streamlit-nightly 1.31.2.dev20240212__py2.py3-none-any.whl → 1.31.2.dev20240214__py2.py3-none-any.whl
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.
- streamlit/case_converters.py +9 -4
- streamlit/cli_util.py +2 -0
- streamlit/code_util.py +5 -2
- streamlit/color_util.py +2 -0
- streamlit/column_config.py +2 -0
- streamlit/commands/execution_control.py +4 -2
- streamlit/commands/experimental_query_params.py +7 -4
- streamlit/commands/page_config.py +11 -9
- streamlit/components/v1/components.py +23 -16
- streamlit/config.py +3 -5
- streamlit/config_option.py +12 -11
- streamlit/connections/base_connection.py +4 -2
- streamlit/connections/snowflake_connection.py +4 -4
- streamlit/connections/snowpark_connection.py +3 -3
- streamlit/connections/sql_connection.py +6 -6
- streamlit/connections/util.py +8 -5
- streamlit/constants.py +2 -0
- streamlit/cursor.py +16 -14
- streamlit/delta_generator.py +10 -13
- streamlit/deprecation_util.py +4 -3
- streamlit/echo.py +5 -3
- streamlit/elements/alert.py +16 -14
- streamlit/elements/altair_utils.py +8 -6
- streamlit/elements/arrow.py +4 -4
- streamlit/elements/arrow_altair.py +24 -34
- streamlit/elements/arrow_vega_lite.py +9 -14
- streamlit/elements/balloons.py +4 -2
- streamlit/elements/bokeh_chart.py +7 -7
- streamlit/elements/code.py +6 -4
- streamlit/elements/deck_gl_json_chart.py +8 -8
- streamlit/elements/doc_string.py +5 -9
- streamlit/elements/empty.py +4 -2
- streamlit/elements/exception.py +10 -10
- streamlit/elements/form.py +1 -3
- streamlit/elements/graphviz_chart.py +5 -6
- streamlit/elements/heading.py +16 -14
- streamlit/elements/iframe.py +14 -12
- streamlit/elements/image.py +8 -8
- streamlit/elements/json.py +6 -4
- streamlit/elements/layouts.py +12 -10
- streamlit/elements/lib/column_config_utils.py +2 -2
- streamlit/elements/lib/column_types.py +23 -23
- streamlit/elements/lib/dicttools.py +10 -6
- streamlit/elements/lib/mutable_status_container.py +7 -7
- streamlit/elements/lib/pandas_styler_utils.py +6 -6
- streamlit/elements/lib/streamlit_plotly_theme.py +2 -0
- streamlit/elements/map.py +11 -22
- streamlit/elements/markdown.py +16 -14
- streamlit/elements/media.py +16 -16
- streamlit/elements/metric.py +9 -7
- streamlit/elements/plotly_chart.py +5 -5
- streamlit/elements/progress.py +6 -6
- streamlit/elements/pyplot.py +10 -13
- streamlit/elements/snow.py +4 -2
- streamlit/elements/spinner.py +2 -0
- streamlit/elements/text.py +7 -5
- streamlit/elements/toast.py +6 -4
- streamlit/elements/utils.py +15 -28
- streamlit/elements/widgets/button.py +39 -39
- streamlit/elements/widgets/camera_input.py +21 -17
- streamlit/elements/widgets/chat.py +6 -7
- streamlit/elements/widgets/checkbox.py +21 -19
- streamlit/elements/widgets/color_picker.py +18 -16
- streamlit/elements/widgets/data_editor.py +7 -7
- streamlit/elements/widgets/file_uploader.py +59 -55
- streamlit/elements/widgets/multiselect.py +33 -42
- streamlit/elements/widgets/number_input.py +10 -5
- streamlit/elements/widgets/radio.py +1 -1
- streamlit/elements/widgets/select_slider.py +25 -34
- streamlit/elements/widgets/selectbox.py +1 -1
- streamlit/elements/widgets/slider.py +28 -36
- streamlit/elements/widgets/text_widgets.py +6 -6
- streamlit/elements/widgets/time_widgets.py +13 -13
- streamlit/elements/write.py +21 -29
- streamlit/env_util.py +5 -3
- streamlit/error_util.py +7 -3
- streamlit/errors.py +3 -1
- streamlit/external/langchain/streamlit_callback_handler.py +26 -24
- streamlit/file_util.py +18 -14
- streamlit/folder_black_list.py +3 -1
- streamlit/git_util.py +5 -3
- streamlit/js_number.py +10 -13
- streamlit/logger.py +5 -5
- streamlit/net_util.py +14 -11
- streamlit/platform.py +2 -0
- streamlit/runtime/__init__.py +2 -0
- streamlit/runtime/app_session.py +42 -42
- streamlit/runtime/caching/__init__.py +4 -4
- streamlit/runtime/caching/cache_data_api.py +3 -3
- streamlit/runtime/caching/cache_errors.py +5 -3
- streamlit/runtime/caching/cache_type.py +2 -0
- streamlit/runtime/caching/cache_utils.py +2 -4
- streamlit/runtime/caching/cached_message_replay.py +12 -5
- streamlit/runtime/caching/hashing.py +29 -21
- streamlit/runtime/caching/storage/cache_storage_protocol.py +1 -2
- streamlit/runtime/caching/storage/local_disk_cache_storage.py +6 -5
- streamlit/runtime/connection_factory.py +8 -8
- streamlit/runtime/forward_msg_cache.py +20 -18
- streamlit/runtime/forward_msg_queue.py +8 -9
- streamlit/runtime/legacy_caching/caching.py +32 -42
- streamlit/runtime/legacy_caching/hashing.py +29 -25
- streamlit/runtime/media_file_manager.py +16 -14
- streamlit/runtime/media_file_storage.py +8 -8
- streamlit/runtime/memory_media_file_storage.py +12 -14
- streamlit/runtime/memory_session_storage.py +4 -3
- streamlit/runtime/memory_uploaded_file_manager.py +9 -10
- streamlit/runtime/metrics_util.py +20 -20
- streamlit/runtime/runtime.py +25 -27
- streamlit/runtime/runtime_util.py +5 -3
- streamlit/runtime/script_data.py +2 -0
- streamlit/runtime/scriptrunner/magic.py +17 -11
- streamlit/runtime/scriptrunner/magic_funcs.py +2 -0
- streamlit/runtime/scriptrunner/script_requests.py +6 -4
- streamlit/runtime/scriptrunner/script_run_context.py +17 -17
- streamlit/runtime/scriptrunner/script_runner.py +7 -5
- streamlit/runtime/secrets.py +4 -6
- streamlit/runtime/session_manager.py +14 -14
- streamlit/runtime/state/common.py +5 -4
- streamlit/runtime/state/query_params.py +8 -6
- streamlit/runtime/state/query_params_proxy.py +7 -5
- streamlit/runtime/state/safe_session_state.py +7 -5
- streamlit/runtime/state/session_state.py +3 -4
- streamlit/runtime/state/session_state_proxy.py +5 -5
- streamlit/runtime/state/widgets.py +20 -18
- streamlit/runtime/stats.py +13 -15
- streamlit/runtime/uploaded_file_manager.py +6 -5
- streamlit/runtime/websocket_session_manager.py +14 -14
- streamlit/source_util.py +13 -11
- streamlit/static/asset-manifest.json +13 -13
- streamlit/static/index.html +1 -1
- streamlit/static/static/css/2411.8b8f33d6.chunk.css +1 -0
- streamlit/static/static/css/43.e3b876c5.chunk.css +1 -0
- streamlit/static/static/css/6692.65519639.chunk.css +1 -0
- streamlit/static/static/js/{3075.76725a14.chunk.js → 2411.714d213e.chunk.js} +2 -2
- streamlit/static/static/js/4185.21ca0590.chunk.js +1 -0
- streamlit/static/static/js/43.36939bb1.chunk.js +1 -0
- streamlit/static/static/js/{5117.6a701db1.chunk.js → 5117.04bfe5d3.chunk.js} +1 -1
- streamlit/static/static/js/{5791.30b01ee8.chunk.js → 5791.c5138157.chunk.js} +1 -1
- streamlit/static/static/js/656.8c998bc8.chunk.js +2 -0
- streamlit/static/static/js/{6692.6ac4ea6f.chunk.js → 6692.6496cbc2.chunk.js} +1 -1
- streamlit/static/static/js/7142.400eefdd.chunk.js +1 -0
- streamlit/static/static/js/main.2737c0f9.js +2 -0
- streamlit/static/static/js/{main.043d802e.js.LICENSE.txt → main.2737c0f9.js.LICENSE.txt} +23 -25
- streamlit/string_util.py +13 -9
- streamlit/temporary_directory.py +3 -1
- streamlit/testing/v1/element_tree.py +1 -2
- streamlit/testing/v1/util.py +7 -3
- streamlit/type_util.py +30 -25
- streamlit/url_util.py +6 -4
- streamlit/user_info.py +8 -6
- streamlit/util.py +23 -37
- streamlit/version.py +16 -9
- streamlit/watcher/event_based_path_watcher.py +10 -10
- streamlit/watcher/local_sources_watcher.py +15 -13
- streamlit/watcher/path_watcher.py +0 -3
- streamlit/watcher/polling_path_watcher.py +9 -8
- streamlit/watcher/util.py +3 -2
- streamlit/web/cache_storage_manager_config.py +2 -0
- streamlit/web/server/app_static_file_handler.py +6 -5
- streamlit/web/server/browser_websocket_handler.py +10 -8
- streamlit/web/server/component_request_handler.py +7 -4
- streamlit/web/server/media_file_handler.py +5 -4
- streamlit/web/server/routes.py +6 -3
- streamlit/web/server/server.py +41 -34
- streamlit/web/server/server_util.py +8 -3
- streamlit/web/server/stats_request_handler.py +14 -5
- streamlit/web/server/upload_file_request_handler.py +7 -8
- streamlit/web/server/websocket_headers.py +2 -2
- {streamlit_nightly-1.31.2.dev20240212.dist-info → streamlit_nightly-1.31.2.dev20240214.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.31.2.dev20240212.dist-info → streamlit_nightly-1.31.2.dev20240214.dist-info}/RECORD +176 -176
- streamlit/static/static/css/3075.81b3d18f.chunk.css +0 -1
- streamlit/static/static/css/43.c24b25fa.chunk.css +0 -1
- streamlit/static/static/css/6692.bb444a79.chunk.css +0 -1
- streamlit/static/static/js/1215.baf3721f.chunk.js +0 -2
- streamlit/static/static/js/4185.90e929dc.chunk.js +0 -1
- streamlit/static/static/js/43.8ca4bc8a.chunk.js +0 -1
- streamlit/static/static/js/7142.a359ed63.chunk.js +0 -1
- streamlit/static/static/js/main.043d802e.js +0 -2
- /streamlit/static/static/js/{3075.76725a14.chunk.js.LICENSE.txt → 2411.714d213e.chunk.js.LICENSE.txt} +0 -0
- /streamlit/static/static/js/{1215.baf3721f.chunk.js.LICENSE.txt → 656.8c998bc8.chunk.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.31.2.dev20240212.data → streamlit_nightly-1.31.2.dev20240214.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.31.2.dev20240212.dist-info → streamlit_nightly-1.31.2.dev20240214.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.31.2.dev20240212.dist-info → streamlit_nightly-1.31.2.dev20240214.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.31.2.dev20240212.dist-info → streamlit_nightly-1.31.2.dev20240214.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! For license information please see 656.8c998bc8.chunk.js.LICENSE.txt */
|
2
|
+
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[656],{86893:t=>{var e=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var e,n,i;try{e=Map}catch(s){e=function(){}}try{n=Set}catch(s){n=function(){}}try{i=Promise}catch(s){i=function(){}}function r(o,s,c,l,u){"object"===typeof s&&(c=s.depth,l=s.prototype,u=s.includeNonEnumerable,s=s.circular);var f=[],d=[],h="undefined"!=typeof Buffer;return"undefined"==typeof s&&(s=!0),"undefined"==typeof c&&(c=1/0),function o(c,p){if(null===c)return null;if(0===p)return c;var m,g;if("object"!=typeof c)return c;if(t(c,e))m=new e;else if(t(c,n))m=new n;else if(t(c,i))m=new i((function(t,e){c.then((function(e){t(o(e,p-1))}),(function(t){e(o(t,p-1))}))}));else if(r.__isArray(c))m=[];else if(r.__isRegExp(c))m=new RegExp(c.source,a(c)),c.lastIndex&&(m.lastIndex=c.lastIndex);else if(r.__isDate(c))m=new Date(c.getTime());else{if(h&&Buffer.isBuffer(c))return m=Buffer.allocUnsafe?Buffer.allocUnsafe(c.length):new Buffer(c.length),c.copy(m),m;t(c,Error)?m=Object.create(c):"undefined"==typeof l?(g=Object.getPrototypeOf(c),m=Object.create(g)):(m=Object.create(l),g=l)}if(s){var v=f.indexOf(c);if(-1!=v)return d[v];f.push(c),d.push(m)}for(var y in t(c,e)&&c.forEach((function(t,e){var n=o(e,p-1),i=o(t,p-1);m.set(n,i)})),t(c,n)&&c.forEach((function(t){var e=o(t,p-1);m.add(e)})),c){var b;g&&(b=Object.getOwnPropertyDescriptor(g,y)),b&&null==b.set||(m[y]=o(c[y],p-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(c);for(y=0;y<x.length;y++){var _=x[y];(!(k=Object.getOwnPropertyDescriptor(c,_))||k.enumerable||u)&&(m[_]=o(c[_],p-1),k.enumerable||Object.defineProperty(m,_,{enumerable:!1}))}}if(u){var w=Object.getOwnPropertyNames(c);for(y=0;y<w.length;y++){var k,E=w[y];(k=Object.getOwnPropertyDescriptor(c,E))&&k.enumerable||(m[E]=o(c[E],p-1),Object.defineProperty(m,E,{enumerable:!1}))}}return m}(o,c)}function o(t){return Object.prototype.toString.call(t)}function a(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return r.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},r.__objToStr=o,r.__isDate=function(t){return"object"===typeof t&&"[object Date]"===o(t)},r.__isArray=function(t){return"object"===typeof t&&"[object Array]"===o(t)},r.__isRegExp=function(t){return"object"===typeof t&&"[object RegExp]"===o(t)},r.__getRegExpFlags=a,r}();t.exports&&(t.exports=e)},60473:t=>{"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(e)){if((i=e.length)!=n.length)return!1;for(r=i;0!==r--;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((i=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(r=i;0!==r--;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;0!==r--;){var a=o[r];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}},4761:t=>{"use strict";t.exports=function(t,e){e||(e={}),"function"===typeof e&&(e={cmp:e});var n,i="boolean"===typeof e.cycles&&e.cycles,r=e.cmp&&(n=e.cmp,function(t){return function(e,i){var r={key:e,value:t[e]},o={key:i,value:t[i]};return n(r,o)}}),o=[];return function t(e){if(e&&e.toJSON&&"function"===typeof e.toJSON&&(e=e.toJSON()),void 0!==e){if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!==typeof e)return JSON.stringify(e);var n,a;if(Array.isArray(e)){for(a="[",n=0;n<e.length;n++)n&&(a+=","),a+=t(e[n])||"null";return a+"]"}if(null===e)return"null";if(-1!==o.indexOf(e)){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=o.push(e)-1,c=Object.keys(e).sort(r&&r(e));for(a="",n=0;n<c.length;n++){var l=c[n],u=t(e[l]);u&&(a&&(a+=","),a+=JSON.stringify(l)+":"+u)}return o.splice(s,1),"{"+a+"}"}}(t)}},99394:(t,e,n)=>{var i=n(63256),r=n(80693)((function(t,e,n,r){i(t,e,n,r)}));t.exports=r},41558:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>oy});var i={};n.r(i),n.d(i,{JsonPatchError:()=>y,_areEquals:()=>M,applyOperation:()=>k,applyPatch:()=>E,applyReducer:()=>D,deepClone:()=>b,getValueByPointer:()=>w,validate:()=>S,validator:()=>A});var r={};n.r(r),n.d(r,{compare:()=>P,generate:()=>z,observe:()=>T,unobserve:()=>N});var o={};n.r(o),n.d(o,{accessPathDepth:()=>Tt,accessPathWithDatum:()=>St,compile:()=>pm,contains:()=>st,deepEqual:()=>Q,deleteNestedProperty:()=>Dt,duplicate:()=>tt,entries:()=>_t,every:()=>lt,fieldIntersection:()=>vt,flatAccessWithDatum:()=>Mt,getFirstDefined:()=>zt,hasIntersection:()=>mt,hash:()=>ot,internalField:()=>jt,isBoolean:()=>wt,isEmpty:()=>yt,isEqual:()=>ht,isInternalField:()=>Bt,isNullOrFalse:()=>at,isNumeric:()=>It,keys:()=>bt,logicalExpr:()=>Et,mergeDeep:()=>ut,never:()=>et,normalize:()=>Nl,normalizeAngle:()=>Ut,omit:()=>it,pick:()=>nt,prefixGenerator:()=>gt,removePathFromField:()=>Nt,replaceAll:()=>Ot,replacePathInField:()=>Ft,resetIdCounter:()=>Lt,setEqual:()=>pt,some:()=>ct,stringify:()=>rt,titleCase:()=>At,unique:()=>dt,uniqueId:()=>Pt,vals:()=>xt,varName:()=>kt,version:()=>mm});var a={};n.r(a),n.d(a,{carbong10:()=>mg,carbong100:()=>vg,carbong90:()=>gg,carbonwhite:()=>pg,dark:()=>xm,excel:()=>wm,fivethirtyeight:()=>Sm,ggplot2:()=>Cm,googlecharts:()=>Ym,latimes:()=>Rm,powerbi:()=>lg,quartz:()=>jm,urbaninstitute:()=>Jm,version:()=>yg,vox:()=>Um});var s=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),c=Object.prototype.hasOwnProperty;function l(t,e){return c.call(t,e)}function u(t){if(Array.isArray(t)){for(var e=new Array(t.length),n=0;n<e.length;n++)e[n]=""+n;return e}if(Object.keys)return Object.keys(t);var i=[];for(var r in t)l(t,r)&&i.push(r);return i}function f(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function d(t){for(var e,n=0,i=t.length;n<i;){if(!((e=t.charCodeAt(n))>=48&&e<=57))return!1;n++}return!0}function h(t){return-1===t.indexOf("/")&&-1===t.indexOf("~")?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function p(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function m(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var e=0,n=t.length;e<n;e++)if(m(t[e]))return!0}else if("object"===typeof t)for(var i=u(t),r=i.length,o=0;o<r;o++)if(m(t[i[o]]))return!0;return!1}function g(t,e){var n=[t];for(var i in e){var r="object"===typeof e[i]?JSON.stringify(e[i],null,2):e[i];"undefined"!==typeof r&&n.push(i+": "+r)}return n.join("\n")}var v=function(t){function e(e,n,i,r,o){var a=this.constructor,s=t.call(this,g(e,{name:n,index:i,operation:r,tree:o}))||this;return s.name=n,s.index=i,s.operation=r,s.tree=o,Object.setPrototypeOf(s,a.prototype),s.message=g(e,{name:n,index:i,operation:r,tree:o}),s}return s(e,t),e}(Error),y=v,b=f,x={add:function(t,e,n){return t[e]=this.value,{newDocument:n}},remove:function(t,e,n){var i=t[e];return delete t[e],{newDocument:n,removed:i}},replace:function(t,e,n){var i=t[e];return t[e]=this.value,{newDocument:n,removed:i}},move:function(t,e,n){var i=w(n,this.path);i&&(i=f(i));var r=k(n,{op:"remove",path:this.from}).removed;return k(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(t,e,n){var i=w(n,this.from);return k(n,{op:"add",path:this.path,value:f(i)}),{newDocument:n}},test:function(t,e,n){return{newDocument:n,test:M(t[e],this.value)}},_get:function(t,e,n){return this.value=t[e],{newDocument:n}}},_={add:function(t,e,n){return d(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:n,index:e}},remove:function(t,e,n){return{newDocument:n,removed:t.splice(e,1)[0]}},replace:function(t,e,n){var i=t[e];return t[e]=this.value,{newDocument:n,removed:i}},move:x.move,copy:x.copy,test:x.test,_get:x._get};function w(t,e){if(""==e)return t;var n={op:"_get",path:e};return k(t,n),n.value}function k(t,e,n,i,r,o){if(void 0===n&&(n=!1),void 0===i&&(i=!0),void 0===r&&(r=!0),void 0===o&&(o=0),n&&("function"==typeof n?n(e,0,t,e.path):A(e,0)),""===e.path){var a={newDocument:t};if("add"===e.op)return a.newDocument=e.value,a;if("replace"===e.op)return a.newDocument=e.value,a.removed=t,a;if("move"===e.op||"copy"===e.op)return a.newDocument=w(t,e.from),"move"===e.op&&(a.removed=t),a;if("test"===e.op){if(a.test=M(t,e.value),!1===a.test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a.newDocument=t,a}if("remove"===e.op)return a.removed=t,a.newDocument=null,a;if("_get"===e.op)return e.value=t,a;if(n)throw new y("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,e,t);return a}i||(t=f(t));var s=(e.path||"").split("/"),c=t,l=1,u=s.length,h=void 0,m=void 0,g=void 0;for(g="function"==typeof n?n:A;;){if((m=s[l])&&-1!=m.indexOf("~")&&(m=p(m)),r&&("__proto__"==m||"prototype"==m&&l>0&&"constructor"==s[l-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===h&&(void 0===c[m]?h=s.slice(0,l).join("/"):l==u-1&&(h=e.path),void 0!==h&&g(e,0,t,h)),l++,Array.isArray(c)){if("-"===m)m=c.length;else{if(n&&!d(m))throw new y("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,e,t);d(m)&&(m=~~m)}if(l>=u){if(n&&"add"===e.op&&m>c.length)throw new y("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,e,t);if(!1===(a=_[e.op].call(e,c,m,t)).test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}}else if(l>=u){if(!1===(a=x[e.op].call(e,c,m,t)).test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}if(c=c[m],n&&l<u&&(!c||"object"!==typeof c))throw new y("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,e,t)}}function E(t,e,n,i,r){if(void 0===i&&(i=!0),void 0===r&&(r=!0),n&&!Array.isArray(e))throw new y("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(t=f(t));for(var o=new Array(e.length),a=0,s=e.length;a<s;a++)o[a]=k(t,e[a],n,!0,r,a),t=o[a].newDocument;return o.newDocument=t,o}function D(t,e,n){var i=k(t,e);if(!1===i.test)throw new y("Test operation failed","TEST_OPERATION_FAILED",n,e,t);return i.newDocument}function A(t,e,n,i){if("object"!==typeof t||null===t||Array.isArray(t))throw new y("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,t,n);if(!x[t.op])throw new y("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,n);if("string"!==typeof t.path)throw new y("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,t,n);if(0!==t.path.indexOf("/")&&t.path.length>0)throw new y('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if(("move"===t.op||"copy"===t.op)&&"string"!==typeof t.from)throw new y("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&void 0===t.value)throw new y("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&m(t.value))throw new y("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,n);if(n)if("add"==t.op){var r=t.path.split("/").length,o=i.split("/").length;if(r!==o+1&&r!==o)throw new y("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,n)}else if("replace"===t.op||"remove"===t.op||"_get"===t.op){if(t.path!==i)throw new y("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,n)}else if("move"===t.op||"copy"===t.op){var a=S([{op:"_get",path:t.from,value:void 0}],n);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new y("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,n)}}function S(t,e,n){try{if(!Array.isArray(t))throw new y("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)E(f(e),f(t),n||!0);else{n=n||A;for(var i=0;i<t.length;i++)n(t[i],i,e,void 0)}}catch(r){if(r instanceof y)return r;throw r}}function M(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){var n,i,r,o=Array.isArray(t),a=Array.isArray(e);if(o&&a){if((i=t.length)!=e.length)return!1;for(n=i;0!==n--;)if(!M(t[n],e[n]))return!1;return!0}if(o!=a)return!1;var s=Object.keys(t);if((i=s.length)!==Object.keys(e).length)return!1;for(n=i;0!==n--;)if(!e.hasOwnProperty(s[n]))return!1;for(n=i;0!==n--;)if(!M(t[r=s[n]],e[r]))return!1;return!0}return t!==t&&e!==e}var C=new WeakMap,F=function(t){this.observers=new Map,this.obj=t},O=function(t,e){this.callback=t,this.observer=e};function N(t,e){e.unobserve()}function T(t,e){var n,i=function(t){return C.get(t)}(t);if(i){var r=function(t,e){return t.observers.get(e)}(i,e);n=r&&r.observer}else i=new F(t),C.set(t,i);if(n)return n;if(n={},i.value=f(t),e){n.callback=e,n.next=null;var o=function(){z(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=t,n.unobserve=function(){z(n),clearTimeout(n.next),function(t,e){t.observers.delete(e.callback)}(i,n),"undefined"!==typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},i.observers.set(e,new O(e,n)),n}function z(t,e){void 0===e&&(e=!1);var n=C.get(t.object);R(n.value,t.object,t.patches,"",e),t.patches.length&&E(n.value,t.patches);var i=t.patches;return i.length>0&&(t.patches=[],t.callback&&t.callback(i)),i}function R(t,e,n,i,r){if(e!==t){"function"===typeof e.toJSON&&(e=e.toJSON());for(var o=u(e),a=u(t),s=!1,c=a.length-1;c>=0;c--){var d=t[m=a[c]];if(!l(e,m)||void 0===e[m]&&void 0!==d&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(r&&n.push({op:"test",path:i+"/"+h(m),value:f(d)}),n.push({op:"remove",path:i+"/"+h(m)}),s=!0):(r&&n.push({op:"test",path:i,value:t}),n.push({op:"replace",path:i,value:e}),!0);else{var p=e[m];"object"==typeof d&&null!=d&&"object"==typeof p&&null!=p&&Array.isArray(d)===Array.isArray(p)?R(d,p,n,i+"/"+h(m),r):d!==p&&(!0,r&&n.push({op:"test",path:i+"/"+h(m),value:f(d)}),n.push({op:"replace",path:i+"/"+h(m),value:f(p)}))}}if(s||o.length!=a.length)for(c=0;c<o.length;c++){var m;l(t,m=o[c])||void 0===e[m]||n.push({op:"add",path:i+"/"+h(m),value:f(e[m])})}}}function P(t,e,n){void 0===n&&(n=!1);var i=[];return R(t,e,i,"",n),i}Object.assign({},i,r,{JsonPatchError:v,deepClone:f,escapePathComponent:h,unescapePathComponent:p});var L=n(76248),j=n.n(L),B=n(95199),U=n(60784);var I=n(15721),q=n(86893),W=n.n(q),H=n(60473),X=n.n(H),J=n(4761),G=n.n(J);function $(t){return!!t.or}function V(t){return!!t.and}function Y(t){return!!t.not}function K(t,e){if(Y(t))K(t.not,e);else if(V(t))for(const n of t.and)K(n,e);else if($(t))for(const n of t.or)K(n,e);else e(t)}function Z(t,e){return Y(t)?{not:Z(t.not,e)}:V(t)?{and:t.and.map((t=>Z(t,e)))}:$(t)?{or:t.or.map((t=>Z(t,e)))}:e(t)}const Q=X(),tt=W();function et(t){throw new Error(t)}function nt(t,e){const n={};for(const i of e)(0,I.nr)(t,i)&&(n[i]=t[i]);return n}function it(t,e){const n={...t};for(const i of e)delete n[i];return n}Set.prototype.toJSON=function(){return"Set(".concat([...this].map((t=>G()(t))).join(","),")")};const rt=G();function ot(t){if((0,I.hj)(t))return t;const e=(0,I.HD)(t)?t:G()(t);if(e.length<250)return e;let n=0;for(let i=0;i<e.length;i++){n=(n<<5)-n+e.charCodeAt(i),n&=n}return n}function at(t){return!1===t||null===t}function st(t,e){return t.includes(e)}function ct(t,e){let n=0;for(const[i,r]of t.entries())if(e(r,i,n++))return!0;return!1}function lt(t,e){let n=0;for(const[i,r]of t.entries())if(!e(r,i,n++))return!1;return!0}function ut(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];for(const r of n)ft(t,null!==r&&void 0!==r?r:{});return t}function ft(t,e){for(const n of bt(e))(0,I.iL)(t,n,e[n],!0)}function dt(t,e){const n=[],i={};let r;for(const o of t)r=e(o),r in i||(i[r]=1,n.push(o));return n}function ht(t,e){const n=bt(t),i=bt(e);if(n.length!==i.length)return!1;for(const r of n)if(t[r]!==e[r])return!1;return!0}function pt(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function mt(t,e){for(const n of t)if(e.has(n))return!0;return!1}function gt(t){const e=new Set;for(const n of t){const t=(0,I._k)(n).map(((t,e)=>0===e?t:"[".concat(t,"]"))),i=t.map(((e,n)=>t.slice(0,n+1).join("")));for(const n of i)e.add(n)}return e}function vt(t,e){return void 0===t||void 0===e||mt(gt(t),gt(e))}function yt(t){return 0===bt(t).length}const bt=Object.keys,xt=Object.values,_t=Object.entries;function wt(t){return!0===t||!1===t}function kt(t){const e=t.replace(/\W/g,"_");return(t.match(/^\d+/)?"_":"")+e}function Et(t,e){return Y(t)?"!(".concat(Et(t.not,e),")"):V(t)?"(".concat(t.and.map((t=>Et(t,e))).join(") && ("),")"):$(t)?"(".concat(t.or.map((t=>Et(t,e))).join(") || ("),")"):e(t)}function Dt(t,e){if(0===e.length)return!0;const n=e.shift();return n in t&&Dt(t[n],e)&&delete t[n],yt(t)}function At(t){return t.charAt(0).toUpperCase()+t.substr(1)}function St(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum";const n=(0,I._k)(t),i=[];for(let r=1;r<=n.length;r++){const t="[".concat(n.slice(0,r).map(I.m8).join("]["),"]");i.push("".concat(e).concat(t))}return i.join(" && ")}function Mt(t){return"".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum","[").concat((0,I.m8)((0,I._k)(t).join(".")),"]")}function Ct(t){return t.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Ft(t){return"".concat((0,I._k)(t).map(Ct).join("\\."))}function Ot(t,e,n){return t.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Nt(t){return"".concat((0,I._k)(t).join("."))}function Tt(t){return t?(0,I._k)(t).length:0}function zt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)if(void 0!==i)return i}let Rt=42;function Pt(t){const e=++Rt;return t?String(t)+e:e}function Lt(){Rt=42}function jt(t){return Bt(t)?t:"__".concat(t)}function Bt(t){return t.startsWith("__")}function Ut(t){if(void 0!==t)return(t%360+360)%360}function It(t){return!!(0,I.hj)(t)||!isNaN(t)&&!isNaN(parseFloat(t))}const qt="row",Wt="column",Ht="facet",Xt="x",Jt="y",Gt="x2",$t="y2",Vt="xOffset",Yt="yOffset",Kt="radius",Zt="radius2",Qt="theta",te="theta2",ee="latitude",ne="longitude",ie="latitude2",re="longitude2",oe="color",ae="fill",se="stroke",ce="shape",le="size",ue="angle",fe="opacity",de="fillOpacity",he="strokeOpacity",pe="strokeWidth",me="strokeDash",ge="text",ve="order",ye="detail",be="key",xe="tooltip",_e="href",we="url",ke="description",Ee={theta:1,theta2:1,radius:1,radius2:1};function De(t){return t in Ee}const Ae={longitude:1,longitude2:1,latitude:1,latitude2:1};function Se(t){switch(t){case ee:return"y";case ie:return"y2";case ne:return"x";case re:return"x2"}}function Me(t){return t in Ae}const Ce=bt(Ae),Fe={x:1,y:1,x2:1,y2:1,...Ee,...Ae,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function Oe(t){return t===oe||t===ae||t===se}const Ne={row:1,column:1,facet:1},Te=bt(Ne),ze={...Fe,...Ne},Re=bt(ze),{order:Pe,detail:Le,tooltip:je,...Be}=ze,{row:Ue,column:Ie,facet:qe,...We}=Be;bt(Be),bt(We);function He(t){return!!ze[t]}const Xe=[Gt,$t,ie,re,te,Zt];function Je(t){return Ge(t)!==t}function Ge(t){switch(t){case Gt:return Xt;case $t:return Jt;case ie:return ee;case re:return ne;case te:return Qt;case Zt:return Kt}return t}function $e(t){if(De(t))switch(t){case Qt:return"startAngle";case te:return"endAngle";case Kt:return"outerRadius";case Zt:return"innerRadius"}return t}function Ve(t){switch(t){case Xt:return Gt;case Jt:return $t;case ee:return ie;case ne:return re;case Qt:return te;case Kt:return Zt}}function Ye(t){switch(t){case Xt:case Gt:return"width";case Jt:case $t:return"height"}}function Ke(t){switch(t){case Xt:return"xOffset";case Jt:return"yOffset";case Gt:return"x2Offset";case $t:return"y2Offset";case Qt:return"thetaOffset";case Kt:return"radiusOffset";case te:return"theta2Offset";case Zt:return"radius2Offset"}}function Ze(t){switch(t){case Xt:return"xOffset";case Jt:return"yOffset"}}function Qe(t){switch(t){case"xOffset":return"x";case"yOffset":return"y"}}const tn=bt(Fe),{x:en,y:nn,x2:rn,y2:on,xOffset:an,yOffset:sn,latitude:cn,longitude:ln,latitude2:un,longitude2:fn,theta:dn,theta2:hn,radius:pn,radius2:mn,...gn}=Fe,vn=bt(gn),yn={x:1,y:1},bn=bt(yn);function xn(t){return t in yn}const _n={theta:1,radius:1},wn=bt(_n);function kn(t){return"width"===t?Xt:Jt}const En={xOffset:1,yOffset:1};bt(En);function Dn(t){return t in En}const{text:An,tooltip:Sn,href:Mn,url:Cn,description:Fn,detail:On,key:Nn,order:Tn,...zn}=gn,Rn=bt(zn);const Pn={...yn,..._n,...En,...zn},Ln=bt(Pn);function jn(t){return!!Pn[t]}function Bn(t,e){return function(t){switch(t){case oe:case ae:case se:case ke:case ye:case be:case xe:case _e:case ve:case fe:case de:case he:case pe:case Ht:case qt:case Wt:return Un;case Xt:case Jt:case Vt:case Yt:case ee:case ne:return qn;case Gt:case $t:case ie:case re:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case le:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case me:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case ce:return{point:"always",geoshape:"always"};case ge:return{text:"always"};case ue:return{point:"always",square:"always",text:"always"};case we:return{image:"always"};case Qt:case Kt:return{text:"always",arc:"always"};case te:case Zt:return{arc:"always"}}}(t)[e]}const Un={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:In,...qn}=Un;function Wn(t){switch(t){case Xt:case Jt:case Qt:case Kt:case Vt:case Yt:case le:case ue:case pe:case fe:case de:case he:case Gt:case $t:case te:case Zt:return;case Ht:case qt:case Wt:case ce:case me:case ge:case xe:case _e:case we:case ke:return"discrete";case oe:case ae:case se:return"flexible";case ee:case ne:case ie:case re:case ye:case be:case ve:return}}const Hn={argmax:1,argmin:1,average:1,count:1,distinct:1,product: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},Xn={count:1,min:1,max:1};function Jn(t){return!!t&&!!t.argmin}function Gn(t){return!!t&&!!t.argmax}function $n(t){return(0,I.HD)(t)&&!!Hn[t]}const Vn=new Set(["count","valid","missing","distinct"]);function Yn(t){return(0,I.HD)(t)&&Vn.has(t)}const Kn=new Set(["count","sum","distinct","valid","missing"]),Zn=new Set(["mean","average","median","q1","q3","min","max"]);function Qn(t){return(0,I.jn)(t)&&(t=ss(t,void 0)),"bin"+bt(t).map((e=>ii(t[e])?kt("_".concat(e,"_").concat(_t(t[e]))):kt("_".concat(e,"_").concat(t[e])))).join("")}function ti(t){return!0===t||ni(t)&&!t.binned}function ei(t){return"binned"===t||ni(t)&&!0===t.binned}function ni(t){return(0,I.Kn)(t)}function ii(t){return null===t||void 0===t?void 0:t.param}function ri(t){switch(t){case qt:case Wt:case le:case oe:case ae:case se:case pe:case fe:case de:case he:case ce:return 6;case me:return 4;default:return 10}}function oi(t){return!(null===t||void 0===t||!t.expr)}function ai(t){const e=bt(t||{}),n={};for(const i of e)n[i]=gi(t[i]);return n}function si(t){const{anchor:e,frame:n,offset:i,orient:r,angle:o,limit:a,color:s,subtitleColor:c,subtitleFont:l,subtitleFontSize:u,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...m}=t,g={...e?{anchor:e}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...void 0!==o?{angle:o}:{},...void 0!==a?{limit:a}:{}},v={...c?{subtitleColor:c}:{},...l?{subtitleFont:l}:{},...u?{subtitleFontSize:u}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}};return{titleMarkConfig:{...m,...s?{fill:s}:{}},subtitleMarkConfig:nt(t,["align","baseline","dx","dy","limit"]),nonMarkTitleProperties:g,subtitle:v}}function ci(t){return(0,I.HD)(t)||(0,I.kJ)(t)&&(0,I.HD)(t[0])}function li(t){return!(null===t||void 0===t||!t.signal)}function ui(t){return!!t.step}function fi(t){return!(0,I.kJ)(t)&&("field"in t&&"data"in t)}const di=bt({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),hi={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},pi=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function mi(t){const e=(0,I.kJ)(t.condition)?t.condition.map(vi):vi(t.condition);return{...gi(t),condition:e}}function gi(t){if(oi(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function vi(t){if(oi(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function yi(t){if(oi(t)){const{expr:e,...n}=t;return{signal:e,...n}}return li(t)?t:void 0!==t?{value:t}:void 0}function bi(t){return li(t)?t.signal:(0,I.m8)(t.value)}function xi(t){return li(t)?t.signal:null==t?null:(0,I.m8)(t)}function _i(t,e,n){for(const i of n){const n=Ei(i,e.markDef,e.config);void 0!==n&&(t[i]=yi(n))}return t}function wi(t){var e;return[].concat(t.type,null!==(e=t.style)&&void 0!==e?e:[])}function ki(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{vgChannel:r,ignoreVgConfig:o}=i;return r&&void 0!==e[r]?e[r]:void 0!==e[t]?e[t]:!o||r&&r!==t?Ei(t,e,n,i):void 0}function Ei(t,e,n){let{vgChannel:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return zt(i?Di(t,e,n.style):void 0,Di(t,e,n.style),i?n[e.type][i]:void 0,n[e.type][t],i?n.mark[i]:n.mark[t])}function Di(t,e,n){return Ai(t,wi(e),n)}function Ai(t,e,n){let i;e=(0,I.IX)(e);for(const r of e){const e=n[r];e&&void 0!==e[t]&&(i=e[t])}return i}function Si(t,e){return(0,I.IX)(t).reduce(((t,n)=>{var i;return t.field.push(Ga(n,e)),t.order.push(null!==(i=n.sort)&&void 0!==i?i:"ascending"),t}),{field:[],order:[]})}function Mi(t,e){const n=[...t];return e.forEach((t=>{for(const e of n)if(Q(e,t))return;n.push(t)})),n}function Ci(t,e){return Q(t,e)||!e?t:t?[...(0,I.IX)(t),...(0,I.IX)(e)].join(", "):e}function Fi(t,e){const n=t.value,i=e.value;if(null==n||null===i)return{explicit:t.explicit,value:null};if((ci(n)||li(n))&&(ci(i)||li(i)))return{explicit:t.explicit,value:Ci(n,i)};if(ci(n)||li(n))return{explicit:t.explicit,value:n};if(ci(i)||li(i))return{explicit:t.explicit,value:i};if(!ci(n)&&!li(n)&&!ci(i)&&!li(i))return{explicit:t.explicit,value:Mi(n,i)};throw new Error("It should never reach here")}function Oi(t){return"Invalid specification ".concat(rt(t),'. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".')}const Ni='Autosize "fit" only works for single views and layered views.';function Ti(t){return"".concat("width"==t?"Width":"Height",' "container" only works for single views and layered views.')}function zi(t){const e="width"==t?"x":"y";return"".concat("width"==t?"Width":"Height",' "container" only works well with autosize "fit" or "fit-').concat(e,'".')}function Ri(t){return t?'Dropping "fit-'.concat(t,'" because spec has discrete ').concat(Ye(t),"."):'Dropping "fit" because spec has discrete size.'}function Pi(t){return"Unknown field for ".concat(t,". Cannot calculate view size.")}function Li(t){return'Cannot project a selection on encoding channel "'.concat(t,'", which has no field.')}function ji(t,e){return'Cannot project a selection on encoding channel "'.concat(t,'" as it uses an aggregate function ("').concat(e,'").')}function Bi(t){return"Selection not supported for ".concat(t," yet.")}const Ui="The same selection must be used to override scale domains in a layered view.";function Ii(t){return'The "columns" property cannot be used when "'.concat(t,'" has nested row/column.')}function qi(t,e,n){return'An ancestor parsed field "'.concat(t,'" as ').concat(n," but a child wants to parse the field as ").concat(e,".")}function Wi(t){return"Config.customFormatTypes is not true, thus custom format type and format for channel ".concat(t," are dropped.")}function Hi(t){return"".concat(t,"Offset dropped because ").concat(t," is continuous")}function Xi(t){return"There is no ".concat(t," encoding. Replacing ").concat(t,"Offset encoding as ").concat(t,".")}function Ji(t){return'Invalid field type "'.concat(t,'".')}function Gi(t,e){const{fill:n,stroke:i}=e;return"Dropping color ".concat(t," as the plot also has ").concat(n&&i?"fill and stroke":n?"fill":"stroke",".")}function $i(t,e){return"Dropping ".concat(rt(t),' from channel "').concat(e,'" since it does not contain any data field, datum, value, or signal.')}function Vi(t,e,n){return"".concat(t,' dropped as it is incompatible with "').concat(e,'"').concat(n?" when ".concat(n):"",".")}function Yi(t){return"".concat(t," encoding has no scale, so specified scale is ignored.")}function Ki(t){return"".concat(t," encoding should be discrete (ordinal / nominal / binned).")}function Zi(t){return"".concat(t," encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).")}function Qi(t,e){return'Using discrete channel "'.concat(t,'" to encode "').concat(e,'" field can be misleading as it does not encode ').concat("ordinal"===e?"order":"magnitude",".")}function tr(t){return"Using unaggregated domain with raw field has no effect (".concat(rt(t),").")}function er(t){return'Unaggregated domain not applicable for "'.concat(t,'" since it produces values outside the origin domain of the source data.')}function nr(t){return"Unaggregated domain is currently unsupported for log scale (".concat(rt(t),").")}function ir(t,e,n){return"".concat(n,"-scale's \"").concat(e,'" is dropped as it does not work with ').concat(t," scale.")}function rr(t){return'The step for "'.concat(t,'" is dropped because the ').concat("width"===t?"x":"y"," is continuous.")}const or="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function ar(t,e){return"Invalid ".concat(t,": ").concat(rt(e),".")}function sr(t){return"1D error band does not support ".concat(t,".")}function cr(t){return"Channel ".concat(t,' is required for "binned" bin.')}const lr=(0,I.kg)(I.uU);let ur=lr;function fr(){return ur=lr,ur}function dr(){ur.warn(...arguments)}function hr(t){if(t&&(0,I.Kn)(t))for(const e of _r)if(e in t)return!0;return!1}new WeakMap;const pr=["january","february","march","april","may","june","july","august","september","october","november","december"],mr=pr.map((t=>t.substr(0,3))),gr=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],vr=gr.map((t=>t.substr(0,3)));function yr(t,e){const n=[];if(e&&void 0!==t.day&&bt(t).length>1&&(dr(function(t){return"Dropping day from datetime ".concat(rt(t)," as day cannot be combined with other units.")}(t)),delete(t=tt(t)).day),void 0!==t.year?n.push(t.year):n.push(2012),void 0!==t.month){const i=e?function(t){if(It(t)&&(t=+t),(0,I.hj)(t))return t-1;{const e=t.toLowerCase(),n=pr.indexOf(e);if(-1!==n)return n;const i=e.substr(0,3),r=mr.indexOf(i);if(-1!==r)return r;throw new Error(ar("month",t))}}(t.month):t.month;n.push(i)}else if(void 0!==t.quarter){const i=e?function(t){if(It(t)&&(t=+t),(0,I.hj)(t))return t>4&&dr(ar("quarter",t)),t-1;throw new Error(ar("quarter",t))}(t.quarter):t.quarter;n.push((0,I.hj)(i)?3*i:"".concat(i,"*3"))}else n.push(0);if(void 0!==t.date)n.push(t.date);else if(void 0!==t.day){const i=e?function(t){if(It(t)&&(t=+t),(0,I.hj)(t))return t%7;{const e=t.toLowerCase(),n=gr.indexOf(e);if(-1!==n)return n;const i=e.substr(0,3),r=vr.indexOf(i);if(-1!==r)return r;throw new Error(ar("day",t))}}(t.day):t.day;n.push((0,I.hj)(i)?i+1:"".concat(i,"+1"))}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const e=t[i];n.push("undefined"===typeof e?0:e)}return n}function br(t){const e=yr(t,!0).join(", ");return t.utc?"utc(".concat(e,")"):"datetime(".concat(e,")")}const xr={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},_r=bt(xr);function wr(t){return t.startsWith("utc")}const kr={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function Er(t){return _r.filter((e=>Dr(t,e)))}function Dr(t,e){const n=t.indexOf(e);return!(n<0)&&(!(n>0&&"seconds"===e&&"i"===t.charAt(n-1))&&(!(t.length>n+3&&"day"===e&&"o"===t.charAt(n+3))&&!(n>0&&"year"===e&&"f"===t.charAt(n-1))))}function Ar(t,e){let{end:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{end:!1};const i=St(e),r=wr(t)?"utc":"";let o;const a={};for(const c of _r)Dr(t,c)&&(a[c]="quarter"===(s=c)?"(".concat(r,"quarter(").concat(i,")-1)"):"".concat(r).concat(s,"(").concat(i,")"),o=c);var s;return n&&(a[o]+="+1"),function(t){const e=yr(t,!1).join(", ");return t.utc?"utc(".concat(e,")"):"datetime(".concat(e,")")}(a)}function Sr(t){if(!t)return;const e=Er(t);return"timeUnitSpecifier(".concat(rt(e),", ").concat(rt(kr),")")}function Mr(t){if(!t)return;let e;return(0,I.HD)(t)?e={unit:t}:(0,I.Kn)(t)&&(e={...t,...t.unit?{unit:t.unit}:{}}),wr(e.unit)&&(e.utc=!0,e.unit=function(t){return t.substr(3)}(e.unit)),e}function Cr(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t=>t;const n=Mr(t),i=function(t){const e=Er(t);return e[e.length-1]}(n.unit);if(i&&"day"!==i){const t={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},r=n.step||1,o={...t,..."quarter"===i?{month:+t.month+3*r}:"week"===i?{date:+t.date+7*r}:{[i]:+t[i]+r}};return"".concat(e(br(o))," - ").concat(e(br(t)))}}function Fr(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.equal}function Or(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.lt}function Nr(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.lte}function Tr(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.gt}function zr(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.gte}function Rr(t){if(null!==t&&void 0!==t&&t.field){if((0,I.kJ)(t.range)&&2===t.range.length)return!0;if(li(t.range))return!0}return!1}function Pr(t){return!(null===t||void 0===t||!t.field)&&((0,I.kJ)(t.oneOf)||(0,I.kJ)(t.in))}function Lr(t){return Pr(t)||Fr(t)||Rr(t)||Or(t)||Tr(t)||Nr(t)||zr(t)}function jr(t,e){return us(t,{timeUnit:e,wrapTime:!0})}function Br(t){var e;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{field:i}=t,r=null===(e=Mr(t.timeUnit))||void 0===e?void 0:e.unit,o=r?"time(".concat(Ar(r,i),")"):Ga(t,{expr:"datum"});if(Fr(t))return"".concat(o,"===").concat(jr(t.equal,r));if(Or(t)){const e=t.lt;return"".concat(o,"<").concat(jr(e,r))}if(Tr(t)){const e=t.gt;return"".concat(o,">").concat(jr(e,r))}if(Nr(t)){const e=t.lte;return"".concat(o,"<=").concat(jr(e,r))}if(zr(t)){const e=t.gte;return"".concat(o,">=").concat(jr(e,r))}if(Pr(t))return"indexof([".concat(function(t,e){return t.map((t=>jr(t,e)))}(t.oneOf,r).join(","),"], ").concat(o,") !== -1");if(function(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.valid}(t))return Ur(o,t.valid);if(Rr(t)){const{range:e}=t,i=li(e)?{signal:"".concat(e.signal,"[0]")}:e[0],a=li(e)?{signal:"".concat(e.signal,"[1]")}:e[1];if(null!==i&&null!==a&&n)return"inrange("+o+", ["+jr(i,r)+", "+jr(a,r)+"])";const s=[];return null!==i&&s.push("".concat(o," >= ").concat(jr(i,r))),null!==a&&s.push("".concat(o," <= ").concat(jr(a,r))),s.length>0?s.join(" && "):"true"}throw new Error("Invalid field predicate: ".concat(rt(t)))}function Ur(t){return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?"isValid(".concat(t,") && isFinite(+").concat(t,")"):"!isValid(".concat(t,") || !isFinite(+").concat(t,")")}function Ir(t){var e;return Lr(t)&&t.timeUnit?{...t,timeUnit:null===(e=Mr(t.timeUnit))||void 0===e?void 0:e.unit}:t}const qr={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Wr(t){return"quantitative"===t||"temporal"===t}function Hr(t){return"ordinal"===t||"nominal"===t}const Xr=qr.quantitative,Jr=qr.ordinal,Gr=qr.temporal,$r=qr.nominal,Vr=qr.geojson;bt(qr);const Yr={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},Kr={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};bt(Kr);function Zr(t,e){const n=Kr[t],i=Kr[e];return n===i||"ordinal-position"===n&&"time"===i||"ordinal-position"===i&&"time"===n}const Qr={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function to(t){return Qr[t]}const eo=new Set(["linear","log","pow","sqrt","symlog"]),no=new Set([...eo,"time","utc"]);function io(t){return eo.has(t)}const ro=new Set(["quantile","quantize","threshold"]),oo=new Set([...no,...ro,"sequential","identity"]),ao=new Set(["ordinal","bin-ordinal","point","band"]);new Set(["time","utc"]);function so(t){return ao.has(t)}function co(t){return oo.has(t)}function lo(t){return no.has(t)}function uo(t){return ro.has(t)}function fo(t){return null===t||void 0===t?void 0:t.param}const ho={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,align:1,range:1,rangeMax:1,rangeMin: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},{type:po,domain:mo,range:go,rangeMax:vo,rangeMin:yo,scheme:bo,...xo}=(bt(ho),ho),_o=bt(xo);function wo(t,e){switch(e){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(t);case"bins":return!["point","band","identity","ordinal"].includes(t);case"round":return lo(t)||"band"===t||"point"===t;case"padding":case"rangeMin":case"rangeMax":return lo(t)||["point","band"].includes(t);case"paddingOuter":case"align":return["point","band"].includes(t);case"paddingInner":return"band"===t;case"domainMax":case"domainMid":case"domainMin":case"clamp":return lo(t);case"nice":return lo(t)||"quantize"===t||"threshold"===t;case"exponent":return"pow"===t;case"base":return"log"===t;case"constant":return"symlog"===t;case"zero":return co(t)&&!st(["log","time","utc","threshold","quantile"],t)}}function ko(t,e){switch(e){case"interpolate":case"scheme":case"domainMid":return Oe(t)?void 0:'Cannot use the scale property "'.concat(e,'" with non-color channel.');case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}const Eo={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},Do=Eo.arc,Ao=Eo.area,So=Eo.bar,Mo=Eo.image,Co=Eo.line,Fo=Eo.point,Oo=Eo.rect,No=Eo.rule,To=Eo.text,zo=Eo.tick,Ro=Eo.trail,Po=Eo.circle,Lo=Eo.square,jo=Eo.geoshape;function Bo(t){return["line","area","trail"].includes(t)}function Uo(t){return["rect","bar","image","arc"].includes(t)}const Io=new Set(bt(Eo));function qo(t){return t.type}const Wo=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],Ho=bt({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),Xo=bt({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1});function Jo(t){return t&&void 0!=t.band}const Go={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},$o={binSpacing:1,continuousBandSize:5,timeUnitBandPosition:.5},Vo={binSpacing:0,continuousBandSize:5,timeUnitBandPosition:.5};function Yo(t){const{channel:e,channelDef:n,markDef:i,scale:r,config:o}=t,a=ea(t);return Ta(n)&&!Yn(n.aggregate)&&r&&lo(r.get("type"))?function(t){let{fieldDef:e,channel:n,markDef:i,ref:r,config:o}=t;if(Bo(i.type))return r;const a=ki("invalid",i,o);if(null===a)return[Ko(e,n),r];return r}({fieldDef:n,channel:e,markDef:i,ref:a,config:o}):a}function Ko(t,e){return{test:Zo(t,!0),..."y"===Ge(e)?{field:{group:"height"}}:{value:0}}}function Zo(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Ur((0,I.HD)(t)?t:Ga(t,{expr:"datum"}),!e)}function Qo(t,e,n,i){const r={};if(e&&(r.scale=e),Ra(t)){const{datum:e}=t;hr(e)?r.signal=br(e):li(e)?r.signal=e.signal:oi(e)?r.signal=e.expr:r.value=e}else r.field=Ga(t,n);if(i){const{offset:t,band:e}=i;t&&(r.offset=t),e&&(r.band=e)}return r}function ta(t){let{scaleName:e,fieldOrDatumDef:n,fieldOrDatumDef2:i,offset:r,startSuffix:o,bandPosition:a=.5}=t;const s=0<a&&a<1?"datum":void 0,c=Ga(n,{expr:s,suffix:o}),l=void 0!==i?Ga(i,{expr:s}):Ga(n,{suffix:"end",expr:s}),u={};if(0===a||1===a){u.scale=e;const t=0===a?c:l;u.field=t}else{const t=li(a)?"".concat(a.signal," * ").concat(c," + (1-").concat(a.signal,") * ").concat(l):"".concat(a," * ").concat(c," + ").concat(1-a," * ").concat(l);u.signal='scale("'.concat(e,'", ').concat(t,")")}return r&&(u.offset=r),u}function ea(t){let{channel:e,channelDef:n,channel2Def:i,markDef:r,config:o,scaleName:a,scale:s,stack:c,offset:l,defaultRef:u,bandPosition:f}=t;if(n){if(Ba(n)){var d,h;const t=null===s||void 0===s?void 0:s.get("type");if(Ua(n)){var p;null!==(p=f)&&void 0!==p||(f=Aa({fieldDef:n,fieldDef2:i,markDef:r,config:o}));const{bin:s,timeUnit:u,type:d}=n;if(ti(s)||f&&u&&d===Gr)return null!==c&&void 0!==c&&c.impute?Qo(n,a,{binSuffix:"mid"},{offset:l}):f&&!so(t)?ta({scaleName:a,fieldOrDatumDef:n,bandPosition:f,offset:l}):Qo(n,a,ds(n,e)?{binSuffix:"range"}:{},{offset:l});if(ei(s)){if(Ta(i))return ta({scaleName:a,fieldOrDatumDef:n,fieldOrDatumDef2:i,bandPosition:f,offset:l});dr(cr(e===Xt?Gt:$t))}}return Qo(n,a,so(t)?{binSuffix:"range"}:{},{offset:l,band:"band"===t?null!==(d=null!==(h=f)&&void 0!==h?h:n.bandPosition)&&void 0!==d?d:.5:void 0})}if(Ia(n)){const t=l?{offset:l}:{};return{...na(e,n.value),...t}}}return(0,I.mf)(u)&&(u=u()),u?{...u,...l?{offset:l}:{}}:u}function na(t,e){return st(["x","x2"],t)&&"width"===e?{field:{group:"width"}}:st(["y","y2"],t)&&"height"===e?{field:{group:"height"}}:yi(e)}function ia(t){return t&&"number"!==t&&"time"!==t}function ra(t,e,n){return"".concat(t,"(").concat(e).concat(n?", ".concat(rt(n)):"",")")}const oa=" \u2013 ";function aa(t){let{fieldOrDatumDef:e,format:n,formatType:i,expr:r,normalizeStack:o,config:a}=t;if(ia(i))return ca({fieldOrDatumDef:e,format:n,formatType:i,expr:r,config:a});const s=sa(e,r,o),c=za(e);if(void 0===n&&void 0===i&&a.customFormatTypes){if("quantitative"===c){if(o&&a.normalizedNumberFormatType)return ca({fieldOrDatumDef:e,format:a.normalizedNumberFormat,formatType:a.normalizedNumberFormatType,expr:r,config:a});if(a.numberFormatType)return ca({fieldOrDatumDef:e,format:a.numberFormat,formatType:a.numberFormatType,expr:r,config:a})}if("temporal"===c&&a.timeFormatType&&Ta(e)&&void 0===e.timeUnit)return ca({fieldOrDatumDef:e,format:a.timeFormat,formatType:a.timeFormatType,expr:r,config:a})}if(ls(e)){var l,u;const t=function(t){let{field:e,timeUnit:n,format:i,formatType:r,rawTimeFormat:o,isUTCScale:a}=t;return!n||i?!n&&r?"".concat(r,"(").concat(e,", '").concat(i,"')"):(i=(0,I.HD)(i)?i:o,"".concat(a?"utc":"time","Format(").concat(e,", '").concat(i,"')")):function(t,e,n){if(!t)return;const i=Sr(t),r=n||wr(t);return"".concat(r?"utc":"time","Format(").concat(e,", ").concat(i,")")}(n,e,a)}({field:s,timeUnit:Ta(e)?null===(l=Mr(e.timeUnit))||void 0===l?void 0:l.unit:void 0,format:n,formatType:a.timeFormatType,rawTimeFormat:a.timeFormat,isUTCScale:qa(e)&&(null===(u=e.scale)||void 0===u?void 0:u.type)===Yr.UTC});return t?{signal:t}:void 0}if(n=fa({type:c,specifiedFormat:n,config:a,normalizeStack:o}),Ta(e)&&ti(e.bin)){return{signal:pa(s,Ga(e,{expr:r,binSuffix:"end"}),n,i,a)}}return n||"quantitative"===za(e)?{signal:"".concat(da(s,n))}:{signal:"isValid(".concat(s,") ? ").concat(s,' : ""+').concat(s)}}function sa(t,e,n){return Ta(t)?n?"".concat(Ga(t,{expr:e,suffix:"end"}),"-").concat(Ga(t,{expr:e,suffix:"start"})):Ga(t,{expr:e}):function(t){const{datum:e}=t;return hr(e)?br(e):"".concat(rt(e))}(t)}function ca(t){var e;let{fieldOrDatumDef:n,format:i,formatType:r,expr:o,normalizeStack:a,config:s,field:c}=t;if(null!==(e=c)&&void 0!==e||(c=sa(n,o,a)),"datum.value"!==c&&Ta(n)&&ti(n.bin)){return{signal:pa(c,Ga(n,{expr:o,binSuffix:"end"}),i,r,s)}}return{signal:ra(r,c,i)}}function la(t,e,n,i,r,o){if(!(0,I.HD)(i)||!ia(i)){if(void 0===n&&void 0===i&&r.customFormatTypes&&"quantitative"===za(t)){if(r.normalizedNumberFormatType&&Wa(t)&&"normalize"===t.stack)return;if(r.numberFormatType)return}if(Wa(t)&&"normalize"===t.stack&&r.normalizedNumberFormat)return fa({type:"quantitative",config:r,normalizeStack:!0});if(ls(t)){var a;const e=Ta(t)?null===(a=Mr(t.timeUnit))||void 0===a?void 0:a.unit:void 0;if(void 0===e&&r.customFormatTypes&&r.timeFormatType)return;return function(t){let{specifiedFormat:e,timeUnit:n,config:i,omitTimeFormatConfig:r}=t;if(e)return e;if(n)return{signal:Sr(n)};return r?void 0:i.timeFormat}({specifiedFormat:n,timeUnit:e,config:r,omitTimeFormatConfig:o})}return fa({type:e,specifiedFormat:n,config:r})}}function ua(t,e,n){return t&&(li(t)||"number"===t||"time"===t)?t:ls(e)&&"time"!==n&&"utc"!==n?Ta(e)&&null!==(i=Mr(null===e||void 0===e?void 0:e.timeUnit))&&void 0!==i&&i.utc?"utc":"time":void 0;var i}function fa(t){let{type:e,specifiedFormat:n,config:i,normalizeStack:r}=t;return(0,I.HD)(n)?n:e===Xr?r?i.normalizedNumberFormat:i.numberFormat:void 0}function da(t,e){return"format(".concat(t,', "').concat(e||"",'")')}function ha(t,e,n,i){var r;return ia(n)?ra(n,t,e):da(t,null!==(r=(0,I.HD)(e)?e:void 0)&&void 0!==r?r:i.numberFormat)}function pa(t,e,n,i,r){if(void 0===n&&void 0===i&&r.customFormatTypes&&r.numberFormatType)return pa(t,e,r.numberFormat,r.numberFormatType,r);const o=ha(t,n,i,r),a=ha(e,n,i,r);return"".concat(Ur(t,!1),' ? "null" : ').concat(o,' + "').concat(oa,'" + ').concat(a)}const ma="min",ga={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function va(t){return t in ga}function ya(t){return!(null===t||void 0===t||!t.encoding)}function ba(t){return t&&("count"===t.op||!!t.field)}function xa(t){return t&&(0,I.kJ)(t)}function _a(t){return"row"in t||"column"in t}function wa(t){return!!t&&"header"in t}function ka(t){return"facet"in t}function Ea(t){const{field:e,timeUnit:n,bin:i,aggregate:r}=t;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:e}}function Da(t){return"sort"in t}function Aa(t){let{fieldDef:e,fieldDef2:n,markDef:i,config:r}=t;if(Ba(e)&&void 0!==e.bandPosition)return e.bandPosition;if(Ta(e)){const{timeUnit:t,bin:o}=e;if(t&&!n)return Uo(i.type)?0:Ei("timeUnitBandPosition",i,r);if(ti(o))return.5}}function Sa(t){let{channel:e,fieldDef:n,fieldDef2:i,markDef:r,config:o,scaleType:a,useVlSizeChannel:s}=t;const c=Ye(e),l=ki(s?"size":c,r,o,{vgChannel:c});if(void 0!==l)return l;if(Ta(n)){const{timeUnit:t,bin:e}=n;if(t&&!i)return{band:Ei("timeUnitBandSize",r,o)};if(ti(e)&&!so(a))return{band:1}}var u,f,d;return Uo(r.type)?a?so(a)?(null===(f=o[r.type])||void 0===f?void 0:f.discreteBandSize)||{band:1}:null===(d=o[r.type])||void 0===d?void 0:d.continuousBandSize:null===(u=o[r.type])||void 0===u?void 0:u.discreteBandSize:void 0}function Ma(t,e,n,i){return!!(ti(t.bin)||t.timeUnit&&Ua(t)&&"temporal"===t.type)&&void 0!==Aa({fieldDef:t,fieldDef2:e,markDef:n,config:i})}function Ca(t){return t&&!!t.sort&&!t.field}function Fa(t){return t&&"condition"in t}function Oa(t){const e=null===t||void 0===t?void 0:t.condition;return!!e&&!(0,I.kJ)(e)&&Ta(e)}function Na(t){const e=null===t||void 0===t?void 0:t.condition;return!!e&&!(0,I.kJ)(e)&&Ba(e)}function Ta(t){return t&&(!!t.field||"count"===t.aggregate)}function za(t){return null===t||void 0===t?void 0:t.type}function Ra(t){return t&&"datum"in t}function Pa(t){return Ua(t)&&!$a(t)||ja(t)}function La(t){return Ua(t)&&"quantitative"===t.type&&!t.bin||ja(t)}function ja(t){return Ra(t)&&(0,I.hj)(t.datum)}function Ba(t){return Ta(t)||Ra(t)}function Ua(t){return t&&("field"in t||"count"===t.aggregate)&&"type"in t}function Ia(t){return t&&"value"in t&&"value"in t}function qa(t){return t&&("scale"in t||"sort"in t)}function Wa(t){return t&&("axis"in t||"stack"in t||"impute"in t)}function Ha(t){return t&&"legend"in t}function Xa(t){return t&&("format"in t||"formatType"in t)}function Ja(t){return it(t,["legend","axis","header","scale"])}function Ga(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.field;const i=e.prefix;let r=e.suffix,o="";if(function(t){return"count"===t.aggregate}(t))n=jt("count");else{let i;if(!e.nofn)if(function(t){return"op"in t}(t))i=t.op;else{const{bin:l,aggregate:u,timeUnit:f}=t;var a,s;if(ti(l))i=Qn(l),r=(null!==(a=e.binSuffix)&&void 0!==a?a:"")+(null!==(s=e.suffix)&&void 0!==s?s:"");else if(u)Gn(u)?(o='["'.concat(n,'"]'),n="argmax_".concat(u.argmax)):Jn(u)?(o='["'.concat(n,'"]'),n="argmin_".concat(u.argmin)):i=String(u);else if(f){var c;i=function(t){const{utc:e,...n}=Mr(t);return n.unit?(e?"utc":"")+bt(n).map((t=>kt("".concat("unit"===t?"":"_".concat(t,"_")).concat(n[t])))).join(""):(e?"utc":"")+"timeunit"+bt(n).map((t=>kt("_".concat(t,"_").concat(n[t])))).join("")}(f),r=(!["range","mid"].includes(e.binSuffix)&&e.binSuffix||"")+(null!==(c=e.suffix)&&void 0!==c?c:"")}}i&&(n=n?"".concat(i,"_").concat(n):i)}return r&&(n="".concat(n,"_").concat(r)),i&&(n="".concat(i,"_").concat(n)),e.forAs?Nt(n):e.expr?Mt(n,e.expr)+o:Ft(n)+o}function $a(t){switch(t.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return Ta(t)&&!!t.bin;case"temporal":return!1}throw new Error(Ji(t.type))}const Va=(t,e)=>{switch(e.fieldTitle){case"plain":return t.field;case"functional":return function(t){const{aggregate:e,bin:n,timeUnit:i,field:r}=t;if(Gn(e))return"".concat(r," for argmax(").concat(e.argmax,")");if(Jn(e))return"".concat(r," for argmin(").concat(e.argmin,")");const o=Mr(i),a=e||(null===o||void 0===o?void 0:o.unit)||(null===o||void 0===o?void 0:o.maxbins)&&"timeunit"||ti(n)&&"bin";return a?"".concat(a.toUpperCase(),"(").concat(r,")"):r}(t);default:return function(t,e){const{field:n,bin:i,timeUnit:r,aggregate:o}=t;if("count"===o)return e.countTitle;if(ti(i))return"".concat(n," (binned)");if(r){var a;const t=null===(a=Mr(r))||void 0===a?void 0:a.unit;if(t)return"".concat(n," (").concat(Er(t).join("-"),")")}else if(o)return Gn(o)?"".concat(n," for max ").concat(o.argmax):Jn(o)?"".concat(n," for min ").concat(o.argmin):"".concat(At(o)," of ").concat(n);return n}(t,e)}};let Ya=Va;function Ka(t){Ya=t}function Za(t,e,n){var i;let{allowDisabling:r,includeDefault:o=!0}=n;const a=null===(i=Qa(t))||void 0===i?void 0:i.title;if(!Ta(t))return null!==a&&void 0!==a?a:t.title;const s=t,c=o?ts(s,e):void 0;return r?zt(a,s.title,c):null!==(l=null!==a&&void 0!==a?a:s.title)&&void 0!==l?l:c;var l}function Qa(t){return Wa(t)&&t.axis?t.axis:Ha(t)&&t.legend?t.legend:wa(t)&&t.header?t.header:void 0}function ts(t,e){return Ya(t,e)}function es(t){if(Xa(t)){const{format:e,formatType:n}=t;return{format:e,formatType:n}}{var e;const n=null!==(e=Qa(t))&&void 0!==e?e:{},{format:i,formatType:r}=n;return{format:i,formatType:r}}}function ns(t){return Ta(t)?t:Oa(t)?t.condition:void 0}function is(t){return Ba(t)?t:Na(t)?t.condition:void 0}function rs(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if((0,I.HD)(t)||(0,I.hj)(t)||(0,I.jn)(t)){return dr(function(t,e,n){return"Channel ".concat(t," is a ").concat(e,". Converted to {value: ").concat(rt(n),"}.")}(e,(0,I.HD)(t)?"string":(0,I.hj)(t)?"number":"boolean",t)),{value:t}}return Ba(t)?os(t,e,n,i):Na(t)?{...t,condition:os(t.condition,e,n,i)}:t}function os(t,e,n,i){if(Xa(t)){const{format:r,formatType:o,...a}=t;if(ia(o)&&!n.customFormatTypes)return dr(Wi(e)),os(a,e,n,i)}else{const r=Wa(t)?"axis":Ha(t)?"legend":wa(t)?"header":null;if(r&&t[r]){const{format:o,formatType:a,...s}=t[r];if(ia(a)&&!n.customFormatTypes)return dr(Wi(e)),os({...t,[r]:s},e,n,i)}}return Ta(t)?as(t,e,i):function(t){let e=t.type;if(e)return t;const{datum:n}=t;return e=(0,I.hj)(n)?"quantitative":(0,I.HD)(n)?"nominal":hr(n)?"temporal":void 0,{...t,type:e}}(t)}function as(t,e){let{compositeMark:n=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{aggregate:i,timeUnit:r,bin:o,field:a}=t,s={...t};if(n||!i||$n(i)||Gn(i)||Jn(i)||(dr(function(t){return'Invalid aggregation operator "'.concat(t,'".')}(i)),delete s.aggregate),r&&(s.timeUnit=Mr(r)),a&&(s.field="".concat(a)),ti(o)&&(s.bin=ss(o,e)),ei(o)&&!xn(e)&&dr(function(t){return"Channel ".concat(t,' should not be used with "binned" bin.')}(e)),Ua(s)){const{type:t}=s,e=function(t){if(t)switch(t=t.toLowerCase()){case"q":case Xr:return"quantitative";case"t":case Gr:return"temporal";case"o":case Jr:return"ordinal";case"n":case $r:return"nominal";case Vr:return"geojson"}}(t);t!==e&&(s.type=e),"quantitative"!==t&&Yn(i)&&(dr(function(t,e){return'Invalid field type "'.concat(t,'" for aggregate: "').concat(e,'", using "quantitative" instead.')}(t,i)),s.type="quantitative")}else if(!Je(e)){const t=function(t,e){var n;switch(e){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Da(t)&&(0,I.kJ)(t.sort))return"ordinal";const{aggregate:i,bin:r,timeUnit:o}=t;if(o)return"temporal";if(r||i&&!Gn(i)&&!Jn(i))return"quantitative";if(qa(t)&&null!==(n=t.scale)&&void 0!==n&&n.type)switch(Kr[t.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,e);s.type=t}if(Ua(s)){const{compatible:t,warning:n}=function(t,e){const n=t.type;if("geojson"===n&&"shape"!==e)return{compatible:!1,warning:"Channel ".concat(e," should not be used with a geojson data.")};switch(e){case qt:case Wt:case Ht:return $a(t)?cs:{compatible:!1,warning:Ki(e)};case Xt:case Jt:case Vt:case Yt:case oe:case ae:case se:case ge:case ye:case be:case xe:case _e:case we:case ue:case Qt:case Kt:case ke:return cs;case ne:case re:case ee:case ie:return n!==Xr?{compatible:!1,warning:"Channel ".concat(e," should be used with a quantitative field only, not ").concat(t.type," field.")}:cs;case fe:case de:case he:case pe:case le:case te:case Zt:case Gt:case $t:return"nominal"!==n||t.sort?cs:{compatible:!1,warning:"Channel ".concat(e," should not be used with an unsorted discrete field.")};case ce:case me:return $a(t)||function(t){var e;return qa(t)&&uo(null===(e=t.scale)||void 0===e?void 0:e.type)}(t)?cs:{compatible:!1,warning:Zi(e)};case ve:return"nominal"!==t.type||"sort"in t?cs:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,e)||{};!1===t&&dr(n)}if(Da(s)&&(0,I.HD)(s.sort)){const{sort:t}=s;if(va(t))return{...s,sort:{encoding:t}};const e=t.substr(1);if("-"===t.charAt(0)&&va(e))return{...s,sort:{encoding:e,order:"descending"}}}if(wa(s)){const{header:t}=s;if(t){const{orient:e,...n}=t;if(e)return{...s,header:{...n,labelOrient:t.labelOrient||e,titleOrient:t.titleOrient||e}}}}return s}function ss(t,e){return(0,I.jn)(t)?{maxbins:ri(e)}:"binned"===t?{binned:!0}:t.maxbins||t.step?t:{...t,maxbins:ri(e)}}const cs={compatible:!0};function ls(t){const{formatType:e}=es(t);return"time"===e||!e&&((n=t)&&("temporal"===n.type||Ta(n)&&!!n.timeUnit));var n}function us(t,e){var n;let{timeUnit:i,type:r,wrapTime:o,undefinedIfExprNotRequired:a}=e;const s=i&&(null===(n=Mr(i))||void 0===n?void 0:n.unit);let c,l=s||"temporal"===r;return oi(t)?c=t.expr:li(t)?c=t.signal:hr(t)?(l=!0,c=br(t)):((0,I.HD)(t)||(0,I.hj)(t))&&l&&(c="datetime(".concat(rt(t),")"),function(t){return!!xr[t]}(s)&&((0,I.hj)(t)&&t<1e4||(0,I.HD)(t)&&isNaN(Date.parse(t)))&&(c=br({[s]:t}))),c?o&&l?"time(".concat(c,")"):c:a?void 0:rt(t)}function fs(t,e){const{type:n}=t;return e.map((e=>{const i=us(e,{timeUnit:Ta(t)?t.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==i?{signal:i}:e}))}function ds(t,e){return ti(t.bin)?jn(e)&&["ordinal","nominal"].includes(t.type):(console.warn("Only call this method for binned field defs."),!1)}const hs={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function ps(t){return null===t||void 0===t?void 0:t.condition}const ms=["domain","grid","labels","ticks","title"],gs={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},vs={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap: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,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap: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,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},ys={...vs,style:1,labelExpr:1,encoding:1};function bs(t){return!!ys[t]}bt(ys);const xs=bt({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1});function _s(t){return"mark"in t}class ws{constructor(t,e){this.name=t,this.run=e}hasMatchingType(t){return!!_s(t)&&(qo(e=t.mark)?e.type:e)===this.name;var e}}function ks(t,e){const n=t&&t[e];return!!n&&((0,I.kJ)(n)?ct(n,(t=>!!t.field)):Ta(n)||Oa(n))}function Es(t,e){const n=t&&t[e];return!!n&&((0,I.kJ)(n)?ct(n,(t=>!!t.field)):Ta(n)||Ra(n)||Na(n))}function Ds(t,e){if(xn(e)){const n=t[e];if((Ta(n)||Ra(n))&&(Hr(n.type)||Ta(n)&&n.timeUnit)){return Es(t,Ze(e))}}return!1}function As(t){return ct(Re,(e=>{if(ks(t,e)){const n=t[e];if((0,I.kJ)(n))return ct(n,(t=>!!t.aggregate));{const t=ns(n);return t&&!!t.aggregate}}return!1}))}function Ss(t,e){const n=[],i=[],r=[],o=[],a={};return Fs(t,((s,c)=>{if(Ta(s)){const{field:l,aggregate:u,bin:f,timeUnit:d,...h}=s;if(u||d||f){const t=Qa(s),p=null===t||void 0===t?void 0:t.title;let m=Ga(s,{forAs:!0});const g={...p?[]:{title:Za(s,e,{allowDisabling:!0})},...h,field:m};if(u){let t;if(Gn(u)?(t="argmax",m=Ga({op:"argmax",field:u.argmax},{forAs:!0}),g.field="".concat(m,".").concat(l)):Jn(u)?(t="argmin",m=Ga({op:"argmin",field:u.argmin},{forAs:!0}),g.field="".concat(m,".").concat(l)):"boxplot"!==u&&"errorbar"!==u&&"errorband"!==u&&(t=u),t){const e={op:t,as:m};l&&(e.field=l),o.push(e)}}else if(n.push(m),Ua(s)&&ti(f)){if(i.push({bin:f,field:l,as:m}),n.push(Ga(s,{binSuffix:"end"})),ds(s,c)&&n.push(Ga(s,{binSuffix:"range"})),xn(c)){const t={field:"".concat(m,"_end")};a["".concat(c,"2")]=t}g.bin="binned",Je(c)||(g.type=Xr)}else if(d){r.push({timeUnit:d,field:l,as:m});const t=Ua(s)&&s.type!==Gr&&"time";t&&(c===ge||c===xe?g.formatType=t:!function(t){return!!gn[t]}(c)?xn(c)&&(g.axis={formatType:t,...g.axis}):g.legend={formatType:t,...g.legend})}a[c]=g}else n.push(l),a[c]=t[c]}else a[c]=t[c]})),{bins:i,timeUnits:r,aggregate:o,groupby:n,encoding:a}}function Ms(t,e,n){const i=Bn(e,n);if(!i)return!1;if("binned"===i){const n=t[e===Gt?Xt:Jt];return!!(Ta(n)&&Ta(t[e])&&ei(n.bin))}return!0}function Cs(t,e){const n={};for(const i of bt(t)){const r=rs(t[i],i,e,{compositeMark:!0});n[i]=r}return n}function Fs(t,e,n){if(t)for(const i of bt(t)){const r=t[i];if((0,I.kJ)(r))for(const t of r)e.call(n,t,i);else e.call(n,r,i)}}function Os(t,e){return bt(e).reduce(((n,i)=>{switch(i){case Xt:case Jt:case _e:case ke:case we:case Gt:case $t:case Vt:case Yt:case Qt:case te:case Kt:case Zt:case ee:case ne:case ie:case re:case ge:case ce:case ue:case xe:return n;case ve:if("line"===t||"trail"===t)return n;case ye:case be:{const t=e[i];if((0,I.kJ)(t)||Ta(t))for(const e of(0,I.IX)(t))e.aggregate||n.push(Ga(e,{}));return n}case le:if("trail"===t)return n;case oe:case ae:case se:case fe:case de:case he:case me:case pe:{const t=ns(e[i]);return t&&!t.aggregate&&n.push(Ga(t,{})),n}}}),[])}function Ns(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("tooltip"in n)return{tooltip:n.tooltip};return{tooltip:[...t.map((t=>{let{fieldPrefix:n,titlePrefix:r}=t;const o=i?" of ".concat(Ts(e)):"";return{field:n+e.field,type:e.type,title:li(r)?{signal:"".concat(r,'"').concat(escape(o),'"')}:r+o}})),...dt(function(t){const e=[];for(const n of bt(t))if(ks(t,n)){const i=t[n],r=(0,I.IX)(i);for(const t of r)Ta(t)?e.push(t):Oa(t)&&e.push(t.condition)}return e}(n).map(Ja),ot)]}}function Ts(t){const{title:e,field:n}=t;return zt(e,n)}function zs(t,e,n,i,r){const{scale:o,axis:a}=n;return s=>{let{partName:c,mark:l,positionPrefix:u,endPositionPrefix:f,extraEncoding:d={}}=s;const h=Ts(n);return Rs(t,c,r,{mark:l,encoding:{[e]:{field:"".concat(u,"_").concat(n.field),type:n.type,...void 0!==h?{title:h}:{},...void 0!==o?{scale:o}:{},...void 0!==a?{axis:a}:{}},...(0,I.HD)(f)?{["".concat(e,"2")]:{field:"".concat(f,"_").concat(n.field)}}:{},...i,...d}})}}function Rs(t,e,n,i){const{clip:r,color:o,opacity:a}=t,s=t.type;return t[e]||void 0===t[e]&&n[e]?[{...i,mark:{...n[e],...r?{clip:r}:{},...o?{color:o}:{},...a?{opacity:a}:{},...qo(i.mark)?i.mark:{type:i.mark},style:"".concat(s,"-").concat(String(e)),...(0,I.jn)(t[e])?{}:t[e]}}]:[]}function Ps(t,e,n){const{encoding:i}=t,r="vertical"===e?"y":"x",o=i[r],a=i["".concat(r,"2")],s=i["".concat(r,"Error")],c=i["".concat(r,"Error2")];return{continuousAxisChannelDef:Ls(o,n),continuousAxisChannelDef2:Ls(a,n),continuousAxisChannelDefError:Ls(s,n),continuousAxisChannelDefError2:Ls(c,n),continuousAxis:r}}function Ls(t,e){if(null!==t&&void 0!==t&&t.aggregate){const{aggregate:n,...i}=t;return n!==e&&dr(function(t,e){return"Continuous axis should not have customized aggregation function ".concat(t,"; ").concat(e," already agregates the axis.")}(n,e)),i}return t}function js(t,e){const{mark:n,encoding:i}=t,{x:r,y:o}=i;if(qo(n)&&n.orient)return n.orient;if(Pa(r)){if(Pa(o)){const t=Ta(r)&&r.aggregate,n=Ta(o)&&o.aggregate;if(t||n!==e){if(n||t!==e){if(t===e&&n===e)throw new Error("Both x and y cannot have aggregate");return ls(o)&&!ls(r)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(Pa(o))return"vertical";throw new Error("Need a valid continuous axis for ".concat(e,"s"))}const Bs="boxplot",Us=new ws(Bs,qs);function Is(t){return(0,I.hj)(t)?"tukey":t}function qs(t,e){var n;let{config:i}=e;t={...t,encoding:Cs(t.encoding,i)};const{mark:r,encoding:o,params:a,projection:s,...c}=t,l=qo(r)?r:{type:r};a&&dr(Bi("boxplot"));const u=null!==(n=l.extent)&&void 0!==n?n:i.boxplot.extent,f=ki("size",l,i),d=l.invalid,h=Is(u),{bins:p,timeUnits:m,transform:g,continuousAxisChannelDef:v,continuousAxis:y,groupby:b,aggregate:x,encodingWithoutContinuousAxis:_,ticksOrient:w,boxOrient:k,customTooltipWithoutAggregatedField:E}=function(t,e,n){const i=js(t,Bs),{continuousAxisChannelDef:r,continuousAxis:o}=Ps(t,i,Bs),a=r.field,s=Is(e),c=[...Ws(a),{op:"median",field:a,as:"mid_box_".concat(a)},{op:"min",field:a,as:("min-max"===s?"lower_whisker_":"min_")+a},{op:"max",field:a,as:("min-max"===s?"upper_whisker_":"max_")+a}],l="min-max"===s||"tukey"===s?[]:[{calculate:'datum["upper_box_'.concat(a,'"] - datum["lower_box_').concat(a,'"]'),as:"iqr_".concat(a)},{calculate:'min(datum["upper_box_'.concat(a,'"] + datum["iqr_').concat(a,'"] * ').concat(e,', datum["max_').concat(a,'"])'),as:"upper_whisker_".concat(a)},{calculate:'max(datum["lower_box_'.concat(a,'"] - datum["iqr_').concat(a,'"] * ').concat(e,', datum["min_').concat(a,'"])'),as:"lower_whisker_".concat(a)}],{[o]:u,...f}=t.encoding,{customTooltipWithoutAggregatedField:d,filteredEncoding:h}=function(t){const{tooltip:e,...n}=t;if(!e)return{filteredEncoding:n};let i,r;if((0,I.kJ)(e)){for(const t of e)t.aggregate?(i||(i=[]),i.push(t)):(r||(r=[]),r.push(t));i&&(n.tooltip=i)}else e.aggregate?n.tooltip=e:r=e;return(0,I.kJ)(r)&&1===r.length&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}(f),{bins:p,timeUnits:m,aggregate:g,groupby:v,encoding:y}=Ss(h,n),b="vertical"===i?"horizontal":"vertical",x=i,_=[...p,...m,{aggregate:[...g,...c],groupby:v},...l];return{bins:p,timeUnits:m,transform:_,groupby:v,aggregate:g,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:y,ticksOrient:b,boxOrient:x,customTooltipWithoutAggregatedField:d}}(t,u,i),{color:D,size:A,...S}=_,M=t=>zs(l,y,v,t,i.boxplot),C=M(S),F=M(_),O=M({...S,...A?{size:A}:{}}),N=Ns([{fieldPrefix:"min-max"===h?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===h?"lower_whisker_":"min_",titlePrefix:"Min"}],v,_),T={type:"tick",color:"black",opacity:1,orient:w,invalid:d,aria:!1},z="min-max"===h?N:Ns([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],v,_),R=[...C({partName:"rule",mark:{type:"rule",invalid:d,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:z}),...C({partName:"rule",mark:{type:"rule",invalid:d,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:z}),...C({partName:"ticks",mark:T,positionPrefix:"lower_whisker",extraEncoding:z}),...C({partName:"ticks",mark:T,positionPrefix:"upper_whisker",extraEncoding:z})],P=[..."tukey"!==h?R:[],...F({partName:"box",mark:{type:"bar",...f?{size:f}:{},orient:k,invalid:d,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:N}),...O({partName:"median",mark:{type:"tick",invalid:d,...(0,I.Kn)(i.boxplot.median)&&i.boxplot.median.color?{color:i.boxplot.median.color}:{},...f?{size:f}:{},orient:w,aria:!1},positionPrefix:"mid_box",extraEncoding:N})];var L;if("min-max"===h)return{...c,transform:(null!==(L=c.transform)&&void 0!==L?L:[]).concat(g),layer:P};const j='datum["lower_box_'.concat(v.field,'"]'),B='datum["upper_box_'.concat(v.field,'"]'),U="(".concat(B," - ").concat(j,")"),q="".concat(j," - ").concat(u," * ").concat(U),W="".concat(B," + ").concat(u," * ").concat(U),H='datum["'.concat(v.field,'"]'),X={joinaggregate:Ws(v.field),groupby:b},J={transform:[{filter:"(".concat(q," <= ").concat(H,") && (").concat(H," <= ").concat(W,")")},{aggregate:[{op:"min",field:v.field,as:"lower_whisker_".concat(v.field)},{op:"max",field:v.field,as:"upper_whisker_".concat(v.field)},{op:"min",field:"lower_box_".concat(v.field),as:"lower_box_".concat(v.field)},{op:"max",field:"upper_box_".concat(v.field),as:"upper_box_".concat(v.field)},...x],groupby:b}],layer:R},{tooltip:G,...$}=S,{scale:V,axis:Y}=v,K=Ts(v),Z=it(Y,["title"]),Q=Rs(l,"outliers",i.boxplot,{transform:[{filter:"(".concat(H," < ").concat(q,") || (").concat(H," > ").concat(W,")")}],mark:"point",encoding:{[y]:{field:v.field,type:v.type,...void 0!==K?{title:K}:{},...void 0!==V?{scale:V}:{},...yt(Z)?{}:{axis:Z}},...$,...D?{color:D}:{},...E?{tooltip:E}:{}}})[0];let tt;const et=[...p,...m,X];return Q?tt={transform:et,layer:[Q,J]}:(tt=J,tt.transform.unshift(...et)),{...c,layer:[tt,{transform:g,layer:P}]}}function Ws(t){return[{op:"q1",field:t,as:"lower_box_".concat(t)},{op:"q3",field:t,as:"upper_box_".concat(t)}]}const Hs="errorbar",Xs=new ws(Hs,Js);function Js(t,e){let{config:n}=e;t={...t,encoding:Cs(t.encoding,n)};const{transform:i,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:a,ticksOrient:s,markDef:c,outerSpec:l,tooltipEncoding:u}=$s(t,Hs,n);delete a.size;const f=zs(c,o,r,a,n.errorbar),d=c.thickness,h=c.size,p={type:"tick",orient:s,aria:!1,...void 0!==d?{thickness:d}:{},...void 0!==h?{size:h}:{}},m=[...f({partName:"ticks",mark:p,positionPrefix:"lower",extraEncoding:u}),...f({partName:"ticks",mark:p,positionPrefix:"upper",extraEncoding:u}),...f({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...void 0!==d?{size:d}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...l,transform:i,...m.length>1?{layer:m}:{...m[0]}}}function Gs(t,e){const{encoding:n}=t;if(function(t){return(Ba(t.x)||Ba(t.y))&&!Ba(t.x2)&&!Ba(t.y2)&&!Ba(t.xError)&&!Ba(t.xError2)&&!Ba(t.yError)&&!Ba(t.yError2)}(n))return{orient:js(t,e),inputType:"raw"};const i=function(t){return Ba(t.x2)||Ba(t.y2)}(n),r=function(t){return Ba(t.xError)||Ba(t.xError2)||Ba(t.yError)||Ba(t.yError2)}(n),o=n.x,a=n.y;if(i){if(r)throw new Error("".concat(e," cannot be both type aggregated-upper-lower and aggregated-error"));const t=n.x2,i=n.y2;if(Ba(t)&&Ba(i))throw new Error("".concat(e," cannot have both x2 and y2"));if(Ba(t)){if(Pa(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error("Both x and x2 have to be quantitative in ".concat(e))}if(Ba(i)){if(Pa(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error("Both y and y2 have to be quantitative in ".concat(e))}throw new Error("No ranged axis")}{const t=n.xError,i=n.xError2,r=n.yError,s=n.yError2;if(Ba(i)&&!Ba(t))throw new Error("".concat(e," cannot have xError2 without xError"));if(Ba(s)&&!Ba(r))throw new Error("".concat(e," cannot have yError2 without yError"));if(Ba(t)&&Ba(r))throw new Error("".concat(e," cannot have both xError and yError with both are quantiative"));if(Ba(t)){if(Pa(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(Ba(r)){if(Pa(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function $s(t,e,n){var i;const{mark:r,encoding:o,params:a,projection:s,...c}=t,l=qo(r)?r:{type:r};a&&dr(Bi(e));const{orient:u,inputType:f}=Gs(t,e),{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:m,continuousAxis:g}=Ps(t,u,e),{errorBarSpecificAggregate:v,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:x}=function(t,e,n,i,r,o,a,s){let c=[],l=[];const u=e.field;let f,d=!1;if("raw"===o){const e=t.center?t.center:t.extent?"iqr"===t.extent?"median":"mean":s.errorbar.center,n=t.extent?t.extent:"mean"===e?"stderr":"iqr";if("median"===e!==("iqr"===n)&&dr(function(t,e,n){return"".concat(t," is not usually used with ").concat(e," for ").concat(n,".")}(e,n,a)),"stderr"===n||"stdev"===n)c=[{op:n,field:u,as:"extent_".concat(u)},{op:e,field:u,as:"center_".concat(u)}],l=[{calculate:'datum["center_'.concat(u,'"] + datum["extent_').concat(u,'"]'),as:"upper_".concat(u)},{calculate:'datum["center_'.concat(u,'"] - datum["extent_').concat(u,'"]'),as:"lower_".concat(u)}],f=[{fieldPrefix:"center_",titlePrefix:At(e)},{fieldPrefix:"upper_",titlePrefix:Vs(e,n,"+")},{fieldPrefix:"lower_",titlePrefix:Vs(e,n,"-")}],d=!0;else{let t,e,i;"ci"===n?(t="mean",e="ci0",i="ci1"):(t="median",e="q1",i="q3"),c=[{op:e,field:u,as:"lower_".concat(u)},{op:i,field:u,as:"upper_".concat(u)},{op:t,field:u,as:"center_".concat(u)}],f=[{fieldPrefix:"upper_",titlePrefix:Za({field:u,aggregate:i,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Za({field:u,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Za({field:u,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(t.center||t.extent)&&dr((h=t.center,p=t.extent,"".concat(p?"extent ":"").concat(p&&h?"and ":"").concat(h?"center ":"").concat(p&&h?"are ":"is ","not needed when data are aggregated."))),"aggregated-upper-lower"===o?(f=[],l=[{calculate:'datum["'.concat(n.field,'"]'),as:"upper_".concat(u)},{calculate:'datum["'.concat(u,'"]'),as:"lower_".concat(u)}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:u}],l=[{calculate:'datum["'.concat(u,'"] + datum["').concat(i.field,'"]'),as:"upper_".concat(u)}],r?l.push({calculate:'datum["'.concat(u,'"] + datum["').concat(r.field,'"]'),as:"lower_".concat(u)}):l.push({calculate:'datum["'.concat(u,'"] - datum["').concat(i.field,'"]'),as:"lower_".concat(u)}));for(const t of l)f.push({fieldPrefix:t.as.substring(0,6),titlePrefix:Ot(Ot(t.calculate,'datum["',""),'"]',"")})}var h,p;return{postAggregateCalculates:l,errorBarSpecificAggregate:c,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,d,h,p,m,f,e,n),{[g]:_,["x"===g?"x2":"y2"]:w,["x"===g?"xError":"yError"]:k,["x"===g?"xError2":"yError2"]:E,...D}=o,{bins:A,timeUnits:S,aggregate:M,groupby:C,encoding:F}=Ss(D,n),O=[...M,...v],N="raw"!==f?[]:C,T=Ns(b,d,F,x);return{transform:[...null!==(i=c.transform)&&void 0!==i?i:[],...A,...S,...0===O.length?[]:[{aggregate:O,groupby:N}],...y],groupby:N,continuousAxisChannelDef:d,continuousAxis:g,encodingWithoutContinuousAxis:F,ticksOrient:"vertical"===u?"horizontal":"vertical",markDef:l,outerSpec:c,tooltipEncoding:T}}function Vs(t,e,n){return"".concat(At(t)," ").concat(n," ").concat(e)}const Ys="errorband",Ks=new ws(Ys,Zs);function Zs(t,e){let{config:n}=e;t={...t,encoding:Cs(t.encoding,n)};const{transform:i,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:a,markDef:s,outerSpec:c,tooltipEncoding:l}=$s(t,Ys,n),u=s,f=zs(u,o,r,a,n.errorband),d=void 0!==t.encoding.x&&void 0!==t.encoding.y;let h={type:d?"area":"rect"},p={type:d?"line":"rule"};const m={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return d?(h={...h,...m,ariaRoleDescription:"errorband"},p={...p,...m,aria:!1}):u.interpolate?dr(sr("interpolate")):u.tension&&dr(sr("tension")),{...c,transform:i,layer:[...f({partName:"band",mark:h,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...f({partName:"borders",mark:p,positionPrefix:"lower",extraEncoding:l}),...f({partName:"borders",mark:p,positionPrefix:"upper",extraEncoding:l})]}}const Qs={};function tc(t,e,n){const i=new ws(t,e);Qs[t]={normalizer:i,parts:n}}tc(Bs,qs,["box","median","outliers","rule","ticks"]),tc(Hs,Js,["ticks","rule"]),tc(Ys,Zs,["band","borders"]);const ec=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],nc={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},ic={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},rc=bt(nc),oc=bt(ic),ac=bt({header:1,headerRow:1,headerColumn:1,headerFacet:1}),sc=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],cc={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description: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,symbolLimit: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,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},lc=(bt(cc),"_vgsid_"),uc={point:{on:"click",fields:[lc],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function fc(t){return"legend"===t||!(null===t||void 0===t||!t.legend)}function dc(t){return fc(t)&&(0,I.Kn)(t)}function hc(t){return!(null===t||void 0===t||!t.select)}function pc(t){const e=[];for(const n of t||[]){if(hc(n))continue;const{expr:t,bind:i,...r}=n;if(i&&t){const n={...r,bind:i,init:t};e.push(n)}else{const n={...r,...t?{update:t}:{},...i?{bind:i}:{}};e.push(n)}}return e}function mc(t){return"concat"in t}function gc(t){return"vconcat"in t}function vc(t){return"hconcat"in t}function yc(t){let{step:e,offsetIsDiscrete:n}=t;var i;return n?null!==(i=e.for)&&void 0!==i?i:"offset":"position"}function bc(t){return(0,I.Kn)(t)&&void 0!==t.step}function xc(t){return t.view||t.width||t.height}const _c=bt({align:1,bounds:1,center:1,columns:1,spacing:1});function wc(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t["width"===e?"continuousWidth":"continuousHeight"]}function kc(t,e){const n=Ec(t,e);return bc(n)?n.step:Dc}function Ec(t,e){var n;return zt(null!==(n=t[e])&&void 0!==n?n:t["width"===e?"discreteWidth":"discreteHeight"],{step:t.step})}const Dc=20;const Ac={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:Dc},mark:{color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},arc:{},area:{},bar:$o,circle:{},geoshape:{},image:{},line:{},point:{},rect:Vo,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0},projection:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:uc,style:{},title:{},facet:{spacing:20},concat:{spacing:20},normalizedNumberFormat:".0%"},Sc=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],Mc={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},Cc={blue:Sc[0],orange:Sc[1],red:Sc[2],teal:Sc[3],green:Sc[4],yellow:Sc[5],purple:Sc[6],pink:Sc[7],brown:Sc[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Fc(t){const e=bt(t||{}),n={};for(const i of e){const e=t[i];n[i]=ps(e)?mi(e):gi(e)}return n}const Oc=[...Xo,...xs,...ac,"background","padding","legend","lineBreak","scale","style","title","view"];function Nc(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{color:e,font:n,fontSize:i,selection:r,...o}=t,a=(0,I.fE)({},tt(Ac),n?function(t){return{text:{font:t},style:{"guide-label":{font:t},"guide-title":{font:t},"group-title":{font:t},"group-subtitle":{font:t}}}}(n):{},e?function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{signals:[{name:"color",value:(0,I.Kn)(t)?{...Cc,...t}:Cc}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}(e):{},i?function(t){return{signals:[{name:"fontSize",value:(0,I.Kn)(t)?{...Mc,...t}:Mc}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}(i):{},o||{});r&&(0,B.writeConfig)(a,"selection",r,!0);const s=it(a,Oc);for(const c of["background","lineBreak","padding"])a[c]&&(s[c]=gi(a[c]));for(const c of Xo)a[c]&&(s[c]=ai(a[c]));for(const c of xs)a[c]&&(s[c]=Fc(a[c]));for(const c of ac)a[c]&&(s[c]=ai(a[c]));return a.legend&&(s.legend=ai(a.legend)),a.scale&&(s.scale=ai(a.scale)),a.style&&(s.style=function(t){const e=bt(t),n={};for(const i of e)n[i]=Fc(t[i]);return n}(a.style)),a.title&&(s.title=ai(a.title)),a.view&&(s.view=ai(a.view)),s}const Tc=new Set(["view",...Io]),zc=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],Rc={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],tick:["bandSize","thickness"]};function Pc(t){t=tt(t);for(const e of zc)delete t[e];if(t.axis)for(const e in t.axis)ps(t.axis[e])&&delete t.axis[e];if(t.legend)for(const e of ec)delete t.legend[e];if(t.mark){for(const e of Ho)delete t.mark[e];t.mark.tooltip&&(0,I.Kn)(t.mark.tooltip)&&delete t.mark.tooltip}t.params&&(t.signals=(t.signals||[]).concat(pc(t.params)),delete t.params);for(const e of Tc){for(const i of Ho)delete t[e][i];const n=Rc[e];if(n)for(const i of n)delete t[e][i];Lc(t,e)}for(const e of bt(Qs))delete t[e];!function(t){const{titleMarkConfig:e,subtitleMarkConfig:n,subtitle:i}=si(t.title);yt(e)||(t.style["group-title"]={...t.style["group-title"],...e});yt(n)||(t.style["group-subtitle"]={...t.style["group-subtitle"],...n});yt(i)?delete t.title:t.title=i}(t);for(const e in t)(0,I.Kn)(t[e])&&yt(t[e])&&delete t[e];return yt(t)?void 0:t}function Lc(t,e,n,i){var r;"view"===e&&(n="cell");const o={...i?t[e][i]:t[e],...t.style[null!==(r=n)&&void 0!==r?r:e]};var a;yt(o)||(t.style[null!==(a=n)&&void 0!==a?a:e]=o);i||delete t[e]}function jc(t){return"layer"in t}class Bc{map(t,e){return ka(t)?this.mapFacet(t,e):function(t){return"repeat"in t}(t)?this.mapRepeat(t,e):vc(t)?this.mapHConcat(t,e):gc(t)?this.mapVConcat(t,e):mc(t)?this.mapConcat(t,e):this.mapLayerOrUnit(t,e)}mapLayerOrUnit(t,e){if(jc(t))return this.mapLayer(t,e);if(_s(t))return this.mapUnit(t,e);throw new Error(Oi(t))}mapLayer(t,e){return{...t,layer:t.layer.map((t=>this.mapLayerOrUnit(t,e)))}}mapHConcat(t,e){return{...t,hconcat:t.hconcat.map((t=>this.map(t,e)))}}mapVConcat(t,e){return{...t,vconcat:t.vconcat.map((t=>this.map(t,e)))}}mapConcat(t,e){const{concat:n,...i}=t;return{...i,concat:n.map((t=>this.map(t,e)))}}mapFacet(t,e){return{...t,spec:this.map(t.spec,e)}}mapRepeat(t,e){return{...t,spec:this.map(t.spec,e)}}}const Uc={zero:1,center:1,normalize:1};const Ic=new Set([Do,So,Ao,No,Fo,Po,Lo,Co,To,zo]),qc=new Set([So,Ao,Do]);function Wc(t){return Ta(t)&&"quantitative"===za(t)&&!t.bin}function Hc(t,e,n){let{orient:i,type:r}=n;const o="x"===e?"y":"radius",a="x"===e,s=t[e],c=t[o];if(Ta(s)&&Ta(c))if(Wc(s)&&Wc(c)){if(s.stack)return e;if(c.stack)return o;const t=Ta(s)&&!!s.aggregate;if(t!==(Ta(c)&&!!c.aggregate))return t?e:o;if(a&&"bar"===r){if("vertical"===i)return o;if("horizontal"===i)return e}}else{if(Wc(s))return e;if(Wc(c))return o}else{if(Wc(s))return e;if(Wc(c))return o}}function Xc(t,e){var n,i;const r=qo(t)?t:{type:t},o=r.type;if(!Ic.has(o))return null;const a=Hc(e,"x",r)||Hc(e,"theta",r);if(!a)return null;const s=e[a],c=Ta(s)?Ga(s,{}):void 0,l=function(t){switch(t){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(a),u=[],f=new Set;if(e[l]){const t=e[l],n=Ta(t)?Ga(t,{}):void 0;n&&n!==c&&(u.push(l),f.add(n));const i="x"===l?"xOffset":"yOffset",r=e[i],o=Ta(r)?Ga(r,{}):void 0;o&&o!==c&&(u.push(i),f.add(o))}const d=vn.reduce(((t,n)=>{if("tooltip"!==n&&ks(e,n)){const i=e[n];for(const e of(0,I.IX)(i)){const i=ns(e);if(i.aggregate)continue;const r=Ga(i,{});r&&f.has(r)||t.push({channel:n,fieldDef:i})}}return t}),[]);let h;return void 0!==s.stack?h=(0,I.jn)(s.stack)?s.stack?"zero":null:s.stack:qc.has(o)&&(h="zero"),h&&h in Uc?As(e)&&0===d.length?null:null!==s&&void 0!==s&&null!==(n=s.scale)&&void 0!==n&&n.type&&(null===s||void 0===s||null===(i=s.scale)||void 0===i?void 0:i.type)!==Yr.LINEAR?(null!==s&&void 0!==s&&s.stack&&dr(function(t){return"Cannot stack non-linear scale (".concat(t,").")}(s.scale.type)),null):Ba(e[Ve(a)])?(void 0!==s.stack&&dr('Cannot stack "'.concat(p=a,'" if there is already "').concat(p,'2".')),null):(Ta(s)&&s.aggregate&&!Kn.has(s.aggregate)&&dr((m=s.aggregate,'Stacking is applied even though the aggregate function is non-summative ("'.concat(m,'").'))),{groupbyChannels:u,groupbyFields:f,fieldChannel:a,impute:null!==s.impute&&Bo(o),stackBy:d,offset:h}):null;var p,m}function Jc(t){const{point:e,line:n,...i}=t;return bt(i).length>1?i:i.type}function Gc(t){for(const e of["line","area","rule","trail"])t[e]&&(t={...t,[e]:it(t[e],["point","line"])});return t}function $c(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return"transparent"===t.point?{opacity:0}:t.point?(0,I.Kn)(t.point)?t.point:{}:void 0!==t.point?null:e.point||n.shape?(0,I.Kn)(e.point)?e.point:{}:void 0}function Vc(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.line?!0===t.line?{}:t.line:void 0!==t.line?null:e.line?!0===e.line?{}:e.line:void 0}class Yc{constructor(){this.name="path-overlay"}hasMatchingType(t,e){if(_s(t)){const{mark:n,encoding:i}=t,r=qo(n)?n:{type:n};switch(r.type){case"line":case"rule":case"trail":return!!$c(r,e[r.type],i);case"area":return!!$c(r,e[r.type],i)||!!Vc(r,e[r.type])}}return!1}run(t,e,n){const{config:i}=e,{params:r,projection:o,mark:a,name:s,encoding:c,...l}=t,u=Cs(c,i),f=qo(a)?a:{type:a},d=$c(f,i[f.type],u),h="area"===f.type&&Vc(f,i[f.type]),p=[{name:s,...r?{params:r}:{},mark:Jc({..."area"===f.type&&void 0===f.opacity&&void 0===f.fillOpacity?{opacity:.7}:{},...f}),encoding:it(u,["shape"])}],m=Xc(f,u);let g=u;if(m){const{fieldChannel:t,offset:e}=m;g={...u,[t]:{...u[t],...e?{stack:e}:{}}}}return g=it(g,["y2","x2"]),h&&p.push({...o?{projection:o}:{},mark:{type:"line",...nt(f,["clip","interpolate","tension","tooltip"]),...h},encoding:g}),d&&p.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...nt(f,["clip","tooltip"]),...d},encoding:g}),n({...l,layer:p},{...e,config:Gc(i)})}}function Kc(t,e){return e?_a(t)?il(t,e):tl(t,e):t}function Zc(t,e){return e?il(t,e):t}function Qc(t,e,n){const i=e[t];return(r=i)&&!(0,I.HD)(r)&&"repeat"in r?i.repeat in n?{...e,[t]:n[i.repeat]}:void dr(function(t){return'Unknown repeated value "'.concat(t,'".')}(i.repeat)):e;var r}function tl(t,e){if(void 0!==(t=Qc("field",t,e))){if(null===t)return null;if(Da(t)&&ba(t.sort)){const n=Qc("field",t.sort,e);t={...t,...n?{sort:n}:{}}}return t}}function el(t,e){if(Ta(t))return tl(t,e);{const n=Qc("datum",t,e);return n===t||n.type||(n.type="nominal"),n}}function nl(t,e){if(!Ba(t)){if(Na(t)){const n=el(t.condition,e);if(n)return{...t,condition:n};{const{condition:e,...n}=t;return n}}return t}{const n=el(t,e);if(n)return n;if(Fa(t))return{condition:t.condition}}}function il(t,e){const n={};for(const i in t)if((0,I.nr)(t,i)){const r=t[i];if((0,I.kJ)(r))n[i]=r.map((t=>nl(t,e))).filter((t=>t));else{const t=nl(r,e);void 0!==t&&(n[i]=t)}}return n}class rl{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(_s(t)){const{encoding:e,mark:n}=t;if("line"===n||qo(n)&&"line"===n.type)for(const t of Xe){const n=e[Ge(t)];if(e[t]&&(Ta(n)&&!ei(n.bin)||Ra(n)))return!0}}return!1}run(t,e,n){const{encoding:i,mark:r}=t;var o,a;return dr((o=!!i.x2,a=!!i.y2,"Line mark is for continuous lines and thus cannot be used with ".concat(o&&a?"x2 and y2":o?"x2":"y2",". We will use the rule mark (line segments) instead."))),n({...t,mark:(0,I.Kn)(r)?{...r,type:"rule"}:"rule"},e)}}function ol(t){let{parentEncoding:e,encoding:n={},layer:i}=t,r={};if(e){const t=new Set([...bt(e),...bt(n)]);for(const o of t){const t=n[o],a=e[o];if(Ba(t)){const e={...a,...t};r[o]=e}else Na(t)?r[o]={...t,condition:{...a,...t.condition}}:t||null===t?r[o]=t:(i||Ia(a)||li(a)||Ba(a)||(0,I.kJ)(a))&&(r[o]=a)}}else r=n;return!r||yt(r)?void 0:r}function al(t){const{parentProjection:e,projection:n}=t;return e&&n&&dr(function(t){const{parentProjection:e,projection:n}=t;return"Layer's shared projection ".concat(rt(e)," is overridden by a child projection ").concat(rt(n),".")}({parentProjection:e,projection:n})),null!==n&&void 0!==n?n:e}function sl(t){return"filter"in t}function cl(t){return void 0!==(null===t||void 0===t?void 0:t.stop)}function ll(t){return"lookup"in t}function ul(t){return"pivot"in t}function fl(t){return"density"in t}function dl(t){return"quantile"in t}function hl(t){return"regression"in t}function pl(t){return"loess"in t}function ml(t){return"sample"in t}function gl(t){return"window"in t}function vl(t){return"joinaggregate"in t}function yl(t){return"flatten"in t}function bl(t){return"calculate"in t}function xl(t){return"bin"in t}function _l(t){return"impute"in t}function wl(t){return"timeUnit"in t}function kl(t){return"aggregate"in t}function El(t){return"stack"in t}function Dl(t){return"fold"in t}function Al(t,e){const{transform:n,...i}=t;if(n){const t=n.map((t=>{if(sl(t))return{filter:Cl(t,e)};if(xl(t)&&ni(t.bin))return{...t,bin:Ml(t.bin)};if(ll(t)){const{selection:e,...n}=t.from;return e?{...t,from:{param:e,...n}}:t}return t}));return{...i,transform:t}}return t}function Sl(t,e){var n,i;const r=tt(t);if(Ta(r)&&ni(r.bin)&&(r.bin=Ml(r.bin)),qa(r)&&null!==(n=r.scale)&&void 0!==n&&null!==(i=n.domain)&&void 0!==i&&i.selection){const{selection:t,...e}=r.scale.domain;r.scale.domain={...e,...t?{param:t}:{}}}if(Fa(r))if((0,B.isArray)(r.condition))r.condition=r.condition.map((t=>{const{selection:n,param:i,test:r,...o}=t;return i?t:{...o,test:Cl(t,e)}}));else{const{selection:t,param:n,test:i,...o}=Sl(r.condition,e);r.condition=n?r.condition:{...o,test:Cl(r.condition,e)}}return r}function Ml(t){const e=t.extent;if(null!==e&&void 0!==e&&e.selection){const{selection:n,...i}=e;return{...t,extent:{...i,param:n}}}return t}function Cl(t,e){const n=t=>Z(t,(t=>{var n,i,r;const o={param:t,empty:null===(n=e.emptySelections[t])||void 0===n||n};return null!==(i=(r=e.selectionPredicates)[t])&&void 0!==i||(r[t]=[]),e.selectionPredicates[t].push(o),o}));return t.selection?n(t.selection):Z(t.test||t.filter,(t=>t.selection?n(t.selection):t))}class Fl extends Bc{map(t,e){var n;const i=null!==(n=e.selections)&&void 0!==n?n:[];if(t.params&&!_s(t)){const e=[];for(const n of t.params)hc(n)?i.push(n):e.push(n);t.params=e}return e.selections=i,super.map(t,e)}mapUnit(t,e){var n;const i=e.selections;if(!i||!i.length)return t;const r=(null!==(n=e.path)&&void 0!==n?n:[]).concat(t.name),o=[];for(const a of i)if(a.views&&a.views.length)for(const e of a.views)((0,B.isString)(e)&&(e===t.name||r.includes(e))||(0,B.isArray)(e)&&e.map((t=>r.indexOf(t))).every(((t,e,n)=>-1!==t&&(0===e||t>n[e-1]))))&&o.push(a);else o.push(a);return o.length&&(t.params=o),t}}for(const cy of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=Fl.prototype[cy];Fl.prototype[cy]=function(e,n){return t.call(this,e,Ol(e,n))}}function Ol(t,e){var n;return t.name?{...e,path:(null!==(n=e.path)&&void 0!==n?n:[]).concat(t.name)}:e}function Nl(t,e){void 0===e&&(e=Nc(t.config));const n=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={config:e};return Rl.map(Tl.map(zl.map(t,n),n),n)}(t,e),{width:i,height:r}=t,o=function(t,e,n){let{width:i,height:r}=e;const o=_s(t)||jc(t),a={};o?"container"==i&&"container"==r?(a.type="fit",a.contains="padding"):"container"==i?(a.type="fit-x",a.contains="padding"):"container"==r&&(a.type="fit-y",a.contains="padding"):("container"==i&&(dr(Ti("width")),i=void 0),"container"==r&&(dr(Ti("height")),r=void 0));const s={type:"pad",...a,...n?Pl(n.autosize):{},...Pl(t.autosize)};"fit"!==s.type||o||(dr(Ni),s.type="pad");"container"==i&&"fit"!=s.type&&"fit-x"!=s.type&&dr(zi("width"));"container"==r&&"fit"!=s.type&&"fit-y"!=s.type&&dr(zi("height"));if(Q(s,{type:"pad"}))return;return s}(n,{width:i,height:r,autosize:t.autosize},e);return{...n,...o?{autosize:o}:{}}}const Tl=new class extends Bc{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[Us,Xs,Ks,new Yc,new rl]}map(t,e){if(_s(t)){const n=ks(t.encoding,qt),i=ks(t.encoding,Wt),r=ks(t.encoding,Ht);if(n||i||r)return this.mapFacetedUnit(t,e)}return super.map(t,e)}mapUnit(t,e){const{parentEncoding:n,parentProjection:i}=e,r=Zc(t.encoding,e.repeater),o={...t,...t.name?{name:[e.repeaterPrefix,t.name].filter((t=>t)).join("_")}:{},...r?{encoding:r}:{}};if(n||i)return this.mapUnitWithParentEncodingOrProjection(o,e);const a=this.mapLayerOrUnit.bind(this);for(const s of this.nonFacetUnitNormalizers)if(s.hasMatchingType(o,e.config))return s.run(o,e,a);return o}mapRepeat(t,e){return function(t){return!(0,I.kJ)(t.repeat)&&t.repeat.layer}(t)?this.mapLayerRepeat(t,e):this.mapNonLayerRepeat(t,e)}mapLayerRepeat(t,e){const{repeat:n,spec:i,...r}=t,{row:o,column:a,layer:s}=n,{repeater:c={},repeaterPrefix:l=""}=e;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:s},spec:i}},e):{...r,layer:s.map((t=>{const n={...c,layer:t},r="".concat((i.name?"".concat(i.name,"_"):"")+l,"child__layer_").concat(kt(t)),o=this.mapLayerOrUnit(i,{...e,repeater:n,repeaterPrefix:r});return o.name=r,o}))}}mapNonLayerRepeat(t,e){var n;const{repeat:i,spec:r,data:o,...a}=t;!(0,I.kJ)(i)&&t.columns&&(t=it(t,["columns"]),dr(Ii("repeat")));const s=[],{repeater:c={},repeaterPrefix:l=""}=e,u=!(0,I.kJ)(i)&&i.row||[c?c.row:null],f=!(0,I.kJ)(i)&&i.column||[c?c.column:null],d=(0,I.kJ)(i)&&i||[c?c.repeat:null];for(const p of d)for(const t of u)for(const n of f){const o={repeat:p,row:t,column:n,layer:c.layer},a=(r.name?"".concat(r.name,"_"):"")+l+"child__"+((0,I.kJ)(i)?"".concat(kt(p)):(i.row?"row_".concat(kt(t)):"")+(i.column?"column_".concat(kt(n)):"")),u=this.map(r,{...e,repeater:o,repeaterPrefix:a});u.name=a,s.push(it(u,["data"]))}const h=(0,I.kJ)(i)?t.columns:i.column?i.column.length:1;return{data:null!==(n=r.data)&&void 0!==n?n:o,align:"all",...a,columns:h,concat:s}}mapFacet(t,e){const{facet:n}=t;return _a(n)&&t.columns&&(t=it(t,["columns"]),dr(Ii("facet"))),super.mapFacet(t,e)}mapUnitWithParentEncodingOrProjection(t,e){const{encoding:n,projection:i}=t,{parentEncoding:r,parentProjection:o,config:a}=e,s=al({parentProjection:o,projection:i}),c=ol({parentEncoding:r,encoding:Zc(n,e.repeater)});return this.mapUnit({...t,...s?{projection:s}:{},...c?{encoding:c}:{}},{config:a})}mapFacetedUnit(t,e){const{row:n,column:i,facet:r,...o}=t.encoding,{mark:a,width:s,projection:c,height:l,view:u,params:f,encoding:d,...h}=t,{facetMapping:p,layout:m}=this.getFacetMappingAndLayout({row:n,column:i,facet:r},e),g=Zc(o,e.repeater);return this.mapFacet({...h,...m,facet:p,spec:{...s?{width:s}:{},...l?{height:l}:{},...u?{view:u}:{},...c?{projection:c}:{},mark:a,encoding:g,...f?{params:f}:{}}},e)}getFacetMappingAndLayout(t,e){const{row:n,column:i,facet:r}=t;if(n||i){r&&dr((a=[...n?[qt]:[],...i?[Wt]:[]],"Facet encoding dropped as ".concat(a.join(" and ")," ").concat(a.length>1?"are":"is"," also specified.")));const e={},s={};for(const n of[qt,Wt]){const i=t[n];if(i){const{align:t,center:r,spacing:a,columns:c,...l}=i;e[n]=l;for(const e of["align","center","spacing"]){var o;if(void 0!==i[e])null!==(o=s[e])&&void 0!==o||(s[e]={}),s[e][n]=i[e]}}}return{facetMapping:e,layout:s}}{const{align:t,center:n,spacing:i,columns:o,...a}=r;return{facetMapping:Kc(a,e.repeater),layout:{...t?{align:t}:{},...n?{center:n}:{},...i?{spacing:i}:{},...o?{columns:o}:{}}}}var a}mapLayer(t,e){let{parentEncoding:n,parentProjection:i,...r}=e;const{encoding:o,projection:a,...s}=t,c={...r,parentEncoding:ol({parentEncoding:n,encoding:o,layer:!0}),parentProjection:al({parentProjection:i,projection:a})};return super.mapLayer({...s,...t.name?{name:[c.repeaterPrefix,t.name].filter((t=>t)).join("_")}:{}},c)}},zl=new class extends Bc{map(t,e){var n,i;return null!==(n=e.emptySelections)&&void 0!==n||(e.emptySelections={}),null!==(i=e.selectionPredicates)&&void 0!==i||(e.selectionPredicates={}),t=Al(t,e),super.map(t,e)}mapLayerOrUnit(t,e){if((t=Al(t,e)).encoding){const n={};for(const[i,r]of _t(t.encoding))n[i]=Sl(r,e);t={...t,encoding:n}}return super.mapLayerOrUnit(t,e)}mapUnit(t,e){const{selection:n,...i}=t;return n?{...i,params:_t(n).map((t=>{let[n,i]=t;const{init:r,bind:o,empty:a,...s}=i;"single"===s.type?(s.type="point",s.toggle=!1):"multi"===s.type&&(s.type="point"),e.emptySelections[n]="none"!==a;for(const l of xt(null!==(c=e.selectionPredicates[n])&&void 0!==c?c:{})){var c;l.empty="none"!==a}return{name:n,value:r,select:s,bind:o}}))}:t}},Rl=new Fl;function Pl(t){return(0,I.HD)(t)?{type:t}:null!==t&&void 0!==t?t:{}}const Ll=["background","padding"];function jl(t,e){const n={};for(const i of Ll)t&&void 0!==t[i]&&(n[i]=gi(t[i]));return e&&(n.params=t.params),n}class Bl{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.explicit=t,this.implicit=e}clone(){return new Bl(tt(this.explicit),tt(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return zt(this.explicit[t],this.implicit[t])}getWithExplicit(t){return void 0!==this.explicit[t]?{explicit:!0,value:this.explicit[t]}:void 0!==this.implicit[t]?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,e){let{value:n,explicit:i}=e;void 0!==n&&this.set(t,n,i)}set(t,e,n){return delete this[n?"implicit":"explicit"][t],this[n?"explicit":"implicit"][t]=e,this}copyKeyFromSplit(t,e){let{explicit:n,implicit:i}=e;void 0!==n[t]?this.set(t,n[t],!0):void 0!==i[t]&&this.set(t,i[t],!1)}copyKeyFromObject(t,e){void 0!==e[t]&&this.set(t,e[t],!0)}copyAll(t){for(const e of bt(t.combine())){const n=t.getWithExplicit(e);this.setWithExplicit(e,n)}}}function Ul(t){return{explicit:!0,value:t}}function Il(t){return{explicit:!1,value:t}}function ql(t){return(e,n,i,r)=>{const o=t(e.value,n.value);return o>0?e:o<0?n:Wl(e,n,i,r)}}function Wl(t,e,n,i){return t.explicit&&e.explicit&&dr(function(t,e,n,i){return"Conflicting ".concat(e.toString(),' property "').concat(t.toString(),'" (').concat(rt(n)," and ").concat(rt(i),"). Using ").concat(rt(n),".")}(n,i,t.value,e.value)),t}function Hl(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Wl;return void 0===t||void 0===t.value?e:t.explicit&&!e.explicit?t:e.explicit&&!t.explicit?e:Q(t.value,e.value)?t:r(t,e,n,i)}class Xl extends Bl{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(t,e),this.explicit=t,this.implicit=e,this.parseNothing=n}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function Jl(t){return"url"in t}function Gl(t){return"values"in t}function $l(t){return"name"in t&&!Jl(t)&&!Gl(t)&&!Vl(t)}function Vl(t){return t&&(Yl(t)||Kl(t)||Zl(t))}function Yl(t){return"sequence"in t}function Kl(t){return"sphere"in t}function Zl(t){return"graticule"in t}var Ql;!function(t){t[t.Raw=0]="Raw",t[t.Main=1]="Main",t[t.Row=2]="Row",t[t.Column=3]="Column",t[t.Lookup=4]="Lookup"}(Ql||(Ql={}));var tu=n(77155);function eu(t){const{signals:e,hasLegend:n,index:i,...r}=t;return r.field=Ft(r.field),r}function nu(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:I.yR;if((0,I.kJ)(t)){const i=t.map((t=>nu(t,e,n)));return e?"[".concat(i.join(", "),"]"):i}return hr(t)?n(e?br(t):function(t){const e=yr(t,!0);return t.utc?+new Date(Date.UTC(...e)):+new Date(...e)}(t)):e?n(rt(t)):t}function iu(t,e){for(const i of xt(null!==(n=t.component.selection)&&void 0!==n?n:{})){var n;const r=i.name;let o="".concat(r).concat(wf,", ").concat("global"===i.resolve?"true":"{unit: ".concat(Af(t),"}"));for(const n of Df)n.defined(i)&&(n.signals&&(e=n.signals(t,i,e)),n.modifyExpr&&(o=n.modifyExpr(t,i,o)));e.push({name:r+kf,on:[{events:{signal:i.name+wf},update:"modify(".concat((0,I.m8)(i.name+_f),", ").concat(o,")")}]})}return au(e)}function ru(t,e){if(t.component.selection&&bt(t.component.selection).length){const n=(0,I.m8)(t.getName("cell"));e.unshift({name:"facet",value:{},on:[{events:(0,tu.r)("mousemove","scope"),update:"isTuple(facet) ? facet : group(".concat(n,").datum")}]})}return au(e)}function ou(t,e){for(const i of xt(null!==(n=t.component.selection)&&void 0!==n?n:{})){var n;for(const n of Df)n.defined(i)&&n.marks&&(e=n.marks(t,i,e))}return e}function au(t){return t.map((t=>(t.on&&!t.on.length&&delete t.on,t)))}class su{constructor(t,e){this.debugName=e,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,e){this._children.includes(t)?dr("Attempt to add the same child twice."):void 0!==e?this._children.splice(e,0,t):this._children.push(t)}removeChild(t){const e=this._children.indexOf(t);return this._children.splice(e,1),e}remove(){let t=this._parent.removeChild(this);for(const e of this._children)e._parent=this._parent,this._parent.addChild(e,t++)}insertAsParentOf(t){const e=t.parent;e.removeChild(this),this.parent=e,t.parent=this}swapWithParent(){const t=this._parent,e=t.parent;for(const i of this._children)i.parent=t;this._children=[],t.removeChild(this);const n=t.parent.removeChild(t);this._parent=e,e.addChild(this,n),t.parent=this}}class cu extends su{clone(){const t=new this.constructor;return t.debugName="clone_".concat(this.debugName),t._source=this._source,t._name="clone_".concat(this._name),t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,e,n,i){super(t,e),this.type=n,this.refCounts=i,this._source=this._name=e,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash="Output ".concat(Pt())),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}class lu extends su{clone(){return new lu(null,tt(this.formula))}constructor(t,e){super(t),this.formula=e}static makeFromEncoding(t,e){const n=e.reduceFieldDef(((t,e)=>{const{field:n,timeUnit:i}=e;if(i){const r=Ga(e,{forAs:!0});t[ot({as:r,field:n,timeUnit:i})]={as:r,field:n,timeUnit:i}}return t}),{});return yt(n)?null:new lu(t,n)}static makeFromTransform(t,e){const{timeUnit:n,...i}={...e},r={...i,timeUnit:Mr(n)};return new lu(t,{[ot(r)]:r})}merge(t){this.formula={...this.formula};for(const e in t.formula)this.formula[e]||(this.formula[e]=t.formula[e]);for(const e of t.children)t.removeChild(e),e.parent=this;t.remove()}removeFormulas(t){const e={};for(const[n,i]of _t(this.formula))t.has(i.as)||(e[n]=i);this.formula=e}producedFields(){return new Set(xt(this.formula).map((t=>t.as)))}dependentFields(){return new Set(xt(this.formula).map((t=>t.field)))}hash(){return"TimeUnit ".concat(ot(this.formula))}assemble(){const t=[];for(const e of xt(this.formula)){const{field:n,as:i,timeUnit:r}=e,{unit:o,utc:a,...s}=Mr(r);t.push({field:Ft(n),type:"timeunit",...o?{units:Er(o)}:{},...a?{timezone:"utc"}:{},...s,as:[i,"".concat(i,"_end")]})}return t}}const uu="_tuple_fields";class fu{constructor(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.items=e,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const du={defined:()=>!0,parse:(t,e,n)=>{var i;const r=e.name,o=null!==(i=e.project)&&void 0!==i?i:e.project=new fu,a={},s={},c=new Set,l=(t,e)=>{const n="visual"===e?t.channel:t.field;let i=kt("".concat(r,"_").concat(n));for(let o=1;c.has(i);o++)i=kt("".concat(r,"_").concat(n,"_").concat(o));return c.add(i),{[e]:i}},u=e.type,f=t.config.selection[u],d=void 0!==n.value?(0,I.IX)(n.value):null;let{fields:h,encodings:p}=(0,I.Kn)(n.select)?n.select:{};if(!h&&!p&&d)for(const y of d)if((0,I.Kn)(y))for(const t of bt(y)){var m;if(We[t])(p||(p=[])).push(t);else if("interval"===u)dr('Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.'),p=f.encodings;else(null!==(m=h)&&void 0!==m?m:h=[]).push(t)}h||p||(p=f.encodings,"fields"in f&&(h=f.fields));for(const y of null!==(g=p)&&void 0!==g?g:[]){var g;const e=t.fieldDef(y);if(e){let n=e.field;if(e.aggregate){dr(ji(y,e.aggregate));continue}if(!n){dr(Li(y));continue}if(e.timeUnit){n=t.vgField(y);const i={timeUnit:e.timeUnit,as:n,field:e.field};s[ot(i)]=i}if(!a[n]){const i={field:n,channel:y,type:"interval"===u&&jn(y)&&co(t.getScaleComponent(y).get("type"))?"R":e.bin?"R-RE":"E",index:o.items.length};i.signals={...l(i,"data"),...l(i,"visual")},o.items.push(a[n]=i),o.hasField[n]=a[n],o.hasSelectionId=o.hasSelectionId||n===lc,Me(y)?(i.geoChannel=y,i.channel=Se(y),o.hasChannel[i.channel]=a[n]):o.hasChannel[y]=a[n]}}else dr(Li(y))}for(const y of null!==(v=h)&&void 0!==v?v:[]){var v;if(o.hasField[y])continue;const t={type:"E",field:y,index:o.items.length};t.signals={...l(t,"data")},o.items.push(t),o.hasField[y]=t,o.hasSelectionId=o.hasSelectionId||y===lc}d&&(e.init=d.map((t=>o.items.map((e=>(0,I.Kn)(t)?void 0!==t[e.geoChannel||e.channel]?t[e.geoChannel||e.channel]:t[e.field]:t))))),yt(s)||(o.timeUnit=new lu(null,s))},signals:(t,e,n)=>{const i=e.name+uu;return n.filter((t=>t.name===i)).length>0||e.project.hasSelectionId?n:n.concat({name:i,value:e.project.items.map(eu)})}},hu=du,pu={defined:t=>"interval"===t.type&&"global"===t.resolve&&t.bind&&"scales"===t.bind,parse:(t,e)=>{const n=e.scales=[];for(const i of e.project.items){const r=i.channel;if(!jn(r))continue;const o=t.getScaleComponent(r),a=o?o.get("type"):void 0;o&&co(a)?(o.set("selectionExtent",{param:e.name,field:i.field},!0),n.push(i)):dr("Scale bindings are currently only supported for scales with unbinned, continuous domains.")}},topLevelSignals:(t,e,n)=>{const i=e.scales.filter((t=>0===n.filter((e=>e.name===t.signals.data)).length));if(!t.parent||vu(t)||0===i.length)return n;const r=n.filter((t=>t.name===e.name))[0];let o=r.update;if(o.indexOf(Ef)>=0)r.update="{".concat(i.map((t=>"".concat((0,I.m8)(Ft(t.field)),": ").concat(t.signals.data))).join(", "),"}");else{for(const t of i){const e="".concat((0,I.m8)(Ft(t.field)),": ").concat(t.signals.data);o.includes(e)||(o="".concat(o.substring(0,o.length-1),", ").concat(e,"}"))}r.update=o}return n.concat(i.map((t=>({name:t.signals.data}))))},signals:(t,e,n)=>{if(t.parent&&!vu(t))for(const i of e.scales){const t=n.filter((t=>t.name===i.signals.data))[0];t.push="outer",delete t.value,delete t.update}return n}},mu=pu;function gu(t,e){const n=(0,I.m8)(t.scaleName(e));return"domain(".concat(n,")")}function vu(t){var e;return t.parent&&pp(t.parent)&&(null!==(e=!t.parent.parent)&&void 0!==e?e:vu(t.parent.parent))}const yu="_brush",bu="_scale_trigger",xu="geo_interval_init_tick",_u="_init",wu={defined:t=>"interval"===t.type,parse:(t,e,n)=>{var i;if(t.hasProjection){const t={...(0,B.isObject)(n.select)?n.select:{}};t.fields=[lc],t.encodings||(t.encodings=n.value?bt(n.value):[ne,ee]),n.select={type:"interval",...t}}if(e.translate&&!mu.defined(e)){const t="!event.item || event.item.mark.name !== ".concat((0,I.m8)(e.name+yu));for(const n of e.events){var r;if(!n.between){dr("".concat(n," is not an ordered event stream for interval selections."));continue}const e=(0,I.IX)(null!==(r=(i=n.between[0]).filter)&&void 0!==r?r:i.filter=[]);e.indexOf(t)<0&&e.push(t)}}},signals:(t,e,n)=>{const i=e.name,r=i+wf,o=xt(e.project.hasChannel).filter((t=>t.channel===Xt||t.channel===Jt)),a=e.init?e.init[0]:null;if(n.push(...o.reduce(((n,i)=>n.concat(function(t,e,n,i){const r=!t.hasProjection,o=n.channel,a=n.signals.visual,s=(0,I.m8)(r?t.scaleName(o):t.projectionName()),c=t=>"scale(".concat(s,", ").concat(t,")"),l=t.getSizeSignalRef(o===Xt?"width":"height").signal,u="".concat(o,"(unit)"),f=e.events.reduce(((t,e)=>[...t,{events:e.between[0],update:"[".concat(u,", ").concat(u,"]")},{events:e,update:"[".concat(a,"[0], clamp(").concat(u,", 0, ").concat(l,")]")}]),[]);if(r){const r=n.signals.data,l=mu.defined(e),u=t.getScaleComponent(o),d=u?u.get("type"):void 0,h=i?{init:nu(i,!0,c)}:{value:[]};return f.push({events:{signal:e.name+bu},update:co(d)?"[".concat(c("".concat(r,"[0]")),", ").concat(c("".concat(r,"[1]")),"]"):"[0, 0]"}),l?[{name:r,on:[]}]:[{name:a,...h,on:f},{name:r,...i?{init:nu(i)}:{},on:[{events:{signal:a},update:"".concat(a,"[0] === ").concat(a,"[1] ? null : invert(").concat(s,", ").concat(a,")")}]}]}{const t=o===Xt?0:1,n=e.name+_u,r=i?{init:"[".concat(n,"[0][").concat(t,"], ").concat(n,"[1][").concat(t,"]]")}:{value:[]};return[{name:a,...r,on:f}]}}(t,e,i,a&&a[i.index]))),[])),t.hasProjection){const s=(0,I.m8)(t.projectionName()),c=t.projectionName()+"_center",{x:l,y:u}=e.project.hasChannel,f=l&&l.signals.visual,d=u&&u.signals.visual,h=l?a&&a[l.index]:"".concat(c,"[0]"),p=u?a&&a[u.index]:"".concat(c,"[1]"),m=e=>t.getSizeSignalRef(e).signal,g="["+"[".concat(f?f+"[0]":"0",", ").concat(d?d+"[0]":"0","],")+"[".concat(f?f+"[1]":m("width"),", ")+"".concat(d?d+"[1]":m("height"),"]")+"]";if(a&&(n.unshift({name:i+_u,init:"[scale(".concat(s,", [").concat(l?h[0]:h,", ").concat(u?p[0]:p,"]), ")+"scale(".concat(s,", [").concat(l?h[1]:h,", ").concat(u?p[1]:p,"])]")}),!l||!u)){n.find((t=>t.name===c))||n.unshift({name:c,update:"invert(".concat(s,", [").concat(m("width"),"/2, ").concat(m("height"),"/2])")})}const v="intersect(".concat(g,", {markname: ").concat((0,I.m8)(t.getName("marks")),"}, unit.mark)"),y="{unit: ".concat(Af(t),"}"),b="vlSelectionTuples(".concat(v,", ").concat(y,")"),x=o.map((t=>t.signals.visual));return n.concat({name:r,on:[{events:[...x.length?[{signal:x.join(" || ")}]:[],...a?[{signal:xu}]:[]],update:b}]})}{if(!mu.defined(e)){const e=i+bu,r=o.map((e=>{const n=e.channel,{data:i,visual:r}=e.signals,o=(0,I.m8)(t.scaleName(n)),a=co(t.getScaleComponent(n).get("type"))?"+":"";return"(!isArray(".concat(i,") || ")+"(".concat(a,"invert(").concat(o,", ").concat(r,")[0] === ").concat(a).concat(i,"[0] && ")+"".concat(a,"invert(").concat(o,", ").concat(r,")[1] === ").concat(a).concat(i,"[1]))")}));r.length&&n.push({name:e,value:{},on:[{events:o.map((e=>({scale:t.scaleName(e.channel)}))),update:r.join(" && ")+" ? ".concat(e," : {}")}]})}const s=o.map((t=>t.signals.data)),c="unit: ".concat(Af(t),", fields: ").concat(i+uu,", values");return n.concat({name:r,...a?{init:"{".concat(c,": ").concat(nu(a),"}")}:{},...s.length?{on:[{events:[{signal:s.join(" || ")}],update:"".concat(s.join(" && ")," ? {").concat(c,": [").concat(s,"]} : null")}]}:{}})}},topLevelSignals:(t,e,n)=>{if(fp(t)&&t.hasProjection&&e.init){n.filter((t=>t.name===xu)).length||n.unshift({name:xu,value:null,on:[{events:"timer{1}",update:"".concat(xu," === null ? {} : ").concat(xu)}]})}return n},marks:(t,e,n)=>{const i=e.name,{x:r,y:o}=e.project.hasChannel,a=null===r||void 0===r?void 0:r.signals.visual,s=null===o||void 0===o?void 0:o.signals.visual,c="data(".concat((0,I.m8)(e.name+_f),")");if(mu.defined(e)||!r&&!o)return n;const l={x:void 0!==r?{signal:"".concat(a,"[0]")}:{value:0},y:void 0!==o?{signal:"".concat(s,"[0]")}:{value:0},x2:void 0!==r?{signal:"".concat(a,"[1]")}:{field:{group:"width"}},y2:void 0!==o?{signal:"".concat(s,"[1]")}:{field:{group:"height"}}};if("global"===e.resolve)for(const m of bt(l))l[m]=[{test:"".concat(c,".length && ").concat(c,"[0].unit === ").concat(Af(t)),...l[m]},{value:0}];const{fill:u,fillOpacity:f,cursor:d,...h}=e.mark,p=bt(h).reduce(((t,e)=>(t[e]=[{test:[void 0!==r&&"".concat(a,"[0] !== ").concat(a,"[1]"),void 0!==o&&"".concat(s,"[0] !== ").concat(s,"[1]")].filter((t=>t)).join(" && "),value:h[e]},{value:null}],t)),{});return[{name:"".concat(i+yu,"_bg"),type:"rect",clip:!0,encode:{enter:{fill:{value:u},fillOpacity:{value:f}},update:l}},...n,{name:i+yu,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...l,...p}}}]}},ku=wu;const Eu={defined:t=>"point"===t.type,signals:(t,e,n)=>{var i;const r=e.name,o=r+uu,a=e.project,s="(item().isVoronoi ? datum.datum : datum)",c=xt(null!==(i=t.component.selection)&&void 0!==i?i:{}).reduce(((t,e)=>"interval"===e.type?t.concat(e.name+yu):t),[]).map((t=>"indexof(item().mark.name, '".concat(t,"') < 0"))).join(" && "),l="datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0".concat(c?" && ".concat(c):"");let u="unit: ".concat(Af(t),", ");if(e.project.hasSelectionId)u+="".concat(lc,": ").concat(s,"[").concat((0,I.m8)(lc),"]");else{const e=a.items.map((e=>{const n=t.fieldDef(e.channel);return null!==n&&void 0!==n&&n.bin?"[".concat(s,"[").concat((0,I.m8)(t.vgField(e.channel,{})),"], ")+"".concat(s,"[").concat((0,I.m8)(t.vgField(e.channel,{binSuffix:"end"})),"]]"):"".concat(s,"[").concat((0,I.m8)(e.field),"]")})).join(", ");u+="fields: ".concat(o,", values: [").concat(e,"]")}const f=e.events;return n.concat([{name:r+wf,on:f?[{events:f,update:"".concat(l," ? {").concat(u,"} : null"),force:!0}]:[]}])}},Du=Eu;function Au(t,e,n,i){const r=Fa(e)&&e.condition,o=i(e);if(r){return{[n]:[...(0,I.IX)(r).map((e=>{const n=i(e);if(function(t){return t.param}(e)){const{param:i,empty:r}=e;return{test:zf(t,{param:i,empty:r}),...n}}return{test:Pf(t,e.test),...n}})),...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function Su(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";const n=t.encoding[e];return Au(t,n,e,(e=>Mu(e,t.config)))}function Mu(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"datum";if(t){if(Ia(t))return yi(t.value);if(Ba(t)){const{format:i,formatType:r}=es(t);return aa({fieldOrDatumDef:t,format:i,formatType:r,expr:n,config:e})}}}function Cu(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{encoding:n,markDef:i,config:r,stack:o}=t,a=n.tooltip;if((0,I.kJ)(a))return{tooltip:Ou({tooltip:a},o,r,e)};{const s=e.reactiveGeom?"datum.datum":"datum";return Au(t,a,"tooltip",(t=>{const a=Mu(t,r,s);if(a)return a;if(null===t)return;let c=ki("tooltip",i,r);return!0===c&&(c={content:"encoding"}),(0,I.HD)(c)?{value:c}:(0,I.Kn)(c)?li(c)?c:"encoding"===c.content?Ou(n,o,r,e):{signal:s}:void 0}))}}function Fu(t,e,n){let{reactiveGeom:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r={...n,...n.tooltipFormat},o={},a=i?"datum.datum":"datum",s=[];function c(n,i){var c;const l=Ge(i),u=Ua(n)?n:{...n,type:t[l].type},f=u.title||ts(u,r),d=(0,I.IX)(f).join(", ");let h;if(xn(i)){const e="x"===i?"x2":"y2",n=ns(t[e]);if(ei(u.bin)&&n){const t=Ga(u,{expr:a}),i=Ga(n,{expr:a}),{format:s,formatType:c}=es(u);h=pa(t,i,s,c,r),o[e]=!0}}if((xn(i)||i===Qt||i===Kt)&&e&&e.fieldChannel===i&&"normalize"===e.offset){const{format:t,formatType:e}=es(u);h=aa({fieldOrDatumDef:u,format:t,formatType:e,expr:a,config:r,normalizeStack:!0}).signal}null!==(c=h)&&void 0!==c||(h=Mu(u,r,a).signal),s.push({channel:i,key:d,value:h})}Fs(t,((t,e)=>{Ta(t)?c(t,e):Oa(t)&&c(t.condition,e)}));const l={};for(const{channel:u,key:f,value:d}of s)o[u]||l[f]||(l[f]=d);return l}function Ou(t,e,n){let{reactiveGeom:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Fu(t,e,n,{reactiveGeom:i}),o=_t(r).map((t=>{let[e,n]=t;return'"'.concat(e,'": ').concat(n)}));return o.length>0?{signal:"{".concat(o.join(", "),"}")}:void 0}function Nu(t){const{markDef:e,config:n}=t,i=ki("aria",e,n);return!1===i?{}:{...i?{aria:i}:{},...Tu(t),...zu(t)}}function Tu(t){const{mark:e,markDef:n,config:i}=t;if(!1===i.aria)return{};const r=ki("ariaRoleDescription",n,i);return null!=r?{ariaRoleDescription:{value:r}}:e in hi?{}:{ariaRoleDescription:{value:e}}}function zu(t){const{encoding:e,markDef:n,config:i,stack:r}=t,o=e.description;if(o)return Au(t,o,"description",(e=>Mu(e,t.config)));const a=ki("description",n,i);if(null!=a)return{description:yi(a)};if(!1===i.aria)return{};const s=Fu(e,r,i);return yt(s)?void 0:{description:{signal:_t(s).map(((t,e)=>{let[n,i]=t;return'"'.concat(e>0?"; ":"").concat(n,': " + (').concat(i,")")})).join(" + ")}}}function Ru(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{markDef:i,encoding:r,config:o}=e,{vgChannel:a}=n;let{defaultRef:s,defaultValue:c}=n;var l;void 0===s&&(null!==(l=c)&&void 0!==l||(c=ki(t,i,o,{vgChannel:a,ignoreVgConfig:!0})),void 0!==c&&(s=yi(c)));const u=r[t];return Au(e,u,null!==a&&void 0!==a?a:t,(n=>ea({channel:t,channelDef:n,markDef:i,config:o,scaleName:e.scaleName(t),scale:e.getScaleComponent(t),stack:null,defaultRef:s})))}function Pu(t){var e,n,i,r;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{filled:void 0};const{markDef:a,encoding:s,config:c}=t,{type:l}=a,u=null!==(e=o.filled)&&void 0!==e?e:ki("filled",a,c),f=st(["bar","point","circle","square","geoshape"],l)?"transparent":void 0,d=null!==(n=null!==(i=ki(!0===u?"color":void 0,a,c,{vgChannel:"fill"}))&&void 0!==i?i:c.mark[!0===u&&"color"])&&void 0!==n?n:f,h=null!==(r=ki(!1===u?"color":void 0,a,c,{vgChannel:"stroke"}))&&void 0!==r?r:c.mark[!1===u&&"color"],p=u?"fill":"stroke",m={...d?{fill:yi(d)}:{},...h?{stroke:yi(h)}:{}};return a.color&&(u?a.fill:a.stroke)&&dr(Gi("property",{fill:"fill"in a,stroke:"stroke"in a})),{...m,...Ru("color",t,{vgChannel:p,defaultValue:u?d:h}),...Ru("fill",t,{defaultValue:s.fill?d:void 0}),...Ru("stroke",t,{defaultValue:s.stroke?h:void 0})}}function Lu(t){const{encoding:e,mark:n}=t,i=e.order;return!Bo(n)&&Ia(i)?Au(t,i,"zindex",(t=>yi(t.value))):{}}function ju(t){let{channel:e,markDef:n,encoding:i={},model:r,bandPosition:o}=t;const a="".concat(e,"Offset"),s=n[a],c=i[a];if(("xOffset"===a||"yOffset"===a)&&c){return{offsetType:"encoding",offset:ea({channel:a,channelDef:c,markDef:n,config:null===r||void 0===r?void 0:r.config,scaleName:r.scaleName(a),scale:r.getScaleComponent(a),stack:null,defaultRef:yi(s),bandPosition:o})}}const l=n[a];return l?{offsetType:"visual",offset:l}:{}}function Bu(t,e,n){let{defaultPos:i,vgChannel:r}=n;const{encoding:o,markDef:a,config:s,stack:c}=e,l=o[t],u=o[Ve(t)],f=e.scaleName(t),d=e.getScaleComponent(t),{offset:h,offsetType:p}=ju({channel:t,markDef:a,encoding:o,model:e,bandPosition:.5}),m=Uu({model:e,defaultPos:i,channel:t,scaleName:f,scale:d}),g=!l&&xn(t)&&(o.latitude||o.longitude)?{field:e.getName(t)}:function(t){const{channel:e,channelDef:n,scaleName:i,stack:r,offset:o,markDef:a}=t;if(Ba(n)&&r&&e===r.fieldChannel){if(Ta(n)){let t=n.bandPosition;if(void 0!==t||"text"!==a.type||"radius"!==e&&"theta"!==e||(t=.5),void 0!==t)return ta({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:t,offset:o})}return Qo(n,i,{suffix:"end"},{offset:o})}return Yo(t)}({channel:t,channelDef:l,channel2Def:u,markDef:a,config:s,scaleName:f,scale:d,stack:c,offset:h,defaultRef:m,bandPosition:"encoding"===p?0:void 0});return g?{[r||t]:g}:void 0}function Uu(t){let{model:e,defaultPos:n,channel:i,scaleName:r,scale:o}=t;const{markDef:a,config:s}=e;return()=>{const t=Ge(i),c=$e(i),l=ki(i,a,s,{vgChannel:c});if(void 0!==l)return na(i,l);switch(n){case"zeroOrMin":case"zeroOrMax":if(r){const t=o.get("type");if(st([Yr.LOG,Yr.TIME,Yr.UTC],t));else if(o.domainDefinitelyIncludesZero())return{scale:r,value:0}}if("zeroOrMin"===n)return"y"===t?{field:{group:"height"}}:{value:0};switch(t){case"radius":return{signal:"min(".concat(e.width.signal,",").concat(e.height.signal,")/2")};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...e[Ye(i)],mult:.5}}}}const Iu={left:"x",center:"xc",right:"x2"},qu={top:"y",middle:"yc",bottom:"y2"};function Wu(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle";if("radius"===t||"theta"===t)return $e(t);const r="x"===t?"align":"baseline",o=ki(r,e,n);let a;return li(o)?(dr(function(t){return"The ".concat(t," for range marks cannot be an expression")}(r)),a=void 0):a=o,"x"===t?Iu[a||("top"===i?"left":"center")]:qu[a||i]}function Hu(t,e,n){let{defaultPos:i,defaultPos2:r,range:o}=n;return o?Xu(t,e,{defaultPos:i,defaultPos2:r}):Bu(t,e,{defaultPos:i})}function Xu(t,e,n){let{defaultPos:i,defaultPos2:r}=n;const{markDef:o,config:a}=e,s=Ve(t),c=Ye(t),l=function(t,e,n){const{encoding:i,mark:r,markDef:o,stack:a,config:s}=t,c=Ge(n),l=Ye(n),u=$e(n),f=i[c],d=t.scaleName(c),h=t.getScaleComponent(c),{offset:p}=ju(n in i||n in o?{channel:n,markDef:o,encoding:i,model:t}:{channel:c,markDef:o,encoding:i,model:t});if(!f&&("x2"===n||"y2"===n)&&(i.latitude||i.longitude)){const e=Ye(n),i=t.markDef[e];return null!=i?{[e]:{value:i}}:{[u]:{field:t.getName(n)}}}const m=function(t){let{channel:e,channelDef:n,channel2Def:i,markDef:r,config:o,scaleName:a,scale:s,stack:c,offset:l,defaultRef:u}=t;if(Ba(n)&&c&&e.charAt(0)===c.fieldChannel.charAt(0))return Qo(n,a,{suffix:"start"},{offset:l});return Yo({channel:e,channelDef:i,scaleName:a,scale:s,stack:c,markDef:r,config:o,offset:l,defaultRef:u})}({channel:n,channelDef:f,channel2Def:i[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});if(void 0!==m)return{[u]:m};return Ju(n,o)||Ju(n,{[n]:Di(n,o,s.style),[l]:Di(l,o,s.style)})||Ju(n,s[r])||Ju(n,s.mark)||{[u]:Uu({model:t,defaultPos:e,channel:n,scaleName:d,scale:h})()}}(e,r,s);return{...Bu(t,e,{defaultPos:i,vgChannel:l[c]?Wu(t,o,a):$e(t)}),...l}}function Ju(t,e){const n=Ye(t),i=$e(t);if(void 0!==e[i])return{[i]:na(t,e[i])};if(void 0!==e[t])return{[i]:na(t,e[t])};if(e[n]){const i=e[n];if(!Jo(i))return{[n]:na(t,i)};dr(function(t){return"Position range does not support relative band size for ".concat(t,".")}(n))}}function Gu(t,e){var n,i;const{config:r,encoding:o,markDef:a}=t,s=a.type,c=Ve(e),l=Ye(e),u=o[e],f=o[c],d=t.getScaleComponent(e),h=d?d.get("type"):void 0,p=a.orient,m=null!==(n=null!==(i=o[l])&&void 0!==i?i:o.size)&&void 0!==n?n:ki("size",a,r,{vgChannel:l}),g=Ke(e),v="bar"===s&&("x"===e?"vertical"===p:"horizontal"===p);return!Ta(u)||!(ti(u.bin)||ei(u.bin)||u.timeUnit&&!f)||m&&!Jo(m)||o[g]||so(h)?(Ba(u)&&so(h)||v)&&!f?function(t,e,n){const{markDef:i,encoding:r,config:o,stack:a}=n,s=i.orient,c=n.scaleName(e),l=n.getScaleComponent(e),u=Ye(e),f=Ve(e),d=Ke(e),h=n.scaleName(d),p=n.getScaleComponent(Ze(e)),m="horizontal"===s&&"y"===e||"vertical"===s&&"x"===e;let g;(r.size||i.size)&&(m?g=Ru("size",n,{vgChannel:u,defaultRef:yi(i.size)}):dr(function(t){return'Cannot apply size to non-oriented mark "'.concat(t,'".')}(i.type)));const v=!!g,y=Sa({channel:e,fieldDef:t,markDef:i,config:o,scaleType:null===l||void 0===l?void 0:l.get("type"),useVlSizeChannel:m});g=g||{[u]:$u(u,h||c,p||l,o,y,!!t,i.type)};const b="band"===(null===l||void 0===l?void 0:l.get("type"))&&Jo(y)&&!v?"top":"middle",x=Wu(e,i,o,b),_="xc"===x||"yc"===x,{offset:w,offsetType:k}=ju({channel:e,markDef:i,encoding:r,model:n,bandPosition:_?.5:0}),E=Yo({channel:e,channelDef:t,markDef:i,config:o,scaleName:c,scale:l,stack:a,offset:w,defaultRef:Uu({model:n,defaultPos:"mid",channel:e,scaleName:c,scale:l}),bandPosition:_?"encoding"===k?0:.5:li(y)?{signal:"(1-".concat(y,")/2")}:Jo(y)?(1-y.band)/2:0});if(u)return{[x]:E,...g};{const t=$e(f),e=g[u],n=w?{...e,offset:w}:e;return{[x]:E,[t]:(0,I.kJ)(E)?[E[0],{...E[1],offset:n}]:{...E,offset:n}}}}(u,e,t):Xu(e,t,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"}):function(t){var e,n,i;let{fieldDef:r,fieldDef2:o,channel:a,model:s}=t;const{config:c,markDef:l,encoding:u}=s,f=s.getScaleComponent(a),d=s.scaleName(a),h=f?f.get("type"):void 0,p=f.get("reverse"),m=Sa({channel:a,fieldDef:r,markDef:l,config:c,scaleType:h}),g=null===(e=s.component.axes[a])||void 0===e?void 0:e[0],v=null!==(n=null===g||void 0===g?void 0:g.get("translate"))&&void 0!==n?n:.5,y=xn(a)&&null!==(i=ki("binSpacing",l,c))&&void 0!==i?i:0,b=Ve(a),x=$e(a),_=$e(b),{offset:w}=ju({channel:a,markDef:l,encoding:u,model:s,bandPosition:0}),k=li(m)?{signal:"(1-".concat(m.signal,")/2")}:Jo(m)?(1-m.band)/2:.5;if(ti(r.bin)||r.timeUnit)return{[_]:Yu({fieldDef:r,scaleName:d,bandPosition:k,offset:Vu(b,y,p,v,w)}),[x]:Yu({fieldDef:r,scaleName:d,bandPosition:li(k)?{signal:"1-".concat(k.signal)}:1-k,offset:Vu(a,y,p,v,w)})};if(ei(r.bin)){const t=Qo(r,d,{},{offset:Vu(b,y,p,v,w)});if(Ta(o))return{[_]:t,[x]:Qo(o,d,{},{offset:Vu(a,y,p,v,w)})};if(ni(r.bin)&&r.bin.step)return{[_]:t,[x]:{signal:'scale("'.concat(d,'", ').concat(Ga(r,{expr:"datum"})," + ").concat(r.bin.step,")"),offset:Vu(a,y,p,v,w)}}}return void dr(cr(b))}({fieldDef:u,fieldDef2:f,channel:e,model:t})}function $u(t,e,n,i,r,o,a){if(Jo(r)){if(!n)return{mult:r.band,field:{group:t}};{const t=n.get("type");if("band"===t){let t="bandwidth('".concat(e,"')");return 1!==r.band&&(t="".concat(r.band," * ").concat(t)),{signal:"max(0.25, ".concat(t,")")}}1!==r.band&&(dr(function(t){return"Cannot use the relative band size with ".concat(t," scale.")}(t)),r=void 0)}}else{if(li(r))return r;if(r)return{value:r}}if(n){const t=n.get("range");if(ui(t)&&(0,I.hj)(t.step))return{value:t.step-2}}if(!o){const{bandPaddingInner:e,barBandPaddingInner:n,rectBandPaddingInner:r}=i.scale,o=zt(e,"bar"===a?n:r);if(li(o))return{signal:"(1 - (".concat(o.signal,")) * ").concat(t)};if((0,I.hj)(o))return{signal:"".concat(1-o," * ").concat(t)};if(oi(o))return{signal:"(1 - (".concat(o.expr,")) * ").concat(t)}}return{value:kc(i.view,t)-2}}function Vu(t,e,n,i,r){if(De(t))return 0;const o="x"===t||"y2"===t?-e/2:e/2;if(li(n)||li(r)||li(i)){const t=xi(n),e=xi(r),a=xi(i);return{signal:(a?"".concat(a," + "):"")+(t?"(".concat(t," ? -1 : 1) * "):"")+(e?"(".concat(e," + ").concat(o,")"):o)}}return r=r||0,i+(n?-r-o:+r+o)}function Yu(t){let{fieldDef:e,scaleName:n,bandPosition:i,offset:r}=t;return ta({scaleName:n,fieldOrDatumDef:e,bandPosition:i,offset:r})}const Ku=new Set(["aria","width","height"]);function Zu(t,e){const{fill:n,stroke:i}="include"===e.color?Pu(t):{};return{...tf(t.markDef,e),...Qu(t,"fill",n),...Qu(t,"stroke",i),...Ru("opacity",t),...Ru("fillOpacity",t),...Ru("strokeOpacity",t),...Ru("strokeWidth",t),...Ru("strokeDash",t),...Lu(t),...Cu(t),...Su(t,"href"),...Nu(t)}}function Qu(t,e,n){const{config:i,mark:r,markDef:o}=t;if("hide"===ki("invalid",o,i)&&n&&!Bo(r)){const i=function(t,e){let{invalid:n=!1,channels:i}=e;const r=i.reduce(((e,n)=>{const i=t.getScaleComponent(n);if(i){const r=i.get("type"),o=t.vgField(n,{expr:"datum"});o&&co(r)&&(e[o]=!0)}return e}),{}),o=bt(r);if(o.length>0){const t=n?"||":"&&";return o.map((t=>Zo(t,n))).join(" ".concat(t," "))}return}(t,{invalid:!0,channels:Ln});if(i)return{[e]:[{test:i,value:null},...(0,I.IX)(n)]}}return n?{[e]:n}:{}}function tf(t,e){return di.reduce(((n,i)=>(Ku.has(i)||void 0===t[i]||"ignore"===e[i]||(n[i]=yi(t[i])),n)),{})}function ef(t){const{config:e,markDef:n}=t;if(ki("invalid",n,e)){const e=function(t,e){let{invalid:n=!1,channels:i}=e;const r=i.reduce(((e,n)=>{const i=t.getScaleComponent(n);if(i){var r;const o=i.get("type"),a=t.vgField(n,{expr:"datum",binSuffix:null!==(r=t.stack)&&void 0!==r&&r.impute?"mid":void 0});a&&co(o)&&(e[a]=!0)}return e}),{}),o=bt(r);if(o.length>0){const t=n?"||":"&&";return o.map((t=>Zo(t,n))).join(" ".concat(t," "))}return}(t,{channels:bn});if(e)return{defined:{signal:e}}}return{}}function nf(t,e){if(void 0!==e)return{[t]:yi(e)}}const rf="voronoi",of={defined:t=>"point"===t.type&&t.nearest,parse:(t,e)=>{if(e.events)for(const n of e.events)n.markname=t.getName(rf)},marks:(t,e,n)=>{const{x:i,y:r}=e.project.hasChannel,o=t.mark;if(Bo(o))return dr('The "nearest" transform is not supported for '.concat(o," marks.")),n;const a={name:t.getName(rf),type:"path",interactive:!0,from:{data:t.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...Cu(t,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]};let s=0,c=!1;return n.forEach(((e,n)=>{var i;const r=null!==(i=e.name)&&void 0!==i?i:"";r===t.component.mark[0].name?s=n:r.indexOf(rf)>=0&&(c=!0)})),c||n.splice(s+1,0,a),n}},af=of,sf={defined:t=>"point"===t.type&&"global"===t.resolve&&t.bind&&"scales"!==t.bind&&!fc(t.bind),parse:(t,e,n)=>Mf(e,n),topLevelSignals:(t,e,n)=>{const i=e.name,r=e.project,o=e.bind,a=e.init&&e.init[0],s=af.defined(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach(((t,r)=>{const c=kt("".concat(i,"_").concat(t.field));var l,u;n.filter((t=>t.name===c)).length||n.unshift({name:c,...a?{init:nu(a[r])}:{value:null},on:e.events?[{events:e.events,update:"datum && item().mark.marktype !== 'group' ? ".concat(s,"[").concat((0,I.m8)(t.field),"] : null")}]:[],bind:null!==(l=null!==(u=o[t.field])&&void 0!==u?u:o[t.channel])&&void 0!==l?l:o})})),n},signals:(t,e,n)=>{const i=e.name,r=e.project,o=n.filter((t=>t.name===i+wf))[0],a=i+uu,s=r.items.map((t=>kt("".concat(i,"_").concat(t.field)))),c=s.map((t=>"".concat(t," !== null"))).join(" && ");return s.length&&(o.update="".concat(c," ? {fields: ").concat(a,", values: [").concat(s.join(", "),"]} : null")),delete o.value,delete o.on,n}},cf=sf,lf="_toggle",uf={defined:t=>"point"===t.type&&!!t.toggle,signals:(t,e,n)=>n.concat({name:e.name+lf,value:!1,on:[{events:e.events,update:e.toggle}]}),modifyExpr:(t,e)=>{const n=e.name+wf,i=e.name+lf;return"".concat(i," ? null : ").concat(n,", ")+("global"===e.resolve?"".concat(i," ? null : true, "):"".concat(i," ? null : {unit: ").concat(Af(t),"}, "))+"".concat(i," ? ").concat(n," : null")}},ff={defined:t=>void 0!==t.clear&&!1!==t.clear,parse:(t,e)=>{e.clear&&(e.clear=(0,I.HD)(e.clear)?(0,tu.r)(e.clear,"view"):e.clear)},topLevelSignals:(t,e,n)=>{if(cf.defined(e))for(const i of e.project.items){const t=n.findIndex((t=>t.name===kt("".concat(e.name,"_").concat(i.field))));-1!==t&&n[t].on.push({events:e.clear,update:"null"})}return n},signals:(t,e,n)=>{function i(t,i){-1!==t&&n[t].on&&n[t].on.push({events:e.clear,update:i})}if("interval"===e.type)for(const r of e.project.items){const t=n.findIndex((t=>t.name===r.signals.visual));if(i(t,"[0, 0]"),-1===t){i(n.findIndex((t=>t.name===r.signals.data)),"null")}}else{let t=n.findIndex((t=>t.name===e.name+wf));i(t,"null"),uf.defined(e)&&(t=n.findIndex((t=>t.name===e.name+lf)),i(t,"false"))}return n}},df={defined:t=>{const e="global"===t.resolve&&t.bind&&fc(t.bind),n=1===t.project.items.length&&t.project.items[0].field!==lc;return e&&!n&&dr("Legend bindings are only supported for selections over an individual field or encoding channel."),e&&n},parse:(t,e,n)=>{const i=tt(n);if(i.select=(0,I.HD)(i.select)?{type:i.select,toggle:e.toggle}:{...i.select,toggle:e.toggle},Mf(e,i),(0,B.isObject)(n.select)&&(n.select.on||n.select.clear)){const t='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of e.events){var r;n.filter=(0,I.IX)(null!==(r=n.filter)&&void 0!==r?r:[]),n.filter.includes(t)||n.filter.push(t)}}const o=dc(e.bind)?e.bind.legend:"click",a=(0,I.HD)(o)?(0,tu.r)(o,"view"):(0,I.IX)(o);e.bind={legend:{merge:a}}},topLevelSignals:(t,e,n)=>{const i=e.name,r=dc(e.bind)&&e.bind.legend,o=t=>e=>{const n=tt(e);return n.markname=t,n};for(const a of e.project.items){if(!a.hasLegend)continue;const t="".concat(kt(a.field),"_legend"),s="".concat(i,"_").concat(t);if(0===n.filter((t=>t.name===s)).length){const i=r.merge.map(o("".concat(t,"_symbols"))).concat(r.merge.map(o("".concat(t,"_labels")))).concat(r.merge.map(o("".concat(t,"_entries"))));n.unshift({name:s,...e.init?{}:{value:null},on:[{events:i,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:"!event.item || !datum ? null : ".concat(s),force:!0}]})}}return n},signals:(t,e,n)=>{const i=e.name,r=e.project,o=n.find((t=>t.name===i+wf)),a=i+uu,s=r.items.filter((t=>t.hasLegend)).map((t=>kt("".concat(i,"_").concat(kt(t.field),"_legend")))),c=s.map((t=>"".concat(t," !== null"))).join(" && "),l="".concat(c," ? {fields: ").concat(a,", values: [").concat(s.join(", "),"]} : null");e.events&&s.length>0?o.on.push({events:s.map((t=>({signal:t}))),update:l}):s.length>0&&(o.update=l,delete o.value,delete o.on);const u=n.find((t=>t.name===i+lf)),f=dc(e.bind)&&e.bind.legend;return u&&(e.events?u.on.push({...u.on[0],events:f}):u.on[0].events=f),n}};const hf="_translate_anchor",pf="_translate_delta",mf={defined:t=>"interval"===t.type&&t.translate,signals:(t,e,n)=>{const i=e.name,r=mu.defined(e),o=i+hf,{x:a,y:s}=e.project.hasChannel;let c=(0,tu.r)(e.translate,"scope");return r||(c=c.map((t=>(t.between[0].markname=i+yu,t)))),n.push({name:o,value:{},on:[{events:c.map((t=>t.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: ".concat(r?gu(t,Xt):"slice(".concat(a.signals.visual,")")):"")+(void 0!==s?", extent_y: ".concat(r?gu(t,Jt):"slice(".concat(s.signals.visual,")")):"")+"}"}]},{name:i+pf,value:{},on:[{events:c,update:"{x: ".concat(o,".x - x(unit), y: ").concat(o,".y - y(unit)}")}]}),void 0!==a&&gf(t,e,a,"width",n),void 0!==s&&gf(t,e,s,"height",n),n}};function gf(t,e,n,i,r){var o,a;const s=e.name,c=s+hf,l=s+pf,u=n.channel,f=mu.defined(e),d=r.filter((t=>t.name===n.signals[f?"data":"visual"]))[0],h=t.getSizeSignalRef(i).signal,p=t.getScaleComponent(u),m=p&&p.get("type"),g=p&&p.get("reverse"),v=f?u===Xt?g?"":"-":g?"-":"":"",y="".concat(c,".extent_").concat(u),b="".concat(v).concat(l,".").concat(u," / ").concat(f?"".concat(h):"span(".concat(y,")")),x=f&&p?"log"===m?"panLog":"symlog"===m?"panSymlog":"pow"===m?"panPow":"panLinear":"panLinear",_=f?"pow"===m?", ".concat(null!==(o=p.get("exponent"))&&void 0!==o?o:1):"symlog"===m?", ".concat(null!==(a=p.get("constant"))&&void 0!==a?a:1):"":"",w="".concat(x,"(").concat(y,", ").concat(b).concat(_,")");d.on.push({events:{signal:l},update:f?w:"clampRange(".concat(w,", 0, ").concat(h,")")})}const vf="_zoom_anchor",yf="_zoom_delta",bf={defined:t=>"interval"===t.type&&t.zoom,signals:(t,e,n)=>{const i=e.name,r=mu.defined(e),o=i+yf,{x:a,y:s}=e.project.hasChannel,c=(0,I.m8)(t.scaleName(Xt)),l=(0,I.m8)(t.scaleName(Jt));let u=(0,tu.r)(e.zoom,"scope");return r||(u=u.map((t=>(t.markname=i+yu,t)))),n.push({name:i+vf,on:[{events:u,update:r?"{"+[c?"x: invert(".concat(c,", x(unit))"):"",l?"y: invert(".concat(l,", y(unit))"):""].filter((t=>t)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:u,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&xf(t,e,a,"width",n),void 0!==s&&xf(t,e,s,"height",n),n}};function xf(t,e,n,i,r){var o,a;const s=e.name,c=n.channel,l=mu.defined(e),u=r.filter((t=>t.name===n.signals[l?"data":"visual"]))[0],f=t.getSizeSignalRef(i).signal,d=t.getScaleComponent(c),h=d&&d.get("type"),p=l?gu(t,c):u.name,m=s+yf,g="".concat(s).concat(vf,".").concat(c),v=l&&d?"log"===h?"zoomLog":"symlog"===h?"zoomSymlog":"pow"===h?"zoomPow":"zoomLinear":"zoomLinear",y=l?"pow"===h?", ".concat(null!==(o=d.get("exponent"))&&void 0!==o?o:1):"symlog"===h?", ".concat(null!==(a=d.get("constant"))&&void 0!==a?a:1):"":"",b="".concat(v,"(").concat(p,", ").concat(g,", ").concat(m).concat(y,")");u.on.push({events:{signal:m},update:l?b:"clampRange(".concat(b,", 0, ").concat(f,")")})}const _f="_store",wf="_tuple",kf="_modify",Ef="vlSelectionResolve",Df=[Du,ku,hu,uf,cf,mu,df,ff,mf,bf,af];function Af(t){let{escape:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{escape:!0},n=e?(0,I.m8)(t.name):t.name;const i=function(t){let e=t.parent;for(;e&&!dp(e);)e=e.parent;return e}(t);if(i){const{facet:t}=i;for(const e of Te)t[e]&&(n+=" + '__facet_".concat(e,"_' + (facet[").concat((0,I.m8)(i.vgField(e)),"])"))}return n}function Sf(t){var e;return xt(null!==(e=t.component.selection)&&void 0!==e?e:{}).reduce(((t,e)=>t||e.project.hasSelectionId),!1)}function Mf(t,e){!(0,B.isString)(e.select)&&e.select.on||delete t.events,!(0,B.isString)(e.select)&&e.select.clear||delete t.clear,!(0,B.isString)(e.select)&&e.select.toggle||delete t.toggle}var Cf=n(88120);function Ff(t){const e=[];return"Identifier"===t.type?[t.name]:"Literal"===t.type?[t.value]:("MemberExpression"===t.type&&(e.push(...Ff(t.object)),e.push(...Ff(t.property))),e)}function Of(t){return"MemberExpression"===t.object.type?Of(t.object):"datum"===t.object.name}function Nf(t){const e=(0,Cf.BJ)(t),n=new Set;return e.visit((t=>{"MemberExpression"===t.type&&Of(t)&&n.add(Ff(t).slice(1).join("."))})),n}class Tf extends su{clone(){return new Tf(null,this.model,tt(this.filter))}constructor(t,e,n){super(t),this.model=e,this.filter=n,this.expr=Pf(this.model,this.filter,this),this._dependentFields=Nf(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return"Filter ".concat(this.expr)}}function zf(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"datum";const r=(0,I.HD)(e)?e:e.param,o=kt(r),a=(0,I.m8)(o+_f);let s;try{s=t.getSelectionComponent(o,r)}catch(d){return"!!".concat(o)}if(s.project.timeUnit){const e=null!==n&&void 0!==n?n:t.component.data.raw,i=s.project.timeUnit.clone();e.parent?i.insertAsParentOf(e):e.parent=i}const c=s.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l="global"===s.resolve?")":", ".concat((0,I.m8)(s.resolve),")"),u="".concat(c).concat(a,", ").concat(i).concat(l),f="length(data(".concat(a,"))");return!1===e.empty?"".concat(f," && ").concat(u):"!".concat(f," || ").concat(u)}function Rf(t,e,n){const i=kt(e),r=n.encoding;let o,a=n.field;try{o=t.getSelectionComponent(i,e)}catch(s){return i}if(r||a){if(r&&!a){const t=o.project.items.filter((t=>t.channel===r));!t.length||t.length>1?(a=o.project.items[0].field,dr((t.length?"Multiple ":"No ")+"matching ".concat((0,I.m8)(r)," encoding found for selection ").concat((0,I.m8)(n.param),". ")+'Using "field": '.concat((0,I.m8)(a),"."))):a=t[0].field}}else a=o.project.items[0].field,o.project.items.length>1&&dr('A "field" or "encoding" must be specified when using a selection as a scale domain. '+'Using "field": '.concat((0,I.m8)(a),"."));return"".concat(o.name,"[").concat((0,I.m8)(Ft(a)),"]")}function Pf(t,e,n){return Et(e,(e=>(0,I.HD)(e)?e:function(t){return null===t||void 0===t?void 0:t.param}(e)?zf(t,e,n):Br(e)))}function Lf(t,e,n,i){var r,o,a,s,c;null!==(r=t.encode)&&void 0!==r||(t.encode={}),null!==(o=(s=t.encode)[e])&&void 0!==o||(s[e]={}),null!==(a=(c=t.encode[e]).update)&&void 0!==a||(c.update={}),t.encode[e].update[n]=i}function jf(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{header:!1};const{disable:r,orient:o,scale:a,labelExpr:s,title:c,zindex:l,...u}=t.combine();if(!r){for(const t in u){const n=gs[t],i=u[t];if(n&&n!==e&&"both"!==n)delete u[t];else if(ps(i)){const{condition:e,...n}=i,r=(0,I.IX)(e),o=hs[t];if(o){const{vgProp:e,part:i}=o;Lf(u,i,e,[...r.map((t=>{const{test:e,...n}=t;return{test:Pf(null,e),...n}})),n]),delete u[t]}else if(null===o){const e={signal:r.map((t=>{const{test:e,...n}=t;return"".concat(Pf(null,e)," ? ").concat(bi(n)," : ")})).join("")+bi(n)};u[t]=e}}else if(li(i)){const e=hs[t];if(e){const{vgProp:n,part:r}=e;Lf(u,r,n,i),delete u[t]}}st(["labelAlign","labelBaseline"],t)&&null===u[t]&&delete u[t]}if("grid"===e){if(!u.grid)return;if(u.encode){const{grid:t}=u.encode;u.encode={...t?{grid:t}:{}},yt(u.encode)&&delete u.encode}return{scale:a,orient:o,...u,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:zt(l,0)}}{if(!i.header&&t.mainExtracted)return;if(void 0!==s){var f,d;let t=s;null!==(f=u.encode)&&void 0!==f&&null!==(d=f.labels)&&void 0!==d&&d.update&&li(u.encode.labels.update.text)&&(t=Ot(s,"datum.label",u.encode.labels.update.text.signal)),Lf(u,"labels","text",{signal:t})}if(null===u.labelAlign&&delete u.labelAlign,u.encode){for(const e of ms)t.hasAxisPart(e)||delete u.encode[e];yt(u.encode)&&delete u.encode}const e=function(t,e){if(t)return(0,I.kJ)(t)&&!ci(t)?t.map((t=>ts(t,e))).join(", "):t}(c,n);return{scale:a,orient:o,grid:!1,...e?{title:e}:{},...u,...!1===n.aria?{aria:!1}:{},zindex:zt(l,0)}}}}function Bf(t){const{axes:e}=t.component,n=[];for(const i of bn)if(e[i])for(const r of e[i])if(!r.get("disable")&&!r.get("gridScale")){const e="x"===i?"height":"width",r=t.getSizeSignalRef(e).signal;e!==r&&n.push({name:e,update:r})}return n}function Uf(t,e,n,i){return Object.assign.apply(null,[{},...t.map((t=>{if("axisOrient"===t){const t="x"===n?"bottom":"left",r=e["x"===n?"axisBottom":"axisLeft"]||{},o=e["x"===n?"axisTop":"axisRight"]||{},a=new Set([...bt(r),...bt(o)]),s={};for(const e of a.values())s[e]={signal:"".concat(i.signal,' === "').concat(t,'" ? ').concat(xi(r[e])," : ").concat(xi(o[e]))};return s}return e[t]}))])}function If(t,e){const n=[{}];for(const r of t){var i;let t=null===(i=e[r])||void 0===i?void 0:i.style;if(t){t=(0,I.IX)(t);for(const i of t)n.push(e.style[i])}}return Object.assign.apply(null,n)}function qf(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Ai(t,n,e);if(void 0!==r)return{configFrom:"style",configValue:r};for(const a of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"]){var o;if(void 0!==(null===(o=i[a])||void 0===o?void 0:o[t]))return{configFrom:a,configValue:i[a][t]}}return{}}const Wf={scale:t=>{let{model:e,channel:n}=t;return e.scaleName(n)},format:t=>{let{format:e}=t;return e},formatType:t=>{let{formatType:e}=t;return e},grid:t=>{var e;let{fieldOrDatumDef:n,axis:i,scaleType:r}=t;return null!==(e=i.grid)&&void 0!==e?e:function(t,e){return!so(t)&&Ta(e)&&!ti(null===e||void 0===e?void 0:e.bin)&&!ei(null===e||void 0===e?void 0:e.bin)}(r,n)},gridScale:t=>{let{model:e,channel:n}=t;return function(t,e){const n="x"===e?"y":"x";if(t.getScaleComponent(n))return t.scaleName(n);return}(e,n)},labelAlign:t=>{let{axis:e,labelAngle:n,orient:i,channel:r}=t;return e.labelAlign||Jf(n,i,r)},labelAngle:t=>{let{labelAngle:e}=t;return e},labelBaseline:t=>{let{axis:e,labelAngle:n,orient:i,channel:r}=t;return e.labelBaseline||Xf(n,i,r)},labelFlush:t=>{var e;let{axis:n,fieldOrDatumDef:i,channel:r}=t;return null!==(e=n.labelFlush)&&void 0!==e?e:function(t,e){if("x"===e&&st(["quantitative","temporal"],t))return!0;return}(i.type,r)},labelOverlap:t=>{var e;let{axis:n,fieldOrDatumDef:i,scaleType:r}=t;return null!==(e=n.labelOverlap)&&void 0!==e?e:function(t,e,n,i){if(n&&!(0,I.Kn)(i)||"nominal"!==t&&"ordinal"!==t)return"log"!==e&&"symlog"!==e||"greedy";return}(i.type,r,Ta(i)&&!!i.timeUnit,Ta(i)?i.sort:void 0)},orient:t=>{let{orient:e}=t;return e},tickCount:t=>{var e;let{channel:n,model:i,axis:r,fieldOrDatumDef:o,scaleType:a}=t;const s="x"===n?"width":"y"===n?"height":void 0,c=s?i.getSizeSignalRef(s):void 0;return null!==(e=r.tickCount)&&void 0!==e?e:function(t){let{fieldOrDatumDef:e,scaleType:n,size:i,values:r}=t;if(!r&&!so(n)&&"log"!==n){if(Ta(e)){var o;if(ti(e.bin))return{signal:"ceil(".concat(i.signal,"/10)")};if(e.timeUnit&&st(["month","hours","day","quarter"],null===(o=Mr(e.timeUnit))||void 0===o?void 0:o.unit))return}return{signal:"ceil(".concat(i.signal,"/40)")}}return}({fieldOrDatumDef:o,scaleType:a,size:c,values:r.values})},tickMinStep:function(t){let{format:e,fieldOrDatumDef:n}=t;if("d"===e)return 1;if(Ta(n)){const{timeUnit:t}=n;if(t){const e=Cr(t);if(e)return{signal:e}}}return},title:t=>{let{axis:e,model:n,channel:i}=t;if(void 0!==e.title)return e.title;const r=Gf(n,i);if(void 0!==r)return r;const o=n.typedFieldDef(i),a="x"===i?"x2":"y2",s=n.fieldDef(a);return Mi(o?[Ea(o)]:[],Ta(s)?[Ea(s)]:[])},values:t=>{let{axis:e,fieldOrDatumDef:n}=t;return function(t,e){const n=t.values;if((0,I.kJ)(n))return fs(e,n);if(li(n))return n;return}(e,n)},zindex:t=>{var e;let{axis:n,fieldOrDatumDef:i,mark:r}=t;return null!==(e=n.zindex)&&void 0!==e?e:function(t,e){if("rect"===t&&$a(e))return 1;return 0}(r,i)}};function Hf(t){return"(((".concat(t.signal," % 360) + 360) % 360)")}function Xf(t,e,n,i){if(void 0!==t){if("x"===n){if(li(t)){const n=Hf(t),i=li(e)?"(".concat(e.signal,' === "top")'):"top"===e;return{signal:"(45 < ".concat(n," && ").concat(n," < 135) || (225 < ").concat(n," && ").concat(n,' < 315) ? "middle" :')+"(".concat(n," <= 45 || 315 <= ").concat(n,") === ").concat(i,' ? "bottom" : "top"')}}if(45<t&&t<135||225<t&&t<315)return"middle";if(li(e)){const n=t<=45||315<=t?"===":"!==";return{signal:"".concat(e.signal," ").concat(n,' "top" ? "bottom" : "top"')}}return(t<=45||315<=t)===("top"===e)?"bottom":"top"}if(li(t)){const n=Hf(t),r=li(e)?"(".concat(e.signal,' === "left")'):"left"===e,o=i?'"middle"':"null";return{signal:"".concat(n," <= 45 || 315 <= ").concat(n," || (135 <= ").concat(n," && ").concat(n," <= 225) ? ").concat(o," : (45 <= ").concat(n," && ").concat(n," <= 135) === ").concat(r,' ? "top" : "bottom"')}}if(t<=45||315<=t||135<=t&&t<=225)return i?"middle":null;if(li(e)){const n=45<=t&&t<=135?"===":"!==";return{signal:"".concat(e.signal," ").concat(n,' "left" ? "top" : "bottom"')}}return(45<=t&&t<=135)===("left"===e)?"top":"bottom"}}function Jf(t,e,n){if(void 0===t)return;const i="x"===n,r=i?0:90,o=i?"bottom":"left";if(li(t)){const n=Hf(t),a=li(e)?"(".concat(e.signal,' === "').concat(o,'")'):e===o;return{signal:"(".concat(r?"(".concat(n," + 90)"):n," % 180 === 0) ? ").concat(i?null:'"center"'," :")+"(".concat(r," < ").concat(n," && ").concat(n," < ").concat(180+r,") === ").concat(a,' ? "left" : "right"')}}if((t+r)%180===0)return i?null:"center";if(li(e)){const n=r<t&&t<180+r?"===":"!==",i="".concat(e.signal," ").concat(n,' "').concat(o,'"');return{signal:"".concat(i,' ? "left" : "right"')}}return(r<t&&t<180+r)===(e===o)?"left":"right"}function Gf(t,e){const n="x"===e?"x2":"y2",i=t.fieldDef(e),r=t.fieldDef(n),o=i?i.title:void 0,a=r?r.title:void 0;return o&&a?Ci(o,a):o||(a||(void 0!==o?o:void 0!==a?a:void 0))}class $f extends su{clone(){return new $f(null,tt(this.transform))}constructor(t,e){super(t),this.transform=e,this._dependentFields=Nf(this.transform.calculate)}static parseAllForSortIndex(t,e){return e.forEachFieldDef(((e,n)=>{if(qa(e)&&xa(e.sort)){const{field:i,timeUnit:r}=e,o=e.sort,a=o.map(((t,e)=>"".concat(Br({field:i,timeUnit:r,equal:t})," ? ").concat(e," : "))).join("")+o.length;t=new $f(t,{calculate:a,as:Vf(e,n,{forAs:!0})})}})),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return"Calculate ".concat(ot(this.transform))}}function Vf(t,e,n){return Ga(t,{prefix:e,suffix:"sort_index",...null!==n&&void 0!==n?n:{}})}function Yf(t,e){return st(["top","bottom"],e)?"column":st(["left","right"],e)||"row"===t?"row":"column"}function Kf(t,e,n,i){const r="row"===i?n.headerRow:"column"===i?n.headerColumn:n.headerFacet;return zt((e||{})[t],r[t],n.header[t])}function Zf(t,e,n,i){const r={};for(const o of t){const t=Kf(o,e||{},n,i);void 0!==t&&(r[o]=t)}return r}const Qf=["row","column"],td=["header","footer"];function ed(t,e){const n=t.component.layoutHeaders[e].title,i=t.config?t.config:void 0,r=t.component.layoutHeaders[e].facetFieldDef?t.component.layoutHeaders[e].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=Zf(["titleAnchor","titleAngle","titleOrient"],r.header,i,e),c=Yf(e,s),l=Ut(a);return{name:"".concat(e,"-title"),type:"group",role:"".concat(c,"-title"),title:{text:n,..."row"===e?{orient:"left"}:{},style:"guide-title",...id(l,c),...nd(c,l,o),...ud(i,r,e,rc,nc)}}}function nd(t,e){switch(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"middle"){case"start":return{align:"left"};case"end":return{align:"right"}}const n=Jf(e,"row"===t?"left":"top","row"===t?"y":"x");return n?{align:n}:{}}function id(t,e){const n=Xf(t,"row"===e?"left":"top","row"===e?"y":"x",!0);return n?{baseline:n}:{}}function rd(t,e){const n=t.component.layoutHeaders[e],i=[];for(const r of td)if(n[r])for(const o of n[r]){const a=sd(t,e,r,n,o);null!=a&&i.push(a)}return i}function od(t,e){const{sort:n}=t;var i;return ba(n)?{field:Ga(n,{expr:"datum"}),order:null!==(i=n.order)&&void 0!==i?i:"ascending"}:(0,I.kJ)(n)?{field:Vf(t,e,{expr:"datum"}),order:"ascending"}:{field:Ga(t,{expr:"datum"}),order:null!==n&&void 0!==n?n:"ascending"}}function ad(t,e,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:c}=Zf(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],t.header,n,e),l=aa({fieldOrDatumDef:t,format:i,formatType:r,expr:"parent",config:n}).signal,u=Yf(e,s);return{text:{signal:c?Ot(Ot(c,"datum.label",l),"datum.value",Ga(t,{expr:"parent"})):l},..."row"===e?{orient:"left"}:{},style:"guide-label",frame:"group",...id(o,u),...nd(u,o,a),...ud(n,t,e,oc,ic)}}function sd(t,e,n,i,r){if(r){let o=null;const{facetFieldDef:a}=i,s=t.config?t.config:void 0;if(a&&r.labels){const{labelOrient:t}=Zf(["labelOrient"],a.header,s,e);("row"===e&&!st(["top","bottom"],t)||"column"===e&&!st(["left","right"],t))&&(o=ad(a,e,s))}const c=dp(t)&&!_a(t.facet),l=r.axes,u=(null===l||void 0===l?void 0:l.length)>0;if(o||u){const s="row"===e?"height":"width";return{name:t.getName("".concat(e,"_").concat(n)),type:"group",role:"".concat(e,"-").concat(n),...i.facetFieldDef?{from:{data:t.getName("".concat(e,"_domain"))},sort:od(a,e)}:{},...u&&c?{from:{data:t.getName("facet_domain_".concat(e))}}:{},...o?{title:o}:{},...r.sizeSignal?{encode:{update:{[s]:r.sizeSignal}}}:{},...u?{axes:l}:{}}}}return null}const cd={column:{start:0,end:1},row:{start:1,end:0}};function ld(t,e){return cd[e][t]}function ud(t,e,n,i,r){const o={};for(const a of i){if(!r[a])continue;const i=Kf(a,null===e||void 0===e?void 0:e.header,t,n);void 0!==i&&(o[r[a]]=i)}return o}function fd(t){return[...dd(t,"width"),...dd(t,"height"),...dd(t,"childWidth"),...dd(t,"childHeight")]}function dd(t,e){const n="width"===e?"x":"y",i=t.component.layoutSize.get(e);if(!i||"merged"===i)return[];const r=t.getSizeSignalRef(e).signal;if("step"===i){const e=t.getScaleComponent(n);if(e){const i=e.get("type"),o=e.get("range");if(so(i)&&ui(o)){const i=t.scaleName(n);if(dp(t.parent)){if("independent"===t.parent.component.resolve.scale[n])return[hd(i,o)]}return[hd(i,o),{name:r,update:pd(i,e,"domain('".concat(i,"').length"))}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==i){const e=r.endsWith("width"),n=e?"containerSize()[0]":"containerSize()[1]",i=wc(t.config.view,e?"width":"height"),o="isFinite(".concat(n,") ? ").concat(n," : ").concat(i);return[{name:r,init:o,on:[{update:o,events:"window:resize"}]}]}return[{name:r,value:i}]}function hd(t,e){const n="".concat(t,"_step");return li(e.step)?{name:n,update:e.step.signal}:{name:n,value:e.step}}function pd(t,e,n){const i=e.get("type"),r=e.get("padding"),o=zt(e.get("paddingOuter"),r);let a=e.get("paddingInner");return a="band"===i?void 0!==a?a:r:1,"bandspace(".concat(n,", ").concat(xi(a),", ").concat(xi(o),") * ").concat(t,"_step")}function md(t){return"childWidth"===t?"width":"childHeight"===t?"height":t}function gd(t,e){return bt(t).reduce(((n,i)=>{const r=t[i];return{...n,...Au(e,r,i,(t=>yi(t.value)))}}),{})}function vd(t,e){if(dp(e))return"theta"===t?"independent":"shared";if(pp(e))return"shared";if(hp(e))return xn(t)||"theta"===t||"radius"===t?"independent":"shared";throw new Error("invalid model type for resolve")}function yd(t,e){const n=t.scale[e],i=xn(e)?"axis":"legend";return"independent"===n?("shared"===t[i][e]&&dr(function(t){return'Setting the scale to be independent for "'.concat(t,'" means we also have to set the guide (axis or legend) to be independent.')}(e)),"independent"):t[i][e]||"shared"}const bd={...cc,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},xd=bt(bd);class _d extends Bl{}const wd={symbols:function(t,e){var n,i,r,o;let{fieldOrDatumDef:a,model:s,channel:c,legendCmpt:l,legendType:u}=e;if("symbol"!==u)return;const{markDef:f,encoding:d,config:h,mark:p}=s,m=f.filled&&"trail"!==p;let g={..._i({},s,Wo),...Pu(s,{filled:m})};const v=null!==(n=l.get("symbolOpacity"))&&void 0!==n?n:h.legend.symbolOpacity,y=null!==(i=l.get("symbolFillColor"))&&void 0!==i?i:h.legend.symbolFillColor,b=null!==(r=l.get("symbolStrokeColor"))&&void 0!==r?r:h.legend.symbolStrokeColor,x=void 0===v?null!==(o=kd(d.opacity))&&void 0!==o?o:f.opacity:void 0;if(g.fill){var _;if("fill"===c||m&&c===oe)delete g.fill;else if(g.fill.field)if(y)delete g.fill;else g.fill=yi(null!==(_=h.legend.symbolBaseFillColor)&&void 0!==_?_:"black"),g.fillOpacity=yi(null!==x&&void 0!==x?x:1);else if((0,I.kJ)(g.fill)){var w,k,E;const t=null!==(w=null!==(k=Ed(null!==(E=d.fill)&&void 0!==E?E:d.color))&&void 0!==k?k:f.fill)&&void 0!==w?w:m&&f.color;t&&(g.fill=yi(t))}}if(g.stroke)if("stroke"===c||!m&&c===oe)delete g.stroke;else if(g.stroke.field||b)delete g.stroke;else if((0,I.kJ)(g.stroke)){const t=zt(Ed(d.stroke||d.color),f.stroke,m?f.color:void 0);t&&(g.stroke={value:t})}if(c!==fe){const t=Ta(a)&&Ad(s,l,a);t?g.opacity=[{test:t,...yi(null!==x&&void 0!==x?x:1)},yi(h.legend.unselectedOpacity)]:x&&(g.opacity=yi(x))}return g={...g,...t},yt(g)?void 0:g},gradient:function(t,e){var n;let{model:i,legendType:r,legendCmpt:o}=e;if("gradient"!==r)return;const{config:a,markDef:s,encoding:c}=i;let l={};const u=void 0===(null!==(n=o.get("gradientOpacity"))&&void 0!==n?n:a.legend.gradientOpacity)?kd(c.opacity)||s.opacity:void 0;u&&(l.opacity=yi(u));return l={...l,...t},yt(l)?void 0:l},labels:function(t,e){let{fieldOrDatumDef:n,model:i,channel:r,legendCmpt:o}=e;const a=i.legend(r)||{},s=i.config,c=Ta(n)?Ad(i,o,n):void 0,l=c?[{test:c,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:u,formatType:f}=a;let d;ia(f)?d=ca({fieldOrDatumDef:n,field:"datum.value",format:u,formatType:f,config:s}):void 0===u&&void 0===f&&s.customFormatTypes&&("quantitative"===n.type&&s.numberFormatType?d=ca({fieldOrDatumDef:n,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):"temporal"===n.type&&s.timeFormatType&&Ta(n)&&void 0===n.timeUnit&&(d=ca({fieldOrDatumDef:n,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const h={...l?{opacity:l}:{},...d?{text:d}:{},...t};return yt(h)?void 0:h},entries:function(t,e){let{legendCmpt:n}=e;const i=n.get("selections");return null!==i&&void 0!==i&&i.length?{...t,fill:{value:"transparent"}}:t}};function kd(t){return Dd(t,((t,e)=>Math.max(t,e.value)))}function Ed(t){return Dd(t,((t,e)=>zt(t,e.value)))}function Dd(t,e){return function(t){const e=null===t||void 0===t?void 0:t.condition;return!!e&&((0,I.kJ)(e)||Ia(e))}(t)?(0,I.IX)(t.condition).reduce(e,t.value):Ia(t)?t.value:void 0}function Ad(t,e,n){const i=e.get("selections");if(null===i||void 0===i||!i.length)return;const r=(0,I.m8)(n.field);return i.map((t=>{const e=(0,I.m8)(kt(t)+_f);return"(!length(data(".concat(e,")) || (").concat(t,"[").concat(r,"] && indexof(").concat(t,"[").concat(r,"], datum.value) >= 0))")})).join(" || ")}const Sd={direction:t=>{let{direction:e}=t;return e},format:t=>{let{fieldOrDatumDef:e,legend:n,config:i}=t;const{format:r,formatType:o}=n;return la(e,e.type,r,o,i,!1)},formatType:t=>{let{legend:e,fieldOrDatumDef:n,scaleType:i}=t;const{formatType:r}=e;return ua(r,n,i)},gradientLength:t=>{var e,n;const{legend:i,legendConfig:r}=t;return null!==(e=null!==(n=i.gradientLength)&&void 0!==n?n:r.gradientLength)&&void 0!==e?e:function(t){let{legendConfig:e,model:n,direction:i,orient:r,scaleType:o}=t;const{gradientHorizontalMaxLength:a,gradientHorizontalMinLength:s,gradientVerticalMaxLength:c,gradientVerticalMinLength:l}=e;if(lo(o))return"horizontal"===i?"top"===r||"bottom"===r?Fd(n,"width",s,a):s:Fd(n,"height",l,c);return}(t)},labelOverlap:t=>{var e,n;let{legend:i,legendConfig:r,scaleType:o}=t;return null!==(e=null!==(n=i.labelOverlap)&&void 0!==n?n:r.labelOverlap)&&void 0!==e?e:function(t){if(st(["quantile","threshold","log","symlog"],t))return"greedy";return}(o)},symbolType:t=>{var e;let{legend:n,markDef:i,channel:r,encoding:o}=t;return null!==(e=n.symbolType)&&void 0!==e?e:function(t,e,n,i){if("shape"!==e){var r;const t=null!==(r=Ed(n))&&void 0!==r?r:i;if(t)return t}switch(t){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(i.type,r,o.shape,i.shape)},title:t=>{let{fieldOrDatumDef:e,config:n}=t;return Za(e,n,{allowDisabling:!0})},type:t=>{let{legendType:e,scaleType:n,channel:i}=t;if(Oe(i)&&lo(n)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:t=>{let{fieldOrDatumDef:e,legend:n}=t;return function(t,e){const n=t.values;if((0,I.kJ)(n))return fs(e,n);if(li(n))return n;return}(n,e)}};function Md(t){const{legend:e}=t;return zt(e.type,function(t){let{channel:e,timeUnit:n,scaleType:i}=t;if(Oe(e)){if(st(["quarter","month","day"],n))return"symbol";if(lo(i))return"gradient"}return"symbol"}(t))}function Cd(t){var e,n;let{legendConfig:i,legendType:r,orient:o,legend:a}=t;return null!==(e=null!==(n=a.direction)&&void 0!==n?n:i[r?"gradientDirection":"symbolDirection"])&&void 0!==e?e:function(t,e){switch(t){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===e?"horizontal":void 0}}(o,r)}function Fd(t,e,n,i){const r=t.getSizeSignalRef(e).signal;return{signal:"clamp(".concat(r,", ").concat(n,", ").concat(i,")")}}function Od(t){const e=fp(t)?function(t){const{encoding:e}=t,n={};for(const i of[oe,...sc]){const r=is(e[i]);r&&t.getScaleComponent(i)&&(i===ce&&Ta(r)&&r.type===Vr||(n[i]=Td(t,i)))}return n}(t):function(t){const{legends:e,resolve:n}=t.component;for(const i of t.children){Od(i);for(const r of bt(i.component.legends))n.legend[r]=yd(t.component.resolve,r),"shared"===n.legend[r]&&(e[r]=zd(e[r],i.component.legends[r]),e[r]||(n.legend[r]="independent",delete e[r]))}for(const i of bt(e))for(const e of t.children)e.component.legends[i]&&"shared"===n.legend[i]&&delete e.component.legends[i];return e}(t);return t.component.legends=e,e}function Nd(t,e,n,i){switch(e){case"disable":return void 0!==n;case"values":return!(null===n||void 0===n||!n.values);case"title":if("title"===e&&t===(null===i||void 0===i?void 0:i.title))return!0}return t===(n||{})[e]}function Td(t,e){var n,i,r;let o=t.legend(e);const{markDef:a,encoding:s,config:c}=t,l=c.legend,u=new _d({},function(t,e){const n=t.scaleName(e);if("trail"===t.mark){if("color"===e)return{stroke:n};if("size"===e)return{strokeWidth:n}}return"color"===e?t.markDef.filled?{fill:n}:{stroke:n}:{[e]:n}}(t,e));!function(t,e,n){var i;const r=null===(i=t.fieldDef(e))||void 0===i?void 0:i.field;for(const c of xt(null!==(o=t.component.selection)&&void 0!==o?o:{})){var o,a;const t=null!==(a=c.project.hasField[r])&&void 0!==a?a:c.project.hasChannel[e];if(t&&df.defined(c)){var s;const e=null!==(s=n.get("selections"))&&void 0!==s?s:[];e.push(c.name),n.set("selections",e,!1),t.hasLegend=!0}}}(t,e,u);const f=void 0!==o?!o:l.disable;if(u.set("disable",f,void 0!==o),f)return u;o=o||{};const d=t.getScaleComponent(e).get("type"),h=is(s[e]),p=Ta(h)?null===(n=Mr(h.timeUnit))||void 0===n?void 0:n.unit:void 0,m=o.orient||c.legend.orient||"right",g=Md({legend:o,channel:e,timeUnit:p,scaleType:d}),v={legend:o,channel:e,model:t,markDef:a,encoding:s,fieldOrDatumDef:h,legendConfig:l,config:c,scaleType:d,orient:m,legendType:g,direction:Cd({legend:o,legendType:g,orient:m,legendConfig:l})};for(const E of xd){if("gradient"===g&&E.startsWith("symbol")||"symbol"===g&&E.startsWith("gradient"))continue;const n=E in Sd?Sd[E](v):o[E];if(void 0!==n){const i=Nd(n,E,o,t.fieldDef(e));(i||void 0===c.legend[E])&&u.set(E,n,i)}}const y=null!==(i=null===(r=o)||void 0===r?void 0:r.encoding)&&void 0!==i?i:{},b=u.get("selections"),x={},_={fieldOrDatumDef:h,model:t,channel:e,legendCmpt:u,legendType:g};for(const E of["labels","legend","title","symbols","gradient","entries"]){var w;const e=gd(null!==(w=y[E])&&void 0!==w?w:{},t),n=E in wd?wd[E](e,_):e;void 0===n||yt(n)||(x[E]={...null!==b&&void 0!==b&&b.length&&Ta(h)?{name:"".concat(kt(h.field),"_legend_").concat(E)}:{},...null!==b&&void 0!==b&&b.length?{interactive:!!b}:{},update:n})}var k;yt(x)||u.set("encode",x,!(null===(k=o)||void 0===k||!k.encoding));return u}function zd(t,e){if(!t)return e.clone();const n=t.getWithExplicit("orient"),i=e.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const l of xd){const n=Hl(t.getWithExplicit(l),e.getWithExplicit(l),l,"legend",((t,e)=>{switch(l){case"symbolType":return Rd(t,e);case"title":return Fi(t,e);case"type":return r=!0,Il("symbol")}return Wl(t,e,l,"legend")}));t.setWithExplicit(l,n)}var o,a,s,c;r&&(null!==(o=t.implicit)&&void 0!==o&&null!==(a=o.encode)&&void 0!==a&&a.gradient&&Dt(t.implicit,["encode","gradient"]),null!==(s=t.explicit)&&void 0!==s&&null!==(c=s.encode)&&void 0!==c&&c.gradient&&Dt(t.explicit,["encode","gradient"]));return t}function Rd(t,e){return"circle"===e.value?e:t}function Pd(t){const e=t.component.legends,n={};for(const i of bt(e)){const r=t.getScaleComponent(i),o=rt(r.get("domains"));if(n[o])for(const t of n[o]){zd(t,e[i])||n[o].push(e[i])}else n[o]=[e[i].clone()]}return xt(n).flat().map((e=>function(t,e){var n;const{disable:i,labelExpr:r,selections:o,...a}=t.combine();if(i)return;!1===e.aria&&void 0==a.aria&&(a.aria=!1);if(null!==(n=a.encode)&&void 0!==n&&n.symbols){const t=a.encode.symbols.update;!t.fill||"transparent"===t.fill.value||t.stroke||a.stroke||(t.stroke={value:"transparent"});for(const e of sc)a[e]&&delete t[e]}a.title||delete a.title;if(void 0!==r){var s,c;let t=r;null!==(s=a.encode)&&void 0!==s&&null!==(c=s.labels)&&void 0!==c&&c.update&&li(a.encode.labels.update.text)&&(t=Ot(r,"datum.label",a.encode.labels.update.text.signal)),function(t,e,n,i){var r,o,a,s,c;null!==(r=t.encode)&&void 0!==r||(t.encode={}),null!==(o=(s=t.encode)[e])&&void 0!==o||(s[e]={}),null!==(a=(c=t.encode[e]).update)&&void 0!==a||(c.update={}),t.encode[e].update[n]=i}(a,"labels","text",{signal:t})}return a}(e,t.config))).filter((t=>void 0!==t))}function Ld(t){return pp(t)||hp(t)?function(t){return t.children.reduce(((t,e)=>t.concat(e.assembleProjections())),jd(t))}(t):jd(t)}function jd(t){const e=t.component.projection;if(!e||e.merged)return[];const n=e.combine(),{name:i}=n;if(e.data){const r={signal:"[".concat(e.size.map((t=>t.signal)).join(", "),"]")},o=e.data.reduce(((e,n)=>{const i=li(n)?n.signal:"data('".concat(t.lookupDataSource(n),"')");return st(e,i)||e.push(i),e}),[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:o.length>1?"[".concat(o.join(", "),"]"):o[0]},...n}]}return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const Bd=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class Ud extends Bl{constructor(t,e,n,i){super({...e},{name:t}),this.specifiedProjection=e,this.size=n,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function Id(t){t.component.projection=fp(t)?function(t){if(t.hasProjection){var e;const n=ai(t.specifiedProjection),i=!(n&&(null!=n.scale||null!=n.translate)),r=i?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,o=i?function(t){const e=[],{encoding:n}=t;for(const i of[[ne,ee],[re,ie]])(is(n[i[0]])||is(n[i[1]]))&&e.push({signal:t.getName("geojson_".concat(e.length))});t.channelHasField(ce)&&t.typedFieldDef(ce).type===Vr&&e.push({signal:t.getName("geojson_".concat(e.length))});0===e.length&&e.push(t.requestDataName(Ql.Main));return e}(t):void 0,a=new Ud(t.projectionName(!0),{...null!==(e=ai(t.config.projection))&&void 0!==e?e:{},...null!==n&&void 0!==n?n:{}},r,o);return a.get("type")||a.set("type","equalEarth",!1),a}return}(t):function(t){if(0===t.children.length)return;let e;for(const i of t.children)Id(i);const n=lt(t.children,(t=>{const n=t.component.projection;if(n){if(e){const t=function(t,e){const n=lt(Bd,(n=>!(0,I.nr)(t.explicit,n)&&!(0,I.nr)(e.explicit,n)||!!((0,I.nr)(t.explicit,n)&&(0,I.nr)(e.explicit,n)&&Q(t.get(n),e.get(n)))));if(Q(t.size,e.size)){if(n)return t;if(Q(t.explicit,{}))return e;if(Q(e.explicit,{}))return t}return null}(e,n);return t&&(e=t),!!t}return e=n,!0}return!0}));if(e&&n){const n=t.projectionName(!0),i=new Ud(n,e.specifiedProjection,e.size,tt(e.data));for(const e of t.children){const t=e.component.projection;t&&(t.isFit&&i.data.push(...e.component.projection.data),e.renameProjection(t.get("name"),n),t.merged=!0)}return i}return}(t)}function qd(t,e,n,i){if(ds(e,n)){var r,o;const a=fp(t)&&null!==(r=null!==(o=t.axis(n))&&void 0!==o?o:t.legend(n))&&void 0!==r?r:{},s=Ga(e,{expr:"datum"}),c=Ga(e,{expr:"datum",binSuffix:"end"});return{formulaAs:Ga(e,{binSuffix:"range",forAs:!0}),formula:pa(s,c,a.format,a.formatType,i)}}return{}}function Wd(t,e){return"".concat(Qn(t),"_").concat(e)}function Hd(t,e,n){var i;const r=Wd(null!==(i=ss(n,void 0))&&void 0!==i?i:{},e);return t.getName("".concat(r,"_bins"))}function Xd(t,e,n){let i,r;i=function(t){return"as"in t}(t)?(0,I.HD)(t.as)?[t.as,"".concat(t.as,"_end")]:[t.as[0],t.as[1]]:[Ga(t,{forAs:!0}),Ga(t,{binSuffix:"end",forAs:!0})];const o={...ss(e,void 0)},a=Wd(o,t.field),{signal:s,extentSignal:c}=function(t,e){return{signal:t.getName("".concat(e,"_bins")),extentSignal:t.getName("".concat(e,"_extent"))}}(n,a);if(ii(o.extent)){const t=o.extent;r=Rf(n,t.param,t),delete o.extent}return{key:a,binComponent:{bin:o,field:t.field,as:[i],...s?{signal:s}:{},...c?{extentSignal:c}:{},...r?{span:r}:{}}}}class Jd extends su{clone(){return new Jd(null,tt(this.bins))}constructor(t,e){super(t),this.bins=e}static makeFromEncoding(t,e){const n=e.reduceFieldDef(((t,n,i)=>{if(Ua(n)&&ti(n.bin)){const{key:r,binComponent:o}=Xd(n,n.bin,e);t[r]={...o,...t[r],...qd(e,n,i,e.config)}}return t}),{});return yt(n)?null:new Jd(t,n)}static makeFromTransform(t,e,n){const{key:i,binComponent:r}=Xd(e,e.bin,n);return new Jd(t,{[i]:r})}merge(t,e){for(const n of bt(t.bins))n in this.bins?(e(t.bins[n].signal,this.bins[n].signal),this.bins[n].as=dt([...this.bins[n].as,...t.bins[n].as],ot)):this.bins[n]=t.bins[n];for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}producedFields(){return new Set(xt(this.bins).map((t=>t.as)).flat(2))}dependentFields(){return new Set(xt(this.bins).map((t=>t.field)))}hash(){return"Bin ".concat(ot(this.bins))}assemble(){return xt(this.bins).flatMap((t=>{const e=[],[n,...i]=t.as,{extent:r,...o}=t.bin,a={type:"bin",field:Ft(t.field),as:n,signal:t.signal,...ii(r)?{extent:null}:{extent:r},...t.span?{span:{signal:"span(".concat(t.span,")")}}:{},...o};!r&&t.extentSignal&&(e.push({type:"extent",field:Ft(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),e.push(a);for(const s of i)for(let t=0;t<2;t++)e.push({type:"formula",expr:Ga({field:n[t]},{expr:"datum"}),as:s[t]});return t.formula&&e.push({type:"formula",expr:t.formula,as:t.formulaAs}),e}))}}function Gd(t,e,n,i){var r;const o=fp(i)?i.encoding[Ve(e)]:void 0;if(Ua(n)&&fp(i)&&Ma(n,o,i.markDef,i.config))t.add(Ga(n,{})),t.add(Ga(n,{suffix:"end"})),n.bin&&ds(n,e)&&t.add(Ga(n,{binSuffix:"range"}));else if(Me(e)){const n=Se(e);t.add(i.getName(n))}else t.add(Ga(n));return qa(n)&&function(t){return(0,B.isObject)(t)&&"field"in t}(null===(r=n.scale)||void 0===r?void 0:r.range)&&t.add(n.scale.range.field),t}class $d extends su{clone(){return new $d(null,new Set(this.dimensions),tt(this.measures))}constructor(t,e,n){super(t),this.dimensions=e,this.measures=n}get groupBy(){return this.dimensions}static makeFromEncoding(t,e){let n=!1;e.forEachFieldDef((t=>{t.aggregate&&(n=!0)}));const i={},r=new Set;return n?(e.forEachFieldDef(((t,n)=>{const{aggregate:o,field:a}=t;if(o)if("count"===o){var s;null!==(s=i["*"])&&void 0!==s||(i["*"]={}),i["*"].count=new Set([Ga(t,{forAs:!0})])}else{if(Jn(o)||Gn(o)){var c;const t=Jn(o)?"argmin":"argmax",e=o[t];null!==(c=i[e])&&void 0!==c||(i[e]={}),i[e][t]=new Set([Ga({op:t,field:e},{forAs:!0})])}else{var l;null!==(l=i[a])&&void 0!==l||(i[a]={}),i[a][o]=new Set([Ga(t,{forAs:!0})])}var u;if(jn(n)&&"unaggregated"===e.scaleDomain(n))null!==(u=i[a])&&void 0!==u||(i[a]={}),i[a].min=new Set([Ga({field:a,aggregate:"min"},{forAs:!0})]),i[a].max=new Set([Ga({field:a,aggregate:"max"},{forAs:!0})])}else Gd(r,n,t,e)})),r.size+bt(i).length===0?null:new $d(t,r,i)):null}static makeFromTransform(t,e){const n=new Set,i={};for(const s of e.aggregate){const{op:t,field:e,as:n}=s;var r,o;if(t)if("count"===t)null!==(r=i["*"])&&void 0!==r||(i["*"]={}),i["*"].count=new Set([n||Ga(s,{forAs:!0})]);else null!==(o=i[e])&&void 0!==o||(i[e]={}),i[e][t]=new Set([n||Ga(s,{forAs:!0})])}for(const s of null!==(a=e.groupby)&&void 0!==a?a:[]){var a;n.add(s)}return n.size+bt(i).length===0?null:new $d(t,n,i)}merge(t){return pt(this.dimensions,t.dimensions)?(function(t,e){for(const i of bt(e)){const r=e[i];for(const e of bt(r)){var n;i in t?t[i][e]=new Set([...null!==(n=t[i][e])&&void 0!==n?n:[],...r[e]]):t[i]={[e]:r[e]}}}}(this.measures,t.measures),!0):(function(){ur.debug(...arguments)}("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...bt(this.measures)])}producedFields(){const t=new Set;for(const e of bt(this.measures))for(const n of bt(this.measures[e])){const i=this.measures[e][n];0===i.size?t.add("".concat(n,"_").concat(e)):i.forEach(t.add,t)}return t}hash(){return"Aggregate ".concat(ot({dimensions:this.dimensions,measures:this.measures}))}assemble(){const t=[],e=[],n=[];for(const i of bt(this.measures))for(const r of bt(this.measures[i]))for(const o of this.measures[i][r])n.push(o),t.push(r),e.push("*"===i?null:Ft(i));return{type:"aggregate",groupby:[...this.dimensions].map(Ft),ops:t,fields:e,as:n}}}class Vd extends su{constructor(t,e,n,i){super(t),this.model=e,this.name=n,this.data=i;for(const r of Te){const t=e.facet[r];if(t){const{bin:n,sort:i}=t;this[r]={name:e.getName("".concat(r,"_domain")),fields:[Ga(t),...ti(n)?[Ga(t,{binSuffix:"end"})]:[]],...ba(i)?{sortField:i}:(0,I.kJ)(i)?{sortIndexField:Vf(t,r)}:{}}}}this.childModel=e.child}hash(){let t="Facet";for(const e of Te)this[e]&&(t+=" ".concat(e.charAt(0),":").concat(ot(this[e])));return t}get fields(){const t=[];for(const n of Te){var e;null!==(e=this[n])&&void 0!==e&&e.fields&&t.push(...this[n].fields)}return t}dependentFields(){const t=new Set(this.fields);for(const e of Te)this[e]&&(this[e].sortField&&t.add(this[e].sortField.field),this[e].sortIndexField&&t.add(this[e].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const e of bn){const n=this.childModel.component.scales[e];if(n&&!n.merged){const i=n.get("type"),r=n.get("range");if(so(i)&&ui(r)){const n=qh(Wh(this.childModel,e));n?t[e]=n:dr(Pi(e))}}}return t}assembleRowColumnHeaderData(t,e,n){const i={row:"y",column:"x",facet:void 0}[t],r=[],o=[],a=[];i&&n&&n[i]&&(e?(r.push("distinct_".concat(n[i])),o.push("max")):(r.push(n[i]),o.push("distinct")),a.push("distinct_".concat(n[i])));const{sortField:s,sortIndexField:c}=this[t];if(s){const{op:t=ma,field:e}=s;r.push(e),o.push(t),a.push(Ga(s,{forAs:!0}))}else c&&(r.push(c),o.push("max"),a.push(c));return{name:this[t].name,source:null!==e&&void 0!==e?e:this.data,transform:[{type:"aggregate",groupby:this[t].fields,...r.length?{fields:r,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){const{columns:e}=this.model.layout,{layoutHeaders:n}=this.model.component,i=[],r={};for(const l of Qf){for(const t of td){var o;const e=null!==(o=n[l]&&n[l][t])&&void 0!==o?o:[];for(const t of e){var a;if((null===(a=t.axes)||void 0===a?void 0:a.length)>0){r[l]=!0;break}}}if(r[l]){const t='length(data("'.concat(this.facet.name,'"))'),n="row"===l?e?{signal:"ceil(".concat(t," / ").concat(e,")")}:1:e?{signal:"min(".concat(t,", ").concat(e,")")}:{signal:t};i.push({name:"".concat(this.facet.name,"_").concat(l),transform:[{type:"sequence",start:0,stop:n}]})}}const{row:s,column:c}=r;return(s||c)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,t)),i}assemble(){const t=[];let e=null;const n=this.getChildIndependentFieldsWithStep(),{column:i,row:r,facet:o}=this;if(i&&r&&(n.x||n.y)){var a,s;e="cross_".concat(this.column.name,"_").concat(this.row.name);const i=[].concat(null!==(a=n.x)&&void 0!==a?a:[],null!==(s=n.y)&&void 0!==s?s:[]),r=i.map((()=>"distinct"));t.push({name:e,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:i,ops:r}]})}for(const c of[Wt,qt])this[c]&&t.push(this.assembleRowColumnHeaderData(c,e,n));if(o){const e=this.assembleFacetHeaderData(n);e&&t.push(...e)}return t}}function Yd(t){return t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function Kd(t){const e={};return K(t.filter,(t=>{if(Lr(t)){let i=null;if(Fr(t))i=gi(t.equal);else if(Nr(t))i=gi(t.lte);else if(Or(t))i=gi(t.lt);else if(Tr(t))i=gi(t.gt);else if(zr(t))i=gi(t.gte);else if(Rr(t))i=t.range[0];else if(Pr(t)){var n;i=(null!==(n=t.oneOf)&&void 0!==n?n:t.in)[0]}i&&(hr(i)?e[t.field]="date":(0,I.hj)(i)?e[t.field]="number":(0,I.HD)(i)&&(e[t.field]="string")),t.timeUnit&&(e[t.field]="date")}})),e}function Zd(t){const e={};function n(t){var n;ls(t)?e[t.field]="date":"quantitative"===t.type&&(n=t.aggregate,(0,I.HD)(n)&&st(["min","max"],n))?e[t.field]="number":Tt(t.field)>1?t.field in e||(e[t.field]="flatten"):qa(t)&&ba(t.sort)&&Tt(t.sort.field)>1&&(t.sort.field in e||(e[t.sort.field]="flatten"))}if((fp(t)||dp(t))&&t.forEachFieldDef(((e,i)=>{if(Ua(e))n(e);else{const r=Ge(i),o=t.fieldDef(r);n({...e,type:o.type})}})),fp(t)){const{mark:n,markDef:i,encoding:r}=t;if(Bo(n)&&!t.encoding.order){const t=r["horizontal"===i.orient?"y":"x"];Ta(t)&&"quantitative"===t.type&&!(t.field in e)&&(e[t.field]="number")}}return e}class Qd extends su{clone(){return new Qd(null,tt(this._parse))}constructor(t,e){super(t),this._parse=e}hash(){return"Parse ".concat(ot(this._parse))}static makeExplicit(t,e,n){var i;let r={};const o=e.data;return!Vl(o)&&null!==o&&void 0!==o&&null!==(i=o.format)&&void 0!==i&&i.parse&&(r=o.format.parse),this.makeWithAncestors(t,r,{},n)}static makeWithAncestors(t,e,n,i){for(const a of bt(n)){const t=i.getWithExplicit(a);void 0!==t.value&&(t.explicit||t.value===n[a]||"derived"===t.value||"flatten"===n[a]?delete n[a]:dr(qi(a,n[a],t.value)))}for(const a of bt(e)){const t=i.get(a);void 0!==t&&(t===e[a]?delete e[a]:dr(qi(a,e[a],t)))}const r=new Bl(e,n);i.copyAll(r);const o={};for(const a of bt(r.combine())){const t=r.get(a);null!==t&&(o[a]=t)}return 0===bt(o).length||i.parseNothing?null:new Qd(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const e of bt(this._parse)){const n=this._parse[e];1===Tt(e)&&(t[e]=n)}return t}producedFields(){return new Set(bt(this._parse))}dependentFields(){return new Set(bt(this._parse))}assembleTransforms(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return bt(this._parse).filter((e=>!t||Tt(e)>1)).map((t=>{const e=function(t,e){const n=St(t);if("number"===e)return"toNumber(".concat(n,")");if("boolean"===e)return"toBoolean(".concat(n,")");if("string"===e)return"toString(".concat(n,")");if("date"===e)return"toDate(".concat(n,")");if("flatten"===e)return n;if(e.startsWith("date:")){const t=Yd(e.slice(5,e.length));return"timeParse(".concat(n,",'").concat(t,"')")}if(e.startsWith("utc:")){const t=Yd(e.slice(4,e.length));return"utcParse(".concat(n,",'").concat(t,"')")}return dr('Unrecognized parse "'.concat(e,'".')),null}(t,this._parse[t]);if(!e)return null;return{type:"formula",expr:e,as:Nt(t)}})).filter((t=>null!==t))}}class th extends su{clone(){return new th(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([lc])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:lc}}}class eh extends su{clone(){return new eh(null,this.params)}constructor(t,e){super(t),this.params=e}dependentFields(){return new Set}producedFields(){}hash(){return"Graticule ".concat(ot(this.params))}assemble(){return{type:"graticule",...!0===this.params?{}:this.params}}}class nh extends su{clone(){return new nh(null,this.params)}constructor(t,e){super(t),this.params=e}dependentFields(){return new Set}producedFields(){var t;return new Set([null!==(t=this.params.as)&&void 0!==t?t:"data"])}hash(){return"Hash ".concat(ot(this.params))}assemble(){return{type:"sequence",...this.params}}}class ih extends su{constructor(t){var e;let n;if(super(null),null!==(e=t)&&void 0!==e||(t={name:"source"}),Vl(t)||(n=t.format?{...it(t.format,["parse"])}:{}),Gl(t))this._data={values:t.values};else if(Jl(t)){if(this._data={url:t.url},!n.type){let e=/(?:\.([^.]+))?$/.exec(t.url)[1];st(["json","csv","tsv","dsv","topojson"],e)||(e="json"),n.type=e}}else Kl(t)?this._data={values:[{type:"Sphere"}]}:($l(t)||Vl(t))&&(this._data={});this._generator=Vl(t),t.name&&(this._name=t.name),n&&!yt(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var rh,oh=function(t,e,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"===typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(t,n):r?r.value=n:e.set(t,n),n},ah=function(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"===typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)};function sh(t){return t instanceof ih||t instanceof eh||t instanceof nh}class ch{constructor(){rh.set(this,void 0),oh(this,rh,!1,"f")}setModified(){oh(this,rh,!0,"f")}get modifiedFlag(){return ah(this,rh,"f")}}rh=new WeakMap;class lh extends ch{getNodeDepths(t,e,n){n.set(t,e);for(const i of t.children)this.getNodeDepths(i,e+1,n);return n}optimize(t){const e=[...this.getNodeDepths(t,0,new Map).entries()].sort(((t,e)=>e[1]-t[1]));for(const n of e)this.run(n[0]);return this.modifiedFlag}}class uh extends ch{optimize(t){this.run(t);for(const e of t.children)this.optimize(e);return this.modifiedFlag}}class fh extends uh{mergeNodes(t,e){const n=e.shift();for(const i of e)t.removeChild(i),i.parent=n,i.remove()}run(t){const e=t.children.map((t=>t.hash())),n={};for(let i=0;i<e.length;i++)void 0===n[e[i]]?n[e[i]]=[t.children[i]]:n[e[i]].push(t.children[i]);for(const i of bt(n))n[i].length>1&&(this.setModified(),this.mergeNodes(t,n[i]))}}class dh extends uh{constructor(t){super(),this.requiresSelectionId=t&&Sf(t)}run(t){t instanceof th&&(this.requiresSelectionId&&(sh(t.parent)||t.parent instanceof $d||t.parent instanceof Qd)||(this.setModified(),t.remove()))}}class hh extends ch{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,e){let n=new Set;t instanceof lu&&(n=t.producedFields(),mt(n,e)&&(this.setModified(),t.removeFormulas(e),0===t.producedFields.length&&t.remove()));for(const i of t.children)this.run(i,new Set([...e,...n]))}}class ph extends uh{constructor(){super()}run(t){t instanceof cu&&!t.isRequired()&&(this.setModified(),t.remove())}}class mh extends lh{run(t){if(!sh(t)&&!(t.numChildren()>1))for(const e of t.children)if(e instanceof Qd)if(t instanceof Qd)this.setModified(),t.merge(e);else{if(vt(t.producedFields(),e.dependentFields()))continue;this.setModified(),e.swapWithParent()}}}class gh extends lh{run(t){const e=[...t.children],n=t.children.filter((t=>t instanceof Qd));if(t.numChildren()>1&&n.length>=1){const i={},r=new Set;for(const t of n){const e=t.parse;for(const t of bt(e))t in i?i[t]!==e[t]&&r.add(t):i[t]=e[t]}for(const t of r)delete i[t];if(!yt(i)){this.setModified();const n=new Qd(t,i);for(const r of e){if(r instanceof Qd)for(const t of bt(i))delete r.parse[t];t.removeChild(r),r.parent=n,r instanceof Qd&&0===bt(r.parse).length&&r.remove()}}}}}class vh extends lh{run(t){t instanceof cu||t.numChildren()>0||t instanceof Vd||t instanceof ih||(this.setModified(),t.remove())}}class yh extends lh{run(t){const e=t.children.filter((t=>t instanceof lu)),n=e.pop();for(const i of e)this.setModified(),n.merge(i)}}class bh extends lh{run(t){const e=t.children.filter((t=>t instanceof $d)),n={};for(const i of e){const t=ot(i.groupBy);t in n||(n[t]=[]),n[t].push(i)}for(const i of bt(n)){const e=n[i];if(e.length>1){const n=e.pop();for(const i of e)n.merge(i)&&(t.removeChild(i),i.parent=n,i.remove(),this.setModified())}}}}class xh extends lh{constructor(t){super(),this.model=t}run(t){const e=!(sh(t)||t instanceof Tf||t instanceof Qd||t instanceof th),n=[],i=[];for(const r of t.children)r instanceof Jd&&(e&&!vt(t.producedFields(),r.dependentFields())?n.push(r):i.push(r));if(n.length>0){const e=n.pop();for(const t of n)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof Jd?t.merge(e,this.model.renameSignal.bind(this.model)):e.swapWithParent()}if(i.length>1){const t=i.pop();for(const e of i)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified()}}}class _h extends lh{run(t){const e=[...t.children];if(!ct(e,(t=>t instanceof cu))||t.numChildren()<=1)return;const n=[];let i;for(const r of e)if(r instanceof cu){let e=r;for(;1===e.numChildren();){const[t]=e.children;if(!(t instanceof cu))break;e=t}n.push(...e.children),i?(t.removeChild(r),r.parent=i.parent,i.parent.removeChild(i),i.parent=e,this.setModified()):i=e}else n.push(r);if(n.length){this.setModified();for(const t of n)t.parent.removeChild(t),t.parent=i}}}class wh extends su{clone(){return new wh(null,tt(this.transform))}constructor(t,e){super(t),this.transform=e}addDimensions(t){this.transform.groupby=dt(this.transform.groupby.concat(t),(t=>t))}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map((t=>t.field)).filter((t=>void 0!==t)).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){var e;return null!==(e=t.as)&&void 0!==e?e:Ga(t)}hash(){return"JoinAggregateTransform ".concat(ot(this.transform))}assemble(){const t=[],e=[],n=[];for(const r of this.transform.joinaggregate)e.push(r.op),n.push(this.getDefaultName(r)),t.push(void 0===r.field?null:r.field);const i=this.transform.groupby;return{type:"joinaggregate",as:n,ops:e,fields:t,...void 0!==i?{groupby:i}:{}}}}class kh extends su{clone(){return new kh(null,tt(this._stack))}constructor(t,e){super(t),this._stack=e}static makeFromTransform(t,e){const{stack:n,groupby:i,as:r,offset:o="zero"}=e,a=[],s=[];if(void 0!==e.sort)for(const u of e.sort)a.push(u.field),s.push(zt(u.order,"ascending"));const c={field:a,order:s};let l;return l=function(t){return(0,I.kJ)(t)&&t.every((t=>(0,I.HD)(t)))&&t.length>1}(r)?r:(0,I.HD)(r)?[r,"".concat(r,"_end")]:["".concat(e.stack,"_start"),"".concat(e.stack,"_end")],new kh(t,{dimensionFieldDefs:[],stackField:n,groupby:i,offset:o,sort:c,facetby:[],as:l})}static makeFromEncoding(t,e){const n=e.stack,{encoding:i}=e;if(!n)return null;const{groupbyChannels:r,fieldChannel:o,offset:a,impute:s}=n,c=r.map((t=>ns(i[t]))).filter((t=>!!t)),l=function(t){return t.stack.stackBy.reduce(((t,e)=>{const n=Ga(e.fieldDef);return n&&t.push(n),t}),[])}(e),u=e.encoding.order;let f;if((0,I.kJ)(u)||Ta(u))f=Si(u);else{const t=Ca(u)?u.sort:"y"===o?"descending":"ascending";f=l.reduce(((e,n)=>(e.field.push(n),e.order.push(t),e)),{field:[],order:[]})}return new kh(t,{dimensionFieldDefs:c,stackField:e.vgField(o),facetby:[],stackby:l,sort:f,offset:a,impute:s,as:[e.vgField(o,{suffix:"start",forAs:!0}),e.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return"Stack ".concat(ot(this._stack))}getGroupbyFields(){const{dimensionFieldDefs:t,impute:e,groupby:n}=this._stack;return t.length>0?t.map((t=>t.bin?e?[Ga(t,{binSuffix:"mid"})]:[Ga(t,{}),Ga(t,{binSuffix:"end"})]:[Ga(t)])).flat():null!==n&&void 0!==n?n:[]}assemble(){const t=[],{facetby:e,dimensionFieldDefs:n,stackField:i,stackby:r,sort:o,offset:a,impute:s,as:c}=this._stack;if(s)for(const l of n){const{bandPosition:n=.5,bin:o}=l;if(o){const e=Ga(l,{expr:"datum"}),i=Ga(l,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:"".concat(n,"*").concat(e,"+").concat(1-n,"*").concat(i),as:Ga(l,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:i,groupby:[...r,...e],key:Ga(l,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...e],field:i,sort:o,as:c,offset:a}),t}}class Eh extends su{clone(){return new Eh(null,tt(this.transform))}constructor(t,e){super(t),this.transform=e}addDimensions(t){this.transform.groupby=dt(this.transform.groupby.concat(t),(t=>t))}dependentFields(){var t,e;const n=new Set;return(null!==(t=this.transform.groupby)&&void 0!==t?t:[]).forEach(n.add,n),(null!==(e=this.transform.sort)&&void 0!==e?e:[]).forEach((t=>n.add(t.field))),this.transform.window.map((t=>t.field)).filter((t=>void 0!==t)).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){var e;return null!==(e=t.as)&&void 0!==e?e:Ga(t)}hash(){return"WindowTransform ".concat(ot(this.transform))}assemble(){const t=[],e=[],n=[],i=[];for(const f of this.transform.window)e.push(f.op),n.push(this.getDefaultName(f)),i.push(void 0===f.param?null:f.param),t.push(void 0===f.field?null:f.field);const r=this.transform.frame,o=this.transform.groupby;if(r&&null===r[0]&&null===r[1]&&e.every((t=>$n(t))))return{type:"joinaggregate",as:n,ops:e,fields:t,...void 0!==o?{groupby:o}:{}};const a=[],s=[];if(void 0!==this.transform.sort)for(const f of this.transform.sort){var c;a.push(f.field),s.push(null!==(c=f.order)&&void 0!==c?c:"ascending")}const l={field:a,order:s},u=this.transform.ignorePeers;return{type:"window",params:i,as:n,ops:e,fields:t,sort:l,...void 0!==u?{ignorePeers:u}:{},...void 0!==o?{groupby:o}:{},...void 0!==r?{frame:r}:{}}}}function Dh(t){if(t instanceof Vd)if(1!==t.numChildren()||t.children[0]instanceof cu){const n=t.model.component.data.main;Ah(n);const i=(e=t,function t(n){if(!(n instanceof Vd)){const i=n.clone();if(i instanceof cu){const t=Sh+i.getSource();i.setSource(t),e.model.component.data.outputNodes[t]=i}else(i instanceof $d||i instanceof kh||i instanceof Eh||i instanceof wh)&&i.addDimensions(e.fields);for(const e of n.children.flatMap(t))e.parent=i;return[i]}return n.children.flatMap(t)}),r=t.children.map(i).flat();for(const t of r)t.parent=n}else{const e=t.children[0];(e instanceof $d||e instanceof kh||e instanceof Eh||e instanceof wh)&&e.addDimensions(t.fields),e.swapWithParent(),Dh(t)}else t.children.map(Dh);var e}function Ah(t){if(t instanceof cu&&t.type===Ql.Main&&1===t.numChildren()){const e=t.children[0];e instanceof Vd||(e.swapWithParent(),Ah(t))}}const Sh="scale_",Mh=5;function Ch(t){for(const e of t){for(const t of e.children)if(t.parent!==e)return!1;if(!Ch(e.children))return!1}return!0}function Fh(t,e){let n=!1;for(const i of e)n=t.optimize(i)||n;return n}function Oh(t,e,n){let i=t.sources,r=!1;return r=Fh(new ph,i)||r,r=Fh(new dh(e),i)||r,i=i.filter((t=>t.numChildren()>0)),r=Fh(new vh,i)||r,i=i.filter((t=>t.numChildren()>0)),n||(r=Fh(new mh,i)||r,r=Fh(new xh(e),i)||r,r=Fh(new hh,i)||r,r=Fh(new gh,i)||r,r=Fh(new bh,i)||r,r=Fh(new yh,i)||r,r=Fh(new fh,i)||r,r=Fh(new _h,i)||r),t.sources=i,r}class Nh{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,e){return new Nh((()=>t(e)))}}function Th(t){fp(t)?function(t){const e=t.component.scales;for(const n of bt(e)){const i=zh(t,n);if(e[n].setWithExplicit("domains",i),jh(t,n),t.component.data.isFaceted){let e=t;for(;!dp(e)&&e.parent;)e=e.parent;if("shared"===e.component.resolve.scale[n])for(const t of i.value)fi(t)&&(t.data=Sh+t.data.replace(Sh,""))}}}(t):function(t){for(const n of t.children)Th(n);const e=t.component.scales;for(const n of bt(e)){let i,r=null;for(const e of t.children){const t=e.component.scales[n];if(t){i=void 0===i?t.getWithExplicit("domains"):Hl(i,t.getWithExplicit("domains"),"domains","scale",Uh);const e=t.get("selectionExtent");r&&e&&r.param!==e.param&&dr(Ui),r=e}}e[n].setWithExplicit("domains",i),r&&e[n].set("selectionExtent",r,!0)}}(t)}function zh(t,e){const n=t.getScaleComponent(e).get("type"),{encoding:i}=t,r=function(t,e,n,i){if("unaggregated"===t){const{valid:t,reason:i}=Bh(e,n);if(!t)return void dr(i)}else if(void 0===t&&i.useUnaggregatedDomain){const{valid:t}=Bh(e,n);if(t)return"unaggregated"}return t}(t.scaleDomain(e),t.typedFieldDef(e),n,t.config.scale);return r!==t.scaleDomain(e)&&(t.specifiedScales[e]={...t.specifiedScales[e],domain:r}),"x"===e&&is(i.x2)?is(i.x)?Hl(Ph(n,r,t,"x"),Ph(n,r,t,"x2"),"domain","scale",Uh):Ph(n,r,t,"x2"):"y"===e&&is(i.y2)?is(i.y)?Hl(Ph(n,r,t,"y"),Ph(n,r,t,"y2"),"domain","scale",Uh):Ph(n,r,t,"y2"):Ph(n,r,t,e)}function Rh(t,e,n){var i;const r=null===(i=Mr(n))||void 0===i?void 0:i.unit;return"temporal"===e||r?function(t,e,n){return t.map((t=>{const i=us(t,{timeUnit:n,type:e});return{signal:"{data: ".concat(i,"}")}}))}(t,e,r):[t]}function Ph(t,e,n,i){const{encoding:r}=n,o=is(r[i]),{type:a}=o,s=o.timeUnit;if(function(t){return null===t||void 0===t?void 0:t.unionWith}(e)){const r=Ph(t,void 0,n,i);return Ul([...Rh(e.unionWith,a,s),...r.value])}if(li(e))return Ul([e]);if(e&&"unaggregated"!==e&&!fo(e))return Ul(Rh(e,a,s));const c=n.stack;if(c&&i===c.fieldChannel){if("normalize"===c.offset)return Il([[0,1]]);const t=n.requestDataName(Ql.Main);return Il([{data:t,field:n.vgField(i,{suffix:"start"})},{data:t,field:n.vgField(i,{suffix:"end"})}])}const l=jn(i)&&Ta(o)?function(t,e,n){if(!so(n))return;const i=t.fieldDef(e),r=i.sort;if(xa(r))return{op:"min",field:Vf(i,e),order:"ascending"};const{stack:o}=t,a=o?new Set([...o.groupbyFields,...o.stackBy.map((t=>t.fieldDef.field))]):void 0;if(ba(r)){return Lh(r,o&&!a.has(r.field))}if(ya(r)){const{encoding:e,order:n}=r,i=t.fieldDef(e),{aggregate:s,field:c}=i,l=o&&!a.has(c);if(Jn(s)||Gn(s))return Lh({field:Ga(i),order:n},l);if($n(s)||!s)return Lh({op:s,field:c,order:n},l)}else{if("descending"===r)return{op:"min",field:t.vgField(e),order:"descending"};if(st(["ascending",void 0],r))return!0}return}(n,i,t):void 0;if(Ra(o)){return Il(Rh([o.datum],a,s))}const u=o;if("unaggregated"===e){const t=n.requestDataName(Ql.Main),{field:e}=o;return Il([{data:t,field:Ga({field:e,aggregate:"min"})},{data:t,field:Ga({field:e,aggregate:"max"})}])}if(ti(u.bin)){if(so(t))return Il("bin-ordinal"===t?[]:[{data:wt(l)?n.requestDataName(Ql.Main):n.requestDataName(Ql.Raw),field:n.vgField(i,ds(u,i)?{binSuffix:"range"}:{}),sort:!0!==l&&(0,I.Kn)(l)?l:{field:n.vgField(i,{}),op:"min"}}]);{const{bin:t}=u;if(ti(t)){const e=Hd(n,u.field,t);return Il([new Nh((()=>{const t=n.getSignalName(e);return"[".concat(t,".start, ").concat(t,".stop]")}))])}return Il([{data:n.requestDataName(Ql.Main),field:n.vgField(i,{})}])}}if(u.timeUnit&&st(["time","utc"],t)&&Ma(u,fp(n)?n.encoding[Ve(i)]:void 0,n.markDef,n.config)){const t=n.requestDataName(Ql.Main);return Il([{data:t,field:n.vgField(i)},{data:t,field:n.vgField(i,{suffix:"end"})}])}return Il(l?[{data:wt(l)?n.requestDataName(Ql.Main):n.requestDataName(Ql.Raw),field:n.vgField(i),sort:l}]:[{data:n.requestDataName(Ql.Main),field:n.vgField(i)}])}function Lh(t,e){const{op:n,field:i,order:r}=t;return{op:null!==n&&void 0!==n?n:e?"sum":ma,...i?{field:Ft(i)}:{},...r?{order:r}:{}}}function jh(t,e){var n;const i=t.component.scales[e],r=t.specifiedScales[e].domain,o=null===(n=t.fieldDef(e))||void 0===n?void 0:n.bin,a=fo(r)&&r,s=ni(o)&&ii(o.extent)&&o.extent;(a||s)&&i.set("selectionExtent",null!==a&&void 0!==a?a:s,!0)}function Bh(t,e){const{aggregate:n,type:i}=t;return n?(0,I.HD)(n)&&!Zn.has(n)?{valid:!1,reason:er(n)}:"quantitative"===i&&"log"===e?{valid:!1,reason:nr(t)}:{valid:!0}:{valid:!1,reason:tr(t)}}function Uh(t,e,n,i){return t.explicit&&e.explicit&&dr(function(t,e,n,i){return"Conflicting ".concat(e.toString(),' property "').concat(t.toString(),'" (').concat(rt(n)," and ").concat(rt(i),"). Using the union of the two domains.")}(n,i,t.value,e.value)),{explicit:t.explicit,value:[...t.value,...e.value]}}function Ih(t){const e=dt(t.map((t=>{if(fi(t)){const{sort:e,...n}=t;return n}return t})),ot),n=dt(t.map((t=>{if(fi(t)){const e=t.sort;return void 0===e||wt(e)||("op"in e&&"count"===e.op&&delete e.field,"ascending"===e.order&&delete e.order),e}})).filter((t=>void 0!==t)),ot);if(0===e.length)return;if(1===e.length){const e=t[0];if(fi(e)&&n.length>0){let t=n[0];if(n.length>1){dr(or);const e=n.filter((t=>(0,I.Kn)(t)&&"op"in t&&"min"!==t.op));t=!n.every((t=>(0,I.Kn)(t)&&"op"in t))||1!==e.length||e[0]}else if((0,I.Kn)(t)&&"field"in t){const n=t.field;e.field===n&&(t=!t.order||{order:t.order})}return{...e,sort:t}}return e}const i=dt(n.map((t=>wt(t)||!("op"in t)||(0,I.HD)(t.op)&&t.op in Xn?t:(dr(function(t){return"Dropping sort property ".concat(rt(t),' as unioned domains only support boolean or op "count", "min", and "max".')}(t)),!0))),ot);let r;1===i.length?r=i[0]:i.length>1&&(dr(or),r=!0);const o=dt(t.map((t=>fi(t)?t.data:null)),(t=>t));if(1===o.length&&null!==o[0]){return{data:o[0],fields:e.map((t=>t.field)),...r?{sort:r}:{}}}return{fields:e,...r?{sort:r}:{}}}function qh(t){if(fi(t)&&(0,I.HD)(t.field))return t.field;if(function(t){return!(0,I.kJ)(t)&&"fields"in t&&!("data"in t)}(t)){let e;for(const n of t.fields)if(fi(n)&&(0,I.HD)(n.field))if(e){if(e!==n.field)return dr("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),e}else e=n.field;return dr("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),e}if(function(t){return!(0,I.kJ)(t)&&"fields"in t&&"data"in t}(t)){dr("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const e=t.fields[0];return(0,I.HD)(e)?e:void 0}}function Wh(t,e){const n=t.component.scales[e].get("domains").map((e=>(fi(e)&&(e.data=t.lookupDataSource(e.data)),e)));return Ih(n)}function Hh(t){return pp(t)||hp(t)?t.children.reduce(((t,e)=>t.concat(Hh(e))),Xh(t)):Xh(t)}function Xh(t){return bt(t.component.scales).reduce(((e,n)=>{const i=t.component.scales[n];if(i.merged)return e;const r=i.combine(),{name:o,type:a,selectionExtent:s,domains:c,range:l,reverse:u,...f}=r,d=function(t,e,n,i){if(xn(n)){if(ui(t))return{step:{signal:"".concat(e,"_step")}}}else if((0,I.Kn)(t)&&fi(t))return{...t,data:i.lookupDataSource(t.data)};return t}(r.range,o,n,t),h=Wh(t,n),p=s?function(t,e,n,i){const r=Rf(t,e.param,e);return{signal:co(n.get("type"))&&(0,I.kJ)(i)&&i[0]>i[1]?"isValid(".concat(r,") && reverse(").concat(r,")"):r}}(t,s,i,h):null;return e.push({name:o,type:a,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...void 0!==u?{reverse:u}:{},...f}),e}),[])}class Jh extends Bl{constructor(t,e){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",e)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||ct(this.get("domains"),(t=>(0,I.kJ)(t)&&2===t.length&&t[0]<=0&&t[1]>=0))}}const Gh=["range","scheme"];function $h(t,e){const n=t.fieldDef(e);if(null!==n&&void 0!==n&&n.bin){const{bin:i,field:r}=n,o=Ye(e),a=t.getName(o);if((0,I.Kn)(i)&&i.binned&&void 0!==i.step)return new Nh((()=>{const n=t.scaleName(e),r='(domain("'.concat(n,'")[1] - domain("').concat(n,'")[0]) / ').concat(i.step);return"".concat(t.getSignalName(a)," / (").concat(r,")")}));if(ti(i)){const e=Hd(t,r,i);return new Nh((()=>{const n=t.getSignalName(e),i="(".concat(n,".stop - ").concat(n,".start) / ").concat(n,".step");return"".concat(t.getSignalName(a)," / (").concat(i,")")}))}}}function Vh(t,e){const n=e.specifiedScales[t],{size:i}=e,r=e.getScaleComponent(t).get("type");for(const u of Gh)if(void 0!==n[u]){const i=wo(r,u),o=ko(t,u);if(i)if(o)dr(o);else switch(u){case"range":{const i=n.range;if((0,I.kJ)(i)){if(xn(t))return Ul(i.map((t=>{if("width"===t||"height"===t){const n=e.getName(t),i=e.getSignalName.bind(e);return Nh.fromName(i,n)}return t})))}else if((0,I.Kn)(i))return Ul({data:e.requestDataName(Ql.Main),field:i.field,sort:{op:"min",field:e.vgField(t)}});return Ul(i)}case"scheme":return Ul(Yh(n[u]))}else dr(ir(r,u,t))}const o=t===Xt||"xOffset"===t?"width":"height",a=i[o];if(bc(a))if(xn(t))if(so(r)){const n=Kh(a,e,t);if(n)return Ul({step:n})}else dr(rr(o));else if(Dn(t)){const n=t===Vt?"x":"y";if("band"===e.getScaleComponent(n).get("type")){const t=Zh(a,r);if(t)return Ul(t)}}const{rangeMin:s,rangeMax:c}=n,l=function(t,e){const{size:n,config:i,mark:r,encoding:o}=e,a=e.getSignalName.bind(e),{type:s}=is(o[t]),c=e.getScaleComponent(t),l=c.get("type"),{domain:u,domainMid:f}=e.specifiedScales[t];switch(t){case Xt:case Jt:{if(st(["point","band"],l)){const r=Qh(t,n,i.view);if(bc(r)){return{step:Kh(r,e,t)}}}const r=Ye(t),o=e.getName(r);return t===Jt&&co(l)?[Nh.fromName(a,o),0]:[0,Nh.fromName(a,o)]}case Vt:case Yt:return function(t,e,n){const i=t===Vt?"x":"y",r=e.getScaleComponent(i),o=r.get("type"),a=e.scaleName(i);if("band"===o){const t=Qh(i,e.size,e.config.view);if(bc(t)){const e=Zh(t,n);if(e)return e}return[0,{signal:"bandwidth('".concat(a,"')")}]}{const n=e.encoding[i];if(Ta(n)&&n.timeUnit){const t=Cr(n.timeUnit,(t=>"scale('".concat(a,"', ").concat(t,")"))),i=e.config.scale.bandWithNestedOffsetPaddingInner;if(i){const e=li(i)?"".concat(i.signal,"/2"):"".concat(i/2),n=li(i)?"(1 - ".concat(i.signal,"/2)"):"".concat(1-i/2);return[{signal:"".concat(e," * (").concat(t,")")},{signal:"".concat(n," * (").concat(t,")")}]}return[0,{signal:t}]}return et("Cannot use ".concat(t," scale if ").concat(i," scale is not discrete."))}}(t,e,l);case le:{const o=tp(r,e.component.scales[t].get("zero"),i),a=function(t,e,n,i){const r={x:$h(n,"x"),y:$h(n,"y")};switch(t){case"bar":case"tick":{if(void 0!==i.scale.maxBandSize)return i.scale.maxBandSize;const t=np(e,r,i.view);return(0,I.hj)(t)?t-1:new Nh((()=>"".concat(t.signal," - 1")))}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const t=np(e,r,i.view);return(0,I.hj)(t)?Math.pow(ep*t,2):new Nh((()=>"pow(".concat(ep," * ").concat(t.signal,", 2)")))}}throw new Error(Vi("size",t))}(r,n,e,i);return uo(l)?function(t,e,n){const i=()=>{const i=xi(e),r=xi(t),o="(".concat(i," - ").concat(r,") / (").concat(n," - 1)");return"sequence(".concat(r,", ").concat(i," + ").concat(o,", ").concat(o,")")};return li(e)?new Nh(i):{signal:i()}}(o,a,function(t,e,n,i){switch(t){case"quantile":return e.scale.quantileCount;case"quantize":return e.scale.quantizeCount;case"threshold":return void 0!==n&&(0,I.kJ)(n)?n.length+1:(dr(function(t){return"Domain for ".concat(t," is required for threshold scale.")}(i)),3)}}(l,i,u,t)):[o,a]}case Qt:return[0,2*Math.PI];case ue:return[0,360];case Kt:return[0,new Nh((()=>{const t=e.getSignalName("width"),n=e.getSignalName("height");return"min(".concat(t,",").concat(n,")/2")}))];case pe:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case me:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case ce:return"symbol";case oe:case ae:case se:return"ordinal"===l?"nominal"===s?"category":"ordinal":void 0!==f?"diverging":"rect"===r||"geoshape"===r?"heatmap":"ramp";case fe:case de:case he:return[i.scale.minOpacity,i.scale.maxOpacity]}}(t,e);return(void 0!==s||void 0!==c)&&wo(r,"rangeMin")&&(0,I.kJ)(l)&&2===l.length?Ul([null!==s&&void 0!==s?s:l[0],null!==c&&void 0!==c?c:l[1]]):Il(l)}function Yh(t){return function(t){return!(0,I.HD)(t)&&!!t.name}(t)?{scheme:t.name,...it(t,["name"])}:{scheme:t}}function Kh(t,e,n){const{encoding:i}=e,r=e.getScaleComponent(n),o=Ze(n),a=i[o];if("offset"===yc({step:t,offsetIsDiscrete:Ba(a)&&Hr(a.type)})&&Es(i,o)){var s;const n=e.getScaleComponent(o),i=e.scaleName(o);let a="domain('".concat(i,"').length");if("band"===n.get("type")){var c,l,u,f;const t=null!==(c=null!==(l=n.get("paddingInner"))&&void 0!==l?l:n.get("padding"))&&void 0!==c?c:0,e=null!==(u=null!==(f=n.get("paddingOuter"))&&void 0!==f?f:n.get("padding"))&&void 0!==u?u:0;a="bandspace(".concat(a,", ").concat(t,", ").concat(e,")")}const h=null!==(s=r.get("paddingInner"))&&void 0!==s?s:r.get("padding");return{signal:"".concat(t.step," * ").concat(a," / (1-").concat((d=h,li(d)?d.signal:(0,I.m8)(d)),")")}}return t.step;var d}function Zh(t,e){if("offset"===yc({step:t,offsetIsDiscrete:so(e)}))return{step:t.step}}function Qh(t,e,n){const i=t===Xt?"width":"height",r=e[i];return r||Ec(n,i)}function tp(t,e,n){if(e)return li(e)?{signal:"".concat(e.signal," ? 0 : ").concat(tp(t,!1,n))}:0;switch(t){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(Vi("size",t))}const ep=.95;function np(t,e,n){const i=bc(t.width)?t.width.step:kc(n,"width"),r=bc(t.height)?t.height.step:kc(n,"height");return e.x||e.y?new Nh((()=>{const t=[e.x?e.x.signal:i,e.y?e.y.signal:r];return"min(".concat(t.join(", "),")")})):Math.min(i,r)}function ip(t,e){fp(t)?function(t,e){const n=t.component.scales,{config:i,encoding:r,markDef:o,specifiedScales:a}=t;for(const s of bt(n)){const c=a[s],l=n[s],u=t.getScaleComponent(s),f=is(r[s]),d=c[e],h=u.get("type"),p=u.get("padding"),m=u.get("paddingInner"),g=wo(h,e),v=ko(s,e);if(void 0!==d&&(g?v&&dr(v):dr(ir(h,e,s))),g&&void 0===v)if(void 0!==d){const t=f.timeUnit,n=f.type;switch(e){case"domainMax":case"domainMin":hr(c[e])||"temporal"===n||t?l.set(e,{signal:us(c[e],{type:n,timeUnit:t})},!0):l.set(e,c[e],!0);break;default:l.copyKeyFromObject(e,c)}}else{const n=e in rp?rp[e]({model:t,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:m,domain:c.domain,domainMin:c.domainMin,domainMax:c.domainMax,markDef:o,config:i,hasNestedOffsetScale:Ds(r,s),hasSecondaryRangeChannel:!!r[Ve(s)]}):i.scale[e];void 0!==n&&l.set(e,n,!1)}}}(t,e):ap(t,e)}const rp={bins:t=>{let{model:e,fieldOrDatumDef:n}=t;return Ta(n)?function(t,e){const n=e.bin;if(ti(n)){const i=Hd(t,e.field,n);return new Nh((()=>t.getSignalName(i)))}if(ei(n)&&ni(n)&&void 0!==n.step)return{step:n.step};return}(e,n):void 0},interpolate:t=>{let{channel:e,fieldOrDatumDef:n}=t;return function(t,e){if(st([oe,ae,se],t)&&"nominal"!==e)return"hcl";return}(e,n.type)},nice:t=>{let{scaleType:e,channel:n,domain:i,domainMin:r,domainMax:o,fieldOrDatumDef:a}=t;return function(t,e,n,i,r,o){var a;if(null!==(a=ns(o))&&void 0!==a&&a.bin||(0,I.kJ)(n)||null!=r||null!=i||st([Yr.TIME,Yr.UTC],t))return;return!!xn(e)||void 0}(e,n,i,r,o,a)},padding:t=>{let{channel:e,scaleType:n,fieldOrDatumDef:i,markDef:r,config:o}=t;return function(t,e,n,i,r,o){if(xn(t)){if(lo(e)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:e,orient:a}=r;if("bar"===e&&(!Ta(i)||!i.bin&&!i.timeUnit)&&("vertical"===a&&"x"===t||"horizontal"===a&&"y"===t))return o.continuousBandSize}if(e===Yr.POINT)return n.pointPadding}return}(e,n,o.scale,i,r,o.bar)},paddingInner:t=>{let{scalePadding:e,channel:n,markDef:i,scaleType:r,config:o,hasNestedOffsetScale:a}=t;return function(t,e,n,i,r){let o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(void 0!==t)return;if(xn(e)){const{bandPaddingInner:t,barBandPaddingInner:e,rectBandPaddingInner:i,bandWithNestedOffsetPaddingInner:a}=r;return o?a:zt(t,"bar"===n?e:i)}if(Dn(e)&&i===Yr.BAND)return r.offsetBandPaddingInner;return}(e,n,i.type,r,o.scale,a)},paddingOuter:t=>{let{scalePadding:e,channel:n,scaleType:i,scalePaddingInner:r,config:o,hasNestedOffsetScale:a}=t;return function(t,e,n,i,r){let o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(void 0!==t)return;if(xn(e)){const{bandPaddingOuter:t,bandWithNestedOffsetPaddingOuter:e}=r;if(o)return e;if(n===Yr.BAND)return zt(t,li(i)?{signal:"".concat(i.signal,"/2")}:i/2)}else if(Dn(e)){if(n===Yr.POINT)return.5;if(n===Yr.BAND)return r.offsetBandPaddingOuter}return}(e,n,i,r,o.scale,a)},reverse:t=>{let{fieldOrDatumDef:e,scaleType:n,channel:i,config:r}=t;return function(t,e,n,i){if("x"===n&&void 0!==i.xReverse)return co(t)&&"descending"===e?li(i.xReverse)?{signal:"!".concat(i.xReverse.signal)}:!i.xReverse:i.xReverse;if(co(t)&&"descending"===e)return!0;return}(n,Ta(e)?e.sort:void 0,i,r.scale)},zero:t=>{let{channel:e,fieldOrDatumDef:n,domain:i,markDef:r,scaleType:o,config:a,hasSecondaryRangeChannel:s}=t;return function(t,e,n,i,r,o,a){if(n&&"unaggregated"!==n&&co(r)){if((0,I.kJ)(n)){const t=n[0],e=n[n.length-1];if(t<=0&&e>=0)return!0}return!1}if("size"===t&&"quantitative"===e.type&&!uo(r))return!0;if((!Ta(e)||!e.bin)&&st([...bn,...wn],t)){const{orient:e,type:n}=i;return(!st(["bar","area","line","trail"],n)||!("horizontal"===e&&"y"===t||"vertical"===e&&"x"===t))&&(!(!st(["bar","area"],n)||a)||(null===o||void 0===o?void 0:o.zero))}return!1}(e,n,i,r,o,a.scale,s)}};function op(t){fp(t)?function(t){const e=t.component.scales;for(const n of Ln){const i=e[n];if(!i)continue;const r=Vh(n,t);i.setWithExplicit("range",r)}}(t):ap(t,"range")}function ap(t,e){const n=t.component.scales;for(const i of t.children)"range"===e?op(i):ip(i,e);for(const i of bt(n)){let r;for(const n of t.children){const t=n.component.scales[i];if(t){r=Hl(r,t.getWithExplicit(e),e,"scale",ql(((t,n)=>"range"===e&&t.step&&n.step?t.step-n.step:0)))}}n[i].setWithExplicit(e,r)}}function sp(t,e,n,i){const r=function(t,e,n,i){switch(e.type){case"nominal":case"ordinal":var r;if(Oe(t)||"discrete"===Wn(t))return"shape"===t&&"ordinal"===e.type&&dr(Qi(t,"ordinal")),"ordinal";if(xn(t)||Dn(t)){if(st(["rect","bar","image","rule"],n.type))return"band";if(i)return"band"}else if("arc"===n.type&&t in _n)return"band";return Jo(n[Ye(t)])||Wa(e)&&null!==(r=e.axis)&&void 0!==r&&r.tickBand?"band":"point";case"temporal":return Oe(t)?"time":"discrete"===Wn(t)?(dr(Qi(t,"temporal")),"ordinal"):Ta(e)&&e.timeUnit&&Mr(e.timeUnit).utc?"utc":"time";case"quantitative":return Oe(t)?Ta(e)&&ti(e.bin)?"bin-ordinal":"linear":"discrete"===Wn(t)?(dr(Qi(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Ji(e.type))}(e,n,i,arguments.length>4&&void 0!==arguments[4]&&arguments[4]),{type:o}=t;return jn(e)?void 0!==o?function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!jn(t))return!1;switch(t){case Xt:case Jt:case Vt:case Yt:case Qt:case Kt:return!!lo(e)||"band"===e||"point"===e&&!n;case le:case pe:case fe:case de:case he:case ue:return lo(e)||uo(e)||st(["band","point","ordinal"],e);case oe:case ae:case se:return"band"!==e;case me:case ce:return"ordinal"===e||uo(e)}}(e,o)?Ta(n)&&(a=o,s=n.type,!(st([Jr,$r],s)?void 0===a||so(a):s===Gr?st([Yr.TIME,Yr.UTC,void 0],a):s!==Xr||io(a)||uo(a)||void 0===a))?(dr(function(t,e){return'FieldDef does not work with "'.concat(t,'" scale. We are using "').concat(e,'" scale instead.')}(o,r)),r):o:(dr(function(t,e,n){return'Channel "'.concat(t,'" does not work with "').concat(e,'" scale. We are using "').concat(n,'" scale instead.')}(e,o,r)),r):r:null;var a,s}function cp(t){fp(t)?t.component.scales=function(t){const{encoding:e,mark:n,markDef:i}=t,r={};for(const a of Ln){const s=is(e[a]);if(s&&n===jo&&a===ce&&s.type===Vr)continue;let c=s&&s.scale;if(Dn(a)){if(!Ds(e,Qe(a))){c&&dr(Yi(a));continue}}if(s&&null!==c&&!1!==c){var o;null!==(o=c)&&void 0!==o||(c={});const n=sp(c,a,s,i,Ds(e,a));r[a]=new Jh(t.scaleName("".concat(a),!0),{value:n,explicit:c.type===n})}}return r}(t):t.component.scales=function(t){var e;const n=t.component.scales={},i={},r=t.component.resolve;for(const a of t.children){cp(a);for(const n of bt(a.component.scales)){var o;if(null!==(o=(e=r.scale)[n])&&void 0!==o||(e[n]=vd(n,t)),"shared"===r.scale[n]){const t=i[n],e=a.component.scales[n].getWithExplicit("type");t?Zr(t.value,e.value)?i[n]=Hl(t,e,"type","scale",lp):(r.scale[n]="independent",delete i[n]):i[n]=e}}}for(const a of bt(i)){const e=t.scaleName(a,!0),r=i[a];n[a]=new Jh(e,r);for(const n of t.children){const t=n.component.scales[a];t&&(n.renameScale(t.get("name"),e),t.merged=!0)}}return n}(t)}const lp=ql(((t,e)=>to(t)-to(e)));class up{constructor(){this.nameMap={}}rename(t,e){this.nameMap[t]=e}has(t){return void 0!==this.nameMap[t]}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function fp(t){return"unit"===(null===t||void 0===t?void 0:t.type)}function dp(t){return"facet"===(null===t||void 0===t?void 0:t.type)}function hp(t){return"concat"===(null===t||void 0===t?void 0:t.type)}function pp(t){return"layer"===(null===t||void 0===t?void 0:t.type)}class mp{constructor(t,e,n,i,r,o,a){var s,c;this.type=e,this.parent=n,this.config=r,this.correctDataNames=t=>{var e,n,i;return null!==(e=t.from)&&void 0!==e&&e.data&&(t.from.data=this.lookupDataSource(t.from.data)),null!==(n=t.from)&&void 0!==n&&null!==(i=n.facet)&&void 0!==i&&i.data&&(t.from.facet.data=this.lookupDataSource(t.from.facet.data)),t},this.parent=n,this.config=r,this.view=ai(a),this.name=null!==(s=t.name)&&void 0!==s?s:i,this.title=ci(t.title)?{text:t.title}:t.title?ai(t.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new up,this.projectionNameMap=n?n.projectionNameMap:new up,this.signalNameMap=n?n.signalNameMap:new up,this.data=t.data,this.description=t.description,this.transforms=(null!==(c=t.transform)&&void 0!==c?c:[]).map((t=>sl(t)?{filter:Z(t.filter,Ir)}:t)),this.layout="layer"===e||"unit"===e?{}:function(t,e,n){const i=n[e],r={},{spacing:o,columns:a}=i;void 0!==o&&(r.spacing=o),void 0!==a&&(ka(t)&&!_a(t.facet)||mc(t))&&(r.columns=a),gc(t)&&(r.columns=1);for(const l of _c)if(void 0!==t[l])if("spacing"===l){var s,c;const e=t[l];r[l]=(0,I.hj)(e)?e:{row:null!==(s=e.row)&&void 0!==s?s:o,column:null!==(c=e.column)&&void 0!==c?c:o}}else r[l]=t[l];return r}(t,e,r),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:ka(t)||(null===n||void 0===n?void 0:n.component.data.isFaceted)&&void 0===t.data},layoutSize:new Bl,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?tt(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(t){let{ignoreRange:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};cp(t),Th(t);for(const n of _o)ip(t,n);e||op(t)}(this)}parseProjection(){Id(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){Od(this)}assembleEncodeFromView(t){const{style:e,...n}=t,i={};for(const r of bt(n)){const t=n[r];void 0!==t&&(i[r]=yi(t))}return i}assembleGroupEncodeEntry(t){let e={};var n;if((this.view&&(e=this.assembleEncodeFromView(this.view)),!t)&&(this.description&&(e.description=yi(this.description)),"unit"===this.type||"layer"===this.type))return{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...null!==(n=e)&&void 0!==n?n:{}};return yt(e)?void 0:e}assembleLayout(){if(!this.layout)return;const{spacing:t,...e}=this.layout,{component:n,config:i}=this,r=function(t,e){const n={};for(const i of Te){const r=t[i];if(null!==r&&void 0!==r&&r.facetFieldDef){const{titleAnchor:t,titleOrient:o}=Zf(["titleAnchor","titleOrient"],r.facetFieldDef.header,e,i),a=Yf(i,o),s=ld(t,a);void 0!==s&&(n[a]=s)}}return yt(n)?void 0:n}(n.layoutHeaders,i);return{padding:t,...this.assembleDefaultLayout(),...e,...r?{titleBand:r}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let e=[];for(const n of Te)t[n].title&&e.push(ed(this,n));for(const n of Qf)e=e.concat(rd(this,n));return e}assembleAxes(){return function(t,e){const{x:n=[],y:i=[]}=t;return[...n.map((t=>jf(t,"grid",e))),...i.map((t=>jf(t,"grid",e))),...n.map((t=>jf(t,"main",e))),...i.map((t=>jf(t,"main",e)))].filter((t=>t))}(this.component.axes,this.config)}assembleLegends(){return Pd(this)}assembleProjections(){return Ld(this)}assembleTitle(){var t;const{encoding:e,...n}=null!==(t=this.title)&&void 0!==t?t:{},i={...si(this.config.title).nonMarkTitleProperties,...n,...e?{encode:{update:e}}:{}};if(i.text){var r,o;if(st(["unit","layer"],this.type)){if(st(["middle",void 0],i.anchor))null!==(r=i.frame)&&void 0!==r||(i.frame="group")}else null!==(o=i.anchor)&&void 0!==o||(i.anchor="start");return yt(i)?void 0:i}}assembleGroup(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e={};t=t.concat(this.assembleSignals()),t.length>0&&(e.signals=t);const n=this.assembleLayout();n&&(e.layout=n),e.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||dp(this.parent)?Hh(this):[];i.length>0&&(e.scales=i);const r=this.assembleAxes();r.length>0&&(e.axes=r);const o=this.assembleLegends();return o.length>0&&(e.legends=o),e}getName(t){return kt((this.name?"".concat(this.name,"_"):"")+t)}getDataName(t){return this.getName(Ql[t].toLowerCase())}requestDataName(t){const e=this.getDataName(t),n=this.component.data.outputNodeRefCounts;return n[e]=(n[e]||0)+1,e}getSizeSignalRef(t){if(dp(this.parent)){const e=kn(md(t)),n=this.component.scales[e];if(n&&!n.merged){const t=n.get("type"),i=n.get("range");if(so(t)&&ui(i)){const t=n.get("name"),i=qh(Wh(this,e));if(i){return{signal:pd(t,n,Ga({aggregate:"distinct",field:i},{expr:"datum"}))}}return dr(Pi(e)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const e=this.component.data.outputNodes[t];return e?e.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,e){this.signalNameMap.rename(t,e)}renameScale(t,e){this.scaleNameMap.rename(t,e)}renameProjection(t,e){this.projectionNameMap.rename(t,e)}scaleName(t,e){return e?this.getName(t):He(t)&&jn(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t))?this.scaleNameMap.get(this.getName(t)):void 0}projectionName(t){return t?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const e=this.component.scales[t];return e&&!e.merged?e:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,e){let n=this.component.selection[t];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(t,e)),!n)throw new Error('Cannot find a selection named "'.concat(e,'".'));return n}hasAxisOrientSignalRef(){var t,e;return(null===(t=this.component.axes.x)||void 0===t?void 0:t.some((t=>t.hasOrientSignalRef())))||(null===(e=this.component.axes.y)||void 0===e?void 0:e.some((t=>t.hasOrientSignalRef())))}}class gp extends mp{vgField(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.fieldDef(t);if(n)return Ga(n,e)}reduceFieldDef(t,e){return function(t,e,n,i){return t?bt(t).reduce(((n,r)=>{const o=t[r];return(0,I.kJ)(o)?o.reduce(((t,n)=>e.call(i,t,n,r)),n):e.call(i,n,o,r)}),n):n}(this.getMapping(),((e,n,i)=>{const r=ns(n);return r?t(e,r,i):e}),e)}forEachFieldDef(t,e){Fs(this.getMapping(),((e,n)=>{const i=ns(e);i&&t(i,n)}),e)}}class vp extends su{clone(){return new vp(null,tt(this.transform))}constructor(t,e){var n,i,r;super(t),this.transform=e,this.transform=tt(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:"value",null!==(r=o[1])&&void 0!==r?r:"density"],e.groupby&&null==e.minsteps&&null==e.maxsteps&&null==e.steps&&(this.transform.steps=200)}dependentFields(){var t;return new Set([this.transform.density,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"DensityTransform ".concat(ot(this.transform))}assemble(){const{density:t,...e}=this.transform;return{type:"kde",field:t,...e}}}class yp extends su{clone(){return new yp(null,{...this.filter})}constructor(t,e){super(t),this.filter=e}static make(t,e){const{config:n,mark:i,markDef:r}=e;if("filter"!==ki("invalid",r,n))return null;const o=e.reduceFieldDef(((t,n,r)=>{const o=jn(r)&&e.getScaleComponent(r);if(o){co(o.get("type"))&&"count"!==n.aggregate&&!Bo(i)&&(t[n.field]=n)}return t}),{});return bt(o).length?new yp(t,o):null}dependentFields(){return new Set(bt(this.filter))}producedFields(){return new Set}hash(){return"FilterInvalid ".concat(ot(this.filter))}assemble(){const t=bt(this.filter).reduce(((t,e)=>{const n=this.filter[e],i=Ga(n,{expr:"datum"});return null!==n&&("temporal"===n.type?t.push("(isDate(".concat(i,") || (isValid(").concat(i,") && isFinite(+").concat(i,")))")):"quantitative"===n.type&&(t.push("isValid(".concat(i,")")),t.push("isFinite(+".concat(i,")")))),t}),[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class bp extends su{clone(){return new bp(this.parent,tt(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=tt(e);const{flatten:n,as:i=[]}=this.transform;this.transform.as=n.map(((t,e)=>{var n;return null!==(n=i[e])&&void 0!==n?n:t}))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return"FlattenTransform ".concat(ot(this.transform))}assemble(){const{flatten:t,as:e}=this.transform;return{type:"flatten",fields:t,as:e}}}class xp extends su{clone(){return new xp(null,tt(this.transform))}constructor(t,e){var n,i,r;super(t),this.transform=e,this.transform=tt(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:"key",null!==(r=o[1])&&void 0!==r?r:"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return"FoldTransform ".concat(ot(this.transform))}assemble(){const{fold:t,as:e}=this.transform;return{type:"fold",fields:t,as:e}}}class _p extends su{clone(){return new _p(null,tt(this.fields),this.geojson,this.signal)}static parseAll(t,e){if(e.component.projection&&!e.component.projection.isFit)return t;let n=0;for(const i of[[ne,ee],[re,ie]]){const r=i.map((t=>{const n=is(e.encoding[t]);return Ta(n)?n.field:Ra(n)?{expr:"".concat(n.datum)}:Ia(n)?{expr:"".concat(n.value)}:void 0}));(r[0]||r[1])&&(t=new _p(t,r,null,e.getName("geojson_".concat(n++))))}if(e.channelHasField(ce)){const i=e.typedFieldDef(ce);i.type===Vr&&(t=new _p(t,null,i.field,e.getName("geojson_".concat(n++))))}return t}constructor(t,e,n,i){super(t),this.fields=e,this.geojson=n,this.signal=i}dependentFields(){var t;const e=(null!==(t=this.fields)&&void 0!==t?t:[]).filter(I.HD);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return"GeoJSON ".concat(this.geojson," ").concat(this.signal," ").concat(ot(this.fields))}assemble(){return[...this.geojson?[{type:"filter",expr:'isValid(datum["'.concat(this.geojson,'"])')}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class wp extends su{clone(){return new wp(null,this.projection,tt(this.fields),tt(this.as))}constructor(t,e,n,i){super(t),this.projection=e,this.fields=n,this.as=i}static parseAll(t,e){if(!e.projectionName())return t;for(const n of[[ne,ee],[re,ie]]){const i=n.map((t=>{const n=is(e.encoding[t]);return Ta(n)?n.field:Ra(n)?{expr:"".concat(n.datum)}:Ia(n)?{expr:"".concat(n.value)}:void 0})),r=n[0]===re?"2":"";(i[0]||i[1])&&(t=new wp(t,e.projectionName(),i,[e.getName("x".concat(r)),e.getName("y".concat(r))]))}return t}dependentFields(){return new Set(this.fields.filter(I.HD))}producedFields(){return new Set(this.as)}hash(){return"Geopoint ".concat(this.projection," ").concat(ot(this.fields)," ").concat(ot(this.as))}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class kp extends su{clone(){return new kp(null,tt(this.transform))}constructor(t,e){super(t),this.transform=e}dependentFields(){var t;return new Set([this.transform.impute,this.transform.key,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:e=0,stop:n,step:i}=t,r=[e,n,...i?[i]:[]].join(",");return{signal:"sequence(".concat(r,")")}}static makeFromTransform(t,e){return new kp(t,e)}static makeFromEncoding(t,e){const n=e.encoding,i=n.x,r=n.y;if(Ta(i)&&Ta(r)){const o=i.impute?i:r.impute?r:void 0;if(void 0===o)return;const a=i.impute?r:r.impute?i:void 0,{method:s,value:c,frame:l,keyvals:u}=o.impute,f=Os(e.mark,n);return new kp(t,{impute:o.field,key:a.field,...s?{method:s}:{},...void 0!==c?{value:c}:{},...l?{frame:l}:{},...void 0!==u?{keyvals:u}:{},...f.length?{groupby:f}:{}})}return null}hash(){return"Impute ".concat(ot(this.transform))}assemble(){const{impute:t,key:e,keyvals:n,method:i,groupby:r,value:o,frame:a=[null,null]}=this.transform,s={type:"impute",field:t,key:e,...n?{keyvals:cl(n)?this.processSequence(n):n}:{},method:"value",...r?{groupby:r}:{},value:i&&"value"!==i?null:o};if(i&&"value"!==i){return[s,{type:"window",as:["imputed_".concat(t,"_value")],ops:[i],fields:[t],frame:a,ignorePeers:!1,...r?{groupby:r}:{}},{type:"formula",expr:"datum.".concat(t," === null ? datum.imputed_").concat(t,"_value : datum.").concat(t),as:t}]}return[s]}}class Ep extends su{clone(){return new Ep(null,tt(this.transform))}constructor(t,e){var n,i,r;super(t),this.transform=e,this.transform=tt(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:e.on,null!==(r=o[1])&&void 0!==r?r:e.loess]}dependentFields(){var t;return new Set([this.transform.loess,this.transform.on,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"LoessTransform ".concat(ot(this.transform))}assemble(){const{loess:t,on:e,...n}=this.transform;return{type:"loess",x:e,y:t,...n}}}class Dp extends su{clone(){return new Dp(null,tt(this.transform),this.secondary)}constructor(t,e,n){super(t),this.transform=e,this.secondary=n}static make(t,e,n,i){const r=e.component.data.sources,{from:o}=n;let a=null;if(function(t){return"data"in t}(o)){let t=Up(o.data,r);t||(t=new ih(o.data),r.push(t));const n=e.getName("lookup_".concat(i));a=new cu(t,n,Ql.Lookup,e.component.data.outputNodeRefCounts),e.component.data.outputNodes[n]=a}else if(function(t){return"param"in t}(o)){const t=o.param;let i;n={as:t,...n};try{i=e.getSelectionComponent(kt(t),t)}catch(s){throw new Error('Lookups can only be performed on selection parameters. "'.concat(t,'" is a variable parameter.'))}if(a=i.materialized,!a)throw new Error(function(t){return'Cannot define and lookup the "'.concat(t,'" selection in the same view. ')+"Try moving the lookup into a second, layered view?"}(t))}return new Dp(t,n,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?(0,I.IX)(this.transform.as):this.transform.from.fields)}hash(){return"Lookup ".concat(ot({transform:this.transform,secondary:this.secondary}))}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:(0,I.IX)(this.transform.as)}:{}};else{let e=this.transform.as;(0,I.HD)(e)||(dr('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.'),e="_lookup"),t={as:[e]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class Ap extends su{clone(){return new Ap(null,tt(this.transform))}constructor(t,e){var n,i,r;super(t),this.transform=e,this.transform=tt(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:"prob",null!==(r=o[1])&&void 0!==r?r:"value"]}dependentFields(){var t;return new Set([this.transform.quantile,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"QuantileTransform ".concat(ot(this.transform))}assemble(){const{quantile:t,...e}=this.transform;return{type:"quantile",field:t,...e}}}class Sp extends su{clone(){return new Sp(null,tt(this.transform))}constructor(t,e){var n,i,r;super(t),this.transform=e,this.transform=tt(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:e.on,null!==(r=o[1])&&void 0!==r?r:e.regression]}dependentFields(){var t;return new Set([this.transform.regression,this.transform.on,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"RegressionTransform ".concat(ot(this.transform))}assemble(){const{regression:t,on:e,...n}=this.transform;return{type:"regression",x:e,y:t,...n}}}class Mp extends su{clone(){return new Mp(null,tt(this.transform))}constructor(t,e){super(t),this.transform=e}addDimensions(t){var e;this.transform.groupby=dt((null!==(e=this.transform.groupby)&&void 0!==e?e:[]).concat(t),(t=>t))}producedFields(){}dependentFields(){var t;return new Set([this.transform.pivot,this.transform.value,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}hash(){return"PivotTransform ".concat(ot(this.transform))}assemble(){const{pivot:t,value:e,groupby:n,limit:i,op:r}=this.transform;return{type:"pivot",field:t,value:e,...void 0!==i?{limit:i}:{},...void 0!==r?{op:r}:{},...void 0!==n?{groupby:n}:{}}}}class Cp extends su{clone(){return new Cp(null,tt(this.transform))}constructor(t,e){super(t),this.transform=e}dependentFields(){return new Set}producedFields(){return new Set}hash(){return"SampleTransform ".concat(ot(this.transform))}assemble(){return{type:"sample",size:this.transform.sample}}}function Fp(t){let e=0;return function n(i,r){if(i instanceof ih&&!i.isGenerator&&!Jl(i.data)){t.push(r);r={name:null,source:r.name,transform:[]}}var o;if(i instanceof Qd&&(i.parent instanceof ih&&!r.source?(r.format={...null!==(o=r.format)&&void 0!==o?o:{},parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Vd)return r.name||(r.name="data_".concat(e++)),!r.source||r.transform.length>0?(t.push(r),i.data=r.name):i.data=r.source,void t.push(...i.assemble());if((i instanceof eh||i instanceof nh||i instanceof yp||i instanceof Tf||i instanceof $f||i instanceof wp||i instanceof $d||i instanceof Dp||i instanceof Eh||i instanceof wh||i instanceof xp||i instanceof bp||i instanceof vp||i instanceof Ep||i instanceof Ap||i instanceof Sp||i instanceof th||i instanceof Cp||i instanceof Mp)&&r.transform.push(i.assemble()),(i instanceof Jd||i instanceof lu||i instanceof kp||i instanceof kh||i instanceof _p)&&r.transform.push(...i.assemble()),i instanceof cu)if(r.source&&0===r.transform.length)i.setSource(r.source);else if(i.parent instanceof cu)i.setSource(r.name);else if(r.name||(r.name="data_".concat(e++)),i.setSource(r.name),1===i.numChildren()){t.push(r);r={name:null,source:r.name,transform:[]}}switch(i.numChildren()){case 0:i instanceof cu&&(!r.source||r.transform.length>0)&&t.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name="data_".concat(e++));let o=r.name;!r.source||r.transform.length>0?t.push(r):o=r.source;for(const t of i.children){n(t,{name:null,source:o,transform:[]})}break}}}}function Op(t){return"top"===t||"left"===t||li(t)?"header":"footer"}function Np(t,e){const{facet:n,config:i,child:r,component:o}=t;if(t.channelHasField(e)){var a;const s=n[e],c=Kf("title",null,i,e);let l=Za(s,i,{allowDisabling:!0,includeDefault:void 0===c||!!c});r.component.layoutHeaders[e].title&&(l=(0,I.kJ)(l)?l.join(", "):l,l+=" / ".concat(r.component.layoutHeaders[e].title),r.component.layoutHeaders[e].title=null);const u=Kf("labelOrient",s.header,i,e),f=null!==s.header&&zt(null===(a=s.header)||void 0===a?void 0:a.labels,i.header.labels,!0),d=st(["bottom","right"],u)?"footer":"header";o.layoutHeaders[e]={title:null!==s.header?l:null,facetFieldDef:s,[d]:"facet"===e?[]:[Tp(t,e,f)]}}}function Tp(t,e,n){const i="row"===e?"height":"width";return{labels:n,sizeSignal:t.child.component.layoutSize.get(i)?t.child.getSizeSignalRef(i):void 0,axes:[]}}function zp(t,e){const{child:n}=t;if(n.component.axes[e]){const{layoutHeaders:r,resolve:o}=t.component;if(o.axis[e]=yd(o,e),"shared"===o.axis[e]){const o="x"===e?"column":"row",a=r[o];for(const r of n.component.axes[e]){var i;const e=Op(r.get("orient"));null!==(i=a[e])&&void 0!==i||(a[e]=[Tp(t,o,!1)]);const n=jf(r,"main",t.config,{header:!0});n&&a[e][0].axes.push(n),r.mainExtracted=!0}}}}function Rp(t){for(const e of t.children)e.parseLayoutSize()}function Pp(t,e){const n=md(e),i=kn(n),r=t.component.resolve,o=t.component.layoutSize;let a;for(const c of t.children){var s;const e=c.component.layoutSize.getWithExplicit(n),o=null!==(s=r.scale[i])&&void 0!==s?s:vd(i,t);if("independent"===o&&"step"===e.value){a=void 0;break}if(a){if("independent"===o&&a.value!==e.value){a=void 0;break}a=Hl(a,e,n,"")}else a=e}if(a){for(const i of t.children)t.renameSignal(i.getName(n),t.getName(e)),i.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(e,a)}else o.setWithExplicit(e,{explicit:!1,value:void 0})}function Lp(t,e){const n="width"===e?"x":"y",i=t.config,r=t.getScaleComponent(n);if(r){const t=r.get("type"),n=r.get("range");if(so(t)){const t=Ec(i.view,e);return ui(n)||bc(t)?"step":t}return wc(i.view,e)}if(t.hasProjection||"arc"===t.mark)return wc(i.view,e);{const t=Ec(i.view,e);return bc(t)?t.step:t}}function jp(t,e,n){return Ga(e,{suffix:"by_".concat(Ga(t)),...null!==n&&void 0!==n?n:{}})}class Bp extends gp{constructor(t,e,n,i){super(t,"facet",e,n,i,t.resolve),this.child=hm(t.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!_a(t))return{facet:this.initFacetFieldDef(t,"facet")};const e=bt(t),n={};for(const i of e){if(![qt,Wt].includes(i)){dr(Vi(i,"facet"));break}const e=t[i];if(void 0===e.field){dr($i(e,i));break}n[i]=this.initFacetFieldDef(e,i)}return n}initFacetFieldDef(t,e){const n=as(t,e);return n.header?n.header=ai(n.header):null===n.header&&(n.header=null),n}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=Ip(this),this.child.parseData()}parseLayoutSize(){Rp(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(t){for(const e of Te)Np(t,e);zp(t,"x"),zp(t,"y")}(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const r of Te)for(const o of td){const a=this.component.layoutHeaders[r],s=a[o],{facetFieldDef:c}=a;if(c){const n=Kf("titleOrient",c.header,this.config,r);if(["right","bottom"].includes(n)){var e;const i=Yf(r,n);null!==(e=t.titleAnchor)&&void 0!==e||(t.titleAnchor={}),t.titleAnchor[i]="end"}}if(null!==s&&void 0!==s&&s[0]){const e="row"===r?"height":"width",s="header"===o?"headerBand":"footerBand";var n,i;if("facet"!==r&&!this.child.component.layoutSize.get(e))null!==(n=t[s])&&void 0!==n||(t[s]={}),t[s][r]=.5;if(a.title)null!==(i=t.offset)&&void 0!==i||(t.offset={}),t.offset["row"===r?"rowTitle":"columnTitle"]=10}}return t}assembleDefaultLayout(){const{column:t,row:e}=this.facet,n=t?this.columnDistinctSignal():e?1:void 0;let i="all";return(e||"independent"!==this.component.resolve.scale.x)&&(t||"independent"!==this.component.resolve.scale.y)||(i="none"),{...this.getHeaderLayoutMixins(),...n?{columns:n}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof Bp)){const t=this.getName("column_domain");return{signal:"length(data('".concat(t,"'))")}}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof Bp?{...this.channelHasField("column")?{encode:{update:{columns:{field:Ga(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],e=[],n=[];if(this.child instanceof Bp){if(this.child.channelHasField("column")){const i=Ga(this.child.facet.column);t.push(i),e.push("distinct"),n.push("distinct_".concat(i))}}else for(const i of bn){const r=this.child.component.scales[i];if(r&&!r.merged){const o=r.get("type"),a=r.get("range");if(so(o)&&ui(a)){const r=qh(Wh(this.child,i));r?(t.push(r),e.push("distinct"),n.push("distinct_".concat(r))):dr(Pi(i))}}}return{fields:t,ops:e,as:n}}assembleFacet(){const{name:t,data:e}=this.component.data.facetRoot,{row:n,column:i}=this.facet,{fields:r,ops:o,as:a}=this.getCardinalityAggregateForChild(),s=[];for(const l of Te){const t=this.facet[l];if(t){s.push(Ga(t));const{bin:e,sort:c}=t;if(ti(e)&&s.push(Ga(t,{binSuffix:"end"})),ba(c)){const{field:e,op:s=ma}=c,l=jp(t,c);n&&i?(r.push(l),o.push("max"),a.push(l)):(r.push(e),o.push(s),a.push(l))}else if((0,I.kJ)(c)){const e=Vf(t,l);r.push(e),o.push("max"),a.push(e)}}}const c=!!n&&!!i;return{name:t,data:e,groupby:s,...c||r.length>0?{aggregate:{...c?{cross:c}:{},...r.length?{fields:r,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:e}=this,n=e[t];return n?ba(n.sort)?[jp(n,n.sort,{expr:"datum"})]:(0,I.kJ)(n.sort)?[Vf(n,t,{expr:"datum"})]:[Ga(n,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:e}=this,n=e[t];if(n){const{sort:t}=n;return[(ba(t)?t.order:!(0,I.kJ)(t)&&t)||"ascending"]}return[]}assembleLabelTitle(){const{facet:t,config:e}=this;if(t.facet)return ad(t.facet,"facet",e);const n={row:["top","bottom"],column:["left","right"]};for(const r of Qf)if(t[r]){var i;const o=Kf("labelOrient",null===(i=t[r])||void 0===i?void 0:i.header,e,r);if(n[r].includes(o))return ad(t[r],r,e)}}assembleMarks(){const{child:t}=this,e=function(t){const e=[],n=Fp(e);for(const i of t.children)n(i,{source:t.name,name:null,transform:[]});return e}(this.component.data.facetRoot),n=t.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||t.assembleTitle(),r=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...i?{title:i}:{},...r?{style:r}:{},from:{facet:this.assembleFacet()},sort:{field:Te.map((t=>this.facetSortFields(t))).flat(),order:Te.map((t=>this.facetSortOrder(t))).flat()},...e.length>0?{data:e}:{},...n?{encode:{update:n}}:{},...t.assembleGroup(ru(this,[]))}]}getMapping(){return this.facet}}function Up(t,e){for(const a of e){var n,i,r,o;const e=a.data;if(t.name&&a.hasName()&&t.name!==a.dataName)continue;const s=null===(n=t.format)||void 0===n?void 0:n.mesh,c=null===(i=e.format)||void 0===i?void 0:i.feature;if(s&&c)continue;const l=null===(r=t.format)||void 0===r?void 0:r.feature;if((l||c)&&l!==c)continue;const u=null===(o=e.format)||void 0===o?void 0:o.mesh;if(!s&&!u||s===u)if(Gl(t)&&Gl(e)){if(Q(t.values,e.values))return a}else if(Jl(t)&&Jl(e)){if(t.url===e.url)return a}else if($l(t)&&t.name===a.dataName)return a}return null}function Ip(t){var e,n,i;let r=function(t,e){if(t.data||!t.parent){if(null===t.data){const t=new ih({values:[]});return e.push(t),t}const n=Up(t.data,e);if(n)return Vl(t.data)||(n.data.format=ut({},t.data.format,n.data.format)),!n.hasName()&&t.data.name&&(n.dataName=t.data.name),n;{const n=new ih(t.data);return e.push(n),n}}return t.parent.component.data.facetRoot?t.parent.component.data.facetRoot:t.parent.component.data.main}(t,t.component.data.sources);const{outputNodes:o,outputNodeRefCounts:a}=t.component.data,s=t.data,c=!(s&&(Vl(s)||Jl(s)||Gl(s)))&&t.parent?t.parent.component.data.ancestorParse.clone():new Xl;Vl(s)?(Yl(s)?r=new nh(r,s.sequence):Zl(s)&&(r=new eh(r,s.graticule)),c.parseNothing=!0):null===(null===s||void 0===s||null===(e=s.format)||void 0===e?void 0:e.parse)&&(c.parseNothing=!0),r=null!==(n=Qd.makeExplicit(r,t,c))&&void 0!==n?n:r,r=new th(r);const l=t.parent&&pp(t.parent);var u;(fp(t)||dp(t))&&(l&&(r=null!==(u=Jd.makeFromEncoding(r,t))&&void 0!==u?u:r));t.transforms.length>0&&(r=function(t,e,n){let i=0;for(const a of e.transforms){let s,c;if(bl(a))c=t=new $f(t,a),s="derived";else if(sl(a)){var r;const i=Kd(a);c=t=null!==(r=Qd.makeWithAncestors(t,{},i,n))&&void 0!==r?r:t,t=new Tf(t,e,a.filter)}else if(xl(a))c=t=Jd.makeFromTransform(t,a,e),s="number";else if(wl(a))s="date",void 0===n.getWithExplicit(a.field).value&&(t=new Qd(t,{[a.field]:s}),n.set(a.field,s,!1)),c=t=lu.makeFromTransform(t,a);else if(kl(a))c=t=$d.makeFromTransform(t,a),s="number",Sf(e)&&(t=new th(t));else if(ll(a))c=t=Dp.make(t,e,a,i++),s="derived";else if(gl(a))c=t=new Eh(t,a),s="number";else if(vl(a))c=t=new wh(t,a),s="number";else if(El(a))c=t=kh.makeFromTransform(t,a),s="derived";else if(Dl(a))c=t=new xp(t,a),s="derived";else if(yl(a))c=t=new bp(t,a),s="derived";else if(ul(a))c=t=new Mp(t,a),s="derived";else if(ml(a))t=new Cp(t,a);else if(_l(a))c=t=kp.makeFromTransform(t,a),s="derived";else if(fl(a))c=t=new vp(t,a),s="derived";else if(dl(a))c=t=new Ap(t,a),s="derived";else if(hl(a))c=t=new Sp(t,a),s="derived";else{if(!pl(a)){dr("Ignoring an invalid transform: ".concat(rt(a),"."));continue}c=t=new Ep(t,a),s="derived"}if(c&&void 0!==s)for(const t of null!==(o=c.producedFields())&&void 0!==o?o:[]){var o;n.set(t,s,!1)}}return t}(r,t,c));const f=function(t){const e={};if(fp(t)&&t.component.selection)for(const n of bt(t.component.selection)){const i=t.component.selection[n];for(const t of i.project.items)!t.channel&&Tt(t.field)>1&&(e[t.field]="flatten")}return e}(t),d=Zd(t);if(r=null!==(i=Qd.makeWithAncestors(r,{},{...f,...d},c))&&void 0!==i?i:r,fp(t)&&(r=_p.parseAll(r,t),r=wp.parseAll(r,t)),fp(t)||dp(t)){var h,p;if(!l)r=null!==(p=Jd.makeFromEncoding(r,t))&&void 0!==p?p:r;r=null!==(h=lu.makeFromEncoding(r,t))&&void 0!==h?h:r,r=$f.parseAllForSortIndex(r,t)}const m=t.getDataName(Ql.Raw),g=new cu(r,m,Ql.Raw,a);if(o[m]=g,r=g,fp(t)){var v,y;const e=$d.makeFromEncoding(r,t);e&&(r=e,Sf(t)&&(r=new th(r))),r=null!==(v=kp.makeFromEncoding(r,t))&&void 0!==v?v:r,r=null!==(y=kh.makeFromEncoding(r,t))&&void 0!==y?y:r}var b;fp(t)&&(r=null!==(b=yp.make(r,t))&&void 0!==b?b:r);const x=t.getDataName(Ql.Main),_=new cu(r,x,Ql.Main,a);o[x]=_,r=_,fp(t)&&function(t,e){for(const[i,r]of _t(null!==(n=t.component.selection)&&void 0!==n?n:{})){var n;const o=t.getName("lookup_".concat(i));t.component.data.outputNodes[o]=r.materialized=new cu(new Tf(e,t,{param:i}),o,Ql.Lookup,t.component.data.outputNodeRefCounts)}}(t,_);let w=null;if(dp(t)){var k;const e=t.getName("facet");r=null!==(k=function(t,e){const{row:n,column:i}=e;if(n&&i){let e=null;for(const r of[n,i])if(ba(r.sort)){const{field:n,op:i=ma}=r.sort;t=e=new wh(t,{joinaggregate:[{op:i,field:n,as:jp(r,r.sort,{forAs:!0})}],groupby:[Ga(r)]})}return e}return null}(r,t.facet))&&void 0!==k?k:r,w=new Vd(r,t,e,_.getSource()),o[e]=w}return{...t.component.data,outputNodes:o,outputNodeRefCounts:a,raw:g,main:_,facetRoot:w,ancestorParse:c}}class qp extends mp{constructor(t,e,n,i){var r,o,a,s;super(t,"concat",e,n,i,t.resolve),"shared"!==(null===(r=t.resolve)||void 0===r||null===(o=r.axis)||void 0===o?void 0:o.x)&&"shared"!==(null===(a=t.resolve)||void 0===a||null===(s=a.axis)||void 0===s?void 0:s.y)||dr("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(t).map(((t,e)=>hm(t,this,this.getName("concat_".concat(e)),void 0,i)))}parseData(){this.component.data=Ip(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const e of bt(t.component.selection))this.component.selection[e]=t.component.selection[e]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return gc(t)?t.vconcat:vc(t)?t.hconcat:t.concat}parseLayoutSize(){!function(t){Rp(t);const e=1===t.layout.columns?"width":"childWidth",n=void 0===t.layout.columns?"height":"childHeight";Pp(t,e),Pp(t,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce(((t,e)=>e.assembleSelectionTopLevelSignals(t)),t)}assembleSignals(){return this.children.forEach((t=>t.assembleSignals())),[]}assembleLayoutSignals(){const t=fd(this);for(const e of this.children)t.push(...e.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce(((t,e)=>e.assembleSelectionData(t)),t)}assembleMarks(){return this.children.map((t=>{const e=t.assembleTitle(),n=t.assembleGroupStyle(),i=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...e?{title:e}:{},...n?{style:n}:{},...i?{encode:{update:i}}:{},...t.assembleGroup()}}))}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...null!=t?{columns:t}:{},bounds:"full",align:"each"}}}const Wp={disable:1,gridScale:1,scale:1,...vs,labelExpr:1,encode:1},Hp=bt(Wp);class Xp extends Bl{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(),this.explicit=t,this.implicit=e,this.mainExtracted=n}clone(){return new Xp(tt(this.explicit),tt(this.implicit),this.mainExtracted)}hasAxisPart(t){return"axis"===t||("grid"===t||"title"===t?!!this.get(t):!(!1===(e=this.get(t))||null===e));var e}hasOrientSignalRef(){return li(this.explicit.orient)}}const Jp={bottom:"top",top:"bottom",left:"right",right:"left"};function Gp(t,e){if(!t)return e.map((t=>t.clone()));{if(t.length!==e.length)return;const n=t.length;for(let i=0;i<n;i++){const n=t[i],r=e[i];if(!!n!==!!r)return;if(n&&r){const e=n.getWithExplicit("orient"),o=r.getWithExplicit("orient");if(e.explicit&&o.explicit&&e.value!==o.value)return;t[i]=$p(n,r)}}}return t}function $p(t,e){for(const n of Hp){const i=Hl(t.getWithExplicit(n),e.getWithExplicit(n),n,"axis",((t,e)=>{switch(n){case"title":return Fi(t,e);case"gridScale":return{explicit:t.explicit,value:zt(t.value,e.value)}}return Wl(t,e,n,"axis")}));t.setWithExplicit(n,i)}return t}function Vp(t,e,n,i,r){if("disable"===e)return void 0!==n;switch(n=n||{},e){case"titleAngle":case"labelAngle":return t===(li(n.labelAngle)?n.labelAngle:Ut(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(t===Gf(i,r))return!0}return t===n[e]}const Yp=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Kp(t,e){var n,i,r,o,a;let s=e.axis(t);const c=new Xp,l=is(e.encoding[t]),{mark:u,config:f}=e,d=(null===(n=s)||void 0===n?void 0:n.orient)||(null===(i=f["x"===t?"axisX":"axisY"])||void 0===i?void 0:i.orient)||(null===(r=f.axis)||void 0===r?void 0:r.orient)||function(t){return"x"===t?"bottom":"left"}(t),h=e.getScaleComponent(t).get("type"),p=function(t,e,n,i){const r="band"===e?["axisDiscrete","axisBand"]:"point"===e?["axisDiscrete","axisPoint"]:io(e)?["axisQuantitative"]:"time"===e||"utc"===e?["axisTemporal"]:[],o="x"===t?"axisX":"axisY",a=li(n)?"axisOrient":"axis".concat(At(n)),s=[...r,...r.map((t=>o+t.substr(4)))],c=["axis",a,o];return{vlOnlyAxisConfig:Uf(s,i,t,n),vgAxisConfig:Uf(c,i,t,n),axisConfigStyle:If([...c,...s],i)}}(t,h,d,e.config),m=void 0!==s?!s:qf("disable",f.style,null===(o=s)||void 0===o?void 0:o.style,p).configValue;if(c.set("disable",m,void 0!==s),m)return c;s=s||{};const g=function(t,e,n,i,r){const o=null===e||void 0===e?void 0:e.labelAngle;if(void 0!==o)return li(o)?o:Ut(o);{const{configValue:o}=qf("labelAngle",i,null===e||void 0===e?void 0:e.style,r);return void 0!==o?Ut(o):n!==Xt||!st([$r,Jr],t.type)||Ta(t)&&t.timeUnit?void 0:270}}(l,s,t,f.style,p),v=ua(s.formatType,l,h),y=la(l,l.type,s.format,s.formatType,f,!0),b={fieldOrDatumDef:l,axis:s,channel:t,model:e,scaleType:h,orient:d,labelAngle:g,format:y,formatType:v,mark:u,config:f};for(const w of Hp){const n=w in Wf?Wf[w](b):bs(w)?s[w]:void 0,i=void 0!==n,r=Vp(n,w,s,e,t);if(i&&r)c.set(w,n,r);else{const{configValue:t,configFrom:e}=bs(w)&&"values"!==w?qf(w,f.style,s.style,p):{},o=void 0!==t;i&&!o?c.set(w,n,r):("vgAxisConfig"!==e||Yp.has(w)&&o||ps(t)||li(t))&&c.set(w,t,!1)}}const x=null!==(a=s.encoding)&&void 0!==a?a:{},_=ms.reduce(((n,i)=>{var r;if(!c.hasAxisPart(i))return n;const o=gd(null!==(r=x[i])&&void 0!==r?r:{},e),a="labels"===i?function(t,e,n){var i;const{encoding:r,config:o}=t,a=null!==(i=is(r[e]))&&void 0!==i?i:is(r[Ve(e)]),s=t.axis(e)||{},{format:c,formatType:l}=s;if(ia(l))return{text:ca({fieldOrDatumDef:a,field:"datum.value",format:c,formatType:l,config:o}),...n};if(void 0===c&&void 0===l&&o.customFormatTypes){if("quantitative"===za(a)){if(Wa(a)&&"normalize"===a.stack&&o.normalizedNumberFormatType)return{text:ca({fieldOrDatumDef:a,field:"datum.value",format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,config:o}),...n};if(o.numberFormatType)return{text:ca({fieldOrDatumDef:a,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}),...n}}if("temporal"===za(a)&&o.timeFormatType&&Ta(a)&&!a.timeUnit)return{text:ca({fieldOrDatumDef:a,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o}),...n}}return n}(e,t,o):o;return void 0===a||yt(a)||(n[i]={update:a}),n}),{});return yt(_)||c.set("encode",_,!!s.encoding||void 0!==s.labelAngle),c}function Zp(t,e,n){const i=ai(t),r=ki("orient",i,n);var o,a;if(i.orient=function(t,e,n){switch(t){case Fo:case Po:case Lo:case To:case Oo:case Mo:return}const{x:i,y:r,x2:o,y2:a}=e;switch(t){case So:if(Ta(i)&&(ei(i.bin)||Ta(r)&&r.aggregate&&!i.aggregate))return"vertical";if(Ta(r)&&(ei(r.bin)||Ta(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o)return(Ta(i)&&i.type===Xr&&!ti(i.bin)||ja(i))&&Ta(r)&&ei(r.bin)?"horizontal":"vertical";if(!a)return(Ta(r)&&r.type===Xr&&!ti(r.bin)||ja(r))&&Ta(i)&&ei(i.bin)?"vertical":"horizontal"}case No:if(o&&(!Ta(i)||!ei(i.bin))&&a&&(!Ta(r)||!ei(r.bin)))return;case Ao:if(a)return Ta(r)&&ei(r.bin)?"horizontal":"vertical";if(o)return Ta(i)&&ei(i.bin)?"vertical":"horizontal";if(t===No){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case Co:case zo:{const e=La(i),o=La(r);if(n)return n;if(e&&!o)return"tick"!==t?"horizontal":"vertical";if(!e&&o)return"tick"!==t?"vertical":"horizontal";if(e&&o)return"vertical";{const t=Ua(i)&&i.type===Gr,e=Ua(r)&&r.type===Gr;if(t&&!e)return"vertical";if(!t&&e)return"horizontal"}return}}return"vertical"}(i.type,e,r),void 0!==r&&r!==i.orient&&dr((o=i.orient,a=r,'Specified orient "'.concat(o,'" overridden with "').concat(a,'".'))),"bar"===i.type&&i.orient){const t=ki("cornerRadiusEnd",i,n);if(void 0!==t){const n="horizontal"===i.orient&&e.x2||"vertical"===i.orient&&e.y2?["cornerRadius"]:Go[i.orient];for(const e of n)i[e]=t;void 0!==i.cornerRadiusEnd&&delete i.cornerRadiusEnd}}void 0===ki("opacity",i,n)&&(i.opacity=function(t,e){if(st([Fo,zo,Po,Lo],t)&&!As(e))return.7;return}(i.type,e));return void 0===ki("cursor",i,n)&&(i.cursor=function(t,e,n){if(e.href||t.href||ki("href",t,n))return"pointer";return t.cursor}(i,e,n)),i}function Qp(t,e){const{config:n}=t;return{...Zu(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Bu("x",t,{defaultPos:"mid"}),...Bu("y",t,{defaultPos:"mid"}),...Ru("size",t),...Ru("angle",t),...tm(t,n,e)}}function tm(t,e,n){return n?{shape:{value:n}}:Ru("shape",t)}const em={vgMark:"rule",encodeEntry:t=>{const{markDef:e}=t,n=e.orient;return t.encoding.x||t.encoding.y||t.encoding.latitude||t.encoding.longitude?{...Zu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Hu("x",t,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n}),...Hu("y",t,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n}),...Ru("size",t,{vgChannel:"strokeWidth"})}:{}}};function nm(t,e,n){if(void 0===ki("align",t,n))return"center"}function im(t,e,n){if(void 0===ki("baseline",t,n))return"middle"}const rm={vgMark:"rect",encodeEntry:t=>{const{config:e,markDef:n}=t,i=n.orient,r="horizontal"===i?"width":"height",o="horizontal"===i?"height":"width";return{...Zu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Bu("x",t,{defaultPos:"mid",vgChannel:"xc"}),...Bu("y",t,{defaultPos:"mid",vgChannel:"yc"}),...Ru("size",t,{defaultValue:om(t),vgChannel:r}),[o]:yi(ki("thickness",n,e))}}};function om(t){var e;const{config:n,markDef:i}=t,{orient:r}=i,o="horizontal"===r?"width":"height",a=t.getScaleComponent("horizontal"===r?"x":"y"),s=null!==(e=ki("size",i,n,{vgChannel:o}))&&void 0!==e?e:n.tick.bandSize;if(void 0!==s)return s;{const t=a?a.get("range"):void 0;if(t&&ui(t)&&(0,I.hj)(t.step))return 3*t.step/4;return 3*kc(n.view,o)/4}}const am={arc:{vgMark:"arc",encodeEntry:t=>({...Zu(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Bu("x",t,{defaultPos:"mid"}),...Bu("y",t,{defaultPos:"mid"}),...Gu(t,"radius"),...Gu(t,"theta")})},area:{vgMark:"area",encodeEntry:t=>({...Zu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Hu("x",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===t.markDef.orient}),...Hu("y",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===t.markDef.orient}),...ef(t)})},bar:{vgMark:"rect",encodeEntry:t=>({...Zu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Gu(t,"x"),...Gu(t,"y")})},circle:{vgMark:"symbol",encodeEntry:t=>Qp(t,"circle")},geoshape:{vgMark:"shape",encodeEntry:t=>({...Zu(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:t=>{const{encoding:e}=t,n=e.shape;return[{type:"geoshape",projection:t.projectionName(),...n&&Ta(n)&&n.type===Vr?{field:Ga(n,{expr:"datum"})}:{}}]}},image:{vgMark:"image",encodeEntry:t=>({...Zu(t,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Gu(t,"x"),...Gu(t,"y"),...Su(t,"url")})},line:{vgMark:"line",encodeEntry:t=>({...Zu(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Bu("x",t,{defaultPos:"mid"}),...Bu("y",t,{defaultPos:"mid"}),...Ru("size",t,{vgChannel:"strokeWidth"}),...ef(t)})},point:{vgMark:"symbol",encodeEntry:t=>Qp(t)},rect:{vgMark:"rect",encodeEntry:t=>({...Zu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Gu(t,"x"),...Gu(t,"y")})},rule:em,square:{vgMark:"symbol",encodeEntry:t=>Qp(t,"square")},text:{vgMark:"text",encodeEntry:t=>{const{config:e,encoding:n}=t;return{...Zu(t,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Bu("x",t,{defaultPos:"mid"}),...Bu("y",t,{defaultPos:"mid"}),...Su(t),...Ru("size",t,{vgChannel:"fontSize"}),...Ru("angle",t),...nf("align",nm(t.markDef,n,e)),...nf("baseline",im(t.markDef,n,e)),...Bu("radius",t,{defaultPos:null}),...Bu("theta",t,{defaultPos:null})}}},tick:rm,trail:{vgMark:"trail",encodeEntry:t=>({...Zu(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Bu("x",t,{defaultPos:"mid"}),...Bu("y",t,{defaultPos:"mid"}),...Ru("size",t),...ef(t)})}};function sm(t){if(st([Co,Ao,Ro],t.mark)){const e=Os(t.mark,t.encoding);if(e.length>0)return function(t,e){return[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:cm+t.requestDataName(Ql.Main),data:t.requestDataName(Ql.Main),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:um(t,{fromPrefix:cm})}]}(t,e)}else if(t.mark===So){const e=pi.some((e=>ki(e,t.markDef,t.config)));if(t.stack&&!t.fieldDef("size")&&e)return function(t){var e;const[n]=um(t,{fromPrefix:lm}),i=t.scaleName(t.stack.fieldChannel),r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.vgField(t.stack.fieldChannel,e)},o=(t,e)=>{const n=[r({prefix:"min",suffix:"start",expr:e}),r({prefix:"max",suffix:"start",expr:e}),r({prefix:"min",suffix:"end",expr:e}),r({prefix:"max",suffix:"end",expr:e})];return"".concat(t,"(").concat(n.map((t=>"scale('".concat(i,"',").concat(t,")"))).join(","),")")};let a,s;"x"===t.stack.fieldChannel?(a={...nt(n.encode.update,["y","yc","y2","height",...pi]),x:{signal:o("min","datum")},x2:{signal:o("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},n.encode.update={...it(n.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(a={...nt(n.encode.update,["x","xc","x2","width"]),y:{signal:o("min","datum")},y2:{signal:o("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},n.encode.update={...it(n.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const l of pi){const e=Ei(l,t.markDef,t.config);n.encode.update[l]?(a[l]=n.encode.update[l],delete n.encode.update[l]):e&&(a[l]=yi(e)),e&&(n.encode.update[l]={value:0})}const c=[];if((null===(e=t.stack.groupbyChannels)||void 0===e?void 0:e.length)>0)for(const l of t.stack.groupbyChannels){const e=t.fieldDef(l),n=Ga(e);n&&c.push(n),(null!==e&&void 0!==e&&e.bin||null!==e&&void 0!==e&&e.timeUnit)&&c.push(Ga(e,{binSuffix:"end"}))}a=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((e,i)=>{if(n.encode.update[i])return{...e,[i]:n.encode.update[i]};{const n=Ei(i,t.markDef,t.config);return void 0!==n?{...e,[i]:yi(n)}:e}}),a),a.stroke&&(a.strokeForeground={value:!0},a.strokeOffset={value:0});return[{type:"group",from:{facet:{data:t.requestDataName(Ql.Main),name:lm+t.requestDataName(Ql.Main),groupby:c,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:a},marks:[{type:"group",encode:{update:s},marks:[n]}]}]}(t)}return um(t)}const cm="faceted_path_";const lm="stack_group_";function um(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{fromPrefix:""};const{mark:n,markDef:i,encoding:r,config:o}=t,a=zt(i.clip,function(t){const e=t.getScaleComponent("x"),n=t.getScaleComponent("y");return!!(null!==e&&void 0!==e&&e.get("selectionExtent")||null!==n&&void 0!==n&&n.get("selectionExtent"))||void 0}(t),function(t){const e=t.component.projection;return!(!e||e.isFit)||void 0}(t)),s=wi(i),c=r.key,l=function(t){const{encoding:e,stack:n,mark:i,markDef:r,config:o}=t,a=e.order;if(!(!(0,I.kJ)(a)&&Ia(a)&&at(a.value)||!a&&at(ki("order",r,o)))){if(((0,I.kJ)(a)||Ta(a))&&!n)return Si(a,{expr:"datum"});if(Bo(i)){const n="horizontal"===r.orient?"y":"x",i=e[n];if(Ta(i)){const e=i.sort;if((0,I.kJ)(e))return{field:Ga(i,{prefix:n,suffix:"sort_index",expr:"datum"})};if(ba(e))return{field:Ga({aggregate:As(t.encoding)?e.op:void 0,field:e.field},{expr:"datum"})};if(ya(e))return{field:Ga(t.fieldDef(e.encoding),{expr:"datum"}),order:e.order};if(null===e)return;var s;return{field:Ga(i,{binSuffix:null!==(s=t.stack)&&void 0!==s&&s.impute?"mid":void 0,expr:"datum"})}}}}}(t),u=function(t){if(!t.component.selection)return null;const e=bt(t.component.selection).length;let n=e,i=t.parent;for(;i&&0===n;)n=bt(i.component.selection).length,i=i.parent;return n?{interactive:e>0||"geoshape"===t.mark||!!t.encoding.tooltip}:null}(t),f=ki("aria",i,o),d=am[n].postEncodingTransform?am[n].postEncodingTransform(t):null;return[{name:t.getName("marks"),type:am[n].vgMark,...a?{clip:!0}:{},...s?{style:s}:{},...c?{key:c.field}:{},...l?{sort:l}:{},...u||{},...!1===f?{aria:f}:{},from:{data:e.fromPrefix+t.requestDataName(Ql.Main)},encode:{update:am[n].encodeEntry(t)},...d?{transform:d}:{}}]}class fm extends gp{constructor(t,e,n){var i;let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0;super(t,"unit",e,n,o,void 0,xc(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const a=qo(t.mark)?{...t.mark}:{type:t.mark},s=a.type;void 0===a.filled&&(a.filled=function(t,e,n){let{graticule:i}=n;if(i)return!1;const r=Ei("filled",t,e),o=t.type;return zt(r,o!==Fo&&o!==Co&&o!==No)}(a,o,{graticule:t.data&&Zl(t.data)}));const c=this.encoding=function(t,e,n,i){const r={};for(const a of bt(t))He(a)||dr("".concat(o=a,"-encoding is dropped as ").concat(o," is not a valid encoding channel."));var o;for(let a of tn){if(!t[a])continue;const o=t[a];if(Dn(a)){const t=Qe(a),e=r[t];if(Ta(e)){if(Wr(e.type)&&Ta(o)&&!e.timeUnit){dr(Hi(t));continue}}else a=t,dr(Xi(t))}if("angle"!==a||"arc"!==e||t.theta||(dr("Arc marks uses theta channel rather than angle, replacing angle with theta."),a=Qt),Ms(t,a,e)){if(a===le&&"line"===e){const e=ns(t[a]);if(null!==e&&void 0!==e&&e.aggregate){dr("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.");continue}}if(a===oe&&(n?"fill"in t:"stroke"in t))dr(Gi("encoding",{fill:"fill"in t,stroke:"stroke"in t}));else if(a===ye||a===ve&&!(0,I.kJ)(o)&&!Ia(o)||a===xe&&(0,I.kJ)(o)){if(o){if(a===ve){const e=t[a];if(Ca(e)){r[a]=e;continue}}r[a]=(0,I.IX)(o).reduce(((t,e)=>(Ta(e)?t.push(as(e,a)):dr($i(e,a)),t)),[])}}else{if(a===xe&&null===o)r[a]=null;else if(!Ta(o)&&!Ra(o)&&!Ia(o)&&!Fa(o)&&!li(o)){dr($i(o,a));continue}r[a]=rs(o,a,i)}}else dr(Vi(a,e))}return r}(t.encoding||{},s,a.filled,o);this.markDef=Zp(a,c,o),this.size=function(t){let{encoding:e,size:n}=t;for(const i of bn){const t=Ye(i);bc(n[t])&&Pa(e[i])&&(delete n[t],dr(rr(t)))}return n}({encoding:c,size:xc(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=Xc(this.markDef,c),this.specifiedScales=this.initScales(s,c),this.specifiedAxes=this.initAxes(c),this.specifiedLegends=this.initLegends(c),this.specifiedProjection=t.projection,this.selection=(null!==(i=t.params)&&void 0!==i?i:[]).filter((t=>hc(t)))}get hasProjection(){const{encoding:t}=this,e=this.mark===jo,n=t&&Ce.some((e=>Ba(t[e])));return e||n}scaleDomain(t){const e=this.specifiedScales[t];return e?e.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,e){return Ln.reduce(((t,n)=>{const i=is(e[n]);var r;i&&(t[n]=this.initScale(null!==(r=i.scale)&&void 0!==r?r:{}));return t}),{})}initScale(t){const{domain:e,range:n}=t,i=ai(t);return(0,I.kJ)(e)&&(i.domain=e.map(gi)),(0,I.kJ)(n)&&(i.range=n.map(gi)),i}initAxes(t){return bn.reduce(((e,n)=>{const i=t[n];if(Ba(i)||n===Xt&&Ba(t.x2)||n===Jt&&Ba(t.y2)){const t=Ba(i)?i.axis:void 0;e[n]=t?this.initAxis({...t}):t}return e}),{})}initAxis(t){const e=bt(t),n={};for(const i of e){const e=t[i];n[i]=ps(e)?mi(e):gi(e)}return n}initLegends(t){return Rn.reduce(((e,n)=>{const i=is(t[n]);if(i&&function(t){switch(t){case oe:case ae:case se:case le:case ce:case fe:case pe:case me:return!0;case de:case he:case ue:return!1}}(n)){const t=i.legend;e[n]=t?ai(t):t}return e}),{})}parseData(){this.component.data=Ip(this)}parseLayoutSize(){!function(t){const{size:e,component:n}=t;for(const i of bn){const r=Ye(i);if(e[r]){const t=e[r];n.layoutSize.set(r,bc(t)?"step":t,!0)}else{const e=Lp(t,r);n.layoutSize.set(r,e,!1)}}}(this)}parseSelections(){this.component.selection=function(t,e){const n={},i=t.config.selection;if(!e||!e.length)return n;for(const o of e){const e=kt(o.name),a=o.select,s=(0,I.HD)(a)?a:a.type,c=(0,I.Kn)(a)?tt(a):{type:s},l=i[s];for(const t in l){var r;"fields"!==t&&"encodings"!==t&&("mark"===t&&(c[t]={...l[t],...c[t]}),(void 0===c[t]||!0===c[t])&&(c[t]=tt(null!==(r=l[t])&&void 0!==r?r:c[t])))}const u=n[e]={...c,name:e,type:s,init:o.value,bind:o.bind,events:(0,I.HD)(c.on)?(0,tu.r)(c.on,"scope"):(0,I.IX)(tt(c.on))},f=tt(o);for(const n of Df)n.defined(u)&&n.parse&&n.parse(t,u,f)}return n}(this,this.selection)}parseMarkGroup(){this.component.mark=sm(this)}parseAxesAndHeaders(){var t;this.component.axes=(t=this,bn.reduce(((e,n)=>(t.component.scales[n]&&(e[n]=[Kp(n,t)]),e)),{}))}assembleSelectionTopLevelSignals(t){return function(t,e){let n=!1;for(const r of xt(null!==(i=t.component.selection)&&void 0!==i?i:{})){var i;const o=r.name,a=(0,I.m8)(o+_f);if(0===e.filter((t=>t.name===o)).length){const t="global"===r.resolve?"union":r.resolve,n="point"===r.type?", true, true)":")";e.push({name:r.name,update:"".concat(Ef,"(").concat(a,", ").concat((0,I.m8)(t)).concat(n)})}n=!0;for(const n of Df)n.defined(r)&&n.topLevelSignals&&(e=n.topLevelSignals(t,r,e))}n&&0===e.filter((t=>"unit"===t.name)).length&&e.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]});return au(e)}(this,t)}assembleSignals(){return[...Bf(this),...iu(this,[])]}assembleSelectionData(t){return function(t,e){const n=[...e],i=Af(t,{escape:!1});for(const o of xt(null!==(r=t.component.selection)&&void 0!==r?r:{})){var r;const t={name:o.name+_f};if(o.project.hasSelectionId&&(t.transform=[{type:"collect",sort:{field:lc}}]),o.init){const e=o.project.items.map(eu);t.values=o.project.hasSelectionId?o.init.map((t=>({unit:i,[lc]:nu(t,!1)[0]}))):o.init.map((t=>({unit:i,fields:e,values:nu(t,!1)})))}n.filter((t=>t.name===o.name+_f)).length||n.push(t)}return n}(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return fd(this)}assembleMarks(){var t;let e=null!==(t=this.component.mark)&&void 0!==t?t:[];return this.parent&&pp(this.parent)||(e=ou(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return void 0!==t?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return ks(this.encoding,t)}fieldDef(t){return ns(this.encoding[t])}typedFieldDef(t){const e=this.fieldDef(t);return Ua(e)?e:null}}class dm extends mp{constructor(t,e,n,i,r){super(t,"layer",e,n,r,t.resolve,t.view);const o={...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map(((t,e)=>{if(jc(t))return new dm(t,this,this.getName("layer_".concat(e)),o,r);if(_s(t))return new fm(t,this,this.getName("layer_".concat(e)),o,r);throw new Error(Oi(t))}))}parseData(){this.component.data=Ip(this);for(const t of this.children)t.parseData()}parseLayoutSize(){var t;Rp(t=this),Pp(t,"width"),Pp(t,"height")}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const e of bt(t.component.selection))this.component.selection[e]=t.component.selection[e]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){!function(t){const{axes:e,resolve:n}=t.component,i={top:0,bottom:0,right:0,left:0};for(const o of t.children){o.parseAxesAndHeaders();for(const i of bt(o.component.axes))n.axis[i]=yd(t.component.resolve,i),"shared"===n.axis[i]&&(e[i]=Gp(e[i],o.component.axes[i]),e[i]||(n.axis[i]="independent",delete e[i]))}for(const o of bn){for(const a of t.children)if(a.component.axes[o]){if("independent"===n.axis[o]){var r;e[o]=(null!==(r=e[o])&&void 0!==r?r:[]).concat(a.component.axes[o]);for(const t of a.component.axes[o]){const{value:e,explicit:n}=t.getWithExplicit("orient");if(!li(e)){if(i[e]>0&&!n){const n=Jp[e];i[e]>i[n]&&t.set("orient",n,!1)}i[e]++}}}delete a.component.axes[o]}if("independent"===n.axis[o]&&e[o]&&e[o].length>1)for(const t of e[o])t.get("grid")&&!t.explicit.grid&&(t.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce(((t,e)=>e.assembleSelectionTopLevelSignals(t)),t)}assembleSignals(){return this.children.reduce(((t,e)=>t.concat(e.assembleSignals())),Bf(this))}assembleLayoutSignals(){return this.children.reduce(((t,e)=>t.concat(e.assembleLayoutSignals())),fd(this))}assembleSelectionData(t){return this.children.reduce(((t,e)=>e.assembleSelectionData(t)),t)}assembleGroupStyle(){const t=new Set;for(const n of this.children)for(const e of(0,I.IX)(n.assembleGroupStyle()))t.add(e);const e=Array.from(t);return e.length>1?e:1===e.length?e[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const e of this.children)if(t=e.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return function(t,e){for(const n of t.children)fp(n)&&(e=ou(n,e));return e}(this,this.children.flatMap((t=>t.assembleMarks())))}assembleLegends(){return this.children.reduce(((t,e)=>t.concat(e.assembleLegends())),Pd(this))}}function hm(t,e,n,i,r){if(ka(t))return new Bp(t,e,n,r);if(jc(t))return new dm(t,e,n,i,r);if(_s(t))return new fm(t,e,n,i,r);if(function(t){return gc(t)||vc(t)||mc(t)}(t))return new qp(t,e,n,r);throw new Error(Oi(t))}function pm(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n;e.logger&&(n=e.logger,ur=n),e.fieldTitle&&Ka(e.fieldTitle);try{const n=Nc((0,I.fE)(e.config,t.config)),i=Nl(t,n),r=hm(i,null,"",void 0,n);r.parse(),function(t,e){Ch(t.sources);let n=0,i=0;for(let r=0;r<Mh&&Oh(t,e,!0);r++)n++;t.sources.map(Dh);for(let r=0;r<Mh&&Oh(t,e,!1);r++)i++;Ch(t.sources),Math.max(n,i)===Mh&&dr("Maximum optimization runs(".concat(Mh,") reached."))}(r.component.data,r);const o=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;const r=t.config?Pc(t.config):void 0,o=[].concat(t.assembleSelectionData([]),function(t,e){const n=[],i=Fp(n);let r=0;for(const c of t.sources){c.hasName()||(c.dataName="source_".concat(r++));const t=c.assemble();i(c,t)}for(const c of n)0===c.transform.length&&delete c.transform;let o=0;for(const[c,l]of n.entries()){var a;0!==(null!==(a=l.transform)&&void 0!==a?a:[]).length||l.source||n.splice(o++,0,n.splice(c,1)[0])}for(const c of n)for(const e of null!==(s=c.transform)&&void 0!==s?s:[]){var s;"lookup"===e.type&&(e.from=t.outputNodes[e.from].getSource())}for(const c of n)c.name in e&&(c.values=e[c.name]);return n}(t.component.data,n)),a=t.assembleProjections(),s=t.assembleTitle(),c=t.assembleGroupStyle(),l=t.assembleGroupEncodeEntry(!0);let u=t.assembleLayoutSignals();u=u.filter((t=>"width"!==t.name&&"height"!==t.name||void 0===t.value||(e[t.name]=+t.value,!1)));const{params:f,...d}=e;return{$schema:"https://vega.github.io/schema/vega/v5.json",...t.description?{description:t.description}:{},...d,...s?{title:s}:{},...c?{style:c}:{},...l?{encode:{update:l}}:{},data:o,...a.length>0?{projections:a}:{},...t.assembleGroup([...u,...t.assembleSelectionTopLevelSignals([]),...pc(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}(r,function(t,e,n,i){const r=i.component.layoutSize.get("width"),o=i.component.layoutSize.get("height");void 0===e?(e={type:"pad"},i.hasAxisOrientSignalRef()&&(e.resize=!0)):(0,I.HD)(e)&&(e={type:e});if(r&&o&&(a=e.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===r&&"step"===o)dr(Ri()),e.type="pad";else if("step"===r||"step"===o){const t="step"===r?"width":"height";dr(Ri(kn(t)));const n="width"===t?"height":"width";e.type=function(t){return t?"fit-".concat(kn(t)):"fit"}(n)}var a;return{...1===bt(e).length&&e.type?"pad"===e.type?{}:{autosize:e.type}:{autosize:e},...jl(n,!1),...jl(t,!0)}}(t,i.autosize,n,r),t.datasets,t.usermeta);return{spec:o,normalized:i}}finally{e.logger&&fr(),e.fieldTitle&&Ka(Va)}}const mm="5.9.3";const gm=function(t){const[e,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:e,version:n}};var vm="2.14.0";const ym="#fff",bm="#888",xm={background:"#333",view:{stroke:bm},title:{color:ym,subtitleColor:ym},style:{"guide-label":{fill:ym},"guide-title":{fill:ym}},axis:{domainColor:ym,gridColor:bm,tickColor:ym}},_m="#4572a7",wm={background:"#fff",arc:{fill:_m},area:{fill:_m},line:{stroke:_m,strokeWidth:2},path:{stroke:_m},rect:{fill:_m},shape:{stroke:_m},symbol:{fill:_m,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"]}},km="#30a2da",Em="#cbcbcb",Dm="#f0f0f0",Am="#333",Sm={arc:{fill:km},area:{fill:km},axis:{domainColor:Em,grid:!0,gridColor:Em,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:Em,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:Dm,group:{fill:Dm},legend:{labelColor:Am,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:Am,titleFontSize:14,titlePadding:10},line:{stroke:km,strokeWidth:2},path:{stroke:km,strokeWidth:.5},rect:{fill:km},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:km},bar:{binSpacing:2,fill:km,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Mm="#000",Cm={group:{fill:"#e5e5e5"},arc:{fill:Mm},area:{fill:Mm},line:{stroke:Mm},path:{stroke:Mm},rect:{fill:Mm},shape:{stroke:Mm},symbol:{fill:Mm,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"]}},Fm="Benton Gothic, sans-serif",Om="#82c6df",Nm="Benton Gothic Bold, sans-serif",Tm="normal",zm={"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"]},Rm={background:"#ffffff",title:{anchor:"start",color:"#000000",font:Nm,fontSize:22,fontWeight:"normal"},arc:{fill:Om},area:{fill:Om},line:{stroke:Om,strokeWidth:2},path:{stroke:Om},rect:{fill:Om},shape:{stroke:Om},symbol:{fill:Om,size:30},axis:{labelFont:Fm,labelFontSize:11.5,labelFontWeight:"normal",titleFont:Nm,titleFontSize:13,titleFontWeight:Tm},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:Fm,labelFontSize:11.5,symbolType:"square",titleFont:Nm,titleFontSize:13,titleFontWeight:Tm},range:{category:zm["category-6"],diverging:zm["fireandice-6"],heatmap:zm["fire-7"],ordinal:zm["fire-7"],ramp:zm["fire-7"]}},Pm="#ab5787",Lm="#979797",jm={background:"#f9f9f9",arc:{fill:Pm},area:{fill:Pm},line:{stroke:Pm},path:{stroke:Pm},rect:{fill:Pm},shape:{stroke:Pm},symbol:{fill:Pm,size:30},axis:{domainColor:Lm,domainWidth:.5,gridWidth:.2,labelColor:Lm,tickColor:Lm,tickWidth:.2,titleColor:Lm},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"]}},Bm="#3e5c69",Um={background:"#fff",arc:{fill:Bm},area:{fill:Bm},line:{stroke:Bm},path:{stroke:Bm},rect:{fill:Bm},shape:{stroke:Bm},symbol:{fill:Bm},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"]}},Im="#1696d2",qm="#000000",Wm="Lato",Hm="Lato",Xm={"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"]},Jm={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:Wm},axisX:{domain:!0,domainColor:qm,domainWidth:1,grid:!1,labelFontSize:12,labelFont:Hm,labelAngle:0,tickColor:qm,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Wm},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:Hm,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Wm,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:Hm,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Wm,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:Xm["six-groups-cat-1"],diverging:Xm["diverging-colors"],heatmap:Xm["diverging-colors"],ordinal:Xm["six-groups-seq"],ramp:Xm["shades-blue"]},area:{fill:Im},rect:{fill:Im},line:{color:Im,stroke:Im,strokeWidth:5},trail:{color:Im,stroke:Im,strokeWidth:0,size:1},path:{stroke:Im,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:Im,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Im,stroke:null}},arc:{fill:Im},shape:{stroke:Im},symbol:{fill:Im,size:30}},Gm="#3366CC",$m="#ccc",Vm="Arial, sans-serif",Ym={arc:{fill:Gm},area:{fill:Gm},path:{stroke:Gm},rect:{fill:Gm},shape:{stroke:Gm},symbol:{stroke:Gm},circle:{fill:Gm},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:Vm,fontSize:12},"guide-title":{font:Vm,fontSize:12},"group-title":{font:Vm,fontSize:12}},title:{font:Vm,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:$m,tickColor:$m,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Km=t=>t*(1/3+1),Zm=Km(9),Qm=Km(10),tg=Km(12),eg="Segoe UI",ng="wf_standard-font, helvetica, arial, sans-serif",ig="#252423",rg="#605E5C",og="transparent",ag="#118DFF",sg="#DEEFFF",cg=[sg,ag],lg={view:{stroke:og},background:og,font:eg,header:{titleFont:ng,titleFontSize:tg,titleColor:ig,labelFont:eg,labelFontSize:Qm,labelColor:rg},axis:{ticks:!1,grid:!1,domain:!1,labelColor:rg,labelFontSize:Zm,titleFont:ng,titleColor:ig,titleFontSize:tg,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:ag},line:{stroke:ag,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:eg,fontSize:Zm,fill:rg},arc:{fill:ag},area:{fill:ag,line:!0,opacity:.6},path:{stroke:ag},rect:{fill:ag},point:{fill:ag,filled:!0,size:75},shape:{stroke:ag},symbol:{fill:ag,strokeWidth:1.5,size:50},legend:{titleFont:eg,titleFontWeight:"bold",titleColor:rg,labelFont:eg,labelFontSize:Qm,labelColor:rg,symbolType:"circle",symbolSize:75},range:{category:[ag,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:cg,heatmap:cg,ordinal:[sg,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",ag]}},ug='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',fg=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],dg=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function hg(t){let{type:e,background:n}=t;const i="dark"===e?"#161616":"#ffffff",r="dark"===e?"#f4f4f4":"#161616",o="dark"===e?"#d4bbff":"#6929c4";return{background:n,arc:{fill:o},area:{fill:o},path:{stroke:o},rect:{fill:o},shape:{stroke:o},symbol:{stroke:o},circle:{fill:o},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:ug,fontWeight:600},axis:{labelColor:r,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:r,labelAngle:0},style:{"guide-label":{font:ug,fill:r,fontWeight:400},"guide-title":{font:ug,fill:r,fontWeight:400}},range:{category:"dark"===e?fg:dg,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 pg=hg({type:"light",background:"#ffffff"}),mg=hg({type:"light",background:"#f4f4f4"}),gg=hg({type:"dark",background:"#262626"}),vg=hg({type:"dark",background:"#161616"}),yg=vm;function bg(t,e){return JSON.stringify(t,function(t){const e=[];return function(n,i){if("object"!==typeof i||null===i)return i;const r=e.indexOf(this)+1;return e.length=r,e.length>t?"[Object]":e.indexOf(i)>=0?"[Circular]":(e.push(i),i)}}(e))}const xg="vg-tooltip-element",_g={offsetX:10,offsetY:10,id:xg,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(t){return String(t).replace(/&/g,"&").replace(/</g,"<")},maxDepth:2,formatTooltip:function(t,e,n){if((0,I.kJ)(t))return"[".concat(t.map((t=>e((0,I.HD)(t)?t:bg(t,n)))).join(", "),"]");if((0,I.Kn)(t)){let i="";const{title:r,image:o,...a}=t;r&&(i+="<h2>".concat(e(r),"</h2>")),o&&(i+='<img src="'.concat(e(o),'">'));const s=Object.keys(a);if(s.length>0){i+="<table>";for(const t of s){let r=a[t];void 0!==r&&((0,I.Kn)(r)&&(r=bg(r,n)),i+='<tr><td class="key">'.concat(e(t),'</td><td class="value">').concat(e(r),"</td></tr>"))}i+="</table>"}return i||"{}"}return e(t)}};class wg{constructor(t){this.options={..._g,...t};const e=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const t=document.createElement("style");t.setAttribute("id",this.options.styleId),t.innerHTML=function(t){if(!/^[A-Za-z]+[-:.\w]*$/.test(t))throw new Error("Invalid HTML ID");return"#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".toString().replace(xg,t)}(e);const n=document.head;n.childNodes.length>0?n.insertBefore(t,n.childNodes[0]):n.appendChild(t)}}tooltipHandler(t,e,n,i){if(this.el=document.getElementById(this.options.id),!this.el){var r;this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip");(null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body).appendChild(this.el)}if(null==i||""===i)return void this.el.classList.remove("visible","".concat(this.options.theme,"-theme"));this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible","".concat(this.options.theme,"-theme"));const{x:o,y:a}=function(t,e,n,i){let r=t.clientX+n;r+e.width>window.innerWidth&&(r=+t.clientX-n-e.width);let o=t.clientY+i;return o+e.height>window.innerHeight&&(o=+t.clientY-i-e.height),{x:r,y:o}}(e,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top="".concat(a,"px"),this.el.style.left="".concat(o,"px")}}var kg,Eg,Dg;function Ag(t){return Ag="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ag(t)}function Sg(t){var e=function(t,e){if("object"!==Ag(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ag(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ag(e)?e:String(e)}function Mg(t,e,n){return(e=Sg(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fg=Og;function Og(t){var e=this;if(e instanceof Og||(e=new Og),e.tail=null,e.head=null,e.length=0,t&&"function"===typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)e.push(arguments[n]);return e}function Ng(t,e,n){var i=e===t.head?new Rg(n,null,e,t):new Rg(n,e,e.next,t);return null===i.next&&(t.tail=i),null===i.prev&&(t.head=i),t.length++,i}function Tg(t,e){t.tail=new Rg(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function zg(t,e){t.head=new Rg(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function Rg(t,e,n,i){if(!(this instanceof Rg))return new Rg(t,e,n,i);this.list=i,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}Og.Node=Rg,Og.create=Og,Og.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;return e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null,e},Og.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},Og.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}},Og.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)Tg(this,arguments[t]);return this.length},Og.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)zg(this,arguments[t]);return this.length},Og.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},Og.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},Og.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,i=0;null!==n;i++)t.call(e,n.value,i,this),n=n.next},Og.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,i=this.length-1;null!==n;i--)t.call(e,n.value,i,this),n=n.prev},Og.prototype.get=function(t){for(var e=0,n=this.head;null!==n&&e<t;e++)n=n.next;if(e===t&&null!==n)return n.value},Og.prototype.getReverse=function(t){for(var e=0,n=this.tail;null!==n&&e<t;e++)n=n.prev;if(e===t&&null!==n)return n.value},Og.prototype.map=function(t,e){e=e||this;for(var n=new Og,i=this.head;null!==i;)n.push(t.call(e,i.value,this)),i=i.next;return n},Og.prototype.mapReverse=function(t,e){e=e||this;for(var n=new Og,i=this.tail;null!==i;)n.push(t.call(e,i.value,this)),i=i.prev;return n},Og.prototype.reduce=function(t,e){var n,i=this.head;if(arguments.length>1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,n=this.head.value}for(var r=0;null!==i;r++)n=t(n,i.value,r),i=i.next;return n},Og.prototype.reduceReverse=function(t,e){var n,i=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==i;r--)n=t(n,i.value,r),i=i.prev;return n},Og.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},Og.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},Og.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new Og;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=0,r=this.head;null!==r&&i<t;i++)r=r.next;for(;null!==r&&i<e;i++,r=r.next)n.push(r.value);return n},Og.prototype.sliceReverse=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new Og;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=this.length,r=this.tail;null!==r&&i>e;i--)r=r.prev;for(;null!==r&&i>t;i--,r=r.prev)n.push(r.value);return n},Og.prototype.splice=function(t,e){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;null!==i&&n<t;n++)i=i.next;var r=[];for(n=0;i&&n<e;n++)r.push(i.value),i=this.removeNode(i);null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(n=0;n<(arguments.length<=2?0:arguments.length-2);n++)i=Ng(this,i,n+2<2||arguments.length<=n+2?void 0:arguments[n+2]);return r},Og.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;null!==n;n=n.prev){var i=n.prev;n.prev=n.next,n.next=i}return this.head=e,this.tail=t,this};try{(Dg||(Dg=1,Eg=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Eg)(Og)}catch(sy){}const Pg=Fg,Lg=Symbol("max"),jg=Symbol("length"),Bg=Symbol("lengthCalculator"),Ug=Symbol("allowStale"),Ig=Symbol("maxAge"),qg=Symbol("dispose"),Wg=Symbol("noDisposeOnSet"),Hg=Symbol("lruList"),Xg=Symbol("cache"),Jg=Symbol("updateAgeOnGet"),Gg=()=>1;const $g=(t,e,n)=>{const i=t[Xg].get(e);if(i){const e=i.value;if(Vg(t,e)){if(Kg(t,i),!t[Ug])return}else n&&(t[Jg]&&(i.value.now=Date.now()),t[Hg].unshiftNode(i));return e.value}},Vg=(t,e)=>{if(!e||!e.maxAge&&!t[Ig])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[Ig]&&n>t[Ig]},Yg=t=>{if(t[jg]>t[Lg])for(let e=t[Hg].tail;t[jg]>t[Lg]&&null!==e;){const n=e.prev;Kg(t,e),e=n}},Kg=(t,e)=>{if(e){const n=e.value;t[qg]&&t[qg](n.key,n.value),t[jg]-=n.length,t[Xg].delete(n.key),t[Hg].removeNode(e)}};class Zg{constructor(t,e,n,i,r){this.key=t,this.value=e,this.length=n,this.now=i,this.maxAge=r||0}}const Qg=(t,e,n,i)=>{let r=n.value;Vg(t,r)&&(Kg(t,n),t[Ug]||(r=void 0)),r&&e.call(i,r.value,r.key,t)};var tv=class{constructor(t){if("number"===typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!==typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[Lg]=t.max||1/0;const e=t.length||Gg;if(this[Bg]="function"!==typeof e?Gg:e,this[Ug]=t.stale||!1,t.maxAge&&"number"!==typeof t.maxAge)throw new TypeError("maxAge must be a number");this[Ig]=t.maxAge||0,this[qg]=t.dispose,this[Wg]=t.noDisposeOnSet||!1,this[Jg]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!==typeof t||t<0)throw new TypeError("max must be a non-negative number");this[Lg]=t||1/0,Yg(this)}get max(){return this[Lg]}set allowStale(t){this[Ug]=!!t}get allowStale(){return this[Ug]}set maxAge(t){if("number"!==typeof t)throw new TypeError("maxAge must be a non-negative number");this[Ig]=t,Yg(this)}get maxAge(){return this[Ig]}set lengthCalculator(t){"function"!==typeof t&&(t=Gg),t!==this[Bg]&&(this[Bg]=t,this[jg]=0,this[Hg].forEach((t=>{t.length=this[Bg](t.value,t.key),this[jg]+=t.length}))),Yg(this)}get lengthCalculator(){return this[Bg]}get length(){return this[jg]}get itemCount(){return this[Hg].length}rforEach(t,e){e=e||this;for(let n=this[Hg].tail;null!==n;){const i=n.prev;Qg(this,t,n,e),n=i}}forEach(t,e){e=e||this;for(let n=this[Hg].head;null!==n;){const i=n.next;Qg(this,t,n,e),n=i}}keys(){return this[Hg].toArray().map((t=>t.key))}values(){return this[Hg].toArray().map((t=>t.value))}reset(){this[qg]&&this[Hg]&&this[Hg].length&&this[Hg].forEach((t=>this[qg](t.key,t.value))),this[Xg]=new Map,this[Hg]=new Pg,this[jg]=0}dump(){return this[Hg].map((t=>!Vg(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[Hg]}set(t,e,n){if((n=n||this[Ig])&&"number"!==typeof n)throw new TypeError("maxAge must be a number");const i=n?Date.now():0,r=this[Bg](e,t);if(this[Xg].has(t)){if(r>this[Lg])return Kg(this,this[Xg].get(t)),!1;const o=this[Xg].get(t).value;return this[qg]&&(this[Wg]||this[qg](t,o.value)),o.now=i,o.maxAge=n,o.value=e,this[jg]+=r-o.length,o.length=r,this.get(t),Yg(this),!0}const o=new Zg(t,e,r,i,n);return o.length>this[Lg]?(this[qg]&&this[qg](t,e),!1):(this[jg]+=o.length,this[Hg].unshift(o),this[Xg].set(t,this[Hg].head),Yg(this),!0)}has(t){if(!this[Xg].has(t))return!1;const e=this[Xg].get(t).value;return!Vg(this,e)}get(t){return $g(this,t,!0)}peek(t){return $g(this,t,!1)}pop(){const t=this[Hg].tail;return t?(Kg(this,t),t.value):null}del(t){Kg(this,this[Xg].get(t))}load(t){this.reset();const e=Date.now();for(let n=t.length-1;n>=0;n--){const i=t[n],r=i.e||0;if(0===r)this.set(i.k,i.v);else{const t=r-e;t>0&&this.set(i.k,i.v,t)}}}prune(){this[Xg].forEach(((t,e)=>$g(this,e,!1)))}};const ev=Object.freeze({loose:!0}),nv=Object.freeze({});var iv=t=>t?"object"!==typeof t?ev:t:nv,rv={exports:{}};var ov={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 av="object"===typeof process&&{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG&&/\bsemver\b/i.test({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG)?function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return console.error("SEMVER",...e)}:()=>{};!function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=ov,o=av,a=(e=t.exports={}).re=[],s=e.safeRe=[],c=e.src=[],l=e.t={};let u=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=(t,e,n)=>{const i=(t=>{for(const[e,n]of d)t=t.split("".concat(e,"*")).join("".concat(e,"{0,").concat(n,"}")).split("".concat(e,"+")).join("".concat(e,"{1,").concat(n,"}"));return t})(e),r=u++;o(t,r,e),l[t]=r,c[r]=e,a[r]=new RegExp(e,n?"g":void 0),s[r]=new RegExp(i,n?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-]".concat(f,"*")),h("MAINVERSION","(".concat(c[l.NUMERICIDENTIFIER],")\\.")+"(".concat(c[l.NUMERICIDENTIFIER],")\\.")+"(".concat(c[l.NUMERICIDENTIFIER],")")),h("MAINVERSIONLOOSE","(".concat(c[l.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(c[l.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(c[l.NUMERICIDENTIFIERLOOSE],")")),h("PRERELEASEIDENTIFIER","(?:".concat(c[l.NUMERICIDENTIFIER],"|").concat(c[l.NONNUMERICIDENTIFIER],")")),h("PRERELEASEIDENTIFIERLOOSE","(?:".concat(c[l.NUMERICIDENTIFIERLOOSE],"|").concat(c[l.NONNUMERICIDENTIFIER],")")),h("PRERELEASE","(?:-(".concat(c[l.PRERELEASEIDENTIFIER],"(?:\\.").concat(c[l.PRERELEASEIDENTIFIER],")*))")),h("PRERELEASELOOSE","(?:-?(".concat(c[l.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(c[l.PRERELEASEIDENTIFIERLOOSE],")*))")),h("BUILDIDENTIFIER","".concat(f,"+")),h("BUILD","(?:\\+(".concat(c[l.BUILDIDENTIFIER],"(?:\\.").concat(c[l.BUILDIDENTIFIER],")*))")),h("FULLPLAIN","v?".concat(c[l.MAINVERSION]).concat(c[l.PRERELEASE],"?").concat(c[l.BUILD],"?")),h("FULL","^".concat(c[l.FULLPLAIN],"$")),h("LOOSEPLAIN","[v=\\s]*".concat(c[l.MAINVERSIONLOOSE]).concat(c[l.PRERELEASELOOSE],"?").concat(c[l.BUILD],"?")),h("LOOSE","^".concat(c[l.LOOSEPLAIN],"$")),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE","".concat(c[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),h("XRANGEIDENTIFIER","".concat(c[l.NUMERICIDENTIFIER],"|x|X|\\*")),h("XRANGEPLAIN","[v=\\s]*(".concat(c[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(c[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(c[l.XRANGEIDENTIFIER],")")+"(?:".concat(c[l.PRERELEASE],")?").concat(c[l.BUILD],"?")+")?)?"),h("XRANGEPLAINLOOSE","[v=\\s]*(".concat(c[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(c[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(c[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(c[l.PRERELEASELOOSE],")?").concat(c[l.BUILD],"?")+")?)?"),h("XRANGE","^".concat(c[l.GTLT],"\\s*").concat(c[l.XRANGEPLAIN],"$")),h("XRANGELOOSE","^".concat(c[l.GTLT],"\\s*").concat(c[l.XRANGEPLAINLOOSE],"$")),h("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:$|[^\\d])"),h("COERCERTL",c[l.COERCE],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM","(\\s*)".concat(c[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",h("TILDE","^".concat(c[l.LONETILDE]).concat(c[l.XRANGEPLAIN],"$")),h("TILDELOOSE","^".concat(c[l.LONETILDE]).concat(c[l.XRANGEPLAINLOOSE],"$")),h("LONECARET","(?:\\^)"),h("CARETTRIM","(\\s*)".concat(c[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",h("CARET","^".concat(c[l.LONECARET]).concat(c[l.XRANGEPLAIN],"$")),h("CARETLOOSE","^".concat(c[l.LONECARET]).concat(c[l.XRANGEPLAINLOOSE],"$")),h("COMPARATORLOOSE","^".concat(c[l.GTLT],"\\s*(").concat(c[l.LOOSEPLAIN],")$|^$")),h("COMPARATOR","^".concat(c[l.GTLT],"\\s*(").concat(c[l.FULLPLAIN],")$|^$")),h("COMPARATORTRIM","(\\s*)".concat(c[l.GTLT],"\\s*(").concat(c[l.LOOSEPLAIN],"|").concat(c[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE","^\\s*(".concat(c[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(c[l.XRANGEPLAIN],")")+"\\s*$"),h("HYPHENRANGELOOSE","^\\s*(".concat(c[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(c[l.XRANGEPLAINLOOSE],")")+"\\s*$"),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(rv,rv.exports);var sv=rv.exports;const cv=/^[0-9]+$/,lv=(t,e)=>{const n=cv.test(t),i=cv.test(e);return n&&i&&(t=+t,e=+e),t===e?0:n&&!i?-1:i&&!n?1:t<e?-1:1};var uv={compareIdentifiers:lv,rcompareIdentifiers:(t,e)=>lv(e,t)};const fv=av,{MAX_LENGTH:dv,MAX_SAFE_INTEGER:hv}=ov,{safeRe:pv,t:mv}=sv,gv=iv,{compareIdentifiers:vv}=uv;var yv=class t{constructor(e,n){if(n=gv(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if("string"!==typeof e)throw new TypeError('Invalid version. Must be a string. Got type "'.concat(typeof e,'".'));if(e.length>dv)throw new TypeError("version is longer than ".concat(dv," characters"));fv("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const i=e.trim().match(n.loose?pv[mv.LOOSE]:pv[mv.FULL]);if(!i)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>hv||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hv||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hv||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((t=>{if(/^[0-9]+$/.test(t)){const e=+t;if(e>=0&&e<hv)return e}return t})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version="".concat(this.major,".").concat(this.minor,".").concat(this.patch),this.prerelease.length&&(this.version+="-".concat(this.prerelease.join("."))),this.version}toString(){return this.version}compare(e){if(fv("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if("string"===typeof e&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),vv(this.major,e.major)||vv(this.minor,e.minor)||vv(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const t=this.prerelease[n],i=e.prerelease[n];if(fv("prerelease compare",n,t,i),void 0===t&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===t)return-1;if(t!==i)return vv(t,i)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{const t=this.build[n],i=e.build[n];if(fv("prerelease compare",n,t,i),void 0===t&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===t)return-1;if(t!==i)return vv(t,i)}while(++n)}inc(t,e,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e,n),this.inc("pre",e,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e,n),this.inc("pre",e,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 t=Number(n)?1:0;if(!e&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[t];else{let i=this.prerelease.length;for(;--i>=0;)"number"===typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(t)}}if(e){let i=[e,t];!1===n&&(i=[e]),0===vv(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}};const bv=yv;var xv=(t,e,n)=>new bv(t,n).compare(new bv(e,n));const _v=xv;const wv=xv;const kv=xv;const Ev=xv;const Dv=xv;const Av=xv;const Sv=(t,e,n)=>0===_v(t,e,n),Mv=(t,e,n)=>0!==wv(t,e,n),Cv=(t,e,n)=>kv(t,e,n)>0,Fv=(t,e,n)=>Ev(t,e,n)>=0,Ov=(t,e,n)=>Dv(t,e,n)<0,Nv=(t,e,n)=>Av(t,e,n)<=0;var Tv,zv,Rv,Pv,Lv=(t,e,n,i)=>{switch(e){case"===":return"object"===typeof t&&(t=t.version),"object"===typeof n&&(n=n.version),t===n;case"!==":return"object"===typeof t&&(t=t.version),"object"===typeof n&&(n=n.version),t!==n;case"":case"=":case"==":return Sv(t,n,i);case"!=":return Mv(t,n,i);case">":return Cv(t,n,i);case">=":return Fv(t,n,i);case"<":return Ov(t,n,i);case"<=":return Nv(t,n,i);default:throw new TypeError("Invalid operator: ".concat(e))}};function jv(){if(Pv)return Rv;Pv=1;class t{constructor(e,r){if(r=n(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof i)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((t=>this.parseRange(t.trim()))).filter((t=>t.length)),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){const t=this.set[0];if(this.set=this.set.filter((t=>!h(t[0]))),0===this.set.length)this.set=[t];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&p(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((t=>t.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(t){const n=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+t,o=e.get(n);if(o)return o;const p=this.options.loose,m=p?a[s.HYPHENRANGELOOSE]:a[s.HYPHENRANGE];t=t.replace(m,A(this.options.includePrerelease)),r("hyphen replace",t),t=t.replace(a[s.COMPARATORTRIM],c),r("comparator trim",t),t=t.replace(a[s.TILDETRIM],l),r("tilde trim",t),t=t.replace(a[s.CARETTRIM],u),r("caret trim",t);let v=t.split(" ").map((t=>g(t,this.options))).join(" ").split(/\s+/).map((t=>D(t,this.options)));p&&(v=v.filter((t=>(r("loose invalid filter",t,this.options),!!t.match(a[s.COMPARATORLOOSE]))))),r("range list",v);const y=new Map,b=v.map((t=>new i(t,this.options)));for(const e of b){if(h(e))return[e];y.set(e.value,e)}y.size>1&&y.has("")&&y.delete("");const x=[...y.values()];return e.set(n,x),x}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>m(t,n)&&e.set.some((e=>m(e,n)&&t.every((t=>e.every((e=>t.intersects(e,n)))))))))}test(t){if(!t)return!1;if("string"===typeof t)try{t=new o(t,this.options)}catch(sy){return!1}for(let e=0;e<this.set.length;e++)if(S(this.set[e],t,this.options))return!0;return!1}}Rv=t;const e=new tv({max:1e3}),n=iv,i=function(){if(zv)return Tv;zv=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(i,r){if(r=n(r),i instanceof e){if(i.loose===!!r.loose)return i;i=i.value}i=i.trim().split(/\s+/).join(" "),a("comparator",i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.semver===t?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(e){const n=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],o=e.match(n);if(!o)throw new TypeError("Invalid comparator: ".concat(e));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=t}toString(){return this.value}test(e){if(a("Comparator.test",e,this.options.loose),this.semver===t||e===t)return!0;if("string"===typeof e)try{e=new s(e,this.options)}catch(sy){return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,i){if(!(t instanceof e))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(t.value,i).test(this.value):""===t.operator?""===t.value||new c(this.value,i).test(t.semver):(!(i=n(i)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==t.value)&&!(!i.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!t.operator.startsWith(">"))||!(!this.operator.startsWith("<")||!t.operator.startsWith("<"))||!(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))||!!(o(this.semver,"<",t.semver,i)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))||!!(o(this.semver,">",t.semver,i)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}Tv=e;const n=iv,{safeRe:i,t:r}=sv,o=Lv,a=av,s=yv,c=jv();return Tv}(),r=av,o=yv,{safeRe:a,t:s,comparatorTrimReplace:c,tildeTrimReplace:l,caretTrimReplace:u}=sv,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=ov,h=t=>"<0.0.0-0"===t.value,p=t=>""===t.value,m=(t,e)=>{let n=!0;const i=t.slice();let r=i.pop();for(;n&&i.length;)n=i.every((t=>r.intersects(t,e))),r=i.pop();return n},g=(t,e)=>(r("comp",t,e),t=x(t,e),r("caret",t),t=y(t,e),r("tildes",t),t=w(t,e),r("xrange",t),t=E(t,e),r("stars",t),t),v=t=>!t||"x"===t.toLowerCase()||"*"===t,y=(t,e)=>t.trim().split(/\s+/).map((t=>b(t,e))).join(" "),b=(t,e)=>{const n=e.loose?a[s.TILDELOOSE]:a[s.TILDE];return t.replace(n,((e,n,i,o,a)=>{let s;return r("tilde",t,e,n,i,o,a),v(n)?s="":v(i)?s=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):v(o)?s=">=".concat(n,".").concat(i,".0 <").concat(n,".").concat(+i+1,".0-0"):a?(r("replaceTilde pr",a),s=">=".concat(n,".").concat(i,".").concat(o,"-").concat(a," <").concat(n,".").concat(+i+1,".0-0")):s=">=".concat(n,".").concat(i,".").concat(o," <").concat(n,".").concat(+i+1,".0-0"),r("tilde return",s),s}))},x=(t,e)=>t.trim().split(/\s+/).map((t=>_(t,e))).join(" "),_=(t,e)=>{r("caret",t,e);const n=e.loose?a[s.CARETLOOSE]:a[s.CARET],i=e.includePrerelease?"-0":"";return t.replace(n,((e,n,o,a,s)=>{let c;return r("caret",t,e,n,o,a,s),v(n)?c="":v(o)?c=">=".concat(n,".0.0").concat(i," <").concat(+n+1,".0.0-0"):v(a)?c="0"===n?">=".concat(n,".").concat(o,".0").concat(i," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".0").concat(i," <").concat(+n+1,".0.0-0"):s?(r("replaceCaret pr",s),c="0"===n?"0"===o?">=".concat(n,".").concat(o,".").concat(a,"-").concat(s," <").concat(n,".").concat(o,".").concat(+a+1,"-0"):">=".concat(n,".").concat(o,".").concat(a,"-").concat(s," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".").concat(a,"-").concat(s," <").concat(+n+1,".0.0-0")):(r("no pr"),c="0"===n?"0"===o?">=".concat(n,".").concat(o,".").concat(a).concat(i," <").concat(n,".").concat(o,".").concat(+a+1,"-0"):">=".concat(n,".").concat(o,".").concat(a).concat(i," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".").concat(a," <").concat(+n+1,".0.0-0")),r("caret return",c),c}))},w=(t,e)=>(r("replaceXRanges",t,e),t.split(/\s+/).map((t=>k(t,e))).join(" ")),k=(t,e)=>{t=t.trim();const n=e.loose?a[s.XRANGELOOSE]:a[s.XRANGE];return t.replace(n,((n,i,o,a,s,c)=>{r("xRange",t,n,i,o,a,s,c);const l=v(o),u=l||v(a),f=u||v(s),d=f;return"="===i&&d&&(i=""),c=e.includePrerelease?"-0":"",l?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&d?(u&&(a=0),s=0,">"===i?(i=">=",u?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===i&&(i="<",u?o=+o+1:a=+a+1),"<"===i&&(c="-0"),n="".concat(i+o,".").concat(a,".").concat(s).concat(c)):u?n=">=".concat(o,".0.0").concat(c," <").concat(+o+1,".0.0-0"):f&&(n=">=".concat(o,".").concat(a,".0").concat(c," <").concat(o,".").concat(+a+1,".0-0")),r("xRange return",n),n}))},E=(t,e)=>(r("replaceStars",t,e),t.trim().replace(a[s.STAR],"")),D=(t,e)=>(r("replaceGTE0",t,e),t.trim().replace(a[e.includePrerelease?s.GTE0PRE:s.GTE0],"")),A=t=>(e,n,i,r,o,a,s,c,l,u,f,d,h)=>(n=v(i)?"":v(r)?">=".concat(i,".0.0").concat(t?"-0":""):v(o)?">=".concat(i,".").concat(r,".0").concat(t?"-0":""):a?">=".concat(n):">=".concat(n).concat(t?"-0":""),c=v(l)?"":v(u)?"<".concat(+l+1,".0.0-0"):v(f)?"<".concat(l,".").concat(+u+1,".0-0"):d?"<=".concat(l,".").concat(u,".").concat(f,"-").concat(d):t?"<".concat(l,".").concat(u,".").concat(+f+1,"-0"):"<=".concat(c),"".concat(n," ").concat(c).trim()),S=(t,e,n)=>{for(let i=0;i<t.length;i++)if(!t[i].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let n=0;n<t.length;n++)if(r(t[n].semver),t[n].semver!==i.ANY&&t[n].semver.prerelease.length>0){const i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0};return Rv}const Bv=jv();var Uv=(t,e,n)=>{try{e=new Bv(e,n)}catch(sy){return!1}return e.test(t)},Iv=Cg(Uv);var qv='.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 Wv(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];for(const r of n)Hv(t,r);return t}function Hv(t,e){for(const n of Object.keys(e))(0,B.writeConfig)(t,n,e[n],!0)}function Xv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Jv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xv(Object(n),!0).forEach((function(e){Mg(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}const Gv=B;let $v=o;const Vv="undefined"!==typeof window?window:void 0;void 0===$v&&null!==Vv&&void 0!==Vv&&null!==(kg=Vv.vl)&&void 0!==kg&&kg.compile&&($v=Vv.vl);const Yv={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Kv={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"},Zv={vega:"Vega","vega-lite":"Vega-Lite"},Qv={vega:Gv.version,"vega-lite":$v?$v.version:"not available"},ty={vega:t=>t,"vega-lite":(t,e)=>$v.compile(t,{config:e}).spec},ey='\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>',ny="chart-wrapper";function iy(t,e,n,i){const r="<html><head>".concat(e,'</head><body><pre><code class="json">'),o="</code></pre>".concat(n,"</body></html>"),a=window.open("");a.document.write(r+t+o),a.document.title="".concat(Zv[i]," JSON Source")}function ry(t){return(e=t)&&"load"in e?t:Gv.loader(t);var e}async function oy(t,e){var n,i;let r,o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,B.isString)(e)?(o=ry(s.loader),r=JSON.parse(await o.load(e))):r=e;const c=function(t){var e,n;const i=null!==(e=null===(n=t.usermeta)||void 0===n?void 0:n.embedOptions)&&void 0!==e?e:{};return(0,B.isString)(i.defaultStyle)&&(i.defaultStyle=!1),i}(r),l=c.loader;var u;o&&!l||(o=ry(null!==(u=s.loader)&&void 0!==u?u:l));const f=await ay(c,o),d=await ay(s,o),h=Jv(Jv({},Wv(d,f)),{},{config:(0,B.mergeConfig)(null!==(n=d.config)&&void 0!==n?n:{},null!==(i=f.config)&&void 0!==i?i:{})});return await async function(t,e){var n,i,r,o,s,c,l;let u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},f=arguments.length>3?arguments[3]:void 0;const d=u.theme?(0,B.mergeConfig)(a[u.theme],null!==(n=u.config)&&void 0!==n?n:{}):u.config,h=(0,B.isBoolean)(u.actions)?u.actions:Wv({},Yv,null!==(i=u.actions)&&void 0!==i?i:{}),p=Jv(Jv({},Kv),u.i18n),m=null!==(r=u.renderer)&&void 0!==r?r:"canvas",g=null!==(o=u.logLevel)&&void 0!==o?o:Gv.Warn,v=null!==(s=u.downloadFileName)&&void 0!==s?s:"visualization",y="string"===typeof t?document.querySelector(t):t;if(!y)throw new Error("".concat(t," does not exist"));if(!1!==u.defaultStyle){const t="vega-embed-style",{root:e,rootContainer:n}=function(t){var e;const n=t.getRootNode?t.getRootNode():document;return n instanceof ShadowRoot?{root:n,rootContainer:n}:{root:document,rootContainer:null!==(e=document.head)&&void 0!==e?e:document.body}}(y);if(!e.getElementById(t)){const e=document.createElement("style");e.id=t,e.innerHTML=void 0===u.defaultStyle||!0===u.defaultStyle?qv.toString():u.defaultStyle,n.appendChild(e)}}const b=function(t,e){if(t.$schema){const i=gm(t.$schema);var n;e&&e!==i.library&&console.warn("The given visualization spec is written in ".concat(Zv[i.library],", but mode argument sets ").concat(null!==(n=Zv[e])&&void 0!==n?n:e,"."));const r=i.library;return Iv(Qv[r],"^".concat(i.version.slice(1)))||console.warn("The input spec uses ".concat(Zv[r]," ").concat(i.version,", but the current version of ").concat(Zv[r]," is v").concat(Qv[r],".")),r}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":null!==e&&void 0!==e?e:"vega"}(e,u.mode);let x=ty[b](e,d);if("vega-lite"===b&&x.$schema){const t=gm(x.$schema);Iv(Qv.vega,"^".concat(t.version.slice(1)))||console.warn("The compiled spec uses Vega ".concat(t.version,", but current version is v").concat(Qv.vega,"."))}y.classList.add("vega-embed"),h&&y.classList.add("has-actions");y.innerHTML="";let _=y;if(h){const t=document.createElement("div");t.classList.add(ny),y.appendChild(t),_=t}const w=u.patch;w&&(x=w instanceof Function?w(x):E(x,w,!0,!1).newDocument);u.formatLocale&&Gv.formatLocale(u.formatLocale);u.timeFormatLocale&&Gv.timeFormatLocale(u.timeFormatLocale);if(u.expressionFunctions)for(const a in u.expressionFunctions){const t=u.expressionFunctions[a];"fn"in t?Gv.expressionFunction(a,t.fn,t.visitor):t instanceof Function&&Gv.expressionFunction(a,t)}const{ast:k}=u,D=Gv.parse(x,"vega-lite"===b?{}:d,{ast:k}),A=new(u.viewClass||Gv.View)(D,Jv({loader:f,logLevel:g,renderer:m},k?{expr:null!==(c=null!==(l=Gv.expressionInterpreter)&&void 0!==l?l:u.expr)&&void 0!==c?c:U.N}:{}));if(A.addSignalListener("autosize",((t,e)=>{const{type:n}=e;"fit-x"==n?(_.classList.add("fit-x"),_.classList.remove("fit-y")):"fit-y"==n?(_.classList.remove("fit-x"),_.classList.add("fit-y")):"fit"==n?_.classList.add("fit-x","fit-y"):_.classList.remove("fit-x","fit-y")})),!1!==u.tooltip){const t="function"===typeof u.tooltip?u.tooltip:new wg(!0===u.tooltip?{}:u.tooltip).call;A.tooltip(t)}let S,{hover:M}=u;void 0===M&&(M="vega"===b);if(M){const{hoverSet:t,updateSet:e}="boolean"===typeof M?{}:M;A.hover(t,e)}u&&(null!=u.width&&A.width(u.width),null!=u.height&&A.height(u.height),null!=u.padding&&A.padding(u.padding));if(await A.initialize(_,u.bind).runAsync(),!1!==h){let t=y;if(!1!==u.defaultStyle||u.forceActionsMenu){const e=document.createElement("details");e.title=p.CLICK_TO_VIEW_ACTIONS,y.append(e),t=e;const n=document.createElement("summary");n.innerHTML=ey,e.append(n),S=t=>{e.contains(t.target)||e.removeAttribute("open")},document.addEventListener("click",S)}const n=document.createElement("div");if(t.append(n),n.classList.add("vega-actions"),!0===h||!1!==h.export)for(const e of["svg","png"])if(!0===h||!0===h.export||h.export[e]){const t=p["".concat(e.toUpperCase(),"_ACTION")],i=document.createElement("a"),r=(0,B.isObject)(u.scaleFactor)?u.scaleFactor[e]:u.scaleFactor;i.text=t,i.href="#",i.target="_blank",i.download="".concat(v,".").concat(e),i.addEventListener("mousedown",(async function(t){t.preventDefault();const n=await A.toImageURL(e,r);this.href=n})),n.append(i)}if(!0===h||!1!==h.source){const t=document.createElement("a");t.text=p.SOURCE_ACTION,t.href="#",t.addEventListener("click",(function(t){var n,i;iy(j()(e),null!==(n=u.sourceHeader)&&void 0!==n?n:"",null!==(i=u.sourceFooter)&&void 0!==i?i:"",b),t.preventDefault()})),n.append(t)}if("vega-lite"===b&&(!0===h||!1!==h.compiled)){const t=document.createElement("a");t.text=p.COMPILED_ACTION,t.href="#",t.addEventListener("click",(function(t){var e,n;iy(j()(x),null!==(e=u.sourceHeader)&&void 0!==e?e:"",null!==(n=u.sourceFooter)&&void 0!==n?n:"","vega"),t.preventDefault()})),n.append(t)}if(!0===h||!1!==h.editor){var C;const t=null!==(C=u.editorUrl)&&void 0!==C?C:"https://vega.github.io/editor/",i=document.createElement("a");i.text=p.EDITOR_ACTION,i.href="#",i.addEventListener("click",(function(n){!function(t,e,n){const i=t.open(e),{origin:r}=new URL(e);let o=40;t.addEventListener("message",(function e(n){n.source===i&&(o=0,t.removeEventListener("message",e,!1))}),!1),setTimeout((function t(){o<=0||(i.postMessage(n,r),setTimeout(t,250),o-=1)}),250)}(window,t,{config:d,mode:b,renderer:m,spec:j()(e)}),n.preventDefault()})),n.append(i)}}function F(){S&&document.removeEventListener("click",S),A.finalize()}return{view:A,spec:e,vgSpec:x,finalize:F,embedOptions:u}}(t,r,h,o)}async function ay(t,e){var n;const i=(0,B.isString)(t.config)?JSON.parse(await e.load(t.config)):null!==(n=t.config)&&void 0!==n?n:{},r=(0,B.isString)(t.patch)?JSON.parse(await e.load(t.patch)):t.patch;return Jv(Jv(Jv({},t),r?{patch:r}:{}),i?{config:i}:{})}},77155:(t,e,n)=>{"use strict";n.d(e,{r:()=>g});const i="view",r="[",o="]",a="{",s="}",c=":",l=",",u="@",f=">",d=/[[\]{}]/,h={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let p,m;function g(t,e,n){return p=e||i,m=n||h,y(t.trim()).map(b)}function v(t,e,n,i,r){const o=t.length;let a,s=0;for(;e<o;++e){if(a=t[e],!s&&a===n)return e;r&&r.indexOf(a)>=0?--s:i&&i.indexOf(a)>=0&&++s}return e}function y(t){const e=[],n=t.length;let i=0,c=0;for(;c<n;)c=v(t,c,l,r+a,o+s),e.push(t.substring(i,c).trim()),i=++c;if(0===e.length)throw"Empty event selector: "+t;return e}function b(t){return"["===t[0]?function(t){const e=t.length;let n,i=1;if(i=v(t,i,o,r,o),i===e)throw"Empty between selector: "+t;if(n=y(t.substring(1,i)),2!==n.length)throw"Between selector must have two elements: "+t;if(t=t.slice(i+1).trim(),t[0]!==f)throw"Expected '>' after between selector: "+t;n=n.map(b);const a=b(t.slice(1).trim());if(a.between)return{between:n,stream:a};a.between=n;return a}(t):function(t){const e={source:p},n=[];let i,f,h=[0,0],g=0,y=0,b=t.length,x=0;if(t[b-1]===s){if(x=t.lastIndexOf(a),!(x>=0))throw"Unmatched right brace: "+t;try{h=function(t){const e=t.split(l);if(!t.length||e.length>2)throw t;return e.map((e=>{const n=+e;if(n!==n)throw t;return n}))}(t.substring(x+1,b-1))}catch(w){throw"Invalid throttle specification: "+t}b=(t=t.slice(0,x).trim()).length,x=0}if(!b)throw t;t[0]===u&&(g=++x);i=v(t,x,c),i<b&&(n.push(t.substring(y,i).trim()),y=x=++i);if(x=v(t,x,r),x===b)n.push(t.substring(y,b).trim());else if(n.push(t.substring(y,x).trim()),f=[],y=++x,y===b)throw"Unmatched left bracket: "+t;for(;x<b;){if(x=v(t,x,o),x===b)throw"Unmatched left bracket: "+t;if(f.push(t.substring(y,x).trim()),x<b-1&&t[++x]!==r)throw"Expected left bracket: "+t;y=++x}if(!(b=n.length)||d.test(n[b-1]))throw"Invalid event selector: "+t;b>1?(e.type=n[1],g?e.markname=n[0].slice(1):(_=n[0],m[_]?e.marktype=n[0]:e.source=n[0])):e.type=n[0];var _;"!"===e.type.slice(-1)&&(e.consume=!0,e.type=e.type.slice(0,-1));null!=f&&(e.filter=f);h[0]&&(e.throttle=h[0]);h[1]&&(e.debounce=h[1]);return e}(t)}},88120:(t,e,n)=>{"use strict";n.d(e,{BJ:()=>Ht,Lt:()=>c,YP:()=>Gt,_G:()=>Xt,t$:()=>r,wk:()=>Jt});var i=n(15721);const r="Literal",o="Property",a="ArrayExpression",s="BinaryExpression",c="CallExpression",l="ConditionalExpression",u="LogicalExpression",f="MemberExpression",d="ObjectExpression",h="UnaryExpression";function p(t){this.type=t}var m,g,v,y,b;p.prototype.visit=function(t){let e,n,i;if(t(this))return 1;for(e=function(t){switch(t.type){case a:return t.elements;case s:case u:return[t.left,t.right];case c:return[t.callee].concat(t.arguments);case l:return[t.test,t.consequent,t.alternate];case f:return[t.object,t.property];case d:return t.properties;case o:return[t.key,t.value];case h:return[t.argument];default:return[]}}(this),n=0,i=e.length;n<i;++n)if(e[n].visit(t))return 1};var x=1,_=2,w=3,k=4,E=5,D=6,A=7,S=8;(m={})[x]="Boolean",m[_]="<end>",m[w]="Identifier",m[k]="Keyword",m[E]="Null",m[D]="Numeric",m[A]="Punctuator",m[S]="String",m[9]="RegularExpression";var M="ArrayExpression",C="BinaryExpression",F="CallExpression",O="ConditionalExpression",N="Identifier",T="Literal",z="LogicalExpression",R="MemberExpression",P="ObjectExpression",L="Property",j="UnaryExpression",B="Unexpected token %0",U="Unexpected number",I="Unexpected string",q="Unexpected identifier",W="Unexpected reserved word",H="Unexpected end of input",X="Invalid regular expression",J="Invalid regular expression: missing /",G="Octal literals are not allowed in strict mode.",$="Duplicate data property in object literal not allowed in strict mode",V="ILLEGAL",Y="Disabled.",K=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Z=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function Q(t,e){if(!t)throw new Error("ASSERT: "+e)}function tt(t){return t>=48&&t<=57}function et(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function nt(t){return"01234567".indexOf(t)>=0}function it(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function rt(t){return 10===t||13===t||8232===t||8233===t}function ot(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&K.test(String.fromCharCode(t))}function at(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&Z.test(String.fromCharCode(t))}const st={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function ct(){for(;v<y;){const t=g.charCodeAt(v);if(!it(t)&&!rt(t))break;++v}}function lt(t){var e,n,i,r=0;for(n="u"===t?4:2,e=0;e<n;++e)v<y&&et(g[v])?(i=g[v++],r=16*r+"0123456789abcdef".indexOf(i.toLowerCase())):Dt({},B,V);return String.fromCharCode(r)}function ut(){var t,e,n,i;for(e=0,"}"===(t=g[v])&&Dt({},B,V);v<y&&et(t=g[v++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&Dt({},B,V),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),i=56320+(e-65536&1023),String.fromCharCode(n,i))}function ft(){var t,e;for(t=g.charCodeAt(v++),e=String.fromCharCode(t),92===t&&(117!==g.charCodeAt(v)&&Dt({},B,V),++v,(t=lt("u"))&&"\\"!==t&&ot(t.charCodeAt(0))||Dt({},B,V),e=t);v<y&&at(t=g.charCodeAt(v));)++v,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==g.charCodeAt(v)&&Dt({},B,V),++v,(t=lt("u"))&&"\\"!==t&&at(t.charCodeAt(0))||Dt({},B,V),e+=t);return e}function dt(){var t,e;return t=v,e=92===g.charCodeAt(v)?ft():function(){var t,e;for(t=v++;v<y;){if(92===(e=g.charCodeAt(v)))return v=t,ft();if(!at(e))break;++v}return g.slice(t,v)}(),{type:1===e.length?w:st.hasOwnProperty(e)?k:"null"===e?E:"true"===e||"false"===e?x:w,value:e,start:t,end:v}}function ht(){var t,e,n,i,r=v,o=g.charCodeAt(v),a=g[v];switch(o){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++v,{type:A,value:String.fromCharCode(o),start:r,end:v};default:if(61===(t=g.charCodeAt(v+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return v+=2,{type:A,value:String.fromCharCode(o)+String.fromCharCode(t),start:r,end:v};case 33:case 61:return v+=2,61===g.charCodeAt(v)&&++v,{type:A,value:g.slice(r,v),start:r,end:v}}}return">>>="===(i=g.substr(v,4))?{type:A,value:i,start:r,end:v+=4}:">>>"===(n=i.substr(0,3))||"<<="===n||">>="===n?{type:A,value:n,start:r,end:v+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:A,value:e,start:r,end:v+=2}:("//"===e&&Dt({},B,V),"<>=!+-*%&|^/".indexOf(a)>=0?(++v,{type:A,value:a,start:r,end:v}):void Dt({},B,V))}function pt(){var t,e,n;if(Q(tt((n=g[v]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=v,t="","."!==n){if(t=g[v++],n=g[v],"0"===t){if("x"===n||"X"===n)return++v,function(t){let e="";for(;v<y&&et(g[v]);)e+=g[v++];return 0===e.length&&Dt({},B,V),ot(g.charCodeAt(v))&&Dt({},B,V),{type:D,value:parseInt("0x"+e,16),start:t,end:v}}(e);if(nt(n))return function(t){let e="0"+g[v++];for(;v<y&&nt(g[v]);)e+=g[v++];return(ot(g.charCodeAt(v))||tt(g.charCodeAt(v)))&&Dt({},B,V),{type:D,value:parseInt(e,8),octal:!0,start:t,end:v}}(e);n&&tt(n.charCodeAt(0))&&Dt({},B,V)}for(;tt(g.charCodeAt(v));)t+=g[v++];n=g[v]}if("."===n){for(t+=g[v++];tt(g.charCodeAt(v));)t+=g[v++];n=g[v]}if("e"===n||"E"===n)if(t+=g[v++],"+"!==(n=g[v])&&"-"!==n||(t+=g[v++]),tt(g.charCodeAt(v)))for(;tt(g.charCodeAt(v));)t+=g[v++];else Dt({},B,V);return ot(g.charCodeAt(v))&&Dt({},B,V),{type:D,value:parseFloat(t),start:e,end:v}}function mt(){var t,e,n,i;return b=null,ct(),t=v,e=function(){var t,e,n,i;for(Q("/"===(t=g[v]),"Regular expression literal must start with a slash"),e=g[v++],n=!1,i=!1;v<y;)if(e+=t=g[v++],"\\"===t)rt((t=g[v++]).charCodeAt(0))&&Dt({},J),e+=t;else if(rt(t.charCodeAt(0)))Dt({},J);else if(n)"]"===t&&(n=!1);else{if("/"===t){i=!0;break}"["===t&&(n=!0)}return i||Dt({},J),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";v<y&&at((t=g[v]).charCodeAt(0));)++v,"\\"===t&&v<y?Dt({},B,V):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&Dt({},X,n),{value:n,literal:e}}(),i=function(t,e){let n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((t,e)=>{if(parseInt(e,16)<=1114111)return"x";Dt({},X)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(i){Dt({},X)}try{return new RegExp(t,e)}catch(r){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:i,regex:{pattern:e.value,flags:n.value},start:t,end:v}}function gt(){if(ct(),v>=y)return{type:_,start:v,end:v};const t=g.charCodeAt(v);return ot(t)?dt():40===t||41===t||59===t?ht():39===t||34===t?function(){var t,e,n,i,r="",o=!1;for(Q("'"===(t=g[v])||'"'===t,"String literal must starts with a quote"),e=v,++v;v<y;){if((n=g[v++])===t){t="";break}if("\\"===n)if((n=g[v++])&&rt(n.charCodeAt(0)))"\r"===n&&"\n"===g[v]&&++v;else switch(n){case"u":case"x":"{"===g[v]?(++v,r+=ut()):r+=lt(n);break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:nt(n)?(0!==(i="01234567".indexOf(n))&&(o=!0),v<y&&nt(g[v])&&(o=!0,i=8*i+"01234567".indexOf(g[v++]),"0123".indexOf(n)>=0&&v<y&&nt(g[v])&&(i=8*i+"01234567".indexOf(g[v++]))),r+=String.fromCharCode(i)):r+=n}else{if(rt(n.charCodeAt(0)))break;r+=n}}return""!==t&&Dt({},B,V),{type:S,value:r,octal:o,start:e,end:v}}():46===t?tt(g.charCodeAt(v+1))?pt():ht():tt(t)?pt():ht()}function vt(){const t=b;return v=t.end,b=gt(),v=t.end,t}function yt(){const t=v;b=gt(),v=t}function bt(t,e,n){const i=new p("||"===t||"&&"===t?z:C);return i.operator=t,i.left=e,i.right=n,i}function xt(t,e){const n=new p(F);return n.callee=t,n.arguments=e,n}function _t(t){const e=new p(N);return e.name=t,e}function wt(t){const e=new p(T);return e.value=t.value,e.raw=g.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function kt(t,e,n){const i=new p(R);return i.computed="["===t,i.object=e,i.property=n,i.computed||(n.member=!0),i}function Et(t,e,n){const i=new p(L);return i.key=e,i.value=n,i.kind=t,i}function Dt(t,e){var n,i=Array.prototype.slice.call(arguments,2),r=e.replace(/%(\d)/g,((t,e)=>(Q(e<i.length,"Message reference must be in range"),i[e])));throw(n=new Error(r)).index=v,n.description=r,n}function At(t){t.type===_&&Dt(t,H),t.type===D&&Dt(t,U),t.type===S&&Dt(t,I),t.type===w&&Dt(t,q),t.type===k&&Dt(t,W),Dt(t,B,t.value)}function St(t){const e=vt();e.type===A&&e.value===t||At(e)}function Mt(t){return b.type===A&&b.value===t}function Ct(t){return b.type===k&&b.value===t}function Ft(){const t=[];for(v=b.start,St("[");!Mt("]");)Mt(",")?(vt(),t.push(null)):(t.push(qt()),Mt("]")||St(","));return vt(),function(t){const e=new p(M);return e.elements=t,e}(t)}function Ot(){v=b.start;const t=vt();return t.type===S||t.type===D?(t.octal&&Dt(t,G),wt(t)):_t(t.value)}function Nt(){var t,e,n;return v=b.start,(t=b).type===w?(n=Ot(),St(":"),Et("init",n,qt())):t.type!==_&&t.type!==A?(e=Ot(),St(":"),Et("init",e,qt())):void At(t)}function Tt(){var t,e,n=[],i={},r=String;for(v=b.start,St("{");!Mt("}");)e="$"+((t=Nt()).key.type===N?t.key.name:r(t.key.value)),Object.prototype.hasOwnProperty.call(i,e)?Dt({},$):i[e]=!0,n.push(t),Mt("}")||St(",");return St("}"),function(t){const e=new p(P);return e.properties=t,e}(n)}const zt={if:1};function Rt(){var t,e,n;if(Mt("("))return function(){St("(");const t=Wt();return St(")"),t}();if(Mt("["))return Ft();if(Mt("{"))return Tt();if(t=b.type,v=b.start,t===w||zt[b.value])n=_t(vt().value);else if(t===S||t===D)b.octal&&Dt(b,G),n=wt(vt());else{if(t===k)throw new Error(Y);t===x?((e=vt()).value="true"===e.value,n=wt(e)):t===E?((e=vt()).value=null,n=wt(e)):Mt("/")||Mt("/=")?(n=wt(mt()),yt()):At(vt())}return n}function Pt(){const t=[];if(St("("),!Mt(")"))for(;v<y&&(t.push(qt()),!Mt(")"));)St(",");return St(")"),t}function Lt(){v=b.start;const t=vt();return function(t){return t.type===w||t.type===k||t.type===x||t.type===E}(t)||At(t),_t(t.value)}function jt(){St("[");const t=Wt();return St("]"),t}function Bt(){const t=function(){var t;for(t=Rt();;)if(Mt("."))St("."),t=kt(".",t,Lt());else if(Mt("("))t=xt(t,Pt());else{if(!Mt("["))break;t=kt("[",t,jt())}return t}();if(b.type===A&&(Mt("++")||Mt("--")))throw new Error(Y);return t}function Ut(){var t,e;if(b.type!==A&&b.type!==k)e=Bt();else{if(Mt("++")||Mt("--"))throw new Error(Y);if(Mt("+")||Mt("-")||Mt("~")||Mt("!"))t=vt(),e=Ut(),e=function(t,e){const n=new p(j);return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if(Ct("delete")||Ct("void")||Ct("typeof"))throw new Error(Y);e=Bt()}}return e}function It(t){let e=0;if(t.type!==A&&t.type!==k)return 0;switch(t.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11}return e}function qt(){var t,e;return t=function(){var t,e,n,i,r,o,a,s,c,l;if(t=b,c=Ut(),0===(r=It(i=b)))return c;for(i.prec=r,vt(),e=[t,b],o=[c,i,a=Ut()];(r=It(b))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,c=o.pop(),e.pop(),n=bt(s,c,a),o.push(n);(i=vt()).prec=r,o.push(i),e.push(b),n=Ut(),o.push(n)}for(n=o[l=o.length-1],e.pop();l>1;)e.pop(),n=bt(o[l-1].value,o[l-2],n),l-=2;return n}(),Mt("?")&&(vt(),e=qt(),St(":"),t=function(t,e,n){const i=new p(O);return i.test=t,i.consequent=e,i.alternate=n,i}(t,e,qt())),t}function Wt(){const t=qt();if(Mt(","))throw new Error(Y);return t}function Ht(t){v=0,y=(g=t).length,b=null,yt();const e=Wt();if(b.type!==_)throw new Error("Unexpect token after expression.");return e}var Xt={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"};function Jt(t){function e(e,n,i){return r=>function(e,n,i,r){let o=t(n[0]);return i&&(o=i+"("+o+")",0===i.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+e+(r<0?"":0===r?"()":"("+n.slice(1).map(t).join(",")+")")}(e,r,n,i)}const n="new Date",r="String",o="RegExp";return{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",hypot:"Math.hypot",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:function(e){e.length<3&&(0,i.vU)("Missing arguments to clamp function."),e.length>3&&(0,i.vU)("Too many arguments to clamp function.");const n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:e("getDate",n,0),day:e("getDay",n,0),year:e("getFullYear",n,0),month:e("getMonth",n,0),hours:e("getHours",n,0),minutes:e("getMinutes",n,0),seconds:e("getSeconds",n,0),milliseconds:e("getMilliseconds",n,0),time:e("getTime",n,0),timezoneoffset:e("getTimezoneOffset",n,0),utcdate:e("getUTCDate",n,0),utcday:e("getUTCDay",n,0),utcyear:e("getUTCFullYear",n,0),utcmonth:e("getUTCMonth",n,0),utchours:e("getUTCHours",n,0),utcminutes:e("getUTCMinutes",n,0),utcseconds:e("getUTCSeconds",n,0),utcmilliseconds:e("getUTCMilliseconds",n,0),length:e("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase",r,0),lower:e("toLowerCase",r,0),substring:e("substring",r),split:e("split",r),trim:e("trim",r,0),regexp:o,test:e("test",o),if:function(e){e.length<3&&(0,i.vU)("Missing arguments to if function."),e.length>3&&(0,i.vU)("Too many arguments to if function.");const n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function Gt(t){const e=(t=t||{}).allowed?(0,i.Rg)(t.allowed):{},n=t.forbidden?(0,i.Rg)(t.forbidden):{},r=t.constants||Xt,o=(t.functions||Jt)(d),a=t.globalvar,s=t.fieldvar,c=(0,i.mf)(a)?a:t=>"".concat(a,'["').concat(t,'"]');let l={},u={},f=0;function d(t){if((0,i.HD)(t))return t;const e=h[t.type];return null==e&&(0,i.vU)("Unsupported type: "+t.type),e(t)}const h={Literal:t=>t.raw,Identifier:t=>{const o=t.name;return f>0?o:(0,i.nr)(n,o)?(0,i.vU)("Illegal identifier: "+o):(0,i.nr)(r,o)?r[o]:(0,i.nr)(e,o)?o:(l[o]=1,c(o))},MemberExpression:t=>{const e=!t.computed,n=d(t.object);e&&(f+=1);const i=d(t.property);return n===s&&(u[function(t){const e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(i)]=1),e&&(f-=1),n+(e?"."+i:"["+i+"]")},CallExpression:t=>{"Identifier"!==t.callee.type&&(0,i.vU)("Illegal callee type: "+t.callee.type);const e=t.callee.name,n=t.arguments,r=(0,i.nr)(o,e)&&o[e];return r||(0,i.vU)("Unrecognized function: "+e),(0,i.mf)(r)?r(n):r+"("+n.map(d).join(",")+")"},ArrayExpression:t=>"["+t.elements.map(d).join(",")+"]",BinaryExpression:t=>"("+d(t.left)+" "+t.operator+" "+d(t.right)+")",UnaryExpression:t=>"("+t.operator+d(t.argument)+")",ConditionalExpression:t=>"("+d(t.test)+"?"+d(t.consequent)+":"+d(t.alternate)+")",LogicalExpression:t=>"("+d(t.left)+t.operator+d(t.right)+")",ObjectExpression:t=>"{"+t.properties.map(d).join(",")+"}",Property:t=>{f+=1;const e=d(t.key);return f-=1,e+":"+d(t.value)}};function p(t){const e={code:d(t),globals:Object.keys(l),fields:Object.keys(u)};return l={},u={},e}return p.functions=o,p.constants=r,p}},60784:(t,e,n)=>{"use strict";n.d(e,{N:()=>h});var i={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},r={"*":(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>>>e},o={"+":t=>+t,"-":t=>-t,"~":t=>~t,"!":t=>!t};const a=Array.prototype.slice,s=(t,e,n)=>{const i=n?n(e[0]):e[0];return i[t].apply(i,a.call(e,1))};var c={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:(t,e,n)=>Math.max(e,Math.min(n,t)),now:Date.now,utc:Date.UTC,datetime:(t,e,n,i,r,o,a)=>new Date(t,e||0,null!=n?n:1,i||0,r||0,o||0,a||0),date:t=>new Date(t).getDate(),day:t=>new Date(t).getDay(),year:t=>new Date(t).getFullYear(),month:t=>new Date(t).getMonth(),hours:t=>new Date(t).getHours(),minutes:t=>new Date(t).getMinutes(),seconds:t=>new Date(t).getSeconds(),milliseconds:t=>new Date(t).getMilliseconds(),time:t=>new Date(t).getTime(),timezoneoffset:t=>new Date(t).getTimezoneOffset(),utcdate:t=>new Date(t).getUTCDate(),utcday:t=>new Date(t).getUTCDay(),utcyear:t=>new Date(t).getUTCFullYear(),utcmonth:t=>new Date(t).getUTCMonth(),utchours:t=>new Date(t).getUTCHours(),utcminutes:t=>new Date(t).getUTCMinutes(),utcseconds:t=>new Date(t).getUTCSeconds(),utcmilliseconds:t=>new Date(t).getUTCMilliseconds(),length:t=>t.length,join:function(){return s("join",arguments)},indexof:function(){return s("indexOf",arguments)},lastindexof:function(){return s("lastIndexOf",arguments)},slice:function(){return s("slice",arguments)},reverse:t=>t.slice().reverse(),parseFloat:parseFloat,parseInt:parseInt,upper:t=>String(t).toUpperCase(),lower:t=>String(t).toLowerCase(),substring:function(){return s("substring",arguments,String)},split:function(){return s("split",arguments,String)},replace:function(){return s("replace",arguments,String)},trim:t=>String(t).trim(),regexp:RegExp,test:(t,e)=>RegExp(t).test(e)};const l=["view","item","group","xy","x","y"],u=new Set([Function,eval,setTimeout,setInterval]);"function"===typeof setImmediate&&u.add(setImmediate);const f={Literal:(t,e)=>e.value,Identifier:(t,e)=>{const n=e.name;return t.memberDepth>0?n:"datum"===n?t.datum:"event"===n?t.event:"item"===n?t.item:i[n]||t.params["$"+n]},MemberExpression:(t,e)=>{const n=!e.computed,i=t(e.object);n&&(t.memberDepth+=1);const r=t(e.property);if(n&&(t.memberDepth-=1),!u.has(i[r]))return i[r];console.error('Prevented interpretation of member "'.concat(r,'" which could lead to insecure code execution'))},CallExpression:(t,e)=>{const n=e.arguments;let i=e.callee.name;return i.startsWith("_")&&(i=i.slice(1)),"if"===i?t(n[0])?t(n[1]):t(n[2]):(t.fn[i]||c[i]).apply(t.fn,n.map(t))},ArrayExpression:(t,e)=>e.elements.map(t),BinaryExpression:(t,e)=>r[e.operator](t(e.left),t(e.right)),UnaryExpression:(t,e)=>o[e.operator](t(e.argument)),ConditionalExpression:(t,e)=>t(e.test)?t(e.consequent):t(e.alternate),LogicalExpression:(t,e)=>"&&"===e.operator?t(e.left)&&t(e.right):t(e.left)||t(e.right),ObjectExpression:(t,e)=>e.properties.reduce(((e,n)=>{t.memberDepth+=1;const i=t(n.key);return t.memberDepth-=1,u.has(t(n.value))?console.error('Prevented interpretation of property "'.concat(i,'" which could lead to insecure code execution')):e[i]=t(n.value),e}),{})};function d(t,e,n,i,r,o){const a=t=>f[t.type](a,t);return a.memberDepth=0,a.fn=Object.create(e),a.params=n,a.datum=i,a.event=r,a.item=o,l.forEach((t=>a.fn[t]=function(){return r.vega[t](...arguments)})),a(t)}var h={operator(t,e){const n=e.ast,i=t.functions;return t=>d(n,i,t)},parameter(t,e){const n=e.ast,i=t.functions;return(t,e)=>d(n,i,e,t)},event(t,e){const n=e.ast,i=t.functions;return t=>d(n,i,void 0,void 0,t)},handler(t,e){const n=e.ast,i=t.functions;return(t,e)=>{const r=e.item&&e.item.datum;return d(n,i,t,r,e)}},encode(t,e){const{marktype:n,channels:i}=e,r=t.functions,o="group"===n||"image"===n||"rect"===n;return(t,e)=>{const a=t.datum;let s,c=0;for(const n in i)s=d(i[n].ast,r,e,a,void 0,t),t[n]!==s&&(t[n]=s,c=1);return"rule"!==n&&function(t,e,n){let i;e.x2&&(e.x?(n&&t.x>t.x2&&(i=t.x,t.x=t.x2,t.x2=i),t.width=t.x2-t.x):t.x=t.x2-(t.width||0)),e.xc&&(t.x=t.xc-(t.width||0)/2),e.y2&&(e.y?(n&&t.y>t.y2&&(i=t.y,t.y=t.y2,t.y2=i),t.height=t.y2-t.y):t.y=t.y2-(t.height||0)),e.yc&&(t.y=t.yc-(t.height||0)/2)}(t,i,o),c}}}},15721:(t,e,n)=>{"use strict";function i(t,e,n){return t.fields=e||[],t.fname=n,t}function r(t){return null==t?null:t.fname}function o(t){return null==t?null:t.fields}function a(t){return 1===t.length?s(t[0]):c(t)}n.d(e,{$G:()=>Lt,$m:()=>At,BB:()=>Rt,Ds:()=>at,Dw:()=>B,EP:()=>f,FP:()=>jt,HD:()=>wt,He:()=>N,Hq:()=>b,IX:()=>Y,J_:()=>yt,Jy:()=>kt,Kj:()=>_t,Kn:()=>A,N3:()=>V,Oj:()=>o,QA:()=>I,Rg:()=>Pt,TS:()=>St,TW:()=>bt,We:()=>ct,XW:()=>mt,Xr:()=>ht,ZE:()=>i,ZU:()=>zt,Zw:()=>q,_k:()=>u,a9:()=>ot,ay:()=>H,bM:()=>p,bV:()=>G,cG:()=>k,dH:()=>X,dI:()=>lt,el:()=>r,fE:()=>M,fj:()=>O,hj:()=>xt,iL:()=>C,id:()=>d,j2:()=>et,jj:()=>x,jn:()=>vt,k:()=>v,kI:()=>w,kJ:()=>D,kX:()=>m,kg:()=>E,l$:()=>K,l7:()=>st,m8:()=>Ot,mJ:()=>U,mK:()=>J,mS:()=>$,mf:()=>Z,nr:()=>ft,qu:()=>tt,rx:()=>Mt,sw:()=>Nt,t7:()=>Et,u5:()=>gt,uU:()=>_,vU:()=>l,vk:()=>Ct,yP:()=>Ft,yR:()=>h,yb:()=>g,yl:()=>pt});const s=t=>function(e){return e[t]},c=t=>{const e=t.length;return function(n){for(let i=0;i<e;++i)n=n[t[i]];return n}};function l(t){throw Error(t)}function u(t){const e=[],n=t.length;let i,r,o,a=null,s=0,c="";function u(){e.push(c+t.substring(i,r)),c="",i=r+1}for(t+="",i=r=0;r<n;++r)if(o=t[r],"\\"===o)c+=t.substring(i,r++),i=r;else if(o===a)u(),a=null,s=-1;else{if(a)continue;i===s&&'"'===o||i===s&&"'"===o?(i=r+1,a=o):"."!==o||s?"["===o?(r>i&&u(),s=i=r+1):"]"===o&&(s||l("Access path missing open bracket: "+t),s>0&&u(),s=0,i=r+1):r>i?u():i=r+1}return s&&l("Access path missing closing bracket: "+t),a&&l("Access path missing closing quote: "+t),r>i&&(r++,u()),e}function f(t,e,n){const r=u(t);return t=1===r.length?r[0]:t,i((n&&n.get||a)(r),[t],e||t)}const d=f("id"),h=i((t=>t),[],"identity"),p=i((()=>0),[],"zero"),m=i((()=>1),[],"one"),g=i((()=>!0),[],"true"),v=i((()=>!1),[],"false");function y(t,e,n){const i=[e].concat([].slice.call(n));console[t].apply(console,i)}const b=0,x=1,_=2,w=3,k=4;function E(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y,i=t||b;return{level(t){return arguments.length?(i=+t,this):i},error(){return i>=x&&n(e||"error","ERROR",arguments),this},warn(){return i>=_&&n(e||"warn","WARN",arguments),this},info(){return i>=w&&n(e||"log","INFO",arguments),this},debug(){return i>=k&&n(e||"log","DEBUG",arguments),this}}}var D=Array.isArray;function A(t){return t===Object(t)}const S=t=>"__proto__"!==t;function M(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce(((t,e)=>{for(const n in e)if("signals"===n)t.signals=F(t.signals,e.signals);else{const i="legend"===n?{layout:1}:"style"===n||null;C(t,n,e[n],i)}return t}),{})}function C(t,e,n,i){if(!S(e))return;let r,o;if(A(n)&&!D(n))for(r in o=A(t[e])?t[e]:t[e]={},n)i&&(!0===i||i[r])?C(o,r,n[r]):S(r)&&(o[r]=n[r]);else t[e]=n}function F(t,e){if(null==t)return e;const n={},i=[];function r(t){n[t.name]||(n[t.name]=1,i.push(t))}return e.forEach(r),t.forEach(r),i}function O(t){return t[t.length-1]}function N(t){return null==t||""===t?null:+t}const T=t=>e=>t*Math.exp(e),z=t=>e=>Math.log(t*e),R=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),P=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,L=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function j(t,e,n,i){const r=n(t[0]),o=n(O(t)),a=(o-r)*e;return[i(r-a),i(o-a)]}function B(t,e){return j(t,e,N,h)}function U(t,e){var n=Math.sign(t[0]);return j(t,e,z(n),T(n))}function I(t,e,n){return j(t,e,L(n),L(1/n))}function q(t,e,n){return j(t,e,R(n),P(n))}function W(t,e,n,i,r){const o=i(t[0]),a=i(O(t)),s=null!=e?i(e):(o+a)/2;return[r(s+(o-s)*n),r(s+(a-s)*n)]}function H(t,e,n){return W(t,e,n,N,h)}function X(t,e,n){const i=Math.sign(t[0]);return W(t,e,n,z(i),T(i))}function J(t,e,n,i){return W(t,e,n,L(i),L(1/i))}function G(t,e,n,i){return W(t,e,n,R(i),P(i))}function $(t){return 1+~~(new Date(t).getMonth()/3)}function V(t){return 1+~~(new Date(t).getUTCMonth()/3)}function Y(t){return null!=t?D(t)?t:[t]:[]}function K(t,e,n){let i,r=t[0],o=t[1];return o<r&&(i=o,o=r,r=i),i=o-r,i>=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-i),r+i]}function Z(t){return"function"===typeof t}const Q="descending";function tt(t,e,n){n=n||{},e=Y(e)||[];const r=[],a=[],s={},c=n.comparator||nt;return Y(t).forEach(((t,i)=>{null!=t&&(r.push(e[i]===Q?-1:1),a.push(t=Z(t)?t:f(t,null,n)),(o(t)||[]).forEach((t=>s[t]=1)))})),0===a.length?null:i(c(a,r),Object.keys(s))}const et=(t,e)=>(t<e||null==t)&&null!=e?-1:(t>e||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),nt=(t,e)=>1===t.length?it(t[0],e[0]):rt(t,e,t.length),it=(t,e)=>function(n,i){return et(t(n),t(i))*e},rt=(t,e,n)=>(e.push(0),function(i,r){let o,a=0,s=-1;for(;0===a&&++s<n;)o=t[s],a=et(o(i),o(r));return a*e[s]});function ot(t){return Z(t)?t:()=>t}function at(t,e){let n;return i=>{n&&clearTimeout(n),n=setTimeout((()=>(e(i),n=null)),t)}}function st(t){for(let e,n,i=1,r=arguments.length;i<r;++i)for(n in e=arguments[i],e)t[n]=e[n];return t}function ct(t,e){let n,i,r,o,a=0;if(t&&(n=t.length))if(null==e){for(i=t[a];a<n&&(null==i||i!==i);i=t[++a]);for(r=o=i;a<n;++a)i=t[a],null!=i&&(i<r&&(r=i),i>o&&(o=i))}else{for(i=e(t[a]);a<n&&(null==i||i!==i);i=e(t[++a]));for(r=o=i;a<n;++a)i=e(t[a]),null!=i&&(i<r&&(r=i),i>o&&(o=i))}return[r,o]}function lt(t,e){const n=t.length;let i,r,o,a,s,c=-1;if(null==e){for(;++c<n;)if(r=t[c],null!=r&&r>=r){i=o=r;break}if(c===n)return[-1,-1];for(a=s=c;++c<n;)r=t[c],null!=r&&(i>r&&(i=r,a=c),o<r&&(o=r,s=c))}else{for(;++c<n;)if(r=e(t[c],c,t),null!=r&&r>=r){i=o=r;break}if(c===n)return[-1,-1];for(a=s=c;++c<n;)r=e(t[c],c,t),null!=r&&(i>r&&(i=r,a=c),o<r&&(o=r,s=c))}return[a,s]}const ut=Object.prototype.hasOwnProperty;function ft(t,e){return ut.call(t,e)}const dt={};function ht(t){let e,n={};function i(t){return ft(n,t)&&n[t]!==dt}const r={size:0,empty:0,object:n,has:i,get:t=>i(t)?n[t]:void 0,set(t,e){return i(t)||(++r.size,n[t]===dt&&--r.empty),n[t]=e,this},delete(t){return i(t)&&(--r.size,++r.empty,n[t]=dt),this},clear(){r.size=r.empty=0,r.object=n={}},test(t){return arguments.length?(e=t,r):e},clean(){const t={};let i=0;for(const r in n){const o=n[r];o===dt||e&&e(o)||(t[r]=o,++i)}r.size=i,r.empty=0,r.object=n=t}};return t&&Object.keys(t).forEach((e=>{r.set(e,t[e])})),r}function pt(t,e,n,i,r,o){if(!n&&0!==n)return o;const a=+n;let s,c=t[0],l=O(t);l<c&&(s=c,c=l,l=s),s=Math.abs(e-c);const u=Math.abs(l-e);return s<u&&s<=a?i:u<=a?r:o}function mt(t,e,n){const i=t.prototype=Object.create(e.prototype);return Object.defineProperty(i,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),st(i,n)}function gt(t,e,n,i){let r,o=e[0],a=e[e.length-1];return o>a&&(r=o,o=a,a=r),i=void 0===i||i,((n=void 0===n||n)?o<=t:o<t)&&(i?t<=a:t<a)}function vt(t){return"boolean"===typeof t}function yt(t){return"[object Date]"===Object.prototype.toString.call(t)}function bt(t){return t&&Z(t[Symbol.iterator])}function xt(t){return"number"===typeof t}function _t(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function wt(t){return"string"===typeof t}function kt(t,e,n){t&&(t=e?Y(t).map((t=>t.replace(/\\(.)/g,"$1"))):Y(t));const r=t&&t.length,o=n&&n.get||a,s=t=>o(e?[t]:u(t));let c;if(r)if(1===r){const e=s(t[0]);c=function(t){return""+e(t)}}else{const e=t.map(s);c=function(t){let n=""+e[0](t),i=0;for(;++i<r;)n+="|"+e[i](t);return n}}else c=function(){return""};return i(c,t,"key")}function Et(t,e){const n=t[0],i=O(t),r=+e;return r?1===r?i:n+r*(i-n):n}const Dt=1e4;function At(t){let e,n,i;t=+t||Dt;const r=()=>{e={},n={},i=0},o=(r,o)=>(++i>t&&(n=e,e={},i=1),e[r]=o);return r(),{clear:r,has:t=>ft(e,t)||ft(n,t),get:t=>ft(e,t)?e[t]:ft(n,t)?o(t,n[t]):void 0,set:(t,n)=>ft(e,t)?e[t]=n:o(t,n)}}function St(t,e,n,i){const r=e.length,o=n.length;if(!o)return e;if(!r)return n;const a=i||new e.constructor(r+o);let s=0,c=0,l=0;for(;s<r&&c<o;++l)a[l]=t(e[s],n[c])>0?n[c++]:e[s++];for(;s<r;++s,++l)a[l]=e[s];for(;c<o;++c,++l)a[l]=n[c];return a}function Mt(t,e){let n="";for(;--e>=0;)n+=t;return n}function Ct(t,e,n,i){const r=n||" ",o=t+"",a=e-o.length;return a<=0?o:"left"===i?Mt(r,a)+o:"center"===i?Mt(r,~~(a/2))+o+Mt(r,Math.ceil(a/2)):o+Mt(r,a)}function Ft(t){return t&&O(t)-t[0]||0}function Ot(t){return D(t)?"["+t.map(Ot)+"]":A(t)||wt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function Nt(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t}const Tt=t=>xt(t)||yt(t)?t:Date.parse(t);function zt(t,e){return e=e||Tt,null==t||""===t?null:e(t)}function Rt(t){return null==t||""===t?null:t+""}function Pt(t){const e={},n=t.length;for(let i=0;i<n;++i)e[t[i]]=!0;return e}function Lt(t,e,n,i){const r=null!=i?i:"\u2026",o=t+"",a=o.length,s=Math.max(0,e-r.length);return a<=e?o:"left"===n?r+o.slice(a-s):"center"===n?o.slice(0,Math.ceil(s/2))+r+o.slice(a-~~(s/2)):o.slice(0,s)+r}function jt(t,e,n){if(t)if(e){const i=t.length;for(let r=0;r<i;++r){const i=e(t[r]);i&&n(i,r,t)}}else t.forEach(n)}},95199:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Bounds:()=>Gh,CanvasHandler:()=>Dg,CanvasRenderer:()=>Fg,DATE:()=>Kt,DAY:()=>Zt,DAYOFYEAR:()=>Qt,Dataflow:()=>to,Debug:()=>m.cG,Error:()=>m.jj,EventStream:()=>Br,Gradient:()=>Kd,GroupItem:()=>Vh,HOURS:()=>te,Handler:()=>ag,Info:()=>m.kI,Item:()=>$h,MILLISECONDS:()=>ie,MINUTES:()=>ee,MONTH:()=>Vt,Marks:()=>Hm,MultiPulse:()=>Vr,None:()=>m.Hq,Operator:()=>Pr,Parameters:()=>Tr,Pulse:()=>Xr,QUARTER:()=>$t,RenderType:()=>_v,Renderer:()=>cg,ResourceLoader:()=>Yh,SECONDS:()=>ne,SVGHandler:()=>Ng,SVGRenderer:()=>rv,SVGStringRenderer:()=>yv,Scenegraph:()=>Zm,TIME_UNITS:()=>re,Transform:()=>no,View:()=>xF,WEEK:()=>Yt,Warn:()=>m.uU,YEAR:()=>Gt,accessor:()=>m.ZE,accessorFields:()=>m.Oj,accessorName:()=>m.el,array:()=>m.IX,ascending:()=>m.j2,bandwidthNRD:()=>xo,bin:()=>_o,bootstrapCI:()=>Eo,boundClip:()=>Cv,boundContext:()=>vp,boundItem:()=>Xm,boundMark:()=>Gm,boundStroke:()=>Qh,changeset:()=>Or,clampRange:()=>m.l$,codegenExpression:()=>wS.YP,compare:()=>m.qu,constant:()=>m.a9,cumulativeLogNormal:()=>Bo,cumulativeNormal:()=>To,cumulativeUniform:()=>Xo,dayofyear:()=>fe,debounce:()=>m.Ds,defaultLocale:()=>Wi,definition:()=>ro,densityLogNormal:()=>jo,densityNormal:()=>No,densityUniform:()=>Ho,domChild:()=>ng,domClear:()=>ig,domCreate:()=>tg,domFind:()=>eg,dotbin:()=>Do,error:()=>m.vU,expressionFunction:()=>gC,extend:()=>m.l7,extent:()=>m.We,extentIndex:()=>m.dI,falsy:()=>m.k,fastmap:()=>m.Xr,field:()=>m.EP,flush:()=>m.yl,font:()=>Pm,fontFamily:()=>Rm,fontSize:()=>Fm,format:()=>hr,formatLocale:()=>Ri,formats:()=>pr,hasOwnProperty:()=>m.nr,id:()=>m.id,identity:()=>m.yR,inferType:()=>ar,inferTypes:()=>sr,ingest:()=>Dr,inherits:()=>m.XW,inrange:()=>m.u5,interpolate:()=>bd,interpolateColors:()=>gd,interpolateRange:()=>md,intersect:()=>Ev,intersectBoxLine:()=>Mp,intersectPath:()=>Ep,intersectPoint:()=>Dp,intersectRule:()=>Sp,isArray:()=>m.kJ,isBoolean:()=>m.jn,isDate:()=>m.J_,isFunction:()=>m.mf,isIterable:()=>m.TW,isNumber:()=>m.hj,isObject:()=>m.Kn,isRegExp:()=>m.Kj,isString:()=>m.HD,isTuple:()=>wr,key:()=>m.Jy,lerp:()=>m.t7,lineHeight:()=>Om,loader:()=>vr,locale:()=>qi,logger:()=>m.kg,lruCache:()=>m.$m,markup:()=>Yg,merge:()=>m.TS,mergeConfig:()=>m.fE,multiLineOffset:()=>Tm,one:()=>m.kX,pad:()=>m.vk,panLinear:()=>m.Dw,panLog:()=>m.mJ,panPow:()=>m.QA,panSymlog:()=>m.Zw,parse:()=>qz,parseExpression:()=>wS.BJ,parseSelector:()=>DF.r,path:()=>el,pathCurves:()=>Qd,pathEqual:()=>Nv,pathParse:()=>oh,pathRectangle:()=>Ch,pathRender:()=>gh,pathSymbols:()=>xh,pathTrail:()=>Fh,peek:()=>m.fj,point:()=>og,projection:()=>Xw,quantileLogNormal:()=>Uo,quantileNormal:()=>zo,quantileUniform:()=>Jo,quantiles:()=>yo,quantizeInterpolator:()=>vd,quarter:()=>m.mS,quartiles:()=>bo,random:()=>wo,randomInteger:()=>So,randomKDE:()=>Po,randomLCG:()=>Ao,randomLogNormal:()=>Io,randomMixture:()=>qo,randomNormal:()=>Ro,randomUniform:()=>Go,read:()=>gr,regressionConstant:()=>$o,regressionExp:()=>ea,regressionLinear:()=>Qo,regressionLoess:()=>ca,regressionLog:()=>ta,regressionPoly:()=>ra,regressionPow:()=>na,regressionQuad:()=>ia,renderModule:()=>kv,repeat:()=>m.rx,resetDefaultLocale:()=>Hi,resetSVGClipId:()=>Xh,resetSVGDefIds:()=>Tv,responseType:()=>mr,runtimeContext:()=>AC,sampleCurve:()=>da,sampleLogNormal:()=>Lo,sampleNormal:()=>Oo,sampleUniform:()=>Wo,scale:()=>od,sceneEqual:()=>Ov,sceneFromJSON:()=>Ym,scenePickVisit:()=>Bp,sceneToJSON:()=>Vm,sceneVisit:()=>jp,sceneZOrder:()=>Lp,scheme:()=>kd,serializeXML:()=>Kg,setRandom:()=>ko,span:()=>m.yP,splitAccessPath:()=>m._k,stringValue:()=>m.m8,textMetrics:()=>Em,timeBin:()=>en,timeFloor:()=>Se,timeFormatLocale:()=>Ui,timeInterval:()=>Te,timeOffset:()=>Pe,timeSequence:()=>Be,timeUnitSpecifier:()=>ce,timeUnits:()=>ae,toBoolean:()=>m.sw,toDate:()=>m.ZU,toNumber:()=>m.He,toSet:()=>m.Rg,toString:()=>m.BB,transform:()=>oo,transforms:()=>io,truncate:()=>m.$G,truthy:()=>m.yb,tupleid:()=>kr,typeParsers:()=>ir,utcFloor:()=>Fe,utcInterval:()=>ze,utcOffset:()=>Le,utcSequence:()=>Ue,utcdayofyear:()=>ve,utcquarter:()=>m.N3,utcweek:()=>ye,version:()=>Wz,visitArray:()=>m.FP,week:()=>de,writeConfig:()=>m.iL,zero:()=>m.bM,zoomLinear:()=>m.ay,zoomLog:()=>m.dH,zoomPow:()=>m.mK,zoomSymlog:()=>m.bV});var i={};n.r(i),n.d(i,{aggregate:()=>Fa,bin:()=>Oa,collect:()=>Ta,compare:()=>za,countpattern:()=>Pa,cross:()=>La,density:()=>Ia,dotbin:()=>Ja,expression:()=>Ga,extent:()=>Va,facet:()=>Ka,field:()=>Za,filter:()=>ts,flatten:()=>es,fold:()=>ns,formula:()=>is,generate:()=>rs,impute:()=>ss,joinaggregate:()=>cs,kde:()=>ls,key:()=>us,load:()=>ds,lookup:()=>ps,multiextent:()=>ms,multivalues:()=>vs,params:()=>bs,pivot:()=>xs,prefacet:()=>_s,project:()=>ws,proxy:()=>ks,quantile:()=>Es,relay:()=>Ds,sample:()=>As,sequence:()=>Ss,sieve:()=>Ms,subflow:()=>Ya,timeunit:()=>Cs,tupleindex:()=>Os,values:()=>Ns,window:()=>Ls});var r={};n.r(r),n.d(r,{interpolate:()=>Tl,interpolateArray:()=>Al,interpolateBasis:()=>Tu.Z,interpolateBasisClosed:()=>zu.Z,interpolateCubehelix:()=>Sf,interpolateCubehelixLong:()=>Mf,interpolateDate:()=>Ml,interpolateDiscrete:()=>Ru,interpolateHcl:()=>pf,interpolateHclLong:()=>mf,interpolateHsl:()=>qu,interpolateHslLong:()=>Wu,interpolateHue:()=>Lu,interpolateLab:()=>df,interpolateNumber:()=>Cl.Z,interpolateNumberArray:()=>El,interpolateObject:()=>Fl,interpolateRgb:()=>kl.ZP,interpolateRgbBasis:()=>kl.hD,interpolateRgbBasisClosed:()=>kl.YD,interpolateRound:()=>zl,interpolateString:()=>Ol.Z,interpolateTransformCss:()=>ju.Y,interpolateTransformSvg:()=>ju.w,interpolateZoom:()=>Uu,piecewise:()=>wu,quantize:()=>Cf});var o={};n.r(o),n.d(o,{bound:()=>vy,identifier:()=>xy,mark:()=>_y,overlap:()=>wy,render:()=>Cy,viewlayout:()=>Ky});var a={};n.r(a),n.d(a,{axisticks:()=>Qy,datajoin:()=>tb,encode:()=>nb,legendentries:()=>ib,linkpath:()=>cb,pie:()=>hb,scale:()=>vb,sortitems:()=>_b,stack:()=>Ab});var s={};n.r(s),n.d(s,{contour:()=>pk,geojson:()=>vk,geopath:()=>yk,geopoint:()=>bk,geoshape:()=>xk,graticule:()=>_k,heatmap:()=>wk,isocontour:()=>rk,kde2d:()=>fk,projection:()=>Ek});var c={};n.r(c),n.d(c,{force:()=>aE});var l={};n.r(l),n.d(l,{nest:()=>hD,pack:()=>bD,partition:()=>_D,stratify:()=>wD,tree:()=>DD,treelinks:()=>AD,treemap:()=>CD});var u={};n.r(u),n.d(u,{label:()=>ZD});var f={};n.r(f),n.d(f,{loess:()=>tA,regression:()=>nA});var d={};n.r(d),n.d(d,{voronoi:()=>RA});var h={};n.r(h),n.d(h,{wordcloud:()=>KA});var p={};n.r(p),n.d(p,{crossfilter:()=>rS,resolvefilter:()=>oS});var m=n(15721),g={},v={},y=34,b=10,x=13;function _(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function w(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var i in t)i in e||n.push(e[i]=i)})),n}function k(t,e){var n=t+"",i=n.length;return i<e?new Array(e-i+1).join(0)+n:n}function E(t){var e,n=t.getUTCHours(),i=t.getUTCMinutes(),r=t.getUTCSeconds(),o=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+k(-e,6):e>9999?"+"+k(e,6):k(e,4))+"-"+k(t.getUTCMonth()+1,2)+"-"+k(t.getUTCDate(),2)+(o?"T"+k(n,2)+":"+k(i,2)+":"+k(r,2)+"."+k(o,3)+"Z":r?"T"+k(n,2)+":"+k(i,2)+":"+k(r,2)+"Z":i||n?"T"+k(n,2)+":"+k(i,2)+"Z":"")}function D(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function i(t,e){var i,r=[],o=t.length,a=0,s=0,c=o<=0,l=!1;function u(){if(c)return v;if(l)return l=!1,g;var e,i,r=a;if(t.charCodeAt(r)===y){for(;a++<o&&t.charCodeAt(a)!==y||t.charCodeAt(++a)===y;);return(e=a)>=o?c=!0:(i=t.charCodeAt(a++))===b?l=!0:i===x&&(l=!0,t.charCodeAt(a)===b&&++a),t.slice(r+1,e-1).replace(/""/g,'"')}for(;a<o;){if((i=t.charCodeAt(e=a++))===b)l=!0;else if(i===x)l=!0,t.charCodeAt(a)===b&&++a;else if(i!==n)continue;return t.slice(r,e)}return c=!0,t.slice(r,o)}for(t.charCodeAt(o-1)===b&&--o,t.charCodeAt(o-1)===x&&--o;(i=u())!==v;){for(var f=[];i!==g&&i!==v;)f.push(i),i=u();e&&null==(f=e(f,s++))||r.push(f)}return r}function r(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?E(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,r,o=i(t,(function(t,i){if(n)return n(t,i-1);r=t,n=e?function(t,e){var n=_(t);return function(i,r){return e(n(i),r,t)}}(t,e):_(t)}));return o.columns=r||[],o},parseRows:i,format:function(e,n){return null==n&&(n=w(e)),[n.map(a).join(t)].concat(r(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=w(t)),r(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function A(t){return t}function S(t,e){return"string"===typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return M(t,e)}))}:M(t,e)}function M(t,e){var n=e.id,i=e.bbox,r=null==e.properties?{}:e.properties,o=C(t,e);return null==n&&null==i?{type:"Feature",properties:r,geometry:o}:null==i?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function C(t,e){var n=function(t){if(null==t)return A;var e,n,i=t.scale[0],r=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,s){s||(e=n=0);var c=2,l=t.length,u=new Array(l);for(u[0]=(e+=t[0])*i+o,u[1]=(n+=t[1])*r+a;c<l;)u[c]=t[c],++c;return u}}(t.transform),i=t.arcs;function r(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],o=0,a=r.length;o<a;++o)e.push(n(r[o],o));t<0&&function(t,e){for(var n,i=t.length,r=i-e;r<--i;)n=t[r],t[r++]=t[i],t[i]=n}(e,a)}function o(t){return n(t)}function a(t){for(var e=[],n=0,i=t.length;n<i;++n)r(t[n],e);return e.length<2&&e.push(e[0]),e}function s(t){for(var e=a(t);e.length<4;)e.push(e[0]);return e}function c(t){return t.map(s)}return function t(e){var n,i=e.type;switch(i){case"GeometryCollection":return{type:i,geometries:e.geometries.map(t)};case"Point":n=o(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(o);break;case"LineString":n=a(e.arcs);break;case"MultiLineString":n=e.arcs.map(a);break;case"Polygon":n=c(e.arcs);break;case"MultiPolygon":n=e.arcs.map(c);break;default:return null}return{type:i,coordinates:n}}(e)}function F(t,e){var n={},i={},r={},o=[],a=-1;function s(t,e){for(var i in t){var r=t[i];delete e[r.start],delete r.start,delete r.end,r.forEach((function(t){n[t<0?~t:t]=1})),o.push(r)}}return e.forEach((function(n,i){var r,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(r=e[++a],e[a]=n,e[i]=r)})),e.forEach((function(e){var n,o,a=function(e){var n,i=t.arcs[e<0?~e:e],r=i[0];t.transform?(n=[0,0],i.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=i[i.length-1];return e<0?[n,r]:[r,n]}(e),s=a[0],c=a[1];if(n=r[s])if(delete r[n.end],n.push(e),n.end=c,o=i[c]){delete i[o.start];var l=o===n?n:n.concat(o);i[l.start=n.start]=r[l.end=o.end]=l}else i[n.start]=r[n.end]=n;else if(n=i[c])if(delete i[n.start],n.unshift(e),n.start=s,o=r[s]){delete r[o.end];var u=o===n?n:o.concat(n);i[u.start=o.start]=r[u.end=n.end]=u}else i[n.start]=r[n.end]=n;else i[(n=[e]).start=s]=r[n.end=c]=n})),s(r,i),s(i,r),e.forEach((function(t){n[t<0?~t:t]||o.push([t])})),o}function O(t){return C(t,N.apply(this,arguments))}function N(t,e,n){var i,r,o;if(arguments.length>1)i=function(t,e,n){var i,r=[],o=[];function a(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:i})}function s(t){t.forEach(a)}function c(t){t.forEach(s)}function l(t){t.forEach(c)}function u(t){switch(i=t,t.type){case"GeometryCollection":t.geometries.forEach(u);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":c(t.arcs);break;case"MultiPolygon":l(t.arcs)}}return u(e),o.forEach(null==n?function(t){r.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&r.push(t[0].i)}),r}(0,e,n);else for(r=0,i=new Array(o=t.arcs.length);r<o;++r)i[r]=r;return{type:"MultiLineString",arcs:F(t,i)}}const T=Math.sqrt(50),z=Math.sqrt(10),R=Math.sqrt(2);function P(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),a=o>=T?10:o>=z?5:o>=R?2:1;let s,c,l;return r<0?(l=Math.pow(10,-r)/a,s=Math.round(t*l),c=Math.round(e*l),s/l<t&&++s,c/l>e&&--c,l=-l):(l=Math.pow(10,r)*a,s=Math.round(t/l),c=Math.round(e/l),s*l<t&&++s,c*l>e&&--c),c<s&&.5<=n&&n<2?P(t,e,2*n):[s,c,l]}function L(t,e,n){if(!((n=+n)>0))return[];if((t=+t)===(e=+e))return[t];const i=e<t,[r,o,a]=i?P(e,t,n):P(t,e,n);if(!(o>=r))return[];const s=o-r+1,c=new Array(s);if(i)if(a<0)for(let l=0;l<s;++l)c[l]=(o-l)/-a;else for(let l=0;l<s;++l)c[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)c[l]=(r+l)/-a;else for(let l=0;l<s;++l)c[l]=(r+l)*a;return c}function j(t,e,n){return P(t=+t,e=+e,n=+n)[2]}function B(t,e,n){n=+n;const i=(e=+e)<(t=+t),r=i?j(e,t,n):j(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}var U,I=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function q(t){if(!(e=I.exec(t)))throw new Error("invalid format: "+t);var e;return new W({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function W(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function H(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function X(t){return(t=H(Math.abs(t)))?t[1]:NaN}function J(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(X(e)/3)))-X(Math.abs(t)))}function G(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,X(e)-X(t))+1}function $(t){return Math.max(0,-X(Math.abs(t)))}function V(t,e){var n=H(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}q.prototype=W.prototype,W.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Y={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>V(100*t,e),r:V,s:function(t,e){var n=H(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(U=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=i.length;return o===a?i:o>a?i+new Array(o-a+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+H(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function K(t){return t}var Z,Q,tt,et=Array.prototype.map,nt=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function it(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?K:(e=et.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,o=[],a=0,s=e[0],c=0;r>0&&s>0&&(c+s+1>i&&(s=Math.max(1,i-c)),o.push(t.substring(r-=s,r+s)),!((c+=s+1)>i));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?K:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(et.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"\u2212":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=q(t)).fill,n=t.align,f=t.sign,d=t.symbol,h=t.zero,p=t.width,m=t.comma,g=t.precision,v=t.trim,y=t.type;"n"===y?(m=!0,y="g"):Y[y]||(void 0===g&&(g=12),v=!0,y="g"),(h||"0"===e&&"="===n)&&(h=!0,e="0",n="=");var b="$"===d?r:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===d?o:/[%p]/.test(y)?c:"",_=Y[y],w=/[defgprs%]/.test(y);function k(t){var r,o,c,d=b,k=x;if("c"===y)k=_(t)+k,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:_(Math.abs(t),g),v&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),E&&0===+t&&"+"!==f&&(E=!1),d=(E?"("===f?f:l:"-"===f||"("===f?"":f)+d,k=("s"===y?nt[8+U/3]:"")+k+(E&&"("===f?")":""),w)for(r=-1,o=t.length;++r<o;)if(48>(c=t.charCodeAt(r))||c>57){k=(46===c?a+t.slice(r+1):t.slice(r))+k,t=t.slice(0,r);break}}m&&!h&&(t=i(t,1/0));var D=d.length+t.length+k.length,A=D<p?new Array(p-D+1).join(e):"";switch(m&&h&&(t=i(A+t,A.length?p-k.length:1/0),A=""),n){case"<":t=d+t+k+A;break;case"=":t=d+A+t+k;break;case"^":t=A.slice(0,D=A.length>>1)+d+t+k+A.slice(D);break;default:t=A+d+t+k}return s(t)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,e){var n=f(((t=q(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(X(e)/3))),r=Math.pow(10,-i),o=nt[8+i/3];return function(t){return n(r*t)+o}}}}!function(t){Z=it(t),Q=Z.format,tt=Z.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const rt=new Date,ot=new Date;function at(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=e=>(t(e=new Date(+e)),e),r.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),r.round=t=>{const e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),r.range=(n,i,o)=>{const a=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i)||!(o>0))return a;let s;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(s<n&&n<i);return a},r.filter=n=>at((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,i)=>{if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})),n&&(r.count=(e,i)=>(rt.setTime(+e),ot.setTime(+i),t(rt),t(ot),Math.floor(n(rt,ot))),r.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?e=>i(e)%t===0:e=>r.count(0,e)%t===0):r:null)),r}const st=1e3,ct=6e4,lt=36e5,ut=864e5,ft=6048e5,dt=2592e6,ht=31536e6,pt=at((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/ut),(t=>t.getDate()-1)),mt=(pt.range,at((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/ut),(t=>t.getUTCDate()-1))),gt=(mt.range,at((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/ut),(t=>Math.floor(t/ut))));gt.range;function vt(t){return at((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/ft))}const yt=vt(0),bt=vt(1),xt=vt(2),_t=vt(3),wt=vt(4),kt=vt(5),Et=vt(6);yt.range,bt.range,xt.range,_t.range,wt.range,kt.range,Et.range;function Dt(t){return at((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/ft))}const At=Dt(0),St=Dt(1),Mt=Dt(2),Ct=Dt(3),Ft=Dt(4),Ot=Dt(5),Nt=Dt(6),Tt=(At.range,St.range,Mt.range,Ct.range,Ft.range,Ot.range,Nt.range,at((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear())));Tt.every=t=>isFinite(t=Math.floor(t))&&t>0?at((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null;Tt.range;const zt=at((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));zt.every=t=>isFinite(t=Math.floor(t))&&t>0?at((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null;zt.range;const Rt=at((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth())),Pt=(Rt.range,at((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()))),Lt=(Pt.range,at((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*st-t.getMinutes()*ct)}),((t,e)=>{t.setTime(+t+e*lt)}),((t,e)=>(e-t)/lt),(t=>t.getHours()))),jt=(Lt.range,at((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*lt)}),((t,e)=>(e-t)/lt),(t=>t.getUTCHours()))),Bt=(jt.range,at((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*st)}),((t,e)=>{t.setTime(+t+e*ct)}),((t,e)=>(e-t)/ct),(t=>t.getMinutes()))),Ut=(Bt.range,at((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*ct)}),((t,e)=>(e-t)/ct),(t=>t.getUTCMinutes()))),It=(Ut.range,at((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*st)}),((t,e)=>(e-t)/st),(t=>t.getUTCSeconds()))),qt=(It.range,at((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t)));qt.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?at((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):qt:null);qt.range;function Wt(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ht(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Xt(t){let e,n,i;function r(t,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<0?r=e+1:o=e}while(r<o)}return r}return 2!==t.length?(e=Wt,n=(e,n)=>Wt(t(e),n),i=(e,n)=>t(e)-n):(e=t===Wt||t===Ht?t:Jt,n=t,i=t),{left:r,center:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const o=r(t,e,n,(arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length)-1);return o>n&&i(t[o-1],e)>-i(t[o],e)?o-1:o},right:function(t,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<=0?r=e+1:o=e}while(r<o)}return r}}}function Jt(){return 0}const Gt="year",$t="quarter",Vt="month",Yt="week",Kt="date",Zt="day",Qt="dayofyear",te="hours",ee="minutes",ne="seconds",ie="milliseconds",re=[Gt,$t,Vt,Yt,Kt,Zt,Qt,te,ee,ne,ie],oe=re.reduce(((t,e,n)=>(t[e]=1+n,t)),{});function ae(t){const e=(0,m.IX)(t).slice(),n={};e.length||(0,m.vU)("Missing time unit."),e.forEach((t=>{(0,m.nr)(oe,t)?n[t]=1:(0,m.vU)("Invalid time unit: ".concat(t,"."))}));return(n[Yt]||n[Zt]?1:0)+(n[$t]||n[Vt]||n[Kt]?1:0)+(n[Qt]?1:0)>1&&(0,m.vU)("Incompatible time units: ".concat(t)),e.sort(((t,e)=>oe[t]-oe[e])),e}const se={[Gt]:"%Y ",[$t]:"Q%q ",[Vt]:"%b ",[Kt]:"%d ",[Yt]:"W%U ",[Zt]:"%a ",[Qt]:"%j ",[te]:"%H:00",[ee]:"00:%M",[ne]:":%S",[ie]:".%L",["".concat(Gt,"-").concat(Vt)]:"%Y-%m ",["".concat(Gt,"-").concat(Vt,"-").concat(Kt)]:"%Y-%m-%d ",["".concat(te,"-").concat(ee)]:"%H:%M"};function ce(t,e){const n=(0,m.l7)({},se,e),i=ae(t),r=i.length;let o,a,s="",c=0;for(c=0;c<r;)for(o=i.length;o>c;--o)if(a=i.slice(c,o).join("-"),null!=n[a]){s+=n[a],c=o;break}return s.trim()}const le=new Date;function ue(t){return le.setFullYear(t),le.setMonth(0),le.setDate(1),le.setHours(0,0,0,0),le}function fe(t){return he(new Date(t))}function de(t){return pe(new Date(t))}function he(t){return pt.count(ue(t.getFullYear())-1,t)}function pe(t){return yt.count(ue(t.getFullYear())-1,t)}function me(t){return ue(t).getDay()}function ge(t,e,n,i,r,o,a){if(0<=t&&t<100){const s=new Date(-1,e,n,i,r,o,a);return s.setFullYear(t),s}return new Date(t,e,n,i,r,o,a)}function ve(t){return be(new Date(t))}function ye(t){return xe(new Date(t))}function be(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return mt.count(e-1,t)}function xe(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return At.count(e-1,t)}function _e(t){return le.setTime(Date.UTC(t,0,1)),le.getUTCDay()}function we(t,e,n,i,r,o,a){if(0<=t&&t<100){const t=new Date(Date.UTC(-1,e,n,i,r,o,a));return t.setUTCFullYear(n.y),t}return new Date(Date.UTC(t,e,n,i,r,o,a))}function ke(t,e,n,i,r){const o=e||1,a=(0,m.fj)(t),s=(t,e,r)=>function(t,e,n,i){const r=n<=1?t:i?(e,r)=>i+n*Math.floor((t(e,r)-i)/n):(e,i)=>n*Math.floor(t(e,i)/n);return e?(t,n)=>e(r(t,n),n):r}(n[r=r||t],i[r],t===a&&o,e),c=new Date,l=(0,m.Rg)(t),u=l[Gt]?s(Gt):(0,m.a9)(2012),f=l[Vt]?s(Vt):l[$t]?s($t):m.bM,d=l[Yt]&&l[Zt]?s(Zt,1,Yt+Zt):l[Yt]?s(Yt,1):l[Zt]?s(Zt,1):l[Kt]?s(Kt,1):l[Qt]?s(Qt,1):m.kX,h=l[te]?s(te):m.bM,p=l[ee]?s(ee):m.bM,g=l[ne]?s(ne):m.bM,v=l[ie]?s(ie):m.bM;return function(t){c.setTime(+t);const e=u(c);return r(e,f(c),d(c,e),h(c),p(c),g(c),v(c))}}function Ee(t,e,n){return e+7*t-(n+6)%7}const De={[Gt]:t=>t.getFullYear(),[$t]:t=>Math.floor(t.getMonth()/3),[Vt]:t=>t.getMonth(),[Kt]:t=>t.getDate(),[te]:t=>t.getHours(),[ee]:t=>t.getMinutes(),[ne]:t=>t.getSeconds(),[ie]:t=>t.getMilliseconds(),[Qt]:t=>he(t),[Yt]:t=>pe(t),[Yt+Zt]:(t,e)=>Ee(pe(t),t.getDay(),me(e)),[Zt]:(t,e)=>Ee(1,t.getDay(),me(e))},Ae={[$t]:t=>3*t,[Yt]:(t,e)=>Ee(t,0,me(e))};function Se(t,e){return ke(t,e||1,De,Ae,ge)}const Me={[Gt]:t=>t.getUTCFullYear(),[$t]:t=>Math.floor(t.getUTCMonth()/3),[Vt]:t=>t.getUTCMonth(),[Kt]:t=>t.getUTCDate(),[te]:t=>t.getUTCHours(),[ee]:t=>t.getUTCMinutes(),[ne]:t=>t.getUTCSeconds(),[ie]:t=>t.getUTCMilliseconds(),[Qt]:t=>be(t),[Yt]:t=>xe(t),[Zt]:(t,e)=>Ee(1,t.getUTCDay(),_e(e)),[Yt+Zt]:(t,e)=>Ee(xe(t),t.getUTCDay(),_e(e))},Ce={[$t]:t=>3*t,[Yt]:(t,e)=>Ee(t,0,_e(e))};function Fe(t,e){return ke(t,e||1,Me,Ce,we)}const Oe={[Gt]:Tt,[$t]:Rt.every(3),[Vt]:Rt,[Yt]:yt,[Kt]:pt,[Zt]:pt,[Qt]:pt,[te]:Lt,[ee]:Bt,[ne]:It,[ie]:qt},Ne={[Gt]:zt,[$t]:Pt.every(3),[Vt]:Pt,[Yt]:At,[Kt]:mt,[Zt]:mt,[Qt]:mt,[te]:jt,[ee]:Ut,[ne]:It,[ie]:qt};function Te(t){return Oe[t]}function ze(t){return Ne[t]}function Re(t,e,n){return t?t.offset(e,n):void 0}function Pe(t,e,n){return Re(Te(t),e,n)}function Le(t,e,n){return Re(ze(t),e,n)}function je(t,e,n,i){return t?t.range(e,n,i):void 0}function Be(t,e,n,i){return je(Te(t),e,n,i)}function Ue(t,e,n,i){return je(ze(t),e,n,i)}const Ie=1e3,qe=6e4,We=36e5,He=864e5,Xe=2592e6,Je=31536e6,Ge=[Gt,Vt,Kt,te,ee,ne,ie],$e=Ge.slice(0,-1),Ve=$e.slice(0,-1),Ye=Ve.slice(0,-1),Ke=Ye.slice(0,-1),Ze=[Gt,Vt],Qe=[Gt],tn=[[$e,1,Ie],[$e,5,5e3],[$e,15,15e3],[$e,30,3e4],[Ve,1,qe],[Ve,5,3e5],[Ve,15,9e5],[Ve,30,18e5],[Ye,1,We],[Ye,3,108e5],[Ye,6,216e5],[Ye,12,432e5],[Ke,1,He],[[Gt,Yt],1,6048e5],[Ze,1,Xe],[Ze,3,7776e6],[Qe,1,Je]];function en(t){const e=t.extent,n=t.maxbins||40,i=Math.abs((0,m.yP)(e))/n;let r,o,a=Xt((t=>t[2])).right(tn,i);return a===tn.length?(r=Qe,o=B(e[0]/Je,e[1]/Je,n)):a?(a=tn[i/tn[a-1][2]<tn[a][2]/i?a-1:a],r=a[0],o=a[1]):(r=Ge,o=Math.max(B(e[0],e[1],n),1)),{units:r,step:o}}function nn(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function rn(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function on(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function an(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,a=t.shortDays,s=t.months,c=t.shortMonths,l=yn(r),u=bn(r),f=yn(o),d=bn(o),h=yn(a),p=bn(a),m=yn(s),g=bn(s),v=yn(c),y=bn(c),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Un,e:Un,f:Xn,g:ni,G:ri,H:In,I:qn,j:Wn,L:Hn,m:Jn,M:Gn,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Si,s:Mi,S:$n,u:Vn,U:Yn,V:Zn,w:Qn,W:ti,x:null,X:null,y:ei,Y:ii,Z:oi,"%":Ai},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:ai,e:ai,f:fi,g:wi,G:Ei,H:si,I:ci,j:li,L:ui,m:di,M:hi,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Si,s:Mi,S:pi,u:mi,U:gi,V:yi,w:bi,W:xi,x:null,X:null,y:_i,Y:ki,Z:Di,"%":Ai},_={a:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=v.exec(e.slice(n));return i?(t.m=y.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=m.exec(e.slice(n));return i?(t.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return E(t,e,n,i)},d:Fn,e:Fn,f:Pn,g:An,G:Dn,H:Nn,I:Nn,j:On,L:Rn,m:Cn,M:Tn,p:function(t,e,n){var i=l.exec(e.slice(n));return i?(t.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:Mn,Q:jn,s:Bn,S:zn,u:_n,U:wn,V:kn,w:xn,W:En,x:function(t,e,i){return E(t,n,e,i)},X:function(t,e,n){return E(t,i,e,n)},y:An,Y:Dn,Z:Sn,"%":Ln};function w(t,e){return function(n){var i,r,o,a=[],s=-1,c=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++s<l;)37===t.charCodeAt(s)&&(a.push(t.slice(c,s)),null!=(r=dn[i=t.charAt(++s)])?i=t.charAt(++s):r="e"===i?" ":"0",(o=e[i])&&(i=o(n,r)),a.push(i),c=s+1);return a.push(t.slice(c,s)),a.join("")}}function k(t,e){return function(n){var i,r,o=on(1900,void 0,1);if(E(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=rn(on(o.y,0,1))).getUTCDay(),i=r>4||0===r?St.ceil(i):St(i),i=mt.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=nn(on(o.y,0,1))).getDay(),i=r>4||0===r?bt.ceil(i):bt(i),i=pt.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?rn(on(o.y,0,1)).getUTCDay():nn(on(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,rn(o)):nn(o)}}function E(t,e,n,i){for(var r,o,a=0,s=e.length,c=n.length;a<s;){if(i>=c)return-1;if(37===(r=e.charCodeAt(a++))){if(r=e.charAt(a++),!(o=_[r in dn?e.charAt(a++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=w(n,b),b.X=w(i,b),b.c=w(e,b),x.x=w(n,x),x.X=w(i,x),x.c=w(e,x),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var sn,cn,ln,un,fn,dn={"-":"",_:" ",0:"0"},hn=/^\s*\d+/,pn=/^%/,mn=/[\\^$*+?|[\]().{}]/g;function gn(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function vn(t){return t.replace(mn,"\\$&")}function yn(t){return new RegExp("^(?:"+t.map(vn).join("|")+")","i")}function bn(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function xn(t,e,n){var i=hn.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function _n(t,e,n){var i=hn.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function wn(t,e,n){var i=hn.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function kn(t,e,n){var i=hn.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function En(t,e,n){var i=hn.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function Dn(t,e,n){var i=hn.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function An(t,e,n){var i=hn.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Sn(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Mn(t,e,n){var i=hn.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function Cn(t,e,n){var i=hn.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function Fn(t,e,n){var i=hn.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function On(t,e,n){var i=hn.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function Nn(t,e,n){var i=hn.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function Tn(t,e,n){var i=hn.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function zn(t,e,n){var i=hn.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function Rn(t,e,n){var i=hn.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function Pn(t,e,n){var i=hn.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Ln(t,e,n){var i=pn.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function jn(t,e,n){var i=hn.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Bn(t,e,n){var i=hn.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Un(t,e){return gn(t.getDate(),e,2)}function In(t,e){return gn(t.getHours(),e,2)}function qn(t,e){return gn(t.getHours()%12||12,e,2)}function Wn(t,e){return gn(1+pt.count(Tt(t),t),e,3)}function Hn(t,e){return gn(t.getMilliseconds(),e,3)}function Xn(t,e){return Hn(t,e)+"000"}function Jn(t,e){return gn(t.getMonth()+1,e,2)}function Gn(t,e){return gn(t.getMinutes(),e,2)}function $n(t,e){return gn(t.getSeconds(),e,2)}function Vn(t){var e=t.getDay();return 0===e?7:e}function Yn(t,e){return gn(yt.count(Tt(t)-1,t),e,2)}function Kn(t){var e=t.getDay();return e>=4||0===e?wt(t):wt.ceil(t)}function Zn(t,e){return t=Kn(t),gn(wt.count(Tt(t),t)+(4===Tt(t).getDay()),e,2)}function Qn(t){return t.getDay()}function ti(t,e){return gn(bt.count(Tt(t)-1,t),e,2)}function ei(t,e){return gn(t.getFullYear()%100,e,2)}function ni(t,e){return gn((t=Kn(t)).getFullYear()%100,e,2)}function ii(t,e){return gn(t.getFullYear()%1e4,e,4)}function ri(t,e){var n=t.getDay();return gn((t=n>=4||0===n?wt(t):wt.ceil(t)).getFullYear()%1e4,e,4)}function oi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+gn(e/60|0,"0",2)+gn(e%60,"0",2)}function ai(t,e){return gn(t.getUTCDate(),e,2)}function si(t,e){return gn(t.getUTCHours(),e,2)}function ci(t,e){return gn(t.getUTCHours()%12||12,e,2)}function li(t,e){return gn(1+mt.count(zt(t),t),e,3)}function ui(t,e){return gn(t.getUTCMilliseconds(),e,3)}function fi(t,e){return ui(t,e)+"000"}function di(t,e){return gn(t.getUTCMonth()+1,e,2)}function hi(t,e){return gn(t.getUTCMinutes(),e,2)}function pi(t,e){return gn(t.getUTCSeconds(),e,2)}function mi(t){var e=t.getUTCDay();return 0===e?7:e}function gi(t,e){return gn(At.count(zt(t)-1,t),e,2)}function vi(t){var e=t.getUTCDay();return e>=4||0===e?Ft(t):Ft.ceil(t)}function yi(t,e){return t=vi(t),gn(Ft.count(zt(t),t)+(4===zt(t).getUTCDay()),e,2)}function bi(t){return t.getUTCDay()}function xi(t,e){return gn(St.count(zt(t)-1,t),e,2)}function _i(t,e){return gn(t.getUTCFullYear()%100,e,2)}function wi(t,e){return gn((t=vi(t)).getUTCFullYear()%100,e,2)}function ki(t,e){return gn(t.getUTCFullYear()%1e4,e,4)}function Ei(t,e){var n=t.getUTCDay();return gn((t=n>=4||0===n?Ft(t):Ft.ceil(t)).getUTCFullYear()%1e4,e,4)}function Di(){return"+0000"}function Ai(){return"%"}function Si(t){return+t}function Mi(t){return Math.floor(+t/1e3)}function Ci(t){const e={};return n=>e[n]||(e[n]=t(n))}function Fi(t){const e=Ci(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(t){const n=q(t||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return i=e(n),r=e(".1f")(1)[1],t=>{const e=i(t),n=e.indexOf(r);if(n<0)return e;let o=function(t,e){let n,i=t.lastIndexOf("e");if(i>0)return i;for(i=t.length;--i>e;)if(n=t.charCodeAt(i),n>=48&&n<=57)return i+1}(e,n);const a=o<e.length?e.slice(o):"";for(;--o>n;)if("0"!==e[o]){++o;break}return e.slice(0,o)+a}}return e(n);var i,r},formatSpan(t,i,r,o){o=q(null==o?",f":o);const a=B(t,i,r),s=Math.max(Math.abs(t),Math.abs(i));let c;if(null==o.precision)switch(o.type){case"s":return isNaN(c=J(a,s))||(o.precision=c),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(c=G(a,s))||(o.precision=c-("e"===o.type));break;case"f":case"%":isNaN(c=$(a))||(o.precision=c-2*("%"===o.type))}return e(o)}}}let Oi,Ni;function Ti(){return Oi=Fi({format:Q,formatPrefix:tt})}function zi(t){return Fi(it(t))}function Ri(t){return arguments.length?Oi=zi(t):Oi}function Pi(t,e,n){n=n||{},(0,m.Kn)(n)||(0,m.vU)("Invalid time multi-format specifier: ".concat(n));const i=e(ne),r=e(ee),o=e(te),a=e(Kt),s=e(Yt),c=e(Vt),l=e($t),u=e(Gt),f=t(n[ie]||".%L"),d=t(n[ne]||":%S"),h=t(n[ee]||"%I:%M"),p=t(n[te]||"%I %p"),g=t(n[Kt]||n[Zt]||"%a %d"),v=t(n[Yt]||"%b %d"),y=t(n[Vt]||"%B"),b=t(n[$t]||"%B"),x=t(n[Gt]||"%Y");return t=>(i(t)<t?f:r(t)<t?d:o(t)<t?h:a(t)<t?p:c(t)<t?s(t)<t?g:v:u(t)<t?l(t)<t?y:b:x)(t)}function Li(t){const e=Ci(t.format),n=Ci(t.utcFormat);return{timeFormat:t=>(0,m.HD)(t)?e(t):Pi(e,Te,t),utcFormat:t=>(0,m.HD)(t)?n(t):Pi(n,ze,t),timeParse:Ci(t.parse),utcParse:Ci(t.utcParse)}}function ji(){return Ni=Li({format:cn,parse:ln,utcFormat:un,utcParse:fn})}function Bi(t){return Li(an(t))}function Ui(t){return arguments.length?Ni=Bi(t):Ni}!function(t){sn=an(t),cn=sn.format,ln=sn.parse,un=sn.utcFormat,fn=sn.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),Ti(),ji();const Ii=(t,e)=>(0,m.l7)({},t,e);function qi(t,e){const n=t?zi(t):Ri(),i=e?Bi(e):Ui();return Ii(n,i)}function Wi(t,e){const n=arguments.length;return n&&2!==n&&(0,m.vU)("defaultLocale expects either zero or two arguments."),n?Ii(Ri(t),Ui(e)):Ii(Ri(),Ui())}function Hi(){return Ti(),ji(),Wi()}const Xi=/^(data:|([A-Za-z]+:)?\/\/)/,Ji=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Gi=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,$i="file://";async function Vi(t,e){const n=await this.sanitize(t,e),i=n.href;return n.localFile?this.file(i):this.http(i,e)}async function Yi(t,e){e=(0,m.l7)({},this.options,e);const n=this.fileAccess,i={href:null};let r,o,a;const s=Ji.test(t.replace(Gi,""));null!=t&&"string"===typeof t&&s||(0,m.vU)("Sanitize failure, invalid URI: "+(0,m.m8)(t));const c=Xi.test(t);return(a=e.baseURL)&&!c&&(t.startsWith("/")||a.endsWith("/")||(t="/"+t),t=a+t),o=(r=t.startsWith($i))||"file"===e.mode||"http"!==e.mode&&!c&&n,r?t=t.slice($i.length):t.startsWith("//")&&("file"===e.defaultProtocol?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(i,"localFile",{value:!!o}),i.href=t,e.target&&(i.target=e.target+""),e.rel&&(i.rel=e.rel+""),"image"===e.context&&e.crossOrigin&&(i.crossOrigin=e.crossOrigin+""),i}function Ki(t){return t?e=>new Promise(((n,i)=>{t.readFile(e,((t,e)=>{t?i(t):n(e)}))})):Zi}async function Zi(){(0,m.vU)("No file system access.")}function Qi(t){return t?async function(e,n){const i=(0,m.l7)({},this.options.http,n),r=n&&n.response,o=await t(e,i);return o.ok?(0,m.mf)(o[r])?o[r]():o.text():(0,m.vU)(o.status+""+o.statusText)}:tr}async function tr(){(0,m.vU)("No HTTP fetch method available.")}const er=t=>null!=t&&t===t,nr=t=>!Number.isNaN(+t)&&!(t instanceof Date),ir={boolean:m.sw,integer:m.He,number:m.He,date:m.ZU,string:m.BB,unknown:m.yR},rr=[t=>"true"===t||"false"===t||!0===t||!1===t,t=>nr(t)&&Number.isInteger(+t),nr,t=>!Number.isNaN(Date.parse(t))],or=["boolean","integer","number","date"];function ar(t,e){if(!t||!t.length)return"unknown";const n=t.length,i=rr.length,r=rr.map(((t,e)=>e+1));for(let o,a,s=0,c=0;s<n;++s)for(a=e?t[s][e]:t[s],o=0;o<i;++o)if(r[o]&&er(a)&&!rr[o](a)&&(r[o]=0,++c,c===rr.length))return"string";return or[r.reduce(((t,e)=>0===t?e:t),0)-1]}function sr(t,e){return e.reduce(((e,n)=>(e[n]=ar(t,n),e)),{})}function cr(t){const e=function(e,n){const i={delimiter:t};return lr(e,n?(0,m.l7)(n,i):i)};return e.responseType="text",e}function lr(t,e){return e.header&&(t=e.header.map(m.m8).join(e.delimiter)+"\n"+t),D(e.delimiter).parse(t+"")}function ur(t,e){const n=e&&e.property?(0,m.EP)(e.property):m.yR;return!(0,m.Kn)(t)||(i=t,"function"===typeof Buffer&&(0,m.mf)(Buffer.isBuffer)&&Buffer.isBuffer(i))?n(JSON.parse(t)):function(t,e){!(0,m.kJ)(t)&&(0,m.TW)(t)&&(t=[...t]);return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(n(t),e);var i}lr.responseType="text",ur.responseType="json";const fr={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function dr(t,e){let n,i,r,o;return t=ur(t,e),e&&e.feature?(n=S,r=e.feature):e&&e.mesh?(n=O,r=e.mesh,o=fr[e.filter]):(0,m.vU)("Missing TopoJSON feature or mesh parameter."),i=(i=t.objects[r])?n(t,i,o):(0,m.vU)("Invalid TopoJSON object: "+r),i&&i.features||[i]}dr.responseType="json";const hr={dsv:lr,csv:cr(","),tsv:cr("\t"),json:ur,topojson:dr};function pr(t,e){return arguments.length>1?(hr[t]=e,this):(0,m.nr)(hr,t)?hr[t]:null}function mr(t){const e=pr(t);return e&&e.responseType||"text"}function gr(t,e,n,i){const r=pr((e=e||{}).type||"json");return r||(0,m.vU)("Unknown data format type: "+e.type),t=r(t,e),e.parse&&function(t,e,n,i){if(!t.length)return;const r=Ui();n=n||r.timeParse,i=i||r.utcParse;let o,a,s,c,l,u,f=t.columns||Object.keys(t[0]);"auto"===e&&(e=sr(t,f));f=Object.keys(e);const d=f.map((t=>{const r=e[t];let o,a;if(r&&(r.startsWith("date:")||r.startsWith("utc:"))){o=r.split(/:(.+)?/,2),a=o[1],("'"===a[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1));return("utc"===o[0]?i:n)(a)}if(!ir[r])throw Error("Illegal format pattern: "+t+":"+r);return ir[r]}));for(s=0,l=t.length,u=f.length;s<l;++s)for(o=t[s],c=0;c<u;++c)a=f[c],o[a]=d[c](o[a])}(t,e.parse,n,i),(0,m.nr)(t,"columns")&&delete t.columns,t}const vr=function(t,e){return n=>({options:n||{},sanitize:Yi,load:Vi,fileAccess:!!e,file:Ki(e),http:Qi(t)})}("undefined"!==typeof fetch&&fetch,null);function yr(t){const e=t||m.yR,n=[],i={};return n.add=t=>{const r=e(t);return i[r]||(i[r]=1,n.push(t)),n},n.remove=t=>{const r=e(t);if(i[r]){i[r]=0;const e=n.indexOf(t);e>=0&&n.splice(e,1)}return n},n}async function br(t,e){try{await e(t)}catch(n){t.error(n)}}const xr=Symbol("vega_id");let _r=1;function wr(t){return!(!t||!kr(t))}function kr(t){return t[xr]}function Er(t,e){return t[xr]=e,t}function Dr(t){const e=t===Object(t)?t:{data:t};return kr(e)?e:Er(e,_r++)}function Ar(t){return Sr(t,Dr({}))}function Sr(t,e){for(const n in t)e[n]=t[n];return e}function Mr(t,e){return Er(e,kr(t))}function Cr(t,e){return t?e?(n,i)=>t(n,i)||kr(e(n))-kr(e(i)):(e,n)=>t(e,n)||kr(e)-kr(n):null}function Fr(t){return t&&t.constructor===Or}function Or(){const t=[],e=[],n=[],i=[],r=[];let o=null,a=!1;return{constructor:Or,insert(e){const n=(0,m.IX)(e),i=n.length;for(let r=0;r<i;++r)t.push(n[r]);return this},remove(t){const n=(0,m.mf)(t)?i:e,r=(0,m.IX)(t),o=r.length;for(let e=0;e<o;++e)n.push(r[e]);return this},modify(t,e,i){const o={field:e,value:(0,m.a9)(i)};return(0,m.mf)(t)?(o.filter=t,r.push(o)):(o.tuple=t,n.push(o)),this},encode(t,e){return(0,m.mf)(t)?r.push({filter:t,field:e}):n.push({tuple:t,field:e}),this},clean(t){return o=t,this},reflow(){return a=!0,this},pulse(s,c){const l={},u={};let f,d,h,p,m,g;for(f=0,d=c.length;f<d;++f)l[kr(c[f])]=1;for(f=0,d=e.length;f<d;++f)m=e[f],l[kr(m)]=-1;for(f=0,d=i.length;f<d;++f)p=i[f],c.forEach((t=>{p(t)&&(l[kr(t)]=-1)}));for(f=0,d=t.length;f<d;++f)m=t[f],g=kr(m),l[g]?l[g]=1:s.add.push(Dr(t[f]));for(f=0,d=c.length;f<d;++f)m=c[f],l[kr(m)]<0&&s.rem.push(m);function v(t,e,n){n?t[e]=n(t):s.encode=e,a||(u[kr(t)]=t)}for(f=0,d=n.length;f<d;++f)h=n[f],m=h.tuple,p=h.field,g=l[kr(m)],g>0&&(v(m,p,h.value),s.modifies(p));for(f=0,d=r.length;f<d;++f)h=r[f],p=h.filter,c.forEach((t=>{p(t)&&l[kr(t)]>0&&v(t,h.field,h.value)})),s.modifies(h.field);if(a)s.mod=e.length||i.length?c.filter((t=>l[kr(t)]>0)):c.slice();else for(g in u)s.mod.push(u[g]);return(o||null==o&&(e.length||i.length))&&s.clean(!0),s}}}const Nr="_:mod:_";function Tr(){Object.defineProperty(this,Nr,{writable:!0,value:{}})}Tr.prototype={set(t,e,n,i){const r=this,o=r[t],a=r[Nr];return null!=e&&e>=0?(o[e]!==n||i)&&(o[e]=n,a[e+":"+t]=-1,a[t]=-1):(o!==n||i)&&(r[t]=n,a[t]=(0,m.kJ)(n)?1+n.length:-1),r},modified(t,e){const n=this[Nr];if(!arguments.length){for(const t in n)if(n[t])return!0;return!1}if((0,m.kJ)(t)){for(let e=0;e<t.length;++e)if(n[t[e]])return!0;return!1}return null!=e&&e>=0?e+1<n[t]||!!n[e+":"+t]:!!n[t]},clear(){return this[Nr]={},this}};let zr=0;const Rr=new Tr;function Pr(t,e,n,i){this.id=++zr,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,i)}function Lr(t){return function(e){const n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}Pr.prototype={targets(){return this._targets||(this._targets=yr(m.id))},set(t){return this.value!==t?(this.value=t,1):0},skip:Lr(1),modified:Lr(2),parameters(t,e,n){e=!1!==e;const i=this._argval=this._argval||new Tr,r=this._argops=this._argops||[],o=[];let a,s,c,l;const u=(t,n,a)=>{a instanceof Pr?(a!==this&&(e&&a.targets().add(this),o.push(a)),r.push({op:a,name:t,index:n})):i.set(t,n,a)};for(a in t)if(s=t[a],"pulse"===a)(0,m.IX)(s).forEach((t=>{t instanceof Pr?t!==this&&(t.targets().add(this),o.push(t)):(0,m.vU)("Pulse parameters must be operator instances.")})),this.source=s;else if((0,m.kJ)(s))for(i.set(a,-1,Array(c=s.length)),l=0;l<c;++l)u(a,l,s[l]);else u(a,-1,s);return this.marshall().clear(),n&&(r.initonly=!0),o},marshall(t){const e=this._argval||Rr,n=this._argops;let i,r,o,a;if(n){const s=n.length;for(r=0;r<s;++r)i=n[r],o=i.op,a=o.modified()&&o.stamp===t,e.set(i.name,i.index,o.value,a);if(n.initonly){for(r=0;r<s;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return e},detach(){const t=this._argops;let e,n,i,r;if(t)for(e=0,n=t.length;e<n;++e)i=t[e],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(t){const e=this._update;if(e){const n=this.marshall(t.stamp),i=e.call(this,n,t);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return t.StopPropagation}},run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.pulse=e||t}};let jr=0;function Br(t,e,n){this.id=++jr,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function Ur(t,e,n){return new Br(t,e,n)}Br.prototype={_filter:m.yb,_apply:m.yR,targets(){return this._targets||(this._targets=yr(m.id))},consume(t){return arguments.length?(this._consume=!!t,this):!!this._consume},receive(t){if(this._filter(t)){const e=this.value=this._apply(t),n=this._targets,i=n?n.length:0;for(let t=0;t<i;++t)n[t].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},filter(t){const e=Ur(t);return this.targets().add(e),e},apply(t){const e=Ur(null,t);return this.targets().add(e),e},merge(){const t=Ur();this.targets().add(t);for(let e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},throttle(t){let e=-1;return this.filter((()=>{const n=Date.now();return n-e>t?(e=n,1):0}))},debounce(t){const e=Ur();return this.targets().add(Ur(null,null,(0,m.Ds)(t,(t=>{const n=t.dataflow;e.receive(t),n&&n.run&&n.run()})))),e},between(t,e){let n=!1;return t.targets().add(Ur(null,null,(()=>n=!0))),e.targets().add(Ur(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=m.yb,this._targets=null}};const Ir={skip:!0};function qr(t,e,n,i,r,o){const a=(0,m.l7)({},o,Ir);let s,c;(0,m.mf)(n)||(n=(0,m.a9)(n)),void 0===i?s=e=>t.touch(n(e)):(0,m.mf)(i)?(c=new Pr(null,i,r,!1),s=e=>{c.evaluate(e);const i=n(e),r=c.value;Fr(r)?t.pulse(i,r,o):t.update(i,r,a)}):s=e=>t.update(n(e),i,a),e.apply(s)}function Wr(t,e,n,i,r,o){if(void 0===i)e.targets().add(n);else{const a=o||{},s=new Pr(null,function(t,e){return e=(0,m.mf)(e)?e:(0,m.a9)(e),t?function(n,i){const r=e(n,i);return t.skip()||(t.skip(r!==this.value).value=r),r}:e}(n,i),r,!1);s.modified(a.force),s.rank=e.rank,e.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),t.connect(n,[s]))}}const Hr={};function Xr(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Jr(t,e){const n=[];return(0,m.FP)(t,e,(t=>n.push(t))),n}function Gr(t,e){const n={};return t.visit(e,(t=>{n[kr(t)]=1})),t=>n[kr(t)]?null:t}function $r(t,e){return t?(n,i)=>t(n,i)&&e(n,i):e}function Vr(t,e,n,i){const r=this;let o=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=i||null,this.pulses=n;for(const a of n)if(a.stamp===e){if(a.fields){const t=r.fields||(r.fields={});for(const e in a.fields)t[e]=1}a.changed(r.ADD)&&(o|=r.ADD),a.changed(r.REM)&&(o|=r.REM),a.changed(r.MOD)&&(o|=r.MOD)}this.changes=o}function Yr(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}Xr.prototype={StopPropagation:Hr,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(t){return new Xr(this.dataflow).init(this,t)},clone(){const t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new Xr(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},reflow(t){if(t)return this.fork(7).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,Gr(this,1))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const e=this.fields||(this.fields={});return(0,m.kJ)(t)?t.forEach((t=>e[t]=!0)):e[t]=!0,this},modified(t,e){const n=this.fields;return!(!e&&!this.mod.length||!n)&&(arguments.length?(0,m.kJ)(t)?t.some((t=>n[t])):n[t]:!!n)},filter(t,e){const n=this;return 1&t&&(n.addF=$r(n.addF,e)),2&t&&(n.remF=$r(n.remF,e)),4&t&&(n.modF=$r(n.modF,e)),16&t&&(n.srcF=$r(n.srcF,e)),n},materialize(t){const e=this;return 1&(t=t||7)&&e.addF&&(e.add=Jr(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=Jr(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=Jr(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,i=e;if(16&t)return(0,m.FP)(n.source,n.srcF,i),n;1&t&&(0,m.FP)(n.add,n.addF,i),2&t&&(0,m.FP)(n.rem,n.remF,i),4&t&&(0,m.FP)(n.mod,n.modF,i);const r=n.source;if(8&t&&r){const t=n.add.length+n.mod.length;t===r.length||(t?(0,m.FP)(r,Gr(n,5),i):(0,m.FP)(r,n.srcF,i))}return n}},(0,m.XW)(Vr,Xr,{fork(t){const e=new Xr(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,(t=>e.add.push(t))),t&e.REM&&this.visit(e.REM,(t=>e.rem.push(t))),t&e.MOD&&this.visit(e.MOD,(t=>e.mod.push(t)))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?(0,m.kJ)(t)?t.some((t=>n[t])):n[t]:0},filter(){(0,m.vU)("MultiPulse does not support filtering.")},materialize(){(0,m.vU)("MultiPulse does not support materialization.")},visit(t,e){const n=this,i=n.pulses,r=i.length;let o=0;if(t&n.SOURCE)for(;o<r;++o)i[o].visit(t,e);else for(;o<r;++o)i[o].stamp===n.stamp&&i[o].visit(t,e);return n}});const Kr={skip:!1,force:!1};function Zr(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),Qr(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let i;return e.length?(i=e[0],e[0]=n,function(t,e,n){const i=e,r=t.length,o=t[e];let a,s=1+(e<<1);for(;s<r;)a=s+1,a<r&&n(t[s],t[a])>=0&&(s=a),t[e]=t[s],s=1+((e=s)<<1);t[e]=o,Qr(t,i,e,n)}(e,0,t)):i=n,i}}}function Qr(t,e,n,i){let r,o;const a=t[n];for(;n>e&&(o=n-1>>1,r=t[o],i(a,r)<0);)t[n]=r,n=o;return t[n]=a}function to(){this.logger((0,m.kg)()),this.logLevel(m.jj),this._clock=0,this._rank=0,this._locale=Wi();try{this._loader=vr()}catch(t){}this._touched=yr(m.id),this._input={},this._pulse=null,this._heap=Zr(((t,e)=>t.qrank-e.qrank)),this._postrun=[]}function eo(t){return function(){return this._log[t].apply(this,arguments)}}function no(t,e){Pr.call(this,t,null,e)}to.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:eo("error"),warn:eo("warn"),info:eo("info"),debug:eo("debug"),logLevel:eo("level"),cleanThreshold:1e4,add:function(t,e,n,i){let r,o=1;return t instanceof Pr?r=t:t&&t.prototype instanceof Pr?r=new t:(0,m.mf)(t)?r=new Pr(null,t):(o=0,r=new Pr(t,e)),this.rank(r),o&&(i=n,n=e),n&&this.connect(r,r.parameters(n,i)),this.touch(r),r},connect:function(t,e){const n=t.rank,i=e.length;for(let r=0;r<i;++r)if(n<e[r].rank)return void this.rerank(t)},rank:function(t){t.rank=++this._rank},rerank:function(t){const e=[t];let n,i,r;for(;e.length;)if(this.rank(n=e.pop()),i=n._targets)for(r=i.length;--r>=0;)e.push(n=i[r]),n===t&&(0,m.vU)("Cycle detected in dataflow graph.")},pulse:function(t,e,n){this.touch(t,n||Kr);const i=new Xr(this,this._clock+(this._pulse?0:1)),r=t.pulse&&t.pulse.source||[];return i.target=t,this._input[t.id]=e.pulse(i,r),this},touch:function(t,e){const n=e||Kr;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},update:function(t,e,n){const i=n||Kr;return(t.set(e)||i.force)&&this.touch(t,i),this},changeset:Or,ingest:function(t,e,n){return e=this.parse(e,n),this.pulse(t,this.changeset().insert(e))},parse:function(t,e){const n=this.locale();return gr(t,e,n.timeParse,n.utcParse)},preload:async function(t,e,n){const i=this,r=i._pending||function(t){let e;const n=new Promise((t=>e=t));return n.requests=0,n.done=()=>{0===--n.requests&&(t._pending=null,e(t))},t._pending=n}(i);r.requests+=1;const o=await i.request(e,n);return i.pulse(t,i.changeset().remove(m.yb).insert(o.data||[])),r.done(),o},request:async function(t,e){const n=this;let i,r=0;try{i=await n.loader().load(t,{context:"dataflow",response:mr(e&&e.type)});try{i=n.parse(i,e)}catch(o){r=-2,n.warn("Data ingestion failed",t,o)}}catch(o){r=-1,n.warn("Loading failed",t,o)}return{data:i,status:r}},events:function(t,e,n,i){const r=this,o=Ur(n,i),a=function(t){t.dataflow=r;try{o.receive(t)}catch(e){r.error(e)}finally{r.run()}};let s;s="string"===typeof t&&"undefined"!==typeof document?document.querySelectorAll(t):(0,m.IX)(t);const c=s.length;for(let l=0;l<c;++l)s[l].addEventListener(e,a);return o},on:function(t,e,n,i,r){return(t instanceof Pr?Wr:qr)(this,t,e,n,i,r),this},evaluate:async function(t,e,n){const i=this,r=[];if(i._pulse)return Yr(i);if(i._pending&&await i._pending,e&&await br(i,e),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const o=++i._clock;i._pulse=new Xr(i,o,t),i._touched.forEach((t=>i._enqueue(t,!0))),i._touched=yr(m.id);let a,s,c,l=0;try{for(;i._heap.size()>0;)a=i._heap.pop(),a.rank===a.qrank?(s=a.run(i._getPulse(a,t)),s.then?s=await s:s.async&&(r.push(s.async),s=Hr),s!==Hr&&a._targets&&a._targets.forEach((t=>i._enqueue(t))),++l):i._enqueue(a,!0)}catch(u){i._heap.clear(),c=u}if(i._input={},i._pulse=null,i.debug("Pulse ".concat(o,": ").concat(l," operators")),c&&(i._postrun=[],i.error(c)),i._postrun.length){const t=i._postrun.sort(((t,e)=>e.priority-t.priority));i._postrun=[];for(let e=0;e<t.length;++e)await br(i,t[e].callback)}return n&&await br(i,n),r.length&&Promise.all(r).then((t=>i.runAsync(null,(()=>{t.forEach((t=>{try{t(i)}catch(u){i.error(u)}}))})))),i},run:function(t,e,n){return this._pulse?Yr(this):(this.evaluate(t,e,n),this)},runAsync:async function(t,e,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(i,i),this._running},runAfter:function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(i){this.error(i)}},_enqueue:function(t,e){const n=t.stamp<this._clock;n&&(t.stamp=this._clock),(n||e)&&(t.qrank=t.rank,this._heap.push(t))},_getPulse:function(t,e){const n=t.source,i=this._clock;return n&&(0,m.kJ)(n)?new Vr(this,i,n.map((t=>t.pulse)),e):this._input[t.id]||function(t,e){if(e&&e.stamp===t.stamp)return e;t=t.fork(),e&&e!==Hr&&(t.source=e.source);return t}(this._pulse,n&&n.pulse)}},(0,m.XW)(no,Pr,{run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?this.skip(!1):e=this.evaluate(t),e=e||t,e.then?e=e.then((t=>this.pulse=t)):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const io={};function ro(t){const e=oo(t);return e&&e.Definition||null}function oo(t){return t=t&&t.toLowerCase(),(0,m.nr)(io,t)?io[t]:null}function ao(t,e){let n;if(void 0===e)for(const i of t)null!=i&&(n<i||void 0===n&&i>=i)&&(n=i);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}function so(t,e){let n;if(void 0===e)for(const i of t)null!=i&&(n>i||void 0===n&&i>=i)&&(n=i);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n>r||void 0===n&&r>=r)&&(n=r)}return n}function co(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Wt;if(t===Wt)return lo;if("function"!==typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const i=t(e,n);return i||0===i?i:(0===t(n,n))-(0===t(e,e))}}function lo(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}function uo(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,r=arguments.length>4?arguments[4]:void 0;if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(t.length-1,i)),!(n<=e&&e<=i))return t;for(r=void 0===r?lo:co(r);i>n;){if(i-n>600){const o=i-n+1,a=e-n+1,s=Math.log(o),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(o-c)/o)*(a-o/2<0?-1:1);uo(t,e,Math.max(n,Math.floor(e-a*c/o+l)),Math.min(i,Math.floor(e+(o-a)*c/o+l)),r)}const o=t[e];let a=n,s=i;for(fo(t,n,e),r(t[i],o)>0&&fo(t,n,i);a<s;){for(fo(t,a,s),++a,--s;r(t[a],o)<0;)++a;for(;r(t[s],o)>0;)--s}0===r(t[n],o)?fo(t,n,s):(++s,fo(t,s,i)),s<=e&&(n=s+1),e<=s&&(i=s-1)}return t}function fo(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function ho(t){return null===t?NaN:+t}function po(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let n of t)null!=n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(i=+i)>=i&&(yield i)}}(t,n)),(i=t.length)&&!isNaN(e=+e)){if(e<=0||i<2)return so(t);if(e>=1)return ao(t);var i,r=(i-1)*e,o=Math.floor(r),a=ao(uo(t,o).subarray(0,o+1));return a+(so(t.subarray(o+1))-a)*(r-o)}}function mo(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ho;if((i=t.length)&&!isNaN(e=+e)){if(e<=0||i<2)return+n(t[0],0,t);if(e>=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,o=Math.floor(r),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(r-o)}}function go(t,e){return po(t,.5,e)}function*vo(t,e){if(null==e)for(let n of t)null!=n&&""!==n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of t)i=e(i,++n,t),null!=i&&""!==i&&(i=+i)>=i&&(yield i)}}function yo(t,e,n){const i=Float64Array.from(vo(t,n));return i.sort(Wt),e.map((t=>mo(i,t)))}function bo(t,e){return yo(t,[.25,.5,.75],e)}function xo(t,e){const n=t.length,i=function(t,e){const n=function(t,e){let n,i=0,r=0,o=0;if(void 0===e)for(let a of t)null!=a&&(a=+a)>=a&&(n=a-r,r+=n/++i,o+=n*(a-r));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-r,r+=n/++i,o+=n*(s-r))}if(i>1)return o/(i-1)}(t,e);return n?Math.sqrt(n):n}(t,e),r=bo(t,e),o=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,o)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function _o(t){const e=t.maxbins||20,n=t.base||10,i=Math.log(n),r=t.divide||[5,2];let o,a,s,c,l,u,f=t.extent[0],d=t.extent[1];const h=t.span||d-f||Math.abs(f)||1;if(t.step)o=t.step;else if(t.steps){for(c=h/e,l=0,u=t.steps.length;l<u&&t.steps[l]<c;++l);o=t.steps[Math.max(0,l-1)]}else{for(a=Math.ceil(Math.log(e)/i),s=t.minstep||0,o=Math.max(s,Math.pow(n,Math.round(Math.log(h)/i)-a));Math.ceil(h/o)>e;)o*=n;for(l=0,u=r.length;l<u;++l)c=o/r[l],c>=s&&h/c<=e&&(o=c)}c=Math.log(o);const p=c>=0?0:1+~~(-c/i),m=Math.pow(n,-p-1);return(t.nice||void 0===t.nice)&&(c=Math.floor(f/o+m)*o,f=f<c?c-o:c,d=Math.ceil(d/o)*o),{start:f,stop:d===f?f+o:d,step:o}}var wo=Math.random;function ko(t){wo=t}function Eo(t,e,n,i){if(!t.length)return[void 0,void 0];const r=Float64Array.from(vo(t,i)),o=r.length,a=e;let s,c,l,u;for(l=0,u=Array(a);l<a;++l){for(s=0,c=0;c<o;++c)s+=r[~~(wo()*o)];u[l]=s/o}return u.sort(Wt),[po(u,n/2),po(u,1-n/2)]}function Do(t,e,n,i){i=i||(t=>t);const r=t.length,o=new Float64Array(r);let a,s=0,c=1,l=i(t[0]),u=l,f=l+e;for(;c<r;++c){if(a=i(t[c]),a>=f){for(u=(l+u)/2;s<c;++s)o[s]=u;f=a+e,l=a}u=a}for(u=(l+u)/2;s<c;++s)o[s]=u;return n?function(t,e){const n=t.length;let i,r,o=0,a=1;for(;t[o]===t[a];)++a;for(;a<n;){for(i=a+1;t[a]===t[i];)++i;if(t[a]-t[a-1]<e){for(r=a+(o+i-a-a>>1);r<a;)t[r++]=t[a];for(;r>a;)t[r--]=t[o]}o=a,a=i}return t}(o,e+e/4):o}function Ao(t){return function(){return(t=(1103515245*t+12345)%2147483647)/2147483647}}function So(t,e){let n,i,r;null==e&&(e=t,t=0);const o={min(t){return arguments.length?(n=t||0,r=i-n,o):n},max(t){return arguments.length?(i=t||0,r=i-n,o):i},sample:()=>n+Math.floor(r*wo()),pdf:t=>t===Math.floor(t)&&t>=n&&t<i?1/r:0,cdf(t){const e=Math.floor(t);return e<n?0:e>=i?1:(e-n+1)/r},icdf:t=>t>=0&&t<=1?n-1+Math.floor(t*r):NaN};return o.min(t).max(e)}const Mo=Math.sqrt(2*Math.PI),Co=Math.SQRT2;let Fo=NaN;function Oo(t,e){t=t||0,e=null==e?1:e;let n,i,r=0,o=0;if(Fo===Fo)r=Fo,Fo=NaN;else{do{r=2*wo()-1,o=2*wo()-1,n=r*r+o*o}while(0===n||n>1);i=Math.sqrt(-2*Math.log(n)/n),r*=i,Fo=o*i}return t+r*e}function No(t,e,n){const i=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*i*i)/(n*Mo)}function To(t,e,n){const i=(t-(e=e||0))/(n=null==n?1:n),r=Math.abs(i);let o;if(r>37)o=0;else{const t=Math.exp(-r*r/2);let e;r<7.07106781186547?(e=.0352624965998911*r+.700383064443688,e=e*r+6.37396220353165,e=e*r+33.912866078383,e=e*r+112.079291497871,e=e*r+221.213596169931,e=e*r+220.206867912376,o=t*e,e=.0883883476483184*r+1.75566716318264,e=e*r+16.064177579207,e=e*r+86.7807322029461,e=e*r+296.564248779674,e=e*r+637.333633378831,e=e*r+793.826512519948,e=e*r+440.413735824752,o/=e):(e=r+.65,e=r+4/e,e=r+3/e,e=r+2/e,e=r+1/e,o=t/e/2.506628274631)}return i>0?1-o:o}function zo(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*Co*function(t){let e,n=-Math.log((1-t)*(1+t));n<6.25?(n-=3.125,e=-364441206401782e-35,e=e*n-16850591381820166e-35,e=128584807152564e-32+e*n,e=11157877678025181e-33+e*n,e=e*n-1333171662854621e-31,e=20972767875968562e-33+e*n,e=6637638134358324e-30+e*n,e=e*n-4054566272975207e-29,e=e*n-8151934197605472e-29,e=26335093153082323e-28+e*n,e=e*n-12975133253453532e-27,e=e*n-5415412054294628e-26,e=1.0512122733215323e-9+e*n,e=e*n-4.112633980346984e-9,e=e*n-2.9070369957882005e-8,e=4.2347877827932404e-7+e*n,e=e*n-13654692000834679e-22,e=e*n-13882523362786469e-21,e=.00018673420803405714+e*n,e=e*n-.000740702534166267,e=e*n-.006033670871430149,e=.24015818242558962+e*n,e=1.6536545626831027+e*n):n<16?(n=Math.sqrt(n)-3.25,e=2.2137376921775787e-9,e=9.075656193888539e-8+e*n,e=e*n-2.7517406297064545e-7,e=1.8239629214389228e-8+e*n,e=15027403968909828e-22+e*n,e=e*n-4013867526981546e-21,e=29234449089955446e-22+e*n,e=12475304481671779e-21+e*n,e=e*n-47318229009055734e-21,e=6828485145957318e-20+e*n,e=24031110387097894e-21+e*n,e=e*n-.0003550375203628475,e=.0009532893797373805+e*n,e=e*n-.0016882755560235047,e=.002491442096107851+e*n,e=e*n-.003751208507569241,e=.005370914553590064+e*n,e=1.0052589676941592+e*n,e=3.0838856104922208+e*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=-27109920616438573e-27,e=e*n-2.555641816996525e-10,e=1.5076572693500548e-9+e*n,e=e*n-3.789465440126737e-9,e=7.61570120807834e-9+e*n,e=e*n-1.496002662714924e-8,e=2.914795345090108e-8+e*n,e=e*n-6.771199775845234e-8,e=2.2900482228026655e-7+e*n,e=e*n-9.9298272942317e-7,e=4526062597223154e-21+e*n,e=e*n-1968177810553167e-20,e=7599527703001776e-20+e*n,e=e*n-.00021503011930044477,e=e*n-.00013871931833623122,e=1.0103004648645344+e*n,e=4.849906401408584+e*n):e=1/0;return e*t}(2*t-1)}function Ro(t,e){let n,i;const r={mean(t){return arguments.length?(n=t||0,r):n},stdev(t){return arguments.length?(i=null==t?1:t,r):i},sample:()=>Oo(n,i),pdf:t=>No(t,n,i),cdf:t=>To(t,n,i),icdf:t=>zo(t,n,i)};return r.mean(t).stdev(e)}function Po(t,e){const n=Ro();let i=0;const r={data(n){return arguments.length?(t=n,i=n?n.length:0,r.bandwidth(e)):t},bandwidth(n){return arguments.length?(!(e=n)&&t&&(e=xo(t)),r):e},sample:()=>t[~~(wo()*i)]+e*n.sample(),pdf(r){let o=0,a=0;for(;a<i;++a)o+=n.pdf((r-t[a])/e);return o/e/i},cdf(r){let o=0,a=0;for(;a<i;++a)o+=n.cdf((r-t[a])/e);return o/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(t)}function Lo(t,e){return t=t||0,e=null==e?1:e,Math.exp(t+Oo()*e)}function jo(t,e,n){if(t<=0)return 0;e=e||0,n=null==n?1:n;const i=(Math.log(t)-e)/n;return Math.exp(-.5*i*i)/(n*Mo*t)}function Bo(t,e,n){return To(Math.log(t),e,n)}function Uo(t,e,n){return Math.exp(zo(t,e,n))}function Io(t,e){let n,i;const r={mean(t){return arguments.length?(n=t||0,r):n},stdev(t){return arguments.length?(i=null==t?1:t,r):i},sample:()=>Lo(n,i),pdf:t=>jo(t,n,i),cdf:t=>Bo(t,n,i),icdf:t=>Uo(t,n,i)};return r.mean(t).stdev(e)}function qo(t,e){let n,i=0;const r={weights(t){return arguments.length?(n=function(t){const e=[];let n,r=0;for(n=0;n<i;++n)r+=e[n]=null==t[n]?1:+t[n];for(n=0;n<i;++n)e[n]/=r;return e}(e=t||[]),r):e},distributions(n){return arguments.length?(n?(i=n.length,t=n):(i=0,t=[]),r.weights(e)):t},sample(){const e=wo();let r=t[i-1],o=n[0],a=0;for(;a<i-1;o+=n[++a])if(e<o){r=t[a];break}return r.sample()},pdf(e){let r=0,o=0;for(;o<i;++o)r+=n[o]*t[o].pdf(e);return r},cdf(e){let r=0,o=0;for(;o<i;++o)r+=n[o]*t[o].cdf(e);return r},icdf(){throw Error("Mixture icdf not supported.")}};return r.distributions(t).weights(e)}function Wo(t,e){return null==e&&(e=null==t?1:t,t=0),t+(e-t)*wo()}function Ho(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=e&&t<=n?1/(n-e):0}function Xo(t,e,n){return null==n&&(n=null==e?1:e,e=0),t<e?0:t>n?1:(t-e)/(n-e)}function Jo(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function Go(t,e){let n,i;const r={min(t){return arguments.length?(n=t||0,r):n},max(t){return arguments.length?(i=null==t?1:t,r):i},sample:()=>Wo(n,i),pdf:t=>Ho(t,n,i),cdf:t=>Xo(t,n,i),icdf:t=>Jo(t,n,i)};return null==e&&(e=null==t?1:t,t=0),r.min(t).max(e)}function $o(t,e,n){let i=0,r=0;for(const o of t){const t=n(o);null==e(o)||null==t||isNaN(t)||(i+=(t-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function Vo(t,e,n,i){const r=i-t*t,o=Math.abs(r)<1e-24?0:(n-t*e)/r;return[e-o*t,o]}function Yo(t,e,n,i){t=t.filter((t=>{let i=e(t),r=n(t);return null!=i&&(i=+i)>=i&&null!=r&&(r=+r)>=r})),i&&t.sort(((t,n)=>e(t)-e(n)));const r=t.length,o=new Float64Array(r),a=new Float64Array(r);let s,c,l,u=0,f=0,d=0;for(l of t)o[u]=s=+e(l),a[u]=c=+n(l),++u,f+=(s-f)/u,d+=(c-d)/u;for(u=0;u<r;++u)o[u]-=f,a[u]-=d;return[o,a,f,d]}function Ko(t,e,n,i){let r,o,a=-1;for(const s of t)r=e(s),o=n(s),null!=r&&(r=+r)>=r&&null!=o&&(o=+o)>=o&&i(r,o,++a)}function Zo(t,e,n,i,r){let o=0,a=0;return Ko(t,e,n,((t,e)=>{const n=e-r(t),s=e-i;o+=n*n,a+=s*s})),1-o/a}function Qo(t,e,n){let i=0,r=0,o=0,a=0,s=0;Ko(t,e,n,((t,e)=>{++s,i+=(t-i)/s,r+=(e-r)/s,o+=(t*e-o)/s,a+=(t*t-a)/s}));const c=Vo(i,r,o,a),l=t=>c[0]+c[1]*t;return{coef:c,predict:l,rSquared:Zo(t,e,n,r,l)}}function ta(t,e,n){let i=0,r=0,o=0,a=0,s=0;Ko(t,e,n,((t,e)=>{++s,t=Math.log(t),i+=(t-i)/s,r+=(e-r)/s,o+=(t*e-o)/s,a+=(t*t-a)/s}));const c=Vo(i,r,o,a),l=t=>c[0]+c[1]*Math.log(t);return{coef:c,predict:l,rSquared:Zo(t,e,n,r,l)}}function ea(t,e,n){const[i,r,o,a]=Yo(t,e,n);let s,c,l,u=0,f=0,d=0,h=0,p=0;Ko(t,e,n,((t,e)=>{s=i[p++],c=Math.log(e),l=s*e,u+=(e*c-u)/p,f+=(l-f)/p,d+=(l*c-d)/p,h+=(s*l-h)/p}));const[m,g]=Vo(f/a,u/a,d/a,h/a),v=t=>Math.exp(m+g*(t-o));return{coef:[Math.exp(m-g*o),g],predict:v,rSquared:Zo(t,e,n,a,v)}}function na(t,e,n){let i=0,r=0,o=0,a=0,s=0,c=0;Ko(t,e,n,((t,e)=>{const n=Math.log(t),l=Math.log(e);++c,i+=(n-i)/c,r+=(l-r)/c,o+=(n*l-o)/c,a+=(n*n-a)/c,s+=(e-s)/c}));const l=Vo(i,r,o,a),u=t=>l[0]*Math.pow(t,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:u,rSquared:Zo(t,e,n,s,u)}}function ia(t,e,n){const[i,r,o,a]=Yo(t,e,n),s=i.length;let c,l,u,f,d=0,h=0,p=0,m=0,g=0;for(c=0;c<s;)l=i[c],u=r[c++],f=l*l,d+=(f-d)/c,h+=(f*l-h)/c,p+=(f*f-p)/c,m+=(l*u-m)/c,g+=(f*u-g)/c;const v=p-d*d,y=d*v-h*h,b=(g*d-m*h)/y,x=(m*v-g*h)/y,_=-b*d,w=t=>b*(t-=o)*t+x*t+_+a;return{coef:[_-x*o+b*o*o+a,x-2*b*o,b],predict:w,rSquared:Zo(t,e,n,a,w)}}function ra(t,e,n,i){if(0===i)return $o(t,e,n);if(1===i)return Qo(t,e,n);if(2===i)return ia(t,e,n);const[r,o,a,s]=Yo(t,e,n),c=r.length,l=[],u=[],f=i+1;let d,h,p,m,g;for(d=0;d<f;++d){for(p=0,m=0;p<c;++p)m+=Math.pow(r[p],d)*o[p];for(l.push(m),g=new Float64Array(f),h=0;h<f;++h){for(p=0,m=0;p<c;++p)m+=Math.pow(r[p],d+h);g[h]=m}u.push(g)}u.push(l);const v=function(t){const e=t.length-1,n=[];let i,r,o,a,s;for(i=0;i<e;++i){for(a=i,r=i+1;r<e;++r)Math.abs(t[i][r])>Math.abs(t[i][a])&&(a=r);for(o=i;o<e+1;++o)s=t[o][i],t[o][i]=t[o][a],t[o][a]=s;for(r=i+1;r<e;++r)for(o=e;o>=i;o--)t[o][r]-=t[o][i]*t[i][r]/t[i][i]}for(r=e-1;r>=0;--r){for(s=0,o=r+1;o<e;++o)s+=t[o][r]*n[o];n[r]=(t[e][r]-s)/t[r][r]}return n}(u),y=t=>{t-=a;let e=s+v[0]+v[1]*t+v[2]*t*t;for(d=3;d<f;++d)e+=v[d]*Math.pow(t,d);return e};return{coef:oa(f,v,-a,s),predict:y,rSquared:Zo(t,e,n,s,y)}}function oa(t,e,n,i){const r=Array(t);let o,a,s,c;for(o=0;o<t;++o)r[o]=0;for(o=t-1;o>=0;--o)for(s=e[o],c=1,r[o]+=s,a=1;a<=o;++a)c*=(o+1-a)/a,r[o-a]+=s*Math.pow(n,a)*c;return r[0]+=i,r}const aa=2,sa=1e-12;function ca(t,e,n,i){const[r,o,a,s]=Yo(t,e,n,!0),c=r.length,l=Math.max(2,~~(i*c)),u=new Float64Array(c),f=new Float64Array(c),d=new Float64Array(c).fill(1);for(let h=-1;++h<=aa;){const t=[0,l-1];for(let n=0;n<c;++n){const e=r[n],i=t[0],a=t[1],s=e-r[i]>r[a]-e?i:a;let c=0,l=0,h=0,p=0,m=0;const g=1/Math.abs(r[s]-e||1);for(let t=i;t<=a;++t){const n=r[t],i=o[t],a=la(Math.abs(e-n)*g)*d[t],s=n*a;c+=a,l+=s,h+=i*a,p+=i*s,m+=n*s}const[v,y]=Vo(l/c,h/c,p/c,m/c);u[n]=v+y*e,f[n]=Math.abs(o[n]-u[n]),ua(r,n+1,t)}if(h===aa)break;const e=go(f);if(Math.abs(e)<sa)break;for(let n,i,r=0;r<c;++r)n=f[r]/(6*e),d[r]=n>=1?sa:(i=1-n*n)*i}return function(t,e,n,i){const r=t.length,o=[];let a,s=0,c=0,l=[];for(;s<r;++s)a=t[s]+n,l[0]===a?l[1]+=(e[s]-l[1])/++c:(c=0,l[1]+=i,l=[a,e[s]],o.push(l));return l[1]+=i,o}(r,u,a,s)}function la(t){return(t=1-t*t*t)*t*t}function ua(t,e,n){const i=t[e];let r=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>r&&t[o]-i<=i-t[r];)n[0]=++r,n[1]=o,++o}const fa=.5*Math.PI/180;function da(t,e,n,i){n=n||25,i=Math.max(n,i||200);const r=e=>[e,t(e)],o=e[0],a=e[1],s=a-o,c=s/i,l=[r(o)],u=[];if(n===i){for(let t=1;t<i;++t)l.push(r(o+t/n*s));return l.push(r(a)),l}u.push(r(a));for(let m=n;--m>0;)u.push(r(o+m/n*s));let f=l[0],d=u[u.length-1];const h=1/s,p=function(t,e){let n=t,i=t;const r=e.length;for(let o=0;o<r;++o){const t=e[o][1];t<n&&(n=t),t>i&&(i=t)}return 1/(i-n)}(f[1],u);for(;d;){const t=r((f[0]+d[0])/2);t[0]-f[0]>=c&&ha(f,t,d,h,p)>fa?u.push(t):(f=d,l.push(d),u.pop()),d=u[u.length-1]}return l}function ha(t,e,n,i,r){const o=Math.atan2(r*(n[1]-t[1]),i*(n[0]-t[0])),a=Math.atan2(r*(e[1]-t[1]),i*(e[0]-t[0]));return Math.abs(o-a)}function pa(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o}function ma(t){return t&&t.length?1===t.length?t[0]:(e=t,t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i<n;++i)r+="|"+e[i](t);return r}):function(){return""};var e}function ga(t,e,n){return n||t+(e?"_"+e:"")}const va=()=>{},ya={init:va,add:va,rem:va,idx:0},ba={values:{init:t=>t.cell.store=!0,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.sum,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:void 0,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:void 0,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:void 0,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):void 0,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:void 0,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):void 0,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=void 0,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{(e<t.min||void 0===t.min)&&(t.min=e)},rem:(t,e)=>{e<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:t=>t.max=void 0,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{(e>t.max||void 0===t.max)&&(t.max=e)},rem:(t,e)=>{e>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:t=>t.argmin=void 0,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{e<t.min&&(t.argmin=n)},rem:(t,e)=>{e<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=void 0,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{e>t.max&&(t.argmax=n)},rem:(t,e)=>{e>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3}},xa=Object.keys(ba).filter((t=>"__count__"!==t));function _a(t,e){return ba[t](e)}function wa(t,e){return t.idx-e.idx}function ka(){this.valid=0,this.missing=0,this._ops.forEach((t=>t.init(this)))}function Ea(t,e){null!=t&&""!==t?t===t&&(++this.valid,this._ops.forEach((n=>n.add(this,t,e)))):++this.missing}function Da(t,e){null!=t&&""!==t?t===t&&(--this.valid,this._ops.forEach((n=>n.rem(this,t,e)))):--this.missing}function Aa(t){return this._out.forEach((e=>t[e.out]=e.value(this))),t}function Sa(t,e){const n=e||m.yR,i=function(t){const e={};t.forEach((t=>e[t.name]=t));const n=t=>{t.req&&t.req.forEach((t=>{e[t]||n(e[t]=ba[t]())}))};return t.forEach(n),Object.values(e).sort(wa)}(t),r=t.slice().sort(wa);function o(t){this._ops=i,this._out=r,this.cell=t,this.init()}return o.prototype.init=ka,o.prototype.add=Ea,o.prototype.rem=Da,o.prototype.set=Aa,o.prototype.get=n,o.fields=t.map((t=>t.out)),o}function Ma(t){this._key=t?(0,m.EP)(t):kr,this.reset()}[...xa,"__count__"].forEach((t=>{ba[t]=function(t,e){return n=>(0,m.l7)({name:t,out:n||t},ya,e)}(t,ba[t])}));const Ca=Ma.prototype;function Fa(t){no.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Ca.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},Ca.add=function(t){this._add.push(t)},Ca.rem=function(t){this._rem.push(t)},Ca.values=function(){if(this._get=null,0===this._rem.length)return this._add;const t=this._add,e=this._rem,n=this._key,i=t.length,r=e.length,o=Array(i-r),a={};let s,c,l;for(s=0;s<r;++s)a[n(e[s])]=1;for(s=0,c=0;s<i;++s)a[n(l=t[s])]?a[n(l)]=0:o[c++]=l;return this._rem=[],this._add=o},Ca.distinct=function(t){const e=this.values(),n={};let i,r=e.length,o=0;for(;--r>=0;)i=t(e[r])+"",(0,m.nr)(n,i)||(n[i]=1,++o);return o},Ca.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=(0,m.dI)(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},Ca.argmin=function(t){return this.extent(t)[0]||{}},Ca.argmax=function(t){return this.extent(t)[1]||{}},Ca.min=function(t){const e=this.extent(t)[0];return null!=e?t(e):void 0},Ca.max=function(t){const e=this.extent(t)[1];return null!=e?t(e):void 0},Ca.quartile=function(t){return this._get===t&&this._q||(this._q=bo(this.values(),t),this._get=t),this._q},Ca.q1=function(t){return this.quartile(t)[0]},Ca.q2=function(t){return this.quartile(t)[1]},Ca.q3=function(t){return this.quartile(t)[2]},Ca.ci=function(t){return this._get===t&&this._ci||(this._ci=Eo(this.values(),1e3,.05,t),this._get=t),this._ci},Ca.ci0=function(t){return this.ci(t)[0]},Ca.ci1=function(t){return this.ci(t)[1]},Fa.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:xa},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},(0,m.XW)(Fa,no,{transform(t,e){const n=this,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.modified();return n.stamp=i.stamp,n.value&&(r||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(t):Object.create(null),e.visit(e.SOURCE,(t=>n.add(t)))):(n.value=n.value||n.init(t),e.visit(e.REM,(t=>n.rem(t))),e.visit(e.ADD,(t=>n.add(t)))),i.modifies(n._outputs),n._drop=!1!==t.drop,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),e.clean()&&n._drop&&i.clean(!0).runAfter((()=>this.clean())),n.changes(i)},cross(){const t=this,e=t.value,n=t._dnames,i=n.map((()=>({}))),r=n.length;function o(t){let e,o,a,s;for(e in t)for(a=t[e].tuple,o=0;o<r;++o)i[o][s=a[n[o]]]=s}o(t._prev),o(e),function o(a,s,c){const l=n[c],u=i[c++];for(const n in u){const i=a?a+"|"+n:n;s[l]=u[n],c<r?o(i,s,c):e[i]||t.cell(i,s)}}("",{},0)},init(t){const e=this._inputs=[],n=this._outputs=[],i={};function r(t){const n=(0,m.IX)((0,m.Oj)(t)),r=n.length;let o,a=0;for(;a<r;++a)i[o=n[a]]||(i[o]=1,e.push(o))}this._dims=(0,m.IX)(t.groupby),this._dnames=this._dims.map((t=>{const e=(0,m.el)(t);return r(t),n.push(e),e})),this.cellkey=t.key?t.key:ma(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=t.fields||[null],a=t.ops||["count"],s=t.as||[],c=o.length,l={};let u,f,d,h,p,g;for(c!==a.length&&(0,m.vU)("Unmatched number of fields and aggregate ops."),g=0;g<c;++g)u=o[g],f=a[g],null==u&&"count"!==f&&(0,m.vU)("Null aggregate field specified."),h=(0,m.el)(u),p=ga(f,h,s[g]),n.push(p),"count"!==f?(d=l[h],d||(r(u),d=l[h]=[],d.field=u,this._measures.push(d)),"count"!==f&&(this._countOnly=!1),d.push(_a(f,p))):this._counts.push(p);return this._measures=this._measures.map((t=>Sa(t,t.field))),Object.create(null)},cellkey:ma(),cell(t,e){let n=this.value[t];return n?0===n.num&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[t]=this.newcell(t,e),this._adds[this._alen++]=n),n},newcell(t,e){const n={key:t,num:0,agg:null,tuple:this.newtuple(e,this._prev&&this._prev[t]),stamp:this.stamp,store:!1};if(!this._countOnly){const t=this._measures,e=t.length;n.agg=Array(e);for(let i=0;i<e;++i)n.agg[i]=new t[i](n)}return n.store&&(n.data=new Ma),n},newtuple(t,e){const n=this._dnames,i=this._dims,r=i.length,o={};for(let a=0;a<r;++a)o[n[a]]=i[a](t);return e?Mr(e.tuple,o):Dr(o)},clean(){const t=this.value;for(const e in t)0===t[e].num&&delete t[e]},add(t){const e=this.cellkey(t),n=this.cell(e,t);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(t);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].add(i[r].get(t),t)},rem(t){const e=this.cellkey(t),n=this.cell(e,t);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(t);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].rem(i[r].get(t),t)},celltuple(t){const e=t.tuple,n=this._counts;t.store&&t.data.values();for(let i=0,r=n.length;i<r;++i)e[n[i]]=t.num;if(!this._countOnly){const n=t.agg;for(let t=0,i=n.length;t<i;++t)n[t].set(e)}return e},changes(t){const e=this._adds,n=this._mods,i=this._prev,r=this._drop,o=t.add,a=t.rem,s=t.mod;let c,l,u,f;if(i)for(l in i)c=i[l],r&&!c.num||a.push(c.tuple);for(u=0,f=this._alen;u<f;++u)o.push(this.celltuple(e[u])),e[u]=null;for(u=0,f=this._mlen;u<f;++u)c=n[u],(0===c.num&&r?a:s).push(this.celltuple(c)),n[u]=null;return this._alen=this._mlen=0,this._prev=null,t}});function Oa(t){no.call(this,null,t)}function Na(t,e,n){const i=t;let r=e||[],o=n||[],a={},s=0;return{add:t=>o.push(t),remove:t=>a[i(t)]=++s,size:()=>r.length,data:(t,e)=>(s&&(r=r.filter((t=>!a[i(t)])),a={},s=0),e&&t&&r.sort(t),o.length&&(r=t?(0,m.TS)(t,r,o.sort(t)):r.concat(o),o=[]),r)}}function Ta(t){no.call(this,[],t)}function za(t){Pr.call(this,null,Ra,t)}function Ra(t){return this.value&&!t.modified()?this.value:(0,m.qu)(t.fields,t.orders)}function Pa(t){no.call(this,null,t)}function La(t){no.call(this,null,t)}Oa.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},(0,m.XW)(Oa,no,{transform(t,e){const n=!1!==t.interval,i=this._bins(t),r=i.start,o=i.step,a=t.as||["bin0","bin1"],s=a[0],c=a[1];let l;return l=t.modified()?(e=e.reflow(!0)).SOURCE:e.modified((0,m.Oj)(t.field))?e.ADD_MOD:e.ADD,e.visit(l,n?t=>{const e=i(t);t[s]=e,t[c]=null==e?null:r+o*(1+(e-r)/o)}:t=>t[s]=i(t)),e.modifies(n?a:s)},_bins(t){if(this.value&&!t.modified())return this.value;const e=t.field,n=_o(t),i=n.step;let r,o,a=n.start,s=a+Math.ceil((n.stop-a)/i)*i;null!=(r=t.anchor)&&(o=r-(a+i*Math.floor((r-a)/i)),a+=o,s+=o);const c=function(t){let n=(0,m.He)(e(t));return null==n?null:n<a?-1/0:n>s?1/0:(n=Math.max(a,Math.min(n,s-i)),a+i*Math.floor(1e-14+(n-a)/i))};return c.start=a,c.stop=n.stop,c.step=i,this.value=(0,m.ZE)(c,(0,m.Oj)(e),t.name||"bin_"+(0,m.el)(e))}}),Ta.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},(0,m.XW)(Ta,no,{transform(t,e){const n=e.fork(e.ALL),i=Na(kr,this.value,n.materialize(n.ADD).add),r=t.sort,o=e.changed()||r&&(t.modified("sort")||e.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(o),this.value=n.source=i.data(Cr(r),o),e.source&&e.source.root&&(this.value.root=e.source.root),n}}),(0,m.XW)(za,Pr),Pa.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},(0,m.XW)(Pa,no,{transform(t,e){const n=e=>n=>{for(var i,r=function(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase()}return t.match(n)}(s(n),t.case,o)||[],c=0,l=r.length;c<l;++c)a.test(i=r[c])||e(i)},i=this._parameterCheck(t,e),r=this._counts,o=this._match,a=this._stop,s=t.field,c=t.as||["text","count"],l=n((t=>r[t]=1+(r[t]||0))),u=n((t=>r[t]-=1));return i?e.visit(e.SOURCE,l):(e.visit(e.ADD,l),e.visit(e.REM,u)),this._finish(e,c)},_parameterCheck(t,e){let n=!1;return!t.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),!t.modified("pattern")&&this._match||(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(t,e){const n=this._counts,i=this._tuples||(this._tuples={}),r=e[0],o=e[1],a=t.fork(t.NO_SOURCE|t.NO_FIELDS);let s,c,l;for(s in n)c=i[s],l=n[s]||0,!c&&l?(i[s]=c=Dr({}),c[r]=s,c[o]=l,a.add.push(c)):0===l?(c&&a.rem.push(c),n[s]=null,i[s]=null):c[o]!==l&&(c[o]=l,a.mod.push(c));return a.modifies(e)}}),La.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},(0,m.XW)(La,no,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.as||["a","b"],r=i[0],o=i[1],a=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=e.materialize(e.SOURCE).source,n.add=this.value=function(t,e,n,i){for(var r,o,a=[],s={},c=t.length,l=0;l<c;++l)for(s[e]=o=t[l],r=0;r<c;++r)s[n]=t[r],i(s)&&(a.push(Dr(s)),(s={})[e]=o);return a}(s,r,o,t.filter||m.yb)):n.mod=s,n.source=this.value,n.modifies(i)}});const ja={kde:Po,mixture:qo,normal:Ro,lognormal:Io,uniform:Go},Ba="function";function Ua(t,e){const n=t[Ba];(0,m.nr)(ja,n)||(0,m.vU)("Unknown distribution function: "+n);const i=ja[n]();for(const r in t)"field"===r?i.data((t.from||e()).map(t[r])):"distributions"===r?i[r](t[r].map((t=>Ua(t,e)))):typeof i[r]===Ba&&i[r](t[r]);return i}function Ia(t){no.call(this,null,t)}const qa=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],Wa={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:qa},{name:"weights",type:"number",array:!0}]};function Ha(t,e){return t?t.map(((t,n)=>e[n]||(0,m.el)(t))):null}function Xa(t,e,n){const i=[],r=t=>t(c);let o,a,s,c,l,u;if(null==e)i.push(t.map(n));else for(o={},a=0,s=t.length;a<s;++a)c=t[a],l=e.map(r),u=o[l],u||(o[l]=u=[],u.dims=l,i.push(u)),u.push(n(c));return i}Ia.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:qa.concat(Wa)},{name:"as",type:"string",array:!0,default:["value","density"]}]},(0,m.XW)(Ia,no,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=Ua(t.distribution,function(t){return()=>t.materialize(t.SOURCE).source}(e)),r=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200;let a=t.method||"pdf";"pdf"!==a&&"cdf"!==a&&(0,m.vU)("Invalid density method: "+a),t.extent||i.data||(0,m.vU)("Missing density extent parameter."),a=i[a];const s=t.as||["value","density"],c=da(a,t.extent||(0,m.We)(i.data()),r,o).map((t=>{const e={};return e[s[0]]=t[0],e[s[1]]=t[1],Dr(e)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});function Ja(t){no.call(this,null,t)}Ja.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]};function Ga(t){Pr.call(this,null,$a,t),this.modified(!0)}function $a(t){const e=t.expr;return this.value&&!t.modified("expr")?this.value:(0,m.ZE)((n=>e(n,t)),(0,m.Oj)(e),(0,m.el)(e))}function Va(t){no.call(this,[void 0,void 0],t)}function Ya(t,e){Pr.call(this,t),this.parent=e,this.count=0}function Ka(t){no.call(this,{},t),this._keys=(0,m.Xr)();const e=this._targets=[];e.active=0,e.forEach=t=>{for(let n=0,i=e.active;n<i;++n)t(e[n],n,e)}}function Za(t){Pr.call(this,null,Qa,t)}function Qa(t){return this.value&&!t.modified()?this.value:(0,m.kJ)(t.name)?(0,m.IX)(t.name).map((t=>(0,m.EP)(t))):(0,m.EP)(t.name,t.as)}function ts(t){no.call(this,(0,m.Xr)(),t)}function es(t){no.call(this,[],t)}function ns(t){no.call(this,[],t)}function is(t){no.call(this,null,t)}function rs(t){no.call(this,[],t)}(0,m.XW)(Ja,no,{transform(t,e){if(this.value&&!t.modified()&&!e.changed())return e;const n=e.materialize(e.SOURCE).source,i=Xa(e.source,t.groupby,m.yR),r=t.smooth||!1,o=t.field,a=t.step||((t,e)=>(0,m.yP)((0,m.We)(t,e))/30)(n,o),s=Cr(((t,e)=>o(t)-o(e))),c=t.as||"bin",l=i.length;let u,f=1/0,d=-1/0,h=0;for(;h<l;++h){const t=i[h].sort(s);u=-1;for(const e of Do(t,a,r,o))e<f&&(f=e),e>d&&(d=e),t[++u][c]=e}return this.value={start:f,stop:d,step:a},e.reflow(!0).modifies(c)}}),(0,m.XW)(Ga,Pr),Va.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},(0,m.XW)(Va,no,{transform(t,e){const n=this.value,i=t.field,r=e.changed()||e.modified(i.fields)||t.modified("field");let o=n[0],a=n[1];if((r||null==o)&&(o=1/0,a=-1/0),e.visit(r?e.SOURCE:e.ADD,(t=>{const e=(0,m.He)(i(t));null!=e&&(e<o&&(o=e),e>a&&(a=e))})),!Number.isFinite(o)||!Number.isFinite(a)){let t=(0,m.el)(i);t&&(t=' for field "'.concat(t,'"')),e.dataflow.warn("Infinite extent".concat(t,": [").concat(o,", ").concat(a,"]")),o=a=void 0}this.value=[o,a]}}),(0,m.XW)(Ya,Pr,{connect(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},add(t){this.count+=1,this.value.add.push(t)},rem(t){this.count-=1,this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}}),(0,m.XW)(Ka,no,{activate(t){this._targets[this._targets.active++]=t},subflow(t,e,n,i){const r=this.value;let o,a,s=(0,m.nr)(r,t)&&r[t];return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(a=i||(a=this._group[t])&&a.tuple,o=n.dataflow,s=new Ya(n.fork(n.NO_SOURCE),this),o.add(s).connect(e(o,t,a)),r[t]=s,this.activate(s)),s},clean(){const t=this.value;let e=0;for(const n in t)if(0===t[n].count){const i=t[n].detachSubflow;i&&i(),delete t[n],++e}if(e){const t=this._targets.filter((t=>t&&t.count>0));this.initTargets(t)}},initTargets(t){const e=this._targets,n=e.length,i=t?t.length:0;let r=0;for(;r<i;++r)e[r]=t[r];for(;r<n&&null!=e[r];++r)e[r]=null;e.active=i},transform(t,e){const n=e.dataflow,i=t.key,r=t.subflow,o=this._keys,a=t.modified("key"),s=t=>this.subflow(t,r,e);return this._group=t.group||{},this.initTargets(),e.visit(e.REM,(t=>{const e=kr(t),n=o.get(e);void 0!==n&&(o.delete(e),s(n).rem(t))})),e.visit(e.ADD,(t=>{const e=i(t);o.set(kr(t),e),s(e).add(t)})),a||e.modified(i.fields)?e.visit(e.MOD,(t=>{const e=kr(t),n=o.get(e),r=i(t);n===r?s(r).mod(t):(o.set(e,r),s(n).rem(t),s(r).add(t))})):e.changed(e.MOD)&&e.visit(e.MOD,(t=>{s(o.get(kr(t))).mod(t)})),a&&e.visit(e.REFLOW,(t=>{const e=kr(t),n=o.get(e),r=i(t);n!==r&&(o.set(e,r),s(n).rem(t),s(r).add(t))})),e.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),e}}),(0,m.XW)(Za,Pr),ts.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},(0,m.XW)(ts,no,{transform(t,e){const n=e.dataflow,i=this.value,r=e.fork(),o=r.add,a=r.rem,s=r.mod,c=t.expr;let l=!0;function u(e){const n=kr(e),r=c(e,t),u=i.get(n);r&&u?(i.delete(n),o.push(e)):r||u?l&&r&&!u&&s.push(e):(i.set(n,1),a.push(e))}return e.visit(e.REM,(t=>{const e=kr(t);i.has(e)?i.delete(e):a.push(t)})),e.visit(e.ADD,(e=>{c(e,t)?o.push(e):i.set(kr(e),1)})),e.visit(e.MOD,u),t.modified()&&(l=!1,e.visit(e.REFLOW,u)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}}),es.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},(0,m.XW)(es,no,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.fields,r=Ha(i,t.as||[]),o=t.index||null,a=r.length;return n.rem=this.value,e.visit(e.SOURCE,(t=>{const e=i.map((e=>e(t))),s=e.reduce(((t,e)=>Math.max(t,e.length)),0);let c,l,u,f=0;for(;f<s;++f){for(l=Ar(t),c=0;c<a;++c)l[r[c]]=null==(u=e[c][f])?null:u;o&&(l[o]=f),n.add.push(l)}})),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(r)}}),ns.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},(0,m.XW)(ns,no,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.fields,r=i.map(m.el),o=t.as||["key","value"],a=o[0],s=o[1],c=i.length;return n.rem=this.value,e.visit(e.SOURCE,(t=>{for(let e,o=0;o<c;++o)e=Ar(t),e[a]=r[o],e[s]=i[o](t),n.add.push(e)})),this.value=n.source=n.add,n.modifies(o)}}),is.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},(0,m.XW)(is,no,{transform(t,e){const n=t.expr,i=t.as,r=t.modified(),o=t.initonly?e.ADD:r?e.SOURCE:e.modified(n.fields)||e.modified(i)?e.ADD_MOD:e.ADD;return r&&(e=e.materialize().reflow(!0)),t.initonly||e.modifies(i),e.visit(o,(e=>e[i]=n(e,t)))}}),(0,m.XW)(rs,no,{transform(t,e){const n=e.fork(e.ALL),i=t.generator;let r,o,a,s=this.value,c=t.size-s.length;if(c>0){for(r=[];--c>=0;)r.push(a=Dr(i(t))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(r):r}else o=s.slice(0,-c),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-c);return n.source=this.value=s,n}});const os={value:"value",median:go,mean:function(t,e){let n=0,i=0;if(void 0===e)for(let r of t)null!=r&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(o=+o)>=o&&(++n,i+=o)}if(n)return i/n},min:so,max:ao},as=[];function ss(t){no.call(this,[],t)}function cs(t){Fa.call(this,t)}function ls(t){no.call(this,null,t)}function us(t){Pr.call(this,null,fs,t)}function fs(t){return this.value&&!t.modified()?this.value:(0,m.Jy)(t.fields,t.flat)}function ds(t){no.call(this,[],t),this._pending=null}function hs(t,e,n){n.forEach(Dr);const i=e.fork(e.NO_FIELDS&e.NO_SOURCE);return i.rem=t.value,t.value=i.source=i.add=n,t._pending=null,i.rem.length&&i.clean(!0),i}function ps(t){no.call(this,{},t)}function ms(t){Pr.call(this,null,gs,t)}function gs(t){if(this.value&&!t.modified())return this.value;const e=t.extents,n=e.length;let i,r,o=1/0,a=-1/0;for(i=0;i<n;++i)r=e[i],r[0]<o&&(o=r[0]),r[1]>a&&(a=r[1]);return[o,a]}function vs(t){Pr.call(this,null,ys,t)}function ys(t){return this.value&&!t.modified()?this.value:t.values.reduce(((t,e)=>t.concat(e)),[])}function bs(t){no.call(this,null,t)}function xs(t){Fa.call(this,t)}function _s(t){Ka.call(this,t)}function ws(t){no.call(this,null,t)}function ks(t){no.call(this,null,t)}function Es(t){no.call(this,null,t)}ss.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},(0,m.XW)(ss,no,{transform(t,e){var n,i,r,o,a,s,c,l,u,f,d=e.fork(e.ALL),h=function(t){var e,n=t.method||os.value;if(null!=os[n])return n===os.value?(e=void 0!==t.value?t.value:0,()=>e):os[n];(0,m.vU)("Unrecognized imputation method: "+n)}(t),p=function(t){const e=t.field;return t=>t?e(t):NaN}(t),g=(0,m.el)(t.field),v=(0,m.el)(t.key),y=(t.groupby||[]).map(m.el),b=function(t,e,n,i){var r,o,a,s,c,l,u,f,d=t=>t(f),h=[],p=i?i.slice():[],m={},g={};for(p.forEach(((t,e)=>m[t]=e+1)),s=0,u=t.length;s<u;++s)l=n(f=t[s]),c=m[l]||(m[l]=p.push(l)),(a=g[o=(r=e?e.map(d):as)+""])||(a=g[o]=[],h.push(a),a.values=r),a[c-1]=f;return h.domain=p,h}(e.source,t.groupby,t.key,t.keyvals),x=[],_=this.value,w=b.domain.length;for(a=0,l=b.length;a<l;++a)for(r=(n=b[a]).values,i=NaN,c=0;c<w;++c)if(null==n[c]){for(o=b.domain[c],f={_impute:!0},s=0,u=r.length;s<u;++s)f[y[s]]=r[s];f[v]=o,f[g]=Number.isNaN(i)?i=h(n,p):i,x.push(Dr(f))}return x.length&&(d.add=d.materialize(d.ADD).add.concat(x)),_.length&&(d.rem=d.materialize(d.REM).rem.concat(_)),this.value=x,d}}),cs.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:xa},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]},(0,m.XW)(cs,Fa,{transform(t,e){const n=this,i=t.modified();let r;return n.value&&(i||e.modified(n._inputs,!0))?(r=n.value=i?n.init(t):{},e.visit(e.SOURCE,(t=>n.add(t)))):(r=n.value=n.value||this.init(t),e.visit(e.REM,(t=>n.rem(t))),e.visit(e.ADD,(t=>n.add(t)))),n.changes(),e.visit(e.SOURCE,(t=>{(0,m.l7)(t,r[n.cellkey(t)].tuple)})),e.reflow(i).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(t[n]),t[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(e[n]),e[n]=null;this._alen=this._mlen=0}}),ls.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]},(0,m.XW)(ls,no,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=e.materialize(e.SOURCE).source,r=Xa(i,t.groupby,t.field),o=(t.groupby||[]).map(m.el),a=t.bandwidth,s=t.cumulative?"cdf":"pdf",c=t.as||["value","density"],l=[];let u=t.extent,f=t.steps||t.minsteps||25,d=t.steps||t.maxsteps||200;"pdf"!==s&&"cdf"!==s&&(0,m.vU)("Invalid density method: "+s),"shared"===t.resolve&&(u||(u=(0,m.We)(i,t.field)),f=d=t.steps||d),r.forEach((e=>{const n=Po(e,a)[s],i=t.counts?e.length:1;da(n,u||(0,m.We)(e),f,d).forEach((t=>{const n={};for(let i=0;i<o.length;++i)n[o[i]]=e.dims[i];n[c[0]]=t[0],n[c[1]]=t[1]*i,l.push(Dr(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}}),(0,m.XW)(us,Pr),(0,m.XW)(ds,no,{transform(t,e){const n=e.dataflow;if(this._pending)return hs(this,e,this._pending);if(function(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}(t))return e.StopPropagation;if(t.values)return hs(this,e,n.parse(t.values,t.format));if(t.async){const e=n.request(t.url,t.format).then((t=>(this._pending=(0,m.IX)(t.data),t=>t.touch(this))));return{async:e}}return n.request(t.url,t.format).then((t=>hs(this,e,(0,m.IX)(t.data))))}}),ps.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},(0,m.XW)(ps,no,{transform(t,e){const n=t.fields,i=t.index,r=t.values,o=null==t.default?null:t.default,a=t.modified(),s=n.length;let c,l,u,f=a?e.SOURCE:e.ADD,d=e,h=t.as;return r?(l=r.length,s>1&&!h&&(0,m.vU)('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*l&&(0,m.vU)('The "as" parameter has too few output field names.'),h=h||r.map(m.el),c=function(t){for(var e,a,c=0,u=0;c<s;++c)if(null==(a=i.get(n[c](t))))for(e=0;e<l;++e,++u)t[h[u]]=o;else for(e=0;e<l;++e,++u)t[h[u]]=r[e](a)}):(h||(0,m.vU)("Missing output field names."),c=function(t){for(var e,r=0;r<s;++r)e=i.get(n[r](t)),t[h[r]]=null==e?o:e}),a?d=e.reflow(!0):(u=n.some((t=>e.modified(t.fields))),f|=u?e.MOD:0),e.visit(f,c),d.modifies(h)}}),(0,m.XW)(ms,Pr),(0,m.XW)(vs,Pr),(0,m.XW)(bs,no,{transform(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),xs.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:xa,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},(0,m.XW)(xs,Fa,{_transform:Fa.prototype.transform,transform(t,e){return this._transform(function(t,e){const n=t.field,i=t.value,r=("count"===t.op?"__count__":t.op)||"sum",o=(0,m.Oj)(n).concat((0,m.Oj)(i)),a=function(t,e,n){const i={},r=[];return n.visit(n.SOURCE,(e=>{const n=t(e);i[n]||(i[n]=1,r.push(n))})),r.sort(m.j2),e?r.slice(0,e):r}(n,t.limit||0,e);e.changed()&&t.set("__pivot__",null,null,!0);return{key:t.key,groupby:t.groupby,ops:a.map((()=>r)),fields:a.map((t=>function(t,e,n,i){return(0,m.ZE)((i=>e(i)===t?n(i):NaN),i,t+"")}(t,n,i,o))),as:a.map((t=>t+"")),modified:t.modified.bind(t)}}(t,e),e)}}),(0,m.XW)(_s,Ka,{transform(t,e){const n=t.subflow,i=t.field,r=t=>this.subflow(kr(t),n,e,t);return(t.modified("field")||i&&e.modified((0,m.Oj)(i)))&&(0,m.vU)("PreFacet does not support field modification."),this.initTargets(),i?(e.visit(e.MOD,(t=>{const e=r(t);i(t).forEach((t=>e.mod(t)))})),e.visit(e.ADD,(t=>{const e=r(t);i(t).forEach((t=>e.add(Dr(t))))})),e.visit(e.REM,(t=>{const e=r(t);i(t).forEach((t=>e.rem(t)))}))):(e.visit(e.MOD,(t=>r(t).mod(t))),e.visit(e.ADD,(t=>r(t).add(t))),e.visit(e.REM,(t=>r(t).rem(t)))),e.clean()&&e.runAfter((()=>this.clean())),e}}),ws.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},(0,m.XW)(ws,no,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.fields,r=Ha(t.fields,t.as||[]),o=i?(t,e)=>function(t,e,n,i){for(let r=0,o=n.length;r<o;++r)e[i[r]]=n[r](t);return e}(t,e,i,r):Sr;let a;return this.value?a=this.value:(e=e.addAll(),a=this.value={}),e.visit(e.REM,(t=>{const e=kr(t);n.rem.push(a[e]),a[e]=null})),e.visit(e.ADD,(t=>{const e=o(t,Dr({}));a[kr(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{n.mod.push(o(t,a[kr(t)]))})),n}}),(0,m.XW)(ks,no,{transform(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}}),Es.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};function Ds(t){no.call(this,null,t)}function As(t){no.call(this,[],t),this.count=0}function Ss(t){no.call(this,null,t)}function Ms(t){no.call(this,null,t),this.modified(!0)}function Cs(t){no.call(this,null,t)}(0,m.XW)(Es,no,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.as||["prob","value"];if(this.value&&!t.modified()&&!e.changed())return n.source=this.value,n;const r=Xa(e.materialize(e.SOURCE).source,t.groupby,t.field),o=(t.groupby||[]).map(m.el),a=[],s=t.step||.01,c=t.probs||pa(s/2,1-1e-14,s),l=c.length;return r.forEach((t=>{const e=yo(t,c);for(let n=0;n<l;++n){const r={};for(let e=0;e<o.length;++e)r[o[e]]=t.dims[e];r[i[0]]=c[n],r[i[1]]=e[n],a.push(Dr(r))}})),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}}),(0,m.XW)(Ds,no,{transform(t,e){let n,i;return this.value?i=this.value:(n=e=e.addAll(),i=this.value={}),t.derive&&(n=e.fork(e.NO_SOURCE),e.visit(e.REM,(t=>{const e=kr(t);n.rem.push(i[e]),i[e]=null})),e.visit(e.ADD,(t=>{const e=Ar(t);i[kr(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{const e=i[kr(t)];for(const i in t)e[i]=t[i],n.modifies(i);n.mod.push(e)}))),n}}),As.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},(0,m.XW)(As,no,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.modified("size"),r=t.size,o=this.value.reduce(((t,e)=>(t[kr(e)]=1,t)),{});let a=this.value,s=this.count,c=0;function l(t){let e,i;a.length<r?a.push(t):(i=~~((s+1)*wo()),i<a.length&&i>=c&&(e=a[i],o[kr(e)]&&n.rem.push(e),a[i]=t)),++s}if(e.rem.length&&(e.visit(e.REM,(t=>{const e=kr(t);o[e]&&(o[e]=-1,n.rem.push(t)),--s})),a=a.filter((t=>-1!==o[kr(t)]))),(e.rem.length||i)&&a.length<r&&e.source&&(c=s=a.length,e.visit(e.SOURCE,(t=>{o[kr(t)]||l(t)})),c=-1),i&&a.length>r){const t=a.length-r;for(let e=0;e<t;++e)o[kr(a[e])]=-1,n.rem.push(a[e]);a=a.slice(t)}return e.mod.length&&e.visit(e.MOD,(t=>{o[kr(t)]&&n.mod.push(t)})),e.add.length&&e.visit(e.ADD,l),(e.add.length||c<0)&&(n.add=a.filter((t=>!o[kr(t)]))),this.count=s,this.value=n.source=a,n}}),Ss.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},(0,m.XW)(Ss,no,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),i=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=pa(t.start,t.stop,t.step||1).map((t=>{const e={};return e[i]=t,Dr(e)})),n.add=e.add.concat(this.value),n}}),(0,m.XW)(Ms,no,{transform(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});const Fs=["unit0","unit1"];function Os(t){no.call(this,(0,m.Xr)(),t)}function Ns(t){no.call(this,null,t)}Cs.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:re,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:Fs}]},(0,m.XW)(Cs,no,{transform(t,e){const n=t.field,i=!1!==t.interval,r="utc"===t.timezone,o=this._floor(t,e),a=(r?ze:Te)(o.unit).offset,s=t.as||Fs,c=s[0],l=s[1],u=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=e.ADD;return(t.modified()||e.changed(e.REM)||e.modified((0,m.Oj)(n)))&&(h=(e=e.reflow(!0)).SOURCE,f=1/0,d=-1/0),e.visit(h,(t=>{const e=n(t);let r,s;null==e?(t[c]=null,i&&(t[l]=null)):(t[c]=r=s=o(e),i&&(t[l]=s=a(r,u)),r<f&&(f=r),s>d&&(d=s))})),o.start=f,o.stop=d,e.modifies(i?s:c)},_floor(t,e){const n="utc"===t.timezone,{units:i,step:r}=t.units?{units:t.units,step:t.step||1}:en({extent:t.extent||(0,m.We)(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins}),o=ae(i),a=this.value||{},s=(n?Fe:Se)(o,r);return s.unit=(0,m.fj)(o),s.units=o,s.step=r,s.start=a.start,s.stop=a.stop,this.value=s}}),(0,m.XW)(Os,no,{transform(t,e){const n=e.dataflow,i=t.field,r=this.value,o=t=>r.set(i(t),t);let a=!0;return t.modified("field")||e.modified(i.fields)?(r.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,(t=>r.delete(i(t)))),e.visit(e.ADD,o)):a=!1,this.modified(a),r.empty>n.cleanThreshold&&n.runAfter(r.clean),e.fork()}}),(0,m.XW)(Ns,no,{transform(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(Cr(t.sort)):e.source).map(t.field))}});const Ts={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,i=e.data;return n&&e.compare(i[n-1],i[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,i=e.data;return n&&e.compare(i[n-1],i[n])?++t:t}}},percent_rank:function(){const t=Ts.rank(),e=t.next;return{init:t.init,next:t=>(e(t)-1)/(t.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,i=e.compare;let r=e.index;if(t<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;t=r}return(1+t)/n.length}}},ntile:function(t,e){(e=+e)>0||(0,m.vU)("ntile num must be greater than zero.");const n=Ts.cume_dist(),i=n.next;return{init:n.init,next:t=>Math.ceil(e*i(t))}},lag:function(t,e){return e=+e||1,{next:n=>{const i=n.index-e;return i>=0?t(n.data[i]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{const i=n.index+e,r=n.data;return i<r.length?t(r[i]):null}}},first_value:function(t){return{next:e=>t(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return(e=+e)>0||(0,m.vU)("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(e-1);return i<n.i1?t(n.data[i]):null}}},prev_value:function(t){let e;return{init:()=>e=null,next:n=>{const i=t(n.data[n.index]);return null!=i?e=i:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:i=>{const r=i.data;return i.index<=n?e:(n=function(t,e,n){for(let i=e.length;n<i;++n){if(null!=t(e[n]))return n}return-1}(t,r,i.index))<0?(n=r.length,e=null):e=t(r[n])}}}};const zs=Object.keys(Ts);function Rs(t){const e=(0,m.IX)(t.ops),n=(0,m.IX)(t.fields),i=(0,m.IX)(t.params),r=(0,m.IX)(t.as),o=this.outputs=[],a=this.windows=[],s={},c={},l=[],u=[];let f=!0;function d(t){(0,m.IX)((0,m.Oj)(t)).forEach((t=>s[t]=1))}d(t.sort),e.forEach(((t,e)=>{const s=n[e],h=(0,m.el)(s),p=ga(t,h,r[e]);if(d(s),o.push(p),(0,m.nr)(Ts,t))a.push(function(t,e,n,i){const r=Ts[t](e,n);return{init:r.init||m.bM,update:function(t,e){e[i]=r.next(t)}}}(t,n[e],i[e],p));else{if(null==s&&"count"!==t&&(0,m.vU)("Null aggregate field specified."),"count"===t)return void l.push(p);f=!1;let e=c[h];e||(e=c[h]=[],e.field=s,u.push(e)),e.push(_a(t,p))}})),(l.length||u.length)&&(this.cell=function(t,e,n){t=t.map((t=>Sa(t,t.field)));const i={num:0,agg:null,store:!1,count:e};if(!n)for(var r=t.length,o=i.agg=Array(r),a=0;a<r;++a)o[a]=new t[a](i);if(i.store)var s=i.data=new Ma;return i.add=function(t){if(i.num+=1,!n){s&&s.add(t);for(let e=0;e<r;++e)o[e].add(o[e].get(t),t)}},i.rem=function(t){if(i.num-=1,!n){s&&s.rem(t);for(let e=0;e<r;++e)o[e].rem(o[e].get(t),t)}},i.set=function(t){let r,a;for(s&&s.values(),r=0,a=e.length;r<a;++r)t[e[r]]=i.num;if(!n)for(r=0,a=o.length;r<a;++r)o[r].set(t)},i.init=function(){i.num=0,s&&s.reset();for(let t=0;t<r;++t)o[t].init()},i}(u,l,f)),this.inputs=Object.keys(s)}const Ps=Rs.prototype;function Ls(t){no.call(this,{},t),this._mlen=0,this._mods=[]}function js(t,e,n,i){const r=i.sort,o=r&&!i.ignorePeers,a=i.frame||[null,0],s=t.data(n),c=s.length,l=o?Xt(r):null,u={i0:0,i1:0,p0:0,p1:0,index:0,data:s,compare:r||(0,m.a9)(-1)};e.init();for(let f=0;f<c;++f)Bs(u,a,f,c),o&&Us(u,l),e.update(u,s[f])}function Bs(t,e,n,i){t.p0=t.i0,t.p1=t.i1,t.i0=null==e[0]?0:Math.max(0,n-Math.abs(e[0])),t.i1=null==e[1]?i:Math.min(i,n+Math.abs(e[1])+1),t.index=n}function Us(t,e){const n=t.i0,i=t.i1-1,r=t.compare,o=t.data,a=o.length-1;n>0&&!r(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),i<a&&!r(o[i],o[i+1])&&(t.i1=e.right(o,o[i]))}function Is(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function qs(t){this._context=t}function Ws(){}function Hs(t){this._context=t}function Xs(t){this._context=t}function Js(t,e){this._basis=new qs(t),this._beta=e}Ps.init=function(){this.windows.forEach((t=>t.init())),this.cell&&this.cell.init()},Ps.update=function(t,e){const n=this.cell,i=this.windows,r=t.data,o=i&&i.length;let a;if(n){for(a=t.p0;a<t.i0;++a)n.rem(r[a]);for(a=t.p1;a<t.i1;++a)n.add(r[a]);n.set(e)}for(a=0;a<o;++a)i[a].update(t,e)},Ls.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:zs.concat(xa)},{name:"params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]},(0,m.XW)(Ls,no,{transform(t,e){this.stamp=e.stamp;const n=t.modified(),i=Cr(t.sort),r=ma(t.groupby),o=t=>this.group(r(t));let a=this.state;a&&!n||(a=this.state=new Rs(t)),n||e.modified(a.inputs)?(this.value={},e.visit(e.SOURCE,(t=>o(t).add(t)))):(e.visit(e.REM,(t=>o(t).remove(t))),e.visit(e.ADD,(t=>o(t).add(t))));for(let s=0,c=this._mlen;s<c;++s)js(this._mods[s],a,i,t);return this._mlen=0,this._mods=[],e.reflow(n).modifies(a.outputs)},group(t){let e=this.value[t];return e||(e=this.value[t]=Na(kr),e.stamp=-1),e.stamp<this.stamp&&(e.stamp=this.stamp,this._mods[this._mlen++]=e),e}}),qs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Is(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Is(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Hs.prototype={areaStart:Ws,areaEnd:Ws,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Is(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Xs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Is(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Js.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],o=e[0],a=t[n]-r,s=e[n]-o,c=-1;++c<=n;)i=c/n,this._basis.point(this._beta*t[c]+(1-this._beta)*(r+i*a),this._beta*e[c]+(1-this._beta)*(o+i*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Gs=function t(e){function n(t){return 1===e?new qs(t):new Js(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function $s(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Vs(t,e){this._context=t,this._k=(1-e)/6}Vs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:$s(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:$s(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ys=function t(e){function n(t){return new Vs(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Ks(t,e){this._context=t,this._k=(1-e)/6}Ks.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:$s(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Zs=function t(e){function n(t){return new Ks(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Qs(t,e){this._context=t,this._k=(1-e)/6}Qs.prototype={areaStart:Ws,areaEnd:Ws,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:$s(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const tc=function t(e){function n(t){return new Qs(t,e)}return n.tension=function(e){return t(+e)},n}(0),ec=Math.abs,nc=Math.atan2,ic=Math.cos,rc=Math.max,oc=Math.min,ac=Math.sin,sc=Math.sqrt,cc=1e-12,lc=Math.PI,uc=lc/2,fc=2*lc;function dc(t){return t>=1?uc:t<=-1?-uc:Math.asin(t)}function hc(t,e,n){var i=t._x1,r=t._y1,o=t._x2,a=t._y2;if(t._l01_a>cc){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,r=(r*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>cc){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,o,a,t._x2,t._y2)}function pc(t,e){this._context=t,this._alpha=e}pc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:hc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const mc=function t(e){function n(t){return e?new pc(t,e):new Vs(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function gc(t,e){this._context=t,this._alpha=e}gc.prototype={areaStart:Ws,areaEnd:Ws,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:hc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const vc=function t(e){function n(t){return e?new gc(t,e):new Qs(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function yc(t,e){this._context=t,this._alpha=e}yc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:hc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const bc=function t(e){function n(t){return e?new yc(t,e):new Ks(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function xc(t){this._context=t}function _c(t){return new xc(t)}function wc(t){this._context=t}function kc(t){return t<0?-1:1}function Ec(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),a=(n-t._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(kc(o)+kc(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Dc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Ac(t,e,n){var i=t._x0,r=t._y0,o=t._x1,a=t._y1,s=(o-i)/3;t._context.bezierCurveTo(i+s,r+s*e,o-s,a-s*n,o,a)}function Sc(t){this._context=t}function Mc(t){this._context=new Cc(t)}function Cc(t){this._context=t}function Fc(t){this._context=t}function Oc(t){var e,n,i=t.length-1,r=new Array(i),o=new Array(i),a=new Array(i);for(r[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,o[i-1]=7,a[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/o[e-1],o[e]-=n,a[e]-=n*a[e-1];for(r[i-1]=a[i-1]/o[i-1],e=i-2;e>=0;--e)r[e]=(a[e]-r[e+1])/o[e];for(o[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)o[e]=2*t[e+1]-r[e+1];return[r,o]}function Nc(t,e){this._context=t,this._t=e}function Tc(t){return function(){return t}}xc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}},wc.prototype={areaStart:Ws,areaEnd:Ws,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Sc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ac(this,this._t0,Dc(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Ac(this,Dc(this,n=Ec(this,t,e)),n);break;default:Ac(this,this._t0,n=Ec(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Mc.prototype=Object.create(Sc.prototype)).point=function(t,e){Sc.prototype.point.call(this,e,t)},Cc.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,o){this._context.bezierCurveTo(e,t,i,n,o,r)}},Fc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=Oc(t),r=Oc(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],t[a],e[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},Nc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var zc,Rc,Pc,Lc,jc,Bc,Uc,Ic,qc,Wc,Hc,Xc,Jc,Gc,$c=n(50669);const Vc=Math.PI,Yc=2*Vc,Kc=1e-6,Zc=Yc-Kc;function Qc(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class tl{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Qc:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error("invalid digits: ".concat(t));if(e>15)return Qc;const n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append(zc||(zc=(0,$c.Z)(["M",",",""])),this._x0=this._x1=+t,this._y0=this._y1=+e)}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append(Rc||(Rc=(0,$c.Z)(["Z"]))))}lineTo(t,e){this._append(Pc||(Pc=(0,$c.Z)(["L",",",""])),this._x1=+t,this._y1=+e)}quadraticCurveTo(t,e,n,i){this._append(Lc||(Lc=(0,$c.Z)(["Q",",",",",",",""])),+t,+e,this._x1=+n,this._y1=+i)}bezierCurveTo(t,e,n,i,r,o){this._append(jc||(jc=(0,$c.Z)(["C",",",",",",",",",",",""])),+t,+e,+n,+i,this._x1=+r,this._y1=+o)}arcTo(t,e,n,i,r){if(t=+t,e=+e,n=+n,i=+i,(r=+r)<0)throw new Error("negative radius: ".concat(r));let o=this._x1,a=this._y1,s=n-t,c=i-e,l=o-t,u=a-e,f=l*l+u*u;if(null===this._x1)this._append(Bc||(Bc=(0,$c.Z)(["M",",",""])),this._x1=t,this._y1=e);else if(f>Kc)if(Math.abs(u*s-c*l)>Kc&&r){let d=n-o,h=i-a,p=s*s+c*c,m=d*d+h*h,g=Math.sqrt(p),v=Math.sqrt(f),y=r*Math.tan((Vc-Math.acos((p+f-m)/(2*g*v)))/2),b=y/v,x=y/g;Math.abs(b-1)>Kc&&this._append(Ic||(Ic=(0,$c.Z)(["L",",",""])),t+b*l,e+b*u),this._append(qc||(qc=(0,$c.Z)(["A",",",",0,0,",",",",",""])),r,r,+(u*d>l*h),this._x1=t+x*s,this._y1=e+x*c)}else this._append(Uc||(Uc=(0,$c.Z)(["L",",",""])),this._x1=t,this._y1=e);else;}arc(t,e,n,i,r,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error("negative radius: ".concat(n));let a=n*Math.cos(i),s=n*Math.sin(i),c=t+a,l=e+s,u=1^o,f=o?i-r:r-i;null===this._x1?this._append(Wc||(Wc=(0,$c.Z)(["M",",",""])),c,l):(Math.abs(this._x1-c)>Kc||Math.abs(this._y1-l)>Kc)&&this._append(Hc||(Hc=(0,$c.Z)(["L",",",""])),c,l),n&&(f<0&&(f=f%Yc+Yc),f>Zc?this._append(Xc||(Xc=(0,$c.Z)(["A",",",",0,1,",",",",","A",",",",0,1,",",",",",""])),n,n,u,t-a,e-s,n,n,u,this._x1=c,this._y1=l):f>Kc&&this._append(Jc||(Jc=(0,$c.Z)(["A",",",",0,",",",",",",",""])),n,n,+(f>=Vc),u,this._x1=t+n*Math.cos(r),this._y1=e+n*Math.sin(r)))}rect(t,e,n,i){this._append(Gc||(Gc=(0,$c.Z)(["M",",","h","v","h","Z"])),this._x0=this._x1=+t,this._y0=this._y1=+e,n=+n,+i,-n)}toString(){return this._}}function el(){return new tl}function nl(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError("invalid digits: ".concat(n));e=t}return t},()=>new tl(e)}function il(t){return t.innerRadius}function rl(t){return t.outerRadius}function ol(t){return t.startAngle}function al(t){return t.endAngle}function sl(t){return t&&t.padAngle}function cl(t,e,n,i,r,o,a){var s=t-n,c=e-i,l=(a?o:-o)/sc(s*s+c*c),u=l*c,f=-l*s,d=t+u,h=e+f,p=n+u,m=i+f,g=(d+p)/2,v=(h+m)/2,y=p-d,b=m-h,x=y*y+b*b,_=r-o,w=d*m-p*h,k=(b<0?-1:1)*sc(rc(0,_*_*x-w*w)),E=(w*b-y*k)/x,D=(-w*y-b*k)/x,A=(w*b+y*k)/x,S=(-w*y+b*k)/x,M=E-g,C=D-v,F=A-g,O=S-v;return M*M+C*C>F*F+O*O&&(E=A,D=S),{cx:E,cy:D,x01:-u,y01:-f,x11:E*(r/_-1),y11:D*(r/_-1)}}el.prototype=tl.prototype;Array.prototype.slice;function ll(t){return"object"===typeof t&&"length"in t?t:Array.from(t)}function ul(t){return t[0]}function fl(t){return t[1]}function dl(t,e){var n=Tc(!0),i=null,r=_c,o=null,a=nl(s);function s(s){var c,l,u,f=(s=ll(s)).length,d=!1;for(null==i&&(o=r(u=a())),c=0;c<=f;++c)!(c<f&&n(l=s[c],c,s))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+t(l,c,s),+e(l,c,s));if(u)return o=null,u+""||null}return t="function"===typeof t?t:void 0===t?ul:Tc(t),e="function"===typeof e?e:void 0===e?fl:Tc(e),s.x=function(e){return arguments.length?(t="function"===typeof e?e:Tc(+e),s):t},s.y=function(t){return arguments.length?(e="function"===typeof t?t:Tc(+t),s):e},s.defined=function(t){return arguments.length?(n="function"===typeof t?t:Tc(!!t),s):n},s.curve=function(t){return arguments.length?(r=t,null!=i&&(o=r(i)),s):r},s.context=function(t){return arguments.length?(null==t?i=o=null:o=r(i=t),s):i},s}function hl(t,e,n){var i=null,r=Tc(!0),o=null,a=_c,s=null,c=nl(l);function l(l){var u,f,d,h,p,m=(l=ll(l)).length,g=!1,v=new Array(m),y=new Array(m);for(null==o&&(s=a(p=c())),u=0;u<=m;++u){if(!(u<m&&r(h=l[u],u,l))===g)if(g=!g)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=u-1;d>=f;--d)s.point(v[d],y[d]);s.lineEnd(),s.areaEnd()}g&&(v[u]=+t(h,u,l),y[u]=+e(h,u,l),s.point(i?+i(h,u,l):v[u],n?+n(h,u,l):y[u]))}if(p)return s=null,p+""||null}function u(){return dl().defined(r).curve(a).context(o)}return t="function"===typeof t?t:void 0===t?ul:Tc(+t),e="function"===typeof e?e:Tc(void 0===e?0:+e),n="function"===typeof n?n:void 0===n?fl:Tc(+n),l.x=function(e){return arguments.length?(t="function"===typeof e?e:Tc(+e),i=null,l):t},l.x0=function(e){return arguments.length?(t="function"===typeof e?e:Tc(+e),l):t},l.x1=function(t){return arguments.length?(i=null==t?null:"function"===typeof t?t:Tc(+t),l):i},l.y=function(t){return arguments.length?(e="function"===typeof t?t:Tc(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"===typeof t?t:Tc(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"===typeof t?t:Tc(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(i).y(e)},l.defined=function(t){return arguments.length?(r="function"===typeof t?t:Tc(!!t),l):r},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}sc(3);const pl={draw(t,e){const n=sc(e/lc);t.moveTo(n,0),t.arc(0,0,n,0,fc)}},ml=(sc(1/3),ac(lc/10)/ac(7*lc/10));ac(fc/10),ic(fc/10),sc(3),sc(3),sc(3),sc(12);function gl(t,e){if("undefined"!==typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=t,n.height=e,n}return null}const vl=()=>"undefined"!==typeof Image?Image:null,yl=Xt(Wt),bl=yl.right,xl=yl.left,_l=(Xt(ho).center,bl);var wl=n(52017),kl=n(30975);function El(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(o){for(n=0;n<i;++n)r[n]=t[n]*(1-o)+e[n]*o;return r}}function Dl(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Al(t,e){return(Dl(e)?El:Sl)(t,e)}function Sl(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,o=new Array(r),a=new Array(i);for(n=0;n<r;++n)o[n]=Tl(t[n],e[n]);for(;n<i;++n)a[n]=e[n];return function(t){for(n=0;n<r;++n)a[n]=o[n](t);return a}}function Ml(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}var Cl=n(74552);function Fl(t,e){var n,i={},r={};for(n in null!==t&&"object"===typeof t||(t={}),null!==e&&"object"===typeof e||(e={}),e)n in t?i[n]=Tl(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}var Ol=n(71413),Nl=n(31874);function Tl(t,e){var n,i=typeof e;return null==e||"boolean"===i?(0,Nl.Z)(e):("number"===i?Cl.Z:"string"===i?(n=(0,wl.ZP)(e))?(e=n,kl.ZP):Ol.Z:e instanceof wl.ZP?kl.ZP:e instanceof Date?Ml:Dl(e)?El:Array.isArray(e)?Sl:"function"!==typeof e.valueOf&&"function"!==typeof e.toString||isNaN(e)?Fl:Cl.Z)(t,e)}function zl(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Rl(t){return+t}var Pl=[0,1];function Ll(t){return t}function jl(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function Bl(t,e,n){var i=t[0],r=t[1],o=e[0],a=e[1];return r<i?(i=jl(r,i),o=n(a,o)):(i=jl(i,r),o=n(o,a)),function(t){return o(i(t))}}function Ul(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<i;)r[a]=jl(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=_l(t,e,1,i)-1;return o[n](r[n](e))}}function Il(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function ql(){var t,e,n,i,r,o,a=Pl,s=Pl,c=Tl,l=Ll;function u(){var t=Math.min(a.length,s.length);return l!==Ll&&(l=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),i=t>2?Ul:Bl,r=o=null,f}function f(e){return null==e||isNaN(e=+e)?n:(r||(r=i(a.map(t),s,c)))(t(l(e)))}return f.invert=function(n){return l(e((o||(o=i(s,a.map(t),Cl.Z)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,Rl),u()):a.slice()},f.range=function(t){return arguments.length?(s=Array.from(t),u()):s.slice()},f.rangeRound=function(t){return s=Array.from(t),c=zl,u()},f.clamp=function(t){return arguments.length?(l=!!t||Ll,u()):l!==Ll},f.interpolate=function(t){return arguments.length?(c=t,u()):c},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,i){return t=n,e=i,u()}}function Wl(){return ql()(Ll,Ll)}function Hl(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Xl(t,e){switch(arguments.length){case 0:break;case 1:"function"===typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"===typeof e?this.interpolator(e):this.range(e)}return this}function Jl(t,e,n,i){var r,o=B(t,e,n);switch((i=q(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=J(o,a))||(i.precision=r),tt(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=G(o,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=$(o))||(i.precision=r-2*("%"===i.type))}return Q(i)}function Gl(t){var e=t.domain;return t.ticks=function(t){var n=e();return L(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return Jl(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,o=e(),a=0,s=o.length-1,c=o[a],l=o[s],u=10;for(l<c&&(r=c,c=l,l=r,r=a,a=s,s=r);u-- >0;){if((r=j(c,l,n))===i)return o[a]=c,o[s]=l,e(o);if(r>0)c=Math.floor(c/r)*r,l=Math.ceil(l/r)*r;else{if(!(r<0))break;c=Math.ceil(c*r)/r,l=Math.floor(l*r)/r}i=r}return t},t}function $l(t,e){var n,i=0,r=(t=t.slice()).length-1,o=t[i],a=t[r];return a<o&&(n=i,i=r,r=n,n=o,o=a,a=n),t[i]=e.floor(o),t[r]=e.ceil(a),t}function Vl(t){return Math.log(t)}function Yl(t){return Math.exp(t)}function Kl(t){return-Math.log(-t)}function Zl(t){return-Math.exp(-t)}function Ql(t){return isFinite(t)?+("1e"+t):t<0?0:t}function tu(t){return(e,n)=>-t(-e,n)}function eu(t){const e=t(Vl,Yl),n=e.domain;let i,r,o=10;function a(){return i=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),r=function(t){return 10===t?Ql:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(i=tu(i),r=tu(r),t(Kl,Zl)):t(Vl,Yl),e}return e.base=function(t){return arguments.length?(o=+t,a()):o},e.domain=function(t){return arguments.length?(n(t),a()):n()},e.ticks=t=>{const e=n();let a=e[0],s=e[e.length-1];const c=s<a;c&&([a,s]=[s,a]);let l,u,f=i(a),d=i(s);const h=null==t?10:+t;let p=[];if(!(o%1)&&d-f<h){if(f=Math.floor(f),d=Math.ceil(d),a>0){for(;f<=d;++f)for(l=1;l<o;++l)if(u=f<0?l/r(-f):l*r(f),!(u<a)){if(u>s)break;p.push(u)}}else for(;f<=d;++f)for(l=o-1;l>=1;--l)if(u=f>0?l/r(-f):l*r(f),!(u<a)){if(u>s)break;p.push(u)}2*p.length<h&&(p=L(a,s,h))}else p=L(f,d,Math.min(d-f,h)).map(r);return c?p.reverse():p},e.tickFormat=(t,n)=>{if(null==t&&(t=10),null==n&&(n=10===o?"s":","),"function"!==typeof n&&(o%1||null!=(n=q(n)).precision||(n.trim=!0),n=Q(n)),t===1/0)return n;const a=Math.max(1,o*t/e.ticks().length);return t=>{let e=t/r(Math.round(i(t)));return e*o<o-.5&&(e*=o),e<=a?n(t):""}},e.nice=()=>n($l(n(),{floor:t=>r(Math.floor(i(t))),ceil:t=>r(Math.ceil(i(t)))})),e}function nu(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function iu(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function ru(t){return t<0?-t*t:t*t}function ou(t){var e=t(Ll,Ll),n=1;return e.exponent=function(e){return arguments.length?1===(n=+e)?t(Ll,Ll):.5===n?t(iu,ru):t(nu(n),nu(1/n)):n},Gl(e)}function au(){var t=ou(ql());return t.copy=function(){return Il(t,au()).exponent(t.exponent())},Hl.apply(t,arguments),t}function su(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function cu(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function lu(t){var e=1,n=t(su(e),cu(e));return n.constant=function(n){return arguments.length?t(su(e=+n),cu(e)):e},Gl(n)}function uu(t,e,n,i,r,o){const a=[[It,1,st],[It,5,5e3],[It,15,15e3],[It,30,3e4],[o,1,ct],[o,5,3e5],[o,15,9e5],[o,30,18e5],[r,1,lt],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,ut],[i,2,1728e5],[n,1,ft],[e,1,dt],[e,3,7776e6],[t,1,ht]];function s(e,n,i){const r=Math.abs(n-e)/i,o=Xt((t=>{let[,,e]=t;return e})).right(a,r);if(o===a.length)return t.every(B(e/ht,n/ht,i));if(0===o)return qt.every(Math.max(B(e,n,i),1));const[s,c]=a[r/a[o-1][2]<a[o][2]/r?o-1:o];return s.every(c)}return[function(t,e,n){const i=e<t;i&&([t,e]=[e,t]);const r=n&&"function"===typeof n.range?n:s(t,e,n),o=r?r.range(t,+e+1):[];return i?o.reverse():o},s]}const[fu,du]=uu(zt,Pt,At,gt,jt,Ut),[hu,pu]=uu(Tt,Rt,yt,pt,Lt,Bt);function mu(t){return new Date(t)}function gu(t){return t instanceof Date?+t:+new Date(+t)}function vu(t,e,n,i,r,o,a,s,c,l){var u=Wl(),f=u.invert,d=u.domain,h=l(".%L"),p=l(":%S"),m=l("%I:%M"),g=l("%I %p"),v=l("%a %d"),y=l("%b %d"),b=l("%B"),x=l("%Y");function _(t){return(c(t)<t?h:s(t)<t?p:a(t)<t?m:o(t)<t?g:i(t)<t?r(t)<t?v:y:n(t)<t?b:x)(t)}return u.invert=function(t){return new Date(f(t))},u.domain=function(t){return arguments.length?d(Array.from(t,gu)):d().map(mu)},u.ticks=function(e){var n=d();return t(n[0],n[n.length-1],null==e?10:e)},u.tickFormat=function(t,e){return null==e?_:l(e)},u.nice=function(t){var n=d();return t&&"function"===typeof t.range||(t=e(n[0],n[n.length-1],null==t?10:t)),t?d($l(n,t)):u},u.copy=function(){return Il(u,vu(t,e,n,i,r,o,a,s,c,l))},u}function yu(){var t,e,n,i,r,o=0,a=1,s=Ll,c=!1;function l(e){return null==e||isNaN(e=+e)?r:s(0===n?.5:(e=(i(e)-t)*n,c?Math.max(0,Math.min(1,e)):e))}function u(t){return function(e){var n,i;return arguments.length?([n,i]=e,s=t(n,i),l):[s(0),s(1)]}}return l.domain=function(r){return arguments.length?([o,a]=r,t=i(o=+o),e=i(a=+a),n=t===e?0:1/(e-t),l):[o,a]},l.clamp=function(t){return arguments.length?(c=!!t,l):c},l.interpolator=function(t){return arguments.length?(s=t,l):s},l.range=u(Tl),l.rangeRound=u(zl),l.unknown=function(t){return arguments.length?(r=t,l):r},function(r){return i=r,t=r(o),e=r(a),n=t===e?0:1/(e-t),l}}function bu(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function xu(){var t=Gl(yu()(Ll));return t.copy=function(){return bu(t,xu())},Xl.apply(t,arguments)}function _u(){var t=ou(yu());return t.copy=function(){return bu(t,_u()).exponent(t.exponent())},Xl.apply(t,arguments)}function wu(t,e){void 0===e&&(e=t,t=Tl);for(var n=0,i=e.length-1,r=e[0],o=new Array(i<0?0:i);n<i;)o[n]=t(r,r=e[++n]);return function(t){var e=Math.max(0,Math.min(i-1,Math.floor(t*=i)));return o[e](t-e)}}function ku(){var t,e,n,i,r,o,a,s=0,c=.5,l=1,u=1,f=Ll,d=!1;function h(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(u*t<u*e?i:r),f(d?Math.max(0,Math.min(1,t)):t))}function p(t){return function(e){var n,i,r;return arguments.length?([n,i,r]=e,f=wu(t,[n,i,r]),h):[f(0),f(.5),f(1)]}}return h.domain=function(a){return arguments.length?([s,c,l]=a,t=o(s=+s),e=o(c=+c),n=o(l=+l),i=t===e?0:.5/(e-t),r=e===n?0:.5/(n-e),u=e<t?-1:1,h):[s,c,l]},h.clamp=function(t){return arguments.length?(d=!!t,h):d},h.interpolator=function(t){return arguments.length?(f=t,h):f},h.range=p(Tl),h.rangeRound=p(zl),h.unknown=function(t){return arguments.length?(a=t,h):a},function(a){return o=a,t=a(s),e=a(c),n=a(l),i=t===e?0:.5/(e-t),r=e===n?0:.5/(n-e),u=e<t?-1:1,h}}function Eu(){var t=ou(ku());return t.copy=function(){return bu(t,Eu()).exponent(t.exponent())},Xl.apply(t,arguments)}class Du extends Map{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fu;if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Su(this,t))}has(t){return super.has(Su(this,t))}set(t,e){return super.set(Mu(this,t),e)}delete(t){return super.delete(Cu(this,t))}}class Au extends Set{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fu;if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const n of t)this.add(n)}has(t){return super.has(Su(this,t))}add(t){return super.add(Mu(this,t))}delete(t){return super.delete(Cu(this,t))}}function Su(t,e){let{_intern:n,_key:i}=t;const r=i(e);return n.has(r)?n.get(r):e}function Mu(t,e){let{_intern:n,_key:i}=t;const r=i(e);return n.has(r)?n.get(r):(n.set(r,e),e)}function Cu(t,e){let{_intern:n,_key:i}=t;const r=i(e);return n.has(r)&&(e=n.get(r),n.delete(r)),e}function Fu(t){return null!==t&&"object"===typeof t?t.valueOf():t}const Ou=Symbol("implicit");function Nu(){var t=new Du,e=[],n=[],i=Ou;function r(r){let o=t.get(r);if(void 0===o){if(i!==Ou)return i;t.set(r,o=e.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Du;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return Nu(e,n).unknown(i)},Hl.apply(r,arguments),r}var Tu=n(5535),zu=n(20943);function Ru(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var Pu=n(97017);function Lu(t,e){var n=(0,Pu.wx)(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}var ju=n(18959);function Bu(t){return((t=Math.exp(t))+1/t)/2}const Uu=function t(e,n,i){function r(t,r){var o,a,s=t[0],c=t[1],l=t[2],u=r[0],f=r[1],d=r[2],h=u-s,p=f-c,m=h*h+p*p;if(m<1e-12)a=Math.log(d/l)/e,o=function(t){return[s+t*h,c+t*p,l*Math.exp(e*t*a)]};else{var g=Math.sqrt(m),v=(d*d-l*l+i*m)/(2*l*n*g),y=(d*d-l*l-i*m)/(2*d*n*g),b=Math.log(Math.sqrt(v*v+1)-v),x=Math.log(Math.sqrt(y*y+1)-y);a=(x-b)/e,o=function(t){var i=t*a,r=Bu(b),o=l/(n*g)*(r*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(e*i+b)-function(t){return((t=Math.exp(t))-1/t)/2}(b));return[s+o*h,c+o*p,l*r/Bu(e*i+b)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return r.rho=function(e){var n=Math.max(.001,+e),i=n*n;return t(n,i,i*i)},r}(Math.SQRT2,2,4);function Iu(t){return function(e,n){var i=t((e=(0,wl.Ym)(e)).h,(n=(0,wl.Ym)(n)).h),r=(0,Pu.ZP)(e.s,n.s),o=(0,Pu.ZP)(e.l,n.l),a=(0,Pu.ZP)(e.opacity,n.opacity);return function(t){return e.h=i(t),e.s=r(t),e.l=o(t),e.opacity=a(t),e+""}}}const qu=Iu(Pu.wx);var Wu=Iu(Pu.ZP),Hu=n(20322);const Xu=Math.PI/180,Ju=180/Math.PI,Gu=.96422,$u=1,Vu=.82521,Yu=4/29,Ku=6/29,Zu=3*Ku*Ku,Qu=.008856451679035631;function tf(t){if(t instanceof nf)return new nf(t.l,t.a,t.b,t.opacity);if(t instanceof uf)return ff(t);t instanceof wl.Ss||(t=(0,wl.SU)(t));var e,n,i=sf(t.r),r=sf(t.g),o=sf(t.b),a=rf((.2225045*i+.7168786*r+.0606169*o)/$u);return i===r&&r===o?e=n=a:(e=rf((.4360747*i+.3850649*r+.1430804*o)/Gu),n=rf((.0139322*i+.0971045*r+.7141733*o)/Vu)),new nf(116*a-16,500*(e-a),200*(a-n),t.opacity)}function ef(t,e,n,i){return 1===arguments.length?tf(t):new nf(t,e,n,null==i?1:i)}function nf(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function rf(t){return t>Qu?Math.pow(t,1/3):t/Zu+Yu}function of(t){return t>Ku?t*t*t:Zu*(t-Yu)}function af(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function sf(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function cf(t){if(t instanceof uf)return new uf(t.h,t.c,t.l,t.opacity);if(t instanceof nf||(t=tf(t)),0===t.a&&0===t.b)return new uf(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Ju;return new uf(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function lf(t,e,n,i){return 1===arguments.length?cf(t):new uf(t,e,n,null==i?1:i)}function uf(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function ff(t){if(isNaN(t.h))return new nf(t.l,0,0,t.opacity);var e=t.h*Xu;return new nf(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function df(t,e){var n=(0,Pu.ZP)((t=ef(t)).l,(e=ef(e)).l),i=(0,Pu.ZP)(t.a,e.a),r=(0,Pu.ZP)(t.b,e.b),o=(0,Pu.ZP)(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=i(e),t.b=r(e),t.opacity=o(e),t+""}}function hf(t){return function(e,n){var i=t((e=lf(e)).h,(n=lf(n)).h),r=(0,Pu.ZP)(e.c,n.c),o=(0,Pu.ZP)(e.l,n.l),a=(0,Pu.ZP)(e.opacity,n.opacity);return function(t){return e.h=i(t),e.c=r(t),e.l=o(t),e.opacity=a(t),e+""}}}(0,Hu.Z)(nf,ef,(0,Hu.l)(wl.Il,{brighter(t){return new nf(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new nf(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=Gu*of(e),t=$u*of(t),n=Vu*of(n),new wl.Ss(af(3.1338561*e-1.6168667*t-.4906146*n),af(-.9787684*e+1.9161415*t+.033454*n),af(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),(0,Hu.Z)(uf,lf,(0,Hu.l)(wl.Il,{brighter(t){return new uf(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new uf(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return ff(this).rgb()}}));const pf=hf(Pu.wx);var mf=hf(Pu.ZP),gf=-.14861,vf=1.78277,yf=-.29227,bf=-.90649,xf=1.97294,_f=xf*bf,wf=xf*vf,kf=vf*yf-bf*gf;function Ef(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof Df)return new Df(t.h,t.s,t.l,t.opacity);t instanceof wl.Ss||(t=(0,wl.SU)(t));var e=t.r/255,n=t.g/255,i=t.b/255,r=(kf*i+_f*e-wf*n)/(kf+_f-wf),o=i-r,a=(xf*(n-r)-yf*o)/bf,s=Math.sqrt(a*a+o*o)/(xf*r*(1-r)),c=s?Math.atan2(a,o)*Ju-120:NaN;return new Df(c<0?c+360:c,s,r,t.opacity)}(t):new Df(t,e,n,null==i?1:i)}function Df(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Af(t){return function e(n){function i(e,i){var r=t((e=Ef(e)).h,(i=Ef(i)).h),o=(0,Pu.ZP)(e.s,i.s),a=(0,Pu.ZP)(e.l,i.l),s=(0,Pu.ZP)(e.opacity,i.opacity);return function(t){return e.h=r(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,i.gamma=e,i}(1)}(0,Hu.Z)(Df,Ef,(0,Hu.l)(wl.Il,{brighter(t){return t=null==t?wl.J5:Math.pow(wl.J5,t),new Df(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?wl.xV:Math.pow(wl.xV,t),new Df(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Xu,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),r=Math.sin(t);return new wl.Ss(255*(e+n*(gf*i+vf*r)),255*(e+n*(yf*i+bf*r)),255*(e+n*(xf*i)),this.opacity)}}));const Sf=Af(Pu.wx);var Mf=Af(Pu.ZP);function Cf(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t(i/(e-1));return n}function Ff(t,e,n){const i=t-e+2*n;return t?i>0?i:1:0}const Of="linear",Nf="log",Tf="pow",zf="sqrt",Rf="symlog",Pf="time",Lf="utc",jf="sequential",Bf="diverging",Uf="quantile",If="quantize",qf="threshold",Wf="ordinal",Hf="point",Xf="band",Jf="bin-ordinal",Gf="continuous",$f="discrete",Vf="discretizing",Yf="interpolating",Kf="temporal";function Zf(){const t=Nu().unknown(void 0),e=t.domain,n=t.range;let i,r,o=[0,1],a=!1,s=0,c=0,l=.5;function u(){const t=e().length,u=o[1]<o[0],f=o[1-u],d=Ff(t,s,c);let h=o[u-0];i=(f-h)/(d||1),a&&(i=Math.floor(i)),h+=(f-h-i*(t-s))*l,r=i*(1-s),a&&(h=Math.round(h),r=Math.round(r));const p=pa(t).map((t=>h+i*t));return n(u?p.reverse():p)}return delete t.unknown,t.domain=function(t){return arguments.length?(e(t),u()):e()},t.range=function(t){return arguments.length?(o=[+t[0],+t[1]],u()):o.slice()},t.rangeRound=function(t){return o=[+t[0],+t[1]],a=!0,u()},t.bandwidth=function(){return r},t.step=function(){return i},t.round=function(t){return arguments.length?(a=!!t,u()):a},t.padding=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),s=c,u()):s},t.paddingInner=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),u()):s},t.paddingOuter=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),u()):c},t.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),u()):l},t.invertRange=function(t){if(null==t[0]||null==t[1])return;const i=o[1]<o[0],a=i?n().reverse():n(),s=a.length-1;let c,l,u,f=+t[0],d=+t[1];return f!==f||d!==d||(d<f&&(u=f,f=d,d=u),d<a[0]||f>o[1-i])?void 0:(c=Math.max(0,bl(a,f)-1),l=f===d?c:bl(a,d)-1,f-a[c]>r+1e-10&&++c,i&&(u=c,c=s-l,l=s-u),c>l?void 0:e().slice(c,l+1))},t.invert=function(e){const n=t.invertRange([e,e]);return n?n[0]:n},t.copy=function(){return Zf().domain(e()).range(o).round(a).paddingInner(s).paddingOuter(c).align(l)},u()}function Qf(t){const e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return Qf(e())},t}var td=Array.prototype.map;const ed=Array.prototype.slice;const nd=new Map,id=Symbol("vega_scale");function rd(t){return t[id]=!0,t}function od(t,e,n){return arguments.length>1?(nd.set(t,function(t,e,n){const i=function(){const n=e();return n.invertRange||(n.invertRange=n.invert?function(t){return function(e){let n,i=e[0],r=e[1];return r<i&&(n=i,i=r,r=n),[t.invert(i),t.invert(r)]}}(n):n.invertExtent?function(t){return function(e){const n=t.range();let i,r,o,a,s=e[0],c=e[1],l=-1;for(c<s&&(r=s,s=c,c=r),o=0,a=n.length;o<a;++o)n[o]>=s&&n[o]<=c&&(l<0&&(l=o),i=o);if(!(l<0))return s=t.invertExtent(n[l]),c=t.invertExtent(n[i]),[void 0===s[0]?s[1]:s[0],void 0===c[1]?c[0]:c[1]]}}(n):void 0),n.type=t,rd(n)};return i.metadata=(0,m.Rg)((0,m.IX)(n)),i}(t,e,n)),this):ad(t)?nd.get(t):void 0}function ad(t){return nd.has(t)}function sd(t,e){const n=nd.get(t);return n&&n.metadata[e]}function cd(t){return sd(t,Gf)}function ld(t){return sd(t,$f)}function ud(t){return sd(t,Vf)}function fd(t){return sd(t,Nf)}function dd(t){return sd(t,Yf)}function hd(t){return sd(t,Uf)}od("identity",(function t(e){var n;function i(t){return null==t||isNaN(t=+t)?n:t}return i.invert=i,i.domain=i.range=function(t){return arguments.length?(e=Array.from(t,Rl),i):e.slice()},i.unknown=function(t){return arguments.length?(n=t,i):n},i.copy=function(){return t(e).unknown(n)},e=arguments.length?Array.from(e,Rl):[0,1],Gl(i)})),od(Of,(function t(){var e=Wl();return e.copy=function(){return Il(e,t())},Hl.apply(e,arguments),Gl(e)}),Gf),od(Nf,(function t(){const e=eu(ql()).domain([1,10]);return e.copy=()=>Il(e,t()).base(e.base()),Hl.apply(e,arguments),e}),[Gf,Nf]),od(Tf,au,Gf),od(zf,(function(){return au.apply(null,arguments).exponent(.5)}),Gf),od(Rf,(function t(){var e=lu(ql());return e.copy=function(){return Il(e,t()).constant(e.constant())},Hl.apply(e,arguments)}),Gf),od(Pf,(function(){return Hl.apply(vu(hu,pu,Tt,Rt,yt,pt,Lt,Bt,It,cn).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[Gf,Kf]),od(Lf,(function(){return Hl.apply(vu(fu,du,zt,Pt,At,mt,jt,Ut,It,un).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[Gf,Kf]),od(jf,xu,[Gf,Yf]),od("".concat(jf,"-").concat(Of),xu,[Gf,Yf]),od("".concat(jf,"-").concat(Nf),(function t(){var e=eu(yu()).domain([1,10]);return e.copy=function(){return bu(e,t()).base(e.base())},Xl.apply(e,arguments)}),[Gf,Yf,Nf]),od("".concat(jf,"-").concat(Tf),_u,[Gf,Yf]),od("".concat(jf,"-").concat(zf),(function(){return _u.apply(null,arguments).exponent(.5)}),[Gf,Yf]),od("".concat(jf,"-").concat(Rf),(function t(){var e=lu(yu());return e.copy=function(){return bu(e,t()).constant(e.constant())},Xl.apply(e,arguments)}),[Gf,Yf]),od("".concat(Bf,"-").concat(Of),(function t(){var e=Gl(ku()(Ll));return e.copy=function(){return bu(e,t())},Xl.apply(e,arguments)}),[Gf,Yf]),od("".concat(Bf,"-").concat(Nf),(function t(){var e=eu(ku()).domain([.1,1,10]);return e.copy=function(){return bu(e,t()).base(e.base())},Xl.apply(e,arguments)}),[Gf,Yf,Nf]),od("".concat(Bf,"-").concat(Tf),Eu,[Gf,Yf]),od("".concat(Bf,"-").concat(zf),(function(){return Eu.apply(null,arguments).exponent(.5)}),[Gf,Yf]),od("".concat(Bf,"-").concat(Rf),(function t(){var e=lu(ku());return e.copy=function(){return bu(e,t()).constant(e.constant())},Xl.apply(e,arguments)}),[Gf,Yf]),od(Uf,(function t(){var e,n=[],i=[],r=[];function o(){var t=0,e=Math.max(1,i.length);for(r=new Array(e-1);++t<e;)r[t-1]=mo(n,t/e);return a}function a(t){return null==t||isNaN(t=+t)?e:i[_l(r,t)]}return a.invertExtent=function(t){var e=i.indexOf(t);return e<0?[NaN,NaN]:[e>0?r[e-1]:n[0],e<r.length?r[e]:n[n.length-1]]},a.domain=function(t){if(!arguments.length)return n.slice();n=[];for(let e of t)null==e||isNaN(e=+e)||n.push(e);return n.sort(Wt),o()},a.range=function(t){return arguments.length?(i=Array.from(t),o()):i.slice()},a.unknown=function(t){return arguments.length?(e=t,a):e},a.quantiles=function(){return r.slice()},a.copy=function(){return t().domain(n).range(i).unknown(e)},Hl.apply(a,arguments)}),[Vf,Uf]),od(If,(function t(){var e,n=0,i=1,r=1,o=[.5],a=[0,1];function s(t){return null!=t&&t<=t?a[_l(o,t,0,r)]:e}function c(){var t=-1;for(o=new Array(r);++t<r;)o[t]=((t+1)*i-(t-r)*n)/(r+1);return s}return s.domain=function(t){return arguments.length?([n,i]=t,n=+n,i=+i,c()):[n,i]},s.range=function(t){return arguments.length?(r=(a=Array.from(t)).length-1,c()):a.slice()},s.invertExtent=function(t){var e=a.indexOf(t);return e<0?[NaN,NaN]:e<1?[n,o[0]]:e>=r?[o[r-1],i]:[o[e-1],o[e]]},s.unknown=function(t){return arguments.length?(e=t,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return t().domain([n,i]).range(a).unknown(e)},Hl.apply(Gl(s),arguments)}),Vf),od(qf,(function t(){var e,n=[.5],i=[0,1],r=1;function o(t){return null!=t&&t<=t?i[_l(n,t,0,r)]:e}return o.domain=function(t){return arguments.length?(n=Array.from(t),r=Math.min(n.length,i.length-1),o):n.slice()},o.range=function(t){return arguments.length?(i=Array.from(t),r=Math.min(n.length,i.length-1),o):i.slice()},o.invertExtent=function(t){var e=i.indexOf(t);return[n[e-1],n[e]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t().domain(n).range(i).unknown(e)},Hl.apply(o,arguments)}),Vf),od(Jf,(function t(){let e=[],n=[];function i(t){return null==t||t!==t?void 0:n[(_l(e,t)-1)%n.length]}return i.domain=function(t){return arguments.length?(e=function(t){return td.call(t,m.He)}(t),i):e.slice()},i.range=function(t){return arguments.length?(n=ed.call(t),i):n.slice()},i.tickFormat=function(t,n){return Jl(e[0],(0,m.fj)(e),null==t?10:t,n)},i.copy=function(){return t().domain(i.domain()).range(i.range())},i}),[$f,Vf]),od(Wf,Nu,$f),od(Xf,Zf,$f),od(Hf,(function(){return Qf(Zf().paddingInner(1))}),$f);const pd=["clamp","base","constant","exponent"];function md(t,e){const n=e[0],i=(0,m.fj)(e)-n;return function(e){return t(n+e*i)}}function gd(t,e,n){return wu(bd(e||"rgb",n),t)}function vd(t,e){const n=new Array(e),i=e+1;for(let r=0;r<e;)n[r]=t(++r/i);return n}function yd(t,e,n){const i=n-e;let r,o,a;return i&&Number.isFinite(i)?(r=(o=t.type).indexOf("-"),o=r<0?o:o.slice(r+1),a=od(o)().domain([e,n]).range([0,1]),pd.forEach((e=>t[e]?a[e](t[e]()):0)),a):(0,m.a9)(.5)}function bd(t,e){const n=r[function(t){return"interpolate"+t.toLowerCase().split("-").map((t=>t[0].toUpperCase()+t.slice(1))).join("")}(t)];return null!=e&&n&&n.gamma?n.gamma(e):n}function xd(t){const e=t.length/6|0,n=new Array(e);for(let i=0;i<e;)n[i]="#"+t.slice(6*i,6*++i);return n}function _d(t,e){for(const n in t)kd(n,e(t[n]))}const wd={};function kd(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(wd[t]=e,this):wd[t]}_d({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},xd),_d({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(t=>gd(xd(t))));const Ed="symbol",Dd="discrete",Ad=t=>(0,m.kJ)(t)?t.map((t=>String(t))):String(t),Sd=(t,e)=>t[1]-e[1],Md=(t,e)=>e[1]-t[1];function Cd(t,e,n){let i;return(0,m.hj)(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),null!=n&&(e=Math.min(e,Math.floor((0,m.yP)(t.domain())/n||1)))),(0,m.Kn)(e)&&(i=e.step,e=e.interval),(0,m.HD)(e)&&(e=t.type===Pf?Te(e):t.type==Lf?ze(e):(0,m.vU)("Only time and utc scales accept interval strings."),i&&(e=e.every(i))),e}function Fd(t,e,n){let i=t.range(),r=i[0],o=(0,m.fj)(i),a=Sd;if(r>o&&(i=o,o=r,r=i,a=Md),r=Math.floor(r),o=Math.ceil(o),e=e.map((e=>[e,t(e)])).filter((t=>r<=t[1]&&t[1]<=o)).sort(a).map((t=>t[0])),n>0&&e.length>1){const t=[e[0],(0,m.fj)(e)];for(;e.length>n&&e.length>=3;)e=e.filter(((t,e)=>!(e%2)));e.length<3&&(e=t)}return e}function Od(t,e){return t.bins?Fd(t,t.bins):t.ticks?t.ticks(e):t.domain()}function Nd(t,e,n,i,r,o){const a=e.type;let s=Ad;if(a===Pf||r===Pf)s=t.timeFormat(i);else if(a===Lf||r===Lf)s=t.utcFormat(i);else if(fd(a)){const r=t.formatFloat(i);if(o||e.bins)s=r;else{const t=Td(e,n,!1);s=e=>t(e)?r(e):""}}else if(e.tickFormat){const r=e.domain();s=t.formatSpan(r[0],r[r.length-1],n,i)}else i&&(s=t.format(i));return s}function Td(t,e,n){const i=Od(t,e),r=t.base(),o=Math.log(r),a=Math.max(1,r*e/i.length),s=t=>{let e=t/Math.pow(r,Math.round(Math.log(t)/o));return e*r<r-.5&&(e*=r),e<=a};return n?i.filter(s):s}const zd={[Uf]:"quantiles",[If]:"thresholds",[qf]:"domain"},Rd={[Uf]:"quantiles",[If]:"domain"};function Pd(t,e){return t.bins?function(t){const e=t.slice(0,-1);return e.max=(0,m.fj)(t),e}(t.bins):t.type===Nf?Td(t,e,!0):zd[t.type]?function(t){const e=[-1/0].concat(t);return e.max=1/0,e}(t[zd[t.type]]()):Od(t,e)}const Ld=t=>zd[t.type]||t.bins;function jd(t,e,n,i,r,o,a){const s=Rd[e.type]&&o!==Pf&&o!==Lf?function(t,e,n){const i=e[Rd[e.type]](),r=i.length;let o,a=r>1?i[1]-i[0]:i[0];for(o=1;o<r;++o)a=Math.min(a,i[o]-i[o-1]);return t.formatSpan(0,a,30,n)}(t,e,r):Nd(t,e,n,r,o,a);return i===Ed&&Ld(e)?Bd(s):i===Dd?Id(s):qd(s)}const Bd=t=>(e,n,i)=>{const r=Ud(i[n+1],Ud(i.max,1/0)),o=Wd(e,t),a=Wd(r,t);return o&&a?o+" \u2013 "+a:a?"< "+a:"\u2265 "+o},Ud=(t,e)=>null!=t?t:e,Id=t=>(e,n)=>n?t(e):null,qd=t=>e=>t(e),Wd=(t,e)=>Number.isFinite(t)?e(t):null;function Hd(t,e,n,i){const r=i||e.type;return(0,m.HD)(n)&&sd(r,Kf)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||r!==Pf?n||r!==Lf?jd(t,e,5,null,n,i,!0):t.utcFormat("%A, %d %B %Y, %X UTC"):t.timeFormat("%A, %d %B %Y, %X")}function Xd(t,e,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=Hd(t,e,n.format,n.formatType);if(ud(e.type)){const t=Pd(e).slice(1).map(r),n=t.length;return"".concat(n," boundar").concat(1===n?"y":"ies",": ").concat(t.join(", "))}if(ld(e.type)){const t=e.domain(),n=t.length,o=n>i?t.slice(0,i-2).map(r).join(", ")+", ending with "+t.slice(-1).map(r):t.map(r).join(", ");return"".concat(n," value").concat(1===n?"":"s",": ").concat(o)}{const t=e.domain();return"values from ".concat(r(t[0])," to ").concat(r((0,m.fj)(t)))}}let Jd=0;const Gd="p_";function $d(t){return t&&t.gradient}function Vd(t,e,n){const i=t.gradient;let r=t.id,o="radial"===i?Gd:"";return r||(r=t.id="gradient_"+Jd++,"radial"===i?(t.x1=Yd(t.x1,.5),t.y1=Yd(t.y1,.5),t.r1=Yd(t.r1,0),t.x2=Yd(t.x2,.5),t.y2=Yd(t.y2,.5),t.r2=Yd(t.r2,.5),o=Gd):(t.x1=Yd(t.x1,0),t.y1=Yd(t.y1,0),t.x2=Yd(t.x2,1),t.y2=Yd(t.y2,0))),e[r]=t,"url("+(n||"")+"#"+o+r+")"}function Yd(t,e){return null!=t?t:e}function Kd(t,e){var n,i=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:i,stop:function(t,e){return i.push({offset:t,color:e}),n}}}const Zd={basis:{curve:function(t){return new qs(t)}},"basis-closed":{curve:function(t){return new Hs(t)}},"basis-open":{curve:function(t){return new Xs(t)}},bundle:{curve:Gs,tension:"beta",value:.85},cardinal:{curve:Ys,tension:"tension",value:0},"cardinal-open":{curve:Zs,tension:"tension",value:0},"cardinal-closed":{curve:tc,tension:"tension",value:0},"catmull-rom":{curve:mc,tension:"alpha",value:.5},"catmull-rom-closed":{curve:vc,tension:"alpha",value:.5},"catmull-rom-open":{curve:bc,tension:"alpha",value:.5},linear:{curve:_c},"linear-closed":{curve:function(t){return new wc(t)}},monotone:{horizontal:function(t){return new Mc(t)},vertical:function(t){return new Sc(t)}},natural:{curve:function(t){return new Fc(t)}},step:{curve:function(t){return new Nc(t,.5)}},"step-after":{curve:function(t){return new Nc(t,1)}},"step-before":{curve:function(t){return new Nc(t,0)}}};function Qd(t,e,n){var i=(0,m.nr)(Zd,t)&&Zd[t],r=null;return i&&(r=i.curve||i[e||"vertical"],i.tension&&null!=n&&(r=r[i.tension](n))),r}const th={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},eh=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,nh=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,ih=/^((\s+,?\s*)|(,\s*))/,rh=/^[01]/;function oh(t){const e=[];return(t.match(eh)||[]).forEach((t=>{let n=t[0];const i=n.toLowerCase(),r=th[i],o=function(t,e,n){const i=[];for(let r=0;e&&r<n.length;)for(let o=0;o<e;++o){const e="a"!==t||3!==o&&4!==o?nh:rh,a=n.slice(r).match(e);if(null===a)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const s=n.slice(r).match(ih);null!==s&&(r+=s[0].length)}return i}(i,r,t.slice(1).trim()),a=o.length;if(a<r||a&&a%r!==0)throw Error("Invalid SVG path, incorrect parameter count");if(e.push([n,...o.slice(0,r)]),a!==r){"m"===i&&(n="M"===n?"L":"l");for(let t=r;t<a;t+=r)e.push([n,...o.slice(t,t+r)])}})),e}const ah=Math.PI/180,sh=Math.PI/2,ch=2*Math.PI,lh=Math.sqrt(3)/2;var uh={},fh={},dh=[].join;function hh(t){const e=dh.call(t);if(fh[e])return fh[e];var n=t[0],i=t[1],r=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7];const u=l*a,f=-c*s,d=c*a,h=l*s,p=Math.cos(r),m=Math.sin(r),g=Math.cos(o),v=Math.sin(o),y=.5*(o-r),b=Math.sin(.5*y),x=8/3*b*b/Math.sin(y),_=n+p-x*m,w=i+m+x*p,k=n+g,E=i+v,D=k+x*v,A=E-x*g;return fh[e]=[u*_+f*w,d*_+h*w,u*D+f*A,d*D+h*A,u*k+f*E,d*k+h*E]}const ph=["l",0,0,0,0,0,0,0];function mh(t,e,n){const i=ph[0]=t[0];if("a"===i||"A"===i)ph[1]=e*t[1],ph[2]=n*t[2],ph[3]=t[3],ph[4]=t[4],ph[5]=t[5],ph[6]=e*t[6],ph[7]=n*t[7];else if("h"===i||"H"===i)ph[1]=e*t[1];else if("v"===i||"V"===i)ph[1]=n*t[1];else for(var r=1,o=t.length;r<o;++r)ph[r]=(r%2==1?e:n)*t[r];return ph}function gh(t,e,n,i,r,o){var a,s,c,l,u,f=null,d=0,h=0,p=0,m=0,g=0,v=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),null==o&&(o=r),t.beginPath&&t.beginPath();for(var y=0,b=e.length;y<b;++y){switch(a=e[y],1===r&&1===o||(a=mh(a,r,o)),a[0]){case"l":d+=a[1],h+=a[2],t.lineTo(d+n,h+i);break;case"L":d=a[1],h=a[2],t.lineTo(d+n,h+i);break;case"h":d+=a[1],t.lineTo(d+n,h+i);break;case"H":d=a[1],t.lineTo(d+n,h+i);break;case"v":h+=a[1],t.lineTo(d+n,h+i);break;case"V":h=a[1],t.lineTo(d+n,h+i);break;case"m":g=d+=a[1],v=h+=a[2],t.moveTo(d+n,h+i);break;case"M":g=d=a[1],v=h=a[2],t.moveTo(d+n,h+i);break;case"c":s=d+a[5],c=h+a[6],p=d+a[3],m=h+a[4],t.bezierCurveTo(d+a[1]+n,h+a[2]+i,p+n,m+i,s+n,c+i),d=s,h=c;break;case"C":d=a[5],h=a[6],p=a[3],m=a[4],t.bezierCurveTo(a[1]+n,a[2]+i,p+n,m+i,d+n,h+i);break;case"s":s=d+a[3],c=h+a[4],p=2*d-p,m=2*h-m,t.bezierCurveTo(p+n,m+i,d+a[1]+n,h+a[2]+i,s+n,c+i),p=d+a[1],m=h+a[2],d=s,h=c;break;case"S":s=a[3],c=a[4],p=2*d-p,m=2*h-m,t.bezierCurveTo(p+n,m+i,a[1]+n,a[2]+i,s+n,c+i),d=s,h=c,p=a[1],m=a[2];break;case"q":s=d+a[3],c=h+a[4],p=d+a[1],m=h+a[2],t.quadraticCurveTo(p+n,m+i,s+n,c+i),d=s,h=c;break;case"Q":s=a[3],c=a[4],t.quadraticCurveTo(a[1]+n,a[2]+i,s+n,c+i),d=s,h=c,p=a[1],m=a[2];break;case"t":s=d+a[1],c=h+a[2],null===f[0].match(/[QqTt]/)?(p=d,m=h):"t"===f[0]?(p=2*d-l,m=2*h-u):"q"===f[0]&&(p=2*d-p,m=2*h-m),l=p,u=m,t.quadraticCurveTo(p+n,m+i,s+n,c+i),h=c,p=(d=s)+a[1],m=h+a[2];break;case"T":s=a[1],c=a[2],p=2*d-p,m=2*h-m,t.quadraticCurveTo(p+n,m+i,s+n,c+i),d=s,h=c;break;case"a":vh(t,d+n,h+i,[a[1],a[2],a[3],a[4],a[5],a[6]+d+n,a[7]+h+i]),d+=a[6],h+=a[7];break;case"A":vh(t,d+n,h+i,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+i]),d=a[6],h=a[7];break;case"z":case"Z":d=g,h=v,t.closePath()}f=a}}function vh(t,e,n,i){const r=function(t,e,n,i,r,o,a,s,c){const l=dh.call(arguments);if(uh[l])return uh[l];const u=a*ah,f=Math.sin(u),d=Math.cos(u),h=d*(s-t)*.5+f*(c-e)*.5,p=d*(c-e)*.5-f*(s-t)*.5;let m=h*h/((n=Math.abs(n))*n)+p*p/((i=Math.abs(i))*i);m>1&&(m=Math.sqrt(m),n*=m,i*=m);const g=d/n,v=f/n,y=-f/i,b=d/i,x=g*s+v*c,_=y*s+b*c,w=g*t+v*e,k=y*t+b*e;let E=1/((w-x)*(w-x)+(k-_)*(k-_))-.25;E<0&&(E=0);let D=Math.sqrt(E);o==r&&(D=-D);const A=.5*(x+w)-D*(k-_),S=.5*(_+k)+D*(w-x),M=Math.atan2(_-S,x-A);let C=Math.atan2(k-S,w-A)-M;C<0&&1===o?C+=ch:C>0&&0===o&&(C-=ch);const F=Math.ceil(Math.abs(C/(sh+.001))),O=[];for(let N=0;N<F;++N){const t=M+N*C/F,e=M+(N+1)*C/F;O[N]=[A,S,t,e,n,i,f,d]}return uh[l]=O}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n);for(let o=0;o<r.length;++o){const e=hh(r[o]);t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5])}}const yh=.5773502691896257,bh={circle:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,ch)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/2.5;t.moveTo(-n,-i),t.lineTo(-n,i),t.lineTo(-i,i),t.lineTo(-i,n),t.lineTo(i,n),t.lineTo(i,i),t.lineTo(n,i),t.lineTo(n,-i),t.lineTo(i,-i),t.lineTo(i,-n),t.lineTo(-i,-n),t.lineTo(-i,-i),t.closePath()}},diamond:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/7,r=n/2.5,o=n/8;t.moveTo(-i,n),t.lineTo(i,n),t.lineTo(i,-o),t.lineTo(r,-o),t.lineTo(0,-n),t.lineTo(-r,-o),t.lineTo(-i,-o),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,i=lh*n,r=i-n*yh,o=n/4;t.moveTo(0,-i-r),t.lineTo(-o,i-r),t.lineTo(o,i-r),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,i=lh*n,r=i-n*yh;t.moveTo(0,-i-r),t.lineTo(-n,i-r),t.lineTo(n,i-r),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,i=lh*n;t.moveTo(0,-i),t.lineTo(-n,i),t.lineTo(n,i),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,i=lh*n;t.moveTo(0,i),t.lineTo(-n,-i),t.lineTo(n,-i),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,i=lh*n;t.moveTo(i,0),t.lineTo(-i,-n),t.lineTo(-i,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,i=lh*n;t.moveTo(-i,0),t.lineTo(i,-n),t.lineTo(i,n),t.closePath()}},stroke:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function xh(t){return(0,m.nr)(bh,t)?bh[t]:function(t){if(!(0,m.nr)(_h,t)){const e=oh(t);_h[t]={draw:function(t,n){gh(t,e,0,0,Math.sqrt(n)/2)}}}return _h[t]}(t)}var _h={};const wh=.448084975506;function kh(t){return t.x}function Eh(t){return t.y}function Dh(t){return t.width}function Ah(t){return t.height}function Sh(t){return"function"===typeof t?t:()=>+t}function Mh(t,e,n){return Math.max(e,Math.min(t,n))}function Ch(){var t=kh,e=Eh,n=Dh,i=Ah,r=Sh(0),o=r,a=r,s=r,c=null;function l(l,u,f){var d,h=null!=u?u:+t.call(this,l),p=null!=f?f:+e.call(this,l),m=+n.call(this,l),g=+i.call(this,l),v=Math.min(m,g)/2,y=Mh(+r.call(this,l),0,v),b=Mh(+o.call(this,l),0,v),x=Mh(+a.call(this,l),0,v),_=Mh(+s.call(this,l),0,v);if(c||(c=d=el()),y<=0&&b<=0&&x<=0&&_<=0)c.rect(h,p,m,g);else{var w=h+m,k=p+g;c.moveTo(h+y,p),c.lineTo(w-b,p),c.bezierCurveTo(w-wh*b,p,w,p+wh*b,w,p+b),c.lineTo(w,k-_),c.bezierCurveTo(w,k-wh*_,w-wh*_,k,w-_,k),c.lineTo(h+x,k),c.bezierCurveTo(h+wh*x,k,h,k-wh*x,h,k-x),c.lineTo(h,p+y),c.bezierCurveTo(h,p+wh*y,h+wh*y,p,h+y,p),c.closePath()}if(d)return c=null,d+""||null}return l.x=function(e){return arguments.length?(t=Sh(e),l):t},l.y=function(t){return arguments.length?(e=Sh(t),l):e},l.width=function(t){return arguments.length?(n=Sh(t),l):n},l.height=function(t){return arguments.length?(i=Sh(t),l):i},l.cornerRadius=function(t,e,n,i){return arguments.length?(r=Sh(t),o=null!=e?Sh(e):r,s=null!=n?Sh(n):r,a=null!=i?Sh(i):o,l):r},l.context=function(t){return arguments.length?(c=null==t?null:t,l):c},l}function Fh(){var t,e,n,i,r,o,a,s,c=null;function l(t,e,n){const i=n/2;if(r){var l=a-e,u=t-o;if(l||u){var f=Math.sqrt(l*l+u*u),d=(l/=f)*s,h=(u/=f)*s,p=Math.atan2(u,l);c.moveTo(o-d,a-h),c.lineTo(t-l*i,e-u*i),c.arc(t,e,i,p-Math.PI,p),c.lineTo(o+d,a+h),c.arc(o,a,s,p,p+Math.PI)}else c.arc(t,e,i,0,ch);c.closePath()}else r=1;o=t,a=e,s=i}function u(o){var a,s,u,f=o.length,d=!1;for(null==c&&(c=u=el()),a=0;a<=f;++a)!(a<f&&i(s=o[a],a,o))===d&&(d=!d)&&(r=0),d&&l(+t(s,a,o),+e(s,a,o),+n(s,a,o));if(u)return c=null,u+""||null}return u.x=function(e){return arguments.length?(t=e,u):t},u.y=function(t){return arguments.length?(e=t,u):e},u.size=function(t){return arguments.length?(n=t,u):n},u.defined=function(t){return arguments.length?(i=t,u):i},u.context=function(t){return arguments.length?(c=null==t?null:t,u):c},u}function Oh(t,e){return null!=t?t:e}const Nh=t=>t.x||0,Th=t=>t.y||0,zh=t=>!(!1===t.defined),Rh=function(){var t=il,e=rl,n=Tc(0),i=null,r=ol,o=al,a=sl,s=null,c=nl(l);function l(){var l,u,f=+t.apply(this,arguments),d=+e.apply(this,arguments),h=r.apply(this,arguments)-uc,p=o.apply(this,arguments)-uc,m=ec(p-h),g=p>h;if(s||(s=l=c()),d<f&&(u=d,d=f,f=u),d>cc)if(m>fc-cc)s.moveTo(d*ic(h),d*ac(h)),s.arc(0,0,d,h,p,!g),f>cc&&(s.moveTo(f*ic(p),f*ac(p)),s.arc(0,0,f,p,h,g));else{var v,y,b=h,x=p,_=h,w=p,k=m,E=m,D=a.apply(this,arguments)/2,A=D>cc&&(i?+i.apply(this,arguments):sc(f*f+d*d)),S=oc(ec(d-f)/2,+n.apply(this,arguments)),M=S,C=S;if(A>cc){var F=dc(A/f*ac(D)),O=dc(A/d*ac(D));(k-=2*F)>cc?(_+=F*=g?1:-1,w-=F):(k=0,_=w=(h+p)/2),(E-=2*O)>cc?(b+=O*=g?1:-1,x-=O):(E=0,b=x=(h+p)/2)}var N=d*ic(b),T=d*ac(b),z=f*ic(w),R=f*ac(w);if(S>cc){var P,L=d*ic(x),j=d*ac(x),B=f*ic(_),U=f*ac(_);if(m<lc)if(P=function(t,e,n,i,r,o,a,s){var c=n-t,l=i-e,u=a-r,f=s-o,d=f*c-u*l;if(!(d*d<cc))return[t+(d=(u*(e-o)-f*(t-r))/d)*c,e+d*l]}(N,T,B,U,L,j,z,R)){var I=N-P[0],q=T-P[1],W=L-P[0],H=j-P[1],X=1/ac(function(t){return t>1?0:t<-1?lc:Math.acos(t)}((I*W+q*H)/(sc(I*I+q*q)*sc(W*W+H*H)))/2),J=sc(P[0]*P[0]+P[1]*P[1]);M=oc(S,(f-J)/(X-1)),C=oc(S,(d-J)/(X+1))}else M=C=0}E>cc?C>cc?(v=cl(B,U,N,T,d,C,g),y=cl(L,j,z,R,d,C,g),s.moveTo(v.cx+v.x01,v.cy+v.y01),C<S?s.arc(v.cx,v.cy,C,nc(v.y01,v.x01),nc(y.y01,y.x01),!g):(s.arc(v.cx,v.cy,C,nc(v.y01,v.x01),nc(v.y11,v.x11),!g),s.arc(0,0,d,nc(v.cy+v.y11,v.cx+v.x11),nc(y.cy+y.y11,y.cx+y.x11),!g),s.arc(y.cx,y.cy,C,nc(y.y11,y.x11),nc(y.y01,y.x01),!g))):(s.moveTo(N,T),s.arc(0,0,d,b,x,!g)):s.moveTo(N,T),f>cc&&k>cc?M>cc?(v=cl(z,R,L,j,f,-M,g),y=cl(N,T,B,U,f,-M,g),s.lineTo(v.cx+v.x01,v.cy+v.y01),M<S?s.arc(v.cx,v.cy,M,nc(v.y01,v.x01),nc(y.y01,y.x01),!g):(s.arc(v.cx,v.cy,M,nc(v.y01,v.x01),nc(v.y11,v.x11),!g),s.arc(0,0,f,nc(v.cy+v.y11,v.cx+v.x11),nc(y.cy+y.y11,y.cx+y.x11),g),s.arc(y.cx,y.cy,M,nc(y.y11,y.x11),nc(y.y01,y.x01),!g))):s.arc(0,0,f,w,_,g):s.lineTo(z,R)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-lc/2;return[ic(i)*n,ac(i)*n]},l.innerRadius=function(e){return arguments.length?(t="function"===typeof e?e:Tc(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"===typeof t?t:Tc(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"===typeof t?t:Tc(+t),l):n},l.padRadius=function(t){return arguments.length?(i=null==t?null:"function"===typeof t?t:Tc(+t),l):i},l.startAngle=function(t){return arguments.length?(r="function"===typeof t?t:Tc(+t),l):r},l.endAngle=function(t){return arguments.length?(o="function"===typeof t?t:Tc(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"===typeof t?t:Tc(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}().startAngle((t=>t.startAngle||0)).endAngle((t=>t.endAngle||0)).padAngle((t=>t.padAngle||0)).innerRadius((t=>t.innerRadius||0)).outerRadius((t=>t.outerRadius||0)).cornerRadius((t=>t.cornerRadius||0)),Ph=hl().x(Nh).y1(Th).y0((t=>(t.y||0)+(t.height||0))).defined(zh),Lh=hl().y(Th).x1(Nh).x0((t=>(t.x||0)+(t.width||0))).defined(zh),jh=dl().x(Nh).y(Th).defined(zh),Bh=Ch().x(Nh).y(Th).width((t=>t.width||0)).height((t=>t.height||0)).cornerRadius((t=>Oh(t.cornerRadiusTopLeft,t.cornerRadius)||0),(t=>Oh(t.cornerRadiusTopRight,t.cornerRadius)||0),(t=>Oh(t.cornerRadiusBottomRight,t.cornerRadius)||0),(t=>Oh(t.cornerRadiusBottomLeft,t.cornerRadius)||0)),Uh=function(t,e){let n=null,i=nl(r);function r(){let r;if(n||(n=r=i()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return t="function"===typeof t?t:Tc(t||pl),e="function"===typeof e?e:Tc(void 0===e?64:+e),r.type=function(e){return arguments.length?(t="function"===typeof e?e:Tc(e),r):t},r.size=function(t){return arguments.length?(e="function"===typeof t?t:Tc(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}().type((t=>xh(t.shape||"circle"))).size((t=>Oh(t.size,64))),Ih=Fh().x(Nh).y(Th).defined(zh).size((t=>t.size||1));function qh(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function Wh(t,e,n,i){return Bh.context(t)(e,n,i)}var Hh=1;function Xh(){Hh=1}function Jh(t,e,n){var i=e.clip,r=t._defs,o=e.clip_id||(e.clip_id="clip"+Hh++),a=r.clipping[o]||(r.clipping[o]={id:o});return(0,m.mf)(i)?a.path=i(null):qh(n)?a.path=Wh(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function Gh(t){this.clear(),t&&this.union(t)}function $h(t){this.mark=t,this.bounds=this.bounds||new Gh}function Vh(t){$h.call(this,t),this.items=this.items||[]}function Yh(t){this._pending=0,this._loader=t||vr()}function Kh(t){t._pending+=1}function Zh(t){t._pending-=1}function Qh(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const i=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(i+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,i):0))}return t}Gh.prototype={clone(){return new Gh(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,i){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this},add(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(t,e,n){var{x1:i,y1:r,x2:o,y2:a}=this,s=Math.cos(t),c=Math.sin(t),l=e-e*s+n*c,u=n-e*c-n*s;return[s*i-c*r+l,c*i+s*r+u,s*i-c*a+l,c*i+s*a+u,s*o-c*r+l,c*o+s*r+u,s*o-c*a+l,c*o+s*a+u]},union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},contains(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},(0,m.XW)(Vh,$h),Yh.prototype={pending(){return this._pending},sanitizeURL(t){const e=this;return Kh(e),e._loader.sanitize(t,{context:"href"}).then((t=>(Zh(e),t))).catch((()=>(Zh(e),null)))},loadImage(t){const e=this,n=vl();return Kh(e),e._loader.sanitize(t,{context:"image"}).then((t=>{const i=t.href;if(!i||!n)throw{url:i};const r=new n,o=(0,m.nr)(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=o&&(r.crossOrigin=o),r.onload=()=>Zh(e),r.onerror=()=>Zh(e),r.src=i,r})).catch((t=>(Zh(e),{complete:!1,width:0,height:0,src:t&&t.url||""})))},ready(){const t=this;return new Promise((e=>{!function n(i){t.pending()?setTimeout((()=>{n(!0)}),10):e(i)}(!1)}))}};const tp=ch-1e-8;let ep,np,ip,rp,op,ap,sp,cp;const lp=(t,e)=>ep.add(t,e),up=(t,e)=>lp(np=t,ip=e),fp=t=>lp(t,ep.y1),dp=t=>lp(ep.x1,t),hp=(t,e)=>op*t+sp*e,pp=(t,e)=>ap*t+cp*e,mp=(t,e)=>lp(hp(t,e),pp(t,e)),gp=(t,e)=>up(hp(t,e),pp(t,e));function vp(t,e){return ep=t,e?(rp=e*ah,op=cp=Math.cos(rp),ap=Math.sin(rp),sp=-ap):(op=cp=1,rp=ap=sp=0),yp}const yp={beginPath(){},closePath(){},moveTo:gp,lineTo:gp,rect(t,e,n,i){rp?(mp(t+n,e),mp(t+n,e+i),mp(t,e+i),gp(t,e)):(lp(t+n,e+i),up(t,e))},quadraticCurveTo(t,e,n,i){const r=hp(t,e),o=pp(t,e),a=hp(n,i),s=pp(n,i);bp(np,r,a,fp),bp(ip,o,s,dp),up(a,s)},bezierCurveTo(t,e,n,i,r,o){const a=hp(t,e),s=pp(t,e),c=hp(n,i),l=pp(n,i),u=hp(r,o),f=pp(r,o);xp(np,a,c,u,fp),xp(ip,s,l,f,dp),up(u,f)},arc(t,e,n,i,r,o){if(i+=rp,r+=rp,np=n*Math.cos(r)+t,ip=n*Math.sin(r)+e,Math.abs(r-i)>tp)lp(t-n,e-n),lp(t+n,e+n);else{const a=i=>lp(n*Math.cos(i)+t,n*Math.sin(i)+e);let s,c;if(a(i),a(r),r!==i)if((i%=ch)<0&&(i+=ch),(r%=ch)<0&&(r+=ch),r<i&&(o=!o,s=i,i=r,r=s),o)for(r-=ch,s=i-i%sh,c=0;c<4&&s>r;++c,s-=sh)a(s);else for(s=i-i%sh+sh,c=0;c<4&&s<r;++c,s+=sh)a(s)}}};function bp(t,e,n,i){const r=(t-e)/(t+n-2*e);0<r&&r<1&&i(t+(e-t)*r)}function xp(t,e,n,i,r){const o=i-t+3*e-3*n,a=t+n-2*e,s=t-e;let c,l=0,u=0;Math.abs(o)>1e-14?(c=a*a+s*o,c>=0&&(c=Math.sqrt(c),l=(-a+c)/o,u=(-a-c)/o)):l=.5*s/a,0<l&&l<1&&r(_p(l,t,e,n,i)),0<u&&u<1&&r(_p(u,t,e,n,i))}function _p(t,e,n,i,r){const o=1-t,a=o*o,s=t*t;return a*o*e+3*a*t*n+3*o*s*i+s*t*r}var wp=(wp=gl(1,1))?wp.getContext("2d"):null;const kp=new Gh;function Ep(t){return function(e,n){if(!wp)return!0;t(wp,e),kp.clear().union(e.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:a}=kp;for(let t=r;t<=a;++t)for(let e=i;e<=o;++e)if(wp.isPointInPath(e,t))return!0;return!1}}function Dp(t,e){return e.contains(t.x||0,t.y||0)}function Ap(t,e){const n=t.x||0,i=t.y||0,r=t.width||0,o=t.height||0;return e.intersects(kp.set(n,i,n+r,i+o))}function Sp(t,e){const n=t.x||0,i=t.y||0;return Mp(e,n,i,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i)}function Mp(t,e,n,i,r){const{x1:o,y1:a,x2:s,y2:c}=t,l=i-e,u=r-n;let f,d,h,p,m=0,g=1;for(p=0;p<4;++p){if(0===p&&(f=-l,d=-(o-e)),1===p&&(f=l,d=s-e),2===p&&(f=-u,d=-(a-n)),3===p&&(f=u,d=c-n),Math.abs(f)<1e-10&&d<0)return!1;if(h=d/f,f<0){if(h>g)return!1;h>m&&(m=h)}else if(f>0){if(h<m)return!1;h<g&&(g=h)}}return!0}function Cp(t,e){t.globalCompositeOperation=e.blend||"source-over"}function Fp(t,e){return null==t?e:t}function Op(t,e){const n=e.length;for(let i=0;i<n;++i)t.addColorStop(e[i].offset,e[i].color);return t}function Np(t,e,n){return $d(n)?function(t,e,n){const i=n.width(),r=n.height();let o;if("radial"===e.gradient)o=t.createRadialGradient(n.x1+Fp(e.x1,.5)*i,n.y1+Fp(e.y1,.5)*r,Math.max(i,r)*Fp(e.r1,0),n.x1+Fp(e.x2,.5)*i,n.y1+Fp(e.y2,.5)*r,Math.max(i,r)*Fp(e.r2,.5));else{const a=Fp(e.x1,0),s=Fp(e.y1,0),c=Fp(e.x2,1),l=Fp(e.y2,0);if(a!==c&&s!==l&&i!==r){const n=gl(Math.ceil(i),Math.ceil(r)),o=n.getContext("2d");return o.scale(i,r),o.fillStyle=Op(o.createLinearGradient(a,s,c,l),e.stops),o.fillRect(0,0,i,r),t.createPattern(n,"no-repeat")}o=t.createLinearGradient(n.x1+a*i,n.y1+s*r,n.x1+c*i,n.y1+l*r)}return Op(o,e.stops)}(t,n,e.bounds):n}function Tp(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=Np(t,e,e.fill),!0)}var zp=[];function Rp(t,e,n){var i=null!=(i=e.strokeWidth)?i:1;return!(i<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=Np(t,e,e.stroke),t.lineWidth=i,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||zp),t.lineDashOffset=e.strokeDashOffset||0),!0))}function Pp(t,e){return t.zindex-e.zindex||t.index-e.index}function Lp(t){if(!t.zdirty)return t.zitems;var e,n,i,r=t.items,o=[];for(n=0,i=r.length;n<i;++n)(e=r[n]).index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(Pp)}function jp(t,e){var n,i,r=t.items;if(!r||!r.length)return;const o=Lp(t);if(o&&o.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||e(r[n]);r=o}for(n=0,i=r.length;n<i;++n)e(r[n])}function Bp(t,e){var n,i,r=t.items;if(!r||!r.length)return null;const o=Lp(t);for(o&&o.length&&(r=o),i=r.length;--i>=0;)if(n=e(r[i]))return n;if(r===o)for(i=(r=t.items).length;--i>=0;)if(!r[i].zindex&&(n=e(r[i])))return n;return null}function Up(t){return function(e,n,i){jp(n,(n=>{i&&!i.intersects(n.bounds)||qp(t,e,n,n)}))}}function Ip(t){return function(e,n,i){!n.items.length||i&&!i.intersects(n.bounds)||qp(t,e,n.items[0],n.items)}}function qp(t,e,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(t(e,i)||(Cp(e,n),n.fill&&Tp(e,n,r)&&e.fill(),n.stroke&&Rp(e,n,r)&&e.stroke()))}function Wp(t){return t=t||m.yb,function(e,n,i,r,o,a){return i*=e.pixelRatio,r*=e.pixelRatio,Bp(n,(n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return t(e,n,i,r,o,a)?n:void 0}))}}function Hp(t,e){return function(n,i,r,o){var a,s,c=Array.isArray(i)?i[0]:i,l=null==e?c.fill:e,u=c.stroke&&n.isPointInStroke;return u&&(a=c.strokeWidth,s=c.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!t(n,i)&&(l&&n.isPointInPath(r,o)||u&&n.isPointInStroke(r,o))}}function Xp(t){return Wp(Hp(t))}function Jp(t,e){return"translate("+t+","+e+")"}function Gp(t){return"rotate("+t+")"}function $p(t){return Jp(t.x||0,t.y||0)}function Vp(t,e,n){function i(t,n){var i=n.x||0,r=n.y||0,o=n.angle||0;t.translate(i,r),o&&t.rotate(o*=ah),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-i,-r)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",function(t){return Jp(t.x||0,t.y||0)+(t.angle?" "+Gp(t.angle):"")}(n)),t("d",e(null,n))},bound:function(t,n){return e(vp(t,n.angle),n),Qh(t,n).translate(n.x||0,n.y||0)},draw:Up(i),pick:Xp(i),isect:n||Ep(i)}}var Yp=Vp("arc",(function(t,e){return Rh.context(t)(e)}));function Kp(t,e,n){function i(t,n){t.beginPath(),e(t,n)}const r=Hp(i);return{type:t,tag:"path",nested:!0,attr:function(t,n){var i=n.mark.items;i.length&&t("d",e(null,i))},bound:function(t,n){var i=n.items;return 0===i.length?t:(e(vp(t),i),Qh(t,i[0]))},draw:Ip(i),pick:function(t,e,n,i,o,a){var s=e.items,c=e.bounds;return!s||!s.length||c&&!c.contains(o,a)?null:(n*=t.pixelRatio,i*=t.pixelRatio,r(t,s,n,i)?s[0]:null)},isect:Dp,tip:n}}var Zp=Kp("area",(function(t,e){const n=e[0],i=n.interpolate||"linear";return("horizontal"===n.orient?Lh:Ph).curve(Qd(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",a=t.length,s=1/0;--a>=0;)!1!==t[a].defined&&(i=Math.abs(t[a][o]-r))<s&&(s=i,n=t[a]);return n}));function Qp(t,e){t.beginPath(),qh(e)?Wh(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}function tm(t){const e=Fp(t.strokeWidth,1);return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function em(t,e){const n=tm(e);t("d",Wh(null,e,n,n))}function nm(t,e,n,i){const r=tm(e);t.beginPath(),Wh(t,e,(n||0)+r,(i||0)+r)}const im=Hp(nm),rm=Hp(nm,!1),om=Hp(nm,!0);var am={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",$p(e))},bound:function(t,e){if(!e.clip&&e.items){const n=e.items,i=n.length;for(let e=0;e<i;++e)t.union(n[e].bounds)}return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),Qh(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){jp(e,(e=>{const i=e.x||0,r=e.y||0,o=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(nm(t,e,i,r),Cp(t,e),e.fill&&Tp(t,e,a)&&t.fill(),e.stroke&&!o&&Rp(t,e,a)&&t.stroke()),t.save(),t.translate(i,r),e.clip&&Qp(t,e),n&&n.translate(-i,-r),jp(e,(e=>{this.draw(t,e,n)})),n&&n.translate(i,r),t.restore(),o&&e.stroke&&a&&(nm(t,e,i,r),Cp(t,e),Rp(t,e,a)&&t.stroke())}))},pick:function(t,e,n,i,r,o){if(e.bounds&&!e.bounds.contains(r,o)||!e.items)return null;const a=n*t.pixelRatio,s=i*t.pixelRatio;return Bp(e,(c=>{let l,u,f;const d=c.bounds;if(d&&!d.contains(r,o))return;u=c.x||0,f=c.y||0;const h=u+(c.width||0),p=f+(c.height||0),m=c.clip;if(m&&(r<u||r>h||o<f||o>p))return;if(t.save(),t.translate(u,f),u=r-u,f=o-f,m&&qh(c)&&!om(t,c,a,s))return t.restore(),null;const g=c.strokeForeground,v=!1!==e.interactive;return v&&g&&c.stroke&&rm(t,c,a,s)?(t.restore(),c):(l=Bp(c,(t=>function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,u,f)?this.pick(t,n,i,u,f):null)),!l&&v&&(c.fill||!g&&c.stroke)&&im(t,c,a,s)&&(l=c),t.restore(),l||null)}))},isect:Ap,content:function(t,e,n){t("clip-path",e.clip?Jh(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),em(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?em(t,e):t("d","")}},sm={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function cm(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then((e=>{t.image=e,t.image.url=t.url}))),n}function lm(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function um(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function fm(t,e){return"center"===t?e/2:"right"===t?e:0}function dm(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var hm={type:"image",tag:"image",nested:!1,attr:function(t,e,n){const i=cm(e,n),r=lm(e,i),o=um(e,i),a=(e.x||0)-fm(e.align,r),s=(e.y||0)-dm(e.baseline,o);t("href",!i.src&&i.toDataURL?i.toDataURL():i.src||"",sm["xmlns:xlink"],"xlink:href"),t("transform",Jp(a,s)),t("width",r),t("height",o),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){const n=e.image,i=lm(e,n),r=um(e,n),o=(e.x||0)-fm(e.align,i),a=(e.y||0)-dm(e.baseline,r);return t.set(o,a,o+i,a+r)},draw:function(t,e,n){jp(e,(e=>{if(n&&!n.intersects(e.bounds))return;const i=cm(e,this);let r=lm(e,i),o=um(e,i);if(0===r||0===o)return;let a,s,c,l,u=(e.x||0)-fm(e.align,r),f=(e.y||0)-dm(e.baseline,o);!1!==e.aspect&&(s=i.width/i.height,c=e.width/e.height,s===s&&c===c&&s!==c&&(c<s?(l=r/s,f+=(o-l)/2,o=l):(l=o*s,u+=(r-l)/2,r=l))),(i.complete||i.toDataURL)&&(Cp(t,e),t.globalAlpha=null!=(a=e.opacity)?a:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(i,u,f,r,o))}))},pick:Wp(),isect:m.yb,get:cm,xOffset:fm,yOffset:dm},pm=Kp("line",(function(t,e){const n=e[0],i=n.interpolate||"linear";return jh.curve(Qd(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r=Math.pow(t[0].strokeWidth||1,2),o=t.length;--o>=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(i=t[o].y-e[1])*i<r)return t[o];return null}));function mm(t,e){var n=e.path;if(null==n)return!0;var i=e.x||0,r=e.y||0,o=e.scaleX||1,a=e.scaleY||1,s=(e.angle||0)*ah,c=e.pathCache;c&&c.path===n||((e.pathCache=c=oh(n)).path=n),s&&t.rotate&&t.translate?(t.translate(i,r),t.rotate(s),gh(t,c,0,0,o,a),t.rotate(-s),t.translate(-i,-r)):gh(t,c,i,r,o,a)}var gm={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,i=e.scaleY||1;1===n&&1===i||t("vector-effect","non-scaling-stroke"),t("transform",function(t){return Jp(t.x||0,t.y||0)+(t.angle?" "+Gp(t.angle):"")+(t.scaleX||t.scaleY?" "+function(t,e){return"scale("+t+","+e+")"}(t.scaleX||1,t.scaleY||1):"")}(e)),t("d",e.path)},bound:function(t,e){return mm(vp(t,e.angle),e)?t.set(0,0,0,0):Qh(t,e,!0)},draw:Up(mm),pick:Xp(mm),isect:Ep(mm)};function vm(t,e){t.beginPath(),Wh(t,e)}var ym={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",Wh(null,e))},bound:function(t,e){var n,i;return Qh(t.set(n=e.x||0,i=e.y||0,n+e.width||0,i+e.height||0),e)},draw:Up(vm),pick:Xp(vm),isect:Ap};function bm(t,e,n){var i,r,o,a;return!(!e.stroke||!Rp(t,e,n))&&(i=e.x||0,r=e.y||0,o=null!=e.x2?e.x2:i,a=null!=e.y2?e.y2:r,t.beginPath(),t.moveTo(i,r),t.lineTo(o,a),!0)}var xm={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",$p(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,i;return Qh(t.set(n=e.x||0,i=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i),e)},draw:function(t,e,n){jp(e,(e=>{if(!n||n.intersects(e.bounds)){var i=null==e.opacity?1:e.opacity;i&&bm(t,e,i)&&(Cp(t,e),t.stroke())}}))},pick:Wp((function(t,e,n,i){return!!t.isPointInStroke&&(bm(t,e,1)&&t.isPointInStroke(n,i))})),isect:Sp},_m=Vp("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),wm=Vp("symbol",(function(t,e){return Uh.context(t)(e)}),Dp);const km=(0,m.$m)();var Em={height:Fm,measureWidth:Mm,estimateWidth:Am,width:Am,canvas:Dm};function Dm(t){Em.width=t&&wp?Mm:Am}function Am(t,e){return Sm(zm(t,e),Fm(t))}function Sm(t,e){return~~(.8*t.length*e)}function Mm(t,e){return Fm(t)<=0||!(e=zm(t,e))?0:Cm(e,Pm(t))}function Cm(t,e){const n="(".concat(e,") ").concat(t);let i=km.get(n);return void 0===i&&(wp.font=e,i=wp.measureText(t).width,km.set(n,i)),i}function Fm(t){return null!=t.fontSize?+t.fontSize||0:11}function Om(t){return null!=t.lineHeight?t.lineHeight:Fm(t)+2}function Nm(t){return e=t.lineBreak&&t.text&&!(0,m.kJ)(t.text)?t.text.split(t.lineBreak):t.text,(0,m.kJ)(e)?e.length>1?e:e[0]:e;var e}function Tm(t){const e=Nm(t);return((0,m.kJ)(e)?e.length-1:0)*Om(t)}function zm(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,i=function(t){if(Em.width===Mm){const e=Pm(t);return t=>Cm(t,e)}{const e=Fm(t);return t=>Sm(t,e)}}(t);if(i(e)<n)return e;var r,o=t.ellipsis||"\u2026",a="rtl"===t.dir,s=0,c=e.length;if(n-=i(o),a){for(;s<c;)r=s+c>>>1,i(e.slice(r))>n?s=r+1:c=r;return o+e.slice(s)}for(;s<c;)r=1+(s+c>>>1),i(e.slice(0,r))<n?s=r:c=r-1;return e.slice(0,s)+o}(t,n):n}function Rm(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Pm(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+Fm(t)+"px "+Rm(t,e)}function Lm(t){var e=t.baseline,n=Fm(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*Om(t):"line-bottom"===e?.29*n-.5*Om(t):0)}Dm(!0);const jm={left:"start",center:"middle",right:"end"},Bm=new Gh;function Um(t){var e,n=t.x||0,i=t.y||0,r=t.radius||0;return r&&(e=(t.theta||0)-sh,n+=r*Math.cos(e),i+=r*Math.sin(e)),Bm.x1=n,Bm.y1=i,Bm}function Im(t,e,n){var i,r=Em.height(e),o=e.align,a=Um(e),s=a.x1,c=a.y1,l=e.dx||0,u=(e.dy||0)+Lm(e)-Math.round(.8*r),f=Nm(e);if((0,m.kJ)(f)?(r+=Om(e)*(f.length-1),i=f.reduce(((t,n)=>Math.max(t,Em.width(e,n))),0)):i=Em.width(e,f),"center"===o?l-=i/2:"right"===o&&(l-=i),t.set(l+=s,u+=c,l+i,u+r),e.angle&&!n)t.rotate(e.angle*ah,s,c);else if(2===n)return t.rotatedPoints(e.angle*ah,s,c);return t}var qm={type:"text",tag:"text",nested:!1,attr:function(t,e){var n,i=e.dx||0,r=(e.dy||0)+Lm(e),o=Um(e),a=o.x1,s=o.y1,c=e.angle||0;t("text-anchor",jm[e.align]||"start"),c?(n=Jp(a,s)+" "+Gp(c),(i||r)&&(n+=" "+Jp(i,r))):n=Jp(a+i,s+r),t("transform",n)},bound:Im,draw:function(t,e,n){jp(e,(e=>{var i,r,o,a,s,c,l,u=null==e.opacity?1:e.opacity;if(!(n&&!n.intersects(e.bounds)||0===u||e.fontSize<=0||null==e.text||0===e.text.length)){if(t.font=Pm(e),t.textAlign=e.align||"left",r=(i=Um(e)).x1,o=i.y1,e.angle&&(t.save(),t.translate(r,o),t.rotate(e.angle*ah),r=o=0),r+=e.dx||0,o+=(e.dy||0)+Lm(e),c=Nm(e),Cp(t,e),(0,m.kJ)(c))for(s=Om(e),a=0;a<c.length;++a)l=zm(e,c[a]),e.fill&&Tp(t,e,u)&&t.fillText(l,r,o),e.stroke&&Rp(t,e,u)&&t.strokeText(l,r,o),o+=s;else l=zm(e,c),e.fill&&Tp(t,e,u)&&t.fillText(l,r,o),e.stroke&&Rp(t,e,u)&&t.strokeText(l,r,o);e.angle&&t.restore()}}))},pick:Wp((function(t,e,n,i,r,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var a=Um(e),s=a.x1,c=a.y1,l=Im(Bm,e,1),u=-e.angle*ah,f=Math.cos(u),d=Math.sin(u),h=f*r-d*o+(s-f*s+d*c),p=d*r+f*o+(c-d*s-f*c);return l.contains(h,p)})),isect:function(t,e){const n=Im(Bm,t,2);return Mp(e,n[0],n[1],n[2],n[3])||Mp(e,n[0],n[1],n[4],n[5])||Mp(e,n[4],n[5],n[6],n[7])||Mp(e,n[2],n[3],n[6],n[7])}},Wm=Kp("trail",(function(t,e){return Ih.context(t)(e)}),(function(t,e){for(var n,i,r=t.length;--r>=0;)if(!1!==t[r].defined&&(n=t[r].x-e[0])*n+(i=t[r].y-e[1])*i<(n=t[r].size||1)*n)return t[r];return null})),Hm={arc:Yp,area:Zp,group:am,image:hm,line:pm,path:gm,rect:ym,rule:xm,shape:_m,symbol:wm,text:qm,trail:Wm};function Xm(t,e,n){var i=Hm[t.mark.marktype],r=e||i.bound;return i.nested&&(t=t.mark),r(t.bounds||(t.bounds=new Gh),t,n)}var Jm={mark:null};function Gm(t,e,n){var i,r,o,a,s=Hm[t.marktype],c=s.bound,l=t.items,u=l&&l.length;if(s.nested)return u?o=l[0]:(Jm.mark=t,o=Jm),a=Xm(o,c,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new Gh,u)for(i=0,r=l.length;i<r;++i)e.union(Xm(l[i],c,n));return t.bounds=e}const $m=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function Vm(t,e){return JSON.stringify(t,$m,e)}function Ym(t){return Km("string"===typeof t?JSON.parse(t):t)}function Km(t){var e,n,i,r=t.marktype,o=t.items;if(o)for(n=0,i=o.length;n<i;++n)e=r?"mark":"group",o[n][e]=t,o[n].zindex&&(o[n][e].zdirty=!0),"group"===(r||e)&&Km(o[n]);return r&&Gm(t),t}function Zm(t){arguments.length?this.root=Ym(t):(this.root=Qm({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Vh(this.root)])}function Qm(t,e){const n={bounds:new Gh,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0};return null!=t.aria&&(n.aria=t.aria),t.description&&(n.description=t.description),n}function tg(t,e,n){return!t&&"undefined"!==typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function eg(t,e){e=e.toLowerCase();for(var n=t.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===e)return n[i]}function ng(t,e,n,i){var r,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(r=o||null,o=tg(t.ownerDocument,n,i),t.insertBefore(o,r)),o}function ig(t,e){for(var n=t.childNodes,i=n.length;i>e;)t.removeChild(n[--i]);return t}function rg(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function og(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function ag(t,e){this._active=null,this._handlers={},this._loader=t||vr(),this._tooltip=e||sg}function sg(t,e,n,i){t.element().setAttribute("title",i||"")}function cg(t){this._el=null,this._bgcolor=null,this._loader=new Yh(t)}Zm.prototype={toJSON(t){return Vm(this.root,t||0)},mark(t,e,n){const i=Qm(t,e=e||this.root.items[0]);return e.items[n]=i,i.zindex&&(i.group.zdirty=!0),i}},ag.prototype={initialize(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},scene(t){return arguments.length?(this._scene=t,this):this._scene},on(){},off(){},_handlerIndex(t,e,n){for(let i=t?t.length:0;--i>=0;)if(t[i].type===e&&(!n||t[i].handler===n))return i;return-1},handlers(t){const e=this._handlers,n=[];if(t)n.push(...e[this.eventName(t)]);else for(const i in e)n.push(...e[i]);return n},eventName(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)},handleHref(t,e,n){this._loader.sanitize(n,{context:"href"}).then((e=>{const n=new MouseEvent(t.type,t),i=tg(null,"a");for(const t in e)i.setAttribute(t,e[t]);i.dispatchEvent(n)})).catch((()=>{}))},handleTooltip(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,i){var r,o,a=t&&t.mark;if(a&&(r=Hm[a.marktype]).tip){for((o=og(e,n))[0]-=i[0],o[1]-=i[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=r.tip(a.items,o)}return t}(e,t,this.canvas(),this._origin);const i=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,i)}},getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),i=this._origin,r=t.bounds,o=r.width(),a=r.height();let s=r.x1+i[0]+n.left,c=r.y1+i[1]+n.top;for(;t.mark&&(t=t.mark.group);)s+=t.x||0,c+=t.y||0;return{x:s,y:c,width:o,height:a,left:s,top:c,right:s+o,bottom:c+a}}},cg.prototype={initialize(t,e,n,i,r){return this._el=t,this.resize(e,n,i,r)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},resize(t,e,n,i){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=i||1,this},dirty(){},render(t){const e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},_render(){},renderAsync(t){const e=this.render(t);return this._ready?this._ready.then((()=>e)):Promise.resolve(e)},_load(t,e){var n=this,i=n._loader[t](e);if(!n._ready){const t=n._call;n._ready=n._loader.ready().then((e=>{e&&t(),n._ready=null}))}return i},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const lg="dragenter",ug="dragleave",fg="dragover",dg="mousedown",hg="mousemove",pg="mouseout",mg="mouseover",gg="click",vg="mousewheel",yg="touchstart",bg="touchmove",xg="touchend",_g=["keydown","keypress","keyup",lg,ug,fg,dg,"mouseup",hg,pg,mg,gg,"dblclick","wheel",vg,yg,bg,xg],wg=hg,kg=pg,Eg=gg;function Dg(t,e){ag.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}function Ag(t,e){(t=>t===yg||t===bg||t===xg?[yg,bg,xg]:[t])(e).forEach((e=>function(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?n=>t[e](n):n=>t.fire(e,n)))}(t,e)))}function Sg(t,e,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r||(r&&r.exit||this.fire(n,i),this._active=o,this.fire(e,i)),this.fire(t,i)}}function Mg(t){return function(e){this.fire(t,e),this._active=null}}(0,m.XW)(Dg,ag,{initialize(t,e,n){return this._canvas=t&&eg(t,"canvas"),[gg,dg,hg,pg,ug].forEach((t=>Ag(this,t))),ag.prototype.initialize.call(this,t,e,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:_g,DOMMouseScroll(t){this.fire(vg,t)},mousemove:Sg(hg,mg,pg),dragover:Sg(fg,lg,ug),mouseout:Mg(pg),dragleave:Mg(ug),mousedown(t){this._down=this._active,this.fire(dg,t)},click(t){this._down===this._active&&(this.fire(gg,t),this._down=null)},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(yg,t,!0)},touchmove(t){this.fire(bg,t,!0)},touchend(t){this.fire(xg,t,!0),this._touch=null},fire(t,e,n){const i=n?this._touch:this._active,r=this._handlers[t];if(e.vegaType=t,t===Eg&&i&&i.href?this.handleHref(e,i,i.href):t!==wg&&t!==kg||this.handleTooltip(e,i,t!==kg),r)for(let o=0,a=r.length;o<a;++o)r[o].handler.call(this._obj,e,i)},on(t,e){const n=this.eventName(t),i=this._handlers;return this._handlerIndex(i[n],t,e)<0&&(Ag(this,t),(i[n]||(i[n]=[])).push({type:t,handler:e})),this},off(t,e){const n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&i.splice(r,1),this},pickEvent(t){const e=og(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},pick(t,e,n,i,r){const o=this.context();return Hm[t.marktype].pick.call(this,o,t,e,n,i,r)}});var Cg="undefined"!==typeof window&&window.devicePixelRatio||1;function Fg(t){cg.call(this,t),this._options={},this._redraw=!1,this._dirty=new Gh,this._tempb=new Gh}const Og=cg.prototype;function Ng(t,e){ag.call(this,t,e);const n=this;n._hrefHandler=Tg(n,((t,e)=>{e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=Tg(n,((t,e)=>{n.handleTooltip(t,e,t.type!==kg)}))}(0,m.XW)(Fg,cg,{initialize(t,e,n,i,r,o){return this._options=o||{},this._canvas=this._options.externalContext?null:gl(1,1,this._options.type),t&&this._canvas&&(ig(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Og.initialize.call(this,t,e,n,i,r)},resize(t,e,n,i){if(Og.resize.call(this,t,e,n,i),this._canvas)!function(t,e,n,i,r,o){const a="undefined"!==typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,s=t.getContext("2d"),c=a?Cg:r;t.width=e*c,t.height=n*c;for(const l in o)s[l]=o[l];a&&1!==c&&(t.style.width=e+"px",t.style.height=n+"px"),s.pixelRatio=c,s.setTransform(c,0,0,c,c*i[0],c*i[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const t=this._options.externalContext;t||(0,m.vU)("CanvasRenderer is missing a valid canvas or context"),t.scale(this._scale,this._scale),t.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(t){const e=this._tempb.clear().union(t.bounds);let n=t.mark.group;for(;n;)e.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(e)},_render(t){const e=this.context(),n=this._origin,i=this._width,r=this._height,o=this._dirty,a=((t,e,n)=>(new Gh).set(0,0,e,n).translate(-t[0],-t[1]))(n,i,r);e.save();const s=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,a.intersect(o),n);return this.clear(-n[0],-n[1],i,r),this.draw(e,t,s),e.restore(),o.clear(),this},draw(t,e,n){const i=Hm[e.marktype];e.clip&&function(t,e){var n=e.clip;t.save(),(0,m.mf)(n)?(t.beginPath(),n(t),t.clip()):Qp(t,e.group)}(t,e),i.draw.call(this,t,e,n),e.clip&&t.restore()},clear(t,e,n,i){const r=this._options,o=this.context();"pdf"===r.type||r.externalContext||o.clearRect(t,e,n,i),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(t,e,n,i))}});const Tg=(t,e)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,e.call(t._obj,n,i)};(0,m.XW)(Ng,ag,{initialize(t,e,n){let i=this._svg;return i&&(i.removeEventListener(Eg,this._hrefHandler),i.removeEventListener(wg,this._tooltipHandler),i.removeEventListener(kg,this._tooltipHandler)),this._svg=i=t&&eg(t,"svg"),i&&(i.addEventListener(Eg,this._hrefHandler),i.addEventListener(wg,this._tooltipHandler),i.addEventListener(kg,this._tooltipHandler)),ag.prototype.initialize.call(this,t,e,n)},canvas(){return this._svg},on(t,e){const n=this.eventName(t),i=this._handlers;if(this._handlerIndex(i[n],t,e)<0){const r={type:t,handler:e,listener:Tg(this,e)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this},off(t,e){const n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this}});const zg="aria-hidden",Rg="aria-label",Pg="role",Lg="aria-roledescription",jg="graphics-object",Bg="graphics-symbol",Ug=(t,e,n)=>({[Pg]:t,[Lg]:e,[Rg]:n||void 0}),Ig=(0,m.Rg)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),qg={axis:{desc:"axis",caption:function(t){const e=t.datum,n=t.orient,i=e.title?Gg(t):null,r=t.context,o=r.scales[e.scale].value,a=r.dataflow.locale(),s=o.type;return"".concat("left"===n||"right"===n?"Y":"X","-axis")+(i?" titled '".concat(i,"'"):"")+" for a ".concat(ld(s)?"discrete":s," scale")+" with ".concat(Xd(a,o,t))}},legend:{desc:"legend",caption:function(t){const e=t.datum,n=e.title?Gg(t):null,i="".concat(e.type||""," legend").trim(),r=e.scales,o=Object.keys(r),a=t.context,s=a.scales[r[o[0]]].value,c=a.dataflow.locale();return function(t){return t.length?t[0].toUpperCase()+t.slice(1):t}(i)+(n?" titled '".concat(n,"'"):"")+" for ".concat(function(t){return t=t.map((t=>t+("fill"===t||"stroke"===t?" color":""))),t.length<2?t[0]:t.slice(0,-1).join(", ")+" and "+(0,m.fj)(t)}(o))+" with ".concat(Xd(c,s,t))}},"title-text":{desc:"title",caption:t=>"Title text '".concat(Jg(t),"'")},"title-subtitle":{desc:"subtitle",caption:t=>"Subtitle text '".concat(Jg(t),"'")}},Wg={ariaRole:Pg,ariaRoleDescription:Lg,description:Rg};function Hg(t,e){const n=!1===e.aria;if(t(zg,n||void 0),n||null==e.description)for(const i in Wg)t(Wg[i],void 0);else{const n=e.mark.marktype;t(Rg,e.description),t(Pg,e.ariaRole||("group"===n?jg:Bg)),t(Lg,e.ariaRoleDescription||"".concat(n," mark"))}}function Xg(t){return!1===t.aria?{[zg]:!0}:Ig[t.role]?null:qg[t.role]?function(t,e){try{const n=t.items[0],i=e.caption||(()=>"");return Ug(e.role||Bg,e.desc,n.description||i(n))}catch(n){return null}}(t,qg[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some((t=>null!=t.description&&!1!==t.aria));return Ug(n?jg:Bg,"".concat(e," mark container"),t.description)}(t)}function Jg(t){return(0,m.IX)(t.text).join(" ")}function Gg(t){try{return(0,m.IX)((0,m.fj)(t.items).items[0].text).join(" ")}catch(e){return null}}const $g=t=>(t+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),Vg=t=>$g(t).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
");function Yg(){let t="",e="",n="";const i=[],r=()=>e=n="",o=(t,n)=>(null!=n&&(e+=" ".concat(t,'="').concat(Vg(n),'"')),a),a={open(s){(o=>{e&&(t+="".concat(e,">").concat(n),r()),i.push(o)})(s),e="<"+s;for(var c=arguments.length,l=new Array(c>1?c-1:0),u=1;u<c;u++)l[u-1]=arguments[u];for(const t of l)for(const e in t)o(e,t[e]);return a},close(){const o=i.pop();return t+=e?e+(n?">".concat(n,"</").concat(o,">"):"/>"):"</".concat(o,">"),r(),a},attr:o,text:t=>(n+=$g(t),a),toString:()=>t};return a}const Kg=t=>Zg(Yg(),t)+"";function Zg(t,e){if(t.open(e.tagName),e.hasAttributes()){const n=e.attributes,i=n.length;for(let e=0;e<i;++e)t.attr(n[e].name,n[e].value)}if(e.hasChildNodes()){const n=e.childNodes;for(const e of n)3===e.nodeType?t.text(e.nodeValue):Zg(t,e)}return t.close()}const Qg={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},tv={blend:"mix-blend-mode"},ev={fill:"none","stroke-miterlimit":10},nv="http://www.w3.org/2000/xmlns/",iv=sm.xmlns;function rv(t){cg.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const ov=cg.prototype;function av(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function sv(t,e,n){let i,r,o;if("radial"===e.gradient){let i=ng(t,n++,"pattern",iv);mv(i,{id:Gd+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),i=ng(i,0,"rect",iv),mv(i,{width:1,height:1,fill:"url(".concat(vv(),"#").concat(e.id,")")}),mv(t=ng(t,n++,"radialGradient",iv),{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else mv(t=ng(t,n++,"linearGradient",iv),{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(i=0,r=e.stops.length;i<r;++i)o=ng(t,i,"stop",iv),o.setAttribute("offset",e.stops[i].offset),o.setAttribute("stop-color",e.stops[i].color);return ig(t,i),n}function cv(t,e,n){let i;return(t=ng(t,n,"clipPath",iv)).setAttribute("id",e.id),e.path?(i=ng(t,0,"path",iv),i.setAttribute("d",e.path)):(i=ng(t,0,"rect",iv),mv(i,{x:0,y:0,width:e.width,height:e.height})),ig(t,1),n+1}function lv(t,e,n,i,r){let o,a=t._svg;if(!a&&(o=e.ownerDocument,a=tg(o,i,iv),t._svg=a,t.mark&&(a.__data__=t,a.__values__={fill:"default"},"g"===i))){const e=tg(o,"path",iv);a.appendChild(e),e.__data__=t;const n=tg(o,"g",iv);a.appendChild(n),n.__data__=t;const i=tg(o,"path",iv);a.appendChild(i),i.__data__=t,i.__values__={fill:"default"}}return(a.ownerSVGElement!==r||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(a,n))&&e.insertBefore(a,n?n.nextSibling:e.firstChild),a}(0,m.XW)(rv,cg,{initialize(t,e,n,i,r){return this._defs={},this._clearDefs(),t&&(this._svg=ng(t,0,"svg",iv),this._svg.setAttributeNS(nv,"xmlns",iv),this._svg.setAttributeNS(nv,"xmlns:xlink",sm["xmlns:xlink"]),this._svg.setAttribute("version",sm.version),this._svg.setAttribute("class","marks"),ig(t,1),this._root=ng(this._svg,0,"g",iv),mv(this._root,ev),ig(this._svg,1)),this.background(this._bgcolor),ov.initialize.call(this,t,e,n,i,r)},background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),ov.background.apply(this,arguments)},resize(t,e,n,i){return ov.resize.call(this,t,e,n,i),this._svg&&(mv(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}),this._root.setAttribute("transform","translate(".concat(this._origin,")"))),this._dirty=[],this},canvas(){return this._svg},svg(){const t=this._svg,e=this._bgcolor;if(!t)return null;let n;e&&(t.removeAttribute("style"),n=ng(t,0,"rect",iv),mv(n,{width:this._width,height:this._height,fill:e}));const i=Kg(t);return e&&(t.removeChild(n),this._svg.style.setProperty("background-color",e)),i},_render(t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t),ig(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const e=++this._dirtyID;let n,i,r,o,a,s,c;for(a=0,s=t.length;a<s;++a)n=t[a],i=n.mark,i.marktype!==r&&(r=i.marktype,o=Hm[r]),i.zdirty&&i.dirty!==e&&(this._dirtyAll=!1,av(n,e),i.items.forEach((t=>{t.dirty=e}))),i.zdirty||(n.exit?(o.nested&&i.items.length?(c=i.items[0],c._svg&&this._update(o,c._svg,c)):n._svg&&(c=n._svg.parentNode,c&&c.removeChild(n._svg)),n._svg=null):(n=o.nested?i.items[0]:n,n._update!==e&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,av(n,e)),n._update=e)));return!this._dirtyAll},mark(t,e,n){if(!this.isDirty(e))return e._svg;const i=this._svg,r=Hm[e.marktype],o=!1===e.interactive?"none":null,a="g"===r.tag,s=lv(e,t,n,"g",i);s.setAttribute("class",rg(e));const c=Xg(e);for(const d in c)gv(s,d,c[d]);a||gv(s,"pointer-events",o),gv(s,"clip-path",e.clip?Jh(this,e,e.group):null);let l=null,u=0;const f=t=>{const e=this.isDirty(t),n=lv(t,s,l,r.tag,i);e&&(this._update(r,n,t),a&&function(t,e,n){e=e.lastChild.previousSibling;let i,r=0;jp(n,(n=>{i=t.mark(e,n,i),++r})),ig(e,1+r)}(this,n,t)),l=n,++u};return r.nested?e.items.length&&f(e.items[0]):jp(e,f),ig(s,u),s},_update(t,e,n){uv=e,fv=e.__values__,Hg(hv,n),t.attr(hv,n,this);const i=dv[t.type];i&&i.call(this,t,e,n),uv&&this.style(uv,n)},style(t,e){if(null!=e){for(const n in Qg){let i="font"===n?Rm(e):e[n];if(i===fv[n])continue;const r=Qg[n];null==i?t.removeAttribute(r):($d(i)&&(i=Vd(i,this._defs.gradient,vv())),t.setAttribute(r,i+"")),fv[n]=i}for(const n in tv)pv(t,tv[n],e[n])}},defs(){const t=this._svg,e=this._defs;let n=e.el,i=0;for(const r in e.gradient)n||(e.el=n=ng(t,1,"defs",iv)),i=sv(n,e.gradient[r],i);for(const r in e.clipping)n||(e.el=n=ng(t,1,"defs",iv)),i=cv(n,e.clipping[r],i);n&&(0===i?(t.removeChild(n),e.el=null):ig(n,i))},_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}});let uv=null,fv=null;const dv={group(t,e,n){const i=uv=e.childNodes[2];fv=i.__values__,t.foreground(hv,n,this),fv=e.__values__,uv=e.childNodes[1],t.content(hv,n,this);const r=uv=e.childNodes[0];t.background(hv,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==fv.events&&(gv(i,"pointer-events",o),gv(r,"pointer-events",o),fv.events=o),n.strokeForeground&&n.stroke){const t=n.fill;gv(i,"display",null),this.style(r,n),gv(r,"stroke",null),t&&(n.fill=null),fv=i.__values__,this.style(i,n),t&&(n.fill=t),uv=null}else gv(i,"display","none")},image(t,e,n){!1===n.smooth?(pv(e,"image-rendering","optimizeSpeed"),pv(e,"image-rendering","pixelated")):pv(e,"image-rendering",null)},text(t,e,n){const i=Nm(n);let r,o,a,s;(0,m.kJ)(i)?(o=i.map((t=>zm(n,t))),r=o.join("\n"),r!==fv.text&&(ig(e,0),a=e.ownerDocument,s=Om(n),o.forEach(((t,i)=>{const r=tg(a,"tspan",iv);r.__data__=n,r.textContent=t,i&&(r.setAttribute("x",0),r.setAttribute("dy",s)),e.appendChild(r)})),fv.text=r)):(o=zm(n,i),o!==fv.text&&(e.textContent=o,fv.text=o)),gv(e,"font-family",Rm(n)),gv(e,"font-size",Fm(n)+"px"),gv(e,"font-style",n.fontStyle),gv(e,"font-variant",n.fontVariant),gv(e,"font-weight",n.fontWeight)}};function hv(t,e,n){e!==fv[t]&&(n?function(t,e,n,i){null!=n?t.setAttributeNS(i,e,n):t.removeAttributeNS(i,e)}(uv,t,e,n):gv(uv,t,e),fv[t]=e)}function pv(t,e,n){n!==fv[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),fv[e]=n)}function mv(t,e){for(const n in e)gv(t,n,e[n])}function gv(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function vv(){let t;return"undefined"===typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function yv(t){cg.call(this,t),this._text=null,this._defs={gradient:{},clipping:{}}}(0,m.XW)(yv,cg,{svg(){return this._text},_render(t){const e=Yg();e.open("svg",(0,m.l7)({},sm,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&e.open("rect",{width:this._width,height:this._height,fill:n}).close(),e.open("g",ev,{transform:"translate("+this._origin+")"}),this.mark(e,t),e.close(),this.defs(e),this._text=e.close()+"",this},mark(t,e){const n=Hm[e.marktype],i=n.tag,r=[Hg,n.attr];t.open("g",{class:rg(e),"clip-path":e.clip?Jh(this,e,e.group):null},Xg(e),{"pointer-events":"g"!==i&&!1===e.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&t.open("a",a),t.open(i,this.attr(e,o,r,"g"!==i?i:null)),"text"===i){const e=Nm(o);if((0,m.kJ)(e)){const n={x:0,dy:Om(o)};for(let i=0;i<e.length;++i)t.open("tspan",i?n:null).text(zm(o,e[i])).close()}else t.text(zm(o,e))}else if("g"===i){const i=o.strokeForeground,r=o.fill,a=o.stroke;i&&a&&(o.stroke=null),t.open("path",this.attr(e,o,n.background,"bgrect")).close(),t.open("g",this.attr(e,o,n.content)),jp(o,(e=>this.mark(t,e))),t.close(),i&&a?(r&&(o.fill=null),o.stroke=a,t.open("path",this.attr(e,o,n.foreground,"bgrect")).close(),r&&(o.fill=r)):t.open("path",this.attr(e,o,n.foreground,"bgfore")).close()}t.close(),a&&t.close()};return n.nested?e.items&&e.items.length&&o(e.items[0]):jp(e,o),t.close()},href(t){const e=t.href;let n;if(e){if(n=this._hrefs&&this._hrefs[e])return n;this.sanitizeURL(e).then((t=>{t["xlink:href"]=t.href,t.href=null,(this._hrefs||(this._hrefs={}))[e]=t}))}return null},attr(t,e,n,i){const r={},o=(t,e,n,i)=>{r[i||t]=e};return Array.isArray(n)?n.forEach((t=>t(o,e,this))):n(o,e,this),i&&function(t,e,n,i,r){let o;if(null==e)return t;"bgrect"===i&&!1===n.interactive&&(t["pointer-events"]="none");if("bgfore"===i&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===i&&!1===e.smooth&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]);"text"===i&&(t["font-family"]=Rm(e),t["font-size"]=Fm(e)+"px",t["font-style"]=e.fontStyle,t["font-variant"]=e.fontVariant,t["font-weight"]=e.fontWeight);for(const a in Qg){let n=e[a];const i=Qg[a];("transparent"!==n||"fill"!==i&&"stroke"!==i)&&null!=n&&($d(n)&&(n=Vd(n,r.gradient,"")),t[i]=n)}for(const a in tv){const t=e[a];null!=t&&(o=o||[],o.push("".concat(tv[a],": ").concat(t,";")))}o&&(t.style=o.join(" "))}(r,e,t,i,this._defs),r},defs(t){const e=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(e).length+Object.keys(n).length){t.open("defs");for(const n in e){const i=e[n],r=i.stops;"radial"===i.gradient?(t.open("pattern",{id:Gd+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),t.close(),t.open("radialGradient",{id:n,fx:i.x1,fy:i.y1,fr:i.r1,cx:i.x2,cy:i.y2,r:i.r2})):t.open("linearGradient",{id:n,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2});for(let e=0;e<r.length;++e)t.open("stop",{offset:r[e].offset,"stop-color":r[e].color}).close();t.close()}for(const e in n){const i=n[e];t.open("clipPath",{id:e}),i.path?t.open("path",{d:i.path}).close():t.open("rect",{x:0,y:0,width:i.width,height:i.height}).close(),t.close()}t.close()}}});const bv="canvas",xv="none",_v={Canvas:bv,PNG:"png",SVG:"svg",None:xv},wv={};function kv(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(wv[t]=e,this):wv[t]}function Ev(t,e,n){const i=[],r=(new Gh).union(e),o=t.marktype;return o?Dv(t,r,n,i):"group"===o?Av(t,r,n,i):(0,m.vU)("Intersect scene must be mark node or group item.")}function Dv(t,e,n,i){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const r=t.items,o=t.marktype,a=r.length;let s=0;if("group"===o)for(;s<a;++s)Av(r[s],e,n,i);else for(const t=Hm[o].isect;s<a;++s){const n=r[s];Sv(n,e,t)&&i.push(n)}}return i}function Av(t,e,n,i){n&&n(t.mark)&&Sv(t,e,Hm.group.isect)&&i.push(t);const r=t.items,o=r&&r.length;if(o){const a=t.x||0,s=t.y||0;e.translate(-a,-s);for(let t=0;t<o;++t)Dv(r[t],e,n,i);e.translate(a,s)}return i}function Sv(t,e,n){const i=t.bounds;return e.encloses(i)||e.intersects(i)&&n(t,e)}wv[bv]=wv.png={renderer:Fg,headless:Fg,handler:Dg},wv.svg={renderer:rv,headless:yv,handler:Ng},wv[xv]={};const Mv=new Gh;function Cv(t){const e=t.clip;if((0,m.mf)(e))e(vp(Mv.clear()));else{if(!e)return;Mv.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(Mv)}const Fv=1e-9;function Ov(t,e,n){return t===e||("path"===n?Nv(t,e):t instanceof Date&&e instanceof Date?+t===+e:(0,m.hj)(t)&&(0,m.hj)(e)?Math.abs(t-e)<=Fv:t&&e&&((0,m.Kn)(t)||(0,m.Kn)(e))?function(t,e){var n,i,r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(r.sort(),o.sort(),i=r.length-1;i>=0;i--)if(r[i]!=o[i])return!1;for(i=r.length-1;i>=0;i--)if(!Ov(t[n=r[i]],e[n],n))return!1;return typeof t===typeof e}(t,e):t==e)}function Nv(t,e){return Ov(oh(t),oh(e))}function Tv(){Xh(),Jd=0}const zv="top",Rv="left",Pv="right",Lv="bottom",jv="top-left",Bv="top-right",Uv="bottom-left",Iv="bottom-right",qv="start",Wv="middle",Hv="end",Xv="x",Jv="y",Gv="group",$v="axis",Vv="title",Yv="frame",Kv="scope",Zv="legend",Qv="row-header",ty="row-footer",ey="row-title",ny="column-header",iy="column-footer",ry="column-title",oy="padding",ay="symbol",sy="fit",cy="fit-x",ly="fit-y",uy="pad",fy="none",dy="all",hy="each",py="flush",my="column",gy="row";function vy(t){no.call(this,null,t)}function yy(t,e,n){return e(t.bounds.clear(),t,n)}(0,m.XW)(vy,no,{transform(t,e){const n=e.dataflow,i=t.mark,r=i.marktype,o=Hm[r],a=o.bound;let s,c=i.bounds;if(o.nested)i.items.length&&n.dirty(i.items[0]),c=yy(i,a),i.items.forEach((t=>{t.bounds.clear().union(c)}));else if(r===Gv||t.modified())switch(e.visit(e.MOD,(t=>n.dirty(t))),c.clear(),i.items.forEach((t=>c.union(yy(t,a)))),i.role){case $v:case Zv:case Vv:e.reflow()}else s=e.changed(e.REM),e.visit(e.ADD,(t=>{c.union(yy(t,a))})),e.visit(e.MOD,(t=>{s=s||c.alignsWith(t.bounds),n.dirty(t),c.union(yy(t,a))})),s&&(c.clear(),i.items.forEach((t=>c.union(t.bounds))));return Cv(i),e.modifies("bounds")}});const by=":vega_identifier:";function xy(t){no.call(this,0,t)}function _y(t){no.call(this,null,t)}function wy(t){no.call(this,null,t)}xy.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},(0,m.XW)(xy,no,{transform(t,e){const n=(r=e.dataflow)._signals[by]||(r._signals[by]=r.add(0)),i=t.as;var r;let o=n.value;return e.visit(e.ADD,(t=>t[i]=t[i]||++o)),n.set(this.value=o),e}}),(0,m.XW)(_y,no,{transform(t,e){let n=this.value;n||(n=e.dataflow.scenegraph().mark(t.markdef,function(t){const e=t.groups,n=t.parent;return e&&1===e.size?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}(t),t.index),n.group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);const i=n.marktype===Gv?Vh:$h;return e.visit(e.ADD,(t=>i.call(t,n))),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e}});const ky={parity:t=>t.filter(((t,e)=>e%2?t.opacity=0:1)),greedy:(t,e)=>{let n;return t.filter(((t,i)=>i&&Ey(n.bounds,t.bounds,e)?t.opacity=0:(n=t,1)))}},Ey=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2),Dy=(t,e)=>{for(var n,i=1,r=t.length,o=t[0].bounds;i<r;o=n,++i)if(Ey(o,n=t[i].bounds,e))return!0},Ay=t=>{const e=t.bounds;return e.width()>1&&e.height()>1},Sy=t=>(t.forEach((t=>t.opacity=1)),t),My=(t,e)=>t.reflow(e.modified()).modifies("opacity");function Cy(t){no.call(this,null,t)}(0,m.XW)(wy,no,{transform(t,e){const n=ky[t.method]||ky.parity,i=t.separation||0;let r,o,a=e.materialize(e.SOURCE).source;if(!a||!a.length)return;if(!t.method)return t.modified("method")&&(Sy(a),e=My(e,t)),e;if(a=a.filter(Ay),!a.length)return;if(t.sort&&(a=a.slice().sort(t.sort)),r=Sy(a),e=My(e,t),r.length>=3&&Dy(r,i)){do{r=n(r,i)}while(r.length>=3&&Dy(r,i));r.length<3&&!(0,m.fj)(a).opacity&&(r.length>1&&((0,m.fj)(r).opacity=0),(0,m.fj)(a).opacity=1)}t.boundScale&&t.boundTolerance>=0&&(o=((t,e,n)=>{var i=t.range(),r=new Gh;return e===zv||e===Lv?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),t=>r.encloses(t.bounds)})(t.boundScale,t.boundOrient,+t.boundTolerance),a.forEach((t=>{o(t)||(t.opacity=0)})));const s=r[0].mark.bounds.clear();return a.forEach((t=>{t.opacity&&s.union(t.bounds)})),e}}),(0,m.XW)(Cy,no,{transform(t,e){const n=e.dataflow;if(e.visit(e.ALL,(t=>n.dirty(t))),e.fields&&e.fields.zindex){const t=e.source&&e.source[0];t&&(t.mark.zdirty=!0)}}});const Fy=new Gh;function Oy(t,e,n){return t[e]===n?0:(t[e]=n,1)}function Ny(t){var e=t.items[0].orient;return e===Rv||e===Pv}function Ty(t,e,n,i){var r,o,a=e.items[0],s=a.datum,c=null!=a.translate?a.translate:.5,l=a.orient,u=function(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}(s),f=a.range,d=a.offset,h=a.position,p=a.minExtent,m=a.maxExtent,g=s.title&&a.items[u[2]].items[0],v=a.titlePadding,y=a.bounds,b=g&&Tm(g),x=0,_=0;switch(Fy.clear().union(y),y.clear(),(r=u[0])>-1&&y.union(a.items[r].bounds),(r=u[1])>-1&&y.union(a.items[r].bounds),l){case zv:x=h||0,_=-d,o=Math.max(p,Math.min(m,-y.y1)),y.add(0,-o).add(f,0),g&&zy(t,g,o,v,b,0,-1,y);break;case Rv:x=-d,_=h||0,o=Math.max(p,Math.min(m,-y.x1)),y.add(-o,0).add(0,f),g&&zy(t,g,o,v,b,1,-1,y);break;case Pv:x=n+d,_=h||0,o=Math.max(p,Math.min(m,y.x2)),y.add(0,0).add(o,f),g&&zy(t,g,o,v,b,1,1,y);break;case Lv:x=h||0,_=i+d,o=Math.max(p,Math.min(m,y.y2)),y.add(0,0).add(f,o),g&&zy(t,g,o,v,0,0,1,y);break;default:x=a.x,_=a.y}return Qh(y.translate(x,_),a),Oy(a,"x",x+c)|Oy(a,"y",_+c)&&(a.bounds=Fy,t.dirty(a),a.bounds=y,t.dirty(a)),a.mark.bounds.clear().union(y)}function zy(t,e,n,i,r,o,a,s){const c=e.bounds;if(e.auto){const s=a*(n+r+i);let l=0,u=0;t.dirty(e),o?l=(e.x||0)-(e.x=s):u=(e.y||0)-(e.y=s),e.mark.bounds.clear().union(c.translate(-l,-u)),t.dirty(e)}s.union(c)}const Ry=(t,e)=>Math.floor(Math.min(t,e)),Py=(t,e)=>Math.ceil(Math.max(t,e));function Ly(t){return(new Gh).set(0,0,t.width||0,t.height||0)}function jy(t){const e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function By(t,e,n){const i=(0,m.Kn)(t)?t[e]:t;return null!=i?i:void 0!==n?n:0}function Uy(t){return t<0?Math.ceil(-t):0}function Iy(t,e,n){var i,r,o,a,s,c,l,u,f,d,h,p=!n.nodirty,m=n.bounds===py?Ly:jy,g=Fy.set(0,0,0,0),v=By(n.align,my),y=By(n.align,gy),b=By(n.padding,my),x=By(n.padding,gy),_=n.columns||e.length,w=_<=0?1:Math.ceil(e.length/_),k=e.length,E=Array(k),D=Array(_),A=0,S=Array(k),M=Array(w),C=0,F=Array(k),O=Array(k),N=Array(k);for(r=0;r<_;++r)D[r]=0;for(r=0;r<w;++r)M[r]=0;for(r=0;r<k;++r)c=e[r],s=N[r]=m(c),c.x=c.x||0,F[r]=0,c.y=c.y||0,O[r]=0,o=r%_,a=~~(r/_),A=Math.max(A,l=Math.ceil(s.x2)),C=Math.max(C,u=Math.ceil(s.y2)),D[o]=Math.max(D[o],l),M[a]=Math.max(M[a],u),E[r]=b+Uy(s.x1),S[r]=x+Uy(s.y1),p&&t.dirty(e[r]);for(r=0;r<k;++r)r%_===0&&(E[r]=0),r<_&&(S[r]=0);if(v===hy)for(o=1;o<_;++o){for(h=0,r=o;r<k;r+=_)h<E[r]&&(h=E[r]);for(r=o;r<k;r+=_)E[r]=h+D[o-1]}else if(v===dy){for(h=0,r=0;r<k;++r)r%_&&h<E[r]&&(h=E[r]);for(r=0;r<k;++r)r%_&&(E[r]=h+A)}else for(v=!1,o=1;o<_;++o)for(r=o;r<k;r+=_)E[r]+=D[o-1];if(y===hy)for(a=1;a<w;++a){for(h=0,i=(r=a*_)+_;r<i;++r)h<S[r]&&(h=S[r]);for(r=a*_;r<i;++r)S[r]=h+M[a-1]}else if(y===dy){for(h=0,r=_;r<k;++r)h<S[r]&&(h=S[r]);for(r=_;r<k;++r)S[r]=h+C}else for(y=!1,a=1;a<w;++a)for(i=(r=a*_)+_;r<i;++r)S[r]+=M[a-1];for(f=0,r=0;r<k;++r)f=E[r]+(r%_?f:0),F[r]+=f-e[r].x;for(o=0;o<_;++o)for(d=0,r=o;r<k;r+=_)d+=S[r],O[r]+=d-e[r].y;if(v&&By(n.center,my)&&w>1)for(r=0;r<k;++r)(f=(s=v===dy?A:D[r%_])-N[r].x2-e[r].x-F[r])>0&&(F[r]+=f/2);if(y&&By(n.center,gy)&&1!==_)for(r=0;r<k;++r)(d=(s=y===dy?C:M[~~(r/_)])-N[r].y2-e[r].y-O[r])>0&&(O[r]+=d/2);for(r=0;r<k;++r)g.union(N[r].translate(F[r],O[r]));switch(f=By(n.anchor,Xv),d=By(n.anchor,Jv),By(n.anchor,my)){case Hv:f-=g.width();break;case Wv:f-=g.width()/2}switch(By(n.anchor,gy)){case Hv:d-=g.height();break;case Wv:d-=g.height()/2}for(f=Math.round(f),d=Math.round(d),g.clear(),r=0;r<k;++r)e[r].mark.bounds.clear();for(r=0;r<k;++r)(c=e[r]).x+=F[r]+=f,c.y+=O[r]+=d,g.union(c.mark.bounds.union(c.bounds.translate(F[r],O[r]))),p&&t.dirty(c);return g}function qy(t,e,n){var i,r,o,a,s,c,l,u=function(t){var e,n,i=t.items,r=i.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o<r;++o)if(n=(e=i[o]).items,e.marktype===Gv)switch(e.role){case $v:case Zv:case Vv:break;case Qv:a.rowheaders.push(...n);break;case ty:a.rowfooters.push(...n);break;case ny:a.colheaders.push(...n);break;case iy:a.colfooters.push(...n);break;case ey:a.rowtitle=n[0];break;case ry:a.coltitle=n[0];break;default:a.marks.push(...n)}return a}(e),f=u.marks,d=n.bounds===py?Wy:Hy,h=n.offset,p=n.columns||f.length,m=p<=0?1:Math.ceil(f.length/p),g=m*p;const v=Iy(t,f,n);v.empty()&&v.set(0,0,0,0),u.rowheaders&&(c=By(n.headerBand,gy,null),i=Xy(t,u.rowheaders,f,p,m,-By(h,"rowHeader"),Ry,0,d,"x1",0,p,1,c)),u.colheaders&&(c=By(n.headerBand,my,null),r=Xy(t,u.colheaders,f,p,p,-By(h,"columnHeader"),Ry,1,d,"y1",0,1,p,c)),u.rowfooters&&(c=By(n.footerBand,gy,null),o=Xy(t,u.rowfooters,f,p,m,By(h,"rowFooter"),Py,0,d,"x2",p-1,p,1,c)),u.colfooters&&(c=By(n.footerBand,my,null),a=Xy(t,u.colfooters,f,p,p,By(h,"columnFooter"),Py,1,d,"y2",g-p,1,p,c)),u.rowtitle&&(s=By(n.titleAnchor,gy),l=By(h,"rowTitle"),l=s===Hv?o+l:i-l,c=By(n.titleBand,gy,.5),Jy(t,u.rowtitle,l,0,v,c)),u.coltitle&&(s=By(n.titleAnchor,my),l=By(h,"columnTitle"),l=s===Hv?a+l:r-l,c=By(n.titleBand,my,.5),Jy(t,u.coltitle,l,1,v,c))}function Wy(t,e){return"x1"===e?t.x||0:"y1"===e?t.y||0:"x2"===e?(t.x||0)+(t.width||0):"y2"===e?(t.y||0)+(t.height||0):void 0}function Hy(t,e){return t.bounds[e]}function Xy(t,e,n,i,r,o,a,s,c,l,u,f,d,h){var p,m,g,v,y,b,x,_,w,k=n.length,E=0,D=0;if(!k)return E;for(p=u;p<k;p+=f)n[p]&&(E=a(E,c(n[p],l)));if(!e.length)return E;for(e.length>r&&(t.warn("Grid headers exceed limit: "+r),e=e.slice(0,r)),E+=o,m=0,v=e.length;m<v;++m)t.dirty(e[m]),e[m].mark.bounds.clear();for(p=u,m=0,v=e.length;m<v;++m,p+=f){for(y=(b=e[m]).mark.bounds,g=p;g>=0&&null==(x=n[g]);g-=d);s?(_=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),w=E):(_=E,w=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),y.union(b.bounds.translate(_-(b.x||0),w-(b.y||0))),b.x=_,b.y=w,t.dirty(b),D=a(D,y[l])}return D}function Jy(t,e,n,i,r,o){if(e){t.dirty(e);var a=n,s=n;i?a=Math.round(r.x1+o*r.width()):s=Math.round(r.y1+o*r.height()),e.bounds.translate(a-(e.x||0),s-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=a,e.y=s,t.dirty(e)}}function Gy(t,e,n,i,r,o,a){const s=function(t,e){const n=t[e]||{};return(e,i)=>null!=n[e]?n[e]:null!=t[e]?t[e]:i}(n,e),c=function(t,e){let n=-1/0;return t.forEach((t=>{null!=t.offset&&(n=Math.max(n,t.offset))})),n>-1/0?n:e}(t,s("offset",0)),l=s("anchor",qv),u=l===Hv?1:l===Wv?.5:0,f={align:hy,bounds:s("bounds",py),columns:"vertical"===s("direction")?1:t.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(e){case Rv:f.anchor={x:Math.floor(i.x1)-c,column:Hv,y:u*(a||i.height()+2*i.y1),row:l};break;case Pv:f.anchor={x:Math.ceil(i.x2)+c,y:u*(a||i.height()+2*i.y1),row:l};break;case zv:f.anchor={y:Math.floor(r.y1)-c,row:Hv,x:u*(o||r.width()+2*r.x1),column:l};break;case Lv:f.anchor={y:Math.ceil(r.y2)+c,x:u*(o||r.width()+2*r.x1),column:l};break;case jv:f.anchor={x:c,y:c};break;case Bv:f.anchor={x:o-c,y:c,column:Hv};break;case Uv:f.anchor={x:c,y:a-c,row:Hv};break;case Iv:f.anchor={x:o-c,y:a-c,column:Hv,row:Hv}}return f}function $y(t,e){var n,i,r=e.items[0],o=r.datum,a=r.orient,s=r.bounds,c=r.x,l=r.y;return r._bounds?r._bounds.clear().union(s):r._bounds=s.clone(),s.clear(),function(t,e,n){var i=e.padding,r=i-n.x,o=i-n.y;if(e.datum.title){var a=e.items[1].items[0],s=a.anchor,c=e.titlePadding||0,l=i-a.x,u=i-a.y;switch(a.orient){case Rv:r+=Math.ceil(a.bounds.width())+c;break;case Pv:case Lv:break;default:o+=a.bounds.height()+c}switch((r||o)&&Yy(t,n,r,o),a.orient){case Rv:u+=Vy(e,n,a,s,1,1);break;case Pv:l+=Vy(e,n,a,Hv,0,0)+c,u+=Vy(e,n,a,s,1,1);break;case Lv:l+=Vy(e,n,a,s,0,0),u+=Vy(e,n,a,Hv,-1,0,1)+c;break;default:l+=Vy(e,n,a,s,0,0)}(l||u)&&Yy(t,a,l,u),(l=Math.round(a.bounds.x1-i))<0&&(Yy(t,n,-l,0),Yy(t,a,-l,0))}else(r||o)&&Yy(t,n,r,o)}(t,r,r.items[0].items[0]),s=function(t,e){return t.items.forEach((t=>e.union(t.bounds))),e.x1=t.padding,e.y1=t.padding,e}(r,s),n=2*r.padding,i=2*r.padding,s.empty()||(n=Math.ceil(s.width()+n),i=Math.ceil(s.height()+i)),o.type===ay&&function(t){const e=t.reduce(((t,e)=>(t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0),t)),{});t.forEach((t=>{t.width=e[t.column],t.height=t.bounds.y2-t.y}))}(r.items[0].items[0].items[0].items),a!==fy&&(r.x=c=0,r.y=l=0),r.width=n,r.height=i,Qh(s.set(c,l,c+n,l+i),r),r.mark.bounds.clear().union(s),r}function Vy(t,e,n,i,r,o,a){const s="symbol"!==t.datum.type,c=n.datum.vgrad,l=(!s||!o&&c||a?e:e.items[0]).bounds[r?"y2":"x2"]-t.padding,u=c&&o?l:0,f=c&&o?0:l,d=r<=0?0:Tm(n);return Math.round(i===qv?u:i===Hv?f-d:.5*(l-d))}function Yy(t,e,n,i){e.x+=n,e.y+=i,e.bounds.translate(n,i),e.mark.bounds.translate(n,i),t.dirty(e)}function Ky(t){no.call(this,null,t)}function Zy(t,e){let n=0;if(void 0===e)for(let i of t)(i=+i)&&(n+=i);else{let i=-1;for(let r of t)(r=+e(r,++i,t))&&(n+=r)}return n}function Qy(t){no.call(this,null,t)}function tb(t){no.call(this,null,t)}function eb(){return Dr({})}function nb(t){no.call(this,null,t)}function ib(t){no.call(this,[],t)}(0,m.XW)(Ky,no,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach((e=>{t.layout&&qy(n,e,t.layout),function(t,e,n){var i,r,o,a,s,c=e.items,l=Math.max(0,e.width||0),u=Math.max(0,e.height||0),f=(new Gh).set(0,0,l,u),d=f.clone(),h=f.clone(),p=[];for(a=0,s=c.length;a<s;++a)switch((r=c[a]).role){case $v:(Ny(r)?d:h).union(Ty(t,r,l,u));break;case Vv:i=r;break;case Zv:p.push($y(t,r));break;case Yv:case Kv:case Qv:case ty:case ey:case ny:case iy:case ry:d.union(r.bounds),h.union(r.bounds);break;default:f.union(r.bounds)}if(p.length){const e={};p.forEach((t=>{(o=t.orient||Pv)!==fy&&(e[o]||(e[o]=[])).push(t)}));for(const i in e){const r=e[i];Iy(t,r,Gy(r,i,n.legends,d,h,l,u))}p.forEach((e=>{const i=e.bounds;if(i.equals(e._bounds)||(e.bounds=e._bounds,t.dirty(e),e.bounds=i,t.dirty(e)),!n.autosize||n.autosize.type!==sy&&n.autosize.type!==cy&&n.autosize.type!==ly)f.union(i);else switch(e.orient){case Rv:case Pv:f.add(i.x1,0).add(i.x2,0);break;case zv:case Lv:f.add(0,i.y1).add(0,i.y2)}}))}f.union(d).union(h),i&&f.union(function(t,e,n,i,r){var o,a=e.items[0],s=a.frame,c=a.orient,l=a.anchor,u=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=c===Rv||c===Pv?i:n,m=0,g=0,v=0,y=0,b=0;if(s!==Gv?c===Rv?(m=r.y2,p=r.y1):c===Pv?(m=r.y1,p=r.y2):(m=r.x1,p=r.x2):c===Rv&&(m=i,p=0),o=l===qv?m:l===Hv?p:(m+p)/2,h&&h.text){switch(c){case zv:case Lv:b=d.bounds.height()+f;break;case Rv:y=d.bounds.width()+f;break;case Pv:y=-d.bounds.width()-f}Fy.clear().union(h.bounds),Fy.translate(y-(h.x||0),b-(h.y||0)),Oy(h,"x",y)|Oy(h,"y",b)&&(t.dirty(h),h.bounds.clear().union(Fy),h.mark.bounds.clear().union(Fy),t.dirty(h)),Fy.clear().union(h.bounds)}else Fy.clear();switch(Fy.union(d.bounds),c){case zv:g=o,v=r.y1-Fy.height()-u;break;case Rv:g=r.x1-Fy.width()-u,v=o;break;case Pv:g=r.x2+Fy.width()+u,v=o;break;case Lv:g=o,v=r.y2+u;break;default:g=a.x,v=a.y}return Oy(a,"x",g)|Oy(a,"y",v)&&(Fy.translate(g,v),t.dirty(a),a.bounds.clear().union(Fy),e.bounds.clear().union(Fy),t.dirty(a)),a.bounds}(t,i,l,u,f));e.clip&&f.set(0,0,e.width||0,e.height||0);!function(t,e,n,i){const r=i.autosize||{},o=r.type;if(t._autosize<1||!o)return;let a=t._width,s=t._height,c=Math.max(0,e.width||0),l=Math.max(0,Math.ceil(-n.x1)),u=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-c)),h=Math.max(0,Math.ceil(n.y2-u));if(r.contains===oy){const e=t.padding();a-=e.left+e.right,s-=e.top+e.bottom}o===fy?(l=0,f=0,c=a,u=s):o===sy?(c=Math.max(0,a-l-d),u=Math.max(0,s-f-h)):o===cy?(c=Math.max(0,a-l-d),s=u+f+h):o===ly?(a=c+l+d,u=Math.max(0,s-f-h)):o===uy&&(a=c+l+d,s=u+f+h);t._resizeView(a,s,c,u,[l,f],r.resize)}(t,e,f,n)}(n,e,t)})),function(t){return t&&"legend-entry"!==t.mark.role}(t.mark.group)?e.reflow():e}}),(0,m.XW)(Qy,no,{transform(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=this.value,o=t.scale,a=Cd(o,null==t.count?t.values?t.values.length:10:t.count,t.minstep),s=t.format||Nd(n,o,a,t.formatSpecifier,t.formatType,!!t.values),c=t.values?Fd(o,t.values,a):Od(o,a);return r&&(i.rem=r),r=c.map(((t,e)=>Dr({index:e/(c.length-1||1),value:t,label:s(t)}))),t.extra&&r.length&&r.push(Dr({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}}),(0,m.XW)(tb,no,{transform(t,e){var n=e.dataflow,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.item||eb,o=t.key||kr,a=this.value;return(0,m.kJ)(i.encode)&&(i.encode=null),a&&(t.modified("key")||e.modified(o))&&(0,m.vU)("DataJoin does not support modified key function or fields."),a||(e=e.addAll(),this.value=a=function(t){const e=(0,m.Xr)().test((t=>t.exit));return e.lookup=n=>e.get(t(n)),e}(o)),e.visit(e.ADD,(t=>{const e=o(t);let n=a.get(e);n?n.exit?(a.empty--,i.add.push(n)):i.mod.push(n):(n=r(t),a.set(e,n),i.add.push(n)),n.datum=t,n.exit=!1})),e.visit(e.MOD,(t=>{const e=o(t),n=a.get(e);n&&(n.datum=t,i.mod.push(n))})),e.visit(e.REM,(t=>{const e=o(t),n=a.get(e);t!==n.datum||n.exit||(i.rem.push(n),n.exit=!0,++a.empty)})),e.changed(e.ADD_MOD)&&i.modifies("datum"),(e.clean()||t.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),i}}),(0,m.XW)(nb,no,{transform(t,e){var n=e.fork(e.ADD_REM),i=t.mod||!1,r=t.encoders,o=e.encode;if((0,m.kJ)(o)){if(!n.changed()&&!o.every((t=>r[t])))return e.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=r.update||m.k,c=r.enter||m.k,l=r.exit||m.k,u=(o&&!a?r[o]:s)||m.k;if(e.changed(e.ADD)&&(e.visit(e.ADD,(e=>{c(e,t),s(e,t)})),n.modifies(c.output),n.modifies(s.output),u!==m.k&&u!==s&&(e.visit(e.ADD,(e=>{u(e,t)})),n.modifies(u.output))),e.changed(e.REM)&&l!==m.k&&(e.visit(e.REM,(e=>{l(e,t)})),n.modifies(l.output)),a||u!==m.k){const r=e.MOD|(t.modified()?e.REFLOW:0);a?(e.visit(r,(e=>{const r=c(e,t)||i;(u(e,t)||r)&&n.mod.push(e)})),n.mod.length&&n.modifies(c.output)):e.visit(r,(e=>{(u(e,t)||i)&&n.mod.push(e)})),n.mod.length&&n.modifies(u.output)}return n.changed()?n:e.StopPropagation}}),(0,m.XW)(ib,no,{transform(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n,i,r,o,a,s=e.dataflow.locale(),c=e.fork(e.NO_SOURCE|e.NO_FIELDS),l=this.value,u=t.type||Ed,f=t.scale,d=+t.limit,h=Cd(f,null==t.count?5:t.count,t.minstep),p=!!t.values||u===Ed,g=t.format||jd(s,f,h,u,t.formatSpecifier,t.formatType,p),v=t.values||Pd(f,h);return l&&(c.rem=l),u===Ed?(d&&v.length>d?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=v.slice(0,d-1),a=!0):l=v,(0,m.mf)(r=t.size)?(t.values||0!==f(l[0])||(l=l.slice(1)),o=l.reduce(((e,n)=>Math.max(e,r(n,t))),0)):r=(0,m.a9)(o=r||8),l=l.map(((e,n)=>Dr({index:n,label:g(e,n,l),value:e,offset:o,size:r(e,t)}))),a&&(a=v[l.length],l.push(Dr({index:l.length,label:"\u2026".concat(v.length-l.length," entries"),value:a,offset:o,size:r(a,t)})))):"gradient"===u?(n=f.domain(),i=yd(f,n[0],(0,m.fj)(n)),v.length<3&&!t.values&&n[0]!==(0,m.fj)(n)&&(v=[n[0],(0,m.fj)(n)]),l=v.map(((t,e)=>Dr({index:e,label:g(t,e,v),value:t,perc:i(t)})))):(r=v.length-1,i=function(t){const e=t.domain(),n=e.length-1;let i=+e[0],r=+(0,m.fj)(e),o=r-i;if(t.type===qf){const t=n?o/n:.1;i-=t,r+=t,o=r-i}return t=>(t-i)/o}(f),l=v.map(((t,e)=>Dr({index:e,label:g(t,e,v),value:t,perc:e?i(t):0,perc2:e===r?1:i(v[e+1])})))),c.source=l,c.add=l,this.value=l,c}});const rb=t=>t.source.x,ob=t=>t.source.y,ab=t=>t.target.x,sb=t=>t.target.y;function cb(t){no.call(this,{},t)}cb.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},(0,m.XW)(cb,no,{transform(t,e){var n=t.sourceX||rb,i=t.sourceY||ob,r=t.targetX||ab,o=t.targetY||sb,a=t.as||"path",s=t.orient||"vertical",c=t.shape||"line",l=db.get(c+"-"+s)||db.get(c);return l||(0,m.vU)("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,(t=>{t[a]=l(n(t),i(t),r(t),o(t))})),e.reflow(t.modified()).modifies(a)}});const lb=(t,e,n,i)=>"M"+t+","+e+"L"+n+","+i,ub=(t,e,n,i)=>{var r=n-t,o=i-e,a=Math.hypot(r,o)/2;return"M"+t+","+e+"A"+a+","+a+" "+180*Math.atan2(o,r)/Math.PI+" 0 1 "+n+","+i},fb=(t,e,n,i)=>{const r=n-t,o=i-e,a=.2*(r+o),s=.2*(o-r);return"M"+t+","+e+"C"+(t+a)+","+(e+s)+" "+(n+s)+","+(i-a)+" "+n+","+i},db=(0,m.Xr)({line:lb,"line-radial":(t,e,n,i)=>lb(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n)),arc:ub,"arc-radial":(t,e,n,i)=>ub(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n)),curve:fb,"curve-radial":(t,e,n,i)=>fb(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(t,e,n,i)=>"M"+t+","+e+"V"+i+"H"+n,"orthogonal-vertical":(t,e,n,i)=>"M"+t+","+e+"H"+n+"V"+i,"orthogonal-radial":(t,e,n,i)=>{const r=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n);return"M"+e*r+","+e*o+"A"+e+","+e+" 0 0,"+((Math.abs(n-t)>Math.PI?n<=t:n>t)?1:0)+" "+e*a+","+e*s+"L"+i*a+","+i*s},"diagonal-horizontal":(t,e,n,i)=>{const r=(t+n)/2;return"M"+t+","+e+"C"+r+","+e+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(t,e,n,i)=>{const r=(e+i)/2;return"M"+t+","+e+"C"+t+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(t,e,n,i)=>{const r=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n),c=(e+i)/2;return"M"+e*r+","+e*o+"C"+c*r+","+c*o+" "+c*a+","+c*s+" "+i*a+","+i*s}});function hb(t){no.call(this,null,t)}hb.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},(0,m.XW)(hb,no,{transform(t,e){var n,i,r,o=t.as||["startAngle","endAngle"],a=o[0],s=o[1],c=t.field||m.kX,l=t.startAngle||0,u=null!=t.endAngle?t.endAngle:2*Math.PI,f=e.source,d=f.map(c),h=d.length,p=l,g=(u-l)/Zy(d),v=pa(h);for(t.sort&&v.sort(((t,e)=>d[t]-d[e])),n=0;n<h;++n)r=d[v[n]],(i=f[v[n]])[a]=p,i[s]=p+=r*g;return this.value=d,e.reflow(t.modified()).modifies(o)}});const pb=5;function mb(t){return cd(t)&&t!==jf}const gb=(0,m.Rg)(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function vb(t){no.call(this,null,t),this.modified(!0)}function yb(t,e,n){if(fd(t)){var i=Math.abs(e.reduce(((t,e)=>t+(e<0?-1:e>0?1:0)),0));i!==e.length&&n.warn("Log scale domain includes zero: "+(0,m.m8)(e))}return e}function bb(t,e,n){return(0,m.mf)(t)&&(e||n)?md(t,xb(e||[0,1],n)):t}function xb(t,e){return e?t.slice().reverse():t}function _b(t){no.call(this,null,t)}(0,m.XW)(vb,no,{transform(t,e){var n=e.dataflow,i=this.value,r=function(t){var e,n=t.type,i="";if(n===jf)return jf+"-"+Of;(function(t){const e=t.type;return cd(e)&&e!==Pf&&e!==Lf&&(t.scheme||t.range&&t.range.length&&t.range.every(m.HD))})(t)&&(i=2===(e=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(null!=t.domainMid):0)?jf+"-":3===e?Bf+"-":"");return(i+n||Of).toLowerCase()}(t);for(r in i&&r===i.type||(this.value=i=od(r)()),t)if(!gb[r]){if("padding"===r&&mb(i.type))continue;(0,m.mf)(i[r])?i[r](t[r]):n.warn("Unsupported scale property: "+r)}return function(t,e,n){var i=t.type,r=e.round||!1,o=e.range;if(null!=e.rangeStep)o=function(t,e,n){t!==Xf&&t!==Hf&&(0,m.vU)("Only band and point scales support rangeStep.");var i=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,r=t===Hf?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*Ff(n,r,i)]}(i,e,n);else if(e.scheme&&(o=function(t,e,n){var i,r=e.schemeExtent;(0,m.kJ)(e.scheme)?i=gd(e.scheme,e.interpolate,e.interpolateGamma):(i=kd(e.scheme.toLowerCase()))||(0,m.vU)("Unrecognized scheme name: ".concat(e.scheme));return n=t===qf?n+1:t===Jf?n-1:t===Uf||t===If?+e.schemeCount||pb:n,dd(t)?bb(i,r,e.reverse):(0,m.mf)(i)?vd(bb(i,r),n):t===Wf?i:i.slice(0,n)}(i,e,n),(0,m.mf)(o))){if(t.interpolator)return t.interpolator(o);(0,m.vU)("Scale type ".concat(i," does not support interpolating color schemes."))}if(o&&dd(i))return t.interpolator(gd(xb(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(bd(e.interpolate,e.interpolateGamma)):(0,m.mf)(t.round)?t.round(r):(0,m.mf)(t.rangeRound)&&t.interpolate(r?zl:Tl);o&&t.range(xb(o,e.reverse))}(i,t,function(t,e,n){let i=e.bins;if(i&&!(0,m.kJ)(i)){const e=t.domain(),n=e[0],r=(0,m.fj)(e),o=i.step;let a=null==i.start?n:i.start,s=null==i.stop?r:i.stop;o||(0,m.vU)("Scale bins parameter missing step property."),a<n&&(a=o*Math.ceil(n/o)),s>r&&(s=o*Math.floor(r/o)),i=pa(a,s+o/2,o)}i?t.bins=i:t.bins&&delete t.bins;t.type===Jf&&(i?e.domain||e.domainRaw||(t.domain(i),n=i.length):t.bins=t.domain());return n}(i,t,function(t,e,n){const i=function(t,e,n){return e?(t.domain(yb(t.type,e,n)),e.length):-1}(t,e.domainRaw,n);if(i>-1)return i;var r,o,a=e.domain,s=t.type,c=e.zero||void 0===e.zero&&function(t){const e=t.type;return!t.bins&&(e===Of||e===Tf||e===zf)}(t);if(!a)return 0;mb(s)&&e.padding&&a[0]!==(0,m.fj)(a)&&(a=function(t,e,n,i,r,o){var a=Math.abs((0,m.fj)(n)-n[0]),s=a/(a-2*i),c=t===Nf?(0,m.dH)(e,null,s):t===zf?(0,m.mK)(e,null,s,.5):t===Tf?(0,m.mK)(e,null,s,r||1):t===Rf?(0,m.bV)(e,null,s,o||1):(0,m.ay)(e,null,s);return e=e.slice(),e[0]=c[0],e[e.length-1]=c[1],e}(s,a,e.range,e.padding,e.exponent,e.constant));if((c||null!=e.domainMin||null!=e.domainMax||null!=e.domainMid)&&(r=(a=a.slice()).length-1||1,c&&(a[0]>0&&(a[0]=0),a[r]<0&&(a[r]=0)),null!=e.domainMin&&(a[0]=e.domainMin),null!=e.domainMax&&(a[r]=e.domainMax),null!=e.domainMid)){const t=(o=e.domainMid)>a[r]?r+1:o<a[0]?0:r;t!==r&&n.warn("Scale domainMid exceeds domain min or max.",o),a.splice(t,0,o)}t.domain(yb(s,a,n)),s===Wf&&t.unknown(e.domainImplicit?Ou:void 0);e.nice&&t.nice&&t.nice(!0!==e.nice&&Cd(t,e.nice)||null);return a.length}(i,t,n))),e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),(0,m.XW)(_b,no,{transform(t,e){const n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");return n&&e.source.sort(Cr(t.sort)),this.modified(n),e}});const wb="zero",kb="center",Eb="normalize",Db=["y0","y1"];function Ab(t){no.call(this,null,t)}function Sb(t,e,n,i,r){for(var o,a=(e-t.sum)/2,s=t.length,c=0;c<s;++c)(o=t[c])[i]=a,o[r]=a+=Math.abs(n(o))}function Mb(t,e,n,i,r){for(var o,a=1/t.sum,s=0,c=t.length,l=0,u=0;l<c;++l)(o=t[l])[i]=s,o[r]=s=a*(u+=Math.abs(n(o)))}function Cb(t,e,n,i,r){for(var o,a,s=0,c=0,l=t.length,u=0;u<l;++u)(o=+n(a=t[u]))<0?(a[i]=c,a[r]=c+=o):(a[i]=s,a[r]=s+=o)}Ab.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:wb,values:[wb,kb,Eb]},{name:"as",type:"string",array:!0,length:2,default:Db}]},(0,m.XW)(Ab,no,{transform(t,e){var n,i,r,o,a=t.as||Db,s=a[0],c=a[1],l=Cr(t.sort),u=t.field||m.kX,f=t.offset===kb?Sb:t.offset===Eb?Mb:Cb;for(n=function(t,e,n,i){var r,o,a,s,c,l,u,f,d,h=[],p=t=>t(c);if(null==e)h.push(t.slice());else for(r={},o=0,a=t.length;o<a;++o)c=t[o],(u=r[l=e.map(p)])||(r[l]=u=[],h.push(u)),u.push(c);for(l=0,d=0,s=h.length;l<s;++l){for(o=0,f=0,a=(u=h[l]).length;o<a;++o)f+=Math.abs(i(u[o]));u.sum=f,f>d&&(d=f),n&&u.sort(n)}return h.max=d,h}(e.source,t.groupby,l,u),i=0,r=n.length,o=n.max;i<r;++i)f(n[i],o,u,s,c);return e.reflow(t.modified()).modifies(a)}});const Fb=t=>t;function Ob(t,e){t&&Tb.hasOwnProperty(t.type)&&Tb[t.type](t,e)}var Nb={Feature:function(t,e){Ob(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)Ob(n[i].geometry,e)}},Tb={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){zb(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)zb(n[i],e,0)},Polygon:function(t,e){Rb(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)Rb(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)Ob(n[i],e)}};function zb(t,e,n){var i,r=-1,o=t.length-n;for(e.lineStart();++r<o;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function Rb(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)zb(t[n],e,1);e.polygonEnd()}function Pb(t,e){t&&Nb.hasOwnProperty(t.type)?Nb[t.type](t,e):Ob(t,e)}class Lb{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],o=t+r,a=Math.abs(t)<Math.abs(r)?t-(o-r):r-(o-t);a&&(e[n++]=a),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,i,r=this._n,o=0;if(r>0){for(o=t[--r];r>0&&(e=o,n=t[--r],o=e+n,i=n-(o-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=o+n,n==e-o&&(o=e))}return o}}var jb=1e-6,Bb=1e-12,Ub=Math.PI,Ib=Ub/2,qb=Ub/4,Wb=2*Ub,Hb=180/Ub,Xb=Ub/180,Jb=Math.abs,Gb=Math.atan,$b=Math.atan2,Vb=Math.cos,Yb=Math.ceil,Kb=Math.exp,Zb=(Math.floor,Math.hypot),Qb=Math.log,tx=Math.pow,ex=Math.sin,nx=Math.sign||function(t){return t>0?1:t<0?-1:0},ix=Math.sqrt,rx=Math.tan;function ox(t){return t>1?0:t<-1?Ub:Math.acos(t)}function ax(t){return t>1?Ib:t<-1?-Ib:Math.asin(t)}function sx(){}var cx,lx,ux,fx,dx=new Lb,hx=new Lb,px={point:sx,lineStart:sx,lineEnd:sx,polygonStart:function(){px.lineStart=mx,px.lineEnd=yx},polygonEnd:function(){px.lineStart=px.lineEnd=px.point=sx,dx.add(Jb(hx)),hx=new Lb},result:function(){var t=dx/2;return dx=new Lb,t}};function mx(){px.point=gx}function gx(t,e){px.point=vx,cx=ux=t,lx=fx=e}function vx(t,e){hx.add(fx*t-ux*e),ux=t,fx=e}function yx(){vx(cx,lx)}const bx=px;var xx=1/0,_x=xx,wx=-xx,kx=wx,Ex={point:function(t,e){t<xx&&(xx=t);t>wx&&(wx=t);e<_x&&(_x=e);e>kx&&(kx=e)},lineStart:sx,lineEnd:sx,polygonStart:sx,polygonEnd:sx,result:function(){var t=[[xx,_x],[wx,kx]];return wx=kx=-(_x=xx=1/0),t}};const Dx=Ex;var Ax,Sx,Mx,Cx,Fx=0,Ox=0,Nx=0,Tx=0,zx=0,Rx=0,Px=0,Lx=0,jx=0,Bx={point:Ux,lineStart:Ix,lineEnd:Hx,polygonStart:function(){Bx.lineStart=Xx,Bx.lineEnd=Jx},polygonEnd:function(){Bx.point=Ux,Bx.lineStart=Ix,Bx.lineEnd=Hx},result:function(){var t=jx?[Px/jx,Lx/jx]:Rx?[Tx/Rx,zx/Rx]:Nx?[Fx/Nx,Ox/Nx]:[NaN,NaN];return Fx=Ox=Nx=Tx=zx=Rx=Px=Lx=jx=0,t}};function Ux(t,e){Fx+=t,Ox+=e,++Nx}function Ix(){Bx.point=qx}function qx(t,e){Bx.point=Wx,Ux(Mx=t,Cx=e)}function Wx(t,e){var n=t-Mx,i=e-Cx,r=ix(n*n+i*i);Tx+=r*(Mx+t)/2,zx+=r*(Cx+e)/2,Rx+=r,Ux(Mx=t,Cx=e)}function Hx(){Bx.point=Ux}function Xx(){Bx.point=Gx}function Jx(){$x(Ax,Sx)}function Gx(t,e){Bx.point=$x,Ux(Ax=Mx=t,Sx=Cx=e)}function $x(t,e){var n=t-Mx,i=e-Cx,r=ix(n*n+i*i);Tx+=r*(Mx+t)/2,zx+=r*(Cx+e)/2,Rx+=r,Px+=(r=Cx*t-Mx*e)*(Mx+t),Lx+=r*(Cx+e),jx+=3*r,Ux(Mx=t,Cx=e)}const Vx=Bx;function Yx(t){this._context=t}Yx.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Wb)}},result:sx};var Kx,Zx,Qx,t_,e_,n_=new Lb,i_={point:sx,lineStart:function(){i_.point=r_},lineEnd:function(){Kx&&o_(Zx,Qx),i_.point=sx},polygonStart:function(){Kx=!0},polygonEnd:function(){Kx=null},result:function(){var t=+n_;return n_=new Lb,t}};function r_(t,e){i_.point=o_,Zx=t_=t,Qx=e_=e}function o_(t,e){t_-=t,e_-=e,n_.add(ix(t_*t_+e_*e_)),t_=t,e_=e}const a_=i_;var s_,c_,l_,u_;let f_,d_,h_,p_;class m_{constructor(t){this._append=null==t?g_:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError("invalid digits: ".concat(t));if(e>15)return g_;if(e!==f_){const t=10**e;f_=e,d_=function(e){let n=1;this._+=e[0];for(const i=e.length;n<i;++n)this._+=Math.round(arguments[n]*t)/t+e[n]}}return d_}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append(s_||(s_=(0,$c.Z)(["M",",",""])),t,e),this._point=1;break;case 1:this._append(c_||(c_=(0,$c.Z)(["L",",",""])),t,e);break;default:if(this._append(l_||(l_=(0,$c.Z)(["M",",",""])),t,e),this._radius!==h_||this._append!==d_){const t=this._radius,e=this._;this._="",this._append(u_||(u_=(0,$c.Z)(["m0,","a",","," 0 1,1 0,","a",","," 0 1,1 0,","z"])),t,t,t,-2*t,t,t,2*t),h_=t,d_=this._append,p_=this._,this._=e}this._+=p_}}result(){const t=this._;return this._="",t.length?t:null}}function g_(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function v_(t,e){let n,i,r=3,o=4.5;function a(t){return t&&("function"===typeof o&&i.pointRadius(+o.apply(this,arguments)),Pb(t,n(i))),i.result()}return a.area=function(t){return Pb(t,n(bx)),bx.result()},a.measure=function(t){return Pb(t,n(a_)),a_.result()},a.bounds=function(t){return Pb(t,n(Dx)),Dx.result()},a.centroid=function(t){return Pb(t,n(Vx)),Vx.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,Fb):(t=e).stream,a):t},a.context=function(t){return arguments.length?(i=null==t?(e=null,new m_(r)):new Yx(e=t),"function"!==typeof o&&i.pointRadius(o),a):e},a.pointRadius=function(t){return arguments.length?(o="function"===typeof t?t:(i.pointRadius(+t),+t),a):o},a.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{const e=Math.floor(t);if(!(e>=0))throw new RangeError("invalid digits: ".concat(t));r=e}return null===e&&(i=new m_(r)),a},a.projection(t).digits(r).context(e)}function y_(){var t,e=[];return{point:function(e,n,i){t.push([e,n,i])},lineStart:function(){e.push(t=[])},lineEnd:sx,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function b_(t,e){return Jb(t[0]-e[0])<jb&&Jb(t[1]-e[1])<jb}function x_(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function __(t,e,n,i,r){var o,a,s=[],c=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],a=t[e];if(b_(i,a)){if(!i[2]&&!a[2]){for(r.lineStart(),o=0;o<e;++o)r.point((i=t[o])[0],i[1]);return void r.lineEnd()}a[0]+=2*jb}s.push(n=new x_(i,t,null,!0)),c.push(n.o=new x_(i,null,n,!1)),s.push(n=new x_(a,t,null,!1)),c.push(n.o=new x_(a,null,n,!0))}})),s.length){for(c.sort(e),w_(s),w_(c),o=0,a=c.length;o<a;++o)c[o].e=n=!n;for(var l,u,f=s[0];;){for(var d=f,h=!0;d.v;)if((d=d.n)===f)return;l=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(o=0,a=l.length;o<a;++o)r.point((u=l[o])[0],u[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(l=d.p.z,o=l.length-1;o>=0;--o)r.point((u=l[o])[0],u[1]);else i(d.x,d.p.x,-1,r);d=d.p}l=(d=d.o).z,h=!h}while(!d.v);r.lineEnd()}}}function w_(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}function k_(t){return[$b(t[1],t[0]),ax(t[2])]}function E_(t){var e=t[0],n=t[1],i=Vb(n);return[i*Vb(e),i*ex(e),ex(n)]}function D_(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function A_(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function S_(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function M_(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function C_(t){var e=ix(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function F_(t){return Jb(t[0])<=Ub?t[0]:nx(t[0])*((Jb(t[0])+Ub)%Wb-Ub)}function O_(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function N_(t,e,n,i){return function(r){var o,a,s,c=e(r),l=y_(),u=e(l),f=!1,d={point:h,lineStart:m,lineEnd:g,polygonStart:function(){d.point=v,d.lineStart=y,d.lineEnd=b,a=[],o=[]},polygonEnd:function(){d.point=h,d.lineStart=m,d.lineEnd=g,a=O_(a);var t=function(t,e){var n=F_(e),i=e[1],r=ex(i),o=[ex(n),-Vb(n),0],a=0,s=0,c=new Lb;1===r?i=Ib+jb:-1===r&&(i=-Ib-jb);for(var l=0,u=t.length;l<u;++l)if(d=(f=t[l]).length)for(var f,d,h=f[d-1],p=F_(h),m=h[1]/2+qb,g=ex(m),v=Vb(m),y=0;y<d;++y,p=x,g=w,v=k,h=b){var b=f[y],x=F_(b),_=b[1]/2+qb,w=ex(_),k=Vb(_),E=x-p,D=E>=0?1:-1,A=D*E,S=A>Ub,M=g*w;if(c.add($b(M*D*ex(A),v*k+M*Vb(A))),a+=S?E+D*Wb:E,S^p>=n^x>=n){var C=A_(E_(h),E_(b));C_(C);var F=A_(o,C);C_(F);var O=(S^E>=0?-1:1)*ax(F[2]);(i>O||i===O&&(C[0]||C[1]))&&(s+=S^E>=0?1:-1)}}return(a<-jb||a<jb&&c<-Bb)^1&s}(o,i);a.length?(f||(r.polygonStart(),f=!0),__(a,z_,t,n,r)):t&&(f||(r.polygonStart(),f=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),f&&(r.polygonEnd(),f=!1),a=o=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(e,n){t(e,n)&&r.point(e,n)}function p(t,e){c.point(t,e)}function m(){d.point=p,c.lineStart()}function g(){d.point=h,c.lineEnd()}function v(t,e){s.push([t,e]),u.point(t,e)}function y(){u.lineStart(),s=[]}function b(){v(s[0][0],s[0][1]),u.lineEnd();var t,e,n,i,c=u.clean(),d=l.result(),h=d.length;if(s.pop(),o.push(s),s=null,h)if(1&c){if((e=(n=d[0]).length-1)>0){for(f||(r.polygonStart(),f=!0),r.lineStart(),t=0;t<e;++t)r.point((i=n[t])[0],i[1]);r.lineEnd()}}else h>1&&2&c&&d.push(d.pop().concat(d.shift())),a.push(d.filter(T_))}return d}}function T_(t){return t.length>1}function z_(t,e){return((t=t.x)[0]<0?t[1]-Ib-jb:Ib-t[1])-((e=e.x)[0]<0?e[1]-Ib-jb:Ib-e[1])}const R_=N_((function(){return!0}),(function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?Ub:-Ub,c=Jb(o-n);Jb(c-Ub)<jb?(t.point(n,i=(i+a)/2>0?Ib:-Ib),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),t.point(o,i),e=0):r!==s&&c>=Ub&&(Jb(n-r)<jb&&(n-=r*jb),Jb(o-s)<jb&&(o-=s*jb),i=function(t,e,n,i){var r,o,a=ex(t-n);return Jb(a)>jb?Gb((ex(e)*(o=Vb(i))*ex(n)-ex(i)*(r=Vb(e))*ex(t))/(r*o*a)):(e+i)/2}(n,i,o,a),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),e=0),t.point(n=o,i=a),r=s},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}}),(function(t,e,n,i){var r;if(null==t)r=n*Ib,i.point(-Ub,r),i.point(0,r),i.point(Ub,r),i.point(Ub,0),i.point(Ub,-r),i.point(0,-r),i.point(-Ub,-r),i.point(-Ub,0),i.point(-Ub,r);else if(Jb(t[0]-e[0])>jb){var o=t[0]<e[0]?Ub:-Ub;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(e[0],e[1])}),[-Ub,-Ib]);function P_(t,e,n,i,r,o){if(n){var a=Vb(e),s=ex(e),c=i*n;null==r?(r=e+i*Wb,o=e-c/2):(r=L_(a,r),o=L_(a,o),(i>0?r<o:r>o)&&(r+=i*Wb));for(var l,u=r;i>0?u>o:u<o;u-=c)l=k_([a,-s*Vb(u),-s*ex(u)]),t.point(l[0],l[1])}}function L_(t,e){(e=E_(e))[0]-=t,C_(e);var n=ox(-e[1]);return((-e[2]<0?-n:n)+Wb-jb)%Wb}var j_=1e9,B_=-j_;function U_(t,e,n,i){function r(r,o){return t<=r&&r<=n&&e<=o&&o<=i}function o(r,o,s,l){var u=0,f=0;if(null==r||(u=a(r,s))!==(f=a(o,s))||c(r,o)<0^s>0)do{l.point(0===u||3===u?t:n,u>1?i:e)}while((u=(u+s+4)%4)!==f);else l.point(o[0],o[1])}function a(i,r){return Jb(i[0]-t)<jb?r>0?0:3:Jb(i[0]-n)<jb?r>0?2:1:Jb(i[1]-e)<jb?r>0?1:0:r>0?3:2}function s(t,e){return c(t.x,e.x)}function c(t,e){var n=a(t,1),i=a(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var c,l,u,f,d,h,p,m,g,v,y,b=a,x=y_(),_={point:w,lineStart:function(){_.point=k,l&&l.push(u=[]);v=!0,g=!1,p=m=NaN},lineEnd:function(){c&&(k(f,d),h&&g&&x.rejoin(),c.push(x.result()));_.point=w,g&&b.lineEnd()},polygonStart:function(){b=x,c=[],l=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=l.length;n<r;++n)for(var o,a,s=l[n],c=1,u=s.length,f=s[0],d=f[0],h=f[1];c<u;++c)o=d,a=h,d=(f=s[c])[0],h=f[1],a<=i?h>i&&(d-o)*(i-a)>(h-a)*(t-o)&&++e:h<=i&&(d-o)*(i-a)<(h-a)*(t-o)&&--e;return e}(),n=y&&e,r=(c=O_(c)).length;(n||r)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),r&&__(c,s,e,o,a),a.polygonEnd());b=a,c=l=u=null}};function w(t,e){r(t,e)&&b.point(t,e)}function k(o,a){var s=r(o,a);if(l&&u.push([o,a]),v)f=o,d=a,h=s,v=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&g)b.point(o,a);else{var c=[p=Math.max(B_,Math.min(j_,p)),m=Math.max(B_,Math.min(j_,m))],x=[o=Math.max(B_,Math.min(j_,o)),a=Math.max(B_,Math.min(j_,a))];!function(t,e,n,i,r,o){var a,s=t[0],c=t[1],l=0,u=1,f=e[0]-s,d=e[1]-c;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a<l)return;a<u&&(u=a)}else if(f>0){if(a>u)return;a>l&&(l=a)}if(a=r-s,f||!(a<0)){if(a/=f,f<0){if(a>u)return;a>l&&(l=a)}else if(f>0){if(a<l)return;a<u&&(u=a)}if(a=i-c,d||!(a>0)){if(a/=d,d<0){if(a<l)return;a<u&&(u=a)}else if(d>0){if(a>u)return;a>l&&(l=a)}if(a=o-c,d||!(a<0)){if(a/=d,d<0){if(a>u)return;a>l&&(l=a)}else if(d>0){if(a<l)return;a<u&&(u=a)}return l>0&&(t[0]=s+l*f,t[1]=c+l*d),u<1&&(e[0]=s+u*f,e[1]=c+u*d),!0}}}}}(c,x,t,e,n,i)?s&&(b.lineStart(),b.point(o,a),y=!1):(g||(b.lineStart(),b.point(c[0],c[1])),b.point(x[0],x[1]),s||b.lineEnd(),y=!1)}p=o,m=a,g=s}return _}}function I_(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n}function q_(t,e){return Jb(t)>Ub&&(t-=Math.round(t/Wb)*Wb),[t,e]}function W_(t,e,n){return(t%=Wb)?e||n?I_(X_(t),J_(e,n)):X_(t):e||n?J_(e,n):q_}function H_(t){return function(e,n){return Jb(e+=t)>Ub&&(e-=Math.round(e/Wb)*Wb),[e,n]}}function X_(t){var e=H_(t);return e.invert=H_(-t),e}function J_(t,e){var n=Vb(t),i=ex(t),r=Vb(e),o=ex(e);function a(t,e){var a=Vb(e),s=Vb(t)*a,c=ex(t)*a,l=ex(e),u=l*n+s*i;return[$b(c*r-u*o,s*n-l*i),ax(u*r+c*o)]}return a.invert=function(t,e){var a=Vb(e),s=Vb(t)*a,c=ex(t)*a,l=ex(e),u=l*r-c*o;return[$b(c*r+l*o,s*n+u*i),ax(u*n-s*i)]},a}function G_(t){return function(e){var n=new $_;for(var i in t)n[i]=t[i];return n.stream=e,n}}function $_(){}function V_(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),Pb(n,t.stream(Dx)),e(Dx.result()),null!=i&&t.clipExtent(i),t}function Y_(t,e,n){return V_(t,(function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],o=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),a=+e[0][0]+(i-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(r-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function K_(t,e,n){return Y_(t,[[0,0],e],n)}function Z_(t,e,n){return V_(t,(function(n){var i=+e,r=i/(n[1][0]-n[0][0]),o=(i-r*(n[1][0]+n[0][0]))/2,a=-r*n[0][1];t.scale(150*r).translate([o,a])}),n)}function Q_(t,e,n){return V_(t,(function(n){var i=+e,r=i/(n[1][1]-n[0][1]),o=-r*n[0][0],a=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([o,a])}),n)}q_.invert=q_,$_.prototype={constructor:$_,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var tw=16,ew=Vb(30*Xb);function nw(t,e){return+e?function(t,e){function n(i,r,o,a,s,c,l,u,f,d,h,p,m,g){var v=l-i,y=u-r,b=v*v+y*y;if(b>4*e&&m--){var x=a+d,_=s+h,w=c+p,k=ix(x*x+_*_+w*w),E=ax(w/=k),D=Jb(Jb(w)-1)<jb||Jb(o-f)<jb?(o+f)/2:$b(_,x),A=t(D,E),S=A[0],M=A[1],C=S-i,F=M-r,O=y*C-v*F;(O*O/b>e||Jb((v*C+y*F)/b-.5)>.3||a*d+s*h+c*p<ew)&&(n(i,r,o,a,s,c,S,M,D,x/=k,_/=k,w,m,g),g.point(S,M),n(S,M,D,x,_,w,l,u,f,d,h,p,m,g))}}return function(e){var i,r,o,a,s,c,l,u,f,d,h,p,m={point:g,lineStart:v,lineEnd:b,polygonStart:function(){e.polygonStart(),m.lineStart=x},polygonEnd:function(){e.polygonEnd(),m.lineStart=v}};function g(n,i){n=t(n,i),e.point(n[0],n[1])}function v(){u=NaN,m.point=y,e.lineStart()}function y(i,r){var o=E_([i,r]),a=t(i,r);n(u,f,l,d,h,p,u=a[0],f=a[1],l=i,d=o[0],h=o[1],p=o[2],tw,e),e.point(u,f)}function b(){m.point=g,e.lineEnd()}function x(){v(),m.point=_,m.lineEnd=w}function _(t,e){y(i=t,e),r=u,o=f,a=d,s=h,c=p,m.point=y}function w(){n(u,f,l,d,h,p,r,o,i,a,s,c,tw,e),m.lineEnd=b,b()}return m}}(t,e):function(t){return G_({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var iw=G_({point:function(t,e){this.stream.point(t*Xb,e*Xb)}});function rw(t,e,n,i,r,o){if(!o)return function(t,e,n,i,r){function o(o,a){return[e+t*(o*=i),n-t*(a*=r)]}return o.invert=function(o,a){return[(o-e)/t*i,(n-a)/t*r]},o}(t,e,n,i,r);var a=Vb(o),s=ex(o),c=a*t,l=s*t,u=a/t,f=s/t,d=(s*n-a*e)/t,h=(s*e+a*n)/t;function p(t,o){return[c*(t*=i)-l*(o*=r)+e,n-l*t-c*o]}return p.invert=function(t,e){return[i*(u*t-f*e+d),r*(h-f*t-u*e)]},p}function ow(t){return aw((function(){return t}))()}function aw(t){var e,n,i,r,o,a,s,c,l,u,f=150,d=480,h=250,p=0,m=0,g=0,v=0,y=0,b=0,x=1,_=1,w=null,k=R_,E=null,D=Fb,A=.5;function S(t){return c(t[0]*Xb,t[1]*Xb)}function M(t){return(t=c.invert(t[0],t[1]))&&[t[0]*Hb,t[1]*Hb]}function C(){var t=rw(f,0,0,x,_,b).apply(null,e(p,m)),i=rw(f,d-t[0],h-t[1],x,_,b);return n=W_(g,v,y),s=I_(e,i),c=I_(n,s),a=nw(s,A),F()}function F(){return l=u=null,S}return S.stream=function(t){return l&&u===t?l:l=iw(function(t){return G_({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}(n)(k(a(D(u=t)))))},S.preclip=function(t){return arguments.length?(k=t,w=void 0,F()):k},S.postclip=function(t){return arguments.length?(D=t,E=i=r=o=null,F()):D},S.clipAngle=function(t){return arguments.length?(k=+t?function(t){var e=Vb(t),n=6*Xb,i=e>0,r=Jb(e)>jb;function o(t,n){return Vb(t)*Vb(n)>e}function a(t,n,i){var r=[1,0,0],o=A_(E_(t),E_(n)),a=D_(o,o),s=o[0],c=a-s*s;if(!c)return!i&&t;var l=e*a/c,u=-e*s/c,f=A_(r,o),d=M_(r,l);S_(d,M_(o,u));var h=f,p=D_(d,h),m=D_(h,h),g=p*p-m*(D_(d,d)-1);if(!(g<0)){var v=ix(g),y=M_(h,(-p-v)/m);if(S_(y,d),y=k_(y),!i)return y;var b,x=t[0],_=n[0],w=t[1],k=n[1];_<x&&(b=x,x=_,_=b);var E=_-x,D=Jb(E-Ub)<jb;if(!D&&k<w&&(b=w,w=k,k=b),D||E<jb?D?w+k>0^y[1]<(Jb(y[0]-x)<jb?w:k):w<=y[1]&&y[1]<=k:E>Ub^(x<=y[0]&&y[0]<=_)){var A=M_(h,(-p+v)/m);return S_(A,d),[y,k_(A)]}}}function s(e,n){var r=i?t:Ub-t,o=0;return e<-r?o|=1:e>r&&(o|=2),n<-r?o|=4:n>r&&(o|=8),o}return N_(o,(function(t){var e,n,c,l,u;return{lineStart:function(){l=c=!1,u=1},point:function(f,d){var h,p=[f,d],m=o(f,d),g=i?m?0:s(f,d):m?s(f+(f<0?Ub:-Ub),d):0;if(!e&&(l=c=m)&&t.lineStart(),m!==c&&(!(h=a(e,p))||b_(e,h)||b_(p,h))&&(p[2]=1),m!==c)u=0,m?(t.lineStart(),h=a(p,e),t.point(h[0],h[1])):(h=a(e,p),t.point(h[0],h[1],2),t.lineEnd()),e=h;else if(r&&e&&i^m){var v;g&n||!(v=a(p,e,!0))||(u=0,i?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!m||e&&b_(e,p)||t.point(p[0],p[1]),e=p,c=m,n=g},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return u|(l&&c)<<1}}}),(function(e,i,r,o){P_(o,t,n,r,e,i)}),i?[0,-t]:[-Ub,t-Ub])}(w=t*Xb):(w=null,R_),F()):w*Hb},S.clipExtent=function(t){return arguments.length?(D=null==t?(E=i=r=o=null,Fb):U_(E=+t[0][0],i=+t[0][1],r=+t[1][0],o=+t[1][1]),F()):null==E?null:[[E,i],[r,o]]},S.scale=function(t){return arguments.length?(f=+t,C()):f},S.translate=function(t){return arguments.length?(d=+t[0],h=+t[1],C()):[d,h]},S.center=function(t){return arguments.length?(p=t[0]%360*Xb,m=t[1]%360*Xb,C()):[p*Hb,m*Hb]},S.rotate=function(t){return arguments.length?(g=t[0]%360*Xb,v=t[1]%360*Xb,y=t.length>2?t[2]%360*Xb:0,C()):[g*Hb,v*Hb,y*Hb]},S.angle=function(t){return arguments.length?(b=t%360*Xb,C()):b*Hb},S.reflectX=function(t){return arguments.length?(x=t?-1:1,C()):x<0},S.reflectY=function(t){return arguments.length?(_=t?-1:1,C()):_<0},S.precision=function(t){return arguments.length?(a=nw(s,A=t*t),F()):ix(A)},S.fitExtent=function(t,e){return Y_(S,t,e)},S.fitSize=function(t,e){return K_(S,t,e)},S.fitWidth=function(t,e){return Z_(S,t,e)},S.fitHeight=function(t,e){return Q_(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&M,C()}}function sw(t){var e=0,n=Ub/3,i=aw(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*Xb,n=t[1]*Xb):[e*Hb,n*Hb]},r}function cw(t,e){var n=ex(t),i=(n+ex(e))/2;if(Jb(i)<jb)return function(t){var e=Vb(t);function n(t,n){return[t*e,ex(n)/e]}return n.invert=function(t,n){return[t/e,ax(n*e)]},n}(t);var r=1+n*(2*i-n),o=ix(r)/i;function a(t,e){var n=ix(r-2*i*ex(e))/i;return[n*ex(t*=i),o-n*Vb(t)]}return a.invert=function(t,e){var n=o-e,a=$b(t,Jb(n))*nx(n);return n*i<0&&(a-=Ub*nx(t)*nx(n)),[a/i,ax((r-(t*t+n*n)*i*i)/(2*i))]},a}function lw(){return sw(cw).scale(155.424).center([0,33.6442])}function uw(){return lw().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function fw(t){return function(e,n){var i=Vb(e),r=Vb(n),o=t(i*r);return o===1/0?[2,0]:[o*r*ex(e),o*ex(n)]}}function dw(t){return function(e,n){var i=ix(e*e+n*n),r=t(i),o=ex(r),a=Vb(r);return[$b(e*o,i*a),ax(i&&n*o/i)]}}var hw=fw((function(t){return ix(2/(1+t))}));hw.invert=dw((function(t){return 2*ax(t/2)}));var pw=fw((function(t){return(t=ox(t))&&t/ex(t)}));function mw(t,e){return[t,Qb(rx((Ib+e)/2))]}function gw(t){var e,n,i,r=ow(t),o=r.center,a=r.scale,s=r.translate,c=r.clipExtent,l=null;function u(){var o=Ub*a(),s=r(function(t){function e(e){return(e=t(e[0]*Xb,e[1]*Xb))[0]*=Hb,e[1]*=Hb,e}return t=W_(t[0]*Xb,t[1]*Xb,t.length>2?t[2]*Xb:0),e.invert=function(e){return(e=t.invert(e[0]*Xb,e[1]*Xb))[0]*=Hb,e[1]*=Hb,e},e}(r.rotate()).invert([0,0]));return c(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===mw?[[Math.max(s[0]-o,l),e],[Math.min(s[0]+o,n),i]]:[[l,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,i)]])}return r.scale=function(t){return arguments.length?(a(t),u()):a()},r.translate=function(t){return arguments.length?(s(t),u()):s()},r.center=function(t){return arguments.length?(o(t),u()):o()},r.clipExtent=function(t){return arguments.length?(null==t?l=e=n=i=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],i=+t[1][1]),u()):null==l?null:[[l,e],[n,i]]},u()}function vw(t){return rx((Ib+t)/2)}function yw(t,e){var n=Vb(t),i=t===e?ex(t):Qb(n/Vb(e))/Qb(vw(e)/vw(t)),r=n*tx(vw(t),i)/i;if(!i)return mw;function o(t,e){r>0?e<-Ib+jb&&(e=-Ib+jb):e>Ib-jb&&(e=Ib-jb);var n=r/tx(vw(e),i);return[n*ex(i*t),r-n*Vb(i*t)]}return o.invert=function(t,e){var n=r-e,o=nx(i)*ix(t*t+n*n),a=$b(t,Jb(n))*nx(n);return n*i<0&&(a-=Ub*nx(t)*nx(n)),[a/i,2*Gb(tx(r/o,1/i))-Ib]},o}function bw(t,e){return[t,e]}function xw(t,e){var n=Vb(t),i=t===e?ex(t):(n-Vb(e))/(e-t),r=n/i+t;if(Jb(i)<jb)return bw;function o(t,e){var n=r-e,o=i*t;return[n*ex(o),r-n*Vb(o)]}return o.invert=function(t,e){var n=r-e,o=$b(t,Jb(n))*nx(n);return n*i<0&&(o-=Ub*nx(t)*nx(n)),[o/i,r-nx(i)*ix(t*t+n*n)]},o}pw.invert=dw((function(t){return t})),mw.invert=function(t,e){return[t,2*Gb(Kb(e))-Ib]},bw.invert=bw;var _w=1.340264,ww=-.081106,kw=893e-6,Ew=.003796,Dw=ix(3)/2;function Aw(t,e){var n=ax(Dw*ex(e)),i=n*n,r=i*i*i;return[t*Vb(n)/(Dw*(_w+3*ww*i+r*(7*kw+9*Ew*i))),n*(_w+ww*i+r*(kw+Ew*i))]}function Sw(t,e){var n=Vb(e),i=Vb(t)*n;return[n*ex(t)/i,ex(e)/i]}function Mw(t,e){var n=e*e,i=n*n;return[t*(.8707-.131979*n+i*(i*(.003971*n-.001529*i)-.013791)),e*(1.007226+n*(.015085+i*(.028874*n-.044475-.005916*i)))]}function Cw(t,e){return[Vb(e)*ex(t),ex(e)]}function Fw(t,e){var n=Vb(e),i=1+Vb(t)*n;return[n*ex(t)/i,ex(e)/i]}function Ow(t,e){return[Qb(rx((Ib+e)/2)),-t]}Aw.invert=function(t,e){for(var n,i=e,r=i*i,o=r*r*r,a=0;a<12&&(o=(r=(i-=n=(i*(_w+ww*r+o*(kw+Ew*r))-e)/(_w+3*ww*r+o*(7*kw+9*Ew*r)))*i)*r*r,!(Jb(n)<Bb));++a);return[Dw*t*(_w+3*ww*r+o*(7*kw+9*Ew*r))/Vb(i),ax(ex(i)/Dw)]},Sw.invert=dw(Gb),Mw.invert=function(t,e){var n,i=e,r=25;do{var o=i*i,a=o*o;i-=n=(i*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(Jb(n)>jb&&--r>0);return[t/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]},Cw.invert=dw(ax),Fw.invert=dw((function(t){return 2*Gb(t)})),Ow.invert=function(t,e){return[-e,2*Gb(Kb(t))-Ib]};var Nw=Math.abs,Tw=(Math.atan,Math.atan2,Math.ceil,Math.cos),zw=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),Rw=(Math.tan,1e-6),Pw=Math.PI,Lw=Pw/2,jw=(Math.SQRT1_2,Uw(2));Uw(Pw);function Bw(t){return t>1?Lw:t<-1?-Lw:Math.asin(t)}function Uw(t){return t>0?Math.sqrt(t):0}function Iw(t,e){var n,i=t*zw(e),r=30;do{e-=n=(e+zw(e)-i)/(1+Tw(e))}while(Nw(n)>Rw&&--r>0);return e/2}var qw=function(t,e,n){function i(i,r){return[t*i*Tw(r=Iw(n,r)),e*zw(r)]}return i.invert=function(i,r){return r=Bw(r/e),[i/(t*Tw(r)),Bw((2*r+zw(2*r))/n)]},i}(jw/Lw,jw,Pw);const Ww=v_(),Hw=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function Xw(t,e){if(!t||"string"!==typeof t)throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(Gw[t]=function(t,e){return function n(){const i=e();return i.type=t,i.path=v_().projection(i),i.copy=i.copy||function(){const t=n();return Hw.forEach((e=>{i[e]&&t[e](i[e]())})),t.path.pointRadius(i.path.pointRadius()),t},rd(i)}}(t,e),this):Gw[t]||null}function Jw(t){return t&&t.path||Ww}const Gw={albers:uw,albersusa:function(){var t,e,n,i,r,o,a=uw(),s=lw().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=lw().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){o=[t,e]}};function u(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(i.point(e,a),o)||(r.point(e,a),o)}function f(){return t=e=null,u}return u.invert=function(t){var e=a.scale(),n=a.translate(),i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?s:r>=.166&&r<.234&&i>=-.214&&i<-.115?c:a).invert(t)},u.stream=function(n){return t&&e===n?t:t=function(t){var e=t.length;return{point:function(n,i){for(var r=-1;++r<e;)t[r].point(n,i)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}([a.stream(e=n),s.stream(n),c.stream(n)])},u.precision=function(t){return arguments.length?(a.precision(t),s.precision(t),c.precision(t),f()):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),s.scale(.35*t),c.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),o=+t[0],u=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,u-.238*e],[o+.455*e,u+.238*e]]).stream(l),i=s.translate([o-.307*e,u+.201*e]).clipExtent([[o-.425*e+jb,u+.12*e+jb],[o-.214*e-jb,u+.234*e-jb]]).stream(l),r=c.translate([o-.205*e,u+.212*e]).clipExtent([[o-.214*e+jb,u+.166*e+jb],[o-.115*e-jb,u+.234*e-jb]]).stream(l),f()},u.fitExtent=function(t,e){return Y_(u,t,e)},u.fitSize=function(t,e){return K_(u,t,e)},u.fitWidth=function(t,e){return Z_(u,t,e)},u.fitHeight=function(t,e){return Q_(u,t,e)},u.scale(1070)},azimuthalequalarea:function(){return ow(hw).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return ow(pw).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return sw(yw).scale(109.5).parallels([30,30])},conicequalarea:lw,conicequidistant:function(){return sw(xw).scale(131.154).center([0,13.9389])},equalEarth:function(){return ow(Aw).scale(177.158)},equirectangular:function(){return ow(bw).scale(152.63)},gnomonic:function(){return ow(Sw).scale(144.049).clipAngle(60)},identity:function(){var t,e,n,i,r,o,a,s=1,c=0,l=0,u=1,f=1,d=0,h=null,p=1,m=1,g=G_({point:function(t,e){var n=b([t,e]);this.stream.point(n[0],n[1])}}),v=Fb;function y(){return p=s*u,m=s*f,o=a=null,b}function b(n){var i=n[0]*p,r=n[1]*m;if(d){var o=r*t-i*e;i=i*t+r*e,r=o}return[i+c,r+l]}return b.invert=function(n){var i=n[0]-c,r=n[1]-l;if(d){var o=r*t+i*e;i=i*t-r*e,r=o}return[i/p,r/m]},b.stream=function(t){return o&&a===t?o:o=g(v(a=t))},b.postclip=function(t){return arguments.length?(v=t,h=n=i=r=null,y()):v},b.clipExtent=function(t){return arguments.length?(v=null==t?(h=n=i=r=null,Fb):U_(h=+t[0][0],n=+t[0][1],i=+t[1][0],r=+t[1][1]),y()):null==h?null:[[h,n],[i,r]]},b.scale=function(t){return arguments.length?(s=+t,y()):s},b.translate=function(t){return arguments.length?(c=+t[0],l=+t[1],y()):[c,l]},b.angle=function(n){return arguments.length?(e=ex(d=n%360*Xb),t=Vb(d),y()):d*Hb},b.reflectX=function(t){return arguments.length?(u=t?-1:1,y()):u<0},b.reflectY=function(t){return arguments.length?(f=t?-1:1,y()):f<0},b.fitExtent=function(t,e){return Y_(b,t,e)},b.fitSize=function(t,e){return K_(b,t,e)},b.fitWidth=function(t,e){return Z_(b,t,e)},b.fitHeight=function(t,e){return Q_(b,t,e)},b},mercator:function(){return gw(mw).scale(961/Wb)},mollweide:function(){return ow(qw).scale(169.529)},naturalEarth1:function(){return ow(Mw).scale(175.295)},orthographic:function(){return ow(Cw).scale(249.5).clipAngle(90+jb)},stereographic:function(){return ow(Fw).scale(250).clipAngle(142)},transversemercator:function(){var t=gw(Ow),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}};for(const Hz in Gw)Xw(Hz,Gw[Hz]);function $w(t,e,n){var i=pa(t,e-jb,n).concat(e);return function(t){return i.map((function(e){return[t,e]}))}}function Vw(t,e,n){var i=pa(t,e-jb,n).concat(e);return function(t){return i.map((function(e){return[e,t]}))}}function Yw(){var t,e,n,i,r,o,a,s,c,l,u,f,d=10,h=d,p=90,m=360,g=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return pa(Yb(i/p)*p,n,p).map(u).concat(pa(Yb(s/m)*m,a,m).map(f)).concat(pa(Yb(e/d)*d,t,d).filter((function(t){return Jb(t%p)>jb})).map(c)).concat(pa(Yb(o/h)*h,r,h).filter((function(t){return Jb(t%m)>jb})).map(l))}return v.lines=function(){return y().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[u(i).concat(f(a).slice(1),u(n).reverse().slice(1),f(s).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],i>n&&(t=i,i=n,n=t),s>a&&(t=s,s=a,a=t),v.precision(g)):[[i,s],[n,a]]},v.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],r=+n[1][1],e>t&&(n=e,e=t,t=n),o>r&&(n=o,o=r,r=n),v.precision(g)):[[e,o],[t,r]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],m=+t[1],v):[p,m]},v.stepMinor=function(t){return arguments.length?(d=+t[0],h=+t[1],v):[d,h]},v.precision=function(d){return arguments.length?(g=+d,c=$w(o,r,90),l=Vw(e,t,g),u=$w(s,a,90),f=Vw(i,n,g),v):g},v.extentMajor([[-180,-90+jb],[180,90-jb]]).extentMinor([[-180,-80-jb],[180,80+jb]])}function Kw(){}const Zw=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Qw(){var t=1,e=1,n=a;function i(t,e){return e.map((e=>r(t,e)))}function r(i,r){var a=[],s=[];return function(n,i,r){var a,s,c,l,u,f,d=new Array,h=new Array;a=s=-1,l=n[0]>=i,Zw[l<<1].forEach(p);for(;++a<t-1;)c=l,l=n[a+1]>=i,Zw[c|l<<1].forEach(p);Zw[l<<0].forEach(p);for(;++s<e-1;){for(a=-1,l=n[s*t+t]>=i,u=n[s*t]>=i,Zw[l<<1|u<<2].forEach(p);++a<t-1;)c=l,l=n[s*t+t+a+1]>=i,f=u,u=n[s*t+a+1]>=i,Zw[c|l<<1|u<<2|f<<3].forEach(p);Zw[l|u<<3].forEach(p)}a=-1,u=n[s*t]>=i,Zw[u<<2].forEach(p);for(;++a<t-1;)f=u,u=n[s*t+a+1]>=i,Zw[u<<2|f<<3].forEach(p);function p(t){var e,n,i=[t[0][0]+a,t[0][1]+s],c=[t[1][0]+a,t[1][1]+s],l=o(i),u=o(c);(e=h[l])?(n=d[u])?(delete h[e.end],delete d[n.start],e===n?(e.ring.push(c),r(e.ring)):d[e.start]=h[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[e.end],e.ring.push(c),h[e.end=u]=e):(e=d[u])?(n=h[l])?(delete d[e.start],delete h[n.end],e===n?(e.ring.push(c),r(e.ring)):d[n.start]=h[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[e.start],e.ring.unshift(i),d[e.start=l]=e):d[l]=h[u]={start:l,end:u,ring:[i,c]}}Zw[u<<3].forEach(p)}(i,r,(t=>{n(t,i,r),function(t){var e=0,n=t.length,i=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];for(;++e<n;)i+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return i}(t)>0?a.push([t]):s.push(t)})),s.forEach((t=>{for(var e,n=0,i=a.length;n<i;++n)if(-1!==tk((e=a[n])[0],t))return void e.push(t)})),{type:"MultiPolygon",value:r,coordinates:a}}function o(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,i,r){n.forEach((n=>{var o,a=n[0],s=n[1],c=0|a,l=0|s,u=i[l*t+c];a>0&&a<t&&c===a&&(o=i[l*t+c-1],n[0]=a+(r-o)/(u-o)-.5),s>0&&s<e&&l===s&&(o=i[(l-1)*t+c],n[1]=s+(r-o)/(u-o)-.5)}))}return i.contour=r,i.size=function(n){if(!arguments.length)return[t,e];var r=Math.floor(n[0]),o=Math.floor(n[1]);return r>=0&&o>=0||(0,m.vU)("invalid size"),t=r,e=o,i},i.smooth=function(t){return arguments.length?(n=t?a:Kw,i):n===a},i}function tk(t,e){for(var n,i=-1,r=e.length;++i<r;)if(n=ek(t,e[i]))return n;return 0}function ek(t,e){for(var n=e[0],i=e[1],r=-1,o=0,a=t.length,s=a-1;o<a;s=o++){var c=t[o],l=c[0],u=c[1],f=t[s],d=f[0],h=f[1];if(nk(c,f,e))return 0;u>i!==h>i&&n<(d-l)*(i-u)/(h-u)+l&&(r=-r)}return r}function nk(t,e,n){var i,r,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(r=t[i=+(t[0]===e[0])],o=n[i],a=e[i],r<=o&&o<=a||a<=o&&o<=r)}function ik(t,e,n){return function(i){var r=(0,m.We)(i),o=n?Math.min(r[0],0):r[0],a=r[1],s=a-o,c=e?B(o,a,t):s/(t+1);return pa(o+c,a,c)}}function rk(t){no.call(this,null,t)}function ok(t,e,n,i,r){const o=t.x1||0,a=t.y1||0,s=e*n<0;function c(t){t.forEach(l)}function l(t){s&&t.reverse(),t.forEach(u)}function u(t){t[0]=(t[0]-o)*e+i,t[1]=(t[1]-a)*n+r}return function(t){return t.coordinates.forEach(c),t}}function ak(t,e,n){const i=t>=0?t:xo(e,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function sk(t){return(0,m.mf)(t)?t:(0,m.a9)(+t)}function ck(){var t=t=>t[0],e=t=>t[1],n=m.kX,i=[-1,-1],r=960,o=500,a=2;function s(s,c){const l=ak(i[0],s,t)>>a,u=ak(i[1],s,e)>>a,f=l?l+2:0,d=u?u+2:0,h=2*f+(r>>a),p=2*d+(o>>a),m=new Float32Array(h*p),g=new Float32Array(h*p);let v=m;s.forEach((i=>{const r=f+(+t(i)>>a),o=d+(+e(i)>>a);r>=0&&r<h&&o>=0&&o<p&&(m[r+o*h]+=+n(i))})),l>0&&u>0?(lk(h,p,m,g,l),uk(h,p,g,m,u),lk(h,p,m,g,l),uk(h,p,g,m,u),lk(h,p,m,g,l),uk(h,p,g,m,u)):l>0?(lk(h,p,m,g,l),lk(h,p,g,m,l),lk(h,p,m,g,l),v=g):u>0&&(uk(h,p,m,g,u),uk(h,p,g,m,u),uk(h,p,m,g,u),v=g);const y=c?Math.pow(2,-2*a):1/Zy(v);for(let t=0,e=h*p;t<e;++t)v[t]*=y;return{values:v,scale:1<<a,width:h,height:p,x1:f,y1:d,x2:f+(r>>a),y2:d+(o>>a)}}return s.x=function(e){return arguments.length?(t=sk(e),s):t},s.y=function(t){return arguments.length?(e=sk(t),s):e},s.weight=function(t){return arguments.length?(n=sk(t),s):n},s.size=function(t){if(!arguments.length)return[r,o];var e=+t[0],n=+t[1];return e>=0&&n>=0||(0,m.vU)("invalid size"),r=e,o=n,s},s.cellSize=function(t){return arguments.length?((t=+t)>=1||(0,m.vU)("invalid cell size"),a=Math.floor(Math.log(t)/Math.LN2),s):1<<a},s.bandwidth=function(t){return arguments.length?(1===(t=(0,m.IX)(t)).length&&(t=[+t[0],+t[0]]),2!==t.length&&(0,m.vU)("invalid bandwidth"),i=t,s):i},s}function lk(t,e,n,i,r){const o=1+(r<<1);for(let a=0;a<e;++a)for(let e=0,s=0;e<t+r;++e)e<t&&(s+=n[e+a*t]),e>=r&&(e>=o&&(s-=n[e-o+a*t]),i[e-r+a*t]=s/Math.min(e+1,t-1+o-e,o))}function uk(t,e,n,i,r){const o=1+(r<<1);for(let a=0;a<t;++a)for(let s=0,c=0;s<e+r;++s)s<e&&(c+=n[a+s*t]),s>=r&&(s>=o&&(c-=n[a+(s-o)*t]),i[a+(s-r)*t]=c/Math.min(s+1,e-1+o-s,o))}function fk(t){no.call(this,null,t)}rk.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},(0,m.XW)(rk,no,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=e.materialize(e.SOURCE).source,r=t.field||m.yR,o=Qw().smooth(!1!==t.smooth),a=t.thresholds||function(t,e,n){const i=ik(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?i:i(t.map((t=>ao(e(t).values))))}(i,r,t),s=null===t.as?null:t.as||"contour",c=[];return i.forEach((e=>{const n=r(e),i=o.size([n.width,n.height])(n.values,(0,m.kJ)(a)?a:a(n.values));!function(t,e,n,i){let r=i.scale||e.scale,o=i.translate||e.translate;(0,m.mf)(r)&&(r=r(n,i));(0,m.mf)(o)&&(o=o(n,i));if((1===r||null==r)&&!o)return;const a=((0,m.hj)(r)?r:r[0])||1,s=((0,m.hj)(r)?r:r[1])||1,c=o&&o[0]||0,l=o&&o[1]||0;t.forEach(ok(e,a,s,c,l))}(i,n,e,t),i.forEach((t=>{c.push(Sr(e,Dr(null!=s?{[s]:t}:t)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=c,n}}),fk.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const dk=["x","y","weight","size","cellSize","bandwidth"];function hk(t,e){return dk.forEach((n=>null!=e[n]?t[n](e[n]):0)),t}function pk(t){no.call(this,null,t)}(0,m.XW)(fk,no,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=function(t,e){var n,i,r,o,a,s,c=[],l=t=>t(o);if(null==e)c.push(t);else for(n={},i=0,r=t.length;i<r;++i)o=t[i],(s=n[a=e.map(l)])||(n[a]=s=[],s.dims=a,c.push(s)),s.push(o);return c}(e.materialize(e.SOURCE).source,t.groupby),o=(t.groupby||[]).map(m.el),a=hk(ck(),t),s=t.as||"grid";return n=r.map((e=>Dr(function(t,e){for(let n=0;n<o.length;++n)t[o[n]]=e[n];return t}({[s]:a(e,t.counts)},e.dims)))),this.value&&(i.rem=this.value),this.value=i.source=i.add=n,i}}),pk.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]},(0,m.XW)(pk,no,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,i,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),o=Qw().smooth(!1!==t.smooth),a=t.values,s=t.thresholds||ik(t.count||10,t.nice,!!a),c=t.size;return a||(a=e.materialize(e.SOURCE).source,i=ok(n=hk(ck(),t)(a,!0),n.scale||1,n.scale||1,0,0),c=[n.width,n.height],a=n.values),s=(0,m.kJ)(s)?s:s(a),a=o.size(c)(a,s),i&&a.forEach(i),this.value&&(r.rem=this.value),this.value=r.source=r.add=(a||[]).map(Dr),r}});const mk="Feature",gk="FeatureCollection";function vk(t){no.call(this,null,t)}function yk(t){no.call(this,null,t)}function bk(t){no.call(this,null,t)}function xk(t){no.call(this,null,t)}function _k(t){no.call(this,[],t),this.generator=Yw()}function wk(t){no.call(this,null,t)}function kk(t){if(!(0,m.mf)(t))return!1;const e=(0,m.Rg)((0,m.Oj)(t));return e.$x||e.$y||e.$value||e.$max}function Ek(t){no.call(this,null,t),this.modified(!0)}function Dk(t,e,n){(0,m.mf)(t[e])&&t[e](n)}function Ak(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,o,a,s,c,l,u,f,d,h=t._root,p={data:i},m=t._x0,g=t._y0,v=t._x1,y=t._y1;if(!h)return t._root=p,t;for(;h.length;)if((l=e>=(o=(m+v)/2))?m=o:v=o,(u=n>=(a=(g+y)/2))?g=a:y=a,r=h,!(h=h[f=u<<1|l]))return r[f]=p,t;if(s=+t._x.call(null,h.data),c=+t._y.call(null,h.data),e===s&&n===c)return p.next=h,r?r[f]=p:t._root=p,t;do{r=r?r[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(m+v)/2))?m=o:v=o,(u=n>=(a=(g+y)/2))?g=a:y=a}while((f=u<<1|l)===(d=(c>=a)<<1|s>=o));return r[d]=h,r[f]=p,t}function Sk(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function Mk(t){return t[0]}function Ck(t){return t[1]}function Fk(t,e,n){var i=new Ok(null==e?Mk:e,null==n?Ck:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function Ok(t,e,n,i,r,o){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function Nk(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}vk.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},(0,m.XW)(vk,no,{transform(t,e){var n,i=this._features,r=this._points,o=t.fields,a=o&&o[0],s=o&&o[1],c=t.geojson||!o&&m.yR,l=e.ADD;n=t.modified()||e.changed(e.REM)||e.modified((0,m.Oj)(c))||a&&e.modified((0,m.Oj)(a))||s&&e.modified((0,m.Oj)(s)),this.value&&!n||(l=e.SOURCE,this._features=i=[],this._points=r=[]),c&&e.visit(l,(t=>i.push(c(t)))),a&&s&&(e.visit(l,(t=>{var e=a(t),n=s(t);null!=e&&null!=n&&(e=+e)===e&&(n=+n)===n&&r.push([e,n])})),i=i.concat({type:mk,geometry:{type:"MultiPoint",coordinates:r}})),this.value={type:gk,features:i}}}),yk.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},(0,m.XW)(yk,no,{transform(t,e){var n=e.fork(e.ALL),i=this.value,r=t.field||m.yR,o=t.as||"path",a=n.SOURCE;!i||t.modified()?(this.value=i=Jw(t.projection),n.materialize().reflow()):a=r===m.yR||e.modified(r.fields)?n.ADD_MOD:n.ADD;const s=function(t,e){const n=t.pointRadius();t.context(null),null!=e&&t.pointRadius(e);return n}(i,t.pointRadius);return n.visit(a,(t=>t[o]=i(r(t)))),i.pointRadius(s),n.modifies(o)}}),bk.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},(0,m.XW)(bk,no,{transform(t,e){var n,i=t.projection,r=t.fields[0],o=t.fields[1],a=t.as||["x","y"],s=a[0],c=a[1];function l(t){const e=i([r(t),o(t)]);e?(t[s]=e[0],t[c]=e[1]):(t[s]=void 0,t[c]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,l):(n=e.modified(r.fields)||e.modified(o.fields),e.visit(n?e.ADD_MOD:e.ADD,l)),e.modifies(a)}}),xk.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},(0,m.XW)(xk,no,{transform(t,e){var n=e.fork(e.ALL),i=this.value,r=t.as||"shape",o=n.ADD;return i&&!t.modified()||(this.value=i=function(t,e,n){const i=null==n?n=>t(e(n)):i=>{var r=t.pointRadius(),o=t.pointRadius(n)(e(i));return t.pointRadius(r),o};return i.context=e=>(t.context(e),i),i}(Jw(t.projection),t.field||(0,m.EP)("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(t=>t[r]=i)),n.modifies(r)}}),_k.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},(0,m.XW)(_k,no,{transform(t,e){var n,i=this.value,r=this.generator;if(!i.length||t.modified())for(const o in t)(0,m.mf)(r[o])&&r[o](t[o]);return n=r(),i.length?e.mod.push(Mr(i[0],n)):e.add.push(Dr(n)),i[0]=n,e}}),wk.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},(0,m.XW)(wk,no,{transform(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,i="shared"===t.resolve,r=t.field||m.yR,o=function(t,e){let n;(0,m.mf)(t)?(n=n=>t(n,e),n.dep=kk(t)):t?n=(0,m.a9)(t):(n=t=>t.$value/t.$max||0,n.dep=!0);return n}(t.opacity,t),a=function(t,e){let n;(0,m.mf)(t)?(n=n=>(0,wl.B8)(t(n,e)),n.dep=kk(t)):n=(0,m.a9)((0,wl.B8)(t||"#888"));return n}(t.color,t),s=t.as||"image",c={$x:0,$y:0,$value:0,$max:i?ao(n.map((t=>ao(r(t).values)))):0};return n.forEach((t=>{const e=r(t),n=(0,m.l7)({},t,c);i||(n.$max=ao(e.values||[])),t[s]=function(t,e,n,i){const r=t.width,o=t.height,a=t.x1||0,s=t.y1||0,c=t.x2||r,l=t.y2||o,u=t.values,f=u?t=>u[t]:m.bM,d=gl(c-a,l-s),h=d.getContext("2d"),p=h.getImageData(0,0,c-a,l-s),g=p.data;for(let m=s,v=0;m<l;++m){e.$y=m-s;for(let t=a,o=m*r;t<c;++t,v+=4){e.$x=t-a,e.$value=f(t+o);const r=n(e);g[v+0]=r.r,g[v+1]=r.g,g[v+2]=r.b,g[v+3]=~~(255*i(e))}}return h.putImageData(p,0,0),d}(e,n,a.dep?a:(0,m.a9)(a(n)),o.dep?o:(0,m.a9)(o(n)))})),e.reflow(!0).modifies(s)}}),(0,m.XW)(Ek,no,{transform(t,e){let n=this.value;return!n||t.modified("type")?(this.value=n=function(t){const e=Xw((t||"mercator").toLowerCase());e||(0,m.vU)("Unrecognized projection type: "+t);return e()}(t.type),Hw.forEach((e=>{null!=t[e]&&Dk(n,e,t[e])}))):Hw.forEach((e=>{t.modified(e)&&Dk(n,e,t[e])})),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function(t,e){const n=function(t){return t=(0,m.IX)(t),1===t.length?t[0]:{type:gk,features:t.reduce(((t,e)=>t.concat(function(t){return t.type===gk?t.features:(0,m.IX)(t).filter((t=>null!=t)).map((t=>t.type===mk?t:{type:mk,geometry:t}))}(e))),[])}}(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});var Tk=Fk.prototype=Ok.prototype;function zk(t){return function(){return t}}function Rk(t){return 1e-6*(t()-.5)}function Pk(t){return t.x+t.vx}function Lk(t){return t.y+t.vy}Tk.copy=function(){var t,e,n=new Ok(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=Nk(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var r=0;r<4;++r)(e=i.source[r])&&(e.length?t.push({source:e,target:i.target[r]=new Array(4)}):i.target[r]=Nk(e));return n},Tk.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Ak(this.cover(e,n),e,n,t)},Tk.addAll=function(t){var e,n,i,r,o=t.length,a=new Array(o),s=new Array(o),c=1/0,l=1/0,u=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(r=+this._y.call(null,e))||(a[n]=i,s[n]=r,i<c&&(c=i),i>u&&(u=i),r<l&&(l=r),r>f&&(f=r));if(c>u||l>f)return this;for(this.cover(c,l).cover(u,f),n=0;n<o;++n)Ak(this,a[n],s[n],t[n]);return this},Tk.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,o=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,o=(i=Math.floor(e))+1;else{for(var a,s,c=r-n||1,l=this._root;n>t||t>=r||i>e||e>=o;)switch(s=(e<i)<<1|t<n,(a=new Array(4))[s]=l,l=a,c*=2,s){case 0:r=n+c,o=i+c;break;case 1:n=r-c,o=i+c;break;case 2:r=n+c,i=o-c;break;case 3:n=r-c,i=o-c}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this},Tk.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},Tk.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Tk.find=function(t,e,n){var i,r,o,a,s,c,l,u=this._x0,f=this._y0,d=this._x1,h=this._y1,p=[],m=this._root;for(m&&p.push(new Sk(m,u,f,d,h)),null==n?n=1/0:(u=t-n,f=e-n,d=t+n,h=e+n,n*=n);c=p.pop();)if(!(!(m=c.node)||(r=c.x0)>d||(o=c.y0)>h||(a=c.x1)<u||(s=c.y1)<f))if(m.length){var g=(r+a)/2,v=(o+s)/2;p.push(new Sk(m[3],g,v,a,s),new Sk(m[2],r,v,g,s),new Sk(m[1],g,o,a,v),new Sk(m[0],r,o,g,v)),(l=(e>=v)<<1|t>=g)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=c)}else{var y=t-+this._x.call(null,m.data),b=e-+this._y.call(null,m.data),x=y*y+b*b;if(x<n){var _=Math.sqrt(n=x);u=t-_,f=e-_,d=t+_,h=e+_,i=m.data}}return i},Tk.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,i,r,o,a,s,c,l,u,f,d,h=this._root,p=this._x0,m=this._y0,g=this._x1,v=this._y1;if(!h)return this;if(h.length)for(;;){if((l=o>=(s=(p+g)/2))?p=s:g=s,(u=a>=(c=(m+v)/2))?m=c:v=c,e=h,!(h=h[f=u<<1|l]))return this;if(!h.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,d=f)}for(;h.data!==t;)if(i=h,!(h=h.next))return this;return(r=h.next)&&delete h.next,i?(r?i.next=r:delete i.next,this):e?(r?e[f]=r:delete e[f],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=r,this)},Tk.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Tk.root=function(){return this._root},Tk.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},Tk.visit=function(t){var e,n,i,r,o,a,s=[],c=this._root;for(c&&s.push(new Sk(c,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(c=e.node,i=e.x0,r=e.y0,o=e.x1,a=e.y1)&&c.length){var l=(i+o)/2,u=(r+a)/2;(n=c[3])&&s.push(new Sk(n,l,u,o,a)),(n=c[2])&&s.push(new Sk(n,i,u,l,a)),(n=c[1])&&s.push(new Sk(n,l,r,o,u)),(n=c[0])&&s.push(new Sk(n,i,r,l,u))}return this},Tk.visitAfter=function(t){var e,n=[],i=[];for(this._root&&n.push(new Sk(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var r=e.node;if(r.length){var o,a=e.x0,s=e.y0,c=e.x1,l=e.y1,u=(a+c)/2,f=(s+l)/2;(o=r[0])&&n.push(new Sk(o,a,s,u,f)),(o=r[1])&&n.push(new Sk(o,u,s,c,f)),(o=r[2])&&n.push(new Sk(o,a,f,u,l)),(o=r[3])&&n.push(new Sk(o,u,f,c,l))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},Tk.x=function(t){return arguments.length?(this._x=t,this):this._x},Tk.y=function(t){return arguments.length?(this._y=t,this):this._y};var jk={value:()=>{}};function Bk(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new Uk(i)}function Uk(t){this._=t}function Ik(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function qk(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=jk,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}Uk.prototype=Bk.prototype={constructor:Uk,on:function(t,e){var n,i,r=this._,o=(i=r,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!==typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)r[n]=qk(r[n],t.name,e);else if(null==e)for(n in r)r[n]=qk(r[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=Ik(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Uk(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(i=this._[t]).length;o<n;++o)i[o].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};const Wk=Bk;var Hk=n(89121);const Xk=1664525,Jk=1013904223,Gk=4294967296;function $k(t){return t.x}function Vk(t){return t.y}var Yk=10,Kk=Math.PI*(3-Math.sqrt(5));function Zk(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,a=.6,s=new Map,c=(0,Hk.HT)(f),l=Wk("tick","end"),u=function(){let t=1;return()=>(t=(Xk*t+Jk)%Gk)/Gk}();function f(){d(),l.call("tick",e),n<i&&(c.stop(),l.call("end",e))}function d(i){var c,l,u=t.length;void 0===i&&(i=1);for(var f=0;f<i;++f)for(n+=(o-n)*r,s.forEach((function(t){t(n)})),c=0;c<u;++c)null==(l=t[c]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function h(){for(var e,n=0,i=t.length;n<i;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var r=Yk*Math.sqrt(.5+n),o=n*Kk;e.x=r*Math.cos(o),e.y=r*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),h(),e={tick:d,restart:function(){return c.restart(f),e},stop:function(){return c.stop(),e},nodes:function(n){return arguments.length?(t=n,h(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(i=+t,e):i},alphaDecay:function(t){return arguments.length?(r=+t,e):+r},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(u=t,s.forEach(p),e):u},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,i){var r,o,a,s,c,l=0,u=t.length;for(null==i?i=1/0:i*=i,l=0;l<u;++l)(a=(r=e-(s=t[l]).x)*r+(o=n-s.y)*o)<i&&(c=s,i=a);return c},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}function Qk(t){return t.index}function tE(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}const eE={center:function(t,e){var n,i=1;function r(){var r,o,a=n.length,s=0,c=0;for(r=0;r<a;++r)s+=(o=n[r]).x,c+=o.y;for(s=(s/a-t)*i,c=(c/a-e)*i,r=0;r<a;++r)(o=n[r]).x-=s,o.y-=c}return null==t&&(t=0),null==e&&(e=0),r.initialize=function(t){n=t},r.x=function(e){return arguments.length?(t=+e,r):t},r.y=function(t){return arguments.length?(e=+t,r):e},r.strength=function(t){return arguments.length?(i=+t,r):i},r},collide:function(t){var e,n,i,r=1,o=1;function a(){for(var t,a,c,l,u,f,d,h=e.length,p=0;p<o;++p)for(a=Fk(e,Pk,Lk).visitAfter(s),t=0;t<h;++t)c=e[t],f=n[c.index],d=f*f,l=c.x+c.vx,u=c.y+c.vy,a.visit(m);function m(t,e,n,o,a){var s=t.data,h=t.r,p=f+h;if(!s)return e>l+p||o<l-p||n>u+p||a<u-p;if(s.index>c.index){var m=l-s.x-s.vx,g=u-s.y-s.vy,v=m*m+g*g;v<p*p&&(0===m&&(v+=(m=Rk(i))*m),0===g&&(v+=(g=Rk(i))*g),v=(p-(v=Math.sqrt(v)))/v*r,c.vx+=(m*=v)*(p=(h*=h)/(d+h)),c.vy+=(g*=v)*p,s.vx-=m*(p=1-p),s.vy-=g*p)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function c(){if(e){var i,r,o=e.length;for(n=new Array(o),i=0;i<o;++i)r=e[i],n[r.index]=+t(r,i,e)}}return"function"!==typeof t&&(t=zk(null==t?1:+t)),a.initialize=function(t,n){e=t,i=n,c()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(r=+t,a):r},a.radius=function(e){return arguments.length?(t="function"===typeof e?e:zk(+e),c(),a):t},a},nbody:function(){var t,e,n,i,r,o=zk(-30),a=1,s=1/0,c=.81;function l(n){var r,o=t.length,a=Fk(t,$k,Vk).visitAfter(f);for(i=n,r=0;r<o;++r)e=t[r],a.visit(d)}function u(){if(t){var e,n,i=t.length;for(r=new Array(i),e=0;e<i;++e)n=t[e],r[n.index]=+o(n,e,t)}}function f(t){var e,n,i,o,a,s=0,c=0;if(t.length){for(i=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,c+=n,i+=n*e.x,o+=n*e.y);t.x=i/c,t.y=o/c}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=r[e.data.index]}while(e=e.next)}t.value=s}function d(t,o,l,u){if(!t.value)return!0;var f=t.x-e.x,d=t.y-e.y,h=u-o,p=f*f+d*d;if(h*h/c<p)return p<s&&(0===f&&(p+=(f=Rk(n))*f),0===d&&(p+=(d=Rk(n))*d),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*i/p,e.vy+=d*t.value*i/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=Rk(n))*f),0===d&&(p+=(d=Rk(n))*d),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(h=r[t.data.index]*i/p,e.vx+=f*h,e.vy+=d*h)}while(t=t.next)}}return l.initialize=function(e,i){t=e,n=i,u()},l.strength=function(t){return arguments.length?(o="function"===typeof t?t:zk(+t),u(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l.theta=function(t){return arguments.length?(c=t*t,l):Math.sqrt(c)},l},link:function(t){var e,n,i,r,o,a,s=Qk,c=function(t){return 1/Math.min(r[t.source.index],r[t.target.index])},l=zk(30),u=1;function f(i){for(var r=0,s=t.length;r<u;++r)for(var c,l,f,d,h,p,m,g=0;g<s;++g)l=(c=t[g]).source,d=(f=c.target).x+f.vx-l.x-l.vx||Rk(a),h=f.y+f.vy-l.y-l.vy||Rk(a),d*=p=((p=Math.sqrt(d*d+h*h))-n[g])/p*i*e[g],h*=p,f.vx-=d*(m=o[g]),f.vy-=h*m,l.vx+=d*(m=1-m),l.vy+=h*m}function d(){if(i){var a,c,l=i.length,u=t.length,f=new Map(i.map(((t,e)=>[s(t,e,i),t])));for(a=0,r=new Array(l);a<u;++a)(c=t[a]).index=a,"object"!==typeof c.source&&(c.source=tE(f,c.source)),"object"!==typeof c.target&&(c.target=tE(f,c.target)),r[c.source.index]=(r[c.source.index]||0)+1,r[c.target.index]=(r[c.target.index]||0)+1;for(a=0,o=new Array(u);a<u;++a)c=t[a],o[a]=r[c.source.index]/(r[c.source.index]+r[c.target.index]);e=new Array(u),h(),n=new Array(u),p()}}function h(){if(i)for(var n=0,r=t.length;n<r;++n)e[n]=+c(t[n],n,t)}function p(){if(i)for(var e=0,r=t.length;e<r;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){i=t,a=e,d()},f.links=function(e){return arguments.length?(t=e,d(),f):t},f.id=function(t){return arguments.length?(s=t,f):s},f.iterations=function(t){return arguments.length?(u=+t,f):u},f.strength=function(t){return arguments.length?(c="function"===typeof t?t:zk(+t),h(),f):c},f.distance=function(t){return arguments.length?(l="function"===typeof t?t:zk(+t),p(),f):l},f},x:function(t){var e,n,i,r=zk(.1);function o(t){for(var r,o=0,a=e.length;o<a;++o)(r=e[o]).vx+=(i[o]-r.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),i=new Array(a),o=0;o<a;++o)n[o]=isNaN(i[o]=+t(e[o],o,e))?0:+r(e[o],o,e)}}return"function"!==typeof t&&(t=zk(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(r="function"===typeof t?t:zk(+t),a(),o):r},o.x=function(e){return arguments.length?(t="function"===typeof e?e:zk(+e),a(),o):t},o},y:function(t){var e,n,i,r=zk(.1);function o(t){for(var r,o=0,a=e.length;o<a;++o)(r=e[o]).vy+=(i[o]-r.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),i=new Array(a),o=0;o<a;++o)n[o]=isNaN(i[o]=+t(e[o],o,e))?0:+r(e[o],o,e)}}return"function"!==typeof t&&(t=zk(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(r="function"===typeof t?t:zk(+t),a(),o):r},o.y=function(e){return arguments.length?(t="function"===typeof e?e:zk(+e),a(),o):t},o}},nE="forces",iE=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],rE=["static","iterations"],oE=["x","y","vx","vy"];function aE(t){no.call(this,null,t)}function sE(t,e,n,i){var r,o,a,s,c=(0,m.IX)(e.forces);for(r=0,o=iE.length;r<o;++r)(a=iE[r])!==nE&&e.modified(a)&&t[a](e[a]);for(r=0,o=c.length;r<o;++r)s=nE+r,(a=n||e.modified(nE,r)?lE(c[r]):i&&cE(c[r],i)?t.force(s):null)&&t.force(s,a);for(o=t.numForces||0;r<o;++r)t.force(nE+r,null);return t.numForces=c.length,t}function cE(t,e){var n,i;for(n in t)if((0,m.mf)(i=t[n])&&e.modified((0,m.Oj)(i)))return 1;return 0}function lE(t){var e,n;for(n in(0,m.nr)(eE,t.force)||(0,m.vU)("Unrecognized force: "+t.force),e=eE[t.force](),t)(0,m.mf)(e[n])&&uE(e[n],t[n],t);return e}function uE(t,e,n){t((0,m.mf)(e)?t=>e(t,n):e)}function fE(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function dE(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=pE)):void 0===e&&(e=hE);for(var n,i,r,o,a,s=new vE(t),c=[s];n=c.pop();)if((r=e(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)c.push(i=r[o]=new vE(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(gE)}function hE(t){return t.children}function pE(t){return Array.isArray(t)?t[1]:null}function mE(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function gE(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function vE(t){this.data=t,this.depth=this.height=0,this.parent=null}function yE(t){return null==t?null:bE(t)}function bE(t){if("function"!==typeof t)throw new Error;return t}function xE(){return 0}function _E(t){return function(){return t}}aE.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:oE}]},(0,m.XW)(aE,no,{transform(t,e){var n,i,r=this.value,o=e.changed(e.ADD_REM),a=t.modified(iE),s=t.iterations||300;if(r?(o&&(e.modifies("index"),r.nodes(e.source)),(a||e.changed(e.MOD))&&sE(r,t,0,e)):(this.value=r=function(t,e){const n=Zk(t),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),sE(n,e,!0).on("end",(()=>o=!0))}(e.source,t),r.on("tick",(n=e.dataflow,i=this,()=>n.touch(i).run())),t.static||(o=!0,r.tick()),e.modifies("index")),a||o||t.modified(rE)||e.changed()&&t.restart)if(r.alpha(Math.max(r.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(r.alphaMin(),1/s)),t.static)for(r.stop();--s>=0;)r.tick();else if(r.stopped()&&r.restart(),!o)return e.StopPropagation;return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let s,c=this._argops,l=0,u=c.length;l<u;++l)if(s=c[l],s.name===nE&&"link"===s.op._argval.force)for(var i,r=s.op._argops,o=0,a=r.length;o<a;++o)if("links"===r[o].name&&(i=r[o].op.source)){n.pulse(i,n.changeset().reflow());break}return e.reflow(t.modified()).modifies(oE)}}),vE.prototype=dE.prototype={constructor:vE,count:function(){return this.eachAfter(fE)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,a=[o],s=[],c=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)t.call(e,o,++c,this);return this},eachBefore:function(t,e){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(t.call(e,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop(),e=i.pop();for(;t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return dE(this).eachBefore(mE)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n<i;++n)o.push(e[n])}while(o.length)}};const wE=1664525,kE=1013904223,EE=4294967296;function DE(t,e){for(var n,i,r=0,o=(t=function(t,e){let n,i,r=t.length;for(;r;)i=e()*r--|0,n=t[r],t[r]=t[i],t[i]=n;return t}(Array.from(t),e)).length,a=[];r<o;)n=t[r],i&&ME(i,n)?++r:(i=FE(a=AE(a,n)),r=0);return i}function AE(t,e){var n,i;if(CE(e,t))return[e];for(n=0;n<t.length;++n)if(SE(e,t[n])&&CE(OE(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(i=n+1;i<t.length;++i)if(SE(OE(t[n],t[i]),e)&&SE(OE(t[n],e),t[i])&&SE(OE(t[i],e),t[n])&&CE(NE(t[n],t[i],e),t))return[t[n],t[i],e];throw new Error}function SE(t,e){var n=t.r-e.r,i=e.x-t.x,r=e.y-t.y;return n<0||n*n<i*i+r*r}function ME(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function CE(t,e){for(var n=0;n<e.length;++n)if(!ME(t,e[n]))return!1;return!0}function FE(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return OE(t[0],t[1]);case 3:return NE(t[0],t[1],t[2])}}function OE(t,e){var n=t.x,i=t.y,r=t.r,o=e.x,a=e.y,s=e.r,c=o-n,l=a-i,u=s-r,f=Math.sqrt(c*c+l*l);return{x:(n+o+c/f*u)/2,y:(i+a+l/f*u)/2,r:(f+r+s)/2}}function NE(t,e,n){var i=t.x,r=t.y,o=t.r,a=e.x,s=e.y,c=e.r,l=n.x,u=n.y,f=n.r,d=i-a,h=i-l,p=r-s,m=r-u,g=c-o,v=f-o,y=i*i+r*r-o*o,b=y-a*a-s*s+c*c,x=y-l*l-u*u+f*f,_=h*p-d*m,w=(p*x-m*b)/(2*_)-i,k=(m*g-p*v)/_,E=(h*b-d*x)/(2*_)-r,D=(d*v-h*g)/_,A=k*k+D*D-1,S=2*(o+w*k+E*D),M=w*w+E*E-o*o,C=-(Math.abs(A)>1e-6?(S+Math.sqrt(S*S-4*A*M))/(2*A):M/S);return{x:i+w+k*C,y:r+E+D*C,r:C}}function TE(t,e,n){var i,r,o,a,s=t.x-e.x,c=t.y-e.y,l=s*s+c*c;l?(r=e.r+n.r,r*=r,a=t.r+n.r,r>(a*=a)?(i=(l+a-r)/(2*l),o=Math.sqrt(Math.max(0,a/l-i*i)),n.x=t.x-i*s-o*c,n.y=t.y-i*c+o*s):(i=(l+r-a)/(2*l),o=Math.sqrt(Math.max(0,r/l-i*i)),n.x=e.x+i*s-o*c,n.y=e.y+i*c+o*s)):(n.x=e.x+n.r,n.y=e.y)}function zE(t,e){var n=t.r+e.r-1e-6,i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function RE(t){var e=t._,n=t.next._,i=e.r+n.r,r=(e.x*n.r+n.x*e.r)/i,o=(e.y*n.r+n.y*e.r)/i;return r*r+o*o}function PE(t){this._=t,this.next=null,this.previous=null}function LE(t,e){if(!(o=(t=function(t){return"object"===typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,i,r,o,a,s,c,l,u,f,d;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(i=t[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;TE(i,n,r=t[2]),n=new PE(n),i=new PE(i),r=new PE(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;t:for(c=3;c<o;++c){TE(n._,i._,r=t[c]),r=new PE(r),l=i.next,u=n.previous,f=i._.r,d=n._.r;do{if(f<=d){if(zE(l._,r._)){i=l,n.next=i,i.previous=n,--c;continue t}f+=l._.r,l=l.next}else{if(zE(u._,r._)){(n=u).next=i,i.previous=n,--c;continue t}d+=u._.r,u=u.previous}}while(l!==u.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,a=RE(n);(r=r.next)!==i;)(s=RE(r))<a&&(n=r,a=s);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=DE(n,e),c=0;c<o;++c)(n=t[c]).x-=r.x,n.y-=r.y;return r.r}function jE(t){return Math.sqrt(t.value)}function BE(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function UE(t,e,n){return function(i){if(r=i.children){var r,o,a,s=r.length,c=t(i)*e||0;if(c)for(o=0;o<s;++o)r[o].r+=c;if(a=LE(r,n),c)for(o=0;o<s;++o)r[o].r-=c;i.r=a+c}}}function IE(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function qE(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function WE(t,e,n,i,r){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(i-e)/t.value;++s<c;)(o=a[s]).y0=n,o.y1=r,o.x0=e,o.x1=e+=o.value*l}var HE={depth:-1},XE={},JE={};function GE(t){return t.id}function $E(t){return t.parentId}function VE(){var t,e=GE,n=$E;function i(i){var r,o,a,s,c,l,u,f,d=Array.from(i),h=e,p=n,m=new Map;if(null!=t){const e=d.map(((e,n)=>function(t){t="".concat(t);let e=t.length;KE(t,e-1)&&!KE(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:"/".concat(t)}(t(e,n,i)))),n=e.map(YE),r=new Set(e).add("");for(const t of n)r.has(t)||(r.add(t),e.push(t),n.push(YE(t)),d.push(JE));h=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,r=d.length;a<r;++a)o=d[a],l=d[a]=new vE(o),null!=(u=h(o,a,i))&&(u+="")&&(f=l.id=u,m.set(f,m.has(f)?XE:l)),null!=(u=p(o,a,i))&&(u+="")&&(l.parent=u);for(a=0;a<r;++a)if(u=(l=d[a]).parent){if(!(c=m.get(u)))throw new Error("missing: "+u);if(c===XE)throw new Error("ambiguous: "+u);c.children?c.children.push(l):c.children=[l],l.parent=c}else{if(s)throw new Error("multiple roots");s=l}if(!s)throw new Error("no root");if(null!=t){for(;s.data===JE&&1===s.children.length;)s=s.children[0],--r;for(let t=d.length-1;t>=0&&(l=d[t]).data===JE;--t)l.data=null}if(s.parent=HE,s.eachBefore((function(t){t.depth=t.parent.depth+1,--r})).eachBefore(gE),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(t){return arguments.length?(e=yE(t),i):e},i.parentId=function(t){return arguments.length?(n=yE(t),i):n},i.path=function(e){return arguments.length?(t=yE(e),i):t},i}function YE(t){let e=t.length;if(e<2)return"";for(;--e>1&&!KE(t,e););return t.slice(0,e)}function KE(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(0===(1&n))return!0}return!1}function ZE(t,e){return t.parent===e.parent?1:2}function QE(t){var e=t.children;return e?e[0]:t.t}function tD(t){var e=t.children;return e?e[e.length-1]:t.t}function eD(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function nD(t,e,n){return t.a.parent===e.parent?t.a:n}function iD(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function rD(t,e){return t.parent===e.parent?1:2}function oD(t,e){return t+e.x}function aD(t,e){return Math.max(t,e.y)}function sD(t,e,n,i,r){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(r-n)/t.value;++s<c;)(o=a[s]).x0=e,o.x1=i,o.y0=n,o.y1=n+=o.value*l}iD.prototype=Object.create(vE.prototype);var cD=(1+Math.sqrt(5))/2;function lD(t,e,n,i,r,o){for(var a,s,c,l,u,f,d,h,p,m,g,v=[],y=e.children,b=0,x=0,_=y.length,w=e.value;b<_;){c=r-n,l=o-i;do{u=y[x++].value}while(!u&&x<_);for(f=d=u,g=u*u*(m=Math.max(l/c,c/l)/(w*t)),p=Math.max(d/g,g/f);x<_;++x){if(u+=s=y[x].value,s<f&&(f=s),s>d&&(d=s),g=u*u*m,(h=Math.max(d/g,g/f))>p){u-=s;break}p=h}v.push(a={value:u,dice:c<l,children:y.slice(b,x)}),a.dice?WE(a,n,i,r,w?i+=l*u/w:o):sD(a,n,i,w?n+=c*u/w:r,o),w-=u,b=x}return v}const uD=function t(e){function n(t,n,i,r,o){lD(e,t,n,i,r,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(cD),fD=function t(e){function n(t,n,i,r,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,c,l,u,f=-1,d=a.length,h=t.value;++f<d;){for(c=(s=a[f]).children,l=s.value=0,u=c.length;l<u;++l)s.value+=c[l].value;s.dice?WE(s,n,i,r,h?i+=(o-i)*s.value/h:o):sD(s,n,i,h?n+=(r-n)*s.value/h:r,o),h-=s.value}else t._squarify=a=lD(e,t,n,i,r,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(cD);function dD(t,e,n){const i={};return t.each((t=>{const r=t.data;n(r)&&(i[e(r)]=t)})),t.lookup=i,t}function hD(t){no.call(this,null,t)}hD.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const pD=t=>t.values;function mD(){const t=[],e={entries:t=>i(n(t,0),0),key:n=>(t.push(n),e)};function n(e,i){if(i>=t.length)return e;const r=e.length,o=t[i++],a={},s={};let c,l,u,f=-1;for(;++f<r;)c=o(l=e[f])+"",(u=a[c])?u.push(l):a[c]=[l];for(c in a)s[c]=n(a[c],i);return s}function i(e,n){if(++n>t.length)return e;const r=[];for(const t in e)r.push({key:t,values:i(e[t],n)});return r}return e}function gD(t){no.call(this,null,t)}(0,m.XW)(hD,no,{transform(t,e){e.source||(0,m.vU)("Nest transform requires an upstream data source.");var n=t.generate,i=t.modified(),r=e.clone(),o=this.value;return(!o||i||e.changed())&&(o&&o.each((t=>{t.children&&wr(t.data)&&r.rem.push(t.data)})),this.value=o=dE({values:(0,m.IX)(t.keys).reduce(((t,e)=>(t.key(e),t)),mD()).entries(r.source)},pD),n&&o.each((t=>{t.children&&(t=Dr(t.data),r.add.push(t),r.source.push(t))})),dD(o,kr,kr)),r.source.root=o,r}});const vD=(t,e)=>t.parent===e.parent?1:2;(0,m.XW)(gD,no,{transform(t,e){e.source&&e.source.root||(0,m.vU)(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(t.method),i=this.fields,r=e.source.root,o=t.as||i;t.field?r.sum(t.field):r.count(),t.sort&&r.sort(Cr(t.sort,(t=>t.data))),function(t,e,n){for(let i,r=0,o=e.length;r<o;++r)i=e[r],i in n&&t[i](n[i])}(n,this.params,t),n.separation&&n.separation(!1!==t.separation?vD:m.kX);try{this.value=n(r)}catch(a){(0,m.vU)(a)}return r.each((t=>function(t,e,n){const i=t.data,r=e.length-1;for(let o=0;o<r;++o)i[n[o]]=t[e[o]];i[n[r]]=t.children?t.children.length:0}(t,i,o))),e.reflow(t.modified()).modifies(o).modifies("leaf")}});const yD=["x","y","r","depth","children"];function bD(t){gD.call(this,t)}bD.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:yD.length,default:yD}]},(0,m.XW)(bD,gD,{layout:function(){var t=null,e=1,n=1,i=xE;function r(r){const o=function(){let t=1;return()=>(t=(wE*t+kE)%EE)/EE}();return r.x=e/2,r.y=n/2,t?r.eachBefore(BE(t)).eachAfter(UE(i,.5,o)).eachBefore(IE(1)):r.eachBefore(BE(jE)).eachAfter(UE(xE,1,o)).eachAfter(UE(i,r.r/Math.min(e,n),o)).eachBefore(IE(Math.min(e,n)/(2*r.r))),r}return r.radius=function(e){return arguments.length?(t=yE(e),r):t},r.size=function(t){return arguments.length?(e=+t[0],n=+t[1],r):[e,n]},r.padding=function(t){return arguments.length?(i="function"===typeof t?t:_E(+t),r):i},r},params:["radius","size","padding"],fields:yD});const xD=["x0","y0","x1","y1","depth","children"];function _D(t){gD.call(this,t)}function wD(t){no.call(this,null,t)}_D.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:xD.length,default:xD}]},(0,m.XW)(_D,gD,{layout:function(){var t=1,e=1,n=0,i=!1;function r(r){var o=r.height+1;return r.x0=r.y0=n,r.x1=t,r.y1=e/o,r.eachBefore(function(t,e){return function(i){i.children&&WE(i,i.x0,t*(i.depth+1)/e,i.x1,t*(i.depth+2)/e);var r=i.x0,o=i.y0,a=i.x1-n,s=i.y1-n;a<r&&(r=a=(r+a)/2),s<o&&(o=s=(o+s)/2),i.x0=r,i.y0=o,i.x1=a,i.y1=s}}(e,o)),i&&r.eachBefore(qE),r}return r.round=function(t){return arguments.length?(i=!!t,r):i},r.size=function(n){return arguments.length?(t=+n[0],e=+n[1],r):[t,e]},r.padding=function(t){return arguments.length?(n=+t,r):n},r},params:["size","round","padding"],fields:xD}),wD.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},(0,m.XW)(wD,no,{transform(t,e){e.source||(0,m.vU)("Stratify transform requires an upstream data source.");let n=this.value;const i=t.modified(),r=e.fork(e.ALL).materialize(e.SOURCE),o=!n||i||e.changed(e.ADD_REM)||e.modified(t.key.fields)||e.modified(t.parentKey.fields);return r.source=r.source.slice(),o&&(n=r.source.length?dD(VE().id(t.key).parentId(t.parentKey)(r.source),t.key,m.yb):dD(VE()([{}]),t.key,t.key)),r.source.root=this.value=n,r}});const kD={tidy:function(){var t=ZE,e=1,n=1,i=null;function r(r){var c=function(t){for(var e,n,i,r,o,a=new iD(t,0),s=[a];e=s.pop();)if(i=e._.children)for(e.children=new Array(o=i.length),r=o-1;r>=0;--r)s.push(n=e.children[r]=new iD(i[r],r)),n.parent=e;return(a.parent=new iD(null,0)).children=[a],a}(r);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),i)r.eachBefore(s);else{var l=r,u=r,f=r;r.eachBefore((function(t){t.x<l.x&&(l=t),t.x>u.x&&(u=t),t.depth>f.depth&&(f=t)}));var d=l===u?1:t(l,u)/2,h=d-l.x,p=e/(u.x+d+h),m=n/(f.depth||1);r.eachBefore((function(t){t.x=(t.x+h)*p,t.y=t.depth*m}))}return r}function o(e){var n=e.children,i=e.parent.children,r=e.i?i[e.i-1]:null;if(n){!function(t){for(var e,n=0,i=0,r=t.children,o=r.length;--o>=0;)(e=r[o]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;r?(e.z=r.z+t(e._,r._),e.m=e.z-o):e.z=o}else r&&(e.z=r.z+t(e._,r._));e.parent.A=function(e,n,i){if(n){for(var r,o=e,a=e,s=n,c=o.parent.children[0],l=o.m,u=a.m,f=s.m,d=c.m;s=tD(s),o=QE(o),s&&o;)c=QE(c),(a=tD(a)).a=e,(r=s.z+f-o.z-l+t(s._,o._))>0&&(eD(nD(s,e,i),e,r),l+=r,u+=r),f+=s.m,l+=o.m,d+=c.m,u+=a.m;s&&!tD(a)&&(a.t=s,a.m+=f-u),o&&!QE(c)&&(c.t=o,c.m+=l-d,i=e)}return i}(e,r,e.parent.A||i[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r},cluster:function(){var t=rD,e=1,n=1,i=!1;function r(r){var o,a=0;r.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(oD,0)/t.length}(n),e.y=function(t){return 1+t.reduce(aD,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(r),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(r),l=s.x-t(s,c)/2,u=c.x+t(c,s)/2;return r.eachAfter(i?function(t){t.x=(t.x-r.x)*e,t.y=(r.y-t.y)*n}:function(t){t.x=(t.x-l)/(u-l)*e,t.y=(1-(r.y?t.y/r.y:1))*n})}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r}},ED=["x","y","depth","children"];function DD(t){gD.call(this,t)}function AD(t){no.call(this,[],t)}DD.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:ED.length,default:ED}]},(0,m.XW)(DD,gD,{layout(t){const e=t||"tidy";if((0,m.nr)(kD,e))return kD[e]();(0,m.vU)("Unrecognized Tree layout method: "+e)},params:["size","nodeSize"],fields:ED}),AD.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},(0,m.XW)(AD,no,{transform(t,e){const n=this.value,i=e.source&&e.source.root,r=e.fork(e.NO_SOURCE),o={};return i||(0,m.vU)("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(r.rem=n,e.visit(e.SOURCE,(t=>o[kr(t)]=1)),i.each((t=>{const e=t.data,n=t.parent&&t.parent.data;n&&o[kr(e)]&&o[kr(n)]&&r.add.push(Dr({source:n,target:e}))})),this.value=r.add):e.changed(e.MOD)&&(e.visit(e.MOD,(t=>o[kr(t)]=1)),n.forEach((t=>{(o[kr(t.source)]||o[kr(t.target)])&&r.mod.push(t)}))),r}});const SD={binary:function(t,e,n,i,r){var o,a,s=t.children,c=s.length,l=new Array(c+1);for(l[0]=a=o=0;o<c;++o)l[o+1]=a+=s[o].value;!function t(e,n,i,r,o,a,c){if(e>=n-1){var u=s[e];return u.x0=r,u.y0=o,u.x1=a,void(u.y1=c)}var f=l[e],d=i/2+f,h=e+1,p=n-1;for(;h<p;){var m=h+p>>>1;l[m]<d?h=m+1:p=m}d-l[h-1]<l[h]-d&&e+1<h&&--h;var g=l[h]-f,v=i-g;if(a-r>c-o){var y=i?(r*v+a*g)/i:a;t(e,h,g,r,o,y,c),t(h,n,v,y,o,a,c)}else{var b=i?(o*v+c*g)/i:c;t(e,h,g,r,o,a,b),t(h,n,v,r,b,a,c)}}(0,c,t.value,e,n,i,r)},dice:WE,slice:sD,slicedice:function(t,e,n,i,r){(1&t.depth?sD:WE)(t,e,n,i,r)},squarify:uD,resquarify:fD},MD=["x0","y0","x1","y1","depth","children"];function CD(t){gD.call(this,t)}CD.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:MD.length,default:MD}]},(0,m.XW)(CD,gD,{layout(){const t=function(){var t=uD,e=!1,n=1,i=1,r=[0],o=xE,a=xE,s=xE,c=xE,l=xE;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=i,t.eachBefore(f),r=[0],e&&t.eachBefore(qE),t}function f(e){var n=r[e.depth],i=e.x0+n,u=e.y0+n,f=e.x1-n,d=e.y1-n;f<i&&(i=f=(i+f)/2),d<u&&(u=d=(u+d)/2),e.x0=i,e.y0=u,e.x1=f,e.y1=d,e.children&&(n=r[e.depth+1]=o(e)/2,i+=l(e)-n,u+=a(e)-n,(f-=s(e)-n)<i&&(i=f=(i+f)/2),(d-=c(e)-n)<u&&(u=d=(u+d)/2),t(e,i,u,f,d))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],i=+t[1],u):[n,i]},u.tile=function(e){return arguments.length?(t=bE(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(o="function"===typeof t?t:_E(+t),u):o},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(a="function"===typeof t?t:_E(+t),u):a},u.paddingRight=function(t){return arguments.length?(s="function"===typeof t?t:_E(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"===typeof t?t:_E(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"===typeof t?t:_E(+t),u):l},u}();return t.ratio=e=>{const n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=e=>{(0,m.nr)(SD,e)?t.tile(SD[e]):(0,m.vU)("Unrecognized Treemap layout method: "+e)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:MD});const FD=4278190080;function OD(t,e,n){return new Uint32Array(t.getImageData(0,0,e,n).data.buffer)}function ND(t,e,n){if(!e.length)return;const i=e[0].mark.marktype;"group"===i?e.forEach((e=>{e.items.forEach((e=>ND(t,e.items,n)))})):Hm[i].draw(t,{items:n?e.map(TD):e})}function TD(t){const e=Sr(t,{});return e.stroke&&0!==e.strokeOpacity||e.fill&&0!==e.fillOpacity?{...e,strokeOpacity:1,stroke:"#000",fillOpacity:0}:e}const zD=5,RD=31,PD=32,LD=new Uint32Array(PD+1),jD=new Uint32Array(PD+1);jD[0]=0,LD[0]=~jD[0];for(let Hz=1;Hz<=PD;++Hz)jD[Hz]=jD[Hz-1]<<1|1,LD[Hz]=~jD[Hz];function BD(t,e,n){const i=Math.max(1,Math.sqrt(t*e/1e6)),r=~~((t+2*n+i)/i),o=~~((e+2*n+i)/i),a=t=>~~((t+n)/i);return a.invert=t=>t*i-n,a.bitmap=()=>function(t,e){const n=new Uint32Array(~~((t*e+PD)/PD));function i(t,e){n[t]|=e}function r(t,e){n[t]&=e}return{array:n,get:(e,i)=>{const r=i*t+e;return n[r>>>zD]&1<<(r&RD)},set:(e,n)=>{const r=n*t+e;i(r>>>zD,1<<(r&RD))},clear:(e,n)=>{const i=n*t+e;r(i>>>zD,~(1<<(i&RD)))},getRange:(e,i,r,o)=>{let a,s,c,l,u=o;for(;u>=i;--u)if(a=u*t+e,s=u*t+r,c=a>>>zD,l=s>>>zD,c===l){if(n[c]&LD[a&RD]&jD[1+(s&RD)])return!0}else{if(n[c]&LD[a&RD])return!0;if(n[l]&jD[1+(s&RD)])return!0;for(let t=c+1;t<l;++t)if(n[t])return!0}return!1},setRange:(e,n,r,o)=>{let a,s,c,l,u;for(;n<=o;++n)if(a=n*t+e,s=n*t+r,c=a>>>zD,l=s>>>zD,c===l)i(c,LD[a&RD]&jD[1+(s&RD)]);else for(i(c,LD[a&RD]),i(l,jD[1+(s&RD)]),u=c+1;u<l;++u)i(u,4294967295)},clearRange:(e,n,i,o)=>{let a,s,c,l,u;for(;n<=o;++n)if(a=n*t+e,s=n*t+i,c=a>>>zD,l=s>>>zD,c===l)r(c,jD[a&RD]|LD[1+(s&RD)]);else for(r(c,jD[a&RD]),r(l,LD[1+(s&RD)]),u=c+1;u<l;++u)r(u,0)},outOfBounds:(n,i,r,o)=>n<0||i<0||o>=e||r>=t}}(r,o),a.ratio=i,a.padding=n,a.width=t,a.height=e,a}function UD(t,e,n,i,r,o){let a=n/2;return t-a<0||t+a>r||e-(a=i/2)<0||e+a>o}function ID(t,e,n,i,r,o,a,s){const c=r*o/(2*i),l=t(e-c),u=t(e+c),f=t(n-(o/=2)),d=t(n+o);return a.outOfBounds(l,f,u,d)||a.getRange(l,f,u,d)||s&&s.getRange(l,f,u,d)}const qD=[-1,-1,1,1],WD=[-1,1,-1,1];const HD=["right","center","left"],XD=["bottom","middle","top"];function JD(t,e,n,i,r,o,a,s,c,l,u,f){return!(r.outOfBounds(t,n,e,i)||(f&&o||r).getRange(t,n,e,i))}const GD={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},$D={naive:function(t,e,n,i){const r=t.width,o=t.height;return function(t){const e=t.datum.datum.items[i].items,n=e.length,a=t.datum.fontSize,s=Em.width(t.datum,t.datum.text);let c,l,u,f,d,h,p,m=0;for(let i=0;i<n;++i)c=e[i].x,u=e[i].y,l=void 0===e[i].x2?c:e[i].x2,f=void 0===e[i].y2?u:e[i].y2,d=(c+l)/2,h=(u+f)/2,p=Math.abs(l-c+f-u),p>=m&&(m=p,t.x=d,t.y=h);return d=s/2,h=a/2,c=t.x-d,l=t.x+d,u=t.y-h,f=t.y+h,t.align="center",c<0&&l<=r?t.align="left":0<=c&&r<l&&(t.align="right"),t.baseline="middle",u<0&&f<=o?t.baseline="top":0<=u&&o<f&&(t.baseline="bottom"),!0}},"reduced-search":function(t,e,n,i){const r=t.width,o=t.height,a=e[0],s=e[1];function c(e,n,i,c,l){const u=t.invert(e),f=t.invert(n);let d,h=i,p=o;if(!UD(u,f,c,l,r,o)&&!ID(t,u,f,l,c,h,a,s)&&!ID(t,u,f,l,c,l,a,null)){for(;p-h>=1;)d=(h+p)/2,ID(t,u,f,l,c,d,a,s)?p=d:h=d;if(h>i)return[u,f,h,!0]}}return function(e){const s=e.datum.datum.items[i].items,l=s.length,u=e.datum.fontSize,f=Em.width(e.datum,e.datum.text);let d,h,p,m,g,v,y,b,x,_,w,k,E,D,A,S,M,C=n?u:0,F=!1,O=!1,N=0;for(let i=0;i<l;++i){for(d=s[i].x,p=s[i].y,h=void 0===s[i].x2?d:s[i].x2,m=void 0===s[i].y2?p:s[i].y2,d>h&&(M=d,d=h,h=M),p>m&&(M=p,p=m,m=M),x=t(d),w=t(h),_=~~((x+w)/2),k=t(p),D=t(m),E=~~((k+D)/2),y=_;y>=x;--y)for(b=E;b>=k;--b)S=c(y,b,C,f,u),S&&([e.x,e.y,C,F]=S);for(y=_;y<=w;++y)for(b=E;b<=D;++b)S=c(y,b,C,f,u),S&&([e.x,e.y,C,F]=S);F||n||(A=Math.abs(h-d+m-p),g=(d+h)/2,v=(p+m)/2,A>=N&&!UD(g,v,f,u,r,o)&&!ID(t,g,v,u,f,u,a,null)&&(N=A,e.x=g,e.y=v,O=!0))}return!(!F&&!O)&&(g=f/2,v=u/2,a.setRange(t(e.x-g),t(e.y-v),t(e.x+g),t(e.y+v)),e.align="center",e.baseline="middle",!0)}},floodfill:function(t,e,n,i){const r=t.width,o=t.height,a=e[0],s=e[1],c=t.bitmap();return function(e){const l=e.datum.datum.items[i].items,u=l.length,f=e.datum.fontSize,d=Em.width(e.datum,e.datum.text),h=[];let p,m,g,v,y,b,x,_,w,k,E,D,A=n?f:0,S=!1,M=!1,C=0;for(let i=0;i<u;++i){for(p=l[i].x,g=l[i].y,m=void 0===l[i].x2?p:l[i].x2,v=void 0===l[i].y2?g:l[i].y2,h.push([t((p+m)/2),t((g+v)/2)]);h.length;)if([x,_]=h.pop(),!(a.get(x,_)||s.get(x,_)||c.get(x,_))){c.set(x,_);for(let t=0;t<4;++t)y=x+qD[t],b=_+WD[t],c.outOfBounds(y,b,y,b)||h.push([y,b]);if(y=t.invert(x),b=t.invert(_),w=A,k=o,!UD(y,b,d,f,r,o)&&!ID(t,y,b,f,d,w,a,s)&&!ID(t,y,b,f,d,f,a,null)){for(;k-w>=1;)E=(w+k)/2,ID(t,y,b,f,d,E,a,s)?k=E:w=E;w>A&&(e.x=y,e.y=b,A=w,S=!0)}}S||n||(D=Math.abs(m-p+v-g),y=(p+m)/2,b=(g+v)/2,D>=C&&!UD(y,b,d,f,r,o)&&!ID(t,y,b,f,d,f,a,null)&&(C=D,e.x=y,e.y=b,M=!0))}return!(!S&&!M)&&(y=d/2,b=f/2,a.setRange(t(e.x-y),t(e.y-b),t(e.x+y),t(e.y+b)),e.align="center",e.baseline="middle",!0)}}};function VD(t,e,n,i,r,o,a,s,c,l,u){if(!t.length)return t;const f=Math.max(i.length,r.length),d=function(t,e){const n=new Float64Array(e),i=t.length;for(let r=0;r<i;++r)n[r]=t[r]||0;for(let r=i;r<e;++r)n[r]=n[i-1];return n}(i,f),h=function(t,e){const n=new Int8Array(e),i=t.length;for(let r=0;r<i;++r)n[r]|=GD[t[r]];for(let r=i;r<e;++r)n[r]=n[i-1];return n}(r,f),p=(x=t[0].datum)&&x.mark&&x.mark.marktype,m="group"===p&&t[0].datum.items[c].marktype,g="area"===m,v=function(t,e,n,i){const r=t=>[t.x,t.x,t.x,t.y,t.y,t.y];return t?"line"===t||"area"===t?t=>r(t.datum):"line"===e?t=>{const e=t.datum.items[i].items;return r(e.length?e["start"===n?0:e.length-1]:{x:NaN,y:NaN})}:t=>{const e=t.datum.bounds;return[e.x1,(e.x1+e.x2)/2,e.x2,e.y1,(e.y1+e.y2)/2,e.y2]}:r}(p,m,s,c),y=null===l||l===1/0,b=g&&"naive"===u;var x;let _=-1,w=-1;const k=t.map((t=>{const e=y?Em.width(t,t.text):void 0;return _=Math.max(_,e),w=Math.max(w,t.fontSize),{datum:t,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:v(t),textWidth:e}}));l=null===l||l===1/0?Math.max(_,w)+Math.max(...i):l;const E=BD(e[0],e[1],l);let D;if(!b){n&&k.sort(((t,e)=>n(t.datum,e.datum)));let e=!1;for(let t=0;t<h.length&&!e;++t)e=5===h[t]||d[t]<0;const i=(p&&a||g)&&t.map((t=>t.datum));D=o.length||i?function(t,e,n,i,r){const o=t.width,a=t.height,s=i||r,c=gl(o,a).getContext("2d"),l=gl(o,a).getContext("2d"),u=s&&gl(o,a).getContext("2d");n.forEach((t=>ND(c,t,!1))),ND(l,e,!1),s&&ND(u,e,!0);const f=OD(c,o,a),d=OD(l,o,a),h=s&&OD(u,o,a),p=t.bitmap(),m=s&&t.bitmap();let g,v,y,b,x,_,w,k;for(v=0;v<a;++v)for(g=0;g<o;++g)x=v*o+g,_=f[x]&FD,k=d[x]&FD,w=s&&h[x]&FD,(_||w||k)&&(y=t(g),b=t(v),r||!_&&!k||p.set(y,b),s&&(_||w)&&m.set(y,b));return[p,m]}(E,i||[],o,e,g):function(t,e){const n=t.bitmap();return(e||[]).forEach((e=>n.set(t(e.boundary[0]),t(e.boundary[3])))),[n,void 0]}(E,a&&k)}const A=g?$D[u](E,D,a,c):function(t,e,n,i){const r=t.width,o=t.height,a=e[0],s=e[1],c=i.length;return function(e){var l;const u=e.boundary,f=e.datum.fontSize;if(u[2]<0||u[5]<0||u[0]>r||u[3]>o)return!1;let d,h,p,m,g,v,y,b,x,_,w,k,E,D,A,S=null!==(l=e.textWidth)&&void 0!==l?l:0;for(let r=0;r<c;++r){if(d=(3&n[r])-1,h=(n[r]>>>2&3)-1,p=0===d&&0===h||i[r]<0,m=d&&h?Math.SQRT1_2:1,g=i[r]<0?-1:1,v=u[1+d]+i[r]*d*m,w=u[4+h]+g*f*h/2+i[r]*h*m,b=w-f/2,x=w+f/2,k=t(v),D=t(b),A=t(x),!S){if(!JD(k,k,D,A,a,s,0,0,0,0,0,p))continue;S=Em.width(e.datum,e.datum.text)}if(_=v+g*S*d/2,v=_-S/2,y=_+S/2,k=t(v),E=t(y),JD(k,E,D,A,a,s,0,0,0,0,0,p))return e.x=d?d*g<0?y:v:_,e.y=h?h*g<0?x:b:w,e.align=HD[d*g+1],e.baseline=XD[h*g+1],a.setRange(k,D,E,A),!0}return!1}}(E,D,h,d);return k.forEach((t=>t.opacity=+A(t))),k}const YD=["x","y","opacity","align","baseline"],KD=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function ZD(t){no.call(this,null,t)}function QD(t,e){var n,i,r,o,a,s,c=[],l=function(t){return t(o)};if(null==e)c.push(t);else for(n={},i=0,r=t.length;i<r;++i)o=t[i],(s=n[a=e.map(l)])||(n[a]=s=[],s.dims=a,c.push(s)),s.push(o);return c}function tA(t){no.call(this,null,t)}ZD.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:KD},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:YD.length,default:YD}]},(0,m.XW)(ZD,no,{transform(t,e){const n=t.modified();if(!(n||e.changed(e.ADD_REM)||function(n){const i=t[n];return(0,m.mf)(i)&&e.modified(i.fields)}("sort")))return;t.size&&2===t.size.length||(0,m.vU)("Size parameter should be specified as a [width, height] array.");const i=t.as||YD;return VD(e.materialize(e.SOURCE).source||[],t.size,t.sort,(0,m.IX)(null==t.offset?1:t.offset),(0,m.IX)(t.anchor||KD),t.avoidMarks||[],!1!==t.avoidBaseMark,t.lineAnchor||"end",t.markIndex||0,void 0===t.padding?0:t.padding,t.method||"naive").forEach((t=>{const e=t.datum;e[i[0]]=t.x,e[i[1]]=t.y,e[i[2]]=t.opacity,e[i[3]]=t.align,e[i[4]]=t.baseline})),e.reflow(n).modifies(i)}}),tA.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},(0,m.XW)(tA,no,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=QD(e.materialize(e.SOURCE).source,t.groupby),r=(t.groupby||[]).map(m.el),o=r.length,a=t.as||[(0,m.el)(t.x),(0,m.el)(t.y)],s=[];i.forEach((e=>{ca(e,t.x,t.y,t.bandwidth||.3).forEach((t=>{const n={};for(let i=0;i<o;++i)n[r[i]]=e.dims[i];n[a[0]]=t[0],n[a[1]]=t[1],s.push(Dr(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=s}return n}});const eA={constant:$o,linear:Qo,log:ta,exp:ea,pow:na,quad:ia,poly:ra};function nA(t){no.call(this,null,t)}nA.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(eA)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},(0,m.XW)(nA,no,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=QD(e.materialize(e.SOURCE).source,t.groupby),r=(t.groupby||[]).map(m.el),o=t.method||"linear",a=null==t.order?3:t.order,s=((t,e)=>"poly"===t?e:"quad"===t?2:1)(o,a),c=t.as||[(0,m.el)(t.x),(0,m.el)(t.y)],l=eA[o],u=[];let f=t.extent;(0,m.nr)(eA,o)||(0,m.vU)("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),i.forEach((n=>{if(n.length<=s)return void e.dataflow.warn("Skipping regression with more parameters than data points.");const i=l(n,t.x,t.y,a);if(t.params)return void u.push(Dr({keys:n.dims,coef:i.coef,rSquared:i.rSquared}));const d=f||(0,m.We)(n,t.x),h=t=>{const e={};for(let i=0;i<r.length;++i)e[r[i]]=n.dims[i];e[c[0]]=t[0],e[c[1]]=t[1],u.push(Dr(e))};"linear"===o||"constant"===o?d.forEach((t=>h([t,i.predict(t)]))):da(i.predict,d,25,200).forEach(h)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const iA=134217729,rA=33306690738754706e-32;function oA(t,e,n,i,r){let o,a,s,c,l=e[0],u=i[0],f=0,d=0;u>l===u>-l?(o=l,l=e[++f]):(o=u,u=i[++d]);let h=0;if(f<t&&d<n)for(u>l===u>-l?(a=l+o,s=o-(a-l),l=e[++f]):(a=u+o,s=o-(a-u),u=i[++d]),o=a,0!==s&&(r[h++]=s);f<t&&d<n;)u>l===u>-l?(a=o+l,c=a-o,s=o-(a-c)+(l-c),l=e[++f]):(a=o+u,c=a-o,s=o-(a-c)+(u-c),u=i[++d]),o=a,0!==s&&(r[h++]=s);for(;f<t;)a=o+l,c=a-o,s=o-(a-c)+(l-c),l=e[++f],o=a,0!==s&&(r[h++]=s);for(;d<n;)a=o+u,c=a-o,s=o-(a-c)+(u-c),u=i[++d],o=a,0!==s&&(r[h++]=s);return 0===o&&0!==h||(r[h++]=o),h}function aA(t){return new Float64Array(t)}const sA=22204460492503146e-32,cA=11093356479670487e-47,lA=aA(4),uA=aA(8),fA=aA(12),dA=aA(16),hA=aA(4);function pA(t,e,n,i,r,o){const a=(e-o)*(n-r),s=(t-r)*(i-o),c=a-s;if(0===a||0===s||a>0!==s>0)return c;const l=Math.abs(a+s);return Math.abs(c)>=33306690738754716e-32*l?c:-function(t,e,n,i,r,o,a){let s,c,l,u,f,d,h,p,m,g,v,y,b,x,_,w,k,E;const D=t-r,A=n-r,S=e-o,M=i-o;x=D*M,d=iA*D,h=d-(d-D),p=D-h,d=iA*M,m=d-(d-M),g=M-m,_=p*g-(x-h*m-p*m-h*g),w=S*A,d=iA*S,h=d-(d-S),p=S-h,d=iA*A,m=d-(d-A),g=A-m,k=p*g-(w-h*m-p*m-h*g),v=_-k,f=_-v,lA[0]=_-(v+f)+(f-k),y=x+v,f=y-x,b=x-(y-f)+(v-f),v=b-w,f=b-v,lA[1]=b-(v+f)+(f-w),E=y+v,f=E-y,lA[2]=y-(E-f)+(v-f),lA[3]=E;let C=function(t,e){let n=e[0];for(let i=1;i<t;i++)n+=e[i];return n}(4,lA),F=sA*a;if(C>=F||-C>=F)return C;if(f=t-D,s=t-(D+f)+(f-r),f=n-A,l=n-(A+f)+(f-r),f=e-S,c=e-(S+f)+(f-o),f=i-M,u=i-(M+f)+(f-o),0===s&&0===c&&0===l&&0===u)return C;if(F=cA*a+rA*Math.abs(C),C+=D*u+M*s-(S*l+A*c),C>=F||-C>=F)return C;x=s*M,d=iA*s,h=d-(d-s),p=s-h,d=iA*M,m=d-(d-M),g=M-m,_=p*g-(x-h*m-p*m-h*g),w=c*A,d=iA*c,h=d-(d-c),p=c-h,d=iA*A,m=d-(d-A),g=A-m,k=p*g-(w-h*m-p*m-h*g),v=_-k,f=_-v,hA[0]=_-(v+f)+(f-k),y=x+v,f=y-x,b=x-(y-f)+(v-f),v=b-w,f=b-v,hA[1]=b-(v+f)+(f-w),E=y+v,f=E-y,hA[2]=y-(E-f)+(v-f),hA[3]=E;const O=oA(4,lA,4,hA,uA);x=D*u,d=iA*D,h=d-(d-D),p=D-h,d=iA*u,m=d-(d-u),g=u-m,_=p*g-(x-h*m-p*m-h*g),w=S*l,d=iA*S,h=d-(d-S),p=S-h,d=iA*l,m=d-(d-l),g=l-m,k=p*g-(w-h*m-p*m-h*g),v=_-k,f=_-v,hA[0]=_-(v+f)+(f-k),y=x+v,f=y-x,b=x-(y-f)+(v-f),v=b-w,f=b-v,hA[1]=b-(v+f)+(f-w),E=y+v,f=E-y,hA[2]=y-(E-f)+(v-f),hA[3]=E;const N=oA(O,uA,4,hA,fA);x=s*u,d=iA*s,h=d-(d-s),p=s-h,d=iA*u,m=d-(d-u),g=u-m,_=p*g-(x-h*m-p*m-h*g),w=c*l,d=iA*c,h=d-(d-c),p=c-h,d=iA*l,m=d-(d-l),g=l-m,k=p*g-(w-h*m-p*m-h*g),v=_-k,f=_-v,hA[0]=_-(v+f)+(f-k),y=x+v,f=y-x,b=x-(y-f)+(v-f),v=b-w,f=b-v,hA[1]=b-(v+f)+(f-w),E=y+v,f=E-y,hA[2]=y-(E-f)+(v-f),hA[3]=E;const T=oA(N,fA,4,hA,dA);return dA[T-1]}(t,e,n,i,r,o,l)}aA(4),aA(4),aA(4),aA(4),aA(4),aA(4),aA(4),aA(4),aA(4),aA(8),aA(8),aA(8),aA(4),aA(8),aA(8),aA(8),aA(12);aA(192),aA(192);aA(4),aA(4),aA(4),aA(4),aA(4),aA(4),aA(4),aA(4),aA(8),aA(8),aA(8),aA(8),aA(8),aA(8),aA(8),aA(8),aA(8),aA(4),aA(4),aA(4),aA(8),aA(16),aA(16),aA(16),aA(32),aA(32),aA(48),aA(64);aA(1152),aA(1152);aA(4),aA(4),aA(4),aA(4),aA(4),aA(4),aA(4),aA(4),aA(4),aA(4),aA(24),aA(24),aA(24),aA(24),aA(24),aA(24),aA(24),aA(24),aA(24),aA(24),aA(1152),aA(1152),aA(1152),aA(1152),aA(1152),aA(2304),aA(2304),aA(3456),aA(5760),aA(8),aA(8),aA(8),aA(16),aA(24),aA(48),aA(48),aA(96),aA(192),aA(384),aA(384),aA(384),aA(768);aA(96),aA(96),aA(96),aA(1152);const mA=Math.pow(2,-52),gA=new Uint32Array(512);class vA{static from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kA,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:EA;const i=t.length,r=new Float64Array(2*i);for(let o=0;o<i;o++){const i=t[o];r[2*o]=e(i),r[2*o+1]=n(i)}return new vA(r)}constructor(t){const e=t.length>>1;if(e>0&&"number"!==typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:i,_hullHash:r}=this,o=t.length>>1;let a=1/0,s=1/0,c=-1/0,l=-1/0;for(let D=0;D<o;D++){const e=t[2*D],n=t[2*D+1];e<a&&(a=e),n<s&&(s=n),e>c&&(c=e),n>l&&(l=n),this._ids[D]=D}const u=(a+c)/2,f=(s+l)/2;let d,h,p,m=1/0;for(let D=0;D<o;D++){const e=yA(u,f,t[2*D],t[2*D+1]);e<m&&(d=D,m=e)}const g=t[2*d],v=t[2*d+1];m=1/0;for(let D=0;D<o;D++){if(D===d)continue;const e=yA(g,v,t[2*D],t[2*D+1]);e<m&&e>0&&(h=D,m=e)}let y=t[2*h],b=t[2*h+1],x=1/0;for(let D=0;D<o;D++){if(D===d||D===h)continue;const e=xA(g,v,y,b,t[2*D],t[2*D+1]);e<x&&(p=D,x=e)}let _=t[2*p],w=t[2*p+1];if(x===1/0){for(let i=0;i<o;i++)this._dists[i]=t[2*i]-t[0]||t[2*i+1]-t[1];_A(this._ids,this._dists,0,o-1);const e=new Uint32Array(o);let n=0;for(let t=0,i=-1/0;t<o;t++){const r=this._ids[t];this._dists[r]>i&&(e[n++]=r,i=this._dists[r])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(pA(g,v,y,b,_,w)<0){const t=h,e=y,n=b;h=p,y=_,b=w,p=t,_=e,w=n}const k=function(t,e,n,i,r,o){const a=n-t,s=i-e,c=r-t,l=o-e,u=a*a+s*s,f=c*c+l*l,d=.5/(a*l-s*c),h=t+(l*u-s*f)*d,p=e+(a*f-c*u)*d;return{x:h,y:p}}(g,v,y,b,_,w);this._cx=k.x,this._cy=k.y;for(let D=0;D<o;D++)this._dists[D]=yA(t[2*D],t[2*D+1],k.x,k.y);_A(this._ids,this._dists,0,o-1),this._hullStart=d;let E=3;n[d]=e[p]=h,n[h]=e[d]=p,n[p]=e[h]=d,i[d]=0,i[h]=1,i[p]=2,r.fill(-1),r[this._hashKey(g,v)]=d,r[this._hashKey(y,b)]=h,r[this._hashKey(_,w)]=p,this.trianglesLen=0,this._addTriangle(d,h,p,-1,-1,-1);for(let D,A,S=0;S<this._ids.length;S++){const o=this._ids[S],a=t[2*o],s=t[2*o+1];if(S>0&&Math.abs(a-D)<=mA&&Math.abs(s-A)<=mA)continue;if(D=a,A=s,o===d||o===h||o===p)continue;let c=0;for(let t=0,e=this._hashKey(a,s);t<this._hashSize&&(c=r[(e+t)%this._hashSize],-1===c||c===n[c]);t++);c=e[c];let l,u=c;for(;l=n[u],pA(a,s,t[2*u],t[2*u+1],t[2*l],t[2*l+1])>=0;)if(u=l,u===c){u=-1;break}if(-1===u)continue;let f=this._addTriangle(u,o,n[u],-1,-1,i[u]);i[o]=this._legalize(f+2),i[u]=f,E++;let m=n[u];for(;l=n[m],pA(a,s,t[2*m],t[2*m+1],t[2*l],t[2*l+1])<0;)f=this._addTriangle(m,o,l,i[o],-1,i[m]),i[o]=this._legalize(f+2),n[m]=m,E--,m=l;if(u===c)for(;l=e[u],pA(a,s,t[2*l],t[2*l+1],t[2*u],t[2*u+1])<0;)f=this._addTriangle(l,o,u,-1,i[u],i[l]),this._legalize(f+2),i[l]=f,n[u]=u,E--,u=l;this._hullStart=e[o]=u,n[u]=e[m]=o,n[o]=m,r[this._hashKey(a,s)]=o,r[this._hashKey(t[2*u],t[2*u+1])]=u}this.hull=new Uint32Array(E);for(let D=0,A=this._hullStart;D<E;D++)this.hull[D]=A,A=n[A];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:i}=this;let r=0,o=0;for(;;){const a=n[t],s=t-t%3;if(o=s+(t+2)%3,-1===a){if(0===r)break;t=gA[--r];continue}const c=a-a%3,l=s+(t+1)%3,u=c+(a+2)%3,f=e[o],d=e[t],h=e[l],p=e[u];if(bA(i[2*f],i[2*f+1],i[2*d],i[2*d+1],i[2*h],i[2*h+1],i[2*p],i[2*p+1])){e[t]=p,e[a]=f;const i=n[u];if(-1===i){let e=this._hullStart;do{if(this._hullTri[e]===u){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,i),this._link(a,n[o]),this._link(o,u);const s=c+(a+1)%3;r<gA.length&&(gA[r++]=s)}else{if(0===r)break;t=gA[--r]}}return o}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,i,r,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=e,this._triangles[a+2]=n,this._link(a,i),this._link(a+1,r),this._link(a+2,o),this.trianglesLen+=3,a}}function yA(t,e,n,i){const r=t-n,o=e-i;return r*r+o*o}function bA(t,e,n,i,r,o,a,s){const c=t-a,l=e-s,u=n-a,f=i-s,d=r-a,h=o-s,p=u*u+f*f,m=d*d+h*h;return c*(f*m-p*h)-l*(u*m-p*d)+(c*c+l*l)*(u*h-f*d)<0}function xA(t,e,n,i,r,o){const a=n-t,s=i-e,c=r-t,l=o-e,u=a*a+s*s,f=c*c+l*l,d=.5/(a*l-s*c),h=(l*u-s*f)*d,p=(a*f-c*u)*d;return h*h+p*p}function _A(t,e,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const i=t[r],o=e[i];let a=r-1;for(;a>=n&&e[t[a]]>o;)t[a+1]=t[a--];t[a+1]=i}else{let r=n+1,o=i;wA(t,n+i>>1,r),e[t[n]]>e[t[i]]&&wA(t,n,i),e[t[r]]>e[t[i]]&&wA(t,r,i),e[t[n]]>e[t[r]]&&wA(t,n,r);const a=t[r],s=e[a];for(;;){do{r++}while(e[t[r]]<s);do{o--}while(e[t[o]]>s);if(o<r)break;wA(t,r,o)}t[n+1]=t[o],t[o]=a,i-r+1>=o-n?(_A(t,e,r,i),_A(t,e,n,o-1)):(_A(t,e,n,o-1),_A(t,e,r,i))}}function wA(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function kA(t){return t[0]}function EA(t){return t[1]}const DA=1e-6;class AA{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+="M".concat(this._x0=this._x1=+t,",").concat(this._y0=this._y1=+e)}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+="L".concat(this._x1=+t,",").concat(this._y1=+e)}arc(t,e,n){const i=(t=+t)+(n=+n),r=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+="M".concat(i,",").concat(r):(Math.abs(this._x1-i)>DA||Math.abs(this._y1-r)>DA)&&(this._+="L"+i+","+r),n&&(this._+="A".concat(n,",").concat(n,",0,1,1,").concat(t-n,",").concat(e,"A").concat(n,",").concat(n,",0,1,1,").concat(this._x1=i,",").concat(this._y1=r))}rect(t,e,n,i){this._+="M".concat(this._x0=this._x1=+t,",").concat(this._y0=this._y1=+e,"h").concat(+n,"v").concat(+i,"h").concat(-n,"Z")}value(){return this._||null}}class SA{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class MA{constructor(t){let[e,n,i,r]=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,960,500];if(!((i=+i)>=(e=+e))||!((r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=i,this.xmin=e,this.ymax=r,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:i}=this,r=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let d,h,p=0,m=0,g=n.length;p<g;p+=3,m+=2){const e=2*n[p],i=2*n[p+1],o=2*n[p+2],a=t[e],s=t[e+1],c=t[i],l=t[i+1],u=t[o],f=t[o+1],g=c-a,v=l-s,y=u-a,b=f-s,x=2*(g*b-v*y);if(Math.abs(x)<1e-9){let e=1e9;const i=2*n[0];e*=Math.sign((t[i]-a)*b-(t[i+1]-s)*y),d=(a+u)/2-e*b,h=(s+f)/2+e*y}else{const t=1/x,e=g*g+v*v,n=y*y+b*b;d=a+(b*e-v*n)*t,h=s+(g*n-y*e)*t}r[m]=d,r[m+1]=h}let o,a,s,c=e[e.length-1],l=4*c,u=t[2*c],f=t[2*c+1];i.fill(0);for(let d=0;d<e.length;++d)c=e[d],o=l,a=u,s=f,l=4*c,u=t[2*c],f=t[2*c+1],i[o+2]=i[l]=s-f,i[o+3]=i[l+1]=u-a}render(t){const e=null==t?t=new AA:void 0,{delaunay:{halfedges:n,inedges:i,hull:r},circumcenters:o,vectors:a}=this;if(r.length<=1)return null;for(let l=0,u=n.length;l<u;++l){const e=n[l];if(e<l)continue;const i=2*Math.floor(l/3),r=2*Math.floor(e/3),a=o[i],s=o[i+1],c=o[r],u=o[r+1];this._renderSegment(a,s,c,u,t)}let s,c=r[r.length-1];for(let l=0;l<r.length;++l){s=c,c=r[l];const e=2*Math.floor(i[c]/3),n=o[e],u=o[e+1],f=4*s,d=this._project(n,u,a[f+2],a[f+3]);d&&this._renderSegment(n,u,d[0],d[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new AA:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new AA:void 0,i=this._clip(t);if(null===i||!i.length)return;e.moveTo(i[0],i[1]);let r=i.length;for(;i[0]===i[r-2]&&i[1]===i[r-1]&&r>1;)r-=2;for(let o=2;o<r;o+=2)i[o]===i[o-2]&&i[o+1]===i[o-1]||e.lineTo(i[o],i[o+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t)}}cellPolygon(t){const e=new SA;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,i,r){let o;const a=this._regioncode(t,e),s=this._regioncode(n,i);0===a&&0===s?(r.moveTo(t,e),r.lineTo(n,i)):(o=this._clipSegment(t,e,n,i,a,s))&&(r.moveTo(o[0],o[1]),r.lineTo(o[2],o[3]))}contains(t,e,n){return(e=+e)===e&&(n=+n)===n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let i=0,r=e.length;i<r;i+=2)for(let o=0,a=t.length;o<a;o+=2)if(e[i]==t[o]&&e[i+1]==t[o+1]&&e[(i+2)%r]==t[(o+a-2)%a]&&e[(i+3)%r]==t[(o+a-1)%a]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:i,triangles:r}}=this,o=n[t];if(-1===o)return null;const a=[];let s=o;do{const n=Math.floor(s/3);if(a.push(e[2*n],e[2*n+1]),s=s%3===2?s-2:s+1,r[s]!==t)break;s=i[s]}while(s!==o&&-1!==s);return a}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,i=4*t;return n[i]||n[i+1]?this._clipInfinite(t,e,n[i],n[i+1],n[i+2],n[i+3]):this._clipFinite(t,e)}_clipFinite(t,e){const n=e.length;let i,r,o,a,s=null,c=e[n-2],l=e[n-1],u=this._regioncode(c,l),f=0;for(let d=0;d<n;d+=2)if(i=c,r=l,c=e[d],l=e[d+1],o=u,u=this._regioncode(c,l),0===o&&0===u)a=f,f=0,s?s.push(c,l):s=[c,l];else{let e,n,d,h,p;if(0===o){if(null===(e=this._clipSegment(i,r,c,l,o,u)))continue;[n,d,h,p]=e}else{if(null===(e=this._clipSegment(c,l,i,r,u,o)))continue;[h,p,n,d]=e,a=f,f=this._edgecode(n,d),a&&f&&this._edge(t,a,f,s,s.length),s?s.push(n,d):s=[n,d]}a=f,f=this._edgecode(h,p),a&&f&&this._edge(t,a,f,s,s.length),s?s.push(h,p):s=[h,p]}if(s)a=f,f=this._edgecode(s[0],s[1]),a&&f&&this._edge(t,a,f,s,s.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return s}_clipSegment(t,e,n,i,r,o){for(;;){if(0===r&&0===o)return[t,e,n,i];if(r&o)return null;let a,s,c=r||o;8&c?(a=t+(n-t)*(this.ymax-e)/(i-e),s=this.ymax):4&c?(a=t+(n-t)*(this.ymin-e)/(i-e),s=this.ymin):2&c?(s=e+(i-e)*(this.xmax-t)/(n-t),a=this.xmax):(s=e+(i-e)*(this.xmin-t)/(n-t),a=this.xmin),r?(t=a,e=s,r=this._regioncode(t,e)):(n=a,i=s,o=this._regioncode(n,i))}}_clipInfinite(t,e,n,i,r,o){let a,s=Array.from(e);if((a=this._project(s[0],s[1],n,i))&&s.unshift(a[0],a[1]),(a=this._project(s[s.length-2],s[s.length-1],r,o))&&s.push(a[0],a[1]),s=this._clipFinite(t,s))for(let c,l=0,u=s.length,f=this._edgecode(s[u-2],s[u-1]);l<u;l+=2)c=f,f=this._edgecode(s[l],s[l+1]),c&&f&&(l=this._edge(t,c,f,s,l),u=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,e,n,i,r){for(;e!==n;){let n,o;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,o=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,o=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,o=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,o=this.ymin}i[r]===n&&i[r+1]===o||!this.contains(t,n,o)||(i.splice(r,0,n,o),r+=2)}if(i.length>4)for(let o=0;o<i.length;o+=2){const t=(o+2)%i.length,e=(o+4)%i.length;(i[o]===i[t]&&i[t]===i[e]||i[o+1]===i[t+1]&&i[t+1]===i[e+1])&&(i.splice(t,2),o-=2)}return r}_project(t,e,n,i){let r,o,a,s=1/0;if(i<0){if(e<=this.ymin)return null;(r=(this.ymin-e)/i)<s&&(a=this.ymin,o=t+(s=r)*n)}else if(i>0){if(e>=this.ymax)return null;(r=(this.ymax-e)/i)<s&&(a=this.ymax,o=t+(s=r)*n)}if(n>0){if(t>=this.xmax)return null;(r=(this.xmax-t)/n)<s&&(o=this.xmax,a=e+(s=r)*i)}else if(n<0){if(t<=this.xmin)return null;(r=(this.xmin-t)/n)<s&&(o=this.xmin,a=e+(s=r)*i)}return[o,a]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}}const CA=2*Math.PI,FA=Math.pow;function OA(t){return t[0]}function NA(t){return t[1]}function TA(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class zA{static from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:OA,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NA,i=arguments.length>3?arguments[3]:void 0;return new zA("length"in t?function(t,e,n,i){const r=t.length,o=new Float64Array(2*r);for(let a=0;a<r;++a){const r=t[a];o[2*a]=e.call(i,r,a,t),o[2*a+1]=n.call(i,r,a,t)}return o}(t,e,n,i):Float64Array.from(function*(t,e,n,i){let r=0;for(const o of t)yield e.call(i,o,r,t),yield n.call(i,o,r,t),++r}(t,e,n,i)))}constructor(t){this._delaunator=new vA(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let i=0;i<e.length;i+=3){const t=2*e[i],r=2*e[i+1],o=2*e[i+2];if((n[o]-n[t])*(n[r+1]-n[t+1])-(n[r]-n[t])*(n[o+1]-n[t+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let o=0,a=e.length/2;o<a;++o){const t=TA(e[2*o],e[2*o+1],r);e[2*o]=t[0],e[2*o+1]=t[1]}this._delaunator=new vA(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,r=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let s=0,c=n.length;s<c;++s){const t=r[s%3===2?s-2:s+1];-1!==n[s]&&-1!==o[t]||(o[t]=s)}for(let s=0,c=i.length;s<c;++s)a[i[s]]=s;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],o[i[0]]=1,2===i.length&&(o[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new MA(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:i,halfedges:r,triangles:o,collinear:a}=this;if(a){const e=a.indexOf(t);return e>0&&(yield a[e-1]),void(e<a.length-1&&(yield a[e+1]))}const s=e[t];if(-1===s)return;let c=s,l=-1;do{if(yield l=o[c],c=c%3===2?c-2:c+1,o[c]!==t)return;if(c=r[c],-1===c){const e=n[(i[t]+1)%n.length];return void(e!==l&&(yield e))}}while(c!==s)}find(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if((t=+t)!==t||(e=+e)!==e)return-1;const i=n;let r;for(;(r=this._step(n,t,e))>=0&&r!==n&&r!==i;)n=r;return r}_step(t,e,n){const{inedges:i,hull:r,_hullIndex:o,halfedges:a,triangles:s,points:c}=this;if(-1===i[t]||!c.length)return(t+1)%(c.length>>1);let l=t,u=FA(e-c[2*t],2)+FA(n-c[2*t+1],2);const f=i[t];let d=f;do{let i=s[d];const f=FA(e-c[2*i],2)+FA(n-c[2*i+1],2);if(f<u&&(u=f,l=i),d=d%3===2?d-2:d+1,s[d]!==t)break;if(d=a[d],-1===d){if(d=r[(o[t]+1)%r.length],d!==i&&FA(e-c[2*d],2)+FA(n-c[2*d+1],2)<u)return d;break}}while(d!==f);return l}render(t){const e=null==t?t=new AA:void 0,{points:n,halfedges:i,triangles:r}=this;for(let o=0,a=i.length;o<a;++o){const e=i[o];if(e<o)continue;const a=2*r[o],s=2*r[e];t.moveTo(n[a],n[a+1]),t.lineTo(n[s],n[s+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e){void 0!==e||t&&"function"===typeof t.moveTo||(e=t,t=null),e=void 0==e?2:+e;const n=null==t?t=new AA:void 0,{points:i}=this;for(let r=0,o=i.length;r<o;r+=2){const n=i[r],o=i[r+1];t.moveTo(n+e,o),t.arc(n,o,e,0,CA)}return n&&n.value()}renderHull(t){const e=null==t?t=new AA:void 0,{hull:n,points:i}=this,r=2*n[0],o=n.length;t.moveTo(i[r],i[r+1]);for(let a=1;a<o;++a){const e=2*n[a];t.lineTo(i[e],i[e+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new SA;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new AA:void 0,{points:i,triangles:r}=this,o=2*r[t*=3],a=2*r[t+1],s=2*r[t+2];return e.moveTo(i[o],i[o+1]),e.lineTo(i[a],i[a+1]),e.lineTo(i[s],i[s+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new SA;return this.renderTriangle(t,e),e.value()}}function RA(t){no.call(this,null,t)}RA.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const PA=[-1e5,-1e5,1e5,1e5];function LA(t){const e=t[0][0],n=t[0][1];let i=t.length-1;for(;t[i][0]===e&&t[i][1]===n;--i);return"M"+t.slice(0,i+1).join("L")+"Z"}(0,m.XW)(RA,no,{transform(t,e){const n=t.as||"path",i=e.source;if(!i||!i.length)return e;let r=t.size;r=r?[0,0,r[0],r[1]]:(r=t.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:PA;const o=this.value=zA.from(i,t.x,t.y).voronoi(r);for(let a=0,s=i.length;a<s;++a){const t=o.cellPolygon(a);i[a][n]=t?LA(t):null}return e.reflow(t.modified()).modifies(n)}});var jA=Math.PI/180,BA=64,UA=2048;function IA(){var t,e,n,i,r,o,a,s=[256,256],c=JA,l=[],u=Math.random,f={};function d(t,e,n){for(var i,r,o,a=e.x,l=e.y,f=Math.sqrt(s[0]*s[0]+s[1]*s[1]),d=c(s),h=u()<.5?1:-1,p=-h;(i=d(p+=h))&&(r=~~i[0],o=~~i[1],!(Math.min(Math.abs(r),Math.abs(o))>=f));)if(e.x=a+r,e.y=l+o,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>s[0]||e.y+e.y1>s[1])&&(!n||!WA(e,t,s[0]))&&(!n||XA(e,n))){for(var m,g=e.sprite,v=e.width>>5,y=s[0]>>5,b=e.x-(v<<4),x=127&b,_=32-x,w=e.y1-e.y0,k=(e.y+e.y0)*y+(b>>5),E=0;E<w;E++){m=0;for(var D=0;D<=v;D++)t[k+D]|=m<<_|(D<v?(m=g[E*v+D])>>>x:0);k+=y}return e.sprite=null,!0}return!1}return f.layout=function(){for(var c=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(BA<<5)/e,t.height=UA/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(gl()),f=function(t){var e=[],n=-1;for(;++n<t;)e[n]=0;return e}((s[0]>>5)*s[1]),h=null,p=l.length,m=-1,g=[],v=l.map((s=>({text:t(s),font:e(s),style:i(s),weight:r(s),rotate:o(s),size:~~(n(s)+1e-14),padding:a(s),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:s}))).sort(((t,e)=>e.size-t.size));++m<p;){var y=v[m];y.x=s[0]*(u()+.5)>>1,y.y=s[1]*(u()+.5)>>1,qA(c,y,v,m),y.hasText&&d(f,y,h)&&(g.push(y),h?HA(h,y):h=[{x:y.x+y.x0,y:y.y+y.y0},{x:y.x+y.x1,y:y.y+y.y1}],y.x-=s[0]>>1,y.y-=s[1]>>1)}return g},f.words=function(t){return arguments.length?(l=t,f):l},f.size=function(t){return arguments.length?(s=[+t[0],+t[1]],f):s},f.font=function(t){return arguments.length?(e=GA(t),f):e},f.fontStyle=function(t){return arguments.length?(i=GA(t),f):i},f.fontWeight=function(t){return arguments.length?(r=GA(t),f):r},f.rotate=function(t){return arguments.length?(o=GA(t),f):o},f.text=function(e){return arguments.length?(t=GA(e),f):t},f.spiral=function(t){return arguments.length?(c=$A[t]||t,f):c},f.fontSize=function(t){return arguments.length?(n=GA(t),f):n},f.padding=function(t){return arguments.length?(a=GA(t),f):a},f.random=function(t){return arguments.length?(u=t,f):u},f}function qA(t,e,n,i){if(!e.sprite){var r=t.context,o=t.ratio;r.clearRect(0,0,(BA<<5)/o,UA/o);var a,s,c,l,u,f=0,d=0,h=0,p=n.length;for(--i;++i<p;){if(e=n[i],r.save(),r.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font,a=r.measureText(e.text+"m").width*o,c=e.size<<1,e.rotate){var m=Math.sin(e.rotate*jA),g=Math.cos(e.rotate*jA),v=a*g,y=a*m,b=c*g,x=c*m;a=Math.max(Math.abs(v+x),Math.abs(v-x))+31>>5<<5,c=~~Math.max(Math.abs(y+b),Math.abs(y-b))}else a=a+31>>5<<5;if(c>h&&(h=c),f+a>=BA<<5&&(f=0,d+=h,h=0),d+c>=UA)break;r.translate((f+(a>>1))/o,(d+(c>>1))/o),e.rotate&&r.rotate(e.rotate*jA),r.fillText(e.text,0,0),e.padding&&(r.lineWidth=2*e.padding,r.strokeText(e.text,0,0)),r.restore(),e.width=a,e.height=c,e.xoff=f,e.yoff=d,e.x1=a>>1,e.y1=c>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,f+=a}for(var _=r.getImageData(0,0,(BA<<5)/o,UA/o).data,w=[];--i>=0;)if((e=n[i]).hasText){for(s=(a=e.width)>>5,c=e.y1-e.y0,l=0;l<c*s;l++)w[l]=0;if(null==(f=e.xoff))return;d=e.yoff;var k=0,E=-1;for(u=0;u<c;u++){for(l=0;l<a;l++){var D=s*u+(l>>5),A=_[(d+u)*(BA<<5)+(f+l)<<2]?1<<31-l%32:0;w[D]|=A,k|=A}k?E=u:(e.y0++,c--,u--,d++)}e.y1=e.y0+E,e.sprite=w.slice(0,(e.y1-e.y0)*s)}}}function WA(t,e,n){n>>=5;for(var i,r=t.sprite,o=t.width>>5,a=t.x-(o<<4),s=127&a,c=32-s,l=t.y1-t.y0,u=(t.y+t.y0)*n+(a>>5),f=0;f<l;f++){i=0;for(var d=0;d<=o;d++)if((i<<c|(d<o?(i=r[f*o+d])>>>s:0))&e[u+d])return!0;u+=n}return!1}function HA(t,e){var n=t[0],i=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>i.x&&(i.x=e.x+e.x1),e.y+e.y1>i.y&&(i.y=e.y+e.y1)}function XA(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function JA(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function GA(t){return"function"===typeof t?t:function(){return t}}var $A={archimedean:JA,rectangular:function(t){var e=4*t[0]/t[1],n=0,i=0;return function(t){var r=t<0?-1:1;switch(Math.sqrt(1+4*r*t)-r&3){case 0:n+=e;break;case 1:i+=4;break;case 2:n-=e;break;default:i-=4}return[n,i]}}};const VA=["x","y","font","fontSize","fontStyle","fontWeight","angle"],YA=["text","font","rotate","fontSize","fontStyle","fontWeight"];function KA(t){no.call(this,IA(),t)}KA.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:VA}]},(0,m.XW)(KA,no,{transform(t,e){!t.size||t.size[0]&&t.size[1]||(0,m.vU)("Wordcloud size dimensions must be non-zero.");const n=t.modified();if(!(n||e.changed(e.ADD_REM)||YA.some((function(n){const i=t[n];return(0,m.mf)(i)&&e.modified(i.fields)}))))return;const i=e.materialize(e.SOURCE).source,r=this.value,o=t.as||VA;let a,s=t.fontSize||14;if((0,m.mf)(s)?a=t.fontSizeRange:s=(0,m.a9)(s),a){const t=s,e=od("sqrt")().domain((0,m.We)(i,t)).range(a);s=n=>e(t(n))}i.forEach((t=>{t[o[0]]=NaN,t[o[1]]=NaN,t[o[3]]=0}));const c=r.words(i).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(s).random(wo).layout(),l=r.size(),u=l[0]>>1,f=l[1]>>1,d=c.length;for(let h,p,m=0;m<d;++m)h=c[m],p=h.datum,p[o[0]]=h.x+u,p[o[1]]=h.y+f,p[o[2]]=h.font,p[o[3]]=h.size,p[o[4]]=h.style,p[o[5]]=h.weight,p[o[6]]=h.rotate;return e.reflow(n).modifies(o)}});const ZA=t=>new Uint8Array(t),QA=t=>new Uint16Array(t),tS=t=>new Uint32Array(t);function eS(t,e,n){const i=(e<257?ZA:e<65537?QA:tS)(t);return n&&i.set(n),i}function nS(t,e,n){const i=1<<e;return{one:i,zero:~i,range:n.slice(),bisect:t.bisect,index:t.index,size:t.size,onAdd(t,e){const n=this,r=n.bisect(n.range,t.value),o=t.index,a=r[0],s=r[1],c=o.length;let l;for(l=0;l<a;++l)e[o[l]]|=i;for(l=s;l<c;++l)e[o[l]]|=i;return n}}}function iS(){let t=tS(0),e=[],n=0;return{insert:function(i,r,o){if(!r.length)return[];const a=n,s=r.length,c=tS(s);let l,u,f,d=Array(s);for(f=0;f<s;++f)d[f]=i(r[f]),c[f]=f;if(d=function(t,e){return t.sort.call(e,((e,n)=>{const i=t[e],r=t[n];return i<r?-1:i>r?1:0})),function(t,e){return Array.from(e,(e=>t[e]))}(t,e)}(d,c),a)l=e,u=t,e=Array(a+s),t=tS(a+s),function(t,e,n,i,r,o,a,s,c){let l,u=0,f=0;for(l=0;u<i&&f<a;++l)e[u]<r[f]?(s[l]=e[u],c[l]=n[u++]):(s[l]=r[f],c[l]=o[f++]+t);for(;u<i;++u,++l)s[l]=e[u],c[l]=n[u];for(;f<a;++f,++l)s[l]=r[f],c[l]=o[f]+t}(o,l,u,a,d,c,s,e,t);else{if(o>0)for(f=0;f<s;++f)c[f]+=o;e=d,t=c}return n=a+s,{index:c,value:d}},remove:function(i,r){const o=n;let a,s,c;for(s=0;!r[t[s]]&&s<o;++s);for(c=s;s<o;++s)r[a=t[s]]||(t[c]=a,e[c]=e[s],++c);n=o-i},bisect:function(t,i){let r;return i?r=i.length:(i=e,r=n),[xl(i,t[0],0,r),bl(i,t[1],0,r)]},reindex:function(e){for(let i=0,r=n;i<r;++i)t[i]=e[t[i]]},index:()=>t,size:()=>n}}function rS(t){no.call(this,function(){let t=8,e=[],n=tS(0),i=eS(0,t),r=eS(0,t);return{data:()=>e,seen:()=>n=function(t,e,n){return t.length>=e?t:((n=n||new t.constructor(e)).set(t),n)}(n,e.length),add(t){for(let n,i=0,r=e.length,o=t.length;i<o;++i)n=t[i],n._index=r++,e.push(n)},remove(t,n){const o=e.length,a=Array(o-t),s=e;let c,l,u;for(l=0;!n[l]&&l<o;++l)a[l]=e[l],s[l]=l;for(u=l;l<o;++l)c=e[l],n[l]?s[l]=-1:(s[l]=u,i[u]=i[l],r[u]=r[l],a[u]=c,c._index=u++),i[l]=0;return e=a,s},size:()=>e.length,curr:()=>i,prev:()=>r,reset:t=>r[t]=i[t],all:()=>t<257?255:t<65537?65535:4294967295,set(t,e){i[t]|=e},clear(t,e){i[t]&=~e},resize(e,n){(e>i.length||n>t)&&(t=Math.max(n,t),i=eS(e,t,i),r=eS(e,t))}}}(),t),this._indices=null,this._dims=null}function oS(t){no.call(this,null,t)}rS.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},(0,m.XW)(rS,no,{transform(t,e){return this._dims?t.modified("fields")||t.fields.some((t=>e.modified(t.fields)))?this.reinit(t,e):this.eval(t,e):this.init(t,e)},init(t,e){const n=t.fields,i=t.query,r=this._indices={},o=this._dims=[],a=i.length;let s,c,l=0;for(;l<a;++l)s=n[l].fname,c=r[s]||(r[s]=iS()),o.push(nS(c,l,i[l]));return this.eval(t,e)},reinit(t,e){const n=e.materialize().fork(),i=t.fields,r=t.query,o=this._indices,a=this._dims,s=this.value,c=s.curr(),l=s.prev(),u=s.all(),f=n.rem=n.add,d=n.mod,h=r.length,p={};let m,g,v,y,b,x,_,w,k;if(l.set(c),e.rem.length&&(b=this.remove(t,e,n)),e.add.length&&s.add(e.add),e.mod.length)for(x={},y=e.mod,_=0,w=y.length;_<w;++_)x[y[_]._index]=1;for(_=0;_<h;++_)k=i[_],(!a[_]||t.modified("fields",_)||e.modified(k.fields))&&(v=k.fname,(m=p[v])||(o[v]=g=iS(),p[v]=m=g.insert(k,e.source,0)),a[_]=nS(g,_,r[_]).onAdd(m,c));for(_=0,w=s.data().length;_<w;++_)b[_]||(l[_]!==c[_]?f.push(_):x[_]&&c[_]!==u&&d.push(_));return s.mask=(1<<h)-1,n},eval(t,e){const n=e.materialize().fork(),i=this._dims.length;let r=0;return e.rem.length&&(this.remove(t,e,n),r|=(1<<i)-1),t.modified("query")&&!t.modified("fields")&&(r|=this.update(t,e,n)),e.add.length&&(this.insert(t,e,n),r|=(1<<i)-1),e.mod.length&&(this.modify(e,n),r|=(1<<i)-1),this.value.mask=r,n},insert(t,e,n){const i=e.add,r=this.value,o=this._dims,a=this._indices,s=t.fields,c={},l=n.add,u=r.size()+i.length,f=o.length;let d,h,p,m=r.size();r.resize(u,f),r.add(i);const g=r.curr(),v=r.prev(),y=r.all();for(d=0;d<f;++d)h=s[d].fname,p=c[h]||(c[h]=a[h].insert(s[d],i,m)),o[d].onAdd(p,g);for(;m<u;++m)v[m]=y,g[m]!==y&&l.push(m)},modify(t,e){const n=e.mod,i=this.value,r=i.curr(),o=i.all(),a=t.mod;let s,c,l;for(s=0,c=a.length;s<c;++s)l=a[s]._index,r[l]!==o&&n.push(l)},remove(t,e,n){const i=this._indices,r=this.value,o=r.curr(),a=r.prev(),s=r.all(),c={},l=n.rem,u=e.rem;let f,d,h,p;for(f=0,d=u.length;f<d;++f)h=u[f]._index,c[h]=1,a[h]=p=o[h],o[h]=s,p!==s&&l.push(h);for(h in i)i[h].remove(d,c);return this.reindex(e,d,c),c},reindex(t,e,n){const i=this._indices,r=this.value;t.runAfter((()=>{const t=r.remove(e,n);for(const e in i)i[e].reindex(t)}))},update(t,e,n){const i=this._dims,r=t.query,o=e.stamp,a=i.length;let s,c,l=0;for(n.filters=0,c=0;c<a;++c)t.modified("query",c)&&(s=c,++l);if(1===l)l=i[s].one,this.incrementOne(i[s],r[s],n.add,n.rem);else for(c=0,l=0;c<a;++c)t.modified("query",c)&&(l|=i[c].one,this.incrementAll(i[c],r[c],o,n.add),n.rem=n.add);return l},incrementAll(t,e,n,i){const r=this.value,o=r.seen(),a=r.curr(),s=r.prev(),c=t.index(),l=t.bisect(t.range),u=t.bisect(e),f=u[0],d=u[1],h=l[0],p=l[1],m=t.one;let g,v,y;if(f<h)for(g=f,v=Math.min(h,d);g<v;++g)y=c[g],o[y]!==n&&(s[y]=a[y],o[y]=n,i.push(y)),a[y]^=m;else if(f>h)for(g=h,v=Math.min(f,p);g<v;++g)y=c[g],o[y]!==n&&(s[y]=a[y],o[y]=n,i.push(y)),a[y]^=m;if(d>p)for(g=Math.max(f,p),v=d;g<v;++g)y=c[g],o[y]!==n&&(s[y]=a[y],o[y]=n,i.push(y)),a[y]^=m;else if(d<p)for(g=Math.max(h,d),v=p;g<v;++g)y=c[g],o[y]!==n&&(s[y]=a[y],o[y]=n,i.push(y)),a[y]^=m;t.range=e.slice()},incrementOne(t,e,n,i){const r=this.value.curr(),o=t.index(),a=t.bisect(t.range),s=t.bisect(e),c=s[0],l=s[1],u=a[0],f=a[1],d=t.one;let h,p,m;if(c<u)for(h=c,p=Math.min(u,l);h<p;++h)m=o[h],r[m]^=d,n.push(m);else if(c>u)for(h=u,p=Math.min(c,f);h<p;++h)m=o[h],r[m]^=d,i.push(m);if(l>f)for(h=Math.max(c,f),p=l;h<p;++h)m=o[h],r[m]^=d,n.push(m);else if(l<f)for(h=Math.max(u,l),p=f;h<p;++h)m=o[h],r[m]^=d,i.push(m);t.range=e.slice()}}),oS.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]},(0,m.XW)(oS,no,{transform(t,e){const n=~(t.ignore||0),i=t.filter,r=i.mask;if(0===(r&n))return e.StopPropagation;const o=e.fork(e.ALL),a=i.data(),s=i.curr(),c=i.prev(),l=t=>s[t]&n?null:a[t];return o.filter(o.MOD,l),r&r-1?(o.filter(o.ADD,(t=>{const e=s[t]&n;return!e&&e^c[t]&n?a[t]:null})),o.filter(o.REM,(t=>{const e=s[t]&n;return e&&!(e^e^c[t]&n)?a[t]:null}))):(o.filter(o.ADD,l),o.filter(o.REM,(t=>(s[t]&n)===r?a[t]:null))),o.filter(o.SOURCE,(t=>l(t._index)))}});var aS,sS,cS,lS,uS,fS,dS,hS,pS,mS,gS,vS,yS,bS,xS,_S,wS=n(88120),kS=new Lb,ES=new Lb,DS={point:sx,lineStart:sx,lineEnd:sx,polygonStart:function(){kS=new Lb,DS.lineStart=AS,DS.lineEnd=SS},polygonEnd:function(){var t=+kS;ES.add(t<0?Wb+t:t),this.lineStart=this.lineEnd=this.point=sx},sphere:function(){ES.add(Wb)}};function AS(){DS.point=MS}function SS(){CS(aS,sS)}function MS(t,e){DS.point=CS,aS=t,sS=e,cS=t*=Xb,lS=Vb(e=(e*=Xb)/2+qb),uS=ex(e)}function CS(t,e){var n=(t*=Xb)-cS,i=n>=0?1:-1,r=i*n,o=Vb(e=(e*=Xb)/2+qb),a=ex(e),s=uS*a,c=lS*o+s*Vb(r),l=s*i*ex(r);kS.add($b(l,c)),cS=t,lS=o,uS=a}var FS,OS,NS,TS,zS,RS,PS,LS,jS,BS,US,IS,qS,WS,HS,XS,JS={point:GS,lineStart:VS,lineEnd:YS,polygonStart:function(){JS.point=KS,JS.lineStart=ZS,JS.lineEnd=QS,bS=new Lb,DS.polygonStart()},polygonEnd:function(){DS.polygonEnd(),JS.point=GS,JS.lineStart=VS,JS.lineEnd=YS,kS<0?(fS=-(hS=180),dS=-(pS=90)):bS>jb?pS=90:bS<-jb&&(dS=-90),_S[0]=fS,_S[1]=hS},sphere:function(){fS=-(hS=180),dS=-(pS=90)}};function GS(t,e){xS.push(_S=[fS=t,hS=t]),e<dS&&(dS=e),e>pS&&(pS=e)}function $S(t,e){var n=E_([t*Xb,e*Xb]);if(yS){var i=A_(yS,n),r=A_([i[1],-i[0],0],i);C_(r),r=k_(r);var o,a=t-mS,s=a>0?1:-1,c=r[0]*Hb*s,l=Jb(a)>180;l^(s*mS<c&&c<s*t)?(o=r[1]*Hb)>pS&&(pS=o):l^(s*mS<(c=(c+360)%360-180)&&c<s*t)?(o=-r[1]*Hb)<dS&&(dS=o):(e<dS&&(dS=e),e>pS&&(pS=e)),l?t<mS?tM(fS,t)>tM(fS,hS)&&(hS=t):tM(t,hS)>tM(fS,hS)&&(fS=t):hS>=fS?(t<fS&&(fS=t),t>hS&&(hS=t)):t>mS?tM(fS,t)>tM(fS,hS)&&(hS=t):tM(t,hS)>tM(fS,hS)&&(fS=t)}else xS.push(_S=[fS=t,hS=t]);e<dS&&(dS=e),e>pS&&(pS=e),yS=n,mS=t}function VS(){JS.point=$S}function YS(){_S[0]=fS,_S[1]=hS,JS.point=GS,yS=null}function KS(t,e){if(yS){var n=t-mS;bS.add(Jb(n)>180?n+(n>0?360:-360):n)}else gS=t,vS=e;DS.point(t,e),$S(t,e)}function ZS(){DS.lineStart()}function QS(){KS(gS,vS),DS.lineEnd(),Jb(bS)>jb&&(fS=-(hS=180)),_S[0]=fS,_S[1]=hS,yS=null}function tM(t,e){return(e-=t)<0?e+360:e}function eM(t,e){return t[0]-e[0]}function nM(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var iM={sphere:sx,point:rM,lineStart:aM,lineEnd:lM,polygonStart:function(){iM.lineStart=uM,iM.lineEnd=fM},polygonEnd:function(){iM.lineStart=aM,iM.lineEnd=lM}};function rM(t,e){t*=Xb;var n=Vb(e*=Xb);oM(n*Vb(t),n*ex(t),ex(e))}function oM(t,e,n){++FS,NS+=(t-NS)/FS,TS+=(e-TS)/FS,zS+=(n-zS)/FS}function aM(){iM.point=sM}function sM(t,e){t*=Xb;var n=Vb(e*=Xb);WS=n*Vb(t),HS=n*ex(t),XS=ex(e),iM.point=cM,oM(WS,HS,XS)}function cM(t,e){t*=Xb;var n=Vb(e*=Xb),i=n*Vb(t),r=n*ex(t),o=ex(e),a=$b(ix((a=HS*o-XS*r)*a+(a=XS*i-WS*o)*a+(a=WS*r-HS*i)*a),WS*i+HS*r+XS*o);OS+=a,RS+=a*(WS+(WS=i)),PS+=a*(HS+(HS=r)),LS+=a*(XS+(XS=o)),oM(WS,HS,XS)}function lM(){iM.point=rM}function uM(){iM.point=dM}function fM(){hM(IS,qS),iM.point=rM}function dM(t,e){IS=t,qS=e,t*=Xb,e*=Xb,iM.point=hM;var n=Vb(e);WS=n*Vb(t),HS=n*ex(t),XS=ex(e),oM(WS,HS,XS)}function hM(t,e){t*=Xb;var n=Vb(e*=Xb),i=n*Vb(t),r=n*ex(t),o=ex(e),a=HS*o-XS*r,s=XS*i-WS*o,c=WS*r-HS*i,l=Zb(a,s,c),u=ax(l),f=l&&-u/l;jS.add(f*a),BS.add(f*s),US.add(f*c),OS+=u,RS+=u*(WS+(WS=i)),PS+=u*(HS+(HS=r)),LS+=u*(XS+(XS=o)),oM(WS,HS,XS)}function pM(t){return t instanceof Au?t:new Au(t)}const mM="intersect",gM="union",vM="_vgsid_",yM=(0,m.EP)(vM),bM="E",xM="R",_M="R-E",wM="R-LE",kM="R-RE",EM="index:unit";function DM(t,e){for(var n,i,r=e.fields,o=e.values,a=r.length,s=0;s<a;++s)if((i=r[s]).getter=m.EP.getter||(0,m.EP)(i.field),n=i.getter(t),(0,m.J_)(n)&&(n=(0,m.He)(n)),(0,m.J_)(o[s])&&(o[s]=(0,m.He)(o[s])),(0,m.J_)(o[s][0])&&(o[s]=o[s].map(m.He)),i.type===bM){if((0,m.kJ)(o[s])?o[s].indexOf(n)<0:n!==o[s])return!1}else if(i.type===xM){if(!(0,m.u5)(n,o[s]))return!1}else if(i.type===kM){if(!(0,m.u5)(n,o[s],!0,!1))return!1}else if(i.type===_M){if(!(0,m.u5)(n,o[s],!1,!1))return!1}else if(i.type===wM&&!(0,m.u5)(n,o[s],!1,!0))return!1;return!0}const AM=Xt(yM),SM=AM.left,MM=AM.right;var CM={["".concat(vM,"_union")]:function(){const t=new Au;for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];for(const r of n)for(const e of r)t.add(e);return t},["".concat(vM,"_intersect")]:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];t=new Au(t),n=n.map(pM);t:for(const r of t)for(const e of n)if(!e.has(r)){t.delete(r);continue t}return t},E_union:function(t,e){if(!t.length)return e;for(var n=0,i=e.length;n<i;++n)t.indexOf(e[n])<0&&t.push(e[n]);return t},E_intersect:function(t,e){return t.length?t.filter((t=>e.indexOf(t)>=0)):e},R_union:function(t,e){var n=(0,m.He)(e[0]),i=(0,m.He)(e[1]);return n>i&&(n=e[1],i=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]<i&&(t[1]=i),t):[n,i]},R_intersect:function(t,e){var n=(0,m.He)(e[0]),i=(0,m.He)(e[1]);return n>i&&(n=e[1],i=e[0]),t.length?i<t[0]||t[1]<n?[]:(t[0]<n&&(t[0]=n),t[1]>i&&(t[1]=i),t):[n,i]}};function FM(t,e,n,i){e[0].type!==wS.t$&&(0,m.vU)("First argument to selection functions must be a string literal.");const r=e[0].value,o="unit",a="@"+o,s=":"+r;(e.length>=2&&(0,m.fj)(e).value)!==mM||(0,m.nr)(i,a)||(i[a]=n.getData(r).indataRef(n,o)),(0,m.nr)(i,s)||(i[s]=n.getData(r).tuplesRef())}function OM(t){const e=this.context.data[t];return e?e.values.value:[]}const NM=t=>function(e,n){return this.context.dataflow.locale()[t](n)(e)},TM=NM("format"),zM=NM("timeFormat"),RM=NM("utcFormat"),PM=NM("timeParse"),LM=NM("utcParse"),jM=new Date(2e3,0,1);function BM(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(jM.setYear(2e3),jM.setMonth(t),jM.setDate(e),zM.call(this,jM,n)):""}const UM="%",IM="$";function qM(t,e,n,i){e[0].type!==wS.t$&&(0,m.vU)("First argument to data functions must be a string literal.");const r=e[0].value,o=":"+r;if(!(0,m.nr)(o,i))try{i[o]=n.getData(r).tuplesRef()}catch(a){}}function WM(t,e,n,i){if(e[0].type===wS.t$)HM(n,i,e[0].value);else for(t in n.scales)HM(n,i,t)}function HM(t,e,n){const i=UM+n;if(!(0,m.nr)(e,i))try{e[i]=t.scaleRef(n)}catch(r){}}function XM(t,e){if((0,m.mf)(t))return t;if((0,m.HD)(t)){const n=e.scales[t];return n&&function(t){return t&&!0===t[id]}(n.value)?n.value:void 0}}function JM(t,e,n){e.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0,n._bandwidth=WM,n._range=WM,n._scale=WM;const i=e=>"_["+(e.type===wS.t$?(0,m.m8)(UM+e.value):(0,m.m8)(UM)+"+"+t(e))+"]";return{_bandwidth:t=>"this.__bandwidth(".concat(i(t[0]),")"),_range:t=>"".concat(i(t[0]),".range()"),_scale:e=>"".concat(i(e[0]),"(").concat(t(e[1]),")")}}function GM(t,e){return function(n,i,r){if(n){const e=XM(n,(r||this).context);return e&&e.path[t](i)}return e(i)}}const $M=GM("area",(function(t){return ES=new Lb,Pb(t,DS),2*ES})),VM=GM("bounds",(function(t){var e,n,i,r,o,a,s;if(pS=hS=-(fS=dS=1/0),xS=[],Pb(t,JS),n=xS.length){for(xS.sort(eM),e=1,o=[i=xS[0]];e<n;++e)nM(i,(r=xS[e])[0])||nM(i,r[1])?(tM(i[0],r[1])>tM(i[0],i[1])&&(i[1]=r[1]),tM(r[0],i[1])>tM(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(a=-1/0,e=0,i=o[n=o.length-1];e<=n;i=r,++e)r=o[e],(s=tM(i[1],r[0]))>a&&(a=s,fS=r[0],hS=i[1])}return xS=_S=null,fS===1/0||dS===1/0?[[NaN,NaN],[NaN,NaN]]:[[fS,dS],[hS,pS]]})),YM=GM("centroid",(function(t){FS=OS=NS=TS=zS=RS=PS=LS=0,jS=new Lb,BS=new Lb,US=new Lb,Pb(t,iM);var e=+jS,n=+BS,i=+US,r=Zb(e,n,i);return r<Bb&&(e=RS,n=PS,i=LS,OS<jb&&(e=NS,n=TS,i=zS),(r=Zb(e,n,i))<Bb)?[NaN,NaN]:[$b(n,e)*Hb,ax(i/r)*Hb]}));function KM(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(i){t.warn(i)}return n[n.length-1]}function ZM(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function QM(t){const e=(0,wl.B8)(t);return.2126*ZM(e.r)+.7152*ZM(e.g)+.0722*ZM(e.b)}function tC(t,e){return t===e||t!==t&&e!==e||((0,m.kJ)(t)?!(!(0,m.kJ)(e)||t.length!==e.length)&&function(t,e){for(let n=0,i=t.length;n<i;++n)if(!tC(t[n],e[n]))return!1;return!0}(t,e):!(!(0,m.Kn)(t)||!(0,m.Kn)(e))&&eC(t,e))}function eC(t,e){for(const n in t)if(!tC(t[n],e[n]))return!1;return!0}function nC(t){return e=>eC(t,e)}const iC={};function rC(t){return(0,m.kJ)(t)||ArrayBuffer.isView(t)?t:null}function oC(t){return rC(t)||((0,m.HD)(t)?t:null)}const aC=t=>t.data;function sC(t,e){const n=OM.call(e,t);return n.root&&n.root.lookup||{}}const cC=()=>"undefined"!==typeof window&&window||null;function lC(t,e,n){if(!t)return[];const[i,r]=t,o=(new Gh).set(i[0],i[1],r[0],r[1]);return Ev(n||this.context.dataflow.scenegraph().root,o,function(t){let e=null;if(t){const n=(0,m.IX)(t.marktype),i=(0,m.IX)(t.markname);e=t=>(!n.length||n.some((e=>t.marktype===e)))&&(!i.length||i.some((e=>t.name===e)))}return e}(e))}const uC={random:()=>wo(),cumulativeNormal:To,cumulativeLogNormal:Bo,cumulativeUniform:Xo,densityNormal:No,densityLogNormal:jo,densityUniform:Ho,quantileNormal:zo,quantileLogNormal:Uo,quantileUniform:Jo,sampleNormal:Oo,sampleLogNormal:Lo,sampleUniform:Wo,isArray:m.kJ,isBoolean:m.jn,isDate:m.J_,isDefined:t=>void 0!==t,isNumber:m.hj,isObject:m.Kn,isRegExp:m.Kj,isString:m.HD,isTuple:wr,isValid:t=>null!=t&&t===t,toBoolean:m.sw,toDate:t=>(0,m.ZU)(t),toNumber:m.He,toString:m.BB,indexof:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return oC(t).indexOf(...n)},join:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return rC(t).join(...n)},lastindexof:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return oC(t).lastIndexOf(...n)},replace:function(t,e,n){return(0,m.mf)(n)&&(0,m.vU)("Function argument passed to replace."),String(t).replace(e,n)},reverse:function(t){return rC(t).slice().reverse()},slice:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return oC(t).slice(...n)},flush:m.yl,lerp:m.t7,merge:function(){const t=[].slice.call(arguments);return t.unshift({}),(0,m.l7)(...t)},pad:m.vk,peek:m.fj,pluck:function(t,e){const n=iC[e]||(iC[e]=(0,m.EP)(e));return(0,m.kJ)(t)?t.map(n):n(t)},span:m.yP,inrange:m.u5,truncate:m.$G,rgb:wl.B8,lab:ef,hcl:lf,hsl:wl.Ym,luminance:QM,contrast:function(t,e){const n=QM(t),i=QM(e);return(Math.max(n,i)+.05)/(Math.min(n,i)+.05)},sequence:pa,format:TM,utcFormat:RM,utcParse:LM,utcOffset:Le,utcSequence:Ue,timeFormat:zM,timeParse:PM,timeOffset:Pe,timeSequence:Be,timeUnitSpecifier:ce,monthFormat:function(t){return BM.call(this,t,1,"%B")},monthAbbrevFormat:function(t){return BM.call(this,t,1,"%b")},dayFormat:function(t){return BM.call(this,0,2+t,"%A")},dayAbbrevFormat:function(t){return BM.call(this,0,2+t,"%a")},quarter:m.mS,utcquarter:m.N3,week:de,utcweek:ye,dayofyear:fe,utcdayofyear:ve,warn:function(){return KM(this.context.dataflow,"warn",arguments)},info:function(){return KM(this.context.dataflow,"info",arguments)},debug:function(){return KM(this.context.dataflow,"debug",arguments)},extent:t=>(0,m.We)(t),inScope:function(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n},intersect:lC,clampRange:m.l$,pinchDistance:function(t){const e=t.touches,n=e[0].clientX-e[1].clientX,i=e[0].clientY-e[1].clientY;return Math.hypot(n,i)},pinchAngle:function(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function(){const t=cC();return t?t.screen:{}},containerSize:function(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]},windowSize:function(){const t=cC();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return Ff(t||0,e||0,n||0)},setdata:function(t,e){const n=this.context.dataflow,i=this.context.data[t].input;return n.pulse(i,n.changeset().remove(m.yb).insert(e)),1},pathShape:function(t){let e=null;return function(n){return n?gh(n,e=e||oh(t)):t}},panLinear:m.Dw,panLog:m.mJ,panPow:m.QA,panSymlog:m.Zw,zoomLinear:m.ay,zoomLog:m.dH,zoomPow:m.mK,zoomSymlog:m.bV,encode:function(t,e,n){if(t){const n=this.context.dataflow,i=t.mark.source;n.pulse(i,n.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,i,r,o){const a=this.context.dataflow,s=this.context.data[t],c=s.input,l=a.stamp();let u,f,d=s.changes;if(!1===a._trigger||!(c.value.length||e||i))return 0;if((!d||d.stamp<l)&&(s.changes=d=a.changeset(),d.stamp=l,a.runAfter((()=>{s.modified=!0,a.pulse(c,d).run()}),!0,1)),n&&(u=!0===n?m.yb:(0,m.kJ)(n)||wr(n)?n:nC(n),d.remove(u)),e&&d.insert(e),i&&(u=nC(i),c.value.some(u)?d.remove(u):d.insert(i)),r)for(f in o)d.modify(r,f,o[f]);return 1},lassoAppend:function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const r=(t=(0,m.IX)(t))[t.length-1];return void 0===r||Math.hypot(r[0]-e,r[1]-n)>i?[...t,[e,n]]:t},lassoPath:function(t){return(0,m.IX)(t).reduce(((e,n,i)=>{let[r,o]=n;return e+(0==i?"M ".concat(r,",").concat(o," "):i===t.length-1?" Z":"L ".concat(r,",").concat(o," "))}),"")},intersectLasso:function(t,e,n){const{x:i,y:r,mark:o}=n,a=(new Gh).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[s,c]of e)s<a.x1&&(a.x1=s),s>a.x2&&(a.x2=s),c<a.y1&&(a.y1=c),c>a.y2&&(a.y2=c);return a.translate(i,r),lC([[a.x1,a.y1],[a.x2,a.y2]],t,o).filter((t=>function(t,e,n){let i=0;for(let r=0,o=n.length-1;r<n.length;o=r++){const[a,s]=n[o],[c,l]=n[r];l>e!=s>e&&t<(a-c)*(e-l)/(s-l)+c&&i++}return 1&i}(t.x,t.y,e)))}},fC=["view","item","group","xy","x","y"],dC="this.",hC={},pC={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>"_[".concat((0,m.m8)(IM+t),"]"),functions:function(t){const e=(0,wS.wk)(t);fC.forEach((t=>e[t]="event.vega."+t));for(const n in uC)e[n]=dC+n;return(0,m.l7)(e,JM(t,uC,hC)),e},constants:wS._G,visitors:hC},mC=(0,wS.YP)(pC);function gC(t,e,n){return 1===arguments.length?uC[t]:(uC[t]=e,n&&(hC[t]=n),mC&&(mC.functions[t]=dC+t),this)}function vC(t,e){const n={};let i;try{t=(0,m.HD)(t)?t:(0,m.m8)(t)+"",i=(0,wS.BJ)(t)}catch(o){(0,m.vU)("Expression parse error: "+t)}i.visit((t=>{if(t.type!==wS.Lt)return;const i=t.callee.name,r=pC.visitors[i];r&&r(i,t.arguments,e,n)}));const r=mC(i);return r.globals.forEach((t=>{const i=IM+t;!(0,m.nr)(n,i)&&e.getSignal(t)&&(n[i]=e.signalRef(t))})),{$expr:(0,m.l7)({code:r.code},e.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}gC("bandwidth",(function(t,e){const n=XM(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),WM),gC("copy",(function(t,e){const n=XM(t,(e||this).context);return n?n.copy():void 0}),WM),gC("domain",(function(t,e){const n=XM(t,(e||this).context);return n?n.domain():[]}),WM),gC("range",(function(t,e){const n=XM(t,(e||this).context);return n&&n.range?n.range():[]}),WM),gC("invert",(function(t,e,n){const i=XM(t,(n||this).context);return i?(0,m.kJ)(e)?(i.invertRange||i.invert)(e):(i.invert||i.invertExtent)(e):void 0}),WM),gC("scale",(function(t,e,n){const i=XM(t,(n||this).context);return i?i(e):void 0}),WM),gC("gradient",(function(t,e,n,i,r){t=XM(t,(r||this).context);const o=Kd(e,n);let a=t.domain(),s=a[0],c=(0,m.fj)(a),l=m.yR;return c-s?l=yd(t,s,c):t=(t.interpolator?od("sequential")().interpolator(t.interpolator()):od("linear")().interpolate(t.interpolate()).range(t.range())).domain([s=0,c=1]),t.ticks&&(a=t.ticks(+i||15),s!==a[0]&&a.unshift(s),c!==(0,m.fj)(a)&&a.push(c)),a.forEach((e=>o.stop(l(e),t(e)))),o}),WM),gC("geoArea",$M,WM),gC("geoBounds",VM,WM),gC("geoCentroid",YM,WM),gC("geoShape",(function(t,e,n){const i=XM(t,(n||this).context);return function(t){return i?i.path.context(t)(e):""}}),WM),gC("indata",(function(t,e,n){const i=this.context.data[t]["index:"+e],r=i?i.value.get(n):void 0;return r?r.count:r}),(function(t,e,n,i){e[0].type!==wS.t$&&(0,m.vU)("First argument to indata must be a string literal."),e[1].type!==wS.t$&&(0,m.vU)("Second argument to indata must be a string literal.");const r=e[0].value,o=e[1].value,a="@"+o;(0,m.nr)(a,i)||(i[a]=n.getData(r).indataRef(n,o))})),gC("data",OM,qM),gC("treePath",(function(t,e,n){const i=sC(t,this),r=i[e],o=i[n];return r&&o?r.path(o).map(aC):void 0}),qM),gC("treeAncestors",(function(t,e){const n=sC(t,this)[e];return n?n.ancestors().map(aC):void 0}),qM),gC("vlSelectionTest",(function(t,e,n){for(var i,r,o,a,s,c=this.context.data[t],l=c?c.values.value:[],u=c?c[EM]&&c[EM].value:void 0,f=n===mM,d=l.length,h=0;h<d;++h)if(i=l[h],u&&f){if(-1===(o=(r=r||{})[a=i.unit]||0))continue;if(s=DM(e,i),r[a]=s?-1:++o,s&&1===u.size)return!0;if(!s&&o===u.get(a).count)return!1}else if(f^(s=DM(e,i)))return s;return d&&f}),FM),gC("vlSelectionIdTest",(function(t,e,n){const i=this.context.data[t],r=i?i.values.value:[],o=i?i[EM]&&i[EM].value:void 0,a=n===mM,s=yM(e),c=SM(r,s);if(c===r.length)return!1;if(yM(r[c])!==s)return!1;if(o&&a){if(1===o.size)return!0;if(MM(r,s)-c<o.size)return!1}return!0}),FM),gC("vlSelectionResolve",(function(t,e,n,i){for(var r,o,a,s,c,l,u,f,d,h,p,g,v=this.context.data[t],y=v?v.values.value:[],b={},x={},_={},w=y.length,k=0;k<w;++k)if(s=(r=y[k]).unit,o=r.fields,a=r.values,o&&a){for(p=0,g=o.length;p<g;++p)c=o[p],f=(u=b[c.field]||(b[c.field]={}))[s]||(u[s]=[]),_[c.field]=d=c.type.charAt(0),h=CM["".concat(d,"_union")],u[s]=h(f,(0,m.IX)(a[p]));n&&(f=x[s]||(x[s]=[])).push((0,m.IX)(a).reduce(((t,e,n)=>(t[o[n].field]=e,t)),{}))}else c=vM,l=yM(r),(f=(u=b[c]||(b[c]={}))[s]||(u[s]=[])).push(l),n&&(f=x[s]||(x[s]=[])).push({[vM]:l});if(e=e||gM,b[vM]?b[vM]=CM["".concat(vM,"_").concat(e)](...Object.values(b[vM])):Object.keys(b).forEach((t=>{b[t]=Object.keys(b[t]).map((e=>b[t][e])).reduce(((n,i)=>void 0===n?i:CM["".concat(_[t],"_").concat(e)](n,i)))})),y=Object.keys(x),n&&y.length){b[i?"vlPoint":"vlMulti"]=e===gM?{or:y.reduce(((t,e)=>(t.push(...x[e]),t)),[])}:{and:y.map((t=>({or:x[t]})))}}return b}),FM),gC("vlSelectionTuples",(function(t,e){return t.map((t=>(0,m.l7)(e.fields?{values:e.fields.map((e=>(e.getter||(e.getter=(0,m.EP)(e.field)))(t.datum)))}:{[vM]:yM(t.datum)},e)))}));const yC=(0,m.Rg)(["rule"]),bC=(0,m.Rg)(["group","image","rect"]);function xC(t){return(t+"").toLowerCase()}function _C(t,e,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...e.concat(n));return t&&t.functions?i.bind(t.functions):i}var wC={operator:(t,e)=>_C(t,["_"],e.code),parameter:(t,e)=>_C(t,["datum","_"],e.code),event:(t,e)=>_C(t,["event"],e.code),handler:(t,e)=>_C(t,["_","event"],"var datum=event.item&&event.item.datum;return ".concat(e.code,";")),encode:(t,e)=>{const{marktype:n,channels:i}=e;let r="var o=item,datum=o.datum,m=0,$;";for(const o in i){const t="o["+(0,m.m8)(o)+"]";r+="$=".concat(i[o].code,";if(").concat(t,"!==$)").concat(t,"=$,m=1;")}return r+=function(t,e){let n="";return yC[e]||(t.x2&&(t.x?(bC[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(bC[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(i,n),r+="return m;",_C(t,["item","_"],r)},codegen:{get(t){const e="[".concat(t.map(m.m8).join("]["),"]"),n=Function("_","return _".concat(e,";"));return n.path=e,n},comparator(t,e){let n;const i=Function("a","b","var u, v; return "+t.map(((t,i)=>{const r=e[i];let o,a;return t.path?(o="a".concat(t.path),a="b".concat(t.path)):((n=n||{})["f"+i]=t,o="this.f".concat(i,"(a)"),a="this.f".concat(i,"(b)")),function(t,e,n,i){return"((u = ".concat(t,") < (v = ").concat(e,") || u == null) && v != null ? ").concat(n,"\n : (u > v || v == null) && u != null ? ").concat(i,"\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ").concat(n,"\n : v !== v && u === u ? ").concat(i," : ")}(o,a,-r,r)})).join("")+"0;");return n?i.bind(n):i}}};function kC(t,e,n){if(!t||!(0,m.Kn)(t))return t;for(let i,r=0,o=EC.length;r<o;++r)if(i=EC[r],(0,m.nr)(t,i.key))return i.parse(t,e,n);return t}var EC=[{key:"$ref",parse:function(t,e){return e.get(t.$ref)||(0,m.vU)("Operator not defined: "+t.$ref)}},{key:"$key",parse:function(t,e){const n="k:"+t.$key+"_"+!!t.$flat;return e.fn[n]||(e.fn[n]=(0,m.Jy)(t.$key,t.$flat,e.expr.codegen))}},{key:"$expr",parse:function(t,e,n){t.$params&&e.parseParameters(t.$params,n);const i="e:"+t.$expr.code;return e.fn[i]||(e.fn[i]=(0,m.ZE)(e.parameterExpression(t.$expr),t.$fields))}},{key:"$field",parse:function(t,e){if(!t.$field)return null;const n="f:"+t.$field+"_"+t.$name;return e.fn[n]||(e.fn[n]=(0,m.EP)(t.$field,t.$name,e.expr.codegen))}},{key:"$encode",parse:function(t,e){const n=t.$encode,i={};for(const r in n){const t=n[r];i[r]=(0,m.ZE)(e.encodeExpression(t.$expr),t.$fields),i[r].output=t.$output}return i}},{key:"$compare",parse:function(t,e){const n="c:"+t.$compare+"_"+t.$order,i=(0,m.IX)(t.$compare).map((t=>t&&t.$tupleid?kr:t));return e.fn[n]||(e.fn[n]=(0,m.qu)(i,t.$order,e.expr.codegen))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){const n=t.$subflow;return function(t,i,r){const o=e.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(r),a.detachSubflow=()=>e.detach(o),a}}},{key:"$tupleid",parse:function(){return kr}}];const DC={skip:!0};function AC(t,e,n,i){return new SC(t,e,n,i)}function SC(t,e,n,i){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=i||wC,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function MC(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}function CC(t,e){t&&(null==e?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}SC.prototype=MC.prototype={fork(){const t=new MC(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach(t){this.subcontext=this.subcontext.filter((e=>e!==t));const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,i=n.dataflow,r=t.value;if(n.set(t.id,e),function(t){return"collect"===xC(t)}(t.type)&&r&&(r.$ingest?i.ingest(e,r.$ingest,r.$format):r.$request?i.preload(e,r.$request,r.$format):i.pulse(e,i.changeset().insert(r))),t.root&&(n.root=e),t.parent){let r=n.get(t.parent.$ref);r?(i.connect(r,[e]),e.targets().add(r)):(n.unresolved=n.unresolved||[]).push((()=>{r=n.get(t.parent.$ref),i.connect(r,[e]),e.targets().add(r)}))}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data)for(const o in t.data){const i=n.data[o]||(n.data[o]={});t.data[o].forEach((t=>i[t]=e))}},resolve(){return(this.unresolved||[]).forEach((t=>t())),delete this.unresolved,this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[xC(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,i,r){this.dataflow.on(e,n,i,r,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:function(t){const e=this,n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),t.locale&&(e.locale=t.locale),n.forEach((t=>e.parseOperator(t))),n.forEach((t=>e.parseOperatorParameters(t))),(t.streams||[]).forEach((t=>e.parseStream(t))),(t.updates||[]).forEach((t=>e.parseUpdate(t))),e.resolve()},parseOperator:function(t){const e=this;!function(t){return"operator"===xC(t)}(t.type)&&t.type?e.transform(t,t.type):e.operator(t,t.update?e.operatorExpression(t.update):null)},parseOperatorParameters:function(t){const e=this;if(t.params){const n=e.get(t.id);n||(0,m.vU)("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}},parseParameters:function(t,e){e=e||{};const n=this;for(const i in t){const r=t[i];e[i]=(0,m.kJ)(r)?r.map((t=>kC(t,n,e))):kC(r,n,e)}return e},parseStream:function(t){var e,n=this,i=null!=t.filter?n.eventExpression(t.filter):void 0,r=null!=t.stream?n.get(t.stream):void 0;t.source?r=n.events(t.source,t.type,i):t.merge&&(r=(e=t.merge.map((t=>n.get(t))))[0].merge.apply(e[0],e.slice(1))),t.between&&(e=t.between.map((t=>n.get(t))),r=r.between(e[0],e[1])),t.filter&&(r=r.filter(i)),null!=t.throttle&&(r=r.throttle(+t.throttle)),null!=t.debounce&&(r=r.debounce(+t.debounce)),null==r&&(0,m.vU)("Invalid stream definition: "+JSON.stringify(t)),t.consume&&r.consume(!0),n.stream(t,r)},parseUpdate:function(t){var e,n=this,i=(0,m.Kn)(i=t.source)?i.$ref:i,r=n.get(i),o=t.update,a=void 0;r||(0,m.vU)("Source not defined: "+t.source),e=t.target&&t.target.$expr?n.eventExpression(t.target.$expr):n.get(t.target),o&&o.$expr&&(o.$params&&(a=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(t,r,e,o,a)},getState:function(t){var e=this,n={};if(t.signals){var i=n.signals={};Object.keys(e.signals).forEach((n=>{const r=e.signals[n];t.signals(n,r)&&(i[n]=r.value)}))}if(t.data){var r=n.data={};Object.keys(e.data).forEach((n=>{const i=e.data[n];t.data(n,i)&&(r[n]=i.input.value)}))}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map((e=>e.getState(t)))),n},setState:function(t){var e=this,n=e.dataflow,i=t.data,r=t.signals;Object.keys(r||{}).forEach((t=>{n.update(e.signals[t],r[t],DC)})),Object.keys(i||{}).forEach((t=>{n.pulse(e.data[t].input,n.changeset().remove(m.yb).insert(i[t]))})),(t.subcontext||[]).forEach(((t,n)=>{const i=e.subcontext[n];i&&i.setState(t)}))}};const FC="default";function OC(t,e){const n=t.globalCursor()?"undefined"!==typeof document&&document.body:t.container();if(n)return null==e?n.style.removeProperty("cursor"):n.style.cursor=e}function NC(t,e){var n=t._runtime.data;return(0,m.nr)(n,e)||(0,m.vU)("Unrecognized data set: "+e),n[e]}function TC(t,e){Fr(e)||(0,m.vU)("Second argument to changes must be a changeset.");const n=NC(this,t);return n.modified=!0,this.pulse(n.input,e)}function zC(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function RC(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function PC(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function LC(t,e,n){var i,r,o=t._renderer,a=o&&o.canvas();return a&&(r=PC(t),(i=og(e.changedTouches?e.changedTouches[0]:e,a))[0]-=r[0],i[1]-=r[1]),e.dataflow=t,e.item=n,e.vega=function(t,e,n){const i=e?"group"===e.mark.marktype?e:e.mark.group:null;function r(t){var n,r=i;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){r=n;break}return r&&r.mark&&r.mark.interactive?r:{}}function o(t){if(!t)return n;(0,m.HD)(t)&&(t=r(t));const e=n.slice();for(;t;)e[0]-=t.x||0,e[1]-=t.y||0,t=t.mark&&t.mark.group;return e}return{view:(0,m.a9)(t),item:(0,m.a9)(e||{}),group:r,xy:o,x:t=>o(t)[0],y:t=>o(t)[1]}}(t,n,i),e}const jC="view",BC={trap:!1};function UC(t,e,n,i){t._eventListeners.push({type:n,sources:(0,m.IX)(e),handler:i})}function IC(t,e,n){const i=t._eventConfig&&t._eventConfig[e];return!(!1===i||(0,m.Kn)(i)&&!i[n])||(t.warn("Blocked ".concat(e," ").concat(n," event listener.")),!1)}function qC(t){return t.item}function WC(t){return t.item.mark.source}function HC(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}function XC(t,e,n){const i=document.createElement(t);for(const r in e)i.setAttribute(r,e[r]);return null!=n&&(i.textContent=n),i}const JC="vega-bind",GC="vega-bind-name",$C="vega-bind-radio";function VC(t,e,n,i){const r=n.event||"input",o=()=>t.update(e.value);i.signal(n.signal,e.value),e.addEventListener(r,o),UC(i,e,r,o),t.set=t=>{e.value=t,e.dispatchEvent(function(t){return"undefined"!==typeof Event?new Event(t):{type:t}}(r))}}function YC(t,e,n,i){const r=i.signal(n.signal),o=XC("div",{class:JC}),a="radio"===n.input?o:o.appendChild(XC("label"));a.appendChild(XC("span",{class:GC},n.name||n.signal)),e.appendChild(o);let s=KC;switch(n.input){case"checkbox":s=ZC;break;case"select":s=QC;break;case"radio":s=tF;break;case"range":s=eF}s(t,a,n,r)}function KC(t,e,n,i){const r=XC("input");for(const o in n)"signal"!==o&&"element"!==o&&r.setAttribute("input"===o?"type":o,n[o]);r.setAttribute("name",n.signal),r.value=i,e.appendChild(r),r.addEventListener("input",(()=>t.update(r.value))),t.elements=[r],t.set=t=>r.value=t}function ZC(t,e,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const o=XC("input",r);e.appendChild(o),o.addEventListener("change",(()=>t.update(o.checked))),t.elements=[o],t.set=t=>o.checked=!!t||null}function QC(t,e,n,i){const r=XC("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((t,e)=>{const n={value:t};nF(t,i)&&(n.selected=!0),r.appendChild(XC("option",n,(o[e]||t)+""))})),e.appendChild(r),r.addEventListener("change",(()=>{t.update(n.options[r.selectedIndex])})),t.elements=[r],t.set=t=>{for(let e=0,i=n.options.length;e<i;++e)if(nF(n.options[e],t))return void(r.selectedIndex=e)}}function tF(t,e,n,i){const r=XC("span",{class:$C}),o=n.labels||[];e.appendChild(r),t.elements=n.options.map(((e,a)=>{const s={type:"radio",name:n.signal,value:e};nF(e,i)&&(s.checked=!0);const c=XC("input",s);c.addEventListener("change",(()=>t.update(e)));const l=XC("label",{},(o[a]||e)+"");return l.prepend(c),r.appendChild(l),c})),t.set=e=>{const n=t.elements,i=n.length;for(let t=0;t<i;++t)nF(n[t].value,e)&&(n[t].checked=!0)}}function eF(t,e,n,i){i=void 0!==i?i:(+n.max+ +n.min)/2;const r=null!=n.max?n.max:Math.max(100,+i)||100,o=n.min||Math.min(0,r,+i)||0,a=n.step||B(o,r,100),s=XC("input",{type:"range",name:n.signal,min:o,max:r,step:a});s.value=i;const c=XC("span",{},+i);e.appendChild(s),e.appendChild(c);const l=()=>{c.textContent=s.value,t.update(+s.value)};s.addEventListener("input",l),s.addEventListener("change",l),t.elements=[s],t.set=t=>{s.value=t,c.textContent=t}}function nF(t,e){return t===e||t+""===e+""}function iF(t,e,n,i,r,o){return(e=e||new i(t.loader())).initialize(n,zC(t),RC(t),PC(t),r,o).background(t.background())}function rF(t,e){return e?function(){try{e.apply(this,arguments)}catch(n){t.error(n)}}:null}function oF(t,e,n){if("string"===typeof e){if("undefined"===typeof document)return t.error("DOM document instance not found."),null;if(!(e=document.querySelector(e)))return t.error("Signal bind element not found: "+e),null}if(e&&n)try{e.textContent=""}catch(i){e=null,t.error(i)}return e}const aF=t=>+t||0;function sF(t){return(0,m.Kn)(t)?{top:aF(t.top),bottom:aF(t.bottom),left:aF(t.left),right:aF(t.right)}:(t=>({top:t,bottom:t,left:t,right:t}))(aF(t))}async function cF(t,e,n,i){const r=kv(e),o=r&&r.headless;return o||(0,m.vU)("Unrecognized renderer type: "+e),await t.runAsync(),iF(t,null,null,o,n,i).renderAsync(t._scenegraph.root)}var lF="width",uF="height",fF="padding",dF={skip:!0};function hF(t,e){var n=t.autosize(),i=t.padding();return e-(n&&n.contains===fF?i.left+i.right:0)}function pF(t,e){var n=t.autosize(),i=t.padding();return e-(n&&n.contains===fF?i.top+i.bottom:0)}function mF(t,e){return e.modified&&(0,m.kJ)(e.input.value)&&t.indexOf("_:vega:_")}function gF(t,e){return!("parent"===t||e instanceof io.proxy)}function vF(t,e,n,i){const r=t.element();r&&r.setAttribute("title",function(t){return null==t?"":(0,m.kJ)(t)?yF(t):(0,m.Kn)(t)&&!(0,m.J_)(t)?(e=t,Object.keys(e).map((t=>{const n=e[t];return t+": "+((0,m.kJ)(n)?yF(n):bF(n))})).join("\n")):t+"";var e}(i))}function yF(t){return"["+t.map(bF).join(", ")+"]"}function bF(t){return(0,m.kJ)(t)?"[\u2026]":(0,m.Kn)(t)&&!(0,m.J_)(t)?"{\u2026}":t}function xF(t,e){const n=this;if(e=e||{},to.call(n),e.loader&&n.loader(e.loader),e.logger&&n.logger(e.logger),null!=e.logLevel&&n.logLevel(e.logLevel),e.locale||t.locale){const i=(0,m.l7)({},t.locale,e.locale);n.locale(qi(i.number,i.time))}n._el=null,n._elBind=null,n._renderType=e.renderer||_v.Canvas,n._scenegraph=new Zm;const i=n._scenegraph.root;n._renderer=null,n._tooltip=e.tooltip||vF,n._redraw=!0,n._handler=(new Dg).scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(t){const e=(0,m.l7)({defaults:{}},t),n=(t,e)=>{e.forEach((e=>{(0,m.kJ)(t[e])&&(t[e]=(0,m.Rg)(t[e]))}))};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}(t.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=function(t,e,n){return AC(t,io,uC,n).parse(e)}(n,t,e.expr);n._runtime=r,n._signals=r.signals,n._bind=(t.bindings||[]).map((t=>({state:null,param:(0,m.l7)({},t)}))),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=hF(n,n._width),n._viewHeight=pF(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(t){var e=t._signals,n=e[lF],i=e[uF],r=e[fF];function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,(e=>{t._width=e.size,t._viewWidth=hF(t,e.size),o()}),{size:n}),t._resizeHeight=t.add(null,(e=>{t._height=e.size,t._viewHeight=pF(t,e.size),o()}),{size:i});const a=t.add(null,o,{pad:r});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=i.rank+1,a.rank=r.rank+1}(n),function(t){t.add(null,(e=>(t._background=e.bg,t._resize=1,e.bg)),{bg:t._signals.background})}(n),function(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:FC,item:null}));t.on(t.events("view","mousemove"),e,((t,n)=>{const i=e.value,r=i?(0,m.HD)(i)?i:i.user:FC,o=n.item&&n.item.cursor||null;return i&&r===i.user&&o==i.item?i:{user:r,item:o}})),t.add(null,(function(e){let n=e.cursor,i=this.value;return(0,m.HD)(n)||(i=n.item,n=n.user),OC(t,n&&n!==FC?n:i||n),i}),{cursor:e})}(n),n.description(t.description),e.hover&&n.hover(),e.container&&n.initialize(e.container,e.bind)}function _F(t,e){return(0,m.nr)(t._signals,e)?t._signals[e]:(0,m.vU)("Unrecognized signal name: "+(0,m.m8)(e))}function wF(t,e){const n=(t._targets||[]).filter((t=>t._update&&t._update.handler===e));return n.length?n[0]:null}function kF(t,e,n,i){let r=wF(n,i);return r||(r=rF(t,(()=>i(e,n.value))),r.handler=i,t.on(n,null,r)),t}function EF(t,e,n){const i=wF(e,n);return i&&e._targets.remove(i),t}(0,m.XW)(xF,to,{async evaluate(t,e,n){if(await to.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,function(t){var e=PC(t),n=zC(t),i=RC(t);t._renderer.background(t.background()),t._renderer.resize(n,i,e),t._handler.origin(e),t._resizeListeners.forEach((e=>{try{e(n,i)}catch(r){t.error(r)}}))}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&br(this,n),this},dirty(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=null!=t?t+"":null;return e!==this._desc&&CC(this._el,this._desc=e),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const i=_F(this,t);return 1===arguments.length?i.value:this.update(i,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",sF(t)):sF(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){return arguments.length?(kv(t)||(0,m.vU)("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},tooltip(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},loader(t){return arguments.length?(t!==this._loader&&(to.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(_F(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(t,e,n,i,r,o){this.runAfter((a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal(lF,n,dF),a._resizeWidth.skip(!0)),a.height()!==i&&(s=1,a.signal(uF,i,dF),a._resizeHeight.skip(!0)),a._viewWidth!==t&&(a._resize=1,a._viewWidth=t),a._viewHeight!==e&&(a._resize=1,a._viewHeight=e),a._origin[0]===r[0]&&a._origin[1]===r[1]||(a._resize=1,a._origin=r),s&&a.run("enter"),o&&a.runAfter((t=>t.resize()))}),!1,1)},addEventListener(t,e,n){let i=e;return n&&!1===n.trap||(i=rF(this,e),i.raw=e),this._handler.on(t,i),this},removeEventListener(t,e){for(var n,i,r=this._handler.handlers(t),o=r.length;--o>=0;)if(i=r[o].type,n=r[o].handler,t===i&&(e===n||e===n.raw)){this._handler.off(i,n);break}return this},addResizeListener(t){const e=this._resizeListeners;return e.indexOf(t)<0&&e.push(t),this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},addSignalListener(t,e){return kF(this,t,_F(this,t),e)},removeSignalListener(t,e){return EF(this,_F(this,t),e)},addDataListener(t,e){return kF(this,t,NC(this,t).values,e)},removeDataListener(t,e){return EF(this,NC(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=OC(this,null);this._globalCursor=!!t,e&&OC(this,e)}return this}return this._globalCursor},preventDefault(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},timer:function(t,e){this._timers.push(function(t,e,n){var i=new Hk.B7,r=e;return null==e?(i.restart(t,e,n),i):(i._restart=i.restart,i.restart=function(t,e,n){e=+e,n=null==n?(0,Hk.zO)():+n,i._restart((function o(a){a+=r,i._restart(o,r+=e,n),t(a)}),e,n)},i.restart(t,e,n),i)}((function(e){t({timestamp:Date.now(),elapsed:e})}),e))},events:function(t,e,n){var i,r=this,o=new Br(n),a=function(n,i){r.runAsync(null,(()=>{t===jC&&function(t,e){var n=t._eventConfig.defaults,i=n.prevent,r=n.allow;return!1!==i&&!0!==r&&(!0===i||!1===r||(i?i[e]:r?!r[e]:t.preventDefault()))}(r,e)&&n.preventDefault(),o.receive(LC(r,n,i))}))};if("timer"===t)IC(r,"timer",e)&&r.timer(a,e);else if(t===jC)IC(r,"view",e)&&r.addEventListener(e,a,BC);else if("window"===t?IC(r,"window",e)&&"undefined"!==typeof window&&(i=[window]):"undefined"!==typeof document&&IC(r,"selector",e)&&(i=Array.from(document.querySelectorAll(t))),i){for(var s=0,c=i.length;s<c;++s)i[s].addEventListener(e,a);UC(r,i,e,a)}else r.warn("Can not resolve event source: "+t);return o},finalize:function(){var t,e,n,i=this._tooltip,r=this._timers,o=this._eventListeners;for(t=r.length;--t>=0;)r[t].stop();for(t=o.length;--t>=0;)for(e=(n=o[t]).sources.length;--e>=0;)n.sources[e].removeEventListener(n.type,n.handler);return i&&i.call(this,this._handler,null,null,null),this},hover:function(t,e){return e=[e||"update",(t=[t||"hover"])[0]],this.on(this.events("view","mouseover",qC),WC,HC(t)),this.on(this.events("view","mouseout",qC),WC,HC(e)),this},data:function(t,e){return arguments.length<2?NC(this,t).values.value:TC.call(this,t,Or().remove(m.yb).insert(e))},change:TC,insert:function(t,e){return TC.call(this,t,Or().insert(e))},remove:function(t,e){return TC.call(this,t,Or().remove(e))},scale:function(t){var e=this._runtime.scales;return(0,m.nr)(e,t)||(0,m.vU)("Unrecognized scale or projection: "+t),e[t].value},initialize:function(t,e){const n=this,i=n._renderType,r=n._eventConfig.bind,o=kv(i);t=n._el=t?oF(n,t,!0):null,function(t){const e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),CC(e,t.description()))}(n),o||n.error("Unrecognized renderer type: "+i);const a=o.handler||Dg,s=t?o.renderer:o.headless;return n._renderer=s?iF(n,n._renderer,t,s):null,n._handler=function(t,e,n,i){const r=new i(t.loader(),rF(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,PC(t),t);return e&&e.handlers().forEach((t=>{r.on(t.type,t.handler)})),r}(n,n._handler,t,a),n._redraw=!0,t&&"none"!==r&&(e=e?n._elBind=oF(n,e,!0):t.appendChild(XC("form",{class:"vega-bindings"})),n._bind.forEach((t=>{t.param.element&&"container"!==r&&(t.element=oF(n,t.param.element,!!t.param.input))})),n._bind.forEach((t=>{!function(t,e,n){if(!e)return;const i=n.param;let r=n.state;r||(r=n.state={elements:null,active:!1,set:null,update:e=>{e!=t.signal(i.signal)&&t.runAsync(null,(()=>{r.source=!0,t.signal(i.signal,e)}))}},i.debounce&&(r.update=(0,m.Ds)(i.debounce,r.update))),(null==i.input&&i.element?VC:YC)(r,e,i,t),r.active||(t.on(t._signals[i.signal],null,(()=>{r.source?r.source=!1:r.set(t.signal(i.signal))})),r.active=!0)}(n,t.element||e,t)}))),n},toImageURL:async function(t,e){t!==_v.Canvas&&t!==_v.SVG&&t!==_v.PNG&&(0,m.vU)("Unrecognized image type: "+t);const n=await cF(this,t,e);return t===_v.SVG?function(t,e){const n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function(t,e){return(await cF(this,_v.Canvas,t,e)).canvas()},toSVG:async function(t){return(await cF(this,_v.SVG,t)).svg()},getState:function(t){return this._runtime.getState(t||{data:mF,signals:gF,recurse:!0})},setState:function(t){return this.runAsync(null,(e=>{e._trigger=!1,e._runtime.setState(t)}),(t=>{t._trigger=!0})),this}});var DF=n(77155);function AF(t){return(0,m.Kn)(t)?t:{type:t||"pad"}}const SF=t=>+t||0,MF=t=>({top:t,bottom:t,left:t,right:t});function CF(t){return(0,m.Kn)(t)?t.signal?t:{top:SF(t.top),bottom:SF(t.bottom),left:SF(t.left),right:SF(t.right)}:MF(SF(t))}const FF=t=>(0,m.Kn)(t)&&!(0,m.kJ)(t)?(0,m.l7)({},t):{value:t};function OF(t,e,n,i){if(null!=n){return(0,m.Kn)(n)&&!(0,m.kJ)(n)||(0,m.kJ)(n)&&n.length&&(0,m.Kn)(n[0])?t.update[e]=n:t[i||"enter"][e]={value:n},1}return 0}function NF(t,e,n){for(const i in e)OF(t,i,e[i]);for(const i in n)OF(t,i,n[i],"update")}function TF(t,e,n){for(const i in e)n&&(0,m.nr)(n,i)||(t[i]=(0,m.l7)(t[i]||{},e[i]));return t}function zF(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}const RF="mark",PF="frame",LF="scope",jF="axis",BF="axis-domain",UF="axis-grid",IF="axis-label",qF="axis-tick",WF="axis-title",HF="legend",XF="legend-band",JF="legend-entry",GF="legend-gradient",$F="legend-label",VF="legend-symbol",YF="legend-title",KF="title",ZF="title-text",QF="title-subtitle";function tO(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const eO=t=>(0,m.HD)(t)?(0,m.m8)(t):t.signal?"(".concat(t.signal,")"):oO(t);function nO(t){if(null!=t.gradient)return function(t){const e=[t.start,t.stop,t.count].map((t=>null==t?null:(0,m.m8)(t)));for(;e.length&&null==(0,m.fj)(e);)e.pop();return e.unshift(eO(t.gradient)),"gradient(".concat(e.join(","),")")}(t);let e=t.signal?"(".concat(t.signal,")"):t.color?function(t){return t.c?iO("hcl",t.h,t.c,t.l):t.h||t.s?iO("hsl",t.h,t.s,t.l):t.l||t.a?iO("lab",t.l,t.a,t.b):t.r||t.g||t.b?iO("rgb",t.r,t.g,t.b):null}(t.color):null!=t.field?oO(t.field):void 0!==t.value?(0,m.m8)(t.value):void 0;return null!=t.scale&&(e=function(t,e){const n=eO(t.scale);null!=t.range?e="lerp(_range(".concat(n,"), ").concat(+t.range,")"):(void 0!==e&&(e="_scale(".concat(n,", ").concat(e,")")),t.band&&(e=(e?e+"+":"")+"_bandwidth(".concat(n,")")+(1===+t.band?"":"*"+rO(t.band)),t.extra&&(e="(datum.extra ? _scale(".concat(n,", datum.extra.value) : ").concat(e,")"))),null==e&&(e="0"));return e}(t,e)),void 0===e&&(e=null),null!=t.exponent&&(e="pow(".concat(e,",").concat(rO(t.exponent),")")),null!=t.mult&&(e+="*".concat(rO(t.mult))),null!=t.offset&&(e+="+".concat(rO(t.offset))),t.round&&(e="round(".concat(e,")")),e}const iO=(t,e,n,i)=>"(".concat(t,"(").concat([e,n,i].map(nO).join(","),")+'')");function rO(t){return(0,m.Kn)(t)?"("+nO(t)+")":t}function oO(t){return aO((0,m.Kn)(t)?t:{datum:t})}function aO(t){let e,n,i;if(t.signal)e="datum",i=t.signal;else if(t.group||t.parent){for(n=Math.max(1,t.level||1),e="item";n-- >0;)e+=".mark.group";t.parent?(i=t.parent,e+=".datum"):i=t.group}else t.datum?(e="datum",i=t.datum):(0,m.vU)("Invalid field reference: "+(0,m.m8)(t));return t.signal||(i=(0,m.HD)(i)?(0,m._k)(i).map(m.m8).join("]["):aO(i)),e+"["+i+"]"}function sO(t,e,n,i,r,o){const a={};(o=o||{}).encoders={$encode:a},t=function(t,e,n,i,r){const o={},a={};let s,c,l,u;for(c in c="lineBreak","text"!==e||null==r[c]||zF(c,t)||tO(o,c,r[c]),("legend"==n||String(n).startsWith("axis"))&&(n=null),u=n===PF?r.group:n===RF?(0,m.l7)({},r.mark,r[e]):null,u)l=zF(c,t)||("fill"===c||"stroke"===c)&&(zF("fill",t)||zF("stroke",t)),l||tO(o,c,u[c]);for(c in(0,m.IX)(i).forEach((e=>{const n=r.style&&r.style[e];for(const i in n)zF(i,t)||tO(o,i,n[i])})),t=(0,m.l7)({},t),o)u=o[c],u.signal?(s=s||{})[c]=u:a[c]=u;return t.enter=(0,m.l7)(a,t.enter),s&&(t.update=(0,m.l7)(s,t.update)),t}(t,e,n,i,r.config);for(const s in t)a[s]=cO(t[s],e,o,r);return o}function cO(t,e,n,i){const r={},o={};for(const s in t)null!=t[s]&&(r[s]=lO((a=t[s],(0,m.kJ)(a)?function(t){let e="";return t.forEach((t=>{const n=nO(t);e+=t.test?"(".concat(t.test,")?").concat(n,":"):n})),":"===(0,m.fj)(e)&&(e+="null"),e}(a):nO(a)),i,n,o));var a;return{$expr:{marktype:e,channels:r},$fields:Object.keys(o),$output:Object.keys(t)}}function lO(t,e,n,i){const r=vC(t,e);return r.$fields.forEach((t=>i[t]=1)),(0,m.l7)(n,r.$params),r.$expr}const uO="outer",fO=["value","update","init","react","bind"];function dO(t,e){(0,m.vU)(t+' for "outer" push: '+(0,m.m8)(e))}function hO(t,e){const n=t.name;if(t.push===uO)e.signals[n]||dO("No prior signal definition",n),fO.forEach((e=>{void 0!==t[e]&&dO("Invalid property ",e)}));else{const i=e.addSignal(n,t.value);!1===t.react&&(i.react=!1),t.bind&&e.addBinding(n,t.bind)}}function pO(t,e,n,i){this.id=-1,this.type=t,this.value=e,this.params=n,i&&(this.parent=i)}function mO(t,e,n,i){return new pO(t,e,n,i)}function gO(t,e){return mO("operator",t,e)}function vO(t){const e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function yO(t,e){return e?{$field:t,$name:e}:{$field:t}}const bO=yO("key");function xO(t,e){return{$compare:t,$order:e}}const _O="descending";function wO(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const kO="scope",EO="view";function DO(t){return t&&t.signal}function AO(t){if(DO(t))return!0;if((0,m.Kn)(t))for(const e in t)if(AO(t[e]))return!0;return!1}function SO(t,e){return null!=t?t:e}function MO(t){return t&&t.signal||t}const CO="timer";function FO(t,e){return(t.merge?OO:t.stream?NO:t.type?TO:(0,m.vU)("Invalid stream specification: "+(0,m.m8)(t)))(t,e)}function OO(t,e){const n=t.merge.map((t=>FO(t,e))),i=zO({merge:n},t,e);return e.addStream(i).id}function NO(t,e){const n=zO({stream:FO(t.stream,e)},t,e);return e.addStream(n).id}function TO(t,e){let n;t.type===CO?(n=e.event(CO,t.throttle),t={between:t.between,filter:t.filter}):n=e.event(function(t){return t===kO?EO:t||EO}(t.source),t.type);const i=zO({stream:n},t,e);return 1===Object.keys(i).length?n:e.addStream(i).id}function zO(t,e,n){let i=e.between;return i&&(2!==i.length&&(0,m.vU)('Stream "between" parameter must have 2 entries: '+(0,m.m8)(e)),t.between=[FO(i[0],n),FO(i[1],n)]),i=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&i.push(function(t,e,n){const i="event.item";return i+(t&&"*"!==t?"&&"+i+".mark.marktype==='"+t+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(e?"&&"+i+".mark.name==='"+e+"'":"")}(e.marktype,e.markname,e.markrole)),e.source===kO&&i.push("inScope(event.item)"),i.length&&(t.filter=vC("("+i.join(")&&(")+")",n).$expr),null!=(i=e.throttle)&&(t.throttle=+i),null!=(i=e.debounce)&&(t.debounce=+i),e.consume&&(t.consume=!0),t}const RO={code:"_.$value",ast:{type:"Identifier",value:"value"}};function PO(t,e,n){const i=t.encode,r={target:n};let o=t.events,a=t.update,s=[];o||(0,m.vU)("Signal update missing events specification."),(0,m.HD)(o)&&(o=(0,DF.r)(o,e.isSubscope()?kO:EO)),o=(0,m.IX)(o).filter((t=>t.signal||t.scale?(s.push(t),0):1)),s.length>1&&(s=[LO(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=i&&(a&&(0,m.vU)("Signal encode and update are mutually exclusive."),a="encode(item(),"+(0,m.m8)(i)+")"),r.update=(0,m.HD)(a)?vC(a,e):null!=a.expr?vC(a.expr,e):null!=a.value?a.value:null!=a.signal?{$expr:RO,$params:{$value:e.signalRef(a.signal)}}:(0,m.vU)("Invalid signal update specification."),t.force&&(r.options={force:!0}),s.forEach((t=>e.addUpdate((0,m.l7)(function(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):FO(t,e)}}(t,e),r))))}function LO(t){return{signal:"["+t.map((t=>t.scale?'scale("'+t.scale+'")':t.signal))+"]"}}const jO=t=>(e,n,i)=>mO(t,n,e||void 0,i),BO=jO("aggregate"),UO=jO("axisticks"),IO=jO("bound"),qO=jO("collect"),WO=jO("compare"),HO=jO("datajoin"),XO=jO("encode"),JO=jO("expression"),GO=jO("facet"),$O=jO("field"),VO=jO("key"),YO=jO("legendentries"),KO=jO("load"),ZO=jO("mark"),QO=jO("multiextent"),tN=jO("multivalues"),eN=jO("overlap"),nN=jO("params"),iN=jO("prefacet"),rN=jO("projection"),oN=jO("proxy"),aN=jO("relay"),sN=jO("render"),cN=jO("scale"),lN=jO("sieve"),uN=jO("sortitems"),fN=jO("viewlayout"),dN=jO("values");let hN=0;const pN={min:"min",max:"max",count:"sum"};function mN(t,e){const n=e.getScale(t.name).params;let i;for(i in n.domain=bN(t.domain,t,e),null!=t.range&&(n.range=SN(t,e,n)),null!=t.interpolate&&function(t,e){e.interpolate=gN(t.type||t),null!=t.gamma&&(e.interpolateGamma=gN(t.gamma))}(t.interpolate,n),null!=t.nice&&(n.nice=function(t){return(0,m.Kn)(t)?{interval:gN(t.interval),step:gN(t.step)}:gN(t)}(t.nice)),null!=t.bins&&(n.bins=function(t,e){return t.signal||(0,m.kJ)(t)?vN(t,e):e.objectProperty(t)}(t.bins,e)),t)(0,m.nr)(n,i)||"name"===i||(n[i]=gN(t[i],e))}function gN(t,e){return(0,m.Kn)(t)?t.signal?e.signalRef(t.signal):(0,m.vU)("Unsupported object: "+(0,m.m8)(t)):t}function vN(t,e){return t.signal?e.signalRef(t.signal):t.map((t=>gN(t,e)))}function yN(t){(0,m.vU)("Can not find data set: "+(0,m.m8)(t))}function bN(t,e,n){if(t)return t.signal?n.signalRef(t.signal):((0,m.kJ)(t)?xN:t.fields?wN:_N)(t,e,n);null==e.domainMin&&null==e.domainMax||(0,m.vU)("No scale domain defined for domainMin/domainMax to override.")}function xN(t,e,n){return t.map((t=>gN(t,n)))}function _N(t,e,n){const i=n.getData(t.data);return i||yN(t.data),ld(e.type)?i.valuesRef(n,t.field,EN(t.sort,!1)):hd(e.type)?i.domainRef(n,t.field):i.extentRef(n,t.field)}function wN(t,e,n){const i=t.data,r=t.fields.reduce(((t,e)=>(e=(0,m.HD)(e)?{data:i,field:e}:(0,m.kJ)(e)||e.signal?function(t,e){const n="_:vega:_"+hN++,i=qO({});if((0,m.kJ)(t))i.value={$ingest:t};else if(t.signal){const r="setdata("+(0,m.m8)(n)+","+t.signal+")";i.params.input=e.signalRef(r)}return e.addDataPipeline(n,[i,lN({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t)),[]);return(ld(e.type)?kN:hd(e.type)?DN:AN)(t,n,r)}function kN(t,e,n){const i=EN(t.sort,!0);let r,o;const a=n.map((t=>{const n=e.getData(t.data);return n||yN(t.data),n.countsRef(e,t.field,i)})),s={groupby:bO,pulse:a};i&&(r=i.op||"count",o=i.field?wO(r,i.field):"count",s.ops=[pN[r]],s.fields=[e.fieldRef(o)],s.as=[o]),r=e.add(BO(s));const c=e.add(qO({pulse:vO(r)}));return o=e.add(dN({field:bO,sort:e.sortRef(i),pulse:vO(c)})),vO(o)}function EN(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field&&t.op&&!pN[t.op]&&(0,m.vU)("Multiple domain scales can not be sorted using "+t.op):(0,m.vU)("No field provided for sort aggregate op: "+t.op):(0,m.Kn)(t)?t.field="key":t={field:"key"}),t}function DN(t,e,n){const i=n.map((t=>{const n=e.getData(t.data);return n||yN(t.data),n.domainRef(e,t.field)}));return vO(e.add(tN({values:i})))}function AN(t,e,n){const i=n.map((t=>{const n=e.getData(t.data);return n||yN(t.data),n.extentRef(e,t.field)}));return vO(e.add(QO({extents:i})))}function SN(t,e,n){const i=e.config.range;let r=t.range;if(r.signal)return e.signalRef(r.signal);if((0,m.HD)(r)){if(i&&(0,m.nr)(i,r))return SN(t=(0,m.l7)({},t,{range:i[r]}),e,n);"width"===r?r=[0,{signal:"width"}]:"height"===r?r=ld(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:(0,m.vU)("Unrecognized scale range value: "+(0,m.m8)(r))}else{if(r.scheme)return n.scheme=(0,m.kJ)(r.scheme)?vN(r.scheme,e):gN(r.scheme,e),r.extent&&(n.schemeExtent=vN(r.extent,e)),void(r.count&&(n.schemeCount=gN(r.count,e)));if(r.step)return void(n.rangeStep=gN(r.step,e));if(ld(t.type)&&!(0,m.kJ)(r))return bN(r,t,e);(0,m.kJ)(r)||(0,m.vU)("Unsupported range type: "+(0,m.m8)(r))}return r.map((t=>((0,m.kJ)(t)?vN:gN)(t,e)))}function MN(t,e,n){return(0,m.kJ)(t)?t.map((t=>MN(t,e,n))):(0,m.Kn)(t)?t.signal?n.signalRef(t.signal):"fit"===e?t:(0,m.vU)("Unsupported parameter object: "+(0,m.m8)(t)):t}const CN="top",FN="left",ON="right",NN="bottom",TN="center",zN="vertical",RN="start",PN="end",LN="index",jN="label",BN="offset",UN="perc",IN="perc2",qN="value",WN="guide-label",HN="guide-title",XN="group-title",JN="group-subtitle",GN="symbol",$N="gradient",VN="discrete",YN="size",KN=[YN,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],ZN={name:1,style:1,interactive:1},QN={value:0},tT={value:1},eT="group",nT="rect",iT="rule",rT="symbol",oT="text";function aT(t){return t.type=eT,t.interactive=t.interactive||!1,t}function sT(t,e){const n=(n,i)=>SO(t[n],SO(e[n],i));return n.isVertical=n=>zN===SO(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>SO(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>SO(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>SO(t.columns,SO(e.columns,+n.isVertical(!0))),n}function cT(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function lT(t,e,n){return"item.anchor === '".concat(RN,"' ? ").concat(t," : item.anchor === '").concat(PN,"' ? ").concat(e," : ").concat(n)}const uT=lT((0,m.m8)(FN),(0,m.m8)(ON),(0,m.m8)(TN));function fT(t,e){return e?t?(0,m.Kn)(t)?Object.assign({},t,{offset:fT(t.offset,e)}):{value:t,offset:e}:e:t}function dT(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=TF(t.encode,e,ZN)):t.interactive=!1,t}function hT(t,e,n,i){const r=sT(t,n),o=r.isVertical(),a=r.gradientThickness(),s=r.gradientLength();let c,l,u,f,d;o?(l=[0,1],u=[0,0],f=a,d=s):(l=[0,0],u=[1,0],f=s,d=a);const h={enter:c={opacity:QN,x:QN,y:QN,width:FF(f),height:FF(d)},update:(0,m.l7)({},c,{opacity:tT,fill:{gradient:e,start:l,stop:u}}),exit:{opacity:QN}};return NF(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),dT({type:nT,role:GF,encode:h},i)}function pT(t,e,n,i,r){const o=sT(t,n),a=o.isVertical(),s=o.gradientThickness(),c=o.gradientLength();let l,u,f,d,h="";a?(l="y",f="y2",u="x",d="width",h="1-"):(l="x",f="x2",u="y",d="height");const p={opacity:QN,fill:{scale:e,field:qN}};p[l]={signal:h+"datum."+UN,mult:c},p[u]=QN,p[f]={signal:h+"datum."+IN,mult:c},p[d]=FF(s);const g={enter:p,update:(0,m.l7)({},p,{opacity:tT}),exit:{opacity:QN}};return NF(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),dT({type:nT,role:XF,key:qN,from:r,encode:g},i)}const mT="datum.".concat(UN,'<=0?"').concat(FN,'":datum.').concat(UN,'>=1?"').concat(ON,'":"').concat(TN,'"'),gT="datum.".concat(UN,'<=0?"').concat(NN,'":datum.').concat(UN,'>=1?"').concat(CN,'":"').concat("middle",'"');function vT(t,e,n,i){const r=sT(t,e),o=r.isVertical(),a=FF(r.gradientThickness()),s=r.gradientLength();let c,l,u,f,d=r("labelOverlap"),h="";const p={enter:c={opacity:QN},update:l={opacity:tT,text:{field:jN}},exit:{opacity:QN}};return NF(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:SO(t.labelLimit,e.gradientLabelLimit)}),o?(c.align={value:"left"},c.baseline=l.baseline={signal:gT},u="y",f="x",h="1-"):(c.align=l.align={signal:mT},c.baseline={value:"top"},u="x",f="y"),c[u]=l[u]={signal:h+"datum."+UN,mult:s},c[f]=l[f]=a,a.offset=SO(t.labelOffset,e.gradientLabelOffset)||0,d=d?{separation:r("labelSeparation"),method:d,order:"datum."+LN}:void 0,dT({type:oT,role:$F,style:WN,key:qN,from:i,encode:p,overlap:d},n)}function yT(t,e,n,i,r){const o=sT(t,e),a=n.entries,s=!(!a||!a.interactive),c=a?a.name:void 0,l=o("clipHeight"),u=o("symbolOffset"),f={data:"value"},d="(".concat(r,") ? datum.").concat(BN," : datum.").concat(YN),h=l?FF(l):{field:YN},p="datum.".concat(LN),m="max(1, ".concat(r,")");let g,v,y,b,x;h.mult=.5,g={enter:v={opacity:QN,x:{signal:d,mult:.5,offset:u},y:h},update:y={opacity:tT,x:v.x,y:v.y},exit:{opacity:QN}};let _=null,w=null;t.fill||(_=e.symbolBaseFillColor,w=e.symbolBaseStrokeColor),NF(g,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",w),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),KN.forEach((e=>{t[e]&&(y[e]=v[e]={scale:t[e],field:qN})}));const k=dT({type:rT,role:VF,key:qN,from:f,clip:!!l||void 0,encode:g},n.symbols),E=FF(u);E.offset=o("labelOffset"),g={enter:v={opacity:QN,x:{signal:d,offset:E},y:h},update:y={opacity:tT,text:{field:jN},x:v.x,y:v.y},exit:{opacity:QN}},NF(g,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const D=dT({type:oT,role:$F,style:WN,key:qN,from:f,encode:g},n.labels);return g={enter:{noBound:{value:!l},width:QN,height:l?FF(l):QN,opacity:QN},exit:{opacity:QN},update:y={opacity:tT,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b="ceil(item.mark.items.length / ".concat(m,")"),y.row.signal="".concat(p,"%").concat(b),y.column.signal="floor(".concat(p," / ").concat(b,")"),x={field:["row",p]}):(y.row.signal="floor(".concat(p," / ").concat(m,")"),y.column.signal="".concat(p," % ").concat(m),x={field:p}),y.column.signal="(".concat(r,")?").concat(y.column.signal,":").concat(p),aT({role:LF,from:i={facet:{data:i,name:"value",groupby:LN}},encode:TF(g,a,ZN),marks:[k,D],name:c,interactive:s,sort:x})}const bT='item.orient === "left"',xT='item.orient === "right"',_T="(".concat(bT," || ").concat(xT,")"),wT="datum.vgrad && ".concat(_T),kT=lT('"top"','"bottom"','"middle"'),ET=lT('"right"','"left"','"center"'),DT="datum.vgrad && ".concat(xT," ? (").concat(ET,") : (").concat(_T," && !(datum.vgrad && ").concat(bT,')) ? "left" : ').concat(uT),AT="item._anchor || (".concat(_T,' ? "middle" : "start")'),ST="".concat(wT," ? (").concat(bT," ? -90 : 90) : 0"),MT="".concat(_T," ? (datum.vgrad ? (").concat(xT,' ? "bottom" : "top") : ').concat(kT,') : "top"');function CT(t,e){let n;return(0,m.Kn)(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+FT(t.path)+")":t.sphere&&(n="geoShape("+FT(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function FT(t){return(0,m.Kn)(t)&&t.signal?t.signal:(0,m.m8)(t)}function OT(t){const e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")&&e.indexOf("title")?t.type===eT?LF:e||RF:e}function NT(t){return{marktype:t.type,name:t.name||void 0,role:t.role||OT(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function TT(t,e){return t&&t.signal?e.signalRef(t.signal):!1!==t}function zT(t,e){const n=ro(t.type);n||(0,m.vU)("Unrecognized transform type: "+(0,m.m8)(t.type));const i=mO(n.type.toLowerCase(),null,RT(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(i)),i.metadata=n.metadata||{},i}function RT(t,e,n){const i={},r=t.params.length;for(let o=0;o<r;++o){const r=t.params[o];i[r.name]=PT(r,e,n)}return i}function PT(t,e,n){const i=t.type,r=e[t.name];return"index"===i?function(t,e,n){(0,m.HD)(e.from)||(0,m.vU)('Lookup "from" parameter must be a string literal.');return n.getData(e.from).lookupRef(n,e.key)}(0,e,n):void 0!==r?"param"===i?function(t,e,n){const i=e[t.name];return t.array?((0,m.kJ)(i)||(0,m.vU)("Expected an array of sub-parameters. Instead: "+(0,m.m8)(i)),i.map((e=>jT(t,e,n)))):jT(t,i,n)}(t,e,n):"projection"===i?n.projectionRef(e[t.name]):t.array&&!DO(r)?r.map((e=>LT(t,e,n))):LT(t,r,n):void(t.required&&(0,m.vU)("Missing required "+(0,m.m8)(e.type)+" parameter: "+(0,m.m8)(t.name)))}function LT(t,e,n){const i=t.type;if(DO(e))return qT(i)?(0,m.vU)("Expression references can not be signals."):WT(i)?n.fieldRef(e):HT(i)?n.compareRef(e):n.signalRef(e.signal);{const r=t.expr||WT(i);return r&&BT(e)?n.exprRef(e.expr,e.as):r&&UT(e)?yO(e.field,e.as):qT(i)?vC(e,n):IT(i)?vO(n.getData(e).values):WT(i)?yO(e):HT(i)?n.compareRef(e):e}}function jT(t,e,n){const i=t.params.length;let r;for(let a=0;a<i;++a){r=t.params[a];for(const t in r.key)if(r.key[t]!==e[t]){r=null;break}if(r)break}r||(0,m.vU)("Unsupported parameter: "+(0,m.m8)(e));const o=(0,m.l7)(RT(r,e,n),r.key);return vO(n.add(nN(o)))}const BT=t=>t&&t.expr,UT=t=>t&&t.field,IT=t=>"data"===t,qT=t=>"expr"===t,WT=t=>"field"===t,HT=t=>"compare"===t;function XT(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:vO(e.getData(t.data).output)}function JT(t,e,n,i,r){this.scope=t,this.input=e,this.output=n,this.values=i,this.aggregate=r,this.index={}}function GT(t){return(0,m.HD)(t)?t:null}function $T(t,e,n){const i=wO(n.op,n.field);let r;if(e.ops){for(let o=0,a=e.as.length;o<a;++o)if(e.as[o]===i)return}else e.ops=["count"],e.fields=[null],e.as=["count"];n.op&&(e.ops.push((r=n.op.signal)?t.signalRef(r):n.op),e.fields.push(t.fieldRef(n.field)),e.as.push(i))}function VT(t,e,n,i,r,o,a){const s=e[n]||(e[n]={}),c=function(t){return(0,m.Kn)(t)?(t.order===_O?"-":"+")+wO(t.op,t.field):""}(o);let l,u,f=GT(r);if(null!=f&&(t=e.scope,f+=c?"|"+c:"",l=s[f]),!l){const n=o?{field:bO,pulse:e.countsRef(t,r,o)}:{field:t.fieldRef(r),pulse:vO(e.output)};c&&(n.sort=t.sortRef(o)),u=t.add(mO(i,void 0,n)),a&&(e.index[r]=u),l=vO(u),null!=f&&(s[f]=l)}return l}function YT(t,e,n){const i=t.remove,r=t.insert,o=t.toggle,a=t.modify,s=t.values,c=e.add(gO()),l=vC("if("+t.trigger+',modify("'+n+'",'+[r,i,o,a,s].map((t=>null==t?"null":t)).join(",")+"),0)",e);c.update=l.$expr,c.params=l.$params}function KT(t,e){const n=OT(t),i=t.type===eT,r=t.from&&t.from.facet,o=t.overlap;let a,s,c,l,u,f,d,h=t.layout||n===LF||n===PF;const p=n===RF||h||r,g=function(t,e,n){let i,r,o,a,s;return t?(i=t.facet)&&(e||(0,m.vU)("Only group marks can be faceted."),null!=i.field?a=s=XT(i,n):(t.data?s=vO(n.getData(t.data).aggregate):(o=zT((0,m.l7)({type:"aggregate",groupby:(0,m.IX)(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=XT(i,n),a=s=vO(n.add(o))),r=n.keyRef(i.groupby,!0))):a=vO(n.add(qO(null,[{}]))),a||(a=XT(t,n)),{key:r,pulse:a,parent:s}}(t.from,i,e);s=e.add(HO({key:g.key||(t.key?yO(t.key):void 0),pulse:g.pulse,clean:!i}));const v=vO(s);s=c=e.add(qO({pulse:v})),s=e.add(ZO({markdef:NT(t),interactive:TT(t.interactive,e),clip:CT(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:vO(s)}));const y=vO(s);s=l=e.add(XO(sO(t.encode,t.type,n,t.style,e,{mod:!1,pulse:y}))),s.params.parent=e.encode(),t.transform&&t.transform.forEach((t=>{const n=zT(t,e),i=n.metadata;(i.generates||i.changes)&&(0,m.vU)("Mark transforms should not generate new data."),i.nomod||(l.params.mod=!0),n.params.pulse=vO(s),e.add(s=n)})),t.sort&&(s=e.add(uN({sort:e.compareRef(t.sort),pulse:vO(s)})));const b=vO(s);(r||h)&&(h=e.add(fN({layout:e.objectProperty(t.layout),legends:e.legends,mark:y,pulse:b})),f=vO(h));const x=e.add(IO({mark:y,pulse:f||b}));d=vO(x),i&&(p&&(a=e.operators,a.pop(),h&&a.pop()),e.pushState(b,f||d,v),r?function(t,e,n){const i=t.from.facet,r=i.name,o=XT(i,e);let a;i.name||(0,m.vU)("Facet must have a name: "+(0,m.m8)(i)),i.data||(0,m.vU)("Facet must reference a data set: "+(0,m.m8)(i)),i.field?a=e.add(iN({field:e.fieldRef(i.field),pulse:o})):i.groupby?a=e.add(GO({key:e.keyRef(i.groupby),group:vO(e.proxy(n.parent)),pulse:o})):(0,m.vU)("Facet must specify groupby or field: "+(0,m.m8)(i));const s=e.fork(),c=s.add(qO()),l=s.add(lN({pulse:vO(c)}));s.addData(r,new JT(s,c,c,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(t).toRuntime()}}(t,e,g):p?function(t,e,n){const i=e.add(iN({pulse:n.pulse})),r=e.fork();r.add(lN()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(t).toRuntime()}}(t,e,g):e.parse(t),e.popState(),p&&(h&&a.push(h),a.push(x))),o&&(d=function(t,e,n){const i=t.method,r=t.bound,o=t.separation,a={separation:DO(o)?n.signalRef(o.signal):o,method:DO(i)?n.signalRef(i.signal):i,pulse:e};t.order&&(a.sort=n.compareRef({field:t.order}));if(r){const t=r.tolerance;a.boundTolerance=DO(t)?n.signalRef(t.signal):+t,a.boundScale=n.scaleRef(r.scale),a.boundOrient=r.orient}return vO(n.add(eN(a)))}(o,d,e));const _=e.add(sN({pulse:d})),w=e.add(lN({pulse:vO(_)},void 0,e.parent()));null!=t.name&&(u=t.name,e.addData(u,new JT(e,c,_,w)),t.on&&t.on.forEach((t=>{(t.insert||t.remove||t.toggle)&&(0,m.vU)("Marks only support modify triggers."),YT(t,e,u)})))}function ZT(t,e){const n=e.config.legend,i=t.encode||{},r=sT(t,n),o=i.legend||{},a=o.name||void 0,s=o.interactive,c=o.style,l={};let u,f,d,h=0;KN.forEach((e=>t[e]?(l[e]=t[e],h=h||t[e]):0)),h||(0,m.vU)("Missing valid scale for legend.");const p=function(t,e){let n=t.type||GN;t.type||1!==function(t){return KN.reduce(((e,n)=>e+(t[n]?1:0)),0)}(t)||!t.fill&&!t.stroke||(n=cd(e)?$N:ud(e)?VN:GN);return n!==$N?n:ud(e)?VN:$N}(t,e.scaleType(h)),g={title:null!=t.title,scales:l,type:p,vgrad:"symbol"!==p&&r.isVertical()},v=vO(e.add(qO(null,[g]))),y=vO(e.add(YO(f={type:p,scale:e.scaleRef(h),count:e.objectProperty(r("tickCount")),limit:e.property(r("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return p===$N?(d=[hT(t,h,n,i.gradient),vT(t,n,i.labels,y)],f.count=f.count||e.signalRef("max(2,2*floor((".concat(MO(r.gradientLength()),")/100))"))):p===VN?d=[pT(t,h,n,i.gradient,y),vT(t,n,i.labels,y)]:(u=function(t,e){const n=sT(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,n),d=[yT(t,n,i,y,MO(u.columns))],f.size=function(t,e,n){const i=MO(tz("size",t,n)),r=MO(tz("strokeWidth",t,n)),o=MO(function(t,e,n){return cT("fontSize",t)||function(t,e,n){const i=e.config.style[n];return i&&i[t]}("fontSize",e,n)}(n[1].encode,e,WN));return vC("max(ceil(sqrt(".concat(i,")+").concat(r,"),").concat(o,")"),e)}(t,e,d[0].marks)),d=[aT({role:JF,from:v,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:u,interactive:s})],g.title&&d.push(function(t,e,n,i){const r=sT(t,e),o={enter:{opacity:QN},update:{opacity:tT,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:QN}};return NF(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:AT},angle:{signal:ST},align:{signal:DT},baseline:{signal:MT},text:t.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),dT({type:oT,role:YF,style:HN,from:i,encode:o},n)}(t,n,i.title,v)),KT(aT({role:HF,from:v,encode:TF(QT(r,t,n),o,ZN),marks:d,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:a,interactive:s,style:c}),e)}function QT(t,e,n){const i={enter:{},update:{}};return NF(i,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType}),i}function tz(t,e,n){return e[t]?'scale("'.concat(e[t],'",datum)'):cT(t,n[0].encode)}JT.fromEntries=function(t,e){const n=e.length,i=e[n-1],r=e[n-2];let o=e[0],a=null,s=1;for(o&&"load"===o.type&&(o=e[1]),t.add(e[0]);s<n;++s)e[s].params.pulse=vO(e[s-1]),t.add(e[s]),"aggregate"===e[s].type&&(a=e[s]);return new JT(t,o,r,i,a)},JT.prototype={countsRef(t,e,n){const i=this,r=i.counts||(i.counts={}),o=GT(e);let a,s,c;return null!=o&&(t=i.scope,a=r[o]),a?n&&n.field&&$T(t,a.agg.params,n):(c={groupby:t.fieldRef(e,"key"),pulse:vO(i.output)},n&&n.field&&$T(t,c,n),s=t.add(BO(c)),a=t.add(qO({pulse:vO(s)})),a={agg:s,ref:vO(a)},null!=o&&(r[o]=a)),a.ref},tuplesRef(){return vO(this.values)},extentRef(t,e){return VT(t,this,"extent","extent",e,!1)},domainRef(t,e){return VT(t,this,"domain","values",e,!1)},valuesRef(t,e,n){return VT(t,this,"vals","values",e,n||!0)},lookupRef(t,e){return VT(t,this,"lookup","tupleindex",e,!1)},indataRef(t,e){return VT(t,this,"indata","tupleindex",e,!0,!0)}};const ez='item.orient==="'.concat(FN,'"?-90:item.orient==="').concat(ON,'"?90:0');function nz(t,e){const n=sT(t=(0,m.HD)(t)?{text:t}:t,e.config.title),i=t.encode||{},r=i.group||{},o=r.name||void 0,a=r.interactive,s=r.style,c=[],l=vO(e.add(qO(null,[{}])));return c.push(function(t,e,n,i){const r={value:0},o=t.text,a={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return NF(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),dT({type:oT,role:ZF,style:XN,from:i,encode:a},n)}(t,n,function(t){const e=t.encode;return e&&e.title||(0,m.l7)({name:t.name,interactive:t.interactive,style:t.style},e)}(t),l)),t.subtitle&&c.push(function(t,e,n,i){const r={value:0},o=t.subtitle,a={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return NF(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),dT({type:oT,role:QF,style:JN,from:i,encode:a},n)}(t,n,i.subtitle,l)),KT(aT({role:KF,from:l,encode:iz(n,r),marks:c,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:s}),e)}function iz(t,e){const n={enter:{},update:{}};return NF(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:uT},angle:{signal:ez},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),TF(n,e,ZN)}function rz(t,e){const n=[];t.transform&&t.transform.forEach((t=>{n.push(zT(t,e))})),t.on&&t.on.forEach((n=>{YT(n,e,t.name)})),e.addDataPipeline(t.name,function(t,e,n){const i=[];let r,o,a,s,c,l=null,u=!1,f=!1;t.values?DO(t.values)||AO(t.format)?(i.push(az(e,t)),i.push(l=oz())):i.push(l=oz({$ingest:t.values,$format:t.format})):t.url?AO(t.url)||AO(t.format)?(i.push(az(e,t)),i.push(l=oz())):i.push(l=oz({$request:t.url,$format:t.format})):t.source&&(l=r=(0,m.IX)(t.source).map((t=>vO(e.getData(t).output))),i.push(null));for(o=0,a=n.length;o<a;++o)s=n[o],c=s.metadata,l||c.source||i.push(l=oz()),i.push(s),c.generates&&(f=!0),c.modifies&&!f&&(u=!0),c.source?l=s:c.changes&&(l=null);r&&(a=r.length-1,i[0]=aN({derive:u,pulse:a?r:r[0]}),(u||a)&&i.splice(1,0,oz()));l||i.push(oz());return i.push(lN({})),i}(t,e,n))}function oz(t){const e=qO({},t);return e.metadata={source:!0},e}function az(t,e){return KO({url:e.url?t.property(e.url):void 0,async:e.async?t.property(e.async):void 0,values:e.values?t.property(e.values):void 0,format:t.objectProperty(e.format)})}const sz=t=>t===NN||t===CN,cz=(t,e,n)=>DO(t)?mz(t.signal,e,n):t===FN||t===CN?e:n,lz=(t,e,n)=>DO(t)?hz(t.signal,e,n):sz(t)?e:n,uz=(t,e,n)=>DO(t)?pz(t.signal,e,n):sz(t)?n:e,fz=(t,e,n)=>DO(t)?gz(t.signal,e,n):t===CN?{value:e}:{value:n},dz=(t,e,n)=>DO(t)?vz(t.signal,e,n):t===ON?{value:e}:{value:n},hz=(t,e,n)=>yz("".concat(t," === '").concat(CN,"' || ").concat(t," === '").concat(NN,"'"),e,n),pz=(t,e,n)=>yz("".concat(t," !== '").concat(CN,"' && ").concat(t," !== '").concat(NN,"'"),e,n),mz=(t,e,n)=>xz("".concat(t," === '").concat(FN,"' || ").concat(t," === '").concat(CN,"'"),e,n),gz=(t,e,n)=>xz("".concat(t," === '").concat(CN,"'"),e,n),vz=(t,e,n)=>xz("".concat(t," === '").concat(ON,"'"),e,n),yz=(t,e,n)=>(e=null!=e?FF(e):e,n=null!=n?FF(n):n,bz(e)&&bz(n)?(e=e?e.signal||(0,m.m8)(e.value):null,n=n?n.signal||(0,m.m8)(n.value):null,{signal:"".concat(t," ? (").concat(e,") : (").concat(n,")")}):[(0,m.l7)({test:t},e)].concat(n||[])),bz=t=>null==t||1===Object.keys(t).length,xz=(t,e,n)=>({signal:"".concat(t," ? (").concat(wz(e),") : (").concat(wz(n),")")}),_z=(t,e,n,i,r)=>({signal:(null!=i?"".concat(t," === '").concat(FN,"' ? (").concat(wz(i),") : "):"")+(null!=n?"".concat(t," === '").concat(NN,"' ? (").concat(wz(n),") : "):"")+(null!=r?"".concat(t," === '").concat(ON,"' ? (").concat(wz(r),") : "):"")+(null!=e?"".concat(t," === '").concat(CN,"' ? (").concat(wz(e),") : "):"")+"(null)"}),wz=t=>DO(t)?t.signal:null==t?null:(0,m.m8)(t),kz=(t,e)=>0===e?0:DO(t)?{signal:"(".concat(t.signal,") * ").concat(e)}:{value:t*e},Ez=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function Dz(t,e,n,i){let r;if(e&&(0,m.nr)(e,t))return e[t];if((0,m.nr)(n,t))return n[t];if(t.startsWith("title")){switch(t){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=t[5].toLowerCase()+t.slice(6)}return i[HN][r]}if(t.startsWith("label")){switch(t){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=t[5].toLowerCase()+t.slice(6)}return i[WN][r]}return null}function Az(t){const e={};for(const n of t)if(n)for(const t in n)e[t]=1;return Object.keys(e)}function Sz(t,e){return{scale:t.scale,range:e}}function Mz(t,e,n,i,r){const o=sT(t,e),a=t.orient,s=t.gridScale,c=cz(a,1,-1),l=function(t,e){if(1===e);else if((0,m.Kn)(t)){let n=t=(0,m.l7)({},t);for(;null!=n.mult;){if(!(0,m.Kn)(n.mult))return n.mult=DO(e)?{signal:"(".concat(n.mult,") * (").concat(e.signal,")")}:n.mult*e,t;n=n.mult=(0,m.l7)({},n.mult)}n.mult=e}else t=DO(e)?{signal:"(".concat(e.signal,") * (").concat(t||0,")")}:e*(t||0);return t}(t.offset,c);let u,f,d;const h={enter:u={opacity:QN},update:d={opacity:tT},exit:f={opacity:QN}};NF(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:t.scale,field:qN,band:r.band,extra:r.extra,offset:r.offset,round:o("tickRound")},g=lz(a,{signal:"height"},{signal:"width"}),v=s?{scale:s,range:0,mult:c,offset:l}:{value:0,offset:l},y=s?{scale:s,range:1,mult:c,offset:l}:(0,m.l7)(g,{mult:c,offset:l});return u.x=d.x=lz(a,p,v),u.y=d.y=uz(a,p,v),u.x2=d.x2=uz(a,y),u.y2=d.y2=lz(a,y),f.x=lz(a,p),f.y=uz(a,p),dT({type:iT,role:UF,key:qN,from:i,encode:h},n)}function Cz(t,e,n,i,r){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+i+","+r+")"}}function Fz(t,e,n,i){const r=sT(t,e),o=t.orient,a=cz(o,-1,1);let s,c;const l={enter:s={opacity:QN,anchor:FF(r("titleAnchor",null)),align:{signal:uT}},update:c=(0,m.l7)({},s,{opacity:tT,text:FF(t.title)}),exit:{opacity:QN}},u={signal:'lerp(range("'.concat(t.scale,'"), ').concat(lT(0,1,.5),")")};return c.x=lz(o,u),c.y=uz(o,u),s.angle=lz(o,QN,kz(a,90)),s.baseline=lz(o,fz(o,NN,CN),{value:NN}),c.angle=s.angle,c.baseline=s.baseline,NF(l,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),function(t,e,n,i){const r=(t,e)=>null!=t?(n.update[e]=Ez(FF(t),n.update[e]),!1):!zF(e,i),o=r(t("titleX"),"x"),a=r(t("titleY"),"y");n.enter.auto=a===o?FF(a):lz(e,FF(a),FF(o))}(r,o,l,n),l.update.align=Ez(l.update.align,s.align),l.update.angle=Ez(l.update.angle,s.angle),l.update.baseline=Ez(l.update.baseline,s.baseline),dT({type:oT,role:WF,style:HN,from:i,encode:l},n)}function Oz(t,e){const n=function(t,e){var n,i,r,o=e.config,a=o.style,s=o.axis,c="band"===e.scaleType(t.scale)&&o.axisBand,l=t.orient;if(DO(l)){const t=Az([o.axisX,o.axisY]),e=Az([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(r of(n={},t))n[r]=lz(l,Dz(r,o.axisX,s,a),Dz(r,o.axisY,s,a));for(r of(i={},e))i[r]=_z(l.signal,Dz(r,o.axisTop,s,a),Dz(r,o.axisBottom,s,a),Dz(r,o.axisLeft,s,a),Dz(r,o.axisRight,s,a))}else n=l===CN||l===NN?o.axisX:o.axisY,i=o["axis"+l[0].toUpperCase()+l.slice(1)];return n||i||c?(0,m.l7)({},s,n,i,c):s}(t,e),i=t.encode||{},r=i.axis||{},o=r.name||void 0,a=r.interactive,s=r.style,c=sT(t,n),l=function(t){const e=t("tickBand");let n,i,r=t("tickOffset");return e?e.signal?(n={signal:"(".concat(e.signal,") === 'extent' ? 1 : 0.5")},i={signal:"(".concat(e.signal,") === 'extent'")},(0,m.Kn)(r)||(r={signal:"(".concat(e.signal,") === 'extent' ? 0 : ").concat(r)})):"extent"===e?(n=1,i=!0,r=0):(n=.5,i=!1):(n=t("bandPosition"),i=t("tickExtra")),{extra:i,band:n,offset:r}}(c),u={scale:t.scale,ticks:!!c("ticks"),labels:!!c("labels"),grid:!!c("grid"),domain:!!c("domain"),title:null!=t.title},f=vO(e.add(qO({},[u]))),d=vO(e.add(UO({scale:e.scaleRef(t.scale),extra:e.property(l.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),h=[];let p;return u.grid&&h.push(Mz(t,n,i.grid,d,l)),u.ticks&&(p=c("tickSize"),h.push(function(t,e,n,i,r,o){const a=sT(t,e),s=t.orient,c=cz(s,-1,1);let l,u,f;const d={enter:l={opacity:QN},update:f={opacity:tT},exit:u={opacity:QN}};NF(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=FF(r);h.mult=c;const p={scale:t.scale,field:qN,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=lz(s,QN,p),f.y2=l.y2=lz(s,h),u.x=lz(s,p),f.x=l.x=uz(s,QN,p),f.x2=l.x2=uz(s,h),u.y=uz(s,p),dT({type:iT,role:qF,key:qN,from:i,encode:d},n)}(t,n,i.ticks,d,p,l))),u.labels&&(p=u.ticks?p:0,h.push(function(t,e,n,i,r,o){const a=sT(t,e),s=t.orient,c=t.scale,l=cz(s,-1,1),u=MO(a("labelFlush")),f=MO(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,m=0===u||!!u;const g=FF(r);g.mult=l,g.offset=FF(a("labelPadding")||0),g.offset.mult=l;const v={scale:c,field:qN,band:.5,offset:fT(o.offset,a("labelOffset"))},y=lz(s,m?Cz(c,u,'"left"','"right"','"center"'):{value:"center"},dz(s,"left","right")),b=lz(s,fz(s,"bottom","top"),m?Cz(c,u,'"top"','"bottom"','"middle"'):{value:"middle"}),x=Cz(c,u,"-(".concat(f,")"),f,0);m=m&&f;const _={opacity:QN,x:lz(s,v,g),y:uz(s,v,g)},w={enter:_,update:p={opacity:tT,text:{field:jN},x:_.x,y:_.y,align:y,baseline:b},exit:{opacity:QN,x:_.x,y:_.y}};NF(w,{dx:!d&&m?lz(s,x):null,dy:!h&&m?uz(s,x):null}),NF(w,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const k=a("labelBound");let E=a("labelOverlap");return E=E||k?{separation:a("labelSeparation"),method:E,order:"datum.index",bound:k?{scale:c,orient:s,tolerance:k}:null}:void 0,p.align!==y&&(p.align=Ez(p.align,y)),p.baseline!==b&&(p.baseline=Ez(p.baseline,b)),dT({type:oT,role:IF,style:WN,key:qN,from:i,encode:w,overlap:E},n)}(t,n,i.labels,d,p,l))),u.domain&&h.push(function(t,e,n,i){const r=sT(t,e),o=t.orient;let a,s;const c={enter:a={opacity:QN},update:s={opacity:tT},exit:{opacity:QN}};NF(c,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=Sz(t,0),u=Sz(t,1);return a.x=s.x=lz(o,l,QN),a.x2=s.x2=lz(o,u),a.y=s.y=uz(o,l,QN),a.y2=s.y2=uz(o,u),dT({type:iT,role:BF,from:i,encode:c},n)}(t,n,i.domain,f)),u.title&&h.push(Fz(t,n,i.title,f)),KT(aT({role:jF,from:f,encode:TF(Nz(c,t),r,ZN),marks:h,aria:c("aria"),description:c("description"),zindex:c("zindex"),name:o,interactive:a,style:s}),e)}function Nz(t,e){const n={enter:{},update:{}};return NF(n,{orient:t("orient"),offset:t("offset")||0,position:SO(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:'abs(span(range("'.concat(e.scale,'")))')},translate:t("translate"),format:e.format,formatType:e.formatType}),n}function Tz(t,e,n){const i=(0,m.IX)(t.signals),r=(0,m.IX)(t.scales);return n||i.forEach((t=>hO(t,e))),(0,m.IX)(t.projections).forEach((t=>function(t,e){const n=e.config.projection||{},i={};for(const r in t)"name"!==r&&(i[r]=MN(t[r],r,e));for(const r in n)null==i[r]&&(i[r]=MN(n[r],r,e));e.addProjection(t.name,i)}(t,e))),r.forEach((t=>function(t,e){const n=t.type||"linear";ad(n)||(0,m.vU)("Unrecognized scale type: "+(0,m.m8)(n)),e.addScale(t.name,{type:n,domain:void 0})}(t,e))),(0,m.IX)(t.data).forEach((t=>rz(t,e))),r.forEach((t=>mN(t,e))),(n||i).forEach((t=>function(t,e){const n=e.getSignal(t.name);let i=t.update;t.init&&(i?(0,m.vU)("Signals can not include both init and update expressions."):(i=t.init,n.initonly=!0)),i&&(i=vC(i,e),n.update=i.$expr,n.params=i.$params),t.on&&t.on.forEach((t=>PO(t,e,n.id)))}(t,e))),(0,m.IX)(t.axes).forEach((t=>Oz(t,e))),(0,m.IX)(t.marks).forEach((t=>KT(t,e))),(0,m.IX)(t.legends).forEach((t=>ZT(t,e))),t.title&&nz(t.title,e),e.parseLambdas(),e}const zz=t=>TF({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t);function Rz(t,e){const n=e.config,i=vO(e.root=e.add(gO())),r=function(t,e){const n=n=>SO(t[n],e[n]),i=[Pz("background",n("background")),Pz("autosize",AF(n("autosize"))),Pz("padding",CF(n("padding"))),Pz("width",n("width")||0),Pz("height",n("height")||0)],r=i.reduce(((t,e)=>(t[e.name]=e,t)),{}),o={};return(0,m.IX)(t.signals).forEach((t=>{(0,m.nr)(r,t.name)?t=(0,m.l7)(r[t.name],t):i.push(t),o[t.name]=t})),(0,m.IX)(e.signals).forEach((t=>{(0,m.nr)(o,t.name)||(0,m.nr)(r,t.name)||i.push(t)})),i}(t,n);r.forEach((t=>hO(t,e))),e.description=t.description||n.description,e.eventConfig=n.events,e.legends=e.objectProperty(n.legend&&n.legend.layout),e.locale=n.locale;const o=e.add(qO()),a=e.add(XO(sO(zz(t.encode),eT,PF,t.style,e,{pulse:vO(o)}))),s=e.add(fN({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:i,pulse:vO(a)}));e.operators.pop(),e.pushState(vO(a),vO(s),null),Tz(t,e,r),e.operators.push(s);let c=e.add(IO({mark:i,pulse:vO(s)}));return c=e.add(sN({pulse:vO(c)})),c=e.add(lN({pulse:vO(c)})),e.addData("root",new JT(e,o,o,c)),e}function Pz(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function Lz(t,e){this.config=t||{},this.options=e||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function jz(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}function Bz(t){return((0,m.kJ)(t)?Uz:Iz)(t)}function Uz(t){const e=t.length;let n="[";for(let i=0;i<e;++i){const e=t[i];n+=(i>0?",":"")+((0,m.Kn)(e)?e.signal||Bz(e):(0,m.m8)(e))}return n+"]"}function Iz(t){let e,n,i="{",r=0;for(e in t)n=t[e],i+=(++r>1?",":"")+(0,m.m8)(e)+":"+((0,m.Kn)(n)?n.signal||Bz(n):(0,m.m8)(n));return i+"}"}function qz(t,e,n){return(0,m.Kn)(t)||(0,m.vU)("Input Vega specification must be an object."),e=(0,m.fE)(function(){const t="sans-serif",e="#4c78a8",n="#000",i="#888",r="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:e},area:{fill:e},image:null,line:{stroke:e,strokeWidth:2},path:{stroke:e},rect:{fill:e},rule:{stroke:n},shape:{stroke:e},symbol:{fill:e,size:64},text:{fill:n,font:t,fontSize:11},trail:{fill:e,size:2},style:{"guide-label":{fill:n,font:t,fontSize:10},"guide-title":{fill:n,font:t,fontSize:11,fontWeight:"bold"},"group-title":{fill:n,font:t,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:n,font:t,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:r},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:i,grid:!1,gridWidth:1,gridColor:r,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:i,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:r,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:i,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}(),e,t.config),Rz(t,new Lz(e,n)).toRuntime()}Lz.prototype=jz.prototype={parse(t){return Tz(t,this)},fork(){return new jz(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach((e=>{e.$ref=t.id})),t.refs=null),t},proxy(t){const e=t instanceof pO?vO(t):t;return this.add(oN({value:e}))},addStream(t){return this.streams.push(t),t.id=this.id(),t},addUpdate(t){return this.updates.push(t),t},finish(){let t,e;for(t in this.root&&(this.root.root=!0),this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(t,e,n){let i,r;t&&(i=t.data||(t.data={}),r=i[e]||(i[e]=[]),r.push(n))}for(t in this.data){e=this.data[t],n(e.input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values");for(const i in e.index)n(e.index[i],t,"index:"+i)}return this},pushState(t,e,n){this._encode.push(vO(this.add(lN({pulse:t})))),this._parent.push(e),this._lookup.push(n?vO(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return(0,m.fj)(this._parent)},encode(){return(0,m.fj)(this._encode)},lookup(){return(0,m.fj)(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if((0,m.HD)(t))return yO(t,e);t.signal||(0,m.vU)("Unsupported field reference: "+(0,m.m8)(t));const n=t.signal;let i=this.field[n];if(!i){const t={name:this.signalRef(n)};e&&(t.as=e),this.field[n]=i=vO(this.add($O(t)))}return i},compareRef(t){let e=!1;const n=t=>DO(t)?(e=!0,this.signalRef(t.signal)):function(t){return t&&t.expr}(t)?(e=!0,this.exprRef(t.expr)):t,i=(0,m.IX)(t.field).map(n),r=(0,m.IX)(t.order).map(n);return e?vO(this.add(WO({fields:i,orders:r}))):xO(i,r)},keyRef(t,e){let n=!1;const i=this.signals;return t=(0,m.IX)(t).map((t=>DO(t)?(n=!0,vO(i[t.signal])):t)),n?vO(this.add(VO({fields:t,flat:e}))):function(t,e){const n={$key:t};return e&&(n.$flat=!0),n}(t,e)},sortRef(t){if(!t)return t;const e=wO(t.op,t.field),n=t.order||"ascending";return n.signal?vO(this.add(WO({fields:e,orders:this.signalRef(n.signal)}))):xO(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:t,type:e}),this.events[n]=i}return this.events[n]},hasOwnSignal(t){return(0,m.nr)(this.signals,t)},addSignal(t,e){this.hasOwnSignal(t)&&(0,m.vU)("Duplicate signal name: "+(0,m.m8)(t));const n=e instanceof pO?e:this.add(gO(e));return this.signals[t]=n},getSignal(t){return this.signals[t]||(0,m.vU)("Unrecognized signal name: "+(0,m.m8)(t)),this.signals[t]},signalRef(t){return this.signals[t]?vO(this.signals[t]):((0,m.nr)(this.lambdas,t)||(this.lambdas[t]=this.add(gO(null))),vO(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;e<n;++e){const n=t[e],i=vC(n,this),r=this.lambdas[n];r.params=i.$params,r.update=i.$expr}},property(t){return t&&t.signal?this.signalRef(t.signal):t},objectProperty(t){return t&&(0,m.Kn)(t)?this.signalRef(t.signal||Bz(t)):t},exprRef(t,e){const n={expr:vC(t,this)};return e&&(n.expr.$name=e),vO(this.add(JO(n)))},addBinding(t,e){this.bindings||(0,m.vU)("Nested signals do not support binding: "+(0,m.m8)(t)),this.bindings.push((0,m.l7)({signal:t},e))},addScaleProj(t,e){(0,m.nr)(this.scales,t)&&(0,m.vU)("Duplicate scale or projection name: "+(0,m.m8)(t)),this.scales[t]=this.add(e)},addScale(t,e){this.addScaleProj(t,cN(e))},addProjection(t,e){this.addScaleProj(t,rN(e))},getScale(t){return this.scales[t]||(0,m.vU)("Unrecognized scale name: "+(0,m.m8)(t)),this.scales[t]},scaleRef(t){return vO(this.getScale(t))},scaleType(t){return this.getScale(t).params.type},projectionRef(t){return this.scaleRef(t)},projectionType(t){return this.scaleType(t)},addData(t,e){return(0,m.nr)(this.data,t)&&(0,m.vU)("Duplicate data set name: "+(0,m.m8)(t)),this.data[t]=e},getData(t){return this.data[t]||(0,m.vU)("Undefined data set name: "+(0,m.m8)(t)),this.data[t]},addDataPipeline(t,e){return(0,m.nr)(this.data,t)&&(0,m.vU)("Duplicate data set name: "+(0,m.m8)(t)),this.addData(t,JT.fromEntries(this,e))}};var Wz="5.25.0";(0,m.l7)(io,i,o,a,s,c,u,l,f,d,h,p)},76248:t=>{"use strict";var e=/("(?:[^\\"]|\\.)*")|[:,]/g;t.exports=function(t,n){var i,r,o;return n=n||{},i=JSON.stringify([1],void 0,void 0===n.indent?2:n.indent).slice(2,-3),r=""===i?1/0:void 0===n.maxLength?80:n.maxLength,o=n.replacer,function t(n,a,s){var c,l,u,f,d,h,p,m,g,v,y,b;if(n&&"function"===typeof n.toJSON&&(n=n.toJSON()),void 0===(y=JSON.stringify(n,o)))return y;if(p=r-a.length-s,y.length<=p&&(g=y.replace(e,(function(t,e){return e||t+" "}))).length<=p)return g;if(null!=o&&(n=JSON.parse(y),o=void 0),"object"===typeof n&&null!==n){if(m=a+i,u=[],l=0,Array.isArray(n))for(v="[",c="]",p=n.length;l<p;l++)u.push(t(n[l],m,l===p-1?0:1)||"null");else for(v="{",c="}",p=(h=Object.keys(n)).length;l<p;l++)f=h[l],d=JSON.stringify(f)+": ",void 0!==(b=t(n[f],m,d.length+(l===p-1?0:1)))&&u.push(d+b);if(u.length>0)return[v,i+u.join(",\n"+m),c].join("\n"+a)}return y}(t,"",0)}}}]);
|