@marimo-team/frontend 0.11.7-dev9 → 0.11.8-dev0

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 (149) hide show
  1. package/dist/assets/ConnectedDataExplorerComponent-DQkkN5Gr.js +22 -0
  2. package/dist/assets/VegaLite-ZAz5rS6L.js +11 -0
  3. package/dist/assets/{_baseEach-DRLOG7FR.js → _baseEach-DUeD5zTR.js} +1 -1
  4. package/dist/assets/_baseMap-CX5EnNRi.js +1 -0
  5. package/dist/assets/{_baseUniq-Z6tslDId.js → _baseUniq-DqfT766e.js} +1 -1
  6. package/dist/assets/{any-language-editor-CN-68zq0.js → any-language-editor-lbuX0UPw.js} +1 -1
  7. package/dist/assets/arc-B5qYPUYs.js +1 -0
  8. package/dist/assets/architectureDiagram-UYN6MBPD-BOfi4LJ1.js +1 -0
  9. package/dist/assets/asn1-DWPaVWf6.js +1 -0
  10. package/dist/assets/blockDiagram-ZHA2E4KO-BbvIIluh.js +1 -0
  11. package/dist/assets/{c4Diagram-6F5ED5ID-CSsWcf65.js → c4Diagram-6F5ED5ID-DanOr1cp.js} +1 -1
  12. package/dist/assets/channel-CPm_lY3q.js +1 -0
  13. package/dist/assets/{chunk-5HRBRIJM-i5Phh7bi.js → chunk-5HRBRIJM-D94gNTUX.js} +1 -1
  14. package/dist/assets/chunk-7U56Z5CX-FiyC7_sa.js +1 -0
  15. package/dist/assets/{chunk-ASOPGD6M-Bsu_b9jH.js → chunk-ASOPGD6M-HrCpo6mZ.js} +1 -1
  16. package/dist/assets/{chunk-KFBOBJHC-C9sMPfZc.js → chunk-KFBOBJHC-BQPVo5MB.js} +1 -1
  17. package/dist/assets/chunk-T2TOU4HS-Bi6av-i6.js +1 -0
  18. package/dist/assets/{chunk-TMUBEWPD-yD_WnSdD.js → chunk-TMUBEWPD-BHFuKE0U.js} +1 -1
  19. package/dist/assets/classDiagram-LNE6IOMH-DCGVnwjR.js +1 -0
  20. package/dist/assets/classDiagram-v2-MQ7JQ4JX-DCGVnwjR.js +1 -0
  21. package/dist/assets/{clike-BPCXT8V3.js → clike-D5G9EsPi.js} +1 -1
  22. package/dist/assets/clone-C24bGQt3.js +1 -0
  23. package/dist/assets/{cobol-DbZRNMTs.js → cobol-stawOqaz.js} +1 -1
  24. package/dist/assets/{compile-BgV4bhlK.js → compile-DGP8y3Rj.js} +1 -1
  25. package/dist/assets/createWsUrl-PEWPGcnr.js +1 -0
  26. package/dist/assets/{cytoscape.esm-BOa7ANXG.js → cytoscape.esm-bH-fs5wT.js} +1 -1
  27. package/dist/assets/{dagre-4EVJKHTY-qlyr5wai.js → dagre-4EVJKHTY-sf9jVxJz.js} +1 -1
  28. package/dist/assets/data-editor-BEo0CQUt.js +1 -0
  29. package/dist/assets/diagram-QW4FP2JN-Dfy0iHvT.js +1 -0
  30. package/dist/assets/edit-page-D6R-uYDh.js +8 -0
  31. package/dist/assets/{erDiagram-6RL3IURR-V5QiSeMD.js → erDiagram-6RL3IURR-BVyJYsHn.js} +1 -1
  32. package/dist/assets/flowDiagram-7ASYPVHJ-SJiQkKfb.js +1 -0
  33. package/dist/assets/ganttDiagram-NTVNEXSI-De6GKnkt.js +1 -0
  34. package/dist/assets/{gitGraph-YCYPL57B-CrdOXnVg.js → gitGraph-YCYPL57B-CrR_9duk.js} +1 -1
  35. package/dist/assets/gitGraphDiagram-NRZ2UAAF-DLbVriux.js +1 -0
  36. package/dist/assets/{graph-CuAM9DuN.js → graph-B-2K6lJu.js} +1 -1
  37. package/dist/assets/haxe-D25e-2l-.js +1 -0
  38. package/dist/assets/home-page-0QydCCjx.js +7 -0
  39. package/dist/assets/{index-C4vyzbl_.js → index-B9LA6Azg.js} +1 -1
  40. package/dist/assets/{index-nafBc7vH.js → index-BMsv01QQ.js} +1 -1
  41. package/dist/assets/{index-DWSqZU7l.js → index-BNvpx3v8.js} +1 -1
  42. package/dist/assets/{index-BXs5VcPX.js → index-BSwISWil.js} +1 -1
  43. package/dist/assets/index-Bez6VuzQ.js +1 -0
  44. package/dist/assets/{index-dBf568lL.js → index-C2daI7Ci.js} +1 -1
  45. package/dist/assets/index-C8E3Zaxy.js +1 -0
  46. package/dist/assets/{index-RZIsHI4j.js → index-C97C2yIx.js} +1 -1
  47. package/dist/assets/index-COO_bQKC.js +1 -0
  48. package/dist/assets/{index-BxXkbUY_.js → index-CSmrnYrt.js} +1 -1
  49. package/dist/assets/{index-CBffH0xV.js → index-CZF29Khj.js} +1 -1
  50. package/dist/assets/index-D-5CFiXB.js +1 -0
  51. package/dist/assets/index-D45l02Ho.js +80 -0
  52. package/dist/assets/index-DeRmdSc8.css +1 -0
  53. package/dist/assets/index-F8tWPq10.js +1 -0
  54. package/dist/assets/{index-D_b38AF4.js → index-e0JH-jF6.js} +1 -1
  55. package/dist/assets/{index-eUGIYQ9e.js → index-uLB5VNlQ.js} +1 -1
  56. package/dist/assets/index-zLQKPb5l.js +1 -0
  57. package/dist/assets/{infoDiagram-A4XQUW5V-BQi5KH8U.js → infoDiagram-A4XQUW5V-BlhKsOgb.js} +1 -1
  58. package/dist/assets/javascript-D48wDJXV.js +1 -0
  59. package/dist/assets/{journeyDiagram-G5WM74LC-CYv86MSD.js → journeyDiagram-G5WM74LC-t7Fyh-_F.js} +1 -1
  60. package/dist/assets/{kanban-definition-QRCXZQQD-LxchZzZC.js → kanban-definition-QRCXZQQD-CD2OhWrH.js} +1 -1
  61. package/dist/assets/layout-B2HDqGcm.js +1 -0
  62. package/dist/assets/{linear-DnzJFOVg.js → linear-BusnHbHn.js} +1 -1
  63. package/dist/assets/main-CEaoNRsh.js +1 -0
  64. package/dist/assets/mermaid-C66YP-Kd.js +13 -0
  65. package/dist/assets/min-B-0h7QLg.js +1 -0
  66. package/dist/assets/mindmap-definition-GWI6TPTV-CIL6APVa.js +1 -0
  67. package/dist/assets/{mirc-1Vs7mkDM.js → mirc-DkvFAiy5.js} +1 -1
  68. package/dist/assets/mllike-3c2dg9RT.js +1 -0
  69. package/dist/assets/pieDiagram-YF2LJOPJ-CzYH63wi.js +1 -0
  70. package/dist/assets/{pig-C9krdGUD.js → pig-CwGJVRC4.js} +1 -1
  71. package/dist/assets/{pug-JtgdeyKq.js → pug-_kJOm_E2.js} +1 -1
  72. package/dist/assets/quadrantDiagram-OS5C2QUG--i4UK3y1.js +1 -0
  73. package/dist/assets/react-plotly-DI89xFbq.js +71 -0
  74. package/dist/assets/requirementDiagram-MIRIMTAZ-Ci-MJK0i.js +1 -0
  75. package/dist/assets/{run-page-BpxdWHNP.js → run-page-Bl1ywdZf.js} +1 -1
  76. package/dist/assets/{sankeyDiagram-Y46BX6SQ-2stxT0h5.js → sankeyDiagram-Y46BX6SQ-CzsqZFFj.js} +1 -1
  77. package/dist/assets/{scheme-DlxeS-fJ.js → scheme-qjP0V5Ag.js} +1 -1
  78. package/dist/assets/sequenceDiagram-G6AWOVSC-Cx2OAkav.js +1 -0
  79. package/dist/assets/{slides-component-CpzjtzJd.js → slides-component-w7QeJN8I.js} +1 -1
  80. package/dist/assets/{sortBy-D5PrM5k_.js → sortBy-CvoKlZgK.js} +1 -1
  81. package/dist/assets/sql-B3SPsWL6.js +1 -0
  82. package/dist/assets/stateDiagram-MAYHULR4-CJ81Siz9.js +1 -0
  83. package/dist/assets/stateDiagram-v2-4JROLMXI-4a_hzQfV.js +1 -0
  84. package/dist/assets/{step-CaHXtLdi.js → step-xJWGRC3d.js} +1 -1
  85. package/dist/assets/{tcl-BWtglvHf.js → tcl-B2fODqDH.js} +1 -1
  86. package/dist/assets/terminal-Ce7Lay_e.js +1 -0
  87. package/dist/assets/{time-B-QFhLuD.js → time-CuLsg0Lt.js} +1 -1
  88. package/dist/assets/{timeline-definition-U7ZMHBDA-Cu5fPfiD.js → timeline-definition-U7ZMHBDA-CDXnhLvA.js} +1 -1
  89. package/dist/assets/{transform-D6ULhE8R.js → transform-CdY8z5kT.js} +1 -1
  90. package/dist/assets/tree-DBsEoHUb.js +8 -0
  91. package/dist/assets/ttcn-BxnYHtq8.js +1 -0
  92. package/dist/assets/ttcn-cfg-CKJxb-l2.js +1 -0
  93. package/dist/assets/useMarimoWebSocket-C-KFESxT.js +15 -0
  94. package/dist/assets/{vega-component-530U8AUz.js → vega-component-EuVF39Y2.js} +1 -1
  95. package/dist/assets/velocity-BdD_26Jv.js +1 -0
  96. package/dist/assets/{xychartDiagram-6QU3TZC5-C7CZWV9M.js → xychartDiagram-6QU3TZC5-DJYNEYqu.js} +1 -1
  97. package/dist/index.html +2 -2
  98. package/package.json +4 -4
  99. package/dist/assets/ConnectedDataExplorerComponent-Dw0lgEx7.js +0 -22
  100. package/dist/assets/VegaLite-i28zbrOg.js +0 -11
  101. package/dist/assets/_baseMap-Csmk0lES.js +0 -1
  102. package/dist/assets/arc-BTlVLyGF.js +0 -1
  103. package/dist/assets/architectureDiagram-UYN6MBPD-CLCthGnb.js +0 -1
  104. package/dist/assets/asn1-BhA3SgW2.js +0 -1
  105. package/dist/assets/blockDiagram-ZHA2E4KO-D8VEqjcW.js +0 -1
  106. package/dist/assets/channel-DHzdgD-d.js +0 -1
  107. package/dist/assets/chunk-7U56Z5CX-D088hXP5.js +0 -1
  108. package/dist/assets/chunk-T2TOU4HS-Depm1_8y.js +0 -1
  109. package/dist/assets/classDiagram-LNE6IOMH-K-Wjg4zZ.js +0 -1
  110. package/dist/assets/classDiagram-v2-MQ7JQ4JX-K-Wjg4zZ.js +0 -1
  111. package/dist/assets/clone-C6gbuftv.js +0 -1
  112. package/dist/assets/createWsUrl-BclB4Lh8.js +0 -1
  113. package/dist/assets/data-editor-O7GB1dOJ.js +0 -1
  114. package/dist/assets/diagram-QW4FP2JN-CeEn361s.js +0 -1
  115. package/dist/assets/edit-page-D09PcIbh.js +0 -8
  116. package/dist/assets/flowDiagram-7ASYPVHJ-DswX-o5B.js +0 -1
  117. package/dist/assets/ganttDiagram-NTVNEXSI-O1FeJt3C.js +0 -1
  118. package/dist/assets/gitGraphDiagram-NRZ2UAAF-DqXKCt3x.js +0 -1
  119. package/dist/assets/haxe-75PMBtaN.js +0 -1
  120. package/dist/assets/home-page-D_b-tjJr.js +0 -7
  121. package/dist/assets/index-6w92-PnA.js +0 -1
  122. package/dist/assets/index-BZUrKLLV.js +0 -1
  123. package/dist/assets/index-BhVxrMm_.js +0 -92
  124. package/dist/assets/index-Cex802kZ.js +0 -1
  125. package/dist/assets/index-CmekZQwh.css +0 -1
  126. package/dist/assets/index-DhKR_xS-.js +0 -1
  127. package/dist/assets/index-YvMhMx5m.js +0 -1
  128. package/dist/assets/index-ooJzGCEl.js +0 -1
  129. package/dist/assets/javascript-CLZUXWcY.js +0 -1
  130. package/dist/assets/layout-BVzdLZD3.js +0 -1
  131. package/dist/assets/main-DPWVgc5Y.js +0 -1
  132. package/dist/assets/mermaid-Bic4bmVF.js +0 -13
  133. package/dist/assets/min-Dw7ZDVyc.js +0 -1
  134. package/dist/assets/mindmap-definition-GWI6TPTV-Dgrbeals.js +0 -1
  135. package/dist/assets/mllike-B8DYu8SS.js +0 -1
  136. package/dist/assets/pieDiagram-YF2LJOPJ-DH_aAvgk.js +0 -1
  137. package/dist/assets/quadrantDiagram-OS5C2QUG-Cdx6px7r.js +0 -1
  138. package/dist/assets/react-plotly-ABMk2537.js +0 -71
  139. package/dist/assets/requirementDiagram-MIRIMTAZ-foNUTolX.js +0 -1
  140. package/dist/assets/sequenceDiagram-G6AWOVSC-DsLWeuD6.js +0 -1
  141. package/dist/assets/sql-BP5jFf-w.js +0 -1
  142. package/dist/assets/stateDiagram-MAYHULR4-DTsueJwY.js +0 -1
  143. package/dist/assets/stateDiagram-v2-4JROLMXI-Co4r5BV4.js +0 -1
  144. package/dist/assets/terminal-DCpCpEop.js +0 -1
  145. package/dist/assets/tree-CYy93deY.js +0 -8
  146. package/dist/assets/ttcn-BXRxJEWs.js +0 -1
  147. package/dist/assets/ttcn-cfg-Ce4xWtqN.js +0 -1
  148. package/dist/assets/useMarimoWebSocket-m-9tpiCT.js +0 -15
  149. package/dist/assets/velocity-Bo4HNIcG.js +0 -1
@@ -1,22 +0,0 @@
1
- import{aD as e,g as t,d5 as n,P as r,ex as i,ey as o,ez as a,eA as s,ax as c,dn as l,dG as u,eB as d,G as f,M as p,eC as h,eD as g,eE as m,eF as y,eG as v,eH as b,eI as x,b1 as E,eJ as T,eK as S,d9 as N,J as w,ad as C,$ as A,dh as O,eL as k,ap as M,ac as I,eM as U,az as F,ay as D,R as _,eN as j,ao as P,aw as R}from"./index-BhVxrMm_.js";import{U as $,e as B,V as L}from"./compile-BgV4bhlK.js";import{a as W}from"./VegaLite-i28zbrOg.js";import"./time-B-QFhLuD.js";import"./step-CaHXtLdi.js";import"./linear-DnzJFOVg.js";import"./init-DLRA0X12.js";import"./range-CtcPcB_L.js";import"./ordinal-BcaZTuz9.js";import"./colors-bszWmPJw.js";import"./arc-BTlVLyGF.js";import"./index-6w92-PnA.js";
2
- /**
3
- * @license lucide-react v0.474.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */const H=e("ChartColumnBig",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["rect",{x:"15",y:"5",width:"4",height:"12",rx:"1",key:"q8uenq"}],["rect",{x:"7",y:"8",width:"4",height:"9",rx:"1",key:"sr5ea"}]]),q=e("ListFilter",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),G=e("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);
8
- /*! *****************************************************************************
9
- Copyright (c) Microsoft Corporation. All rights reserved.
10
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
11
- this file except in compliance with the License. You may obtain a copy of the
12
- License at http://www.apache.org/licenses/LICENSE-2.0
13
-
14
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
16
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
17
- MERCHANTABLITY OR NON-INFRINGEMENT.
18
-
19
- See the Apache Version 2.0 License for specific language governing permissions
20
- and limitations under the License.
21
- ***************************************************************************** */
22
- function z(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}var Y,Q;Y={exports:{}},Q=function(){function e(e,t){return null!=t&&e instanceof t}var t,n,r;try{t=Map}catch(s){t=function(){}}try{n=Set}catch(s){n=function(){}}try{r=Promise}catch(s){r=function(){}}function i(o,s,c,l,u){"object"==typeof s&&(c=s.depth,l=s.prototype,u=s.includeNonEnumerable,s=s.circular);var d=[],f=[],p="undefined"!=typeof Buffer;return void 0===s&&(s=!0),void 0===c&&(c=1/0),function o(c,h){if(null===c)return null;if(0===h)return c;var g,m;if("object"!=typeof c)return c;if(e(c,t))g=new t;else if(e(c,n))g=new n;else if(e(c,r))g=new r((function(e,t){c.then((function(t){e(o(t,h-1))}),(function(e){t(o(e,h-1))}))}));else if(i.__isArray(c))g=[];else if(i.__isRegExp(c))g=new RegExp(c.source,a(c)),c.lastIndex&&(g.lastIndex=c.lastIndex);else if(i.__isDate(c))g=new Date(c.getTime());else{if(p&&Buffer.isBuffer(c))return g=Buffer.allocUnsafe?Buffer.allocUnsafe(c.length):new Buffer(c.length),c.copy(g),g;e(c,Error)?g=Object.create(c):void 0===l?(m=Object.getPrototypeOf(c),g=Object.create(m)):(g=Object.create(l),m=l)}if(s){var y=d.indexOf(c);if(-1!=y)return f[y];d.push(c),f.push(g)}for(var v in e(c,t)&&c.forEach((function(e,t){var n=o(t,h-1),r=o(e,h-1);g.set(n,r)})),e(c,n)&&c.forEach((function(e){var t=o(e,h-1);g.add(t)})),c){var b;m&&(b=Object.getOwnPropertyDescriptor(m,v)),b&&null==b.set||(g[v]=o(c[v],h-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(c);for(v=0;v<x.length;v++){var E=x[v];(!(S=Object.getOwnPropertyDescriptor(c,E))||S.enumerable||u)&&(g[E]=o(c[E],h-1),S.enumerable||Object.defineProperty(g,E,{enumerable:!1}))}}if(u){var T=Object.getOwnPropertyNames(c);for(v=0;v<T.length;v++){var S,N=T[v];(S=Object.getOwnPropertyDescriptor(c,N))&&S.enumerable||(g[N]=o(c[N],h-1),Object.defineProperty(g,N,{enumerable:!1}))}}return g}(o,c)}function o(e){return Object.prototype.toString.call(e)}function a(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return i.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},i.__objToStr=o,i.__isDate=function(e){return"object"==typeof e&&"[object Date]"===o(e)},i.__isArray=function(e){return"object"==typeof e&&"[object Array]"===o(e)},i.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===o(e)},i.__getRegExpFlags=a,i}(),Y.exports&&(Y.exports=Q);var V=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n="boolean"==typeof t.cycles&&t.cycles,r=t.cmp&&function(e){return function(t){return function(n,r){var i={key:n,value:t[n]},o={key:r,value:t[r]};return e(i,o)}}}(t.cmp),i=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var o,a;if(Array.isArray(t)){for(a="[",o=0;o<t.length;o++)o&&(a+=","),a+=e(t[o])||"null";return a+"]"}if(null===t)return"null";if(-1!==i.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=i.push(t)-1,c=Object.keys(t).sort(r&&r(t));for(a="",o=0;o<c.length;o++){var l=c[o],u=e(t[l]);u&&(a&&(a+=","),a+=JSON.stringify(l)+":"+u)}return i.splice(s,1),"{"+a+"}"}}(e)};const K=t(V);function J(e,t,n){return e.fields=t||[],e.fname=n,e}function X(e){throw Error(e)}function Z(e){var t,n,r,i=[],o=null,a=0,s=e.length,c="";function l(){i.push(c+e.substring(t,n)),c="",t=n+1}for(e+="",t=n=0;n<s;++n)if("\\"===(r=e[n]))c+=e.substring(t,n),t=++n;else if(r===o)l(),o=null,a=-1;else{if(o)continue;t===a&&'"'===r||t===a&&"'"===r?(t=n+1,o=r):"."!==r||a?"["===r?(n>t&&l(),a=t=n+1):"]"===r&&(a||X("Access path missing open bracket: "+e),a>0&&l(),a=0,t=n+1):n>t?l():t=n+1}return a&&X("Access path missing closing bracket: "+e),o&&X("Access path missing closing quote: "+e),n>t&&(n++,l()),i}const ee=Array.isArray;function te(e){return e===Object(e)}function ne(e){return"string"==typeof e}function re(e){return ee(e)?"["+e.map(re)+"]":te(e)||ne(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}var ie,oe,ae,se=[];function ce(e,t,n){var r=[t].concat([].slice.call(n));console[e](...r)}oe=Z(ie="id"),ae="return _["+oe.map(re).join("][")+"];",J(Function("_",ae),[ie=1===oe.length?oe[0]:ie],ie),J((function(e){return e}),se,"identity"),J((function(){return 0}),se,"zero"),J((function(){return 1}),se,"one"),J((function(){return!0}),se,"true"),J((function(){return!1}),se,"false");function le(e){return"boolean"==typeof e}function ue(e){for(var t={},n=0,r=e.length;n<r;++n)t[e[n]]=!0;return t}Set.prototype.toJSON=function(){return`Set(${[...this].map((e=>K(e))).join(",")})`};const de=K;function fe(e,t){return e.indexOf(t)>-1}const pe=Object.keys;const he="row",ge="column",me="facet",ye="x",ve="y",be="x2",xe="y2",Ee="latitude",Te="longitude",Se="latitude2",Ne="longitude2",we="color",Ce="fill",Ae="stroke",Oe="shape",ke="size",Me="opacity",Ie="fillOpacity",Ue="strokeOpacity",Fe="strokeWidth",De="text",_e="order",je="detail",Pe="key",Re="tooltip",$e="href",Be=Object.assign({},{x:1,y:1,x2:1,y2:1},{longitude:1,longitude2:1,latitude:1,latitude2:1},{color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,size:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1});function Le(e){return"color"===e||"fill"===e||"stroke"===e}const We=Object.assign({},Be,{row:1,column:1,facet:1}),He=pe(We);z(We,["order","detail"]),z(We,["order","detail","row","column","facet"]);const qe=z(Be,["x","y","x2","y2","latitude","longitude","latitude2","longitude2"]),Ge=pe(qe),ze=z(qe,["text","tooltip","href","detail","key","order"]),Ye=Object.assign({},{x:1,y:1},ze);function Qe(e,t){return function(e){switch(e){case we:case Ce:case Ae:case je:case Pe:case Re:case $e:case _e:case Me:case Ie:case Ue:case Fe:case me:case he:case ge:return Ve;case ye:case ve:case Ee:case Te:return Ke;case be:case xe:case Se:case Ne:return{rule:"always",bar:"always",rect:"always",area:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case ke:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Oe:return{point:"always",geoshape:"always"};case De:return{text:"always"}}}(e)[t]}const Ve={area:"always",bar:"always",circle:"always",geoshape:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},Ke=z(Ve,["geoshape"]);function Je(e){switch(e){case ye:case ve:case ke:case Fe:case Me:case Ie:case Ue:case be:case xe:return;case me:case he:case ge:case Oe:case De:case Re:case $e:return"discrete";case we:case Ce:case Ae:return"flexible";case Ee:case Te:case Se:case Ne:case je:case Pe:case _e:return}throw new Error("rangeType not implemented for "+e)}const Xe={orient:1,bandPosition:1,domain:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,values:1,zindex:1},Ze=Object.assign({},Xe,{encoding:1});Object.assign({gridScale:1,scale:1},Xe,{encode:1});const et=pe(Ze),tt={clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1};Object.assign({},tt,{opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,encode:1});const nt=pe(tt);const rt=Object.freeze(Object.defineProperty({__proto__:null,BAR_WITH_POINT_SCALE_AND_RANGESTEP_NULL:"Bar mark should not be used with point scale when rangeStep is null. Please use band scale instead.",CANNOT_FIX_RANGE_STEP_WITH_FIT:'Cannot use a fixed value of "rangeStep" when "autosize" is "fit".',CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN:"custom domain scale cannot be unioned with default field-based domain",CONCAT_CANNOT_SHARE_AXIS:"Axes cannot be shared in concatenated views yet (https://github.com/vega/vega-lite/issues/2415).",FIT_NON_SINGLE:'Autosize "fit" only works for single views and layered views.',INVALID_CHANNEL_FOR_AXIS:"Invalid channel for axis.",INVALID_SPEC:"Invalid spec",LINE_WITH_VARYING_SIZE:"Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.",MORE_THAN_ONE_SORT:"Domains that should be unioned has conflicting sort properties. Sort will be set to true.",NO_FIELDS_NEEDS_AS:'If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.',NO_INIT_SCALE_BINDINGS:"Selections bound to scales cannot be separately initialized.",REPEAT_CANNOT_SHARE_AXIS:"Axes cannot be shared in repeated views yet (https://github.com/vega/vega-lite/issues/2415).",SCALE_BINDINGS_CONTINUOUS:"Scale bindings are currently only supported for scales with unbinned, continuous domains.",UNABLE_TO_MERGE_DOMAINS:"Unable to merge domains",cannotApplySizeToNonOrientedMark:function(e){return`Cannot apply size to non-oriented mark "${e}".`},cannotProjectOnChannelWithoutField:function(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`},cannotStackNonLinearScale:function(e){return`Cannot stack non-linear scale (${e})`},cannotStackRangedMark:function(e){return`Cannot stack "${e}" if there is already "${e}2"`},cannotUseScalePropertyWithNonColor:function(e){return`Cannot use the scale property "${e}" with non-color channel.`},channelRequiredForBinned:function(e){return`Channel ${e} is required for "binned" bin`},columnsNotSupportByRowCol:function(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`},dayReplacedWithDate:function(e){return`Time unit "${e}" is not supported. We are replacing it with ${e.replace("day","date")}.`},differentParse:function(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`},discreteChannelCannotEncode:function(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`},domainRequiredForThresholdScale:function(e){return`Domain for ${e} is required for threshold scale`},domainSortDropped:function(e){return`Dropping sort property ${de(e)} as unioned domains only support boolean or op 'count'.`},droppedDay:function(e){return`Dropping day from datetime ${de(e)} as day cannot be combined with other units.`},droppingColor:function(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has `+(n&&r?"fill and stroke":n?"fill":"stroke")},emptyFieldDef:function(e,t){return`Dropping ${de(e)} from channel "${t}" since it does not contain data field or value.`},encodingOverridden:function(e){return`Layer's shared ${e.join(",")} channel ${1===e.length?"is":"are"} overriden`},errorBand1DNotSupport:function(e){return`1D error band does not support ${e}`},errorBarCenterAndExtentAreNotNeeded:function(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`},errorBarCenterIsNotNeeded:function(e,t){return`Center is not needed to be specified in ${t} when extent is ${e}.`},errorBarCenterIsUsedWithWrongExtent:function(e,t,n){return`${e} is not usually used with ${t} for ${n}.`},errorBarContinuousAxisHasCustomizedAggregate:function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`},facetChannelDropped:function(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`},facetChannelShouldBeDiscrete:function(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`},incompatibleChannel:function(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`},independentScaleMeansIndependentGuide:function(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`},invalidAggregate:function(e){return`Invalid aggregation operator "${e}"`},invalidEncodingChannel:function(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`},invalidFieldType:function(e){return`Invalid field type "${e}"`},invalidFieldTypeForCountAggregate:function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`},invalidTimeUnit:function(e,t){return`Invalid ${e}: ${de(t)}`},invalidTransformIgnored:function(e){return`Ignoring an invalid transform: ${de(e)}.`},latLongDeprecated:function(e,t,n){return`${e}-encoding with type ${t} is deprecated. Replacing with ${n}-encoding.`},lineWithRange:function(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`},mergeConflictingDomainProperty:function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${de(n)} and ${de(r)}). Using the union of the two domains.`},mergeConflictingProperty:function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${de(n)} and ${de(r)}). Using ${de(n)}.`},missingFieldType:function(e,t){return`Missing type for channel "${e}", using "${t}" instead.`},nearestNotSupportForContinuous:function(e){return`The "nearest" transform is not supported for ${e} marks.`},noSuchRepeatedValue:function(e){return`Unknown repeated value "${e}".`},nonZeroScaleUsedWithLengthMark:function(e,t,n){return`A ${n.scaleType?`${n.scaleType} scale`:n.zeroFalse?"scale with zero=false":"scale with custom domain that excludes zero"} is used to encode ${e}'s ${t}. This can be misleading as the ${"x"===t?"width":"height"} of the ${e} can be arbitrary based on the scale domain. You may want to use point mark instead.`},orientOverridden:function(e,t){return`Specified orient "${e}" overridden with "${t}"`},primitiveChannelDef:function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${de(n)}}.`},projectionOverridden:function(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${de(t)} is overridden by a child projection ${de(n)}.`},rangeStepDropped:function(e){return`rangeStep for "${e}" is dropped as top-level ${"x"===e?"width":"height"} is provided.`},scalePropertyNotWorkWithScaleType:function(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`},scaleTypeNotWorkWithChannel:function(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`},scaleTypeNotWorkWithFieldDef:function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`},scaleTypeNotWorkWithMark:function(e,t){return`Scale type "${t}" does not work with mark "${e}".`},selectionNotFound:function(e){return`Cannot find a selection named "${e}"`},selectionNotSupported:function(e){return`Selection not supported for ${e} yet`},stackNonSummativeAggregate:function(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}")`},unaggregateDomainHasNoEffectForRawField:function(e){return`Using unaggregated domain with raw field has no effect (${de(e)}).`},unaggregateDomainWithNonSharedDomainOp:function(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`},unaggregatedDomainWithLogScale:function(e){return`Unaggregated domain is currently unsupported for log scale (${de(e)}).`},unrecognizedParse:function(e){return`Unrecognized parse "${e}".`}},Symbol.toStringTag,{value:"Module"})),it=rt;var ot;let at=(ot=2,{level:function(e){return arguments.length?(ot=+e,this):ot},error:function(){return ot>=1&&ce("error","ERROR",arguments),this},warn:function(){return ot>=2&&ce("warn","WARN",arguments),this},info:function(){return ot>=3&&ce("log","INFO",arguments),this},debug:function(){return ot>=4&&ce("log","DEBUG",arguments),this}});function st(...e){at.warn.apply(at,arguments)}const ct={quantitative:1,ordinal:1,temporal:1,nominal:1,geojson:1},lt="quantitative",ut="ordinal",dt="temporal",ft="nominal";var pt,ht;(ht=pt||(pt={})).LINEAR="linear",ht.LOG="log",ht.POW="pow",ht.SQRT="sqrt",ht.SYMLOG="symlog",ht.TIME="time",ht.UTC="utc",ht.QUANTILE="quantile",ht.QUANTIZE="quantize",ht.THRESHOLD="threshold",ht.BIN_ORDINAL="bin-ordinal",ht.ORDINAL="ordinal",ht.POINT="point",ht.BAND="band";const gt=pe({linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"}),mt=["linear","log","pow","sqrt","symlog","time","utc"],yt=ue(mt),vt=ue(["quantile","quantize","threshold"]),bt=ue(mt.concat(["quantile","quantize","threshold"])),xt=ue(["ordinal","bin-ordinal","point","band"]);function Et(e){return e in xt}function Tt(e){return e in yt}const St={type:1,domain:1,align:1,range:1,rangeStep:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},Nt=pe(St);function wt(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!fe(["point","band","identity"],e);case"bins":return!fe(["point","band","identity","ordinal"],e);case"round":return Tt(e)||"band"===e||"point"===e;case"padding":return Tt(e)||fe(["point","band"],e);case"paddingOuter":case"rangeStep":case"align":return fe(["point","band"],e);case"paddingInner":return"band"===e;case"clamp":return Tt(e);case"nice":return Tt(e)||"quantize"===e||"threshold"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"constant":return"symlog"===e;case"zero":return e in bt&&!fe(["log","time","utc","threshold","quantile"],e)}}function Ct(e,t){switch(t){case"interpolate":case"scheme":return Le(e)?void 0:it.cannotUseScalePropertyWithNonColor(e);case"align":case"type":case"bins":case"domain":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeStep":case"reverse":case"round":case"clamp":case"zero":return}}function At(e,t){return fe([ut,ft],t)?void 0===e||Et(e):t===dt?fe([pt.TIME,pt.UTC,void 0],e):t!==lt||fe([pt.LOG,pt.POW,pt.SQRT,pt.SYMLOG,pt.QUANTILE,pt.QUANTIZE,pt.THRESHOLD,pt.LINEAR,void 0],e)}function Ot(e,t){switch(e){case ye:case ve:return Tt(t)||fe(["band","point"],t);case ke:case Fe:case Me:case Ie:case Ue:return Tt(t)||t in vt||fe(["band","point"],t);case we:case Ce:case Ae:return"band"!==t;case Oe:return"ordinal"===t}return!1}function kt(e,t){return e+"_"+t}z(St,["type","domain","range","rangeStep","scheme"]),function(){const e={};for(const t of He)for(const n of pe(ct))for(const r of gt){const i=kt(t,n);Ot(t,r)&&At(r,n)&&(e[i]=e[i]||[],e[i].push(r))}}();var Mt={exports:{}};!function(){var e=Mt.exports,t="__name__";e.namedfunc=function(e,n){return n[t]=e,n},e.name=function(e){return null==e?null:e[t]},e.identity=function(e){return e},e.true=e.namedfunc("true",(function(){return!0})),e.false=e.namedfunc("false",(function(){return!1})),e.duplicate=function(e){return JSON.parse(JSON.stringify(e))},e.equal=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},e.extend=function(e){for(var t,n,r=1,i=arguments.length;r<i;++r)for(n in t=arguments[r])e[n]=t[n];return e},e.length=function(e){return null!=e&&null!=e.length?e.length:null},e.keys=function(e){var t,n=[];for(t in e)n.push(t);return n},e.vals=function(e){var t,n=[];for(t in e)n.push(e[t]);return n},e.toMap=function(t,n){return(n=e.$(n))?t.reduce((function(e,t){return e[n(t)]=1,e}),{}):t.reduce((function(e,t){return e[t]=1,e}),{})},e.keystr=function(e){var t=e.length;if(!t)return"";for(var n=String(e[0]),r=1;r<t;++r)n+="|"+String(e[r]);return n};var n=Object.prototype.toString;e.isObject=function(e){return e===Object(e)},e.isFunction=function(e){return"[object Function]"===n.call(e)},e.isString=function(e){return"string"==typeof value||"[object String]"===n.call(e)},e.isArray=Array.isArray||function(e){return"[object Array]"===n.call(e)},e.isNumber=function(e){return"number"==typeof e||"[object Number]"===n.call(e)},e.isBoolean=function(e){return!0===e||!1===e||"[object Boolean]"==n.call(e)},e.isDate=function(e){return"[object Date]"===n.call(e)},e.isValid=function(e){return null!=e&&e==e},e.isBuffer="function"==typeof Buffer&&Buffer.isBuffer||e.false,e.number=function(e){return null==e||""===e?null:+e},e.boolean=function(e){return null==e||""===e?null:"false"!==e&&!!e},e.date=function(e,t){var n=t||Date;return null==e||""===e?null:n.parse(e)},e.array=function(t){return null!=t?e.isArray(t)?t:[t]:[]},e.str=function(t){return e.isArray(t)?"["+t.map(e.str)+"]":e.isObject(t)||e.isString(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t};var r=/\[(.*?)\]|[^.\[]+/g;function i(e,t){var n,r="";for(n=0;n<e;++n)r+=t;return r}function o(e,t,n){var r=0,i=e.split(a);return(e=n?(i=i.reverse()).filter((function(e){return(r+=e.length)<=t})).reverse():i.filter((function(e){return(r+=e.length)<=t}))).length?e.join("").trim():i[0].slice(0,t)}e.field=function(e){return String(e).match(r).map((function(e){return"["!==e[0]?e:"'"!==e[1]&&'"'!==e[1]?e.slice(1,-1):e.slice(2,-2).replace(/\\(["'])/g,"$1")}))},e.accessor=function(t){return null==t||e.isFunction(t)?t:e.namedfunc(t,Function("x","return x["+e.field(t).map(e.str).join("][")+"];"))},e.$=e.accessor,e.mutator=function(t){var n;return e.isString(t)&&(n=e.field(t)).length>1?function(e,t){for(var r=0;r<n.length-1;++r)e=e[n[r]];e[n[r]]=t}:function(e,n){e[t]=n}},e.$func=function(t,n){return function(r){r=e.$(r)||e.identity;var i=t+(e.name(r)?"_"+e.name(r):"");return e.namedfunc(i,(function(e){return n(r(e))}))}},e.$valid=e.$func("valid",e.isValid),e.$length=e.$func("length",e.length),e.$in=function(t,n){t=e.$(t);var r=e.isArray(n)?e.toMap(n):n;return function(e){return!!r[t(e)]}},e.comparator=function(t){var n=[];return void 0===t&&(t=[]),t=e.array(t).map((function(t){var r=1;return"-"===t[0]?(r=-1,t=t.slice(1)):"+"===t[0]&&(r=1,t=t.slice(1)),n.push(r),e.accessor(t)})),function(r,i){var o,a,s,c;for(o=0,a=t.length;o<a;++o)if(s=t[o],c=e.cmp(s(r),s(i)))return c*n[o];return 0}},e.cmp=function(e,t){return(e<t||null==e)&&null!=t?-1:(e>t||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t==t?-1:t!=t&&e==e?1:0)},e.numcmp=function(e,t){return e-t},e.stablesort=function(e,t,n){var r=e.reduce((function(e,t,r){return e[n(t)]=r,e}),{});return e.sort((function(e,i){var o=t(e),a=t(i);return o<a?-1:o>a?1:r[n(e)]-r[n(i)]})),e},e.permute=function(e){for(var t,n,r=e.length;r;)n=Math.floor(Math.random()*r--),t=e[r],e[r]=e[n],e[n]=t},e.pad=function(e,t,n,r){r=r||" ";var o=t-e.length;if(o<=0)return e;switch(n){case"left":return i(o,r)+e;case"middle":case"center":return i(Math.floor(o/2),r)+e+i(Math.ceil(o/2),r);default:return e+i(o,r)}},e.truncate=function(e,t,n,r,i){var a=e.length;if(a<=t)return e;i=void 0!==i?String(i):"…";var s=Math.max(0,t-i.length);switch(n){case"left":return i+(r?o(e,s,1):e.slice(a-s));case"middle":case"center":var c=Math.ceil(s/2),l=Math.floor(s/2);return(r?o(e,c):e.slice(0,c))+i+(r?o(e,l,1):e.slice(a-l));default:return(r?o(e,s):e.slice(0,s))+i}};var a=/([\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF])/}();var It=Mt.exports;function Ut(e,t){return-1!==e.indexOf(t)}function Ft(e,t){for(let n=0;n<e.length;n++)if(!t(e[n],n))return!1;return!0}function Dt(e,t,n){if(e.forEach)e.forEach.call(n,t);else for(let r in e)t.call(n,e[r],r,e)}function _t(e,t){let n,r=0;for(n in e)if(t(e[n],n,r++))return!0;return!1}function jt(e){return!!e.parent}const Pt={channel:1,aggregate:1,autoCount:1,bin:1,timeUnit:1,hasFn:1,sort:1,stack:1,field:1,type:1,format:1,scale:1,axis:1,legend:1,value:1},Rt=($t=Pt,Object.keys($t));var $t;const Bt={bin:1,scale:1,sort:1,axis:1,legend:1};function Lt(e){return Bt[e]}const Wt=["maxbins","divide","extent","base","step","steps","minstep"].map((e=>({parent:"bin",child:e}))),Ht=["field","op","order"].map((e=>({parent:"sort",child:e}))),qt=Nt.map((e=>({parent:"scale",child:e}))),Gt=et.map((e=>({parent:"axis",child:e}))),zt=nt.map((e=>({parent:"legend",child:e}))),Yt=[].concat(Wt,Ht,qt,Gt,zt),Qt=["width","height","background","padding","title"];function Vt(e){return jt(e)?e.parent+"."+e.child:e}const Kt=Yt.reduce(((e,t)=>(e[t.parent]=e[t.parent]||[],e[t.parent][t.child]=t,e)),{});function Jt(e,t){return(Kt[e]||{})[t]}function Xt(e){return function(e){return e in Pt}(e)||jt(e)}const Zt=[].concat(Rt,Yt),en=["type","field","bin","timeUnit","aggregate","autoCount","channel","mark","stack","scale","sort","axis","legend"].concat(Wt,qt,Gt,zt,Ht);var tn,nn;(nn=tn||(tn={})).MARK="mark",nn.TRANSFORM="transform",nn.STACK="stack",nn.FORMAT="format",nn.CHANNEL="channel",nn.AGGREGATE="aggregate",nn.AUTOCOUNT="autoCount",nn.BIN="bin",nn.HAS_FN="hasFn",nn.TIMEUNIT="timeUnit",nn.FIELD="field",nn.TYPE="type",nn.SORT="sort",nn.SCALE="scale",nn.AXIS="axis",nn.LEGEND="legend",nn.WIDTH="width",nn.HEIGHT="height",nn.BACKGROUND="background",nn.PADDING="padding",nn.TITLE="title";const rn="area",on="bar",an="line",sn="point",cn="rect",ln="rule",un="text",dn="tick",fn="circle",pn="square";function hn(e){return fe(["line","area","trail"],e)}ue(pe({area:1,bar:1,line:1,point:1,text:1,tick:1,trail:1,rect:1,geoshape:1,rule:1,circle:1,square:1}));["january","february","march","april","may","june","july","august","september","october","november","december"].map((e=>e.substr(0,3)));var gn,mn;["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].map((e=>e.substr(0,3))),(mn=gn||(gn={})).YEAR="year",mn.MONTH="month",mn.DAY="day",mn.DATE="date",mn.HOURS="hours",mn.MINUTES="minutes",mn.SECONDS="seconds",mn.MILLISECONDS="milliseconds",mn.YEARMONTH="yearmonth",mn.YEARMONTHDATE="yearmonthdate",mn.YEARMONTHDATEHOURS="yearmonthdatehours",mn.YEARMONTHDATEHOURSMINUTES="yearmonthdatehoursminutes",mn.YEARMONTHDATEHOURSMINUTESSECONDS="yearmonthdatehoursminutesseconds",mn.MONTHDATE="monthdate",mn.MONTHDATEHOURS="monthdatehours",mn.HOURSMINUTES="hoursminutes",mn.HOURSMINUTESSECONDS="hoursminutesseconds",mn.MINUTESSECONDS="minutesseconds",mn.SECONDSMILLISECONDS="secondsmilliseconds",mn.QUARTER="quarter",mn.YEARQUARTER="yearquarter",mn.QUARTERMONTH="quartermonth",mn.YEARQUARTERMONTH="yearquartermonth",mn.UTCYEAR="utcyear",mn.UTCMONTH="utcmonth",mn.UTCDAY="utcday",mn.UTCDATE="utcdate",mn.UTCHOURS="utchours",mn.UTCMINUTES="utcminutes",mn.UTCSECONDS="utcseconds",mn.UTCMILLISECONDS="utcmilliseconds",mn.UTCYEARMONTH="utcyearmonth",mn.UTCYEARMONTHDATE="utcyearmonthdate",mn.UTCYEARMONTHDATEHOURS="utcyearmonthdatehours",mn.UTCYEARMONTHDATEHOURSMINUTES="utcyearmonthdatehoursminutes",mn.UTCYEARMONTHDATEHOURSMINUTESSECONDS="utcyearmonthdatehoursminutesseconds",mn.UTCMONTHDATE="utcmonthdate",mn.UTCMONTHDATEHOURS="utcmonthdatehours",mn.UTCHOURSMINUTES="utchoursminutes",mn.UTCHOURSMINUTESSECONDS="utchoursminutesseconds",mn.UTCMINUTESSECONDS="utcminutesseconds",mn.UTCSECONDSMILLISECONDS="utcsecondsmilliseconds",mn.UTCQUARTER="utcquarter",mn.UTCYEARQUARTER="utcyearquarter",mn.UTCQUARTERMONTH="utcquartermonth",mn.UTCYEARQUARTERMONTH="utcyearquartermonth";const yn={year:1,quarter:1,month:1,day:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},vn=pe(yn);const bn={utcyear:1,utcquarter:1,utcmonth:1,utcday:1,utcdate:1,utchours:1,utcminutes:1,utcseconds:1,utcmilliseconds:1};const xn={utcyearquarter:1,utcyearquartermonth:1,utcyearmonth:1,utcyearmonthdate:1,utcyearmonthdatehours:1,utcyearmonthdatehoursminutes:1,utcyearmonthdatehoursminutesseconds:1,utcquartermonth:1,utcmonthdate:1,utcmonthdatehours:1,utchoursminutes:1,utchoursminutesseconds:1,utcminutesseconds:1,utcsecondsmilliseconds:1},En=Object.assign({},bn,xn);const Tn=Object.assign({},yn,bn,{yearquarter:1,yearquartermonth:1,yearmonth:1,yearmonthdate:1,yearmonthdatehours:1,yearmonthdatehoursminutes:1,yearmonthdatehoursminutesseconds:1,quartermonth:1,monthdate:1,monthdatehours:1,hoursminutes:1,hoursminutesseconds:1,minutesseconds:1,secondsmilliseconds:1},xn);const Sn={year:"setFullYear",month:"setMonth",date:"setDate",hours:"setHours",minutes:"setMinutes",seconds:"setSeconds",milliseconds:"setMilliseconds",quarter:null,day:null};function Nn(e,t){const n=!!En[e];const r=n?new Date(Date.UTC(1972,0,1,0,0,0,0)):new Date(1972,0,1,0,0,0,0);for(const i of vn)if(Cn(e,i))switch(i){case gn.DAY:throw new Error("Cannot convert to TimeUnits containing 'day'");case gn.QUARTER:{const{getDateMethod:e,setDateMethod:i}=wn("month",n);r[i](3*Math.floor(t[e]()/3));break}default:{const{getDateMethod:e,setDateMethod:o}=wn(i,n);r[o](t[e]())}}return r}function wn(e,t){const n=Sn[e];return{setDateMethod:t?"setUTC"+n.substr(3):n,getDateMethod:"get"+(t?"UTC":"")+n.substr(3)}}function Cn(e,t){const n=e.indexOf(t);return n>-1&&(t!==gn.SECONDS||0===n||"i"!==e.charAt(n-1))}const An="?";function On(e){return kn(e)||function(e){return!(void 0===e||null==e||!e.enum&&!e.name||It.isArray(e))}(e)}function kn(e){return e===An}function Mn(e,t,n){return It.extend({},{name:t,enum:n},e===An?{}:e)}function In(e){let t={},n={};for(const r of e){const e=[0];for(let t=0;t<r.length;t++)r.charAt(t).toUpperCase()===r.charAt(t)&&e.push(t);let i=e.map((e=>r.charAt(e))).join("").toLowerCase();if(n[i])if(e[e.length-1]===r.length-1||(i=e.concat([r.length-1]).map((e=>r.charAt(e))).join("").toLowerCase(),n[i]))for(let o=1;!t[r];o++){let e=i+"_"+o;if(!n[e]){t[r]=e,n[e]=!0;break}}else t[r]=i,n[i]=!0;else t[r]=i,n[i]=!0}return t}const Un={mark:"m",channel:"c",aggregate:"a",autoCount:"#",hasFn:"h",bin:"b",sort:"so",stack:"st",scale:"s",format:"f",axis:"ax",legend:"l",value:"v",timeUnit:"tu",field:"f",type:"t",binProps:{maxbins:"mb",min:"mi",max:"ma",base:"b",step:"s",steps:"ss",minstep:"ms",divide:"d"},sortProps:{field:"f",op:"o",order:"or"},scaleProps:In(Nt),axisProps:In(et),legendProps:In(nt)};function Fn(e){if(jt(e))return Un[e.parent]+"-"+Un[e.parent+"Props"][e.child];if(Un[e])return Un[e];throw new Error("Default name undefined for "+e)}const Dn=[!1,!0],_n={type:[void 0,pt.LOG],domain:[void 0],base:[void 0],exponent:[1,2],constant:[void 0],bins:[void 0],clamp:Dn,nice:Dn,reverse:Dn,round:Dn,zero:Dn,padding:[void 0],paddingInner:[void 0],paddingOuter:[void 0],interpolate:[void 0],range:[void 0],rangeStep:[17,21],scheme:[void 0]},jn={zindex:[1,0],offset:[void 0],orient:[void 0],values:[void 0],bandPosition:[void 0],encoding:[void 0],domain:Dn,domainColor:[void 0],domainDash:[void 0],domainDashOffset:[void 0],domainOpacity:[void 0],domainWidth:[void 0],formatType:[void 0],grid:Dn,gridColor:[void 0],gridDash:[void 0],gridDashOffset:[void 0],gridOpacity:[void 0],gridWidth:[void 0],format:[void 0],labels:Dn,labelAlign:[void 0],labelAngle:[void 0],labelBaseline:[void 0],labelColor:[void 0],labelFlushOffset:[void 0],labelFont:[void 0],labelFontSize:[void 0],labelFontStyle:[void 0],labelFontWeight:[void 0],labelLimit:[void 0],labelOpacity:[void 0],labelSeparation:[void 0],labelOverlap:[void 0],labelPadding:[void 0],labelBound:[void 0],labelFlush:[void 0],maxExtent:[void 0],minExtent:[void 0],position:[void 0],ticks:Dn,tickColor:[void 0],tickCount:[void 0],tickDash:[void 0],tickExtra:[void 0],tickDashOffset:[void 0],tickMinStep:[void 0],tickOffset:[void 0],tickOpacity:[void 0],tickRound:[void 0],tickSize:[void 0],tickWidth:[void 0],title:[void 0],titleAlign:[void 0],titleAnchor:[void 0],titleAngle:[void 0],titleBaseline:[void 0],titleColor:[void 0],titleFont:[void 0],titleFontSize:[void 0],titleFontStyle:[void 0],titleFontWeight:[void 0],titleLimit:[void 0],titleOpacity:[void 0],titlePadding:[void 0],titleX:[void 0],titleY:[void 0]},Pn={mark:[sn,on,an,rn,cn,dn,un],channel:[ye,ve,he,ge,ke,we],aggregate:[void 0,"mean"],autoCount:Dn,bin:Dn,hasFn:Dn,timeUnit:[void 0,gn.YEAR,gn.MONTH,gn.MINUTES,gn.SECONDS],field:[void 0],type:[ft,ut,lt,dt],sort:["ascending","descending"],stack:["zero","normalize","center",null],value:[void 0],format:[void 0],title:[void 0],scale:[!0],axis:Dn,legend:Dn,binProps:{maxbins:[5,10,20],extent:[void 0],base:[10],step:[void 0],steps:[void 0],minstep:[void 0],divide:[[5,2]],binned:[!1],anchor:[void 0],nice:[!0]},sortProps:{field:[void 0],op:["min","mean"],order:["ascending","descending"]},scaleProps:_n,axisProps:jn,legendProps:{orient:["left","right"],format:[void 0],type:[void 0],values:[void 0],zindex:[void 0],clipHeight:[void 0],columnPadding:[void 0],columns:[void 0],cornerRadius:[void 0],direction:[void 0],encoding:[void 0],fillColor:[void 0],formatType:[void 0],gridAlign:[void 0],offset:[void 0],padding:[void 0],rowPadding:[void 0],strokeColor:[void 0],labelAlign:[void 0],labelBaseline:[void 0],labelColor:[void 0],labelFont:[void 0],labelFontSize:[void 0],labelFontStyle:[void 0],labelFontWeight:[void 0],labelLimit:[void 0],labelOffset:[void 0],labelOpacity:[void 0],labelOverlap:[void 0],labelPadding:[void 0],labelSeparation:[void 0],legendX:[void 0],legendY:[void 0],gradientLength:[void 0],gradientOpacity:[void 0],gradientStrokeColor:[void 0],gradientStrokeWidth:[void 0],gradientThickness:[void 0],symbolDash:[void 0],symbolDashOffset:[void 0],symbolFillColor:[void 0],symbolOffset:[void 0],symbolOpacity:[void 0],symbolSize:[void 0],symbolStrokeColor:[void 0],symbolStrokeWidth:[void 0],symbolType:[void 0],tickCount:[void 0],tickMinStep:[void 0],title:[void 0],titleAnchor:[void 0],titleAlign:[void 0],titleBaseline:[void 0],titleColor:[void 0],titleFont:[void 0],titleFontSize:[void 0],titleFontStyle:[void 0],titleFontWeight:[void 0],titleLimit:[void 0],titleOpacity:[void 0],titleOrient:[void 0],titlePadding:[void 0]}};function Rn(e,t,n){if("field"===e||jt(e)&&"sort"===e.parent&&"field"===e.child)return t.fieldNames();let r;if(r=jt(e)?n.enum[e.parent+"Props"][e.child]:n.enum[e],void 0!==r)return r;throw new Error("No default enumValues for "+JSON.stringify(e))}const $n={verbose:!1,defaultSpecConfig:{line:{point:!0},scale:{useUnaggregatedDomain:!0}},propertyPrecedence:en.map(Vt),enum:Pn,numberNominalProportion:.05,numberNominalLimit:40,constraintManuallySpecifiedValue:!1,autoAddCount:!1,hasAppropriateGraphicTypeForMark:!0,omitAggregate:!1,omitAggregatePlotWithDimensionOnlyOnFacet:!0,omitAggregatePlotWithoutDimension:!1,omitBarLineAreaWithOcclusion:!0,omitBarTickWithSize:!0,omitMultipleNonPositionalChannels:!0,omitRaw:!1,omitRawContinuousFieldForAggregatePlot:!0,omitRepeatedField:!0,omitNonPositionalOrFacetOverPositionalChannels:!0,omitTableWithOcclusionIfAutoAddCount:!0,omitVerticalDotPlot:!1,omitInvalidStackSpec:!0,omitNonSumStack:!0,preferredBinAxis:ye,preferredTemporalAxis:ye,preferredOrdinalAxis:ve,preferredNominalAxis:ve,preferredFacet:he,minCardinalityForBin:15,maxCardinalityForCategoricalColor:20,maxCardinalityForFacet:20,maxCardinalityForShape:6,timeUnitShouldHaveVariation:!0,typeMatchesSchemaType:!0,stylize:!0,smallRangeStepForHighCardinalityOrFacet:{maxCardinality:10,rangeStep:12},nominalColorScaleForHighCardinality:{maxCardinality:10,palette:"category20"},xAxisOnTopForHighYCardinalityWithoutColumn:{maxCardinality:30},maxGoodCardinalityForFacet:5,maxGoodCardinalityForColor:7,minPercentUniqueForKey:.8,minCardinalityForKey:50},Bn={argmax:1,argmin:1,average:1,count:1,distinct:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1};const Ln=["count","sum","distinct","valid","missing"];function Wn(e){return le(e)&&(e=function(e,t){return le(e)?{maxbins:qn(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:Object.assign({},e,{maxbins:qn(t)})}(e,void 0)),"bin"+pe(e).map((t=>function(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}(`_${t}_${e[t]}`))).join("")}function Hn(e){return!0===e||function(e){return te(e)}(e)&&!e.binned}function qn(e){switch(e){case he:case ge:case ke:case we:case Ce:case Ae:case Fe:case Me:case Ie:case Ue:case Oe:return 6;default:return 10}}function Gn(e){return!!e&&!!e.condition&&!ee(e.condition)&&zn(e.condition)}function zn(e){return!(!e||!e.field&&"count"!==e.aggregate)}function Yn(e){return zn(e)&&ne(e.field)}function Qn(e,t={}){let n=e.field;const r=t.prefix;let i=t.suffix,o="";if(function(e){return"count"===e.aggregate}(e))n=function(e){return 0===e.indexOf("__")}(s="count")?s:`__${s}`;else{let r;if(!t.nofn)if(function(e){return!!e.op}(e))r=e.op;else{const{bin:s,aggregate:c,timeUnit:l}=e;Hn(s)?(r=Wn(s),i=(t.binSuffix||"")+(t.suffix||"")):c?(a=c)&&a.argmax?(o=`.${n}`,n=`argmax_${c.argmax}`):!function(e){return!!e&&!!e.argmin}(c)?r=String(c):(o=`.${n}`,n=`argmin_${c.argmin}`):l&&(r=String(l))}r&&(n=n?`${r}_${n}`:r)}var a,s;return i&&(n=`${n}_${i}`),r&&(n=`${r}_${n}`),t.forAs?n:t.expr?function(e,t="datum"){return`${t}[${re(Z(e).join("."))}]`}(n,t.expr)+o:function(e){return`${Z(e).map((e=>e.replace(".","\\."))).join("\\.")}`}(n)+o}function Vn(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return!!e.bin;case"temporal":return!1}throw new Error(it.invalidFieldType(e.type))}ue(["mean","average","median","q1","q3","min","max"]);const Kn={compatible:!0};function Jn(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case"row":case"column":case"facet":return function(e){return!Vn(e)}(e)?{compatible:!1,warning:it.facetChannelShouldBeDiscrete(t)}:Kn;case"x":case"y":case"color":case"fill":case"stroke":case"text":case"detail":case"key":case"tooltip":case"href":return Kn;case"longitude":case"longitude2":case"latitude":case"latitude2":return n!==lt?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:Kn;case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"size":case"x2":case"y2":return"nominal"!==n||e.sort?Kn:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case"shape":return fe(["ordinal","nominal","geojson"],e.type)?Kn:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case"order":return"nominal"!==e.type||"sort"in e?Kn:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}throw new Error("channelCompatability not implemented for channel "+t)}function Xn(e,t,n,r){const i=function(e,t,n){switch(t.type){case"nominal":case"ordinal":return Le(e)||"discrete"===Je(e)?("shape"===e&&"ordinal"===t.type&&st(it.discreteChannelCannotEncode(e,"ordinal")),"ordinal"):fe(["x","y"],e)&&fe(["rect","bar","rule"],n)?"band":"point";case"temporal":return Le(e)?"time":"discrete"===Je(e)?(st(it.discreteChannelCannotEncode(e,"temporal")),"ordinal"):"time";case"quantitative":return Le(e)?Hn(t.bin)?"bin-ordinal":"linear":"discrete"===Je(e)?(st(it.discreteChannelCannotEncode(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(it.invalidFieldType(t.type))}(t,n,r),{type:o}=e;return function(e){return!!Ye[e]}(t)?void 0!==o?Ot(t,o)?At(o,n.type)?o:(st(it.scaleTypeNotWorkWithFieldDef(o,i)),i):(st(it.scaleTypeNotWorkWithChannel(t,o,i)),i):i:null}var Zn,er;function tr(e){return e===ut||e===ft||e===Zn.KEY}(er=Zn||(Zn={})).QUANTITATIVE=lt,er.ORDINAL=ut,er.TEMPORAL=dt,er.NOMINAL=ft,er.KEY="key";class nr{constructor(e=null){this.index=e?Object.assign({},e):{}}has(e){return Vt(e)in this.index}get(e){return this.index[Vt(e)]}set(e,t){return this.index[Vt(e)]=t,this}setByKey(e,t){this.index[e]=t}map(e){const t=new nr;for(const n in this.index)t.index[n]=e(this.index[n]);return t}size(){return It.keys(this.index).length}duplicate(){return new nr(this.index)}}function rr(e,t){const n=e&&e[t];return!!n&&(ee(n)?function(e,t){let n=0;for(const[r,i]of e.entries())if(t(i,r,n++))return!0;return!1}(n,(e=>!!e.field)):zn(n)||Gn(n))}const ir={zero:1,center:1,normalize:1};const or=[on,rn,ln,sn,fn,pn,an,un,dn],ar=[on,rn];function sr(e,t,n,r={}){const i=function(e){return e.type}(e)?e.type:e;if(!fe(or,i))return null;const o=function(e){const t=e.x,n=e.y;if(zn(t)&&zn(n))if("quantitative"===t.type&&"quantitative"===n.type){if(t.stack)return"x";if(n.stack)return"y";if(!!t.aggregate!=!!n.aggregate)return t.aggregate?"x":"y"}else{if("quantitative"===t.type)return"x";if("quantitative"===n.type)return"y"}else{if(zn(t)&&"quantitative"===t.type)return"x";if(zn(n)&&"quantitative"===n.type)return"y"}}(t);if(!o)return null;const a=t[o],s=Yn(a)?Qn(a,{}):void 0,c="x"===o?"y":"x",l=t[c],u=Yn(l)?Qn(l,{}):void 0,d=Ge.reduce(((e,n)=>{if("tooltip"!==n&&rr(t,n)){const r=t[n];(ee(r)?r:[r]).forEach((t=>{const r=function(e){return zn(e)?e:Gn(e)?e.condition:void 0}(t);if(r.aggregate)return;const i=Yn(r)?Qn(r,{}):void 0;(!i||i!==u&&i!==s)&&e.push({channel:n,fieldDef:r})}))}return e}),[]);let f;if(void 0!==a.stack?f=le(a.stack)?a.stack?"zero":null:a.stack:d.length>0&&(f=fe(ar,i)?function(...e){for(const t of e)if(void 0!==t)return t}(n,"zero"):n),!f||!ir[f])return null;if(a.scale&&a.scale.type&&a.scale.type!==pt.LINEAR){if(r.disallowNonLinearStack)return null;st(it.cannotStackNonLinearScale(a.scale.type))}return rr(t,o===ye?be:xe)?(void 0!==a.stack&&st(it.cannotStackRangedMark(o)),null):(a.aggregate&&!fe(Ln,a.aggregate)&&st(it.stackNonSummativeAggregate(a.aggregate)),{groupbyChannel:l?c:void 0,fieldChannel:o,impute:hn(i),stackBy:d,offset:f})}function cr(e){if(!function(e){if(On(e.mark))return!1;const t=[tn.STACK,tn.CHANNEL,tn.MARK,tn.FIELD,tn.AGGREGATE,tn.AUTOCOUNT,tn.SCALE,Jt("scale","type"),tn.TYPE],n=It.toMap((i=Zt,o=t,i.filter((function(e){return!Ut(o,e)})))),r=e.encodings.filter((e=>!Nr(e)));var i,o;for(const a of r)if(lr(a,{exclude:n}))return!1;return!0}(e))return null;const t=Ar(e.encodings,{schema:null,wildcardMode:"null"});return sr(e.mark,t,void 0,{disallowNonLinearStack:!0})}function lr(e,t={}){if(!It.isObject(e))return!1;for(const n in e)if(e.hasOwnProperty(n)){if(On(e[n])&&(!t.exclude||!t.exclude[n])||lr(e[n],t))return!0}return!1}function ur(e){return e.map((e=>{return t=e,e=>void 0!==t[e]?t[e]:e;var t}))}function dr(e,t){return On(e)?!kn(e)&&e.enum?An+JSON.stringify(e.enum):An:t?t(e):e}function fr(e,t){return t?t(e):e}const pr=new nr,hr=[].concat(en,Ht,[tn.TRANSFORM,tn.STACK],Qt).reduce(((e,t)=>e.set(t,!0)),new nr),gr={axis:{x:!0,y:!0,row:!0,column:!0},legend:{color:!0,opacity:!0,size:!0,shape:!0},scale:{x:!0,y:!0,color:!0,opacity:!0,row:!0,column:!0,size:!0,shape:!0},sort:{x:!0,y:!0,path:!0,order:!0},stack:{x:!0,y:!0}};function mr(e,t=hr,n=pr){const r=[];let i;if(t.get(tn.MARK)&&r.push(dr(e.mark,n.get(tn.MARK))),e.transform&&e.transform.length>0&&r.push("transform:"+JSON.stringify(e.transform)),t.get(tn.STACK)&&(i=cr(e)),e.encodings){const o=e.encodings.reduce(((e,r)=>{if(!Nr(r)){let o;o=i&&r.channel===i.fieldChannel?yr(Object.assign({},r,{stack:i.offset}),t,n):yr(r,t,n),o&&e.push(o)}return e}),[]).sort().join("|");o&&r.push(o)}for(let o of Qt){const n=o.toString();if(t.get(o)&&e[n]){const t=e[n];r.push(`${n}=${JSON.stringify(t)}`)}}return r.join("|")}function yr(e,t=hr,n=pr){const r=[];if(t.get(tn.CHANNEL)&&r.push(dr(e.channel,n.get(tn.CHANNEL))),Tr(e)){const i=vr(e,t,n);i&&r.push(i)}else Er(e)?r.push(e.value):Sr(e)&&r.push("autocount()");return r.join(":")}function vr(e,t=hr,n=pr){if(t.get(tn.AGGREGATE)&&Nr(e))return"-";const r=function(e,t,n){if(t.get(tn.AGGREGATE)&&e.aggregate&&!On(e.aggregate))return fr(e.aggregate,n.get(tn.AGGREGATE));if(t.get(tn.AGGREGATE)&&wr(e))return fr("count",n.get(tn.AGGREGATE));if(t.get(tn.TIMEUNIT)&&e.timeUnit&&!On(e.timeUnit))return fr(e.timeUnit,n.get(tn.TIMEUNIT));if(t.get(tn.BIN)&&e.bin&&!On(e.bin))return"bin";{let n=null;for(const r of[tn.AGGREGATE,tn.AUTOCOUNT,tn.TIMEUNIT,tn.BIN]){const i=e[r];t.get(r)&&e[r]&&On(i)&&(n=n||{},n[r]=kn(i)?i:i.enum)}return n&&e.hasFn&&(n.hasFn=!0),n}}(e,t,n),i=function(e,t,n){const r=[];if(!It.isBoolean(e.bin)&&!kn(e.bin)){const i=e.bin;for(const e in i){const o=Jt("bin",e);o&&t.get(o)&&void 0!==i[e]&&r.push({key:e,value:dr(i[e],n.get(o))})}r.sort(((e,t)=>e.key.localeCompare(t.key)))}for(const i of[tn.SCALE,tn.SORT,tn.STACK,tn.AXIS,tn.LEGEND])if((On(e.channel)||gr[i][e.channel])&&t.get(i)&&void 0!==e[i]){const o=e[i];if(It.isBoolean(o)||null===o)r.push({key:i+"",value:o||!1});else if(It.isString(o))r.push({key:i+"",value:fr(JSON.stringify(o),n.get(i))});else{let e=[];for(const r in o){const a=Jt(i,r);a&&t.get(a)&&void 0!==o[r]&&e.push({key:r,value:dr(o[r],n.get(a))})}if(e.length>0){const t=e.sort(((e,t)=>e.key.localeCompare(t.key))).reduce(((e,t)=>(e[t.key]=t.value,e)),{});r.push({key:i+"",value:JSON.stringify(t)})}}}return r}(e,t,n);let o;if(Tr(e)){if(o=t.get("field")?dr(e.field,n.get("field")):"...",t.get(tn.TYPE))if(On(e.type))o+=","+dr(e.type,n.get(tn.TYPE));else{o+=","+dr(((e.type||lt)+"").substr(0,1),n.get(tn.TYPE))}o+=i.map((e=>{let t=e.value instanceof Array?"["+e.value+"]":e.value;return","+e.key+"="+t})).join("")}else Sr(e)&&(o="*,q");if(!o)return null;if(r){return(It.isString(r)?r:An+(It.keys(r).length>0?JSON.stringify(r):""))+"("+o+")"}return o}function br(e,t,n){let r=[],i=0;for(let o=0;o<n;o++){let n=e.indexOf(t,i);if(-1===n)break;r.push(e.substring(i,n)),i=n+1}if(r.push(e.substr(i)),r.length!==n+1)for(;r.length!==n+1;)r.push("");return r}var xr;function Er(e){return null!=e&&void 0!==e.value}function Tr(e){return null!=e&&(e.field||"count"===e.aggregate)}function Sr(e){return null!=e&&"autoCount"in e}function Nr(e){return Sr(e)&&!1===e.autoCount}function wr(e){return Sr(e)&&!0===e.autoCount}!function(e){function t(e){const t={};t.field=e[0],t.type=function(e){if(e)switch(e=e.toLowerCase()){case"q":case lt:return"quantitative";case"t":case dt:return"temporal";case"o":case ut:return"ordinal";case"n":case ft:return"nominal";case"geojson":return"geojson"}}(e[1].toUpperCase())||"?";let r=e[2],i=0,o=0;for(;o<r.length;){let e,a=r.indexOf("=",o);if(-1===a)break;{let s=r.substring(o,a);if("{"===r[o+s.length+1]){let t=o+s.length+1;i=n(t,r,"}");const a=r.substring(t,i+1);e=JSON.parse(a),o=i+2}else if("["===r[o+s.length+1]){let t=o+s.length+1,i=n(t,r,"]");const a=r.substring(t,i+1);e=JSON.parse(a),o=i+2}else{let t=o,n=r.indexOf(",",o+s.length);-1===n&&(n=r.length),o=n+1,e=JSON.parse(r.substring(t+s.length+1,n))}Lt(s)?t[s]=e:(t.bin=t.bin||{},t.bin[s]=e)}}return t}function n(e,t,n){for(let r=e;r<t.length;r++)if(t[r]===n)return r}function r(e){const r={};if("?"===e[0]){let i=n(1,e,"}"),o=JSON.parse(e.substring(1,i+1));for(let e in o)It.isArray(o[e])?r[e]={enum:o[e]}:r[e]=o[e];return Object.assign({},r,t(br(e.substring(i+2,e.length-1),",",2)))}{let n=e.substring(0,e.indexOf("(")),r=br(e.substring(n.length+1,e.length-1),",",2);if(ne(i=n)&&Bn[i])return Object.assign({aggregate:n},t(r));if(Tn[n])return Object.assign({timeUnit:n},t(r));if("bin"===n)return Object.assign({bin:{}},t(r))}var i}e.encoding=function(e,n){let i=-1!==n.indexOf("(")?r(n):t(br(n,",",2));return Object.assign({channel:e},i)},e.rawFieldDef=t,e.getClosingIndex=n,e.fn=r}(xr||(xr={}));const Cr=[tn.AGGREGATE,tn.BIN,tn.TIMEUNIT,tn.FIELD,tn.TYPE,tn.SCALE,tn.SORT,tn.AXIS,tn.LEGEND,tn.STACK,tn.FORMAT];function Ar(e,t){let n={};for(const r of e){if(Nr(r))continue;const{channel:e}=r;if(On(e))throw new Error("Cannot convert wildcard channel to a fixed channel");const i=Er(r)?Or(r):kr(r,t);if(null!==i)n[e]=i;else if("null"===t.wildcardMode)return null}return n}function Or(e){const{value:t}=e;return On(t)?null:{value:t}}function kr(e,t={}){const{props:n=Cr,schema:r,wildcardMode:i="skip"}=t;if(Tr(e)){const t={};for(const o of n){let n=e[o];if(On(n)){if("skip"===i)continue;return null}if(void 0!==n){if(!(!gr[o]||gr[o][e.channel]))continue;if(Lt(o)&&It.isObject(n)){n=Object.assign({},n);for(const e in n)if(On(n[e])){if("null"===i)return null;delete n[e]}}if("bin"===o&&!1===n)continue;"type"===o&&"key"===n?t.type="nominal":t[o]=n}if(o===tn.SCALE&&r&&e.type===ut){const n=e.scale,{ordinalDomain:i}=r.fieldSchema(e.field);null!==n&&i&&(t[tn.SCALE]=Object.assign({domain:i},It.isObject(n)?n:{}))}}return t}if(!1===e.autoCount)throw new Error("Cannot convert {autoCount: false} into a field def");return{aggregate:"count",field:"*",type:"quantitative"}}function Mr(e){return Tr(e)?!Ir(e)&&"temporal"!==e.type:Sr(e)}function Ir(e){if(Tr(e)){const t=kr(e,{props:["bin","timeUnit","type"]});return Vn(t)||!!t.timeUnit}return!1}function Ur(e){const t=!0===e.scale||e.scale===An?{}:e.scale||{},{type:n,channel:r,timeUnit:i,bin:o}=e;if(On(t.type)||On(n)||On(r)||On(o))return;if(t.type)return t.type;if("temporal"===n&&On(i))return;if("quantitative"===n&&On(o))return;const a={type:n===Zn.KEY?"nominal":n,timeUnit:i,bin:o};return Xn({type:t.type},r,a,void 0)}var Fr={exports:{}},Dr=new Date,_r=new Date;function jr(e,t,n,r){function i(t){return e(t=new Date(+t)),t}return i.floor=i,i.round=function(n){var r=new Date(+n),i=new Date(n-1);return e(r),e(i),t(i,1),n-r<i-n?r:i},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,i){var o=[];if(n=new Date(n-1),r=new Date(+r),i=null==i?1:Math.floor(i),!(n<r&&i>0))return o;for(t(n,1),e(n),n<r&&o.push(new Date(+n));t(n,i),e(n),n<r;)o.push(new Date(+n));return o},i.filter=function(n){return jr((function(t){for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Dr.setTime(+t),_r.setTime(+r),e(Dr),e(_r),Math.floor(n(Dr,_r))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var Pr=jr((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));Pr.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?jr((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):Pr:null};const Rr=jr((function(e){e.setMilliseconds(0)}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getSeconds()})),$r=jr((function(e){e.setSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()})),Br=jr((function(e){e.setMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()})),Lr=jr((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5}),(function(e){return e.getDate()-1}));function Wr(e){return jr((function(t){t.setHours(0,0,0,0),t.setDate(t.getDate()-(t.getDay()+7-e)%7)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}var Hr=Wr(0),qr=Wr(1),Gr=Wr(2),zr=Wr(3),Yr=Wr(4),Qr=Wr(5),Vr=Wr(6);const Kr=jr((function(e){e.setHours(0,0,0,0),e.setDate(1)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),Jr=jr((function(e){e.setHours(0,0,0,0),e.setMonth(0,1)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()})),Xr=jr((function(e){e.setUTCMilliseconds(0)}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()})),Zr=jr((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()})),ei=jr((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()})),ti=jr((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1}));function ni(e){return jr((function(t){t.setUTCHours(0,0,0,0),t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/6048e5}))}var ri=ni(0),ii=ni(1),oi=ni(2),ai=ni(3),si=ni(4),ci=ni(5),li=ni(6);const ui=jr((function(e){e.setUTCHours(0,0,0,0),e.setUTCDate(1)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),di=jr((function(e){e.setUTCHours(0,0,0,0),e.setUTCMonth(0,1)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));var fi=Pr.range,pi=Rr.range,hi=$r.range,gi=Br.range,mi=Lr.range,yi=Hr.range,vi=qr.range,bi=Gr.range,xi=zr.range,Ei=Yr.range,Ti=Qr.range,Si=Vr.range,Ni=Hr.range,wi=Kr.range,Ci=Jr.range,Ai=Pr,Oi=fi,ki=Xr.range,Mi=Zr.range,Ii=ei.range,Ui=ti.range,Fi=ri.range,Di=ii.range,_i=oi.range,ji=ai.range,Pi=si.range,Ri=ci.range,$i=li.range,Bi=ri.range,Li=ui.range,Wi=di.range;var Hi=n(Object.freeze(Object.defineProperty({__proto__:null,day:Lr,days:mi,friday:Qr,fridays:Ti,hour:Br,hours:gi,interval:jr,millisecond:Pr,milliseconds:fi,minute:$r,minutes:hi,monday:qr,mondays:vi,month:Kr,months:wi,saturday:Vr,saturdays:Si,second:Rr,seconds:pi,sunday:Hr,sundays:yi,thursday:Yr,thursdays:Ei,tuesday:Gr,tuesdays:bi,utcDay:ti,utcDays:Ui,utcFriday:ci,utcFridays:Ri,utcHour:ei,utcHours:Ii,utcMillisecond:Ai,utcMilliseconds:Oi,utcMinute:Zr,utcMinutes:Mi,utcMonday:ii,utcMondays:Di,utcMonth:ui,utcMonths:Li,utcSaturday:li,utcSaturdays:$i,utcSecond:Xr,utcSeconds:ki,utcSunday:ri,utcSundays:Fi,utcThursday:si,utcThursdays:Pi,utcTuesday:oi,utcTuesdays:_i,utcWednesday:ai,utcWednesdays:ji,utcWeek:ri,utcWeeks:Bi,utcYear:di,utcYears:Wi,wednesday:zr,wednesdays:xi,week:Hr,weeks:Ni,year:Jr,years:Ci},Symbol.toStringTag,{value:"Module"}))),qi=new Date,Gi=new Date(0,0,1).setFullYear(0),zi=new Date(Date.UTC(0,0,1)).setUTCFullYear(0);function Yi(e){return qi.setTime(+e),qi}function Qi(e,t,n,r,i,o){var a={type:e,date:t,unit:n};return r?a.step=r:a.minstep=1,null!=i&&(a.min=i),null!=o&&(a.max=o),a}function Vi(e,t,n,r,i,o){return Qi(e,(function(e){return t.offset(n,e)}),(function(e){return t.count(n,e)}),r,i,o)}var Ki=[Vi("second",Hi.second,Gi),Vi("minute",Hi.minute,Gi),Vi("hour",Hi.hour,Gi),Vi("day",Hi.day,Gi,[1,7]),Vi("month",Hi.month,Gi,[1,3,6]),Vi("year",Hi.year,Gi),Qi("seconds",(function(e){return new Date(1970,0,1,0,0,e)}),(function(e){return Yi(e).getSeconds()}),null,0,59),Qi("minutes",(function(e){return new Date(1970,0,1,0,e)}),(function(e){return Yi(e).getMinutes()}),null,0,59),Qi("hours",(function(e){return new Date(1970,0,1,e)}),(function(e){return Yi(e).getHours()}),null,0,23),Qi("weekdays",(function(e){return new Date(1970,0,4+e)}),(function(e){return Yi(e).getDay()}),[1],0,6),Qi("dates",(function(e){return new Date(1970,0,e)}),(function(e){return Yi(e).getDate()}),[1],1,31),Qi("months",(function(e){return new Date(1970,e%12,1)}),(function(e){return Yi(e).getMonth()}),[1],0,11)],Ji=[Vi("second",Hi.utcSecond,zi),Vi("minute",Hi.utcMinute,zi),Vi("hour",Hi.utcHour,zi),Vi("day",Hi.utcDay,zi,[1,7]),Vi("month",Hi.utcMonth,zi,[1,3,6]),Vi("year",Hi.utcYear,zi),Qi("seconds",(function(e){return new Date(Date.UTC(1970,0,1,0,0,e))}),(function(e){return Yi(e).getUTCSeconds()}),null,0,59),Qi("minutes",(function(e){return new Date(Date.UTC(1970,0,1,0,e))}),(function(e){return Yi(e).getUTCMinutes()}),null,0,59),Qi("hours",(function(e){return new Date(Date.UTC(1970,0,1,e))}),(function(e){return Yi(e).getUTCHours()}),null,0,23),Qi("weekdays",(function(e){return new Date(Date.UTC(1970,0,4+e))}),(function(e){return Yi(e).getUTCDay()}),[1],0,6),Qi("dates",(function(e){return new Date(Date.UTC(1970,0,e))}),(function(e){return Yi(e).getUTCDate()}),[1],1,31),Qi("months",(function(e){return new Date(Date.UTC(1970,e%12,1))}),(function(e){return Yi(e).getUTCMonth()}),[1],0,11)],Xi=[[31536e6,5],[7776e6,4],[2592e6,4],[12096e5,3],[6048e5,3],[1728e5,3],[864e5,3],[432e5,2],[216e5,2],[108e5,2],[36e5,2],[18e5,1],[9e5,1],[3e5,1],[6e4,1],[3e4,0],[15e3,0],[5e3,0],[1e3,0]];function Zi(e){var t,n,r={};for(t=0,n=e.length;t<n;++t)r[e[t].type]=e[t];return r.find=function(t,n,r){return function(e,t,n,r){var i,o,a,s=Xi[0];for(i=1,o=Xi.length;i<o;++i)if(t>(s=Xi[i])[0]){if((a=t/s[0])>r)return e[Xi[i-1][1]];if(a>=n)return e[s[1]]}return e[Xi[o-1][1]]}(e,t,n,r)},r}Fr.exports=Zi(Ki),Fr.exports.utc=Zi(Ji);var eo=Fr.exports,to=It,no=eo;function ro(e){if(!e)throw Error("Missing binning options.");var t,n,r,i,o,a,s,c=e.maxbins||15,l=e.base||10,u=Math.log(l),d=e.div||[5,2],f=e.min,p=e.max,h=p-f;if(e.step)t=e.step;else if(e.steps)t=e.steps[Math.min(e.steps.length-1,function(e,t,n,r){for(;n<r;){var i=n+r>>>1;to.cmp(e[i],t)<0?n=i+1:r=i}return n}(e.steps,h/c,0,e.steps.length))];else{for(n=Math.ceil(Math.log(c)/u),r=e.minstep||0,t=Math.max(r,Math.pow(l,Math.round(Math.log(h)/u)-n));Math.ceil(h/t)>c;)t*=l;for(a=0;a<d.length;++a)(o=t/d[a])>=r&&h/o<=c&&(t=o)}return i=(o=Math.log(t))>=0?0:1+~~(-o/u),s=Math.pow(l,-i-1),{start:f=Math.min(f,Math.floor(f/t+s)*t),stop:p=Math.ceil(p/t)*t,step:t,unit:{precision:i},value:io,index:oo}}function io(e){return this.step*Math.floor(e/this.step+1e-15)}function oo(e){return Math.floor((e-this.start)/this.step+1e-15)}function ao(e){return this.unit.date(io.call(this,e))}function so(e){return oo.call(this,this.unit.unit(e))}ro.date=function(e){if(!e)throw Error("Missing date binning options.");var t=e.utc?no.utc:no,n=e.min,r=e.max,i=e.maxbins||20,o=e.minbins||4,a=+r-+n,s=e.unit?t[e.unit]:t.find(a,o,i),c=ro({min:null!=s.min?s.min:s.unit(n),max:null!=s.max?s.max:s.unit(r),maxbins:i,minstep:s.minstep,steps:s.step});return c.unit=s,c.index=so,e.raw||(c.value=ao),c};const co=t(ro);var lo=It,uo="__types__",fo={boolean:lo.boolean,integer:lo.number,number:lo.number,date:lo.date,string:function(e){return null==e||""===e?null:e+""}},po={boolean:function(e){return"true"===e||"false"===e||lo.isBoolean(e)},integer:function(e){return po.number(e)&&(e=+e)==~~e},number:function(e){return!isNaN(+e)&&!lo.isDate(e)},date:function(e){return!isNaN(Date.parse(e))}};function ho(e){return lo.keys(e)}function go(e){return"["+e+"]"}function mo(e,t){var n,r,i;if(e=lo.array(e),t=lo.$(t),e[uo]&&(n=t(e[uo]),lo.isString(n)))return n;for(r=0,i=e.length;!lo.isValid(n)&&r<i;++r)n=t?t(e[r]):e[r];return lo.isDate(n)?"date":lo.isNumber(n)?"number":lo.isBoolean(n)?"boolean":lo.isString(n)?"string":null}function yo(e,t){var n,r,i;e=lo.array(e),t=lo.$(t);var o=["boolean","integer","number","date"];for(n=0;n<e.length;++n){for(i=t?t(e[n]):e[n],r=0;r<o.length;++r)lo.isValid(i)&&!po[o[r]](i)&&(o.splice(r,1),r-=1);if(0===o.length)return"string"}return o[0]}mo.annotation=function(e,t){if(!t)return e&&e[uo]||null;e[uo]=t},mo.all=function(e,t){if(e.length){var n=t?lo.identity:(t=ho(e[0]),go);return t.reduce((function(t,r){return t[r]=mo(e,n(r)),t}),{})}},mo.infer=yo,mo.inferAll=function(e,t){var n=t?lo.identity:(t=ho(e[0]),go);return t.reduce((function(t,r){return t[r]=yo(e,n(r)),t}),{})},mo.parsers=fo;var vo,bo,xo=mo,Eo={exports:{}},To={exports:{}};vo=It,(bo=To.exports).repeat=function(e,t){var n,r=Array(t);for(n=0;n<t;++n)r[n]=e;return r},bo.zeros=function(e){return bo.repeat(0,e)},bo.range=function(e,t,n){if(arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0)),(t-e)/n==1/0)throw new Error("Infinite range");var r,i=[],o=-1;if(n<0)for(;(r=e+n*++o)>t;)i.push(r);else for(;(r=e+n*++o)<t;)i.push(r);return i},bo.random={},bo.random.uniform=function(e,t){void 0===t&&(t=void 0===e?1:e,e=0);var n=t-e,r=function(){return e+n*Math.random()};return r.samples=function(e){return bo.zeros(e).map(r)},r.pdf=function(r){return r>=e&&r<=t?1/n:0},r.cdf=function(r){return r<e?0:r>t?1:(r-e)/n},r.icdf=function(t){return t>=0&&t<=1?e+t*n:NaN},r},bo.random.integer=function(e,t){void 0===t&&(t=e,e=0);var n=t-e,r=function(){return e+Math.floor(n*Math.random())};return r.samples=function(e){return bo.zeros(e).map(r)},r.pdf=function(r){return r===Math.floor(r)&&r>=e&&r<t?1/n:0},r.cdf=function(r){var i=Math.floor(r);return i<e?0:i>=t?1:(i-e+1)/n},r.icdf=function(t){return t>=0&&t<=1?e-1+Math.floor(t*n):NaN},r},bo.random.normal=function(e,t){var n;e=e||0,t=t||1;var r=function(){var r,i,o=0,a=0;if(void 0!==n)return o=n,n=void 0,o;do{r=(o=2*Math.random()-1)*o+(a=2*Math.random()-1)*a}while(0===r||r>1);return i=Math.sqrt(-2*Math.log(r)/r),n=e+a*i*t,e+o*i*t};return r.samples=function(e){return bo.zeros(e).map(r)},r.pdf=function(n){var r=Math.exp(Math.pow(n-e,2)/(-2*Math.pow(t,2)));return 1/(t*Math.sqrt(2*Math.PI))*r},r.cdf=function(n){var r,i=(n-e)/t,o=Math.abs(i);if(o>37)r=0;else{var a=Math.exp(-o*o/2);o<7.07106781186547?(r=a*((((((.0352624965998911*o+.700383064443688)*o+6.37396220353165)*o+33.912866078383)*o+112.079291497871)*o+221.213596169931)*o+220.206867912376),r/=((((((.0883883476483184*o+1.75566716318264)*o+16.064177579207)*o+86.7807322029461)*o+296.564248779674)*o+637.333633378831)*o+793.826512519948)*o+440.413735824752):r=a/(o+1/(o+2/(o+3/(o+4/(o+.65)))))/2.506628274631}return i>0?1-r:r},r.icdf=function(n){if(n<=0||n>=1)return NaN;var r=2*n-1,i=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),o=2/(Math.PI*i)+Math.log(1-Math.pow(r,2))/2,a=Math.log(1-r*r)/i,s=(r>0?1:-1)*Math.sqrt(Math.sqrt(o*o-a)-o);return e+t*Math.SQRT2*s},r},bo.random.bootstrap=function(e,t){var n=e.filter(vo.isValid),r=n.length,i=t?bo.random.normal(0,t):null,o=function(){return n[~~(Math.random()*r)]+(i?i():0)};return o.samples=function(e){return bo.zeros(e).map(o)},o};var So=To.exports;!function(){var e=It,t=xo,n=So,r=Eo.exports;function i(e,t,i){var o=e&&e.nullh||0,a=n.random.normal(0,1),s=r.mean(t,i),c=r.stdev(t,i)/Math.sqrt(r.count.valid(t,i));if(0===c)return s-o==0?1:0;var l=(s-o)/c;return 2*a.cdf(-Math.abs(l))}function o(t,n,i,o){var a,s=o?n.map(e.$(i)):n,c=o?n.map(e.$(o)):i,l=r.count(s),u=r.count(c),d=Array();if(l!==u)throw Error("Array lengths must match.");for(a=0;a<l;++a)e.isValid(s[a])&&e.isValid(c[a])&&d.push(s[a]-c[a]);return r.z.test(d,t&&t.nullh||0)}function a(t,i,o,a){var s=a?i.map(e.$(o)):i,c=a?i.map(e.$(a)):o,l=r.count.valid(s),u=r.count.valid(c),d=n.random.normal(0,1),f=r.mean(s)-r.mean(c)-(t&&t.nullh||0),p=Math.sqrt(r.variance(s)/l+r.variance(c)/u);if(0===p)return 0===f?1:0;var h=f/p;return 2*d.cdf(-Math.abs(h))}r.unique=function(t,n,r){n=e.$(n),r=r||[];var i,o,a,s={};for(o=0,a=t.length;o<a;++o)(i=n?n(t[o]):t[o])in s||(s[i]=1,r.push(i));return r},r.count=function(e){return e&&e.length||0},r.count.valid=function(t,n){n=e.$(n);var r,i,o,a=0;for(i=0,o=t.length;i<o;++i)r=n?n(t[i]):t[i],e.isValid(r)&&(a+=1);return a},r.count.missing=function(t,n){n=e.$(n);var r,i,o=0;for(r=0,i=t.length;r<i;++r)null==(n?n(t[r]):t[r])&&(o+=1);return o},r.count.distinct=function(t,n){n=e.$(n);var r,i,o,a={},s=0;for(i=0,o=t.length;i<o;++i)(r=n?n(t[i]):t[i])in a||(a[r]=1,s+=1);return s},r.count.map=function(t,n){n=e.$(n);var r,i,o,a={};for(i=0,o=t.length;i<o;++i)a[r=n?n(t[i]):t[i]]=r in a?a[r]+1:1;return a},r.median=function(t,n){return n&&(t=t.map(e.$(n))),t=t.filter(e.isValid).sort(e.cmp),r.quantile(t,.5)},r.quartile=function(t,n){n&&(t=t.map(e.$(n))),t=t.filter(e.isValid).sort(e.cmp);var i=r.quantile;return[i(t,.25),i(t,.5),i(t,.75)]},r.quantile=function(t,n,r){void 0===r&&(r=n,n=e.identity),n=e.$(n);var i=(t.length-1)*r+1,o=Math.floor(i),a=+n(t[o-1]),s=i-o;return s?a+s*(n(t[o])-a):a},r.sum=function(t,n){n=e.$(n);for(var r,i=0,o=0,a=t.length;o<a;++o)r=n?n(t[o]):t[o],e.isValid(r)&&(i+=r);return i},r.mean=function(t,n){n=e.$(n);var r,i,o,a,s=0;for(r=0,o=0,i=t.length;r<i;++r)a=n?n(t[r]):t[r],e.isValid(a)&&(s+=(a-s)/++o);return s},r.mean.geometric=function(t,n){n=e.$(n);var r,i,o,a,s=1;for(a=0,r=0,i=t.length;a<i;++a)if(o=n?n(t[a]):t[a],e.isValid(o)){if(o<=0)throw Error("Geometric mean only defined for positive values.");s*=o,++r}return s=r>0?Math.pow(s,1/r):0},r.mean.harmonic=function(t,n){n=e.$(n);var r,i,o,a,s=0;for(a=0,r=0,i=t.length;a<i;++a)o=n?n(t[a]):t[a],e.isValid(o)&&(s+=1/o,++r);return r/s},r.variance=function(t,n){if(n=e.$(n),!e.isArray(t)||t.length<2)return 0;var r,i,o,a,s=0,c=0;for(i=0,o=0;i<t.length;++i)a=n?n(t[i]):t[i],e.isValid(a)&&(c+=(r=a-s)*(a-(s+=r/++o)));return c/=o-1},r.stdev=function(e,t){return Math.sqrt(r.variance(e,t))},r.modeskew=function(e,t){var n=r.mean(e,t),i=r.median(e,t),o=r.stdev(e,t);return 0===o?0:(n-i)/o},r.min=function(e,t){return r.extent(e,t)[0]},r.max=function(e,t){return r.extent(e,t)[1]},r.extent=function(t,n){n=e.$(n);var r,i,o,a,s=t.length;for(a=0;a<s;++a)if(o=n?n(t[a]):t[a],e.isValid(o)){r=i=o;break}for(;a<s;++a)o=n?n(t[a]):t[a],e.isValid(o)&&(o<r&&(r=o),o>i&&(i=o));return[r,i]},r.extent.index=function(t,n){n=e.$(n);var r,i,o,a,s=-1,c=-1,l=t.length;for(a=0;a<l;++a)if(o=n?n(t[a]):t[a],e.isValid(o)){r=i=o,s=c=a;break}for(;a<l;++a)o=n?n(t[a]):t[a],e.isValid(o)&&(o<r&&(r=o,s=a),o>i&&(i=o,c=a));return[s,c]},r.dot=function(t,n,r){var i,o,a=0;if(r)for(n=e.$(n),r=e.$(r),i=0;i<t.length;++i)(o=n(t[i])*r(t[i]))==o&&(a+=o);else{if(t.length!==n.length)throw Error("Array lengths must match.");for(i=0;i<t.length;++i)(o=t[i]*n[i])==o&&(a+=o)}return a},r.dist=function(t,n,r,i){var o,a,s=e.isFunction(r)||e.isString(r),c=t,l=s?t:n,u=s?i:r,d=2===u||null==u,f=t.length,p=0;for(s&&(n=e.$(n),r=e.$(r)),a=0;a<f;++a)o=s?n(c[a])-r(l[a]):c[a]-l[a],p+=d?o*o:Math.pow(Math.abs(o),u);return d?Math.sqrt(p):Math.pow(p,1/u)},r.cohensd=function(t,n,i){var o=i?t.map(e.$(n)):t,a=i?t.map(e.$(i)):n,s=r.mean(o),c=r.mean(a),l=r.count.valid(o),u=r.count.valid(a);if(l+u-2<=0)return 0;var d=r.variance(o),f=r.variance(a),p=Math.sqrt(((l-1)*d+(u-1)*f)/(l+u-2));return 0===p?0:(s-c)/p},r.covariance=function(t,n,i){var o,a,s,c,l,u=i?t.map(e.$(n)):t,d=i?t.map(e.$(i)):n,f=u.length,p=r.mean(u),h=r.mean(d),g=0,m=0;if(f!==d.length)throw Error("Input lengths must match.");for(o=0;o<f;++o)if(a=u[o],c=e.isValid(a),s=d[o],l=e.isValid(s),c&&l)g+=(a-p)*(s-h),++m;else if(c||l)throw Error("Valid values must align.");return g/(m-1)},r.rank=function(t,n){n=e.$(n)||e.identity;var r,i,o,a=t.map((function(e,t){return{idx:t,val:n(e)}})).sort(e.comparator("val")),s=t.length,c=Array(s),l=-1,u={};for(r=0;r<s;++r){if(i=a[r].val,l<0&&u===i)l=r-1;else if(l>-1&&u!==i){for(o=1+(r-1+l)/2;l<r;++l)c[a[l].idx]=o;l=-1}c[a[r].idx]=r+1,u=i}if(l>-1)for(o=1+(s-1+l)/2;l<s;++l)c[a[l].idx]=o;return c},r.cor=function(t,n,i){var o=i;i=o?t.map(e.$(i)):n,n=o?t.map(e.$(n)):t;var a=r.dot(n,i),s=r.mean(n),c=r.mean(i),l=r.stdev(n),u=r.stdev(i),d=t.length;return(a-d*s*c)/((d-1)*l*u)},r.cor.rank=function(e,t,n){var i,o,a,s=n?r.rank(e,t):r.rank(e),c=n?r.rank(e,n):r.rank(t),l=e.length;for(i=0,o=0;i<l;++i)o+=(a=s[i]-c[i])*a;return 1-6*o/(l*(l*l-1))},r.cor.dist=function(t,n,i){var o,a,s,c,l=i?t.map(e.$(n)):t,u=i?t.map(e.$(i)):n,d=r.dist.mat(l),f=r.dist.mat(u),p=d.length;for(o=0,a=0,s=0,c=0;o<p;++o)a+=d[o]*d[o],s+=f[o]*f[o],c+=d[o]*f[o];return Math.sqrt(c/Math.sqrt(a*s))},r.linearRegression=function(t,n,i){var o,a,s=i?t.map(e.$(n)):t,c=i?t.map(e.$(i)):n,l=s.length,u=r.covariance(s,c),d=r.stdev(s),f=r.stdev(c),p=u/(d*d),h=r.mean(c)-p*r.mean(s),g={slope:p,intercept:h,R:u/(d*f),rss:0};for(a=0;a<l;++a)e.isValid(s[a])&&e.isValid(c[a])&&(o=p*s[a]+h-c[a],g.rss+=o*o);return g},r.bootstrap={},r.bootstrap.ci=function(t,i,o,a,s){var c,l,u,d,f,p,h;for(e.isFunction(i)||e.isString(i)?(c=t.map(e.$(i)),l=o,u=a,d=s):(c=t,l=i,u=o,d=a),l=l?+l:1e3,u=u||.05,f=n.random.bootstrap(c,d),h=0,p=Array(l);h<l;++h)p[h]=r.mean(f.samples(c.length));return p.sort(e.numcmp),[r.quantile(p,u/2),r.quantile(p,1-u/2)]},r.z={},r.z.ci=function(t,i,o){var a=t,s=i;(e.isFunction(i)||e.isString(i))&&(a=t.map(e.$(i)),s=o);var c=.05===(s=s||.05)?1.96:n.random.normal(0,1).icdf(1-s/2),l=r.mean(a),u=r.stdev(a)/Math.sqrt(r.count.valid(a));return[l-c*u,l+c*u]},r.z.test=function(t,n,r,s){return e.isFunction(r)||e.isString(r)?(s&&s.paired?o:a)(s,t,n,r):e.isArray(n)?(r&&r.paired?o:a)(r,t,n):e.isFunction(n)||e.isString(n)?i(r,t,n):i(n,t)},r.dist.mat=function(e){var t,r,i,o=e.length,a=o*o,s=Array(a),c=n.zeros(o),l=0;for(r=0;r<o;++r)for(s[r*o+r]=0,i=r+1;i<o;++i)s[r*o+i]=t=Math.abs(e[r]-e[i]),s[i*o+r]=t,c[r]+=t,c[i]+=t;for(r=0;r<o;++r)l+=c[r],c[r]/=o;for(l/=a,r=0;r<o;++r)for(i=r;i<o;++i)s[r*o+i]+=l-c[r]-c[i],s[i*o+r]=s[r*o+i];return s},r.entropy=function(t,n){n=e.$(n);var r,i,o=0,a=0,s=t.length;for(r=0;r<s;++r)o+=n?n(t[r]):t[r];if(0===o)return 0;for(r=0;r<s;++r)(i=(n?n(t[r]):t[r])/o)&&(a+=i*Math.log(i));return-a/Math.LN2},r.mutual=function(t,n,r,i){var o,a,s,c=i?t.map(e.$(n)):t,l=i?t.map(e.$(r)):n,u=i?t.map(e.$(i)):r,d={},f={},p=u.length,h=0,g=0,m=0;for(s=0;s<p;++s)d[c[s]]=0,f[l[s]]=0;for(s=0;s<p;++s)d[c[s]]+=u[s],f[l[s]]+=u[s],h+=u[s];for(a=1/(h*Math.LN2),s=0;s<p;++s)0!==u[s]&&(o=h*u[s]/(d[c[s]]*f[l[s]]),g+=u[s]*a*Math.log(o),m+=u[s]*a*Math.log(u[s]/h));return[g,1+g/m]},r.mutual.info=function(e,t,n,i){return r.mutual(e,t,n,i)[0]},r.mutual.dist=function(e,t,n,i){return r.mutual(e,t,n,i)[1]},r.profile=function(n,i){var o,a,s,c,l,u=0,d=0,f=0,p=0,h=null,g=null,m=0,y=[],v={};for(s=0;s<n.length;++s)v[c=i?i(n[s]):n[s]]=c in v?v[c]+1:(p+=1,1),null==c?++f:e.isValid(c)&&(l="string"==typeof c?c.length:c,(null===h||l<h)&&(h=l),(null===g||l>g)&&(g=l),m+=(o=l-u)*(l-(u+=o/++d)),y.push(l));return m/=d-1,a=Math.sqrt(m),y.sort(e.cmp),{type:t(n,i),unique:v,count:n.length,valid:d,missing:f,distinct:p,min:h,max:g,mean:u,stdev:a,median:c=r.quantile(y,.5),q1:r.quantile(y,.25),q3:r.quantile(y,.75),modeskew:0===a?0:(u-c)/a}},r.summary=function(t,n){var i=(n=n||e.keys(t[0])).map((function(n){var i=r.profile(t,e.$(n));return i.field=n,i}));return i.__summary__=!0,i}}();var No=Eo.exports;const wo=co;const Co={nominal:0,key:1,ordinal:2,temporal:3,quantitative:4};class Ao{constructor(e){this._tableSchema=e,e.fields.sort((function(e,t){return Co[e.vlType]<Co[t.vlType]?-1:Co[e.vlType]>Co[t.vlType]?1:e.name.localeCompare(t.name)})),e.fields.forEach(((e,t)=>e.index=t)),this._fieldSchemaIndex=e.fields.reduce(((e,t)=>(e[t.name]=t,e)),{})}fieldNames(){return this._tableSchema.fields.map((e=>e.name))}get fieldSchemas(){return this._tableSchema.fields}fieldSchema(e){return this._fieldSchemaIndex[e]}tableSchema(){const e=It.duplicate(this._tableSchema);return e.fields.sort(((e,t)=>e.originalIndex-t.originalIndex)),e}primitiveType(e){return this._fieldSchemaIndex[e]?this._fieldSchemaIndex[e].type:null}vlType(e){return this._fieldSchemaIndex[e]?this._fieldSchemaIndex[e].vlType:null}cardinality(e,t=!0,n=!1){const r=this._fieldSchemaIndex[e.field];if(e.aggregate||Sr(e)&&e.autoCount)return 1;if(e.bin){let t;t="boolean"==typeof e.bin?{maxbins:qn(e.channel)}:"?"===e.bin?{enum:[!0,!1]}:e.bin;const n=t.maxbins;return r.binStats[n]||(r.binStats[n]=Oo(n,r.stats)),r.binStats[n].distinct}if(e.timeUnit){if(t)switch(e.timeUnit){case gn.SECONDS:case gn.MINUTES:return 60;case gn.HOURS:return 24;case gn.DAY:return 7;case gn.DATE:return 31;case gn.MONTH:return 12;case gn.QUARTER:return 4;case gn.MILLISECONDS:return 1e3}let i=e.timeUnit,o=r.timeStats;return o&&o[i]||(o=Object.assign({},o,{[i]:ko(e.timeUnit,r.stats)})),n?o[i].distinct-Mo(o[i].unique,["Invalid Date",null]):o[i].distinct}return r?n?r.stats.distinct-Mo(r.stats.unique,[NaN,null]):r.stats.distinct:null}timeUnitHasVariation(e){if(!e.timeUnit)return;if(e.timeUnit===gn.DAY){const t=It.extend({},e,{timeUnit:gn.DATE});if(this.cardinality(t,!1,!0)<=1)return!1}let t=e.timeUnit;for(let n of vn)if(Cn(t,n)){const t=It.extend({},e,{timeUnit:n});if(this.cardinality(t,!1,!0)<=1)return!1}return!0}domain(e){const t=this._fieldSchemaIndex[e.field];let n=It.keys(t.stats.unique);return t.vlType===lt?[+t.stats.min,+t.stats.max]:t.type===Io.DATETIME?[t.stats.min,t.stats.max]:t.type===Io.INTEGER||t.type===Io.NUMBER?(n=n.map((e=>+e)),n.sort(It.cmp)):t.vlType===ut&&t.ordinalDomain?t.ordinalDomain:n.map((e=>"null"===e?null:e)).sort(It.cmp)}stats(e){const t=this._fieldSchemaIndex[e.field];return t?t.stats:null}}function Oo(e,t){const n=wo({min:t.min,max:t.max,maxbins:e}),r=It.extend({},t);return r.unique=function(e,t){const n={};for(let r in t){let i;i=null===r?null:isNaN(Number(r))?NaN:e.value(Number(r)),n[i]=(n[i]||0)+t[r]}return n}(n,t.unique),r.distinct=(n.stop-n.start)/n.step,r.min=n.start,r.max=n.stop,r}function ko(e,t){const n=It.extend({},t);let r={};return It.keys(t.unique).forEach((function(n){let i,o="null"===n?null:new Date(n);i=null===o?null:isNaN(o.getTime())?"Invalid Date":(e===gn.DAY?o.getDay():Nn(e,o)).toString(),r[i]=(r[i]||0)+t.unique[n]})),n.unique=r,n.distinct=It.keys(r).length,n}function Mo(e,t){return t.reduce((function(t,n){return e[n]?t+1:t}),0)}var Io,Uo;(Uo=Io||(Io={}))[Uo.STRING="string"]="STRING",Uo[Uo.NUMBER="number"]="NUMBER",Uo[Uo.INTEGER="integer"]="INTEGER",Uo[Uo.BOOLEAN="boolean"]="BOOLEAN",Uo[Uo.DATETIME="datetime"]="DATETIME";class Fo{constructor(e){this.constraint=e}name(){return this.constraint.name}description(){return this.constraint.description}properties(){return this.constraint.properties}strict(){return this.constraint.strict}}class Do extends Fo{constructor(e){super(e)}hasAllRequiredPropertiesSpecific(e){return Ft(this.constraint.properties,(t=>{if(jt(t)){let n=t.parent,r=t.child;return!e[n]||!On(e[n][r])}return!e[t]||!On(e[t])}))}satisfy(e,t,n,r){return!this.constraint.allowWildcardForProperties&&!this.hasAllRequiredPropertiesSpecific(e)||this.constraint.satisfy(e,t,n,r)}}const _o=[{name:"aggregateOpSupportedByType",description:"Aggregate function should be supported by data type.",properties:[tn.TYPE,tn.AGGREGATE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>!e.aggregate||!tr(e.type)},{name:"asteriskFieldWithCountOnly",description:'Field="*" should be disallowed except aggregate="count"',properties:[tn.FIELD,tn.AGGREGATE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>"*"===e.field==("count"===e.aggregate)},{name:"minCardinalityForBin",description:"binned quantitative field should not have too low cardinality",properties:[tn.BIN,tn.FIELD,tn.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>{if(e.bin&&e.type===lt){let n={channel:e.channel,field:e.field,type:e.type};return t.cardinality(n)>=r.minCardinalityForBin}return!0}},{name:"binAppliedForQuantitative",description:"bin should be applied to quantitative field only.",properties:[tn.TYPE,tn.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>!e.bin||e.type===lt},{name:"channelFieldCompatible",description:"encoding channel's range type be compatible with channel type.",properties:[tn.CHANNEL,tn.TYPE,tn.BIN,tn.TIMEUNIT],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>{const i=Object.assign({field:"f"},kr(e,{schema:t,props:["bin","timeUnit","type"]})),{compatible:o}=Jn(i,e.channel);if(o)return!0;return!("row"!==e.channel&&"column"!==e.channel||(a=i.timeUnit,!yn[a]&&!function(e){return!!bn[e]}(i.timeUnit)));var a}},{name:"hasFn",description:"A field with as hasFn flag should have one of aggregate, timeUnit, or bin.",properties:[tn.AGGREGATE,tn.BIN,tn.TIMEUNIT],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,r)=>!e.hasFn||(!!e.aggregate||!!e.bin||!!e.timeUnit)},{name:"omitScaleZeroWithBinnedField",description:"Do not use scale zero with binned field",properties:[tn.SCALE,Jt("scale","zero"),tn.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>!e.bin||!e.scale||!0!==e.scale.zero},{name:"onlyOneTypeOfFunction",description:"Only of of aggregate, autoCount, timeUnit, or bin should be applied at the same time.",properties:[tn.AGGREGATE,tn.AUTOCOUNT,tn.TIMEUNIT,tn.BIN],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,r)=>{if(Tr(e)){return(!On(e.aggregate)&&e.aggregate?1:0)+(!On(e.bin)&&e.bin?1:0)+(!On(e.timeUnit)&&e.timeUnit?1:0)<=1}return!0}},{name:"timeUnitAppliedForTemporal",description:"Time unit should be applied to temporal field only.",properties:[tn.TYPE,tn.TIMEUNIT],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>!e.timeUnit||e.type===dt},{name:"timeUnitShouldHaveVariation",description:"A particular time unit should be applied only if they produce unique values.",properties:[tn.TIMEUNIT,tn.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,r)=>!e.timeUnit||e.type!==dt||(!n.has("timeUnit")&&!r.constraintManuallySpecifiedValue||t.timeUnitHasVariation(e))},{name:"scalePropertiesSupportedByScaleType",description:"Scale properties must be supported by correct scale type",properties:[].concat(qt,[tn.SCALE,tn.TYPE]),allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,r)=>{if(e.scale){const t=e.scale,n=Ur(e);if(null==n)return!0;for(let e in t){if("type"===e||"name"===e||"enum"===e)continue;const t=e;if("point"===n){if(!wt("point",t)&&!wt("band",t))return!1}else if(!wt(n,t))return!1}}return!0}},{name:"scalePropertiesSupportedByChannel",description:"Not all scale properties are supported by all encoding channels",properties:[].concat(qt,[tn.SCALE,tn.CHANNEL]),allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,r)=>{if(e){let t=e.channel,n=e.scale;if(t&&!On(t)&&n){if("row"===t||"column"===t)return!1;for(let e in n){if(!n.hasOwnProperty(e))continue;if("type"===e||"name"===e||"enum"===e)continue;if(!(void 0===Ct(t,e)))return!1}}}return!0}},{name:"typeMatchesPrimitiveType",description:"Data type should be supported by field's primitive type.",properties:[tn.FIELD,tn.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>{if("*"===e.field)return!0;const i=t.primitiveType(e.field),o=e.type;if(!n.has("field")&&!n.has("type")&&!r.constraintManuallySpecifiedValue)return!0;switch(i){case Io.BOOLEAN:case Io.STRING:return o!==lt&&o!==dt;case Io.NUMBER:case Io.INTEGER:return o!==dt;case Io.DATETIME:return o===dt;case null:return!1}throw new Error("Not implemented")}},{name:"typeMatchesSchemaType",description:"Enumerated data type of a field should match the field's type in the schema.",properties:[tn.FIELD,tn.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,r)=>!(n.has("field")||n.has("type")||r.constraintManuallySpecifiedValue)||("*"===e.field?e.type===lt:t.vlType(e.field)===e.type)},{name:"maxCardinalityForCategoricalColor",description:"Categorical channel should not have too high cardinality",properties:[tn.CHANNEL,tn.FIELD],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,r)=>e.channel!==we||e.type!==ft&&e.type!==Zn.KEY||t.cardinality(e)<=r.maxCardinalityForCategoricalColor},{name:"maxCardinalityForFacet",description:"Row/column channel should not have too high cardinality",properties:[tn.CHANNEL,tn.FIELD,tn.BIN,tn.TIMEUNIT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,r)=>e.channel!==he&&e.channel!==ge||t.cardinality(e)<=r.maxCardinalityForFacet},{name:"maxCardinalityForShape",description:"Shape channel should not have too high cardinality",properties:[tn.CHANNEL,tn.FIELD,tn.BIN,tn.TIMEUNIT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,r)=>e.channel!==Oe||t.cardinality(e)<=r.maxCardinalityForShape},{name:"dataTypeAndFunctionMatchScaleType",description:"Scale type must match data type",properties:[tn.TYPE,tn.SCALE,Jt("scale","type"),tn.TIMEUNIT,tn.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>{if(e.scale){const t=e.type,n=Ur(e);if(tr(t))return void 0===n||Et(n);if(t===dt)return e.timeUnit?Ut([pt.TIME,pt.UTC,void 0],n)||Et(n):Ut([pt.TIME,pt.UTC,void 0],n);if(t===lt)return e.bin?Ut([pt.LINEAR,void 0],n):Ut([pt.LOG,pt.POW,pt.SQRT,pt.QUANTILE,pt.QUANTIZE,pt.LINEAR,void 0],n)}return!0}},{name:"stackIsOnlyUsedWithXY",description:"stack should only be allowed for x and y channels",properties:[tn.STACK,tn.CHANNEL],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>!e.stack||(e.channel===ye||e.channel===ve)}].map((e=>new Do(e)));_o.reduce(((e,t)=>(e[t.name()]=t,e)),{});const jo=_o.reduce(((e,t)=>{for(const n of t.properties())e.set(n,e.get(n)||[]),e.get(n).push(t);return e}),new nr),Po=[{name:"doesNotSupportConstantValue",description:"row, column, x, y, order, and detail should not work with constant values.",properties:[tn.TYPE,tn.AGGREGATE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>!Ut(["row","column","x","y","detail","order"],e.channel)}].map((e=>new Do(e)));Po.reduce(((e,t)=>(e[t.name()]=t,e)),{});const Ro=Po.reduce(((e,t)=>{for(const n of t.properties())e.set(n,e.get(n)||[]),e.get(n).push(t);return e}),new nr);const $o=Ge.reduce(((e,t)=>(e[t]=!0,e)),{});class Bo extends Fo{constructor(e){super(e)}hasAllRequiredPropertiesSpecific(e){return Ft(this.constraint.properties,(t=>{if(t===tn.MARK)return!On(e.getMark());if(jt(t)){let n=t.parent,r=t.child;return Ft(e.getEncodings(),(e=>!e[n]||!On(e[n][r])))}if(!Xt(t))throw new Error("UNIMPLEMENTED");return Ft(e.getEncodings(),(e=>!e[t]||!On(e[t])))}))}satisfy(e,t,n){return!this.constraint.allowWildcardForProperties&&!this.hasAllRequiredPropertiesSpecific(e)||this.constraint.satisfy(e,t,n)}}const Lo=[{name:"noRepeatedChannel",description:"Each encoding channel should only be used once.",properties:[tn.CHANNEL],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n)=>{let r={};return Ft(e.getEncodings(),(e=>!!On(e.channel)||!r[e.channel]&&(r[e.channel]=!0,!0)))}},{name:"alwaysIncludeZeroInScaleWithBarMark",description:"Do not recommend bar mark if scale does not start at zero",properties:[tn.MARK,tn.SCALE,Jt("scale","zero"),tn.CHANNEL,tn.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const r=e.getMark(),i=e.getEncodings();if(r===on)for(let o of i)if(Tr(o)&&(o.channel===ye||o.channel===ve)&&o.type===lt&&o.scale&&!1===o.scale.zero)return!1;return!0}},{name:"autoAddCount",description:"Automatically adding count only for plots with only ordinal, binned quantitative, or temporal with timeunit fields.",properties:[tn.BIN,tn.TIMEUNIT,tn.TYPE,tn.AUTOCOUNT],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{if(_t(e.getEncodings(),(e=>wr(e))))return Ft(e.getEncodings(),(e=>{if(Er(e))return!0;if(Sr(e))return!0;switch(e.type){case lt:return!!e.bin;case dt:return!!e.timeUnit;case ut:case Zn.KEY:case ft:return!0}throw new Error("Unsupported Type")}));if(Ft(e.wildcardIndex.encodingIndicesByProperty.get("autoCount")||[],(t=>{let n=e.getEncodingQueryByIndex(t);return Sr(n)&&!On(n.autoCount)})))return _t(e.getEncodings(),(e=>(Tr(e)||Sr(e))&&e.type===lt?!Nr(e)&&(Tr(e)&&(!e.bin||On(e.bin))):!(!Tr(e)||e.type!==dt)&&(!e.timeUnit||On(e.timeUnit))));return!0}},{name:"channelPermittedByMarkType",description:"Each encoding channel should be supported by the mark type",properties:[tn.CHANNEL,tn.MARK],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n)=>{const r=e.getMark();return!!On(r)||Ft(e.getEncodings(),(e=>!!On(e.channel)||!!Qe(e.channel,r)))}},{name:"hasAllRequiredChannelsForMark",description:"All required channels for the specified mark should be specified",properties:[tn.CHANNEL,tn.MARK],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const r=e.getMark();switch(r){case rn:case an:return e.channelUsed(ye)&&e.channelUsed(ve);case un:return e.channelUsed(De);case on:case fn:case pn:case dn:case ln:case cn:return e.channelUsed(ye)||e.channelUsed(ve);case sn:return!e.wildcardIndex.hasProperty(tn.CHANNEL)||e.channelUsed(ye)||e.channelUsed(ve)}throw new Error("hasAllRequiredChannelsForMark not implemented for mark"+JSON.stringify(r))}},{name:"omitAggregate",description:"Omit aggregate plots.",properties:[tn.AGGREGATE,tn.AUTOCOUNT],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>!e.isAggregate()},{name:"omitAggregatePlotWithDimensionOnlyOnFacet",description:"Omit aggregate plots with dimensions only on facets as that leads to inefficient use of space.",properties:[tn.CHANNEL,tn.AGGREGATE,tn.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{if(e.isAggregate()){let t=!1,r=!1,i=!1;if(e.specQuery.encodings.forEach(((n,o)=>{Er(n)||Nr(n)||Tr(n)&&!n.aggregate&&(r=!0,Ut([he,ge],n.channel)?e.wildcardIndex.hasEncodingProperty(o,tn.CHANNEL)&&(i=!0):t=!0)})),r&&!t&&(i||n.constraintManuallySpecifiedValue))return!1}return!0}},{name:"omitAggregatePlotWithoutDimension",description:"Aggregate plots without dimension should be omitted",properties:[tn.AGGREGATE,tn.AUTOCOUNT,tn.BIN,tn.TIMEUNIT,tn.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>!e.isAggregate()||_t(e.getEncodings(),(e=>!!(Ir(e)||Tr(e)&&"temporal"===e.type)))},{name:"omitBarLineAreaWithOcclusion",description:"Don't use bar, line or area to visualize raw plot as they often lead to occlusion.",properties:[tn.MARK,tn.AGGREGATE,tn.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>!Ut([on,an,rn],e.getMark())||e.isAggregate()},{name:"omitBarTickWithSize",description:"Do not map field to size channel with bar and tick mark",properties:[tn.CHANNEL,tn.MARK],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{const r=e.getMark();if(Ut([dn,on],r)&&e.channelEncodingField(ke)){if(n.constraintManuallySpecifiedValue)return!1;{const t=e.specQuery.encodings;for(let n=0;n<t.length;n++){if(t[n].channel===ke)return!e.wildcardIndex.hasEncodingProperty(n,tn.CHANNEL)}}}return!0}},{name:"omitBarAreaForLogScale",description:"Do not use bar and area mark for x and y's log scale",properties:[tn.MARK,tn.CHANNEL,tn.SCALE,Jt("scale","type"),tn.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const r=e.getMark(),i=e.getEncodings();if(r===rn||r===on)for(let o of i)if(Tr(o)&&(o.channel===ye||o.channel===ve)&&o.scale){if(Ur(o)===pt.LOG)return!1}return!0}},{name:"omitMultipleNonPositionalChannels",description:"Unless manually specified, do not use multiple non-positional encoding channel to avoid over-encoding.",properties:[tn.CHANNEL],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{const r=e.specQuery.encodings;let i=0,o=!1;for(let a=0;a<r.length;a++){const t=r[a];if(Er(t)||Nr(t))continue;const s=t.channel;if(!On(s)&&$o[s+""]&&(i+=1,e.wildcardIndex.hasEncodingProperty(a,tn.CHANNEL)&&(o=!0),i>1&&(o||n.constraintManuallySpecifiedValue)))return!1}return!0}},{name:"omitNonPositionalOrFacetOverPositionalChannels",description:"Do not use non-positional channels unless all positional channels are used",properties:[tn.CHANNEL],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{const r=e.specQuery.encodings;let i=!1,o=!1,a=!1,s=!1;for(let c=0;c<r.length;c++){const t=r[c];if(Er(t)||Nr(t))continue;const n=t.channel;n===ye?a=!0:n===ve?s=!0:On(n)||(i=!0,e.wildcardIndex.hasEncodingProperty(c,tn.CHANNEL)&&(o=!0))}return!(o||n.constraintManuallySpecifiedValue&&i)||a&&s}},{name:"omitRaw",description:"Omit raw plots.",properties:[tn.AGGREGATE,tn.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>!!e.isAggregate()},{name:"omitRawContinuousFieldForAggregatePlot",description:"Aggregate plot should not use raw continuous field as group by values. (Quantitative should be binned. Temporal should have time unit.)",properties:[tn.AGGREGATE,tn.AUTOCOUNT,tn.TIMEUNIT,tn.BIN,tn.TYPE],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{if(e.isAggregate()){const t=e.specQuery.encodings;for(let r=0;r<t.length;r++){const i=t[r];if(!Er(i)&&!Nr(i)){if(Tr(i)&&i.type===dt&&!i.timeUnit&&(e.wildcardIndex.hasEncodingProperty(r,tn.TIMEUNIT)||n.constraintManuallySpecifiedValue))return!1;if(i.type===lt&&Tr(i)&&!i.bin&&!i.aggregate){if(e.wildcardIndex.hasEncodingProperty(r,tn.BIN)||e.wildcardIndex.hasEncodingProperty(r,tn.AGGREGATE)||e.wildcardIndex.hasEncodingProperty(r,tn.AUTOCOUNT))return!1;if(n.constraintManuallySpecifiedValue)return!1}}}}return!0}},{name:"omitRawDetail",description:"Do not use detail channel with raw plot.",properties:[tn.CHANNEL,tn.AGGREGATE,tn.AUTOCOUNT],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>!!e.isAggregate()||Ft(e.specQuery.encodings,((t,r)=>!(!Er(t)&&!Nr(t))||(t.channel!==je||!e.wildcardIndex.hasEncodingProperty(r,tn.CHANNEL)&&!n.constraintManuallySpecifiedValue)))},{name:"omitRepeatedField",description:"Each field should be mapped to only one channel",properties:[tn.FIELD],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{let r={},i={};const o=e.specQuery.encodings;for(let a=0;a<o.length;a++){const t=o[a];if(Er(t)||Sr(t))continue;let s;if(t.field&&!On(t.field)&&(s=t.field),Sr(t)&&!On(t.autoCount)&&(s="count_*"),s){if(e.wildcardIndex.hasEncodingProperty(a,tn.FIELD)&&(i[s]=!0),r[s]&&(i[s]||n.constraintManuallySpecifiedValue))return!1;r[s]=!0}}return!0}},{name:"omitVerticalDotPlot",description:"Do not output vertical dot plot.",properties:[tn.CHANNEL],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{const r=e.getEncodings();return 1!==r.length||r[0].channel!==ve}},{name:"hasAppropriateGraphicTypeForMark",description:"Has appropriate graphic type for mark",properties:[tn.CHANNEL,tn.MARK,tn.TYPE,tn.TIMEUNIT,tn.BIN,tn.AGGREGATE,tn.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{const r=e.getMark();switch(r){case rn:case an:if(e.isAggregate()){const t=e.getEncodingQueryByChannel(ye),n=e.getEncodingQueryByChannel(ve),r=Mr(t),i=Mr(n);return t&&n&&r!==i&&!(Tr(t)&&!r&&Ut(["nominal","key"],t.type))&&!(Tr(n)&&!i&&Ut(["nominal","key"],n.type))}return!0;case un:return!0;case on:case dn:if(e.channelEncodingField(ke))return!1;{const t=e.getEncodingQueryByChannel(ye),n=e.getEncodingQueryByChannel(ve);return Mr(t)!==Mr(n)}case cn:const t=e.getEncodingQueryByChannel(ye),n=e.getEncodingQueryByChannel(ve),r=Ir(t),i=Ir(n),o=e.getEncodingQueryByChannel(we),a=Mr(o),s=!!Tr(o)&&o.type===ut;return(r&&i||r&&!e.channelUsed(ve)||i&&!e.channelUsed(ye))&&(!o||o&&(a||s));case fn:case sn:case pn:case ln:return!0}throw new Error("hasAllRequiredChannelsForMark not implemented for mark"+r)}},{name:"omitInvalidStackSpec",description:"If stack is specified, must follow Vega-Lite stack rules",properties:[tn.STACK,tn.FIELD,tn.CHANNEL,tn.MARK,tn.AGGREGATE,tn.AUTOCOUNT,tn.SCALE,Jt("scale","type"),tn.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{if(!e.wildcardIndex.hasProperty(tn.STACK))return!0;const r=e.getVlStack();return(null!==r||null===e.getStackOffset())&&r.fieldChannel===e.getStackChannel()}},{name:"omitNonSumStack",description:"Stack specifications that use non-summative aggregates should be omitted (even implicit ones)",properties:[tn.CHANNEL,tn.MARK,tn.AGGREGATE,tn.AUTOCOUNT,tn.SCALE,Jt("scale","type"),tn.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const r=e.getVlStack();if(null!=r){const t=e.getEncodingQueryByChannel(r.fieldChannel);if(!Ut(Ln,t.aggregate))return!1}return!0}},{name:"omitTableWithOcclusionIfAutoAddCount",description:"Plots without aggregation or autocount where x and y are both discrete should be omitted if autoAddCount is enabled as they often lead to occlusion",properties:[tn.CHANNEL,tn.TYPE,tn.TIMEUNIT,tn.BIN,tn.AGGREGATE,tn.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{if(n.autoAddCount){const t=e.getEncodingQueryByChannel("x"),n=e.getEncodingQueryByChannel("y");if((!Tr(t)||Ir(t))&&(!Tr(n)||Ir(n)))return!!e.isAggregate()&&Ft(e.getEncodings(),(e=>{let t=e.channel;return!(t!==ye&&t!==ve&&t!==he&&t!==ge&&Tr(e)&&!e.aggregate)}))}return!0}}].map((e=>new Bo(e)));Lo.reduce(((e,t)=>(e[t.name()]=t,e)),{});const Wo=Lo.reduce(((e,t)=>{for(const n of t.properties())e.set(n,e.get(n)||[]),e.get(n).push(t);return e}),new nr);function Ho(e,t,n,r,i){const o=Wo.get(e)||[];for(const a of o)if(a.strict()||i[a.name()]){if(!a.satisfy(n,r,i)){let e="(spec) "+a.name();return i.verbose&&console.log(e+" failed with "+n.toShorthand()+" for "+t.name),e}}return null}const qo=new nr;function Go(e){return(t,n,r)=>(i,o)=>{const a=t.encodingIndicesByProperty.get(e);return function s(c){if(c===a.length)return void i.push(o.duplicate());const l=a[c],u=t.encodings[l].get(e),d=o.getEncodingQueryByIndex(l),f=o.getEncodingProperty(l,e);Er(d)||Nr(d)||!f?s(c+1):(u.enum.forEach((t=>{null===t&&(t=void 0),o.setEncodingProperty(l,e,t,u);const i=function(e,t,n,r,i,o){const a=jo.get(e)||[],s=r.getEncodingQueryByIndex(n);for(const l of a)if((l.strict()||o[l.name()])&&!l.satisfy(s,i,r.wildcardIndex.encodings[n],o)){let e="(enc) "+l.name();return o.verbose&&console.log(e+" failed with "+r.toShorthand()+" for "+t.name),e}const c=Ro.get(e)||[];for(const l of c)if((l.strict()||o[l.name()])&&Er(s)&&!l.satisfy(s,i,r.wildcardIndex.encodings[n],o)){let e="(enc) "+l.name();return o.verbose&&console.log(e+" failed with "+r.toShorthand()+" for "+t.name),e}return null}(e,u,l,o,n,r);if(i)return;Ho(e,u,o,n,r)||s(c+1)})),o.resetEncodingProperty(l,e,u))}(0),i}}function zo(e,t,n){return t=t||new nr,n=n||new nr,e.forEach((e=>{var r;r=e,It.isObject(r)&&r.property?(t.setByKey(e.property,!0),n.setByKey(e.property,e.replace)):t.setByKey(e,!0)})),{include:t,replaceIndex:n,replacer:ur(n)}}qo.set("mark",((e,t,n)=>(r,i)=>(i.getMark().enum.forEach((o=>{i.setMark(o);Ho("mark",e.mark,i,t,n)||r.push(i.duplicate())})),i.resetMark(),r))),Rt.forEach((e=>{qo.set(e,Go(e))})),Yt.forEach((e=>{qo.set(e,Go(e))}));const Yo=[tn.FIELD,tn.TYPE,tn.AGGREGATE,tn.BIN,tn.TIMEUNIT,tn.STACK],Qo=Yo.concat([{property:tn.CHANNEL,replace:{x:"xy",y:"xy",color:"style",size:"style",shape:"style",opacity:"style",row:"facet",column:"facet"}}]);let Vo={};function Ko(e,t){Vo[e]=t}const Jo=zo([tn.FIELD]);Ko("field",(e=>mr(e,Jo.include,Jo.replacer)));const Xo=zo(Yo);Ko("fieldTransform",(e=>mr(e,Xo.include,Xo.replacer)));const Zo=zo(Qo);Ko("encoding",(e=>mr(e,Zo.include,Zo.replacer))),Ko("spec",(e=>JSON.stringify(e)));class ea{constructor(){this._mark=void 0,this._encodings={},this._encodingIndicesByProperty=new nr}setEncodingProperty(e,t,n){const r=this._encodings;(r[e]=r[e]||new nr).set(t,n);const i=this._encodingIndicesByProperty;return i.set(t,i.get(t)||[]),i.get(t).push(e),this}hasEncodingProperty(e,t){return!!this._encodings[e]&&this._encodings[e].has(t)}hasProperty(e){if(Xt(e))return this.encodingIndicesByProperty.has(e);if("mark"===e)return!!this.mark;throw new Error("Unimplemented for property "+e)}isEmpty(){return!this.mark&&0===this.encodingIndicesByProperty.size()}setMark(e){return this._mark=e,this}get mark(){return this._mark}get encodings(){return this._encodings}get encodingIndicesByProperty(){return this._encodingIndicesByProperty}}class ta{constructor(e,t,n,r,i){this._rankingScore={},this._spec=e,this._channelFieldCount=e.encodings.reduce(((e,t)=>(On(t.channel)||Sr(t)&&!1===t.autoCount||(e[t.channel+""]=1),e)),{}),this._wildcardIndex=t,this._assignedWildcardIndex=i,this._opt=r,this._schema=n}static build(e,t,n){let r=new ea;if(On(e.mark)){const t=Fn(tn.MARK);e.mark=Mn(e.mark,t,n.enum.mark),r.setMark(e.mark)}if(e.encodings.forEach(((e,i)=>{Sr(e)&&(console.warn("A field with autoCount should not be included as autoCount meant to be an internal object."),e.type=lt),Tr(e)&&void 0===e.type&&(e.type=An),Rt.forEach((o=>{if(On(e[o])){const a=Fn(o)+i,s=Rn(o,t,n),c=e[o]=Mn(e[o],a,s);r.setEncodingProperty(i,o,c)}})),Yt.forEach((o=>{const a=e[o.parent];if(a){const e=o.child;if(On(a[e])){const s=Fn(o)+i,c=Rn(o,t,n),l=a[e]=Mn(a[e],s,c);r.setEncodingProperty(i,o,l)}}}))})),n.autoAddCount){const i={name:Fn(tn.CHANNEL)+e.encodings.length,enum:Rn(tn.CHANNEL,t,n)},o={name:Fn(tn.AUTOCOUNT)+e.encodings.length,enum:[!1,!0]},a={channel:i,autoCount:o,type:lt};e.encodings.push(a);const s=e.encodings.length-1;r.setEncodingProperty(s,tn.CHANNEL,i),r.setEncodingProperty(s,tn.AUTOCOUNT,o)}return new ta(e,r,t,n,{})}get wildcardIndex(){return this._wildcardIndex}get schema(){return this._schema}get specQuery(){return this._spec}duplicate(){return new ta(It.duplicate(this._spec),this._wildcardIndex,this._schema,this._opt,It.duplicate(this._assignedWildcardIndex))}setMark(e){const t=this._wildcardIndex.mark.name;this._assignedWildcardIndex[t]=this._spec.mark=e}resetMark(){const e=this._spec.mark=this._wildcardIndex.mark;delete this._assignedWildcardIndex[e.name]}getMark(){return this._spec.mark}getEncodingProperty(e,t){const n=this._spec.encodings[e];return jt(t)?n[t.parent][t.child]:n[t]}setEncodingProperty(e,t,n,r){const i=this._spec.encodings[e];t===tn.CHANNEL&&i.channel&&!On(i.channel)&&this._channelFieldCount[i.channel]--,jt(t)?i[t.parent][t.child]=n:Lt(t)&&!0===n?i[t]=It.extend({},i[t],{enum:void 0,name:void 0}):i[t]=n,this._assignedWildcardIndex[r.name]=n,t===tn.CHANNEL&&(this._channelFieldCount[n]=(this._channelFieldCount[n]||0)+1)}resetEncodingProperty(e,t,n){const r=this._spec.encodings[e];t===tn.CHANNEL&&this._channelFieldCount[r.channel]--,jt(t)?r[t.parent][t.child]=n:r[t]=n,delete this._assignedWildcardIndex[n.name]}channelUsed(e){return this._channelFieldCount[e]>0}channelEncodingField(e){return Tr(this.getEncodingQueryByChannel(e))}getEncodings(){return this._spec.encodings.filter((e=>!Nr(e)))}getEncodingQueryByChannel(e){for(let t of this._spec.encodings)if(t.channel===e)return t}getEncodingQueryByIndex(e){return this._spec.encodings[e]}isAggregate(){return _t(this._spec.encodings,(e=>Tr(e)&&!On(e.aggregate)&&!!e.aggregate||wr(e)))}getVlStack(){return cr(this._spec)}getStackOffset(){return function(e){for(const t of e.encodings)if(void 0!==t[tn.STACK]&&!On(t[tn.STACK]))return t[tn.STACK]}(this._spec)}getStackChannel(){return function(e){for(const t of e.encodings)if(void 0!==t[tn.STACK]&&!On(t.channel))return t.channel;return null}(this._spec)}toShorthand(e){if(e){if(It.isString(e))return function(e,t){return Vo[t](e)}(this.specQuery,e);const t=zo(e);return mr(this._spec,t.include,t.replacer)}return mr(this._spec)}toSpec(e){if(On(this._spec.mark))return null;let t={};return(e=e||this._spec.data)&&(t.data=e),this._spec.transform&&(t.transform=this._spec.transform),t.mark=this._spec.mark,t.encoding=Ar(this.specQuery.encodings,{schema:this._schema,wildcardMode:"null"}),this._spec.width&&(t.width=this._spec.width),this._spec.height&&(t.height=this._spec.height),this._spec.background&&(t.background=this._spec.background),this._spec.padding&&(t.padding=this._spec.padding),this._spec.title&&(t.title=this._spec.title),null===t.encoding?null:((this._spec.config||this._opt.defaultSpecConfig)&&(t.config=It.extend({},this._opt.defaultSpecConfig,this._spec.config)),t)}getRankingScore(e){return this._rankingScore[e]}setRankingScore(e,t){this._rankingScore[e]=t}}function na(e){return void 0!==e.items}function ra(e){let t=e.items[0];for(;t&&na(t);)t=t.items[0];return t}class ia{constructor(e){this.type=e,this.scoreIndex=this.initScore()}getFeatureScore(e){const t=this.type,n=this.scoreIndex[e];if(void 0!==n)return{type:t,feature:e,score:n}}}var oa,aa;(aa=oa||(oa={}))[aa.Q=lt]="Q",aa[aa.BIN_Q="bin_"+lt]="BIN_Q",aa[aa.T=dt]="T",aa[aa.TIMEUNIT_T="timeUnit_time"]="TIMEUNIT_T",aa[aa.TIMEUNIT_O="timeUnit_"+ut]="TIMEUNIT_O",aa[aa.O=ut]="O",aa[aa.N=ft]="N",aa[aa.K=Zn.KEY]="K",aa[aa.NONE="-"]="NONE";const sa=oa.Q,ca=oa.BIN_Q,la=oa.T,ua=oa.TIMEUNIT_T,da=oa.TIMEUNIT_O,fa=oa.O,pa=oa.N,ha=oa.K,ga=oa.NONE;function ma(e){if(e.bin)return oa.BIN_Q;if(e.timeUnit){return Et(Ur(e))?oa.TIMEUNIT_O:oa.TIMEUNIT_T}return e.type}const ya=-10;function va(e,t,n,r){return e+"_"+t+"_"+n+"_"+r}const ba=[new class extends ia{constructor(){super("Axis")}initScore(e={}){e=Object.assign({},$n,e);let t={};return[{feature:ca,opt:"preferredBinAxis"},{feature:la,opt:"preferredTemporalAxis"},{feature:ua,opt:"preferredTemporalAxis"},{feature:da,opt:"preferredTemporalAxis"},{feature:fa,opt:"preferredOrdinalAxis"},{feature:pa,opt:"preferredNominalAxis"}].forEach((n=>{e[n.opt]===ye?t[n.feature+"_"+ve]=-.01:e[n.opt]===ve&&(t[n.feature+"_"+ye]=-.01)})),t}featurize(e,t){return e+"_"+t}getScore(e,t,n){return e.getEncodings().reduce(((e,t)=>{if(Tr(t)||Sr(t)){const n=ma(t),r=this.featurize(n,t.channel),i=this.getFeatureScore(r);i&&e.push(i)}return e}),[])}},new class extends ia{constructor(){super("Dimension")}initScore(){return{row:-2,column:-2,color:0,opacity:0,size:0,shape:0}}getScore(e,t,n){return e.isAggregate()&&e.getEncodings().reduce(((e,t)=>{if(Sr(t)||Tr(t)&&!t.aggregate){const n=this.getFeatureScore(t.channel+"");if(n&&n.score>e.score)return n}return e}),{type:"Dimension",feature:"No Dimension",score:-5}),[]}},new class extends ia{constructor(){super("Facet")}initScore(e){let t={};return(e=Object.assign({},$n,e)).preferredFacet===he?t[ge]=-.01:e.preferredFacet===ge&&(t[he]=-.01),t}getScore(e,t,n){return e.getEncodings().reduce(((e,t)=>{if(Tr(t)||Sr(t)){const n=this.getFeatureScore(t.channel);n&&e.push(n)}return e}),[])}},new class extends ia{constructor(){super("Mark")}initScore(){return function(){const e=[sa,la],t=[ca,da,fa,pa,ha].concat([ga]);let n={};e.forEach((t=>{e.forEach((e=>{Dt({point:0,text:-.2,tick:-.5,rect:-1,bar:-2,line:-2,area:-2,rule:-2.5},((r,i)=>{const o=va(t,e,!0,i);n[o]=r}));Dt({point:0,text:-.2,tick:-.5,bar:-2,line:-2,area:-2,rule:-2.5},((r,i)=>{const o=va(t,e,!1,i);n[o]=r}))}))})),e.forEach((e=>{t.forEach((t=>{Dt({tick:0,point:-.2,text:-.5,bar:-2,line:-2,area:-2,rule:-2.5},((r,i)=>{const o=va(e,t,!0,i);n[o]=r;const a=va(t,e,!0,i);n[a]=r}))})),[ua].forEach((t=>{Dt({point:0,text:-.5,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5},((r,i)=>{const o=va(e,t,!0,i);n[o]=r;const a=va(t,e,!0,i);n[a]=r}))})),[ga,pa,fa,ha].forEach((t=>{Dt({bar:0,point:-.2,tick:-.25,text:-.3,line:-2,area:-2,rule:-2.5},((r,i)=>{const o=va(e,t,!1,i);n[o]=r;const a=va(t,e,!1,i);n[a]=r}))})),[ca].forEach((t=>{Dt({bar:0,point:-.2,tick:-.25,text:-.3,line:-.5,area:-.5,rule:-2.5},((r,i)=>{const o=va(e,t,!1,i);n[o]=r;const a=va(t,e,!1,i);n[a]=r}))})),[ua,da].forEach((t=>{Dt({line:0,area:-.1,bar:-.2,point:-.3,tick:-.35,text:-.4,rule:-2.5},((r,i)=>{const o=va(e,t,!1,i);n[o]=r;const a=va(t,e,!1,i);n[a]=r}))}))})),[ua].forEach((e=>{[ua].forEach((t=>{const r={point:0,rect:-.1,text:-.5,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5};Dt(r,((r,i)=>{const o=va(e,t,!0,i);n[o]=r})),Dt(r,((r,i)=>{const o=va(e,t,!1,i);n[o]=r}))})),t.forEach((t=>{const r={tick:0,point:-.2,text:-.5,rect:-1,bar:-2,line:-2,area:-2,rule:-2.5};Dt(r,((r,i)=>{const o=va(e,t,!0,i);n[o]=r})),Dt(r,((r,i)=>{const o=va(t,e,!0,i);n[o]=r})),Dt(r,((r,i)=>{const o=va(e,t,!1,i);n[o]=r})),Dt(r,((r,i)=>{const o=va(t,e,!1,i);n[o]=r}))}))}));for(const r of t)for(const e of t){const t={point:0,rect:0,text:-.1,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5};Dt(t,((t,i)=>{const o=va(r,e,!0,i);n[o]=t})),Dt(t,((t,i)=>{const o=va(r,e,!1,i);n[o]=t}))}return n}()}getScore(e,t,n){let r=e.getMark();r!==fn&&r!==pn||(r=sn);const i=e.getEncodingQueryByChannel(ye),o=i?ma(i):ga,a=e.getEncodingQueryByChannel(ve),s=o+"_"+(a?ma(a):ga)+"_"+!e.isAggregate()+"_"+r,c=this.getFeatureScore(s);return c?[c]:(console.error("feature score missing for",s),[])}},new class extends ia{constructor(){super("SizeChannel")}initScore(){return{bar_size:-2,tick_size:-2}}getScore(e,t,n){const r=e.getMark();return e.getEncodings().reduce(((e,t)=>{if(Tr(t)||Sr(t)){const n=r+"_"+t.channel,i=this.getFeatureScore(n);i&&e.push(i)}return e}),[])}},new class extends ia{constructor(){super("TypeChannel")}initScore(){let e={};const t={x:0,y:0,size:-.575,color:-.725,text:-2,opacity:-3,shape:ya,row:ya,column:ya,detail:-20};[sa,la,ua].forEach((n=>{It.keys(t).forEach((r=>{e[this.featurize(n,r)]=t[r]}))}));const n=It.extend({},t,{row:-.75,column:-.75,shape:-3.1,text:-3.2,detail:-4});[ca,da,fa].forEach((t=>{It.keys(n).forEach((r=>{e[this.featurize(t,r)]=n[r]}))}));const r={x:0,y:0,color:-.6,shape:-.65,row:-.7,column:-.7,text:-.8,detail:-2,size:-3,opacity:-3.1};return It.keys(r).forEach((t=>{e[this.featurize(pa,t)]=r[t],e[this.featurize(ha,t)]=Ut(["x","y","detail"],t)?-1:r[t]-2})),e}featurize(e,t){return e+"_"+t}getScore(e,t,n){const r=e.getEncodings().reduce(((e,t)=>{if(Tr(t)||Sr(t)){const n=vr(t);(e[n]=e[n]||[]).push(t)}return e}),{}),i=[];return Dt(r,(e=>{const t=e.reduce(((e,t)=>{if(Tr(t)||Sr(t)){const n=ma(t),r=this.featurize(n,t.channel),i=this.getFeatureScore(r);if(null===e||i.score>e.score)return i}return e}),null);i.push(t)})),i}}];const xa="aggregationQuality";let Ea={};function Ta(e,t){Ea[e]=t}function Sa(e,t,n,r){return t.nest&&r!==t.nest.length?(e.items.forEach((e=>{Sa(e,t,n,r+1)})),t.nest[r].orderGroupBy&&e.items.sort(function(e,t,n){return(r,i)=>{const o=ra(r),a=ra(i);return Na(e instanceof Array?e:[e],o,a,t,n)}}(t.nest[r].orderGroupBy,n,t.config))):(t.orderBy||t.chooseBy)&&(e.items.sort(function(e,t,n){return(r,i)=>Na(e instanceof Array?e:[e],r,i,t,n)}(t.orderBy||t.chooseBy,n,t.config)),t.chooseBy&&e.items.length>0&&e.items.splice(1)),e}function Na(e,t,n,r,i){for(let o of e){let e=wa(n,o,r,i).score-wa(t,o,r,i).score;if(0!==e)return e}return 0}function wa(e,t,n,r){if(void 0!==e.getRankingScore(t))return e.getRankingScore(t);const i=(0,Ea[t])(e,n,r);return e.setRankingScore(t,i),i}function Ca(e,t,n){let r={};return e=e.map((function(e){return n.smallRangeStepForHighCardinalityOrFacet&&(e=function(e,t,n,r){[he,ve,ge,ye].forEach((t=>{n[t]=e.getEncodingQueryByChannel(t)}));const i=n[ve];if(void 0!==i&&Tr(i)&&(n[he]||t.cardinality(i)>r.smallRangeStepForHighCardinalityOrFacet.maxCardinality)){void 0===i.scale&&(i.scale={});const e=Ur(i);i.scale&&(void 0===e||Et(e))&&(i.scale.rangeStep||(i.scale.rangeStep=12))}const o=n[ye];if(Tr(o)&&(n[ge]||t.cardinality(o)>r.smallRangeStepForHighCardinalityOrFacet.maxCardinality)){void 0===o.scale&&(o.scale={});const e=Ur(o);o.scale&&(void 0===e||Et(e))&&(o.scale.rangeStep||(o.scale.rangeStep=12))}return e}(e,t,r,n)),n.nominalColorScaleForHighCardinality&&(e=function(e,t,n,r){n[we]=e.getEncodingQueryByChannel(we);const i=n[we];Tr(i)&&void 0!==i&&(i.type===ft||i.type===Zn.KEY)&&t.cardinality(i)>r.nominalColorScaleForHighCardinality.maxCardinality&&(void 0===i.scale&&(i.scale={}),i.scale&&(i.scale.range||(i.scale.scheme=r.nominalColorScaleForHighCardinality.palette)));return e}(e,t,r,n)),n.xAxisOnTopForHighYCardinalityWithoutColumn&&(e=function(e,t,n,r){if([ge,ye,ve].forEach((t=>{n[t]=e.getEncodingQueryByChannel(t)})),void 0===n[ge]){const e=n[ye],i=n[ve];Tr(e)&&Tr(i)&&void 0!==i&&i.field&&Et(Ur(i))&&void 0!==e&&t.cardinality(i)>r.xAxisOnTopForHighYCardinalityWithoutColumn.maxCardinality&&(void 0===e.axis&&(e.axis={}),e.axis&&!e.axis.orient&&(e.axis.orient="top"))}return e}(e,t,r,n)),e})),e}function Aa(e,t,n=$n){const r=ta.build(e,t,n),i=r.wildcardIndex;let o=[r];return n.propertyPrecedence.forEach((e=>{const r=function(e){const t=e.split(".");if(1===t.length)return e;if(2===t.length)return{parent:t[0],child:t[1]};throw"Invalid property key with "+t.length+" dots: "+e}(e);if(i.hasProperty(r)){const e=function(e){return qo.get(e)}(r),a=e(i,t,n);o=o.reduce(a,[])}})),!n.stylize||null===n.nominalColorScaleForHighCardinality&&null===n.smallRangeStepForHighCardinalityOrFacet&&null===n.xAxisOnTopForHighYCardinalityWithoutColumn?o:Ca(o,t,n)}function Oa(e,t,n){const r=function(e,t){if(t){const n={name:"",path:"",items:[]};let r={},i=[],o=[],a=[];for(let e=0;e<t.length;e++){i.push(e>0?i[e-1].duplicate():new nr),o.push(e>0?o[e-1].duplicate():new nr);const n=t[e].groupBy;if(It.isArray(n)){let t=zo(n,i[e],o[e]);a.push(t.replacer)}}return e.forEach((e=>{let o="",s=n;for(let n=0;n<t.length;n++){const c=s.groupBy=t[n].groupBy;s.orderGroupBy=t[n].orderGroupBy;const l=It.isArray(c)?mr(e.specQuery,i[n],a[n]):Vo[c](e.specQuery);o+="/"+l,r[o]||(r[o]={name:l,path:o,items:[]},s.items.push(r[o])),s=r[o]}s.items.push(e)})),n}return{name:"",path:"",items:e}}(Aa((e=Object.assign({},function(e){if(e.groupBy){let t={groupBy:e.groupBy};e.orderBy&&(t.orderGroupBy=e.orderBy);let n={spec:It.duplicate(e.spec),nest:[t]};return e.chooseBy&&(n.chooseBy=e.chooseBy),e.config&&(n.config=e.config),n}return It.duplicate(e)}(e),{config:Object.assign({},$n,n,e.config)})).spec,t,e.config),e.nest);return{query:e,result:Sa(r,e,t,0)}}Ta("effectiveness",(function(e,t,n){const r=ba.reduce(((r,i)=>{const o=i.getScore(e,t,n);return r.concat(o)}),[]);return{score:r.reduce(((e,t)=>e+t.score),0),features:r}})),Ta(xa,(function(e,t,n){const r=function(e){const t=e.getEncodings();if(e.isAggregate()){if(_t(t,(e=>Tr(e)&&(e.type===lt&&!e.bin&&!e.aggregate||e.type===dt&&!e.timeUnit))))return{type:xa,score:.1,feature:"Aggregate with raw continuous"};if(_t(t,(e=>Tr(e)&&Ir(e)))){let e=_t(t,(e=>Tr(e)&&"count"===e.aggregate||wr(e))),n=_t(t,(e=>Tr(e)&&!!e.bin));return e?{type:xa,score:.8,feature:"Aggregate with count"}:n?{type:xa,score:.7,feature:"Aggregate with bin but without count"}:{type:xa,score:.9,feature:"Aggregate without count and without bin"}}return{type:xa,score:.3,feature:"Aggregate without dimension"}}return _t(t,(e=>Tr(e)&&!Ir(e)))?{type:xa,score:1,feature:"Raw with measure"}:{type:xa,score:.2,feature:"Raw without measure"}}(e);return{score:r.score,features:[r]}})),Ta("fieldOrder",(function(e,t,n){const r=e.wildcardIndex.encodingIndicesByProperty.get("field");if(!r)return{score:0,features:[]};const i=e.specQuery.encodings,o=t.fieldSchemas.length,a=[];let s=0,c=1;for(let l=r.length-1;l>=0;l--){const n=r[l],u=i[n];let d;if(!Tr(u))continue;d=u.field;const f=e.wildcardIndex.encodings[n].get("field"),p=t.fieldSchema(d).index,h=-p*c;s+=h,a.push({score:h,type:"fieldOrder",feature:`field ${f.name} is ${d} (#${p} in the schema)`}),c*=o}return{score:s,features:a}}));const ka={[Io.BOOLEAN]:r.jsx(i,{className:"h-5 w-5 inline-flex opacity-60"}),[Io.DATETIME]:r.jsx(o,{className:"h-5 w-5 inline-flex opacity-60"}),[Io.NUMBER]:r.jsx(a,{className:"h-5 w-5 inline-flex opacity-60"}),[Io.STRING]:r.jsx(s,{className:"h-5 w-5 inline-flex opacity-60"}),[Io.INTEGER]:r.jsx(G,{className:"h-5 w-5 inline-flex opacity-60"})};function Ma(e){const{type:t,limit:n,additionalFieldQuery:r}=e;return{type:t,limit:n,createQuery:e=>({spec:{...e.spec,encodings:[...e.spec.encodings,r]},groupBy:"field",orderBy:["fieldOrder","aggregationQuality","effectiveness"],chooseBy:["aggregationQuality","effectiveness"],config:{autoAddCount:!0}})}}const Ia=Ma({type:"addCategoricalField",limit:4,additionalFieldQuery:{channel:An,field:An,type:"nominal"}}),Ua=Ma({type:"addQuantitativeField",limit:4,additionalFieldQuery:{channel:An,bin:An,aggregate:An,field:An,type:"quantitative"}}),Fa=Ma({type:"addTemporalField",limit:2,additionalFieldQuery:{channel:An,hasFn:!0,timeUnit:An,field:An,type:"temporal"}});function Da(e){return e?"bin"===e?{bin:!0}:$(e)?{aggregate:e}:function(e){if(!e)return!1;return ja.includes(e)||Pa.includes(e)}(e)?{timeUnit:e}:{}:{}}const _a=["bin","min","max","mean","median","sum"],ja=["year","month","date","day","hours","minutes","seconds","milliseconds"],Pa=["yearmonth","yearmonthdate","monthdate"];function Ra(e){const t={};for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}function $a(e){const{aggregate:t,bin:n,timeUnit:r,field:i,scale:o,legend:a,axis:s,sort:u,description:d}=e;let{type:f}=e;if(On(f))throw new Error("Wildcard not support");"ordinal"===f&&(c.warn("Ordinal type is not supported. Using nominal type instead."),f="nominal");const p=function(e){const{aggregate:t,bin:n,timeUnit:r}=e;return n?"bin":t?t.toString():r?r.toString():void 0}({aggregate:t,bin:n,timeUnit:r});return l(void 0!==i,"Field is required for fieldQ"),Ra({field:i,fn:p,type:f,sort:u,scale:o,axis:s,legend:a,description:d})}function Ba(e){return 0===e.encodings.length}function La(e){let t=!1,n=!1,r=!1;for(const i of e.encodings)Er(i)||(Sr(i)?On(i.autoCount)&&(n=!0):(On(i.field)&&(t=!0),(On(i.aggregate)||On(i.bin)||On(i.timeUnit))&&(n=!0),On(i.channel)&&(r=!0)));return{hasAnyWildcard:r||t||n,hasWildcardField:t,hasWildcardFn:n,hasWildcardChannel:r}}function Wa(e){return{mark:e.mark,encodings:(t=e.encoding,Object.entries(t).map((([e,t])=>function(e,t){const{fn:n,...r}=e;return{channel:t,...Da(n),...r}}(t,e)))),config:e.config};var t}const Ha={name:"source"};function qa(e,t){const n={},{hasOpenPosition:r,hasStyleChannel:i,hasOpenFacet:o}=function(e){let t=!1,n=!1,r=!1;return e.encodings.forEach((e=>{"x"===e.channel||"y"===e.channel?t=!0:"row"===e.channel||"column"===e.channel?r=!0:"string"==typeof e.channel&&B(L,e.channel)&&(n=!0)})),{hasOpenPosition:t,hasStyleChannel:n,hasOpenFacet:r}}(e.spec);return(r||i)&&(n.addQuantitativeField=za(Ua,e,t)),(r||i||o)&&(n.addCategoricalField=za(Ia,e,t)),r&&(n.addTemporalField=za(Fa,e,t)),n}function Ga(e,t){if(Ba(e.spec))return{plots:[],query:e,limit:1};return{plots:[Ya(Oa(e,t).result,Ha)[0]],query:e,limit:1}}function za(e,t,n){const r=e.createQuery(t);return{plots:Ya(Oa(r,n).result,Ha),query:r,limit:e.limit}}function Ya(e,t){return e.items.map((e=>na(e)?Qa(t,ra(e)):Qa(t,e)))}function Qa(e,t){return{fieldInfos:t.getEncodings().filter(Tr).map((e=>({fieldDef:$a(e),channel:e.channel}))),spec:t.toSpec(e)}}const Va={type:"histograms",limit:12,createQuery:e=>({spec:{data:e.spec.data,mark:An,transform:e.spec.transform,encodings:[{channel:An,bin:An,timeUnit:An,field:An,type:An},{channel:An,aggregate:"count",field:"*",type:"quantitative"}]},groupBy:"fieldTransform",orderBy:["fieldOrder","aggregationQuality","effectiveness"],chooseBy:["aggregationQuality","effectiveness"],config:{autoAddCount:!1}})};const{valueAtom:Ka,useActions:Ja}=u((function(){return{mark:An,encoding:{},config:{},schema:null}}),{setSchema:(e,t)=>({...e,schema:t}),setMark:(e,t)=>({...e,mark:t}),setEncoding:(e,t)=>{const n=Ra({...e.encoding,...t});return{...e,encoding:n}},set:(e,t)=>{const{schema:n,...r}=t;return{...e,...r}}});function Xa(){return Ja()}const Za=d((e=>{const t=e(Ka);if(!t.schema)return{};const n=function(e){const{spec:t,autoAddCount:n}=e,r=Wa(t),{hasAnyWildcard:i,hasWildcardFn:o,hasWildcardField:a}=La(r),s=function(e){const{hasWildcardFn:t,hasWildcardField:n}=e;return t?"fieldTransform":n?"field":"encoding"}({hasWildcardFn:o,hasWildcardField:a});return{spec:r,groupBy:s,orderBy:["fieldOrder","aggregationQuality","effectiveness"],chooseBy:["aggregationQuality","effectiveness"],config:i?{autoAddCount:n}:void 0}}({spec:t,autoAddCount:!0});return Ba(n.spec)?{main:Ga(n,t.schema),histograms:za(Va,n,t.schema)}:function(e){return!La(e).hasAnyWildcard}(n.spec)&&!function(e){const t=new Set(e.encodings.map((e=>e.channel))),n=["x","y","color"].every((e=>t.has(e))),r=["row","column"].some((e=>t.has(e)));return n&&r}(n.spec)?{main:Ga(n,t.schema),...qa(n,t.schema)}:{main:Ga(n,t.schema)}})),es=[An,"area","bar","circle","geoshape","line","point","rect","rule","square","text","tick","trail"],ts=["x","y","row","column"],ns=["color","size","shape"],rs=e=>{const t=f.c(26),{schema:n,mark:i}=e,o=p(Ka),a=Xa(),s=o.encoding.x&&o.encoding.y;let c;t[0]!==a||t[1]!==s||t[2]!==n||t[3]!==o.encoding?(c=e=>{const t=("row"===e||"column"===e)&&!s;return r.jsx(is,{schema:n,label:e,disabled:t,fieldDefinition:o.encoding[e],onChange:t=>a.setEncoding({[e]:t})},e)},t[0]=a,t[1]=s,t[2]=n,t[3]=o.encoding,t[4]=c):c=t[4];const l=c;let u,d,x,E,T;t[5]!==i?(u=i.toString(),t[5]=i,t[6]=u):u=t[6],t[7]!==a?(d=e=>a.setMark(e),t[7]=a,t[8]=d):d=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(x=r.jsx(h,{children:r.jsx(g,{placeholder:"Mark"})}),t[9]=x):x=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(E=r.jsx(m,{children:r.jsxs(y,{children:[r.jsx(v,{children:"Mark"}),es.map(ss)]})}),t[10]=E):E=t[10],t[11]!==u||t[12]!==d?(T=r.jsxs(b,{"data-testid":"marimo-plugin-data-explorer-mark-select",value:u,onValueChange:d,children:[x,E]}),t[11]=u,t[12]=d,t[13]=T):T=t[13];const S=T;let N,w,C,A,O,k;return t[14]===Symbol.for("react.memo_cache_sentinel")?(N=r.jsx("span",{className:"col-span-2 flex items-center justify-between w-full",children:r.jsx("div",{className:"text-sm font-semibold",children:"Encodings"})}),t[14]=N):N=t[14],t[15]!==l?(w=ts.map(l),t[15]=l,t[16]=w):w=t[16],t[17]===Symbol.for("react.memo_cache_sentinel")?(C=r.jsx("div",{children:"Mark"}),t[17]=C):C=t[17],t[18]!==S?(A=r.jsxs("span",{className:"col-span-2 text-sm font-semibold w-full border-t border-divider flex items-center justify-between pt-2 pr-[30px]",children:[C,S]}),t[18]=S,t[19]=A):A=t[19],t[20]!==l?(O=ns.map(l),t[20]=l,t[21]=O):O=t[21],t[22]!==A||t[23]!==O||t[24]!==w?(k=r.jsxs("div",{className:"grid gap-x-2 gap-y-4 justify-items-start py-3 pl-4 pr-2 bg-[var(--slate-1)] border rounded items-center grid-template-columns-[repeat(2,_minmax(0,_min-content))] self-start",children:[N,w,A,O]}),t[22]=A,t[23]=O,t[24]=w,t[25]=k):k=t[25],k},is=e=>{const t=f.c(43),{label:n,schema:i,fieldDefinition:o,disabled:a,onChange:s}=e;let c;t[0]!==o||t[1]!==i?(c=()=>{if(!o)return"--";if("*"===o.field)return r.jsxs("span",{className:"flex gap-2 flex-1",children:[ka[Io.NUMBER],r.jsx("span",{className:"text-left flex-1",children:"Count"})]});const e=o.field.toString();return r.jsxs("span",{className:"flex gap-2 flex-1",children:[ka[i.primitiveType(e)],r.jsx("span",{className:"text-left flex-1",children:o.fn?`${o.fn}(${o.field})`:e})]})},t[0]=o,t[1]=i,t[2]=c):c=t[2];const l=c;let u;t[3]!==s?(u=()=>{s(void 0)},t[3]=s,t[4]=u):u=t[4];const d=u;let p;t[5]!==(null==o?void 0:o.field)?(p=(null==o?void 0:o.field.toString())??"",t[5]=null==o?void 0:o.field,t[6]=p):p=t[6];const g=p;let v,S;t[7]!==n?(v=r.jsx(E,{className:"text-[var(--slate-11)] font-semibold",children:n}),t[7]=n,t[8]=v):v=t[8],t[9]!==s||t[10]!==i?(S=e=>{s("*"===e?{field:"*",fn:"count",type:"quantitative"}:{field:e,type:i.vlType(e)})},t[9]=s,t[10]=i,t[11]=S):S=t[11];const N=g?d:void 0;let w,C,A,O,k,M,I,U,F,D,_,j;return t[12]!==l?(w=l(),t[12]=l,t[13]=w):w=t[13],t[14]!==N||t[15]!==w?(C=r.jsx(h,{className:"min-w-[140px] lg:min-w-[210px] h-full",onClear:N,children:w}),t[14]=N,t[15]=w,t[16]=C):C=t[16],t[17]!==i?(A=i.fieldNames().map((e=>r.jsx(x,{value:e.toString(),children:r.jsxs("span",{className:"flex items-center gap-2 flex-1",children:[ka[i.primitiveType(e)],r.jsx("span",{className:"flex-1",children:e}),r.jsxs("span",{className:"text-muted-foreground text-xs font-semibold",children:["(",i.vlType(e),")"]})]})},e))),t[17]=i,t[18]=A):A=t[18],t[19]!==i?(O=0===i.fieldNames().length&&r.jsx(x,{disabled:!0,value:"--",children:"No columns"}),t[19]=i,t[20]=O):O=t[20],t[21]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(T,{}),t[21]=k):k=t[21],t[22]===Symbol.for("react.memo_cache_sentinel")?(M=r.jsx(x,{value:"*",children:r.jsxs("span",{className:"flex items-center gap-1 flex-1",children:[ka[Io.NUMBER],r.jsx("span",{className:"flex-1",children:"Count"})]})},"*"),t[22]=M):M=t[22],t[23]!==O||t[24]!==A?(I=r.jsx(m,{children:r.jsxs(y,{children:[A,O,k,M]})}),t[23]=O,t[24]=A,t[25]=I):I=t[25],t[26]!==a||t[27]!==g||t[28]!==I||t[29]!==S||t[30]!==C?(U=r.jsxs(b,{value:g,disabled:a,onValueChange:S,children:[C,I]}),t[26]=a,t[27]=g,t[28]=I,t[29]=S,t[30]=C,t[31]=U):U=t[31],t[32]!==o||t[33]!==s?(F=o&&r.jsx(as,{field:o,onChange:s}),t[32]=o,t[33]=s,t[34]=F):F=t[34],t[35]!==F?(D=r.jsx("div",{className:"w-[26px]",children:F}),t[35]=F,t[36]=D):D=t[36],t[37]!==U||t[38]!==D?(_=r.jsxs("div",{className:"flex flex-row gap-1 h-[26px]",children:[U,D]}),t[37]=U,t[38]=D,t[39]=_):_=t[39],t[40]!==_||t[41]!==v?(j=r.jsxs(r.Fragment,{children:[v,_]}),t[40]=_,t[41]=v,t[42]=j):j=t[42],j},os="__",as=e=>{const t=f.c(15),{field:n,onChange:i}=e;if("*"===n.field)return null;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];let a=o;if(n.type===Zn.QUANTITATIVE){let e;t[1]===Symbol.for("react.memo_cache_sentinel")?(e=[["",_a]],t[1]=e):e=t[1],a=e}if(n.type===Zn.TEMPORAL){let e;t[2]===Symbol.for("react.memo_cache_sentinel")?(e=[["Single",ja],["Multi",Pa]],t[2]=e):e=t[2],a=e}if(a.length>0){let e,o,s,c,l,u;return t[3]!==n||t[4]!==i?(e=e=>{i({...n,fn:e===os?void 0:e})},t[3]=n,t[4]=i,t[5]=e):e=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(h,{className:"h-full px-1",hideChevron:!0,variant:"ghost",children:r.jsx(S,{size:14,strokeWidth:1.5})}),t[6]=o):o=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx(y,{children:r.jsx(x,{value:os,children:"None"})}),c=r.jsx(T,{}),t[7]=s,t[8]=c):(s=t[7],c=t[8]),t[9]!==a?(l=r.jsxs(m,{children:[s,c,a.map(ls)]}),t[9]=a,t[10]=l):l=t[10],t[11]!==n.fn||t[12]!==e||t[13]!==l?(u=r.jsxs(b,{"data-testid":"marimo-plugin-data-explorer-field-options",value:n.fn,onValueChange:e,children:[o,l]}),t[11]=n.fn,t[12]=e,t[13]=l,t[14]=u):u=t[14],u}return null};function ss(e){return r.jsx(x,{value:e,children:e===An?"auto":e},e)}function cs(e){return r.jsx(x,{value:e??os,children:N(e)},e)}function ls(e){const[t,n]=e;return r.jsxs(y,{children:[t&&r.jsx(v,{children:t}),n.map(cs)]},t)}const us=e=>{const t=f.c(26),{schema:n}=e,[i,o]=w.useState(),[a,s]=w.useState();let c;if(t[0]!==n||t[1]!==i||t[2]!==a){const e=n.fieldNames(),l=i?n.stats({field:i,channel:"x"}):void 0;let u;t[4]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx(H,{className:"text-muted-foreground",width:40,height:40,strokeWidth:1.5}),t[4]=u):u=t[4];const d=u,f=a?e:e.slice(0,12),p=e.length>12,v=e.length>0?e.length:"No";let E,T;t[5]!==v?(E=r.jsxs("span",{className:"text-muted-foreground font-semibold",children:[v," fields"]}),t[5]=v,t[6]=E):E=t[6],t[7]!==n||t[8]!==i?(T=e=>{const t=n.cardinality({channel:"x",field:e});return r.jsxs("span",{className:C("hover:bg-muted self-start px-2 py-2 rounded flex flex-row gap-1 items-center cursor-pointer lg:justify-center text-sm truncate flex-shrink-0 overflow-hidden",i===e&&"bg-muted"),onClick:()=>{o(i!==e?e:void 0)},children:[ka[n.primitiveType(e)],e,t>1&&r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",t,")"]})]},e)},t[7]=n,t[8]=i,t[9]=T):T=t[9];const S=f.map(T);let N,w;t[10]!==p||t[11]!==a?(N=p&&r.jsx(A,{"data-testid":"marimo-plugin-data-explorer-show-more-columns",variant:"link",size:"sm",className:"self-center col-span-3 -mt-1",onClick:()=>s(ps),children:a?"Show less":"Show more"}),t[10]=p,t[11]=a,t[12]=N):N=t[12],t[13]!==S||t[14]!==N?(w=r.jsxs("div",{className:"hidden lg:grid grid-cols-2 xl:grid-cols-3 gap-2 p-2 bg-[var(--slate-1)] border rounded lg:items-center items-start w-fit grid-flow-dense max-h-[300px] overflow-auto",children:[S,N]}),t[13]=S,t[14]=N,t[15]=w):w=t[15];const O=i||"",k=0===e.length;let M,I,U,F,D;t[16]===Symbol.for("react.memo_cache_sentinel")?(M=e=>{o(e)},t[16]=M):M=t[16],t[17]===Symbol.for("react.memo_cache_sentinel")?(I=r.jsx(h,{className:"min-w-[210px] h-full",children:r.jsx(g,{placeholder:"Select a column"})}),t[17]=I):I=t[17],t[18]!==n?(U=n.fieldNames().map((e=>r.jsx(x,{value:e.toString(),children:r.jsxs("span",{className:"flex items-center gap-2 flex-1",children:[ka[n.primitiveType(e)],r.jsx("span",{className:"flex-1",children:e}),r.jsxs("span",{className:"text-muted-foreground text-xs font-semibold",children:["(",n.vlType(e),")"]})]})},e))),t[18]=n,t[19]=U):U=t[19],t[20]!==U?(F=r.jsx(m,{children:r.jsx(y,{children:U})}),t[20]=U,t[21]=F):F=t[21],t[22]!==k||t[23]!==F||t[24]!==O?(D=r.jsx("div",{className:"lg:hidden",children:r.jsxs(b,{"data-testid":"marimo-plugin-data-explorer-column-select",value:O,disabled:k,onValueChange:M,children:[I,F]})}),t[22]=k,t[23]=F,t[24]=O,t[25]=D):D=t[25],c=r.jsxs("div",{className:"flex flex-col justify-center items-center h-full flex-1 gap-2",children:[d,E,w,D,i&&r.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-2 p-2 text-sm",children:ds.map((e=>r.jsxs("div",{className:"flex flex-row gap-2 min-w-[100px]",children:[r.jsx("span",{className:"font-semibold",children:e}),r.jsx("span",{children:fs(null==l?void 0:l[e])})]},e)))})]}),t[0]=n,t[1]=i,t[2]=a,t[3]=c}else c=t[3];return c},ds=["distinct","min","max","mean","median","q1","q3","stdev"];function fs(e){return"number"==typeof e?new Intl.NumberFormat("en-US",{maximumFractionDigits:2}).format(e):"string"==typeof e?e:"object"==typeof e&&e instanceof Date?new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(e):String(e)}function ps(e){return!e}const hs=e=>{const t=f.c(5);let n,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=j(),t[0]=i):i=t[0],n=i;const o=n;let a,s;return t[1]!==e?(a=()=>{const t=o.sub(Ka,(()=>{const t=o.get(Ka),{schema:n,...r}=t;e.setValue(r)})),n=e.value;return n&&Object.keys(n).length>0&&o.set(Ka,n),t},t[1]=e,t[2]=a):a=t[2],O(a),t[3]!==e?(s=r.jsx(k,{store:o,children:r.jsx(ys,{...e})}),t[3]=e,t[4]=s):s=t[4],s},gs={export:{svg:!0,png:!0},source:!1,compiled:!1,editor:!1},ms={left:20,right:20,top:20,bottom:20},ys=e=>{var t,n,i,o,a,s,c,l,u,d,h,g,m,y;const v=f.c(43),{data:b}=e,x=Xa();let E,T;v[0]!==x||v[1]!==b?(E=async()=>{if(!b)return{};const e=await P(b,{type:"csv",parse:"auto"},{replacePeriod:!0}),t=function(e,t={},n={fields:[]}){t=It.extend({},$n,t);let r=No.summary(e),i=xo.inferAll(e),o=n.fields.reduce(((e,t)=>(e[t.name]=t,e)),{}),a=r.map((function(n,r){const a=n.field,s="date"===i[a]?Io.DATETIME:i[a];let c,l=n.distinct;if(s===Io.NUMBER)c=lt;else if(s===Io.INTEGER)c=l<t.numberNominalLimit&&l/n.count<t.numberNominalProportion?ft:lt;else if(s===Io.DATETIME){c=dt,n.min=new Date(e[0][a]),n.max=new Date(e[0][a]);for(const t of e){const e=new Date(t[a]).getTime();e<n.min.getTime()&&(n.min=new Date(e)),e>n.max.getTime()&&(n.max=new Date(e))}}else c=ft;c===ft&&l/n.count>t.minPercentUniqueForKey&&n.count>t.minCardinalityForKey&&(c=Zn.KEY);let u={name:a,originalIndex:r,vlType:c,type:s,stats:n,timeStats:{},binStats:{}};const d=o[u.name];return u=It.extend(u,d),u}));for(let c of a)if(c.vlType===lt)for(let e of t.enum.binProps.maxbins)c.binStats[e]=Oo(e,c.stats);else if(c.vlType===dt)for(let e of t.enum.timeUnit)void 0!==e&&(c.timeStats[e]=ko(e,c.stats));const s=Object.assign({},n,{fields:a});return new Ao(s)}(e);return x.setSchema(t),{chartData:e,schema:t}},v[0]=x,v[1]=b,v[2]=E):E=v[2],v[3]!==b?(T=[b],v[3]=b,v[4]=T):T=v[4];const{data:S,loading:N,error:w}=M(E,T),{mark:C}=p(Ka),O=p(Za),{theme:k}=I();if(w){let e;return v[5]!==w?(e=r.jsx(R,{error:w}),v[5]=w,v[6]=e):e=v[6],e}if(!S){let e;return v[7]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{}),v[7]=e):e=v[7],e}const{chartData:_,schema:j}=S;if(N||!j){let e;return v[8]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{}),v[8]=e):e=v[8],e}const $=null==(n=null==(t=O.main)?void 0:t.plots)?void 0:n[0];let B,L,H,G,z,Y;if(v[9]!==x||v[10]!==_||v[11]!==(null==(i=O.addCategoricalField)?void 0:i.plots)||v[12]!==(null==(o=O.addQuantitativeField)?void 0:o.plots)||v[13]!==(null==(a=O.addTemporalField)?void 0:a.plots)||v[14]!==(null==(s=O.histograms)?void 0:s.plots)||v[15]!==$||v[16]!==C||v[17]!==j||v[18]!==k){const e=new Set(null==$?void 0:$.fieldInfos.map(Es));let t;v[23]!==_||v[24]!==$||v[25]!==j||v[26]!==k?(t=()=>$?r.jsx("div",{className:"flex overflow-y-auto justify-center items-center flex-1 w-[90%]",children:r.jsx(W,{data:{source:_},padding:ms,actions:gs,spec:xs($.spec),theme:"dark"===k?"dark":void 0})}):r.jsx(us,{schema:j}),v[23]=_,v[24]=$,v[25]=j,v[26]=k,v[27]=t):t=v[27];const n=t;let i,o;H="flex flex-col gap-2",v[28]!==C||v[29]!==j?(i=r.jsx(rs,{mark:C,schema:j}),v[28]=C,v[29]=j,v[30]=i):i=v[30],v[31]!==n?(o=n(),v[31]=n,v[32]=o):o=v[32],v[33]!==i||v[34]!==o?(G=r.jsxs("div",{className:"flex items-center gap-2",children:[i,o]}),v[33]=i,v[34]=o,v[35]=G):G=v[35],B=vs,L=[null==(c=O.histograms)?void 0:c.plots,null==(l=O.addCategoricalField)?void 0:l.plots,null==(u=O.addQuantitativeField)?void 0:u.plots,null==(d=O.addTemporalField)?void 0:d.plots].filter(Boolean).flat().map(((t,n)=>r.jsx(bs,{title:r.jsx("div",{className:"flex flex-row gap-1",children:t.fieldInfos.map((t=>{const n="*"===t.fieldDef.field?"Count":t.fieldDef.fn?`${t.fieldDef.fn}(${t.fieldDef.field})`:t.fieldDef.field.toString();return r.jsx(U,{variant:e.has(t.fieldDef.field)?"secondary":"defaultOutline",children:n},n)}))}),actions:r.jsx(F,{content:"Make main plot",children:r.jsx(A,{"data-testid":"marimo-plugin-data-explorer-make-main-plot",variant:"text",size:"icon",onClick:()=>{const e=D.fromEntries(t.fieldInfos.map(Ts));x.setEncoding(e)},children:r.jsx(q,{className:"w-4 h-4"})})}),children:r.jsx(W,{data:{source:_},actions:!1,spec:t.spec,theme:"dark"===k?"dark":void 0},n)},n))),v[9]=x,v[10]=_,v[11]=null==(h=O.addCategoricalField)?void 0:h.plots,v[12]=null==(g=O.addQuantitativeField)?void 0:g.plots,v[13]=null==(m=O.addTemporalField)?void 0:m.plots,v[14]=null==(y=O.histograms)?void 0:y.plots,v[15]=$,v[16]=C,v[17]=j,v[18]=k,v[19]=B,v[20]=L,v[21]=H,v[22]=G}else B=v[19],L=v[20],H=v[21],G=v[22];return v[36]!==B||v[37]!==L?(z=r.jsx(B,{children:L}),v[36]=B,v[37]=L,v[38]=z):z=v[38],v[39]!==H||v[40]!==G||v[41]!==z?(Y=r.jsxs("div",{className:H,children:[G,z]}),v[39]=H,v[40]=G,v[41]=z,v[42]=Y):Y=v[42],Y},vs=e=>{const t=f.c(2),{children:n}=e;if(0===_.Children.count(n))return null;let i;return t[0]!==n?(i=r.jsx("div",{className:"flex flex-row overflow-x-auto overflow-y-hidden gap-4 snap-x pb-4",children:n}),t[0]=n,t[1]=i):i=t[1],i},bs=e=>{const t=f.c(10),{title:n,children:i,actions:o}=e;let a,s,c,l;return t[0]!==n?(a=r.jsx("div",{className:"text-sm font-medium",children:n}),t[0]=n,t[1]=a):a=t[1],t[2]!==o||t[3]!==a?(s=r.jsxs("div",{className:"flex flex-row justify-between items-center bg-[var(--slate-3)] py-0.5 px-2",children:[a,o]}),t[2]=o,t[3]=a,t[4]=s):s=t[4],t[5]!==i?(c=r.jsx("div",{className:"px-6 pt-2 max-h-[280px] overflow-y-auto",children:i}),t[5]=i,t[6]=c):c=t[6],t[7]!==s||t[8]!==c?(l=r.jsxs("div",{className:"flex-shrink-0 bg-card shadow-md border overflow-hidden rounded snap-start",children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l};function xs(e){var t,n;return Boolean((null==(t=e.encoding)?void 0:t.row)||(null==(n=e.encoding)?void 0:n.column))||(e.width="container"),e}function Es(e){return e.fieldDef.field}function Ts(e){return[e.channel,e.fieldDef]}export{ys as DataExplorerComponent,hs as default};
@@ -1,11 +0,0 @@
1
- var e;import{g as t,co as n,cp as r,cq as i,cr as o,cs as a,ct as s,R as l,cu as c}from"./index-BhVxrMm_.js";import{a as h,b as p,c as f,d,e as u,f as g,g as m,h as v,i as E,j as b,k as y,l as w,m as O,n as A,o as x,p as N,q as I,r as S,s as R,t as L,u as $,v as T,w as D,x as C,y as F,z as k,A as P,B as _,C as j,D as M,E as z,F as U,G as B,H as G,I as V,J as W,K as X,L as H,N as q,O as Y,P as J,Q,R as K,S as Z,T as ee}from"./compile-BgV4bhlK.js";import{e as te}from"./index-6w92-PnA.js";const ne="5.23.0",re=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:h,accessPathWithDatum:p,accessWithDatumToUnescapedPath:f,compile:d,contains:u,deepEqual:g,deleteNestedProperty:m,duplicate:v,entries:E,every:b,fieldIntersection:y,flatAccessWithDatum:w,getFirstDefined:O,hasIntersection:A,hasProperty:x,hash:N,internalField:I,isBoolean:S,isEmpty:R,isEqual:L,isInternalField:$,isNullOrFalse:T,isNumeric:D,keys:C,logicalExpr:F,mergeDeep:k,never:P,normalize:_,normalizeAngle:j,omit:M,pick:z,prefixGenerator:U,removePathFromField:B,replaceAll:G,replacePathInField:V,resetIdCounter:W,setEqual:X,some:H,stringify:q,titleCase:Y,unique:J,uniqueId:Q,vals:K,varName:Z,version:ne},Symbol.toStringTag,{value:"Module"})),ie={};function oe(e,t){void 0===e&&(e=ie),void 0===t&&(t=ie);const n=Object.keys(e),r=Object.keys(t);return e===t||n.length===r.length&&n.every((n=>e[n]===t[n]))}
2
- /*!
3
- * https://github.com/Starcounter-Jack/JSON-Patch
4
- * (c) 2017-2022 Joachim Wester
5
- * MIT licensed
6
- */var ae=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),se=Object.prototype.hasOwnProperty;function le(e,t){return se.call(e,t)}function ce(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var r=[];for(var i in e)le(e,i)&&r.push(i);return r}function he(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function pe(e){for(var t,n=0,r=e.length;n<r;){if(!((t=e.charCodeAt(n))>=48&&t<=57))return!1;n++}return!0}function fe(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function de(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ue(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(ue(e[t]))return!0}else if("object"==typeof e)for(var r=ce(e),i=r.length,o=0;o<i;o++)if(ue(e[r[o]]))return!0;return!1}function ge(e,t){var n=[e];for(var r in t){var i="object"==typeof t[r]?JSON.stringify(t[r],null,2):t[r];void 0!==i&&n.push(r+": "+i)}return n.join("\n")}var me=function(e){function t(t,n,r,i,o){var a=this.constructor,s=e.call(this,ge(t,{name:n,index:r,operation:i,tree:o}))||this;return s.name=n,s.index=r,s.operation=i,s.tree=o,Object.setPrototypeOf(s,a.prototype),s.message=ge(t,{name:n,index:r,operation:i,tree:o}),s}return ae(t,e),t}(Error),ve=me,Ee=he,be={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=we(n,this.path);r&&(r=he(r));var i=Oe(n,{op:"remove",path:this.from}).removed;return Oe(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=we(n,this.from);return Oe(n,{op:"add",path:this.path,value:he(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:Ie(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},ye={add:function(e,t,n){return pe(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:be.move,copy:be.copy,test:be.test,_get:be._get};function we(e,t){if(""==t)return e;var n={op:"_get",path:t};return Oe(e,n),n.value}function Oe(e,t,n,r,i,o){if(void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===i&&(i=!0),void 0===o&&(o=0),n&&("function"==typeof n?n(t,0,e,t.path):xe(t,0)),""===t.path){var a={newDocument:e};if("add"===t.op)return a.newDocument=t.value,a;if("replace"===t.op)return a.newDocument=t.value,a.removed=e,a;if("move"===t.op||"copy"===t.op)return a.newDocument=we(e,t.from),"move"===t.op&&(a.removed=e),a;if("test"===t.op){if(a.test=Ie(e,t.value),!1===a.test)throw new ve("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a.newDocument=e,a}if("remove"===t.op)return a.removed=e,a.newDocument=null,a;if("_get"===t.op)return t.value=e,a;if(n)throw new ve("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return a}r||(e=he(e));var s=(t.path||"").split("/"),l=e,c=1,h=s.length,p=void 0,f=void 0,d=void 0;for(d="function"==typeof n?n:xe;;){if((f=s[c])&&-1!=f.indexOf("~")&&(f=de(f)),i&&("__proto__"==f||"prototype"==f&&c>0&&"constructor"==s[c-1]))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");if(n&&void 0===p&&(void 0===l[f]?p=s.slice(0,c).join("/"):c==h-1&&(p=t.path),void 0!==p&&d(t,0,e,p)),c++,Array.isArray(l)){if("-"===f)f=l.length;else{if(n&&!pe(f))throw new ve("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",o,t,e);pe(f)&&(f=~~f)}if(c>=h){if(n&&"add"===t.op&&f>l.length)throw new ve("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=ye[t.op].call(t,l,f,e)).test)throw new ve("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(c>=h){if(!1===(a=be[t.op].call(t,l,f,e)).test)throw new ve("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(l=l[f],n&&c<h&&(!l||"object"!=typeof l))throw new ve("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}function Ae(e,t,n,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),n&&!Array.isArray(t))throw new ve("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(e=he(e));for(var o=new Array(t.length),a=0,s=t.length;a<s;a++)o[a]=Oe(e,t[a],n,!0,i,a),e=o[a].newDocument;return o.newDocument=e,o}function xe(e,t,n,r){if("object"!=typeof e||null===e||Array.isArray(e))throw new ve("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(!be[e.op])throw new ve("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n);if("string"!=typeof e.path)throw new ve("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new ve('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new ve("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new ve("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&ue(e.value))throw new ve("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var i=e.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new ve("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==r)throw new ve("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var a=Ne([{op:"_get",path:e.from,value:void 0}],n);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new ve("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function Ne(e,t,n){try{if(!Array.isArray(e))throw new ve("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Ae(he(t),he(e),n||!0);else{n=n||xe;for(var r=0;r<e.length;r++)n(e[r],r,t,void 0)}}catch(i){if(i instanceof ve)return i;throw i}}function Ie(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var n,r,i,o=Array.isArray(e),a=Array.isArray(t);if(o&&a){if((r=e.length)!=t.length)return!1;for(n=r;0!=n--;)if(!Ie(e[n],t[n]))return!1;return!0}if(o!=a)return!1;var s=Object.keys(e);if((r=s.length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!t.hasOwnProperty(s[n]))return!1;for(n=r;0!=n--;)if(!Ie(e[i=s[n]],t[i]))return!1;return!0}return e!=e&&t!=t}const Se=Object.freeze(Object.defineProperty({__proto__:null,JsonPatchError:ve,_areEquals:Ie,applyOperation:Oe,applyPatch:Ae,applyReducer:function(e,t,n){var r=Oe(e,t);if(!1===r.test)throw new ve("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return r.newDocument},deepClone:Ee,getValueByPointer:we,validate:Ne,validator:xe},Symbol.toStringTag,{value:"Module"}));
7
- /*!
8
- * https://github.com/Starcounter-Jack/JSON-Patch
9
- * (c) 2017-2021 Joachim Wester
10
- * MIT license
11
- */var Re=new WeakMap,Le=function(){return function(e){this.observers=new Map,this.obj=e}}(),$e=function(){return function(e,t){this.callback=e,this.observer=t}}();function Te(e,t){void 0===t&&(t=!1);var n=Re.get(e.object);De(n.value,e.object,e.patches,"",t),e.patches.length&&Ae(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function De(e,t,n,r,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=ce(t),a=ce(e),s=!1,l=a.length-1;l>=0;l--){var c=e[p=a[l]];if(!le(t,p)||void 0===t[p]&&void 0!==c&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+fe(p),value:he(c)}),n.push({op:"remove",path:r+"/"+fe(p)}),s=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}));else{var h=t[p];"object"==typeof c&&null!=c&&"object"==typeof h&&null!=h&&Array.isArray(c)===Array.isArray(h)?De(c,h,n,r+"/"+fe(p),i):c!==h&&(i&&n.push({op:"test",path:r+"/"+fe(p),value:he(c)}),n.push({op:"replace",path:r+"/"+fe(p),value:he(h)}))}}if(s||o.length!=a.length)for(l=0;l<o.length;l++){var p;le(e,p=o[l])||void 0===t[p]||n.push({op:"add",path:r+"/"+fe(p),value:he(t[p])})}}}const Ce=Object.freeze(Object.defineProperty({__proto__:null,compare:function(e,t,n){void 0===n&&(n=!1);var r=[];return De(e,t,r,"",n),r},generate:Te,observe:function(e,t){var n,r=function(e){return Re.get(e)}(e);if(r){var i=function(e,t){return e.observers.get(t)}(r,t);n=i&&i.observer}else r=new Le(e),Re.set(e,r);if(n)return n;if(n={},r.value=he(e),t){n.callback=t,n.next=null;var o=function(){Te(n)},a=function(){clearTimeout(n.next),n.next=setTimeout(o)};"undefined"!=typeof window&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return n.patches=[],n.object=e,n.unobserve=function(){Te(n),clearTimeout(n.next),function(e,t){e.observers.delete(t.callback)}(r,n),"undefined"!=typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(t,new $e(t,n)),n},unobserve:function(e,t){t.unobserve()}},Symbol.toStringTag,{value:"Module"}));Object.assign({},Se,Ce,{JsonPatchError:me,deepClone:he,escapePathComponent:fe,unescapePathComponent:de});var Fe=/("(?:[^\\"]|\\.)*")|[:,]/g;const ke=t((function(e,t){var n,r,i;return t=t||{},n=JSON.stringify([1],void 0,void 0===t.indent?2:t.indent).slice(2,-3),r=""===n?1/0:void 0===t.maxLength?80:t.maxLength,i=t.replacer,function e(t,o,a){var s,l,c,h,p,f,d,u,g,m,v,E;if(t&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===(v=JSON.stringify(t,i)))return v;if(d=r-o.length-a,v.length<=d&&(g=v.replace(Fe,(function(e,t){return t||e+" "}))).length<=d)return g;if(null!=i&&(t=JSON.parse(v),i=void 0),"object"==typeof t&&null!==t){if(u=o+n,c=[],l=0,Array.isArray(t))for(m="[",s="]",d=t.length;l<d;l++)c.push(e(t[l],u,l===d-1?0:1)||"null");else for(m="{",s="}",d=(f=Object.keys(t)).length;l<d;l++)h=f[l],p=JSON.stringify(h)+": ",void 0!==(E=e(t[h],u,p.length+(l===d-1?0:1)))&&c.push(p+E);if(c.length>0)return[m,n+c.join(",\n"+u),s].join("\n"+o)}return v}(e,"",0)}));var Pe={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},_e={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<<t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},je={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const Me=Array.prototype.slice,ze=(e,t,n)=>{const r=n?n(t[0]):t[0];return r[e].apply(r,Me.call(t,1))};var Ue={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:(e,t,n,r,i,o,a)=>new Date(e,t||0,null!=n?n:1,r||0,i||0,o||0,a||0),date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return ze("join",arguments)},indexof:function(){return ze("indexOf",arguments)},lastindexof:function(){return ze("lastIndexOf",arguments)},slice:function(){return ze("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat:parseFloat,parseInt:parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return ze("substring",arguments,String)},split:function(){return ze("split",arguments,String)},replace:function(){return ze("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const Be=["view","item","group","xy","x","y"],Ge=new Set([Function,eval,setTimeout,setInterval]);"function"==typeof setImmediate&&Ge.add(setImmediate);const Ve={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:"datum"===n?e.datum:"event"===n?e.event:"item"===n?e.item:Pe[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);const i=e(t.property);if(n&&(e.memberDepth-=1),!Ge.has(r[i]))return r[i];console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`)},CallExpression:(e,t)=>{const n=t.arguments;let r=t.callee.name;return r.startsWith("_")&&(r=r.slice(1)),"if"===r?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||Ue[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>_e[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>je[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>"&&"===t.operator?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce(((t,n)=>{e.memberDepth+=1;const r=e(n.key);return e.memberDepth-=1,Ge.has(e(n.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):t[r]=e(n.value),t}),{})};function We(e,t,n,r,i,o){const a=e=>Ve[e.type](a,e);return a.memberDepth=0,a.fn=Object.create(t),a.params=n,a.datum=r,a.event=i,a.item=o,Be.forEach((e=>a.fn[e]=function(){return i.vega[e](...arguments)})),a(e)}var Xe={operator(e,t){const n=t.ast,r=e.functions;return e=>We(n,r,e)},parameter(e,t){const n=t.ast,r=e.functions;return(e,t)=>We(n,r,t,e)},event(e,t){const n=t.ast,r=e.functions;return e=>We(n,r,void 0,void 0,e)},handler(e,t){const n=t.ast,r=e.functions;return(e,t)=>{const i=t.item&&t.item.datum;return We(n,r,e,i,t)}},encode(e,t){const{marktype:n,channels:r}=t,i=e.functions,o="group"===n||"image"===n||"rect"===n;return(e,t)=>{const a=e.datum;let s,l=0;for(const n in r)s=We(r[n].ast,i,t,a,void 0,e),e[n]!==s&&(e[n]=s,l=1);return"rule"!==n&&function(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}(e,r,o),l}}};function He(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var qe="2.14.0";const Ye="#fff",Je="#888",Qe={background:"#333",view:{stroke:Je},title:{color:Ye,subtitleColor:Ye},style:{"guide-label":{fill:Ye},"guide-title":{fill:Ye}},axis:{domainColor:Ye,gridColor:Je,tickColor:Ye}},Ke="#4572a7",Ze={background:"#fff",arc:{fill:Ke},area:{fill:Ke},line:{stroke:Ke,strokeWidth:2},path:{stroke:Ke},rect:{fill:Ke},shape:{stroke:Ke},symbol:{fill:Ke,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},et="#30a2da",tt="#cbcbcb",nt="#f0f0f0",rt="#333",it={arc:{fill:et},area:{fill:et},axis:{domainColor:tt,grid:!0,gridColor:tt,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:tt,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:nt,group:{fill:nt},legend:{labelColor:rt,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:rt,titleFontSize:14,titlePadding:10},line:{stroke:et,strokeWidth:2},path:{stroke:et,strokeWidth:.5},rect:{fill:et},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:et},bar:{binSpacing:2,fill:et,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},ot="#000",at={group:{fill:"#e5e5e5"},arc:{fill:ot},area:{fill:ot},line:{stroke:ot},path:{stroke:ot},rect:{fill:ot},shape:{stroke:ot},symbol:{fill:ot,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},st="Benton Gothic, sans-serif",lt="#82c6df",ct="Benton Gothic Bold, sans-serif",ht="normal",pt={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},ft={background:"#ffffff",title:{anchor:"start",color:"#000000",font:ct,fontSize:22,fontWeight:"normal"},arc:{fill:lt},area:{fill:lt},line:{stroke:lt,strokeWidth:2},path:{stroke:lt},rect:{fill:lt},shape:{stroke:lt},symbol:{fill:lt,size:30},axis:{labelFont:st,labelFontSize:11.5,labelFontWeight:"normal",titleFont:ct,titleFontSize:13,titleFontWeight:ht},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:st,labelFontSize:11.5,symbolType:"square",titleFont:ct,titleFontSize:13,titleFontWeight:ht},range:{category:pt["category-6"],diverging:pt["fireandice-6"],heatmap:pt["fire-7"],ordinal:pt["fire-7"],ramp:pt["fire-7"]}},dt="#ab5787",ut="#979797",gt={background:"#f9f9f9",arc:{fill:dt},area:{fill:dt},line:{stroke:dt},path:{stroke:dt},rect:{fill:dt},shape:{stroke:dt},symbol:{fill:dt,size:30},axis:{domainColor:ut,domainWidth:.5,gridWidth:.2,labelColor:ut,tickColor:ut,tickWidth:.2,titleColor:ut},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},mt="#3e5c69",vt={background:"#fff",arc:{fill:mt},area:{fill:mt},line:{stroke:mt},path:{stroke:mt},rect:{fill:mt},shape:{stroke:mt},symbol:{fill:mt},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},Et="#1696d2",bt="#000000",yt="Lato",wt="Lato",Ot={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},At={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:yt},axisX:{domain:!0,domainColor:bt,domainWidth:1,grid:!1,labelFontSize:12,labelFont:wt,labelAngle:0,tickColor:bt,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:yt},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:wt,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:yt,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:wt,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:yt,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:Ot["six-groups-cat-1"],diverging:Ot["diverging-colors"],heatmap:Ot["diverging-colors"],ordinal:Ot["six-groups-seq"],ramp:Ot["shades-blue"]},area:{fill:Et},rect:{fill:Et},line:{color:Et,stroke:Et,strokeWidth:5},trail:{color:Et,stroke:Et,strokeWidth:0,size:1},path:{stroke:Et,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:Et,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Et,stroke:null}},arc:{fill:Et},shape:{stroke:Et},symbol:{fill:Et,size:30}},xt="#3366CC",Nt="#ccc",It="Arial, sans-serif",St={arc:{fill:xt},area:{fill:xt},path:{stroke:xt},rect:{fill:xt},shape:{stroke:xt},symbol:{stroke:xt},circle:{fill:xt},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:It,fontSize:12},"guide-title":{font:It,fontSize:12},"group-title":{font:It,fontSize:12}},title:{font:It,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:Nt,tickColor:Nt,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Rt=e=>e*(1/3+1),Lt=Rt(9),$t=Rt(10),Tt=Rt(12),Dt="Segoe UI",Ct="wf_standard-font, helvetica, arial, sans-serif",Ft="#252423",kt="#605E5C",Pt="transparent",_t="#118DFF",jt="#DEEFFF",Mt=[jt,_t],zt={view:{stroke:Pt},background:Pt,font:Dt,header:{titleFont:Ct,titleFontSize:Tt,titleColor:Ft,labelFont:Dt,labelFontSize:$t,labelColor:kt},axis:{ticks:!1,grid:!1,domain:!1,labelColor:kt,labelFontSize:Lt,titleFont:Ct,titleColor:Ft,titleFontSize:Tt,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:"#C8C6C4",gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:_t},line:{stroke:_t,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Dt,fontSize:Lt,fill:kt},arc:{fill:_t},area:{fill:_t,line:!0,opacity:.6},path:{stroke:_t},rect:{fill:_t},point:{fill:_t,filled:!0,size:75},shape:{stroke:_t},symbol:{fill:_t,strokeWidth:1.5,size:50},legend:{titleFont:Dt,titleFontWeight:"bold",titleColor:kt,labelFont:Dt,labelFontSize:$t,labelColor:kt,symbolType:"circle",symbolSize:75},range:{category:[_t,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:Mt,heatmap:Mt,ordinal:[jt,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",_t]}},Ut='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',Bt=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Gt=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function Vt({type:e,background:t}){const n="dark"===e?"#161616":"#ffffff",r="dark"===e?"#f4f4f4":"#161616",i="dark"===e?"#d4bbff":"#6929c4";return{background:t,arc:{fill:i},area:{fill:i},path:{stroke:i},rect:{fill:i},shape:{stroke:i},symbol:{stroke:i},circle:{fill:i},view:{fill:n,stroke:n},group:{fill:n},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:Ut,fontWeight:600},axis:{labelColor:r,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:r,labelAngle:0},style:{"guide-label":{font:Ut,fill:r,fontWeight:400},"guide-title":{font:Ut,fill:r,fontWeight:400}},range:{category:"dark"===e?Bt:Gt,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const Wt=Vt({type:"light",background:"#ffffff"}),Xt=Vt({type:"light",background:"#f4f4f4"}),Ht=Vt({type:"dark",background:"#262626"}),qt=Vt({type:"dark",background:"#161616"}),Yt=qe,Jt=Object.freeze(Object.defineProperty({__proto__:null,carbong10:Xt,carbong100:qt,carbong90:Ht,carbonwhite:Wt,dark:Qe,excel:Ze,fivethirtyeight:it,ggplot2:at,googlecharts:St,latimes:ft,powerbi:zt,quartz:gt,urbaninstitute:At,version:Yt,vox:vt},Symbol.toStringTag,{value:"Module"}));function Qt(e,t){return JSON.stringify(e,function(e){const t=[];return function(n,r){if("object"!=typeof r||null===r)return r;const i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}(t))}var Kt="#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n";const Zt="vg-tooltip-element",en={offsetX:10,offsetY:10,id:Zt,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")},maxDepth:2,formatTooltip:function(e,t,o){if(n(e))return`[${e.map((e=>t(r(e)?e:Qt(e,o)))).join(", ")}]`;if(i(e)){let n="";const{title:r,image:a,...s}=e;r&&(n+=`<h2>${t(r)}</h2>`),a&&(n+=`<img src="${t(a)}">`);const l=Object.keys(s);if(l.length>0){n+="<table>";for(const e of l){let r=s[e];void 0!==r&&(i(r)&&(r=Qt(r,o)),n+=`<tr><td class="key">${t(e)}</td><td class="value">${t(r)}</td></tr>`)}n+="</table>"}return n||"{}"}return t(e)}};class tn{constructor(e){this.options={...en,...e};const t=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId),e.innerHTML=function(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Kt.toString().replace(Zt,e)}(t);const n=document.head;n.childNodes.length>0?n.insertBefore(e,n.childNodes[0]):n.appendChild(e)}}tooltipHandler(e,t,n,r){if(this.el=document.getElementById(this.options.id),!this.el){this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip");(document.fullscreenElement??document.body).appendChild(this.el)}if(null==r||""===r)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:i,y:o}=function(e,t,n,r){let i=e.clientX+n;i+t.width>window.innerWidth&&(i=+e.clientX-n-t.width);let o=e.clientY+r;return o+t.height>window.innerHeight&&(o=+e.clientY-r-t.height),{x:i,y:o}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${o}px`,this.el.style.left=`${i}px`}}var nn,rn,on={};function an(e){return(an="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sn(e){var t=function(e,t){if("object"!==an(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==an(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===an(t)?t:String(t)}function ln(e,t,n){return(t=sn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cn(e){return e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hn=pn;function pn(e){var t=this;if(t instanceof pn||(t=new pn),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}function fn(e,t,n){var r=t===e.head?new gn(n,null,t,e):new gn(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function dn(e,t){e.tail=new gn(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function un(e,t){e.head=new gn(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function gn(e,t,n,r){if(!(this instanceof gn))return new gn(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}pn.Node=gn,pn.create=pn,pn.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},pn.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},pn.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},pn.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)dn(this,arguments[e]);return this.length},pn.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)un(this,arguments[e]);return this.length},pn.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},pn.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},pn.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},pn.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},pn.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},pn.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},pn.prototype.map=function(e,t){t=t||this;for(var n=new pn,r=this.head;null!==r;)n.push(e.call(t,r.value,this)),r=r.next;return n},pn.prototype.mapReverse=function(e,t){t=t||this;for(var n=new pn,r=this.tail;null!==r;)n.push(e.call(t,r.value,this)),r=r.prev;return n},pn.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},pn.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},pn.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},pn.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},pn.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new pn;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,i=this.head;null!==i&&r<e;r++)i=i.next;for(;null!==i&&r<t;r++,i=i.next)n.push(i.value);return n},pn.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new pn;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,i=this.tail;null!==i&&r>t;r--)i=i.prev;for(;null!==i&&r>e;r--,i=i.prev)n.push(i.value);return n},pn.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;null!==i&&r<e;r++)i=i.next;var o=[];for(r=0;i&&r<t;r++)o.push(i.value),i=this.removeNode(i);null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(r=0;r<n.length;r++)i=fn(this,i,n[r]);return o},pn.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{(rn?nn:(rn=1,nn=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}))(pn)}catch(Zr){}const mn=hn,vn=Symbol("max"),En=Symbol("length"),bn=Symbol("lengthCalculator"),yn=Symbol("allowStale"),wn=Symbol("maxAge"),On=Symbol("dispose"),An=Symbol("noDisposeOnSet"),xn=Symbol("lruList"),Nn=Symbol("cache"),In=Symbol("updateAgeOnGet"),Sn=()=>1;const Rn=(e,t,n)=>{const r=e[Nn].get(t);if(r){const t=r.value;if(Ln(e,t)){if(Tn(e,r),!e[yn])return}else n&&(e[In]&&(r.value.now=Date.now()),e[xn].unshiftNode(r));return t.value}},Ln=(e,t)=>{if(!t||!t.maxAge&&!e[wn])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[wn]&&n>e[wn]},$n=e=>{if(e[En]>e[vn])for(let t=e[xn].tail;e[En]>e[vn]&&null!==t;){const n=t.prev;Tn(e,t),t=n}},Tn=(e,t)=>{if(t){const n=t.value;e[On]&&e[On](n.key,n.value),e[En]-=n.length,e[Nn].delete(n.key),e[xn].removeNode(t)}};class Dn{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const Cn=(e,t,n,r)=>{let i=n.value;Ln(e,i)&&(Tn(e,n),e[yn]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};var Fn=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[vn]=e.max||1/0;const t=e.length||Sn;if(this[bn]="function"!=typeof t?Sn:t,this[yn]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[wn]=e.maxAge||0,this[On]=e.dispose,this[An]=e.noDisposeOnSet||!1,this[In]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[vn]=e||1/0,$n(this)}get max(){return this[vn]}set allowStale(e){this[yn]=!!e}get allowStale(){return this[yn]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[wn]=e,$n(this)}get maxAge(){return this[wn]}set lengthCalculator(e){"function"!=typeof e&&(e=Sn),e!==this[bn]&&(this[bn]=e,this[En]=0,this[xn].forEach((e=>{e.length=this[bn](e.value,e.key),this[En]+=e.length}))),$n(this)}get lengthCalculator(){return this[bn]}get length(){return this[En]}get itemCount(){return this[xn].length}rforEach(e,t){t=t||this;for(let n=this[xn].tail;null!==n;){const r=n.prev;Cn(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[xn].head;null!==n;){const r=n.next;Cn(this,e,n,t),n=r}}keys(){return this[xn].toArray().map((e=>e.key))}values(){return this[xn].toArray().map((e=>e.value))}reset(){this[On]&&this[xn]&&this[xn].length&&this[xn].forEach((e=>this[On](e.key,e.value))),this[Nn]=new Map,this[xn]=new mn,this[En]=0}dump(){return this[xn].map((e=>!Ln(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[xn]}set(e,t,n){if((n=n||this[wn])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,i=this[bn](t,e);if(this[Nn].has(e)){if(i>this[vn])return Tn(this,this[Nn].get(e)),!1;const o=this[Nn].get(e).value;return this[On]&&(this[An]||this[On](e,o.value)),o.now=r,o.maxAge=n,o.value=t,this[En]+=i-o.length,o.length=i,this.get(e),$n(this),!0}const o=new Dn(e,t,i,r,n);return o.length>this[vn]?(this[On]&&this[On](e,t),!1):(this[En]+=o.length,this[xn].unshift(o),this[Nn].set(e,this[xn].head),$n(this),!0)}has(e){if(!this[Nn].has(e))return!1;const t=this[Nn].get(e).value;return!Ln(this,t)}get(e){return Rn(this,e,!0)}peek(e){return Rn(this,e,!1)}pop(){const e=this[xn].tail;return e?(Tn(this,e),e.value):null}del(e){Tn(this,this[Nn].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[Nn].forEach(((e,t)=>Rn(this,t,!1)))}};const kn=Object.freeze({loose:!0}),Pn=Object.freeze({});var _n=e=>e?"object"!=typeof e?kn:e:Pn,jn={exports:{}};var Mn={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var zn="object"==typeof process&&on&&on.NODE_DEBUG&&/\bsemver\b/i.test(on.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Mn,o=zn,a=(t=e.exports={}).re=[],s=t.safeRe=[],l=t.src=[],c=t.t={};let h=0;const p="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[p,r]],d=(e,t,n)=>{const r=(e=>{for(const[t,n]of f)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=h++;o(e,i,t),c[e]=i,l[i]=t,a[i]=new RegExp(t,n?"g":void 0),s[i]=new RegExp(r,n?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),d("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${p}+`),d("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),d("FULL",`^${l[c.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),d("LOOSE",`^${l[c.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),d("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),d("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),d("COERCERTL",l[c.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(jn,jn.exports);var Un=jn.exports;const Bn=/^[0-9]+$/,Gn=(e,t)=>{const n=Bn.test(e),r=Bn.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1};var Vn={compareIdentifiers:Gn,rcompareIdentifiers:(e,t)=>Gn(t,e)};const Wn=zn,{MAX_LENGTH:Xn,MAX_SAFE_INTEGER:Hn}=Mn,{safeRe:qn,t:Yn}=Un,Jn=_n,{compareIdentifiers:Qn}=Vn;var Kn=class e{constructor(t,n){if(n=Jn(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Xn)throw new TypeError(`version is longer than ${Xn} characters`);Wn("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?qn[Yn.LOOSE]:qn[Yn.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Hn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Hn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Hn||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<Hn)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Wn("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),Qn(this.major,t.major)||Qn(this.minor,t.minor)||Qn(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const e=this.prerelease[n],r=t.prerelease[n];if(Wn("prerelease compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return Qn(e,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{const e=this.build[n],r=t.build[n];if(Wn("prerelease compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return Qn(e,r)}while(++n)}inc(e,t,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===Qn(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const Zn=Kn;var er=(e,t,n)=>new Zn(e,n).compare(new Zn(t,n));const tr=er;const nr=er;const rr=er;const ir=er;const or=er;const ar=er;const sr=(e,t,n)=>0===tr(e,t,n),lr=(e,t,n)=>0!==nr(e,t,n),cr=(e,t,n)=>rr(e,t,n)>0,hr=(e,t,n)=>ir(e,t,n)>=0,pr=(e,t,n)=>or(e,t,n)<0,fr=(e,t,n)=>ar(e,t,n)<=0;var dr,ur,gr,mr,vr=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return sr(e,n,r);case"!=":return lr(e,n,r);case">":return cr(e,n,r);case">=":return hr(e,n,r);case"<":return pr(e,n,r);case"<=":return fr(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};function Er(){if(mr)return gr;mr=1;class e{constructor(t,i){if(i=n(i),t instanceof e)return t.loose===!!i.loose&&t.includePrerelease===!!i.includePrerelease?t:new e(t.raw,i);if(t instanceof r)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!d(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&u(t[0])){this.set=[t];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const n=((this.options.includePrerelease&&p)|(this.options.loose&&f))+":"+e,o=t.get(n);if(o)return o;const u=this.options.loose,g=u?a[s.HYPHENRANGELOOSE]:a[s.HYPHENRANGE];e=e.replace(g,I(this.options.includePrerelease)),i("hyphen replace",e),e=e.replace(a[s.COMPARATORTRIM],l),i("comparator trim",e),e=e.replace(a[s.TILDETRIM],c),i("tilde trim",e),e=e.replace(a[s.CARETTRIM],h),i("caret trim",e);let v=e.split(" ").map((e=>m(e,this.options))).join(" ").split(/\s+/).map((e=>N(e,this.options)));u&&(v=v.filter((e=>(i("loose invalid filter",e,this.options),!!e.match(a[s.COMPARATORLOOSE]))))),i("range list",v);const E=new Map,b=v.map((e=>new r(e,this.options)));for(const t of b){if(d(t))return[t];E.set(t.value,t)}E.size>1&&E.has("")&&E.delete("");const y=[...E.values()];return t.set(n,y),y}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>g(e,n)&&t.set.some((t=>g(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new o(e,this.options)}catch(Zr){return!1}for(let t=0;t<this.set.length;t++)if(S(this.set[t],e,this.options))return!0;return!1}}gr=e;const t=new Fn({max:1e3}),n=_n,r=function(){if(ur)return dr;ur=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),a("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new s(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(a("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new s(t,this.options)}catch(Zr){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new l(e.value,r).test(this.value):""===e.operator?""===e.value||new l(this.value,r).test(e.semver):!((r=n(r)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}dr=t;const n=_n,{safeRe:r,t:i}=Un,o=vr,a=zn,s=Kn,l=Er();return dr}(),i=zn,o=Kn,{safeRe:a,t:s,comparatorTrimReplace:l,tildeTrimReplace:c,caretTrimReplace:h}=Un,{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:f}=Mn,d=e=>"<0.0.0-0"===e.value,u=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},m=(e,t)=>(i("comp",e,t),e=y(e,t),i("caret",e),e=E(e,t),i("tildes",e),e=O(e,t),i("xrange",e),e=x(e,t),i("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map((e=>b(e,t))).join(" "),b=(e,t)=>{const n=t.loose?a[s.TILDELOOSE]:a[s.TILDE];return e.replace(n,((t,n,r,o,a)=>{let s;return i("tilde",e,t,n,r,o,a),v(n)?s="":v(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:v(o)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(i("replaceTilde pr",a),s=`>=${n}.${r}.${o}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${o} <${n}.${+r+1}.0-0`,i("tilde return",s),s}))},y=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{i("caret",e,t);const n=t.loose?a[s.CARETLOOSE]:a[s.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,o,a,s)=>{let l;return i("caret",e,t,n,o,a,s),v(n)?l="":v(o)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(a)?l="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:s?(i("replaceCaret pr",s),l="0"===n?"0"===o?`>=${n}.${o}.${a}-${s} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}-${s} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a}-${s} <${+n+1}.0.0-0`):(i("no pr"),l="0"===n?"0"===o?`>=${n}.${o}.${a}${r} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a} <${+n+1}.0.0-0`),i("caret return",l),l}))},O=(e,t)=>(i("replaceXRanges",e,t),e.split(/\s+/).map((e=>A(e,t))).join(" ")),A=(e,t)=>{e=e.trim();const n=t.loose?a[s.XRANGELOOSE]:a[s.XRANGE];return e.replace(n,((n,r,o,a,s,l)=>{i("xRange",e,n,r,o,a,s,l);const c=v(o),h=c||v(a),p=h||v(s),f=p;return"="===r&&f&&(r=""),l=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(h&&(a=0),s=0,">"===r?(r=">=",h?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",h?o=+o+1:a=+a+1),"<"===r&&(l="-0"),n=`${r+o}.${a}.${s}${l}`):h?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:p&&(n=`>=${o}.${a}.0${l} <${o}.${+a+1}.0-0`),i("xRange return",n),n}))},x=(e,t)=>(i("replaceStars",e,t),e.trim().replace(a[s.STAR],"")),N=(e,t)=>(i("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?s.GTE0PRE:s.GTE0],"")),I=e=>(t,n,r,i,o,a,s,l,c,h,p,f,d)=>`${n=v(r)?"":v(i)?`>=${r}.0.0${e?"-0":""}`:v(o)?`>=${r}.${i}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=v(c)?"":v(h)?`<${+c+1}.0.0-0`:v(p)?`<${c}.${+h+1}.0-0`:f?`<=${c}.${h}.${p}-${f}`:e?`<${c}.${h}.${+p+1}-0`:`<=${l}`}`.trim(),S=(e,t,n)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(i(e[n].semver),e[n].semver!==r.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return gr}const br=Er();var yr=cn(((e,t,n)=>{try{t=new br(t,n)}catch(Zr){return!1}return t.test(e)}));var wr='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus-within summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid rgba(0, 0, 0, 0);\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid rgba(0, 0, 0, 0);\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n';function Or(e,...t){for(const n of t)Ar(e,n);return e}function Ar(e,t){for(const n of Object.keys(t))s(e,n,t[n],!0)}function xr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xr(Object(n),!0).forEach((function(t){ln(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Ir=ee;let Sr=re;const Rr="undefined"!=typeof window?window:void 0;void 0===Sr&&(null==(e=null==Rr?void 0:Rr.vl)?void 0:e.compile)&&(Sr=Rr.vl);const Lr={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},$r={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},Tr={vega:"Vega","vega-lite":"Vega-Lite"},Dr={vega:Ir.version,"vega-lite":Sr?Sr.version:"not available"},Cr={vega:e=>e,"vega-lite":(e,t)=>Sr.compile(e,{config:t}).spec},Fr='\n<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">\n <circle r="2" cy="8" cx="2"></circle>\n <circle r="2" cy="8" cx="8"></circle>\n <circle r="2" cy="8" cx="14"></circle>\n</svg>',kr="chart-wrapper";function Pr(e,t,n,r){const i=`<html><head>${t}</head><body><pre><code class="json">`,o=`</code></pre>${n}</body></html>`,a=window.open("");a.document.write(i+e+o),a.document.title=`${Tr[r]} JSON Source`}function _r(e){return(t=e)&&"load"in t?e:Ir.loader(e);var t}async function jr(e,t,n={}){let s,l;r(t)?(l=_r(n.loader),s=JSON.parse(await l.load(t))):s=t;const c=function(e){var t;const n=(null==(t=e.usermeta)?void 0:t.embedOptions)??{};return r(n.defaultStyle)&&(n.defaultStyle=!1),n}(s),h=c.loader;l&&!h||(l=_r(n.loader??h));const p=await Mr(c,l),f=await Mr(n,l),d=Nr(Nr({},Or(f,p)),{},{config:o(f.config??{},p.config??{})});return await async function(e,t,n={},r){const s=n.theme?o(Jt[n.theme],n.config??{}):n.config,l=a(n.actions)?n.actions:Or({},Lr,n.actions??{}),c=Nr(Nr({},$r),n.i18n),h=n.renderer??"canvas",p=n.logLevel??Ir.Warn,f=n.downloadFileName??"visualization",d="string"==typeof e?document.querySelector(e):e;if(!d)throw new Error(`${e} does not exist`);if(!1!==n.defaultStyle){const e="vega-embed-style",{root:t,rootContainer:r}=function(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}(d);if(!t.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerHTML=void 0===n.defaultStyle||!0===n.defaultStyle?wr.toString():n.defaultStyle,r.appendChild(t)}}const u=function(e,t){if(e.$schema){const n=He(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${Tr[n.library]}, but mode argument sets ${Tr[t]??t}.`);const r=n.library;return yr(Dr[r],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${Tr[r]} ${n.version}, but the current version of ${Tr[r]} is v${Dr[r]}.`),r}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}(t,n.mode);let g=Cr[u](t,s);if("vega-lite"===u&&g.$schema){const e=He(g.$schema);yr(Dr.vega,`^${e.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${Dr.vega}.`)}d.classList.add("vega-embed"),l&&d.classList.add("has-actions");d.innerHTML="";let m=d;if(l){const e=document.createElement("div");e.classList.add(kr),d.appendChild(e),m=e}const v=n.patch;v&&(g=v instanceof Function?v(g):Ae(g,v,!0,!1).newDocument);n.formatLocale&&Ir.formatLocale(n.formatLocale);n.timeFormatLocale&&Ir.timeFormatLocale(n.timeFormatLocale);if(n.expressionFunctions)for(const i in n.expressionFunctions){const e=n.expressionFunctions[i];"fn"in e?Ir.expressionFunction(i,e.fn,e.visitor):e instanceof Function&&Ir.expressionFunction(i,e)}const{ast:E}=n,b=Ir.parse(g,"vega-lite"===u?{}:s,{ast:E}),y=new(n.viewClass||Ir.View)(b,Nr({loader:r,logLevel:p,renderer:h},E?{expr:Ir.expressionInterpreter??n.expr??Xe}:{}));if(y.addSignalListener("autosize",((e,t)=>{const{type:n}=t;"fit-x"==n?(m.classList.add("fit-x"),m.classList.remove("fit-y")):"fit-y"==n?(m.classList.remove("fit-x"),m.classList.add("fit-y")):"fit"==n?m.classList.add("fit-x","fit-y"):m.classList.remove("fit-x","fit-y")})),!1!==n.tooltip){const e="function"==typeof n.tooltip?n.tooltip:new tn(!0===n.tooltip?{}:n.tooltip).call;y.tooltip(e)}let w,{hover:O}=n;void 0===O&&(O="vega"===u);if(O){const{hoverSet:e,updateSet:t}="boolean"==typeof O?{}:O;y.hover(e,t)}n&&(null!=n.width&&y.width(n.width),null!=n.height&&y.height(n.height),null!=n.padding&&y.padding(n.padding));if(await y.initialize(m,n.bind).runAsync(),!1!==l){let e=d;if(!1!==n.defaultStyle||n.forceActionsMenu){const t=document.createElement("details");t.title=c.CLICK_TO_VIEW_ACTIONS,d.append(t),e=t;const n=document.createElement("summary");n.innerHTML=Fr,t.append(n),w=e=>{t.contains(e.target)||t.removeAttribute("open")},document.addEventListener("click",w)}const r=document.createElement("div");if(e.append(r),r.classList.add("vega-actions"),!0===l||!1!==l.export)for(const t of["svg","png"])if(!0===l||!0===l.export||l.export[t]){const e=c[`${t.toUpperCase()}_ACTION`],o=document.createElement("a"),a=i(n.scaleFactor)?n.scaleFactor[t]:n.scaleFactor;o.text=e,o.href="#",o.target="_blank",o.download=`${f}.${t}`,o.addEventListener("mousedown",(async function(e){e.preventDefault();const n=await y.toImageURL(t,a);this.href=n})),r.append(o)}if(!0===l||!1!==l.source){const e=document.createElement("a");e.text=c.SOURCE_ACTION,e.href="#",e.addEventListener("click",(function(e){Pr(ke(t),n.sourceHeader??"",n.sourceFooter??"",u),e.preventDefault()})),r.append(e)}if("vega-lite"===u&&(!0===l||!1!==l.compiled)){const e=document.createElement("a");e.text=c.COMPILED_ACTION,e.href="#",e.addEventListener("click",(function(e){Pr(ke(g),n.sourceHeader??"",n.sourceFooter??"","vega"),e.preventDefault()})),r.append(e)}if(!0===l||!1!==l.editor){const e=n.editorUrl??"https://vega.github.io/editor/",i=document.createElement("a");i.text=c.EDITOR_ACTION,i.href="#",i.addEventListener("click",(function(n){!function(e,t,n){const r=e.open(t),{origin:i}=new URL(t);let o=40;e.addEventListener("message",(function t(n){n.source===r&&(o=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){o<=0||(r.postMessage(n,i),setTimeout(e,250),o-=1)}),250)}(window,e,{config:s,mode:u,renderer:h,spec:ke(t)}),n.preventDefault()})),r.append(i)}}function A(){w&&document.removeEventListener("click",w),y.finalize()}return{view:y,spec:t,vgSpec:g,finalize:A,embedOptions:n}}(e,s,d,l)}async function Mr(e,t){const n=r(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=r(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return Nr(Nr(Nr({},e),i?{patch:i}:{}),n?{config:n}:{})}function zr(e,t){Object.keys(t).forEach((n=>{!function(e,t,n){var r;n&&((r=n)&&"[object Function]"==={}.toString.call(r)?n(e.data(t)):e.change(t,Ir.changeset().remove((()=>!0)).insert(n)))}(e,n,t[n])}))}function Ur(e){const t=new Set;return e.forEach((e=>{Object.keys(e).forEach((e=>{t.add(e)}))})),t}const Br=()=>{};function Gr(e,t){const n=Object.keys(t);return n.forEach((n=>{try{e.addSignalListener(n,t[n])}catch(r){console.warn("Cannot add invalid signal listener.",r)}})),n.length>0}function Vr(e,t){const n=Object.keys(t);return n.forEach((n=>{try{e.removeSignalListener(n,t[n])}catch(r){console.warn("Cannot remove invalid signal listener.",r)}})),n.length>0}function Wr(e){const{spec:t,width:n,height:r}=e;return void 0!==n&&void 0!==r?{...t,width:n,height:r}:void 0!==n?{...t,width:n}:void 0!==r?{...t,height:r}:t}function Xr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Hr extends l.PureComponent{constructor(){super(...arguments),Xr(this,"containerRef",l.createRef()),Xr(this,"resultPromise",void 0),Xr(this,"handleError",(e=>{const{onError:t=Br}=this.props;t(e,this.containerRef.current),console.warn(e)})),Xr(this,"modifyView",(e=>{this.resultPromise&&this.resultPromise.then((t=>(t&&e(t.view),!0))).catch(this.handleError)}))}componentDidMount(){this.createView()}componentDidUpdate(e){const t=Ur([this.props,e]);if(t.delete("className"),t.delete("signalListeners"),t.delete("spec"),t.delete("style"),t.delete("width"),t.delete("height"),Array.from(t).some((t=>this.props[t]!==e[t])))this.clearView(),this.createView();else{const t=function(e,t){if(e===t)return!1;const n={width:!1,height:!1,isExpensive:!1},r=Ur([e,t]);return!r.has("width")||"width"in e&&"width"in t&&e.width===t.width||("width"in e&&"number"==typeof e.width?n.width=e.width:n.isExpensive=!0),!r.has("height")||"height"in e&&"height"in t&&e.height===t.height||("height"in e&&"number"==typeof e.height?n.height=e.height:n.isExpensive=!0),r.delete("width"),r.delete("height"),[...r].some((n=>!(n in e)||!(n in t)||!te(e[n],t[n])))&&(n.isExpensive=!0),!(!1===n.width&&!1===n.height&&!n.isExpensive)&&n}(Wr(this.props),Wr(e)),{signalListeners:n}=this.props,{signalListeners:r}=e;if(t)if(t.isExpensive)this.clearView(),this.createView();else{const e=!oe(n,r);this.modifyView((i=>{!1!==t.width&&i.width(t.width),!1!==t.height&&i.height(t.height),e&&(r&&Vr(i,r),n&&Gr(i,n)),i.run()}))}else oe(n,r)||this.modifyView((e=>{r&&Vr(e,r),n&&Gr(e,n),e.run()}))}}componentWillUnmount(){this.clearView()}createView(){const{spec:e,onNewView:t,signalListeners:n={},width:r,height:i,...o}=this.props;if(this.containerRef.current){const e=Wr(this.props);this.resultPromise=jr(this.containerRef.current,e,o).then((e=>{if(e){const{view:t}=e;Gr(t,n)&&t.run()}return e})).catch(this.handleError),t&&this.modifyView(t)}}clearView(){return this.resultPromise&&this.resultPromise.then((e=>{e&&e.finalize()})).catch(this.handleError),this.resultPromise=void 0,this}render(){const{className:e,style:t}=this.props;return l.createElement("div",{ref:this.containerRef,className:e,style:t})}}function qr(){return qr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qr.apply(this,arguments)}function Yr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Xr(Hr,"propTypes",{className:c.string,onError:c.func});class Jr extends l.PureComponent{constructor(){super(...arguments),Yr(this,"vegaEmbed",l.createRef()),Yr(this,"handleNewView",(e=>{this.update();const{onNewView:t=Br}=this.props;t(e)}))}componentDidMount(){this.update()}componentDidUpdate(e){oe(this.props.data,e.data)||this.update()}update(){const{data:e}=this.props;this.vegaEmbed.current&&e&&Object.keys(e).length>0&&this.vegaEmbed.current.modifyView((t=>{zr(t,e),t.resize().run()}))}render(){const{data:e,...t}=this.props;return l.createElement(Hr,qr({ref:this.vegaEmbed},t,{onNewView:this.handleNewView}))}}function Qr(){return Qr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qr.apply(this,arguments)}function Kr(e){return l.createElement(Jr,Qr({},e,{mode:"vega-lite"}))}Yr(Jr,"defaultProps",{data:{}});export{Jr as V,Kr as a};
@@ -1 +0,0 @@
1
- import{b as r}from"./_baseEach-DRLOG7FR.js";import{n}from"./index-BhVxrMm_.js";function a(a,o){var t=-1,s=n(a)?Array(a.length):[];return r(a,(function(r,n,a){s[++t]=o(r,n,a)})),s}export{a as b};
@@ -1 +0,0 @@
1
- import{w as n,p as t,c as r,s as c,a as e,h as a,e as u,t as i,b as o,m as y,d as l,f,g as s,i as p,j as x}from"./step-CaHXtLdi.js";function h(n){return n.innerRadius}function v(n){return n.outerRadius}function g(n){return n.startAngle}function d(n){return n.endAngle}function m(n){return n&&n.padAngle}function T(n,t,r,c,e,a,u){var i=n-r,y=t-c,l=(u?a:-a)/o(i*i+y*y),f=l*y,s=-l*i,p=n+f,h=t+s,v=r+f,g=c+s,d=(p+v)/2,m=(h+g)/2,T=v-p,A=g-h,R=T*T+A*A,j=e-a,b=p*g-v*h,w=(A<0?-1:1)*o(x(0,j*j*R-b*b)),P=(b*A-T*w)/R,k=(-b*T-A*w)/R,q=(b*A+T*w)/R,z=(-b*T+A*w)/R,B=P-d,C=k-m,D=q-d,E=z-m;return B*B+C*C>D*D+E*E&&(P=q,k=z),{cx:P,cy:k,x01:-f,y01:-s,x11:P*(e/j-1),y11:k*(e/j-1)}}function A(){var x=h,A=v,R=e(0),j=null,b=g,w=d,P=m,k=null,q=n(z);function z(){var n,e,h=+x.apply(this,arguments),v=+A.apply(this,arguments),g=b.apply(this,arguments)-a,d=w.apply(this,arguments)-a,m=l(d-g),z=d>g;if(k||(k=n=q()),v<h&&(e=v,v=h,h=e),v>u)if(m>i-u)k.moveTo(v*r(g),v*c(g)),k.arc(0,0,v,g,d,!z),h>u&&(k.moveTo(h*r(d),h*c(d)),k.arc(0,0,h,d,g,z));else{var B,C,D=g,E=d,F=g,G=d,H=m,I=m,J=P.apply(this,arguments)/2,K=J>u&&(j?+j.apply(this,arguments):o(h*h+v*v)),L=y(l(v-h)/2,+R.apply(this,arguments)),M=L,N=L;if(K>u){var O=s(K/h*c(J)),Q=s(K/v*c(J));(H-=2*O)>u?(F+=O*=z?1:-1,G-=O):(H=0,F=G=(g+d)/2),(I-=2*Q)>u?(D+=Q*=z?1:-1,E-=Q):(I=0,D=E=(g+d)/2)}var S=v*r(D),U=v*c(D),V=h*r(G),W=h*c(G);if(L>u){var X,Y=v*r(E),Z=v*c(E),$=h*r(F),_=h*c(F);if(m<t)if(X=function(n,t,r,c,e,a,i,o){var y=r-n,l=c-t,f=i-e,s=o-a,p=s*y-f*l;if(!(p*p<u))return[n+(p=(f*(t-a)-s*(n-e))/p)*y,t+p*l]}(S,U,$,_,Y,Z,V,W)){var nn=S-X[0],tn=U-X[1],rn=Y-X[0],cn=Z-X[1],en=1/c(p((nn*rn+tn*cn)/(o(nn*nn+tn*tn)*o(rn*rn+cn*cn)))/2),an=o(X[0]*X[0]+X[1]*X[1]);M=y(L,(h-an)/(en-1)),N=y(L,(v-an)/(en+1))}else M=N=0}I>u?N>u?(B=T($,_,S,U,v,N,z),C=T(Y,Z,V,W,v,N,z),k.moveTo(B.cx+B.x01,B.cy+B.y01),N<L?k.arc(B.cx,B.cy,N,f(B.y01,B.x01),f(C.y01,C.x01),!z):(k.arc(B.cx,B.cy,N,f(B.y01,B.x01),f(B.y11,B.x11),!z),k.arc(0,0,v,f(B.cy+B.y11,B.cx+B.x11),f(C.cy+C.y11,C.cx+C.x11),!z),k.arc(C.cx,C.cy,N,f(C.y11,C.x11),f(C.y01,C.x01),!z))):(k.moveTo(S,U),k.arc(0,0,v,D,E,!z)):k.moveTo(S,U),h>u&&H>u?M>u?(B=T(V,W,Y,Z,h,-M,z),C=T(S,U,$,_,h,-M,z),k.lineTo(B.cx+B.x01,B.cy+B.y01),M<L?k.arc(B.cx,B.cy,M,f(B.y01,B.x01),f(C.y01,C.x01),!z):(k.arc(B.cx,B.cy,M,f(B.y01,B.x01),f(B.y11,B.x11),!z),k.arc(0,0,h,f(B.cy+B.y11,B.cx+B.x11),f(C.cy+C.y11,C.cx+C.x11),z),k.arc(C.cx,C.cy,M,f(C.y11,C.x11),f(C.y01,C.x01),!z))):k.arc(0,0,h,G,F,z):k.lineTo(V,W)}else k.moveTo(0,0);if(k.closePath(),n)return k=null,n+""||null}return z.centroid=function(){var n=(+x.apply(this,arguments)+ +A.apply(this,arguments))/2,e=(+b.apply(this,arguments)+ +w.apply(this,arguments))/2-t/2;return[r(e)*n,c(e)*n]},z.innerRadius=function(n){return arguments.length?(x="function"==typeof n?n:e(+n),z):x},z.outerRadius=function(n){return arguments.length?(A="function"==typeof n?n:e(+n),z):A},z.cornerRadius=function(n){return arguments.length?(R="function"==typeof n?n:e(+n),z):R},z.padRadius=function(n){return arguments.length?(j=null==n?null:"function"==typeof n?n:e(+n),z):j},z.startAngle=function(n){return arguments.length?(b="function"==typeof n?n:e(+n),z):b},z.endAngle=function(n){return arguments.length?(w="function"==typeof n?n:e(+n),z):w},z.padAngle=function(n){return arguments.length?(P="function"==typeof n?n:e(+n),z):P},z.context=function(n){return arguments.length?(k=null==n?null:n,z):k},z}export{A as d};