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
@@ -1,2 +0,0 @@
|
|
1
|
-
/*! For license information please see 1215.baf3721f.chunk.js.LICENSE.txt */
|
2
|
-
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1215],{86893:t=>{var e=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var e,n,r;try{e=Map}catch(s){e=function(){}}try{n=Set}catch(s){n=function(){}}try{r=Promise}catch(s){r=function(){}}function i(o,s,u,c,l){"object"===typeof s&&(u=s.depth,c=s.prototype,l=s.includeNonEnumerable,s=s.circular);var f=[],d=[],h="undefined"!=typeof Buffer;return"undefined"==typeof s&&(s=!0),"undefined"==typeof u&&(u=1/0),function o(u,p){if(null===u)return null;if(0===p)return u;var m,g;if("object"!=typeof u)return u;if(t(u,e))m=new e;else if(t(u,n))m=new n;else if(t(u,r))m=new r((function(t,e){u.then((function(e){t(o(e,p-1))}),(function(t){e(o(t,p-1))}))}));else if(i.__isArray(u))m=[];else if(i.__isRegExp(u))m=new RegExp(u.source,a(u)),u.lastIndex&&(m.lastIndex=u.lastIndex);else if(i.__isDate(u))m=new Date(u.getTime());else{if(h&&Buffer.isBuffer(u))return m=Buffer.allocUnsafe?Buffer.allocUnsafe(u.length):new Buffer(u.length),u.copy(m),m;t(u,Error)?m=Object.create(u):"undefined"==typeof c?(g=Object.getPrototypeOf(u),m=Object.create(g)):(m=Object.create(c),g=c)}if(s){var v=f.indexOf(u);if(-1!=v)return d[v];f.push(u),d.push(m)}for(var y in t(u,e)&&u.forEach((function(t,e){var n=o(e,p-1),r=o(t,p-1);m.set(n,r)})),t(u,n)&&u.forEach((function(t){var e=o(t,p-1);m.add(e)})),u){var b;g&&(b=Object.getOwnPropertyDescriptor(g,y)),b&&null==b.set||(m[y]=o(u[y],p-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(u);for(y=0;y<x.length;y++){var A=x[y];(!(w=Object.getOwnPropertyDescriptor(u,A))||w.enumerable||l)&&(m[A]=o(u[A],p-1),w.enumerable||Object.defineProperty(m,A,{enumerable:!1}))}}if(l){var _=Object.getOwnPropertyNames(u);for(y=0;y<_.length;y++){var w,E=_[y];(w=Object.getOwnPropertyDescriptor(u,E))&&w.enumerable||(m[E]=o(u[E],p-1),Object.defineProperty(m,E,{enumerable:!1}))}}return m}(o,u)}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 i.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},i.__objToStr=o,i.__isDate=function(t){return"object"===typeof t&&"[object Date]"===o(t)},i.__isArray=function(t){return"object"===typeof t&&"[object Array]"===o(t)},i.__isRegExp=function(t){return"object"===typeof t&&"[object RegExp]"===o(t)},i.__getRegExpFlags=a,i}();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 r,i,o;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!==i--;)if(!t(e[i],n[i]))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((r=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!==i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!==i--;){var a=o[i];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,r="boolean"===typeof e.cycles&&e.cycles,i=e.cmp&&(n=e.cmp,function(t){return function(e,r){var i={key:e,value:t[e]},o={key:r,value:t[r]};return n(i,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(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=o.push(e)-1,u=Object.keys(e).sort(i&&i(e));for(a="",n=0;n<u.length;n++){var c=u[n],l=t(e[c]);l&&(a&&(a+=","),a+=JSON.stringify(c)+":"+l)}return o.splice(s,1),"{"+a+"}"}}(t)}},99394:(t,e,n)=>{var r=n(63256),i=n(80693)((function(t,e,n,i){r(t,e,n,i)}));t.exports=i},6988:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>Wb});var r={};n.r(r),n.d(r,{JsonPatchError:()=>y,_areEquals:()=>k,applyOperation:()=>w,applyPatch:()=>E,applyReducer:()=>D,deepClone:()=>b,getValueByPointer:()=>_,validate:()=>C,validator:()=>F});var i={};n.r(i),n.d(i,{compare:()=>R,generate:()=>T,observe:()=>N,unobserve:()=>O});var o={};n.r(o),n.d(o,{accessPathDepth:()=>Nt,accessPathWithDatum:()=>Ct,compile:()=>Zg,contains:()=>st,deepEqual:()=>Q,deleteNestedProperty:()=>Dt,duplicate:()=>tt,entries:()=>At,every:()=>ct,fieldIntersection:()=>vt,flatAccessWithDatum:()=>kt,getFirstDefined:()=>Tt,hasIntersection:()=>mt,hash:()=>ot,internalField:()=>Lt,isBoolean:()=>_t,isEmpty:()=>yt,isEqual:()=>ht,isInternalField:()=>jt,isNullOrFalse:()=>at,isNumeric:()=>It,keys:()=>bt,logicalExpr:()=>Et,mergeDeep:()=>lt,never:()=>et,normalize:()=>Oc,normalizeAngle:()=>Ut,omit:()=>rt,pick:()=>nt,prefixGenerator:()=>gt,removePathFromField:()=>Ot,replaceAll:()=>Bt,replacePathInField:()=>Mt,resetIdCounter:()=>Pt,setEqual:()=>pt,some:()=>ut,stringify:()=>it,titleCase:()=>Ft,unique:()=>dt,uniqueId:()=>Rt,vals:()=>xt,varName:()=>wt,version:()=>Qg});var a={};n.r(a),n.d(a,{carbong10:()=>Qv,carbong100:()=>ey,carbong90:()=>ty,carbonwhite:()=>Zv,dark:()=>iv,excel:()=>av,fivethirtyeight:()=>fv,ggplot2:()=>hv,googlecharts:()=>Tv,latimes:()=>bv,powerbi:()=>Jv,quartz:()=>_v,urbaninstitute:()=>Mv,version:()=>ny,vox:()=>Ev});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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),u=Object.prototype.hasOwnProperty;function c(t,e){return u.call(t,e)}function l(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 r=[];for(var i in t)c(t,i)&&r.push(i);return r}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,r=t.length;n<r;){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 r=l(t),i=r.length,o=0;o<i;o++)if(m(t[r[o]]))return!0;return!1}function g(t,e){var n=[t];for(var r in e){var i="object"===typeof e[r]?JSON.stringify(e[r],null,2):e[r];"undefined"!==typeof i&&n.push(r+": "+i)}return n.join("\n")}var v=function(t){function e(e,n,r,i,o){var a=this.constructor,s=t.call(this,g(e,{name:n,index:r,operation:i,tree:o}))||this;return s.name=n,s.index=r,s.operation=i,s.tree=o,Object.setPrototypeOf(s,a.prototype),s.message=g(e,{name:n,index:r,operation:i,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 r=t[e];return delete t[e],{newDocument:n,removed:r}},replace:function(t,e,n){var r=t[e];return t[e]=this.value,{newDocument:n,removed:r}},move:function(t,e,n){var r=_(n,this.path);r&&(r=f(r));var i=w(n,{op:"remove",path:this.from}).removed;return w(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(t,e,n){var r=_(n,this.from);return w(n,{op:"add",path:this.path,value:f(r)}),{newDocument:n}},test:function(t,e,n){return{newDocument:n,test:k(t[e],this.value)}},_get:function(t,e,n){return this.value=t[e],{newDocument:n}}},A={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 r=t[e];return t[e]=this.value,{newDocument:n,removed:r}},move:x.move,copy:x.copy,test:x.test,_get:x._get};function _(t,e){if(""==e)return t;var n={op:"_get",path:e};return w(t,n),n.value}function w(t,e,n,r,i,o){if(void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===i&&(i=!0),void 0===o&&(o=0),n&&("function"==typeof n?n(e,0,t,e.path):F(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=_(t,e.from),"move"===e.op&&(a.removed=t),a;if("test"===e.op){if(a.test=k(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}r||(t=f(t));var s=(e.path||"").split("/"),u=t,c=1,l=s.length,h=void 0,m=void 0,g=void 0;for(g="function"==typeof n?n:F;;){if((m=s[c])&&-1!=m.indexOf("~")&&(m=p(m)),i&&("__proto__"==m||"prototype"==m&&c>0&&"constructor"==s[c-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===h&&(void 0===u[m]?h=s.slice(0,c).join("/"):c==l-1&&(h=e.path),void 0!==h&&g(e,0,t,h)),c++,Array.isArray(u)){if("-"===m)m=u.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(c>=l){if(n&&"add"===e.op&&m>u.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=A[e.op].call(e,u,m,t)).test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}}else if(c>=l){if(!1===(a=x[e.op].call(e,u,m,t)).test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}if(u=u[m],n&&c<l&&(!u||"object"!==typeof u))throw new y("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,e,t)}}function E(t,e,n,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),n&&!Array.isArray(e))throw new y("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(t=f(t));for(var o=new Array(e.length),a=0,s=e.length;a<s;a++)o[a]=w(t,e[a],n,!0,i,a),t=o[a].newDocument;return o.newDocument=t,o}function D(t,e,n){var r=w(t,e);if(!1===r.test)throw new y("Test operation failed","TEST_OPERATION_FAILED",n,e,t);return r.newDocument}function F(t,e,n,r){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 i=t.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==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!==r)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=C([{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 C(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||F;for(var r=0;r<t.length;r++)n(t[r],r,e,void 0)}}catch(i){if(i instanceof y)return i;throw i}}function k(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){var n,r,i,o=Array.isArray(t),a=Array.isArray(e);if(o&&a){if((r=t.length)!=e.length)return!1;for(n=r;0!==n--;)if(!k(t[n],e[n]))return!1;return!0}if(o!=a)return!1;var s=Object.keys(t);if((r=s.length)!==Object.keys(e).length)return!1;for(n=r;0!==n--;)if(!e.hasOwnProperty(s[n]))return!1;for(n=r;0!==n--;)if(!k(t[i=s[n]],e[i]))return!1;return!0}return t!==t&&e!==e}var S=new WeakMap,M=function(t){this.observers=new Map,this.obj=t},B=function(t,e){this.callback=t,this.observer=e};function O(t,e){e.unobserve()}function N(t,e){var n,r=function(t){return S.get(t)}(t);if(r){var i=function(t,e){return t.observers.get(e)}(r,e);n=i&&i.observer}else r=new M(t),S.set(t,r);if(n)return n;if(n={},r.value=f(t),e){n.callback=e,n.next=null;var o=function(){T(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(){T(n),clearTimeout(n.next),function(t,e){t.observers.delete(e.callback)}(r,n),"undefined"!==typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(e,new B(e,n)),n}function T(t,e){void 0===e&&(e=!1);var n=S.get(t.object);z(n.value,t.object,t.patches,"",e),t.patches.length&&E(n.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function z(t,e,n,r,i){if(e!==t){"function"===typeof e.toJSON&&(e=e.toJSON());for(var o=l(e),a=l(t),s=!1,u=a.length-1;u>=0;u--){var d=t[m=a[u]];if(!c(e,m)||void 0===e[m]&&void 0!==d&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(i&&n.push({op:"test",path:r+"/"+h(m),value:f(d)}),n.push({op:"remove",path:r+"/"+h(m)}),s=!0):(i&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}),!0);else{var p=e[m];"object"==typeof d&&null!=d&&"object"==typeof p&&null!=p&&Array.isArray(d)===Array.isArray(p)?z(d,p,n,r+"/"+h(m),i):d!==p&&(!0,i&&n.push({op:"test",path:r+"/"+h(m),value:f(d)}),n.push({op:"replace",path:r+"/"+h(m),value:f(p)}))}}if(s||o.length!=a.length)for(u=0;u<o.length;u++){var m;c(t,m=o[u])||void 0===e[m]||n.push({op:"add",path:r+"/"+h(m),value:f(e[m])})}}}function R(t,e,n){void 0===n&&(n=!1);var r=[];return z(t,e,r,"",n),r}Object.assign({},r,i,{JsonPatchError:v,deepClone:f,escapePathComponent:h,unescapePathComponent:p});var P=n(76248),L=n.n(P),j=n(40566),U=n(60784);var I=n(15721),q=n(86893),W=n.n(q),H=n(60473),X=n.n(H),G=n(4761),J=n.n(G);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 r of e)(0,I.nr)(t,r)&&(n[r]=t[r]);return n}function rt(t,e){const n={...t};for(const r of e)delete n[r];return n}Set.prototype.toJSON=function(){return"Set(".concat([...this].map((t=>J()(t))).join(","),")")};const it=J();function ot(t){if((0,I.hj)(t))return t;const e=(0,I.HD)(t)?t:J()(t);if(e.length<250)return e;let n=0;for(let r=0;r<e.length;r++){n=(n<<5)-n+e.charCodeAt(r),n&=n}return n}function at(t){return!1===t||null===t}function st(t,e){return t.includes(e)}function ut(t,e){let n=0;for(const[r,i]of t.entries())if(e(i,r,n++))return!0;return!1}function ct(t,e){let n=0;for(const[r,i]of t.entries())if(!e(i,r,n++))return!1;return!0}function lt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];for(const i of n)ft(t,null!==i&&void 0!==i?i:{});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=[],r={};let i;for(const o of t)i=e(o),i in r||(r[i]=1,n.push(o));return n}function ht(t,e){const n=bt(t),r=bt(e);if(n.length!==r.length)return!1;for(const i of n)if(t[i]!==e[i])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,"]"))),r=t.map(((e,n)=>t.slice(0,n+1).join("")));for(const n of r)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,At=Object.entries;function _t(t){return!0===t||!1===t}function wt(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 Ft(t){return t.charAt(0).toUpperCase()+t.substr(1)}function Ct(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum";const n=(0,I._k)(t),r=[];for(let i=1;i<=n.length;i++){const t="[".concat(n.slice(0,i).map(I.m8).join("]["),"]");r.push("".concat(e).concat(t))}return r.join(" && ")}function kt(t){return"".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum","[").concat((0,I.m8)((0,I._k)(t).join(".")),"]")}function St(t){return t.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Mt(t){return"".concat((0,I._k)(t).map(St).join("\\."))}function Bt(t,e,n){return t.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Ot(t){return"".concat((0,I._k)(t).join("."))}function Nt(t){return t?(0,I._k)(t).length:0}function Tt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const r of e)if(void 0!==r)return r}let zt=42;function Rt(t){const e=++zt;return t?String(t)+e:e}function Pt(){zt=42}function Lt(t){return jt(t)?t:"__".concat(t)}function jt(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",Gt="y",Jt="x2",$t="y2",Vt="xOffset",Yt="yOffset",Kt="radius",Zt="radius2",Qt="theta",te="theta2",ee="latitude",ne="longitude",re="latitude2",ie="longitude2",oe="color",ae="fill",se="stroke",ue="shape",ce="size",le="angle",fe="opacity",de="fillOpacity",he="strokeOpacity",pe="strokeWidth",me="strokeDash",ge="text",ve="order",ye="detail",be="key",xe="tooltip",Ae="href",_e="url",we="description",Ee={theta:1,theta2:1,radius:1,radius2:1};function De(t){return t in Ee}const Fe={longitude:1,longitude2:1,latitude:1,latitude2:1};function Ce(t){switch(t){case ee:return"y";case re:return"y2";case ne:return"x";case ie:return"x2"}}function ke(t){return t in Fe}const Se=bt(Fe),Me={x:1,y:1,x2:1,y2:1,...Ee,...Fe,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 Be(t){return t===oe||t===ae||t===se}const Oe={row:1,column:1,facet:1},Ne=bt(Oe),Te={...Me,...Oe},ze=bt(Te),{order:Re,detail:Pe,tooltip:Le,...je}=Te,{row:Ue,column:Ie,facet:qe,...We}=je;bt(je),bt(We);function He(t){return!!Te[t]}const Xe=[Jt,$t,re,ie,te,Zt];function Ge(t){return Je(t)!==t}function Je(t){switch(t){case Jt:return Xt;case $t:return Gt;case re:return ee;case ie: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 Jt;case Gt:return $t;case ee:return re;case ne:return ie;case Qt:return te;case Kt:return Zt}}function Ye(t){switch(t){case Xt:case Jt:return"width";case Gt:case $t:return"height"}}function Ke(t){switch(t){case Xt:return"xOffset";case Gt:return"yOffset";case Jt: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 Gt:return"yOffset"}}function Qe(t){switch(t){case"xOffset":return"x";case"yOffset":return"y"}}const tn=bt(Me),{x:en,y:nn,x2:rn,y2:on,xOffset:an,yOffset:sn,latitude:un,longitude:cn,latitude2:ln,longitude2:fn,theta:dn,theta2:hn,radius:pn,radius2:mn,...gn}=Me,vn=bt(gn),yn={x:1,y:1},bn=bt(yn);function xn(t){return t in yn}const An={theta:1,radius:1},_n=bt(An);function wn(t){return"width"===t?Xt:Gt}const En={xOffset:1,yOffset:1};bt(En);function Dn(t){return t in En}const{text:Fn,tooltip:Cn,href:kn,url:Sn,description:Mn,detail:Bn,key:On,order:Nn,...Tn}=gn,zn=bt(Tn);const Rn={...yn,...An,...En,...Tn},Pn=bt(Rn);function Ln(t){return!!Rn[t]}function jn(t,e){return function(t){switch(t){case oe:case ae:case se:case we:case ye:case be:case xe:case Ae:case ve:case fe:case de:case he:case pe:case Ht:case qt:case Wt:return Un;case Xt:case Gt:case Vt:case Yt:case ee:case ne:return qn;case Jt:case $t:case re:case ie:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case ce: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 ue:return{point:"always",geoshape:"always"};case ge:return{text:"always"};case le:return{point:"always",square:"always",text:"always"};case _e: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 Gt:case Qt:case Kt:case Vt:case Yt:case ce:case le:case pe:case fe:case de:case he:case Jt:case $t:case te:case Zt:return;case Ht:case qt:case Wt:case ue:case me:case ge:case xe:case Ae:case _e:case we:return"discrete";case oe:case ae:case se:return"flexible";case ee:case ne:case re:case ie: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 Gn(t){return!!t&&!!t.argmin}function Jn(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=>rr(t[e])?wt("_".concat(e,"_").concat(At(t[e]))):wt("_".concat(e,"_").concat(t[e])))).join("")}function tr(t){return!0===t||nr(t)&&!t.binned}function er(t){return"binned"===t||nr(t)&&!0===t.binned}function nr(t){return(0,I.Kn)(t)}function rr(t){return null===t||void 0===t?void 0:t.param}function ir(t){switch(t){case qt:case Wt:case ce:case oe:case ae:case se:case pe:case fe:case de:case he:case ue:return 6;case me:return 4;default:return 10}}function or(t){return!(null===t||void 0===t||!t.expr)}function ar(t){const e=bt(t||{}),n={};for(const r of e)n[r]=gr(t[r]);return n}function sr(t){const{anchor:e,frame:n,offset:r,orient:i,angle:o,limit:a,color:s,subtitleColor:u,subtitleFont:c,subtitleFontSize:l,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...m}=t,g={...e?{anchor:e}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...void 0!==o?{angle:o}:{},...void 0!==a?{limit:a}:{}},v={...u?{subtitleColor:u}:{},...c?{subtitleFont:c}:{},...l?{subtitleFontSize:l}:{},...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 ur(t){return(0,I.HD)(t)||(0,I.kJ)(t)&&(0,I.HD)(t[0])}function cr(t){return!(null===t||void 0===t||!t.signal)}function lr(t){return!!t.step}function fr(t){return!(0,I.kJ)(t)&&("field"in t&&"data"in t)}const dr=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}),hr={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},pr=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function mr(t){const e=(0,I.kJ)(t.condition)?t.condition.map(vr):vr(t.condition);return{...gr(t),condition:e}}function gr(t){if(or(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function vr(t){if(or(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function yr(t){if(or(t)){const{expr:e,...n}=t;return{signal:e,...n}}return cr(t)?t:void 0!==t?{value:t}:void 0}function br(t){return cr(t)?t.signal:(0,I.m8)(t.value)}function xr(t){return cr(t)?t.signal:null==t?null:(0,I.m8)(t)}function Ar(t,e,n){for(const r of n){const n=Er(r,e.markDef,e.config);void 0!==n&&(t[r]=yr(n))}return t}function _r(t){var e;return[].concat(t.type,null!==(e=t.style)&&void 0!==e?e:[])}function wr(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{vgChannel:i,ignoreVgConfig:o}=r;return i&&void 0!==e[i]?e[i]:void 0!==e[t]?e[t]:!o||i&&i!==t?Er(t,e,n,r):void 0}function Er(t,e,n){let{vgChannel:r}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Tt(r?Dr(t,e,n.style):void 0,Dr(t,e,n.style),r?n[e.type][r]:void 0,n[e.type][t],r?n.mark[r]:n.mark[t])}function Dr(t,e,n){return Fr(t,_r(e),n)}function Fr(t,e,n){let r;e=(0,I.IX)(e);for(const i of e){const e=n[i];e&&void 0!==e[t]&&(r=e[t])}return r}function Cr(t,e){return(0,I.IX)(t).reduce(((t,n)=>{var r;return t.field.push(Ja(n,e)),t.order.push(null!==(r=n.sort)&&void 0!==r?r:"ascending"),t}),{field:[],order:[]})}function kr(t,e){const n=[...t];return e.forEach((t=>{for(const e of n)if(Q(e,t))return;n.push(t)})),n}function Sr(t,e){return Q(t,e)||!e?t:t?[...(0,I.IX)(t),...(0,I.IX)(e)].join(", "):e}function Mr(t,e){const n=t.value,r=e.value;if(null==n||null===r)return{explicit:t.explicit,value:null};if((ur(n)||cr(n))&&(ur(r)||cr(r)))return{explicit:t.explicit,value:Sr(n,r)};if(ur(n)||cr(n))return{explicit:t.explicit,value:n};if(ur(r)||cr(r))return{explicit:t.explicit,value:r};if(!ur(n)&&!cr(n)&&!ur(r)&&!cr(r))return{explicit:t.explicit,value:kr(n,r)};throw new Error("It should never reach here")}function Br(t){return"Invalid specification ".concat(it(t),'. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".')}const Or='Autosize "fit" only works for single views and layered views.';function Nr(t){return"".concat("width"==t?"Width":"Height",' "container" only works for single views and layered views.')}function Tr(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 zr(t){return t?'Dropping "fit-'.concat(t,'" because spec has discrete ').concat(Ye(t),"."):'Dropping "fit" because spec has discrete size.'}function Rr(t){return"Unknown field for ".concat(t,". Cannot calculate view size.")}function Pr(t){return'Cannot project a selection on encoding channel "'.concat(t,'", which has no field.')}function Lr(t,e){return'Cannot project a selection on encoding channel "'.concat(t,'" as it uses an aggregate function ("').concat(e,'").')}function jr(t){return"Selection not supported for ".concat(t," yet.")}const Ur="The same selection must be used to override scale domains in a layered view.";function Ir(t){return'The "columns" property cannot be used when "'.concat(t,'" has nested row/column.')}function qr(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 Wr(t){return"Config.customFormatTypes is not true, thus custom format type and format for channel ".concat(t," are dropped.")}function Hr(t){return"".concat(t,"Offset dropped because ").concat(t," is continuous")}function Xr(t){return"There is no ".concat(t," encoding. Replacing ").concat(t,"Offset encoding as ").concat(t,".")}function Gr(t){return'Invalid field type "'.concat(t,'".')}function Jr(t,e){const{fill:n,stroke:r}=e;return"Dropping color ".concat(t," as the plot also has ").concat(n&&r?"fill and stroke":n?"fill":"stroke",".")}function $r(t,e){return"Dropping ".concat(it(t),' from channel "').concat(e,'" since it does not contain any data field, datum, value, or signal.')}function Vr(t,e,n){return"".concat(t,' dropped as it is incompatible with "').concat(e,'"').concat(n?" when ".concat(n):"",".")}function Yr(t){return"".concat(t," encoding has no scale, so specified scale is ignored.")}function Kr(t){return"".concat(t," encoding should be discrete (ordinal / nominal / binned).")}function Zr(t){return"".concat(t," encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).")}function Qr(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 ti(t){return"Using unaggregated domain with raw field has no effect (".concat(it(t),").")}function ei(t){return'Unaggregated domain not applicable for "'.concat(t,'" since it produces values outside the origin domain of the source data.')}function ni(t){return"Unaggregated domain is currently unsupported for log scale (".concat(it(t),").")}function ri(t,e,n){return"".concat(n,"-scale's \"").concat(e,'" is dropped as it does not work with ').concat(t," scale.")}function ii(t){return'The step for "'.concat(t,'" is dropped because the ').concat("width"===t?"x":"y"," is continuous.")}const oi="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function ai(t,e){return"Invalid ".concat(t,": ").concat(it(e),".")}function si(t){return"1D error band does not support ".concat(t,".")}function ui(t){return"Channel ".concat(t,' is required for "binned" bin.')}const ci=(0,I.kg)(I.uU);let li=ci;function fi(){return li=ci,li}function di(){li.warn(...arguments)}function hi(t){if(t&&(0,I.Kn)(t))for(const e of Ai)if(e in t)return!0;return!1}new WeakMap;const pi=["january","february","march","april","may","june","july","august","september","october","november","december"],mi=pi.map((t=>t.substr(0,3))),gi=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],vi=gi.map((t=>t.substr(0,3)));function yi(t,e){const n=[];if(e&&void 0!==t.day&&bt(t).length>1&&(di(function(t){return"Dropping day from datetime ".concat(it(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 r=e?function(t){if(It(t)&&(t=+t),(0,I.hj)(t))return t-1;{const e=t.toLowerCase(),n=pi.indexOf(e);if(-1!==n)return n;const r=e.substr(0,3),i=mi.indexOf(r);if(-1!==i)return i;throw new Error(ai("month",t))}}(t.month):t.month;n.push(r)}else if(void 0!==t.quarter){const r=e?function(t){if(It(t)&&(t=+t),(0,I.hj)(t))return t>4&&di(ai("quarter",t)),t-1;throw new Error(ai("quarter",t))}(t.quarter):t.quarter;n.push((0,I.hj)(r)?3*r:"".concat(r,"*3"))}else n.push(0);if(void 0!==t.date)n.push(t.date);else if(void 0!==t.day){const r=e?function(t){if(It(t)&&(t=+t),(0,I.hj)(t))return t%7;{const e=t.toLowerCase(),n=gi.indexOf(e);if(-1!==n)return n;const r=e.substr(0,3),i=vi.indexOf(r);if(-1!==i)return i;throw new Error(ai("day",t))}}(t.day):t.day;n.push((0,I.hj)(r)?r+1:"".concat(r,"+1"))}else n.push(1);for(const r of["hours","minutes","seconds","milliseconds"]){const e=t[r];n.push("undefined"===typeof e?0:e)}return n}function bi(t){const e=yi(t,!0).join(", ");return t.utc?"utc(".concat(e,")"):"datetime(".concat(e,")")}const xi={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Ai=bt(xi);function _i(t){return t.startsWith("utc")}const wi={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function Ei(t){return Ai.filter((e=>Di(t,e)))}function Di(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 Fi(t,e){let{end:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{end:!1};const r=Ct(e),i=_i(t)?"utc":"";let o;const a={};for(const u of Ai)Di(t,u)&&(a[u]="quarter"===(s=u)?"(".concat(i,"quarter(").concat(r,")-1)"):"".concat(i).concat(s,"(").concat(r,")"),o=u);var s;return n&&(a[o]+="+1"),function(t){const e=yi(t,!1).join(", ");return t.utc?"utc(".concat(e,")"):"datetime(".concat(e,")")}(a)}function Ci(t){if(!t)return;const e=Ei(t);return"timeUnitSpecifier(".concat(it(e),", ").concat(it(wi),")")}function ki(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}:{}}),_i(e.unit)&&(e.utc=!0,e.unit=function(t){return t.substr(3)}(e.unit)),e}function Si(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t=>t;const n=ki(t),r=function(t){const e=Ei(t);return e[e.length-1]}(n.unit);if(r&&"day"!==r){const t={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},i=n.step||1,o={...t,..."quarter"===r?{month:+t.month+3*i}:"week"===r?{date:+t.date+7*i}:{[r]:+t[r]+i}};return"".concat(e(bi(o))," - ").concat(e(bi(t)))}}function Mi(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.equal}function Bi(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.lt}function Oi(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.lte}function Ni(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.gt}function Ti(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.gte}function zi(t){if(null!==t&&void 0!==t&&t.field){if((0,I.kJ)(t.range)&&2===t.range.length)return!0;if(cr(t.range))return!0}return!1}function Ri(t){return!(null===t||void 0===t||!t.field)&&((0,I.kJ)(t.oneOf)||(0,I.kJ)(t.in))}function Pi(t){return Ri(t)||Mi(t)||zi(t)||Bi(t)||Ni(t)||Oi(t)||Ti(t)}function Li(t,e){return ls(t,{timeUnit:e,wrapTime:!0})}function ji(t){var e;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{field:r}=t,i=null===(e=ki(t.timeUnit))||void 0===e?void 0:e.unit,o=i?"time(".concat(Fi(i,r),")"):Ja(t,{expr:"datum"});if(Mi(t))return"".concat(o,"===").concat(Li(t.equal,i));if(Bi(t)){const e=t.lt;return"".concat(o,"<").concat(Li(e,i))}if(Ni(t)){const e=t.gt;return"".concat(o,">").concat(Li(e,i))}if(Oi(t)){const e=t.lte;return"".concat(o,"<=").concat(Li(e,i))}if(Ti(t)){const e=t.gte;return"".concat(o,">=").concat(Li(e,i))}if(Ri(t))return"indexof([".concat(function(t,e){return t.map((t=>Li(t,e)))}(t.oneOf,i).join(","),"], ").concat(o,") !== -1");if(function(t){return!(null===t||void 0===t||!t.field)&&void 0!==t.valid}(t))return Ui(o,t.valid);if(zi(t)){const{range:e}=t,r=cr(e)?{signal:"".concat(e.signal,"[0]")}:e[0],a=cr(e)?{signal:"".concat(e.signal,"[1]")}:e[1];if(null!==r&&null!==a&&n)return"inrange("+o+", ["+Li(r,i)+", "+Li(a,i)+"])";const s=[];return null!==r&&s.push("".concat(o," >= ").concat(Li(r,i))),null!==a&&s.push("".concat(o," <= ").concat(Li(a,i))),s.length>0?s.join(" && "):"true"}throw new Error("Invalid field predicate: ".concat(it(t)))}function Ui(t){return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?"isValid(".concat(t,") && isFinite(+").concat(t,")"):"!isValid(".concat(t,") || !isFinite(+").concat(t,")")}function Ii(t){var e;return Pi(t)&&t.timeUnit?{...t,timeUnit:null===(e=ki(t.timeUnit))||void 0===e?void 0:e.unit}:t}const qi={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Wi(t){return"quantitative"===t||"temporal"===t}function Hi(t){return"ordinal"===t||"nominal"===t}const Xi=qi.quantitative,Gi=qi.ordinal,Ji=qi.temporal,$i=qi.nominal,Vi=qi.geojson;bt(qi);const Yi={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"},Ki={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(Ki);function Zi(t,e){const n=Ki[t],r=Ki[e];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}const Qi={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 Qi[t]}const eo=new Set(["linear","log","pow","sqrt","symlog"]),no=new Set([...eo,"time","utc"]);function ro(t){return eo.has(t)}const io=new Set(["quantile","quantize","threshold"]),oo=new Set([...no,...io,"sequential","identity"]),ao=new Set(["ordinal","bin-ordinal","point","band"]);new Set(["time","utc"]);function so(t){return ao.has(t)}function uo(t){return oo.has(t)}function co(t){return no.has(t)}function lo(t){return io.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),Ao=bt(xo);function _o(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 co(t)||"band"===t||"point"===t;case"padding":case"rangeMin":case"rangeMax":return co(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 co(t);case"nice":return co(t)||"quantize"===t||"threshold"===t;case"exponent":return"pow"===t;case"base":return"log"===t;case"constant":return"symlog"===t;case"zero":return uo(t)&&!st(["log","time","utc","threshold","quantile"],t)}}function wo(t,e){switch(e){case"interpolate":case"scheme":case"domainMid":return Be(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,Fo=Eo.area,Co=Eo.bar,ko=Eo.image,So=Eo.line,Mo=Eo.point,Bo=Eo.rect,Oo=Eo.rule,No=Eo.text,To=Eo.tick,zo=Eo.trail,Ro=Eo.circle,Po=Eo.square,Lo=Eo.geoshape;function jo(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 Go(t){return t&&void 0!=t.band}const Jo={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:r,scale:i,config:o}=t,a=ea(t);return Na(n)&&!Yn(n.aggregate)&&i&&co(i.get("type"))?function(t){let{fieldDef:e,channel:n,markDef:r,ref:i,config:o}=t;if(jo(r.type))return i;const a=wr("invalid",r,o);if(null===a)return[Ko(e,n),i];return i}({fieldDef:n,channel:e,markDef:r,ref:a,config:o}):a}function Ko(t,e){return{test:Zo(t,!0),..."y"===Je(e)?{field:{group:"height"}}:{value:0}}}function Zo(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Ui((0,I.HD)(t)?t:Ja(t,{expr:"datum"}),!e)}function Qo(t,e,n,r){const i={};if(e&&(i.scale=e),za(t)){const{datum:e}=t;hi(e)?i.signal=bi(e):cr(e)?i.signal=e.signal:or(e)?i.signal=e.expr:i.value=e}else i.field=Ja(t,n);if(r){const{offset:t,band:e}=r;t&&(i.offset=t),e&&(i.band=e)}return i}function ta(t){let{scaleName:e,fieldOrDatumDef:n,fieldOrDatumDef2:r,offset:i,startSuffix:o,bandPosition:a=.5}=t;const s=0<a&&a<1?"datum":void 0,u=Ja(n,{expr:s,suffix:o}),c=void 0!==r?Ja(r,{expr:s}):Ja(n,{suffix:"end",expr:s}),l={};if(0===a||1===a){l.scale=e;const t=0===a?u:c;l.field=t}else{const t=cr(a)?"".concat(a.signal," * ").concat(u," + (1-").concat(a.signal,") * ").concat(c):"".concat(a," * ").concat(u," + ").concat(1-a," * ").concat(c);l.signal='scale("'.concat(e,'", ').concat(t,")")}return i&&(l.offset=i),l}function ea(t){let{channel:e,channelDef:n,channel2Def:r,markDef:i,config:o,scaleName:a,scale:s,stack:u,offset:c,defaultRef:l,bandPosition:f}=t;if(n){if(ja(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=Fa({fieldDef:n,fieldDef2:r,markDef:i,config:o}));const{bin:s,timeUnit:l,type:d}=n;if(tr(s)||f&&l&&d===Ji)return null!==u&&void 0!==u&&u.impute?Qo(n,a,{binSuffix:"mid"},{offset:c}):f&&!so(t)?ta({scaleName:a,fieldOrDatumDef:n,bandPosition:f,offset:c}):Qo(n,a,ds(n,e)?{binSuffix:"range"}:{},{offset:c});if(er(s)){if(Na(r))return ta({scaleName:a,fieldOrDatumDef:n,fieldOrDatumDef2:r,bandPosition:f,offset:c});di(ui(e===Xt?Jt:$t))}}return Qo(n,a,so(t)?{binSuffix:"range"}:{},{offset:c,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=c?{offset:c}:{};return{...na(e,n.value),...t}}}return(0,I.mf)(l)&&(l=l()),l?{...l,...c?{offset:c}:{}}:l}function na(t,e){return st(["x","x2"],t)&&"width"===e?{field:{group:"width"}}:st(["y","y2"],t)&&"height"===e?{field:{group:"height"}}:yr(e)}function ra(t){return t&&"number"!==t&&"time"!==t}function ia(t,e,n){return"".concat(t,"(").concat(e).concat(n?", ".concat(it(n)):"",")")}const oa=" \u2013 ";function aa(t){let{fieldOrDatumDef:e,format:n,formatType:r,expr:i,normalizeStack:o,config:a}=t;if(ra(r))return ua({fieldOrDatumDef:e,format:n,formatType:r,expr:i,config:a});const s=sa(e,i,o),u=Ta(e);if(void 0===n&&void 0===r&&a.customFormatTypes){if("quantitative"===u){if(o&&a.normalizedNumberFormatType)return ua({fieldOrDatumDef:e,format:a.normalizedNumberFormat,formatType:a.normalizedNumberFormatType,expr:i,config:a});if(a.numberFormatType)return ua({fieldOrDatumDef:e,format:a.numberFormat,formatType:a.numberFormatType,expr:i,config:a})}if("temporal"===u&&a.timeFormatType&&Na(e)&&void 0===e.timeUnit)return ua({fieldOrDatumDef:e,format:a.timeFormat,formatType:a.timeFormatType,expr:i,config:a})}if(cs(e)){var c,l;const t=function(t){let{field:e,timeUnit:n,format:r,formatType:i,rawTimeFormat:o,isUTCScale:a}=t;return!n||r?!n&&i?"".concat(i,"(").concat(e,", '").concat(r,"')"):(r=(0,I.HD)(r)?r:o,"".concat(a?"utc":"time","Format(").concat(e,", '").concat(r,"')")):function(t,e,n){if(!t)return;const r=Ci(t),i=n||_i(t);return"".concat(i?"utc":"time","Format(").concat(e,", ").concat(r,")")}(n,e,a)}({field:s,timeUnit:Na(e)?null===(c=ki(e.timeUnit))||void 0===c?void 0:c.unit:void 0,format:n,formatType:a.timeFormatType,rawTimeFormat:a.timeFormat,isUTCScale:qa(e)&&(null===(l=e.scale)||void 0===l?void 0:l.type)===Yi.UTC});return t?{signal:t}:void 0}if(n=fa({type:u,specifiedFormat:n,config:a,normalizeStack:o}),Na(e)&&tr(e.bin)){return{signal:pa(s,Ja(e,{expr:i,binSuffix:"end"}),n,r,a)}}return n||"quantitative"===Ta(e)?{signal:"".concat(da(s,n))}:{signal:"isValid(".concat(s,") ? ").concat(s,' : ""+').concat(s)}}function sa(t,e,n){return Na(t)?n?"".concat(Ja(t,{expr:e,suffix:"end"}),"-").concat(Ja(t,{expr:e,suffix:"start"})):Ja(t,{expr:e}):function(t){const{datum:e}=t;return hi(e)?bi(e):"".concat(it(e))}(t)}function ua(t){var e;let{fieldOrDatumDef:n,format:r,formatType:i,expr:o,normalizeStack:a,config:s,field:u}=t;if(null!==(e=u)&&void 0!==e||(u=sa(n,o,a)),"datum.value"!==u&&Na(n)&&tr(n.bin)){return{signal:pa(u,Ja(n,{expr:o,binSuffix:"end"}),r,i,s)}}return{signal:ia(i,u,r)}}function ca(t,e,n,r,i,o){if(!(0,I.HD)(r)||!ra(r)){if(void 0===n&&void 0===r&&i.customFormatTypes&&"quantitative"===Ta(t)){if(i.normalizedNumberFormatType&&Wa(t)&&"normalize"===t.stack)return;if(i.numberFormatType)return}if(Wa(t)&&"normalize"===t.stack&&i.normalizedNumberFormat)return fa({type:"quantitative",config:i,normalizeStack:!0});if(cs(t)){var a;const e=Na(t)?null===(a=ki(t.timeUnit))||void 0===a?void 0:a.unit:void 0;if(void 0===e&&i.customFormatTypes&&i.timeFormatType)return;return function(t){let{specifiedFormat:e,timeUnit:n,config:r,omitTimeFormatConfig:i}=t;if(e)return e;if(n)return{signal:Ci(n)};return i?void 0:r.timeFormat}({specifiedFormat:n,timeUnit:e,config:i,omitTimeFormatConfig:o})}return fa({type:e,specifiedFormat:n,config:i})}}function la(t,e,n){return t&&(cr(t)||"number"===t||"time"===t)?t:cs(e)&&"time"!==n&&"utc"!==n?Na(e)&&null!==(r=ki(null===e||void 0===e?void 0:e.timeUnit))&&void 0!==r&&r.utc?"utc":"time":void 0;var r}function fa(t){let{type:e,specifiedFormat:n,config:r,normalizeStack:i}=t;return(0,I.HD)(n)?n:e===Xi?i?r.normalizedNumberFormat:r.numberFormat:void 0}function da(t,e){return"format(".concat(t,', "').concat(e||"",'")')}function ha(t,e,n,r){var i;return ra(n)?ia(n,t,e):da(t,null!==(i=(0,I.HD)(e)?e:void 0)&&void 0!==i?i:r.numberFormat)}function pa(t,e,n,r,i){if(void 0===n&&void 0===r&&i.customFormatTypes&&i.numberFormatType)return pa(t,e,i.numberFormat,i.numberFormatType,i);const o=ha(t,n,r,i),a=ha(e,n,r,i);return"".concat(Ui(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 Aa(t){return"row"in t||"column"in t}function _a(t){return!!t&&"header"in t}function wa(t){return"facet"in t}function Ea(t){const{field:e,timeUnit:n,bin:r,aggregate:i}=t;return{...n?{timeUnit:n}:{},...r?{bin:r}:{},...i?{aggregate:i}:{},field:e}}function Da(t){return"sort"in t}function Fa(t){let{fieldDef:e,fieldDef2:n,markDef:r,config:i}=t;if(ja(e)&&void 0!==e.bandPosition)return e.bandPosition;if(Na(e)){const{timeUnit:t,bin:o}=e;if(t&&!n)return Uo(r.type)?0:Er("timeUnitBandPosition",r,i);if(tr(o))return.5}}function Ca(t){let{channel:e,fieldDef:n,fieldDef2:r,markDef:i,config:o,scaleType:a,useVlSizeChannel:s}=t;const u=Ye(e),c=wr(s?"size":u,i,o,{vgChannel:u});if(void 0!==c)return c;if(Na(n)){const{timeUnit:t,bin:e}=n;if(t&&!r)return{band:Er("timeUnitBandSize",i,o)};if(tr(e)&&!so(a))return{band:1}}var l,f,d;return Uo(i.type)?a?so(a)?(null===(f=o[i.type])||void 0===f?void 0:f.discreteBandSize)||{band:1}:null===(d=o[i.type])||void 0===d?void 0:d.continuousBandSize:null===(l=o[i.type])||void 0===l?void 0:l.discreteBandSize:void 0}function ka(t,e,n,r){return!!(tr(t.bin)||t.timeUnit&&Ua(t)&&"temporal"===t.type)&&void 0!==Fa({fieldDef:t,fieldDef2:e,markDef:n,config:r})}function Sa(t){return t&&!!t.sort&&!t.field}function Ma(t){return t&&"condition"in t}function Ba(t){const e=null===t||void 0===t?void 0:t.condition;return!!e&&!(0,I.kJ)(e)&&Na(e)}function Oa(t){const e=null===t||void 0===t?void 0:t.condition;return!!e&&!(0,I.kJ)(e)&&ja(e)}function Na(t){return t&&(!!t.field||"count"===t.aggregate)}function Ta(t){return null===t||void 0===t?void 0:t.type}function za(t){return t&&"datum"in t}function Ra(t){return Ua(t)&&!$a(t)||La(t)}function Pa(t){return Ua(t)&&"quantitative"===t.type&&!t.bin||La(t)}function La(t){return za(t)&&(0,I.hj)(t.datum)}function ja(t){return Na(t)||za(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 Ga(t){return rt(t,["legend","axis","header","scale"])}function Ja(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.field;const r=e.prefix;let i=e.suffix,o="";if(function(t){return"count"===t.aggregate}(t))n=Lt("count");else{let r;if(!e.nofn)if(function(t){return"op"in t}(t))r=t.op;else{const{bin:c,aggregate:l,timeUnit:f}=t;var a,s;if(tr(c))r=Qn(c),i=(null!==(a=e.binSuffix)&&void 0!==a?a:"")+(null!==(s=e.suffix)&&void 0!==s?s:"");else if(l)Jn(l)?(o='["'.concat(n,'"]'),n="argmax_".concat(l.argmax)):Gn(l)?(o='["'.concat(n,'"]'),n="argmin_".concat(l.argmin)):r=String(l);else if(f){var u;r=function(t){const{utc:e,...n}=ki(t);return n.unit?(e?"utc":"")+bt(n).map((t=>wt("".concat("unit"===t?"":"_".concat(t,"_")).concat(n[t])))).join(""):(e?"utc":"")+"timeunit"+bt(n).map((t=>wt("_".concat(t,"_").concat(n[t])))).join("")}(f),i=(!["range","mid"].includes(e.binSuffix)&&e.binSuffix||"")+(null!==(u=e.suffix)&&void 0!==u?u:"")}}r&&(n=n?"".concat(r,"_").concat(n):r)}return i&&(n="".concat(n,"_").concat(i)),r&&(n="".concat(r,"_").concat(n)),e.forAs?Ot(n):e.expr?kt(n,e.expr)+o:Mt(n)+o}function $a(t){switch(t.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return Na(t)&&!!t.bin;case"temporal":return!1}throw new Error(Gr(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:r,field:i}=t;if(Jn(e))return"".concat(i," for argmax(").concat(e.argmax,")");if(Gn(e))return"".concat(i," for argmin(").concat(e.argmin,")");const o=ki(r),a=e||(null===o||void 0===o?void 0:o.unit)||(null===o||void 0===o?void 0:o.maxbins)&&"timeunit"||tr(n)&&"bin";return a?"".concat(a.toUpperCase(),"(").concat(i,")"):i}(t);default:return function(t,e){const{field:n,bin:r,timeUnit:i,aggregate:o}=t;if("count"===o)return e.countTitle;if(tr(r))return"".concat(n," (binned)");if(i){var a;const t=null===(a=ki(i))||void 0===a?void 0:a.unit;if(t)return"".concat(n," (").concat(Ei(t).join("-"),")")}else if(o)return Jn(o)?"".concat(n," for max ").concat(o.argmax):Gn(o)?"".concat(n," for min ").concat(o.argmin):"".concat(Ft(o)," of ").concat(n);return n}(t,e)}};let Ya=Va;function Ka(t){Ya=t}function Za(t,e,n){var r;let{allowDisabling:i,includeDefault:o=!0}=n;const a=null===(r=Qa(t))||void 0===r?void 0:r.title;if(!Na(t))return null!==a&&void 0!==a?a:t.title;const s=t,u=o?ts(s,e):void 0;return i?Tt(a,s.title,u):null!==(c=null!==a&&void 0!==a?a:s.title)&&void 0!==c?c:u;var c}function Qa(t){return Wa(t)&&t.axis?t.axis:Ha(t)&&t.legend?t.legend:_a(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:r,formatType:i}=n;return{format:r,formatType:i}}}function ns(t){return Na(t)?t:Ba(t)?t.condition:void 0}function rs(t){return ja(t)?t:Oa(t)?t.condition:void 0}function is(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if((0,I.HD)(t)||(0,I.hj)(t)||(0,I.jn)(t)){return di(function(t,e,n){return"Channel ".concat(t," is a ").concat(e,". Converted to {value: ").concat(it(n),"}.")}(e,(0,I.HD)(t)?"string":(0,I.hj)(t)?"number":"boolean",t)),{value:t}}return ja(t)?os(t,e,n,r):Oa(t)?{...t,condition:os(t.condition,e,n,r)}:t}function os(t,e,n,r){if(Xa(t)){const{format:i,formatType:o,...a}=t;if(ra(o)&&!n.customFormatTypes)return di(Wr(e)),os(a,e,n,r)}else{const i=Wa(t)?"axis":Ha(t)?"legend":_a(t)?"header":null;if(i&&t[i]){const{format:o,formatType:a,...s}=t[i];if(ra(a)&&!n.customFormatTypes)return di(Wr(e)),os({...t,[i]:s},e,n,r)}}return Na(t)?as(t,e,r):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":hi(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:r,timeUnit:i,bin:o,field:a}=t,s={...t};if(n||!r||$n(r)||Jn(r)||Gn(r)||(di(function(t){return'Invalid aggregation operator "'.concat(t,'".')}(r)),delete s.aggregate),i&&(s.timeUnit=ki(i)),a&&(s.field="".concat(a)),tr(o)&&(s.bin=ss(o,e)),er(o)&&!xn(e)&&di(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 Xi:return"quantitative";case"t":case Ji:return"temporal";case"o":case Gi:return"ordinal";case"n":case $i:return"nominal";case Vi:return"geojson"}}(t);t!==e&&(s.type=e),"quantitative"!==t&&Yn(r)&&(di(function(t,e){return'Invalid field type "'.concat(t,'" for aggregate: "').concat(e,'", using "quantitative" instead.')}(t,r)),s.type="quantitative")}else if(!Ge(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:r,bin:i,timeUnit:o}=t;if(o)return"temporal";if(i||r&&!Jn(r)&&!Gn(r))return"quantitative";if(qa(t)&&null!==(n=t.scale)&&void 0!==n&&n.type)switch(Ki[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)?us:{compatible:!1,warning:Kr(e)};case Xt:case Gt:case Vt:case Yt:case oe:case ae:case se:case ge:case ye:case be:case xe:case Ae:case _e:case le:case Qt:case Kt:case we:return us;case ne:case ie:case ee:case re:return n!==Xi?{compatible:!1,warning:"Channel ".concat(e," should be used with a quantitative field only, not ").concat(t.type," field.")}:us;case fe:case de:case he:case pe:case ce:case te:case Zt:case Jt:case $t:return"nominal"!==n||t.sort?us:{compatible:!1,warning:"Channel ".concat(e," should not be used with an unsorted discrete field.")};case ue:case me:return $a(t)||function(t){var e;return qa(t)&&lo(null===(e=t.scale)||void 0===e?void 0:e.type)}(t)?us:{compatible:!1,warning:Zr(e)};case ve:return"nominal"!==t.type||"sort"in t?us:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,e)||{};!1===t&&di(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(_a(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:ir(e)}:"binned"===t?{binned:!0}:t.maxbins||t.step?t:{...t,maxbins:ir(e)}}const us={compatible:!0};function cs(t){const{formatType:e}=es(t);return"time"===e||!e&&((n=t)&&("temporal"===n.type||Na(n)&&!!n.timeUnit));var n}function ls(t,e){var n;let{timeUnit:r,type:i,wrapTime:o,undefinedIfExprNotRequired:a}=e;const s=r&&(null===(n=ki(r))||void 0===n?void 0:n.unit);let u,c=s||"temporal"===i;return or(t)?u=t.expr:cr(t)?u=t.signal:hi(t)?(c=!0,u=bi(t)):((0,I.HD)(t)||(0,I.hj)(t))&&c&&(u="datetime(".concat(it(t),")"),function(t){return!!xi[t]}(s)&&((0,I.hj)(t)&&t<1e4||(0,I.HD)(t)&&isNaN(Date.parse(t)))&&(u=bi({[s]:t}))),u?o&&c?"time(".concat(u,")"):u:a?void 0:it(t)}function fs(t,e){const{type:n}=t;return e.map((e=>{const r=ls(e,{timeUnit:Na(t)?t.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==r?{signal:r}:e}))}function ds(t,e){return tr(t.bin)?Ln(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 As(t){return"mark"in t}class _s{constructor(t,e){this.name=t,this.run=e}hasMatchingType(t){return!!As(t)&&(qo(e=t.mark)?e.type:e)===this.name;var e}}function ws(t,e){const n=t&&t[e];return!!n&&((0,I.kJ)(n)?ut(n,(t=>!!t.field)):Na(n)||Ba(n))}function Es(t,e){const n=t&&t[e];return!!n&&((0,I.kJ)(n)?ut(n,(t=>!!t.field)):Na(n)||za(n)||Oa(n))}function Ds(t,e){if(xn(e)){const n=t[e];if((Na(n)||za(n))&&(Hi(n.type)||Na(n)&&n.timeUnit)){return Es(t,Ze(e))}}return!1}function Fs(t){return ut(ze,(e=>{if(ws(t,e)){const n=t[e];if((0,I.kJ)(n))return ut(n,(t=>!!t.aggregate));{const t=ns(n);return t&&!!t.aggregate}}return!1}))}function Cs(t,e){const n=[],r=[],i=[],o=[],a={};return Ms(t,((s,u)=>{if(Na(s)){const{field:c,aggregate:l,bin:f,timeUnit:d,...h}=s;if(l||d||f){const t=Qa(s),p=null===t||void 0===t?void 0:t.title;let m=Ja(s,{forAs:!0});const g={...p?[]:{title:Za(s,e,{allowDisabling:!0})},...h,field:m};if(l){let t;if(Jn(l)?(t="argmax",m=Ja({op:"argmax",field:l.argmax},{forAs:!0}),g.field="".concat(m,".").concat(c)):Gn(l)?(t="argmin",m=Ja({op:"argmin",field:l.argmin},{forAs:!0}),g.field="".concat(m,".").concat(c)):"boxplot"!==l&&"errorbar"!==l&&"errorband"!==l&&(t=l),t){const e={op:t,as:m};c&&(e.field=c),o.push(e)}}else if(n.push(m),Ua(s)&&tr(f)){if(r.push({bin:f,field:c,as:m}),n.push(Ja(s,{binSuffix:"end"})),ds(s,u)&&n.push(Ja(s,{binSuffix:"range"})),xn(u)){const t={field:"".concat(m,"_end")};a["".concat(u,"2")]=t}g.bin="binned",Ge(u)||(g.type=Xi)}else if(d){i.push({timeUnit:d,field:c,as:m});const t=Ua(s)&&s.type!==Ji&&"time";t&&(u===ge||u===xe?g.formatType=t:!function(t){return!!gn[t]}(u)?xn(u)&&(g.axis={formatType:t,...g.axis}):g.legend={formatType:t,...g.legend})}a[u]=g}else n.push(c),a[u]=t[u]}else a[u]=t[u]})),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function ks(t,e,n){const r=jn(e,n);if(!r)return!1;if("binned"===r){const n=t[e===Jt?Xt:Gt];return!!(Na(n)&&Na(t[e])&&er(n.bin))}return!0}function Ss(t,e){const n={};for(const r of bt(t)){const i=is(t[r],r,e,{compositeMark:!0});n[r]=i}return n}function Ms(t,e,n){if(t)for(const r of bt(t)){const i=t[r];if((0,I.kJ)(i))for(const t of i)e.call(n,t,r);else e.call(n,i,r)}}function Bs(t,e){return bt(e).reduce(((n,r)=>{switch(r){case Xt:case Gt:case Ae:case we:case _e:case Jt:case $t:case Vt:case Yt:case Qt:case te:case Kt:case Zt:case ee:case ne:case re:case ie:case ge:case ue:case le:case xe:return n;case ve:if("line"===t||"trail"===t)return n;case ye:case be:{const t=e[r];if((0,I.kJ)(t)||Na(t))for(const e of(0,I.IX)(t))e.aggregate||n.push(Ja(e,{}));return n}case ce: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[r]);return t&&!t.aggregate&&n.push(Ja(t,{})),n}}}),[])}function Os(t,e,n){let r=!(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:i}=t;const o=r?" of ".concat(Ns(e)):"";return{field:n+e.field,type:e.type,title:cr(i)?{signal:"".concat(i,'"').concat(escape(o),'"')}:i+o}})),...dt(function(t){const e=[];for(const n of bt(t))if(ws(t,n)){const r=t[n],i=(0,I.IX)(r);for(const t of i)Na(t)?e.push(t):Ba(t)&&e.push(t.condition)}return e}(n).map(Ga),ot)]}}function Ns(t){const{title:e,field:n}=t;return Tt(e,n)}function Ts(t,e,n,r,i){const{scale:o,axis:a}=n;return s=>{let{partName:u,mark:c,positionPrefix:l,endPositionPrefix:f,extraEncoding:d={}}=s;const h=Ns(n);return zs(t,u,i,{mark:c,encoding:{[e]:{field:"".concat(l,"_").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)}}:{},...r,...d}})}}function zs(t,e,n,r){const{clip:i,color:o,opacity:a}=t,s=t.type;return t[e]||void 0===t[e]&&n[e]?[{...r,mark:{...n[e],...i?{clip:i}:{},...o?{color:o}:{},...a?{opacity:a}:{},...qo(r.mark)?r.mark:{type:r.mark},style:"".concat(s,"-").concat(String(e)),...(0,I.jn)(t[e])?{}:t[e]}}]:[]}function Rs(t,e,n){const{encoding:r}=t,i="vertical"===e?"y":"x",o=r[i],a=r["".concat(i,"2")],s=r["".concat(i,"Error")],u=r["".concat(i,"Error2")];return{continuousAxisChannelDef:Ps(o,n),continuousAxisChannelDef2:Ps(a,n),continuousAxisChannelDefError:Ps(s,n),continuousAxisChannelDefError2:Ps(u,n),continuousAxis:i}}function Ps(t,e){if(null!==t&&void 0!==t&&t.aggregate){const{aggregate:n,...r}=t;return n!==e&&di(function(t,e){return"Continuous axis should not have customized aggregation function ".concat(t,"; ").concat(e," already agregates the axis.")}(n,e)),r}return t}function Ls(t,e){const{mark:n,encoding:r}=t,{x:i,y:o}=r;if(qo(n)&&n.orient)return n.orient;if(Ra(i)){if(Ra(o)){const t=Na(i)&&i.aggregate,n=Na(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 cs(o)&&!cs(i)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(Ra(o))return"vertical";throw new Error("Need a valid continuous axis for ".concat(e,"s"))}const js="boxplot",Us=new _s(js,qs);function Is(t){return(0,I.hj)(t)?"tukey":t}function qs(t,e){var n;let{config:r}=e;t={...t,encoding:Ss(t.encoding,r)};const{mark:i,encoding:o,params:a,projection:s,...u}=t,c=qo(i)?i:{type:i};a&&di(jr("boxplot"));const l=null!==(n=c.extent)&&void 0!==n?n:r.boxplot.extent,f=wr("size",c,r),d=c.invalid,h=Is(l),{bins:p,timeUnits:m,transform:g,continuousAxisChannelDef:v,continuousAxis:y,groupby:b,aggregate:x,encodingWithoutContinuousAxis:A,ticksOrient:_,boxOrient:w,customTooltipWithoutAggregatedField:E}=function(t,e,n){const r=Ls(t,js),{continuousAxisChannelDef:i,continuousAxis:o}=Rs(t,r,js),a=i.field,s=Is(e),u=[...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}],c="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]:l,...f}=t.encoding,{customTooltipWithoutAggregatedField:d,filteredEncoding:h}=function(t){const{tooltip:e,...n}=t;if(!e)return{filteredEncoding:n};let r,i;if((0,I.kJ)(e)){for(const t of e)t.aggregate?(r||(r=[]),r.push(t)):(i||(i=[]),i.push(t));r&&(n.tooltip=r)}else e.aggregate?n.tooltip=e:i=e;return(0,I.kJ)(i)&&1===i.length&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}(f),{bins:p,timeUnits:m,aggregate:g,groupby:v,encoding:y}=Cs(h,n),b="vertical"===r?"horizontal":"vertical",x=r,A=[...p,...m,{aggregate:[...g,...u],groupby:v},...c];return{bins:p,timeUnits:m,transform:A,groupby:v,aggregate:g,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:y,ticksOrient:b,boxOrient:x,customTooltipWithoutAggregatedField:d}}(t,l,r),{color:D,size:F,...C}=A,k=t=>Ts(c,y,v,t,r.boxplot),S=k(C),M=k(A),B=k({...C,...F?{size:F}:{}}),O=Os([{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,A),N={type:"tick",color:"black",opacity:1,orient:_,invalid:d,aria:!1},T="min-max"===h?O:Os([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],v,A),z=[...S({partName:"rule",mark:{type:"rule",invalid:d,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:T}),...S({partName:"rule",mark:{type:"rule",invalid:d,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:T}),...S({partName:"ticks",mark:N,positionPrefix:"lower_whisker",extraEncoding:T}),...S({partName:"ticks",mark:N,positionPrefix:"upper_whisker",extraEncoding:T})],R=[..."tukey"!==h?z:[],...M({partName:"box",mark:{type:"bar",...f?{size:f}:{},orient:w,invalid:d,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:O}),...B({partName:"median",mark:{type:"tick",invalid:d,...(0,I.Kn)(r.boxplot.median)&&r.boxplot.median.color?{color:r.boxplot.median.color}:{},...f?{size:f}:{},orient:_,aria:!1},positionPrefix:"mid_box",extraEncoding:O})];var P;if("min-max"===h)return{...u,transform:(null!==(P=u.transform)&&void 0!==P?P:[]).concat(g),layer:R};const L='datum["lower_box_'.concat(v.field,'"]'),j='datum["upper_box_'.concat(v.field,'"]'),U="(".concat(j," - ").concat(L,")"),q="".concat(L," - ").concat(l," * ").concat(U),W="".concat(j," + ").concat(l," * ").concat(U),H='datum["'.concat(v.field,'"]'),X={joinaggregate:Ws(v.field),groupby:b},G={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:z},{tooltip:J,...$}=C,{scale:V,axis:Y}=v,K=Ns(v),Z=rt(Y,["title"]),Q=zs(c,"outliers",r.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,G]}:(tt=G,tt.transform.unshift(...et)),{...u,layer:[tt,{transform:g,layer:R}]}}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 _s(Hs,Gs);function Gs(t,e){let{config:n}=e;t={...t,encoding:Ss(t.encoding,n)};const{transform:r,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:a,ticksOrient:s,markDef:u,outerSpec:c,tooltipEncoding:l}=$s(t,Hs,n);delete a.size;const f=Ts(u,o,i,a,n.errorbar),d=u.thickness,h=u.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:l}),...f({partName:"ticks",mark:p,positionPrefix:"upper",extraEncoding:l}),...f({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...void 0!==d?{size:d}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...c,transform:r,...m.length>1?{layer:m}:{...m[0]}}}function Js(t,e){const{encoding:n}=t;if(function(t){return(ja(t.x)||ja(t.y))&&!ja(t.x2)&&!ja(t.y2)&&!ja(t.xError)&&!ja(t.xError2)&&!ja(t.yError)&&!ja(t.yError2)}(n))return{orient:Ls(t,e),inputType:"raw"};const r=function(t){return ja(t.x2)||ja(t.y2)}(n),i=function(t){return ja(t.xError)||ja(t.xError2)||ja(t.yError)||ja(t.yError2)}(n),o=n.x,a=n.y;if(r){if(i)throw new Error("".concat(e," cannot be both type aggregated-upper-lower and aggregated-error"));const t=n.x2,r=n.y2;if(ja(t)&&ja(r))throw new Error("".concat(e," cannot have both x2 and y2"));if(ja(t)){if(Ra(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error("Both x and x2 have to be quantitative in ".concat(e))}if(ja(r)){if(Ra(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,r=n.xError2,i=n.yError,s=n.yError2;if(ja(r)&&!ja(t))throw new Error("".concat(e," cannot have xError2 without xError"));if(ja(s)&&!ja(i))throw new Error("".concat(e," cannot have yError2 without yError"));if(ja(t)&&ja(i))throw new Error("".concat(e," cannot have both xError and yError with both are quantiative"));if(ja(t)){if(Ra(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(ja(i)){if(Ra(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 r;const{mark:i,encoding:o,params:a,projection:s,...u}=t,c=qo(i)?i:{type:i};a&&di(jr(e));const{orient:l,inputType:f}=Js(t,e),{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:m,continuousAxis:g}=Rs(t,l,e),{errorBarSpecificAggregate:v,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:x}=function(t,e,n,r,i,o,a,s){let u=[],c=[];const l=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)&&di(function(t,e,n){return"".concat(t," is not usually used with ").concat(e," for ").concat(n,".")}(e,n,a)),"stderr"===n||"stdev"===n)u=[{op:n,field:l,as:"extent_".concat(l)},{op:e,field:l,as:"center_".concat(l)}],c=[{calculate:'datum["center_'.concat(l,'"] + datum["extent_').concat(l,'"]'),as:"upper_".concat(l)},{calculate:'datum["center_'.concat(l,'"] - datum["extent_').concat(l,'"]'),as:"lower_".concat(l)}],f=[{fieldPrefix:"center_",titlePrefix:Ft(e)},{fieldPrefix:"upper_",titlePrefix:Vs(e,n,"+")},{fieldPrefix:"lower_",titlePrefix:Vs(e,n,"-")}],d=!0;else{let t,e,r;"ci"===n?(t="mean",e="ci0",r="ci1"):(t="median",e="q1",r="q3"),u=[{op:e,field:l,as:"lower_".concat(l)},{op:r,field:l,as:"upper_".concat(l)},{op:t,field:l,as:"center_".concat(l)}],f=[{fieldPrefix:"upper_",titlePrefix:Za({field:l,aggregate:r,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Za({field:l,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Za({field:l,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(t.center||t.extent)&&di((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=[],c=[{calculate:'datum["'.concat(n.field,'"]'),as:"upper_".concat(l)},{calculate:'datum["'.concat(l,'"]'),as:"lower_".concat(l)}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:l}],c=[{calculate:'datum["'.concat(l,'"] + datum["').concat(r.field,'"]'),as:"upper_".concat(l)}],i?c.push({calculate:'datum["'.concat(l,'"] + datum["').concat(i.field,'"]'),as:"lower_".concat(l)}):c.push({calculate:'datum["'.concat(l,'"] - datum["').concat(r.field,'"]'),as:"lower_".concat(l)}));for(const t of c)f.push({fieldPrefix:t.as.substring(0,6),titlePrefix:Bt(Bt(t.calculate,'datum["',""),'"]',"")})}var h,p;return{postAggregateCalculates:c,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}(c,d,h,p,m,f,e,n),{[g]:A,["x"===g?"x2":"y2"]:_,["x"===g?"xError":"yError"]:w,["x"===g?"xError2":"yError2"]:E,...D}=o,{bins:F,timeUnits:C,aggregate:k,groupby:S,encoding:M}=Cs(D,n),B=[...k,...v],O="raw"!==f?[]:S,N=Os(b,d,M,x);return{transform:[...null!==(r=u.transform)&&void 0!==r?r:[],...F,...C,...0===B.length?[]:[{aggregate:B,groupby:O}],...y],groupby:O,continuousAxisChannelDef:d,continuousAxis:g,encodingWithoutContinuousAxis:M,ticksOrient:"vertical"===l?"horizontal":"vertical",markDef:c,outerSpec:u,tooltipEncoding:N}}function Vs(t,e,n){return"".concat(Ft(t)," ").concat(n," ").concat(e)}const Ys="errorband",Ks=new _s(Ys,Zs);function Zs(t,e){let{config:n}=e;t={...t,encoding:Ss(t.encoding,n)};const{transform:r,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:a,markDef:s,outerSpec:u,tooltipEncoding:c}=$s(t,Ys,n),l=s,f=Ts(l,o,i,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={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return d?(h={...h,...m,ariaRoleDescription:"errorband"},p={...p,...m,aria:!1}):l.interpolate?di(si("interpolate")):l.tension&&di(si("tension")),{...u,transform:r,layer:[...f({partName:"band",mark:h,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c}),...f({partName:"borders",mark:p,positionPrefix:"lower",extraEncoding:c}),...f({partName:"borders",mark:p,positionPrefix:"upper",extraEncoding:c})]}}const Qs={};function tu(t,e,n){const r=new _s(t,e);Qs[t]={normalizer:r,parts:n}}tu(js,qs,["box","median","outliers","rule","ticks"]),tu(Hs,Gs,["ticks","rule"]),tu(Ys,Zs,["band","borders"]);const eu=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],nu={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"},ru={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"},iu=bt(nu),ou=bt(ru),au=bt({header:1,headerRow:1,headerColumn:1,headerFacet:1}),su=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],uu={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},cu=(bt(uu),"_vgsid_"),lu={point:{on:"click",fields:[cu],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 fu(t){return"legend"===t||!(null===t||void 0===t||!t.legend)}function du(t){return fu(t)&&(0,I.Kn)(t)}function hu(t){return!(null===t||void 0===t||!t.select)}function pu(t){const e=[];for(const n of t||[]){if(hu(n))continue;const{expr:t,bind:r,...i}=n;if(r&&t){const n={...i,bind:r,init:t};e.push(n)}else{const n={...i,...t?{update:t}:{},...r?{bind:r}:{}};e.push(n)}}return e}function mu(t){return"concat"in t}function gu(t){return"vconcat"in t}function vu(t){return"hconcat"in t}function yu(t){let{step:e,offsetIsDiscrete:n}=t;var r;return n?null!==(r=e.for)&&void 0!==r?r:"offset":"position"}function bu(t){return(0,I.Kn)(t)&&void 0!==t.step}function xu(t){return t.view||t.width||t.height}const Au=bt({align:1,bounds:1,center:1,columns:1,spacing:1});function _u(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t["width"===e?"continuousWidth":"continuousHeight"]}function wu(t,e){const n=Eu(t,e);return bu(n)?n.step:Du}function Eu(t,e){var n;return Tt(null!==(n=t[e])&&void 0!==n?n:t["width"===e?"discreteWidth":"discreteHeight"],{step:t.step})}const Du=20;const Fu={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:Du},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:lu,style:{},title:{},facet:{spacing:20},concat:{spacing:20},normalizedNumberFormat:".0%"},Cu=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],ku={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},Su={blue:Cu[0],orange:Cu[1],red:Cu[2],teal:Cu[3],green:Cu[4],yellow:Cu[5],purple:Cu[6],pink:Cu[7],brown:Cu[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 Mu(t){const e=bt(t||{}),n={};for(const r of e){const e=t[r];n[r]=ps(e)?mr(e):gr(e)}return n}const Bu=[...Xo,...xs,...au,"background","padding","legend","lineBreak","scale","style","title","view"];function Ou(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{color:e,font:n,fontSize:r,selection:i,...o}=t,a=(0,I.fE)({},tt(Fu),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)?{...Su,...t}:Su}],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):{},r?function(t){return{signals:[{name:"fontSize",value:(0,I.Kn)(t)?{...ku,...t}:ku}],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"}}}}}(r):{},o||{});i&&(0,j.writeConfig)(a,"selection",i,!0);const s=rt(a,Bu);for(const u of["background","lineBreak","padding"])a[u]&&(s[u]=gr(a[u]));for(const u of Xo)a[u]&&(s[u]=ar(a[u]));for(const u of xs)a[u]&&(s[u]=Mu(a[u]));for(const u of au)a[u]&&(s[u]=ar(a[u]));return a.legend&&(s.legend=ar(a.legend)),a.scale&&(s.scale=ar(a.scale)),a.style&&(s.style=function(t){const e=bt(t),n={};for(const r of e)n[r]=Mu(t[r]);return n}(a.style)),a.title&&(s.title=ar(a.title)),a.view&&(s.view=ar(a.view)),s}const Nu=new Set(["view",...Io]),Tu=["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"],zu={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],tick:["bandSize","thickness"]};function Ru(t){t=tt(t);for(const e of Tu)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 eu)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(pu(t.params)),delete t.params);for(const e of Nu){for(const r of Ho)delete t[e][r];const n=zu[e];if(n)for(const r of n)delete t[e][r];Pu(t,e)}for(const e of bt(Qs))delete t[e];!function(t){const{titleMarkConfig:e,subtitleMarkConfig:n,subtitle:r}=sr(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(r)?delete t.title:t.title=r}(t);for(const e in t)(0,I.Kn)(t[e])&&yt(t[e])&&delete t[e];return yt(t)?void 0:t}function Pu(t,e,n,r){var i;"view"===e&&(n="cell");const o={...r?t[e][r]:t[e],...t.style[null!==(i=n)&&void 0!==i?i:e]};var a;yt(o)||(t.style[null!==(a=n)&&void 0!==a?a:e]=o);r||delete t[e]}function Lu(t){return"layer"in t}class ju{map(t,e){return wa(t)?this.mapFacet(t,e):function(t){return"repeat"in t}(t)?this.mapRepeat(t,e):vu(t)?this.mapHConcat(t,e):gu(t)?this.mapVConcat(t,e):mu(t)?this.mapConcat(t,e):this.mapLayerOrUnit(t,e)}mapLayerOrUnit(t,e){if(Lu(t))return this.mapLayer(t,e);if(As(t))return this.mapUnit(t,e);throw new Error(Br(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,...r}=t;return{...r,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 Uu={zero:1,center:1,normalize:1};const Iu=new Set([Do,Co,Fo,Oo,Mo,Ro,Po,So,No,To]),qu=new Set([Co,Fo,Do]);function Wu(t){return Na(t)&&"quantitative"===Ta(t)&&!t.bin}function Hu(t,e,n){let{orient:r,type:i}=n;const o="x"===e?"y":"radius",a="x"===e,s=t[e],u=t[o];if(Na(s)&&Na(u))if(Wu(s)&&Wu(u)){if(s.stack)return e;if(u.stack)return o;const t=Na(s)&&!!s.aggregate;if(t!==(Na(u)&&!!u.aggregate))return t?e:o;if(a&&"bar"===i){if("vertical"===r)return o;if("horizontal"===r)return e}}else{if(Wu(s))return e;if(Wu(u))return o}else{if(Wu(s))return e;if(Wu(u))return o}}function Xu(t,e){var n,r;const i=qo(t)?t:{type:t},o=i.type;if(!Iu.has(o))return null;const a=Hu(e,"x",i)||Hu(e,"theta",i);if(!a)return null;const s=e[a],u=Na(s)?Ja(s,{}):void 0,c=function(t){switch(t){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(a),l=[],f=new Set;if(e[c]){const t=e[c],n=Na(t)?Ja(t,{}):void 0;n&&n!==u&&(l.push(c),f.add(n));const r="x"===c?"xOffset":"yOffset",i=e[r],o=Na(i)?Ja(i,{}):void 0;o&&o!==u&&(l.push(r),f.add(o))}const d=vn.reduce(((t,n)=>{if("tooltip"!==n&&ws(e,n)){const r=e[n];for(const e of(0,I.IX)(r)){const r=ns(e);if(r.aggregate)continue;const i=Ja(r,{});i&&f.has(i)||t.push({channel:n,fieldDef:r})}}return t}),[]);let h;return void 0!==s.stack?h=(0,I.jn)(s.stack)?s.stack?"zero":null:s.stack:qu.has(o)&&(h="zero"),h&&h in Uu?Fs(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===(r=s.scale)||void 0===r?void 0:r.type)!==Yi.LINEAR?(null!==s&&void 0!==s&&s.stack&&di(function(t){return"Cannot stack non-linear scale (".concat(t,").")}(s.scale.type)),null):ja(e[Ve(a)])?(void 0!==s.stack&&di('Cannot stack "'.concat(p=a,'" if there is already "').concat(p,'2".')),null):(Na(s)&&s.aggregate&&!Kn.has(s.aggregate)&&di((m=s.aggregate,'Stacking is applied even though the aggregate function is non-summative ("'.concat(m,'").'))),{groupbyChannels:l,groupbyFields:f,fieldChannel:a,impute:null!==s.impute&&jo(o),stackBy:d,offset:h}):null;var p,m}function Gu(t){const{point:e,line:n,...r}=t;return bt(r).length>1?r:r.type}function Ju(t){for(const e of["line","area","rule","trail"])t[e]&&(t={...t,[e]:rt(t[e],["point","line"])});return t}function $u(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 Vu(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 Yu{constructor(){this.name="path-overlay"}hasMatchingType(t,e){if(As(t)){const{mark:n,encoding:r}=t,i=qo(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!$u(i,e[i.type],r);case"area":return!!$u(i,e[i.type],r)||!!Vu(i,e[i.type])}}return!1}run(t,e,n){const{config:r}=e,{params:i,projection:o,mark:a,name:s,encoding:u,...c}=t,l=Ss(u,r),f=qo(a)?a:{type:a},d=$u(f,r[f.type],l),h="area"===f.type&&Vu(f,r[f.type]),p=[{name:s,...i?{params:i}:{},mark:Gu({..."area"===f.type&&void 0===f.opacity&&void 0===f.fillOpacity?{opacity:.7}:{},...f}),encoding:rt(l,["shape"])}],m=Xu(f,l);let g=l;if(m){const{fieldChannel:t,offset:e}=m;g={...l,[t]:{...l[t],...e?{stack:e}:{}}}}return g=rt(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({...c,layer:p},{...e,config:Ju(r)})}}function Ku(t,e){return e?Aa(t)?rc(t,e):tc(t,e):t}function Zu(t,e){return e?rc(t,e):t}function Qu(t,e,n){const r=e[t];return(i=r)&&!(0,I.HD)(i)&&"repeat"in i?r.repeat in n?{...e,[t]:n[r.repeat]}:void di(function(t){return'Unknown repeated value "'.concat(t,'".')}(r.repeat)):e;var i}function tc(t,e){if(void 0!==(t=Qu("field",t,e))){if(null===t)return null;if(Da(t)&&ba(t.sort)){const n=Qu("field",t.sort,e);t={...t,...n?{sort:n}:{}}}return t}}function ec(t,e){if(Na(t))return tc(t,e);{const n=Qu("datum",t,e);return n===t||n.type||(n.type="nominal"),n}}function nc(t,e){if(!ja(t)){if(Oa(t)){const n=ec(t.condition,e);if(n)return{...t,condition:n};{const{condition:e,...n}=t;return n}}return t}{const n=ec(t,e);if(n)return n;if(Ma(t))return{condition:t.condition}}}function rc(t,e){const n={};for(const r in t)if((0,I.nr)(t,r)){const i=t[r];if((0,I.kJ)(i))n[r]=i.map((t=>nc(t,e))).filter((t=>t));else{const t=nc(i,e);void 0!==t&&(n[r]=t)}}return n}class ic{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(As(t)){const{encoding:e,mark:n}=t;if("line"===n||qo(n)&&"line"===n.type)for(const t of Xe){const n=e[Je(t)];if(e[t]&&(Na(n)&&!er(n.bin)||za(n)))return!0}}return!1}run(t,e,n){const{encoding:r,mark:i}=t;var o,a;return di((o=!!r.x2,a=!!r.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)(i)?{...i,type:"rule"}:"rule"},e)}}function oc(t){let{parentEncoding:e,encoding:n={},layer:r}=t,i={};if(e){const t=new Set([...bt(e),...bt(n)]);for(const o of t){const t=n[o],a=e[o];if(ja(t)){const e={...a,...t};i[o]=e}else Oa(t)?i[o]={...t,condition:{...a,...t.condition}}:t||null===t?i[o]=t:(r||Ia(a)||cr(a)||ja(a)||(0,I.kJ)(a))&&(i[o]=a)}}else i=n;return!i||yt(i)?void 0:i}function ac(t){const{parentProjection:e,projection:n}=t;return e&&n&&di(function(t){const{parentProjection:e,projection:n}=t;return"Layer's shared projection ".concat(it(e)," is overridden by a child projection ").concat(it(n),".")}({parentProjection:e,projection:n})),null!==n&&void 0!==n?n:e}function sc(t){return"filter"in t}function uc(t){return void 0!==(null===t||void 0===t?void 0:t.stop)}function cc(t){return"lookup"in t}function lc(t){return"pivot"in t}function fc(t){return"density"in t}function dc(t){return"quantile"in t}function hc(t){return"regression"in t}function pc(t){return"loess"in t}function mc(t){return"sample"in t}function gc(t){return"window"in t}function vc(t){return"joinaggregate"in t}function yc(t){return"flatten"in t}function bc(t){return"calculate"in t}function xc(t){return"bin"in t}function Ac(t){return"impute"in t}function _c(t){return"timeUnit"in t}function wc(t){return"aggregate"in t}function Ec(t){return"stack"in t}function Dc(t){return"fold"in t}function Fc(t,e){const{transform:n,...r}=t;if(n){const t=n.map((t=>{if(sc(t))return{filter:Sc(t,e)};if(xc(t)&&nr(t.bin))return{...t,bin:kc(t.bin)};if(cc(t)){const{selection:e,...n}=t.from;return e?{...t,from:{param:e,...n}}:t}return t}));return{...r,transform:t}}return t}function Cc(t,e){var n,r;const i=tt(t);if(Na(i)&&nr(i.bin)&&(i.bin=kc(i.bin)),qa(i)&&null!==(n=i.scale)&&void 0!==n&&null!==(r=n.domain)&&void 0!==r&&r.selection){const{selection:t,...e}=i.scale.domain;i.scale.domain={...e,...t?{param:t}:{}}}if(Ma(i))if((0,j.isArray)(i.condition))i.condition=i.condition.map((t=>{const{selection:n,param:r,test:i,...o}=t;return r?t:{...o,test:Sc(t,e)}}));else{const{selection:t,param:n,test:r,...o}=Cc(i.condition,e);i.condition=n?i.condition:{...o,test:Sc(i.condition,e)}}return i}function kc(t){const e=t.extent;if(null!==e&&void 0!==e&&e.selection){const{selection:n,...r}=e;return{...t,extent:{...r,param:n}}}return t}function Sc(t,e){const n=t=>Z(t,(t=>{var n,r,i;const o={param:t,empty:null===(n=e.emptySelections[t])||void 0===n||n};return null!==(r=(i=e.selectionPredicates)[t])&&void 0!==r||(i[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 Mc extends ju{map(t,e){var n;const r=null!==(n=e.selections)&&void 0!==n?n:[];if(t.params&&!As(t)){const e=[];for(const n of t.params)hu(n)?r.push(n):e.push(n);t.params=e}return e.selections=r,super.map(t,e)}mapUnit(t,e){var n;const r=e.selections;if(!r||!r.length)return t;const i=(null!==(n=e.path)&&void 0!==n?n:[]).concat(t.name),o=[];for(const a of r)if(a.views&&a.views.length)for(const e of a.views)((0,j.isString)(e)&&(e===t.name||i.includes(e))||(0,j.isArray)(e)&&e.map((t=>i.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 Gb of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=Mc.prototype[Gb];Mc.prototype[Gb]=function(e,n){return t.call(this,e,Bc(e,n))}}function Bc(t,e){var n;return t.name?{...e,path:(null!==(n=e.path)&&void 0!==n?n:[]).concat(t.name)}:e}function Oc(t,e){void 0===e&&(e=Ou(t.config));const n=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={config:e};return zc.map(Nc.map(Tc.map(t,n),n),n)}(t,e),{width:r,height:i}=t,o=function(t,e,n){let{width:r,height:i}=e;const o=As(t)||Lu(t),a={};o?"container"==r&&"container"==i?(a.type="fit",a.contains="padding"):"container"==r?(a.type="fit-x",a.contains="padding"):"container"==i&&(a.type="fit-y",a.contains="padding"):("container"==r&&(di(Nr("width")),r=void 0),"container"==i&&(di(Nr("height")),i=void 0));const s={type:"pad",...a,...n?Rc(n.autosize):{},...Rc(t.autosize)};"fit"!==s.type||o||(di(Or),s.type="pad");"container"==r&&"fit"!=s.type&&"fit-x"!=s.type&&di(Tr("width"));"container"==i&&"fit"!=s.type&&"fit-y"!=s.type&&di(Tr("height"));if(Q(s,{type:"pad"}))return;return s}(n,{width:r,height:i,autosize:t.autosize},e);return{...n,...o?{autosize:o}:{}}}const Nc=new class extends ju{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[Us,Xs,Ks,new Yu,new ic]}map(t,e){if(As(t)){const n=ws(t.encoding,qt),r=ws(t.encoding,Wt),i=ws(t.encoding,Ht);if(n||r||i)return this.mapFacetedUnit(t,e)}return super.map(t,e)}mapUnit(t,e){const{parentEncoding:n,parentProjection:r}=e,i=Zu(t.encoding,e.repeater),o={...t,...t.name?{name:[e.repeaterPrefix,t.name].filter((t=>t)).join("_")}:{},...i?{encoding:i}:{}};if(n||r)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:r,...i}=t,{row:o,column:a,layer:s}=n,{repeater:u={},repeaterPrefix:c=""}=e;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:s},spec:r}},e):{...i,layer:s.map((t=>{const n={...u,layer:t},i="".concat((r.name?"".concat(r.name,"_"):"")+c,"child__layer_").concat(wt(t)),o=this.mapLayerOrUnit(r,{...e,repeater:n,repeaterPrefix:i});return o.name=i,o}))}}mapNonLayerRepeat(t,e){var n;const{repeat:r,spec:i,data:o,...a}=t;!(0,I.kJ)(r)&&t.columns&&(t=rt(t,["columns"]),di(Ir("repeat")));const s=[],{repeater:u={},repeaterPrefix:c=""}=e,l=!(0,I.kJ)(r)&&r.row||[u?u.row:null],f=!(0,I.kJ)(r)&&r.column||[u?u.column:null],d=(0,I.kJ)(r)&&r||[u?u.repeat:null];for(const p of d)for(const t of l)for(const n of f){const o={repeat:p,row:t,column:n,layer:u.layer},a=(i.name?"".concat(i.name,"_"):"")+c+"child__"+((0,I.kJ)(r)?"".concat(wt(p)):(r.row?"row_".concat(wt(t)):"")+(r.column?"column_".concat(wt(n)):"")),l=this.map(i,{...e,repeater:o,repeaterPrefix:a});l.name=a,s.push(rt(l,["data"]))}const h=(0,I.kJ)(r)?t.columns:r.column?r.column.length:1;return{data:null!==(n=i.data)&&void 0!==n?n:o,align:"all",...a,columns:h,concat:s}}mapFacet(t,e){const{facet:n}=t;return Aa(n)&&t.columns&&(t=rt(t,["columns"]),di(Ir("facet"))),super.mapFacet(t,e)}mapUnitWithParentEncodingOrProjection(t,e){const{encoding:n,projection:r}=t,{parentEncoding:i,parentProjection:o,config:a}=e,s=ac({parentProjection:o,projection:r}),u=oc({parentEncoding:i,encoding:Zu(n,e.repeater)});return this.mapUnit({...t,...s?{projection:s}:{},...u?{encoding:u}:{}},{config:a})}mapFacetedUnit(t,e){const{row:n,column:r,facet:i,...o}=t.encoding,{mark:a,width:s,projection:u,height:c,view:l,params:f,encoding:d,...h}=t,{facetMapping:p,layout:m}=this.getFacetMappingAndLayout({row:n,column:r,facet:i},e),g=Zu(o,e.repeater);return this.mapFacet({...h,...m,facet:p,spec:{...s?{width:s}:{},...c?{height:c}:{},...l?{view:l}:{},...u?{projection:u}:{},mark:a,encoding:g,...f?{params:f}:{}}},e)}getFacetMappingAndLayout(t,e){const{row:n,column:r,facet:i}=t;if(n||r){i&&di((a=[...n?[qt]:[],...r?[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 r=t[n];if(r){const{align:t,center:i,spacing:a,columns:u,...c}=r;e[n]=c;for(const e of["align","center","spacing"]){var o;if(void 0!==r[e])null!==(o=s[e])&&void 0!==o||(s[e]={}),s[e][n]=r[e]}}}return{facetMapping:e,layout:s}}{const{align:t,center:n,spacing:r,columns:o,...a}=i;return{facetMapping:Ku(a,e.repeater),layout:{...t?{align:t}:{},...n?{center:n}:{},...r?{spacing:r}:{},...o?{columns:o}:{}}}}var a}mapLayer(t,e){let{parentEncoding:n,parentProjection:r,...i}=e;const{encoding:o,projection:a,...s}=t,u={...i,parentEncoding:oc({parentEncoding:n,encoding:o,layer:!0}),parentProjection:ac({parentProjection:r,projection:a})};return super.mapLayer({...s,...t.name?{name:[u.repeaterPrefix,t.name].filter((t=>t)).join("_")}:{}},u)}},Tc=new class extends ju{map(t,e){var n,r;return null!==(n=e.emptySelections)&&void 0!==n||(e.emptySelections={}),null!==(r=e.selectionPredicates)&&void 0!==r||(e.selectionPredicates={}),t=Fc(t,e),super.map(t,e)}mapLayerOrUnit(t,e){if((t=Fc(t,e)).encoding){const n={};for(const[r,i]of At(t.encoding))n[r]=Cc(i,e);t={...t,encoding:n}}return super.mapLayerOrUnit(t,e)}mapUnit(t,e){const{selection:n,...r}=t;return n?{...r,params:At(n).map((t=>{let[n,r]=t;const{init:i,bind:o,empty:a,...s}=r;"single"===s.type?(s.type="point",s.toggle=!1):"multi"===s.type&&(s.type="point"),e.emptySelections[n]="none"!==a;for(const c of xt(null!==(u=e.selectionPredicates[n])&&void 0!==u?u:{})){var u;c.empty="none"!==a}return{name:n,value:i,select:s,bind:o}}))}:t}},zc=new Mc;function Rc(t){return(0,I.HD)(t)?{type:t}:null!==t&&void 0!==t?t:{}}const Pc=["background","padding"];function Lc(t,e){const n={};for(const r of Pc)t&&void 0!==t[r]&&(n[r]=gr(t[r]));return e&&(n.params=t.params),n}class jc{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 jc(tt(this.explicit),tt(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return Tt(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:r}=e;void 0!==n&&this.set(t,n,r)}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:r}=e;void 0!==n[t]?this.set(t,n[t],!0):void 0!==r[t]&&this.set(t,r[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 Uc(t){return{explicit:!0,value:t}}function Ic(t){return{explicit:!1,value:t}}function qc(t){return(e,n,r,i)=>{const o=t(e.value,n.value);return o>0?e:o<0?n:Wc(e,n,r,i)}}function Wc(t,e,n,r){return t.explicit&&e.explicit&&di(function(t,e,n,r){return"Conflicting ".concat(e.toString(),' property "').concat(t.toString(),'" (').concat(it(n)," and ").concat(it(r),"). Using ").concat(it(n),".")}(n,r,t.value,e.value)),t}function Hc(t,e,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Wc;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:i(t,e,n,r)}class Xc extends jc{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 Gc(t){return"url"in t}function Jc(t){return"values"in t}function $c(t){return"name"in t&&!Gc(t)&&!Jc(t)&&!Vc(t)}function Vc(t){return t&&(Yc(t)||Kc(t)||Zc(t))}function Yc(t){return"sequence"in t}function Kc(t){return"sphere"in t}function Zc(t){return"graticule"in t}var Qc;!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"}(Qc||(Qc={}));var tl=n(77155);function el(t){const{signals:e,hasLegend:n,index:r,...i}=t;return i.field=Mt(i.field),i}function nl(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 r=t.map((t=>nl(t,e,n)));return e?"[".concat(r.join(", "),"]"):r}return hi(t)?n(e?bi(t):function(t){const e=yi(t,!0);return t.utc?+new Date(Date.UTC(...e)):+new Date(...e)}(t)):e?n(it(t)):t}function rl(t,e){for(const r of xt(null!==(n=t.component.selection)&&void 0!==n?n:{})){var n;const i=r.name;let o="".concat(i).concat(_f,", ").concat("global"===r.resolve?"true":"{unit: ".concat(Ff(t),"}"));for(const n of Df)n.defined(r)&&(n.signals&&(e=n.signals(t,r,e)),n.modifyExpr&&(o=n.modifyExpr(t,r,o)));e.push({name:i+wf,on:[{events:{signal:r.name+_f},update:"modify(".concat((0,I.m8)(r.name+Af),", ").concat(o,")")}]})}return al(e)}function il(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,tl.r)("mousemove","scope"),update:"isTuple(facet) ? facet : group(".concat(n,").datum")}]})}return al(e)}function ol(t,e){for(const r of xt(null!==(n=t.component.selection)&&void 0!==n?n:{})){var n;for(const n of Df)n.defined(r)&&n.marks&&(e=n.marks(t,r,e))}return e}function al(t){return t.map((t=>(t.on&&!t.on.length&&delete t.on,t)))}class sl{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)?di("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 r of this._children)r.parent=t;this._children=[],t.removeChild(this);const n=t.parent.removeChild(t);this._parent=e,e.addChild(this,n),t.parent=this}}class ul extends sl{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,r){super(t,e),this.type=n,this.refCounts=r,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(Rt())),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}class cl extends sl{clone(){return new cl(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:r}=e;if(r){const i=Ja(e,{forAs:!0});t[ot({as:i,field:n,timeUnit:r})]={as:i,field:n,timeUnit:r}}return t}),{});return yt(n)?null:new cl(t,n)}static makeFromTransform(t,e){const{timeUnit:n,...r}={...e},i={...r,timeUnit:ki(n)};return new cl(t,{[ot(i)]:i})}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,r]of At(this.formula))t.has(r.as)||(e[n]=r);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:r,timeUnit:i}=e,{unit:o,utc:a,...s}=ki(i);t.push({field:Mt(n),type:"timeunit",...o?{units:Ei(o)}:{},...a?{timezone:"utc"}:{},...s,as:[r,"".concat(r,"_end")]})}return t}}const ll="_tuple_fields";class fl{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 dl={defined:()=>!0,parse:(t,e,n)=>{var r;const i=e.name,o=null!==(r=e.project)&&void 0!==r?r:e.project=new fl,a={},s={},u=new Set,c=(t,e)=>{const n="visual"===e?t.channel:t.field;let r=wt("".concat(i,"_").concat(n));for(let o=1;u.has(r);o++)r=wt("".concat(i,"_").concat(n,"_").concat(o));return u.add(r),{[e]:r}},l=e.type,f=t.config.selection[l],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"===l)di('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){di(Lr(y,e.aggregate));continue}if(!n){di(Pr(y));continue}if(e.timeUnit){n=t.vgField(y);const r={timeUnit:e.timeUnit,as:n,field:e.field};s[ot(r)]=r}if(!a[n]){const r={field:n,channel:y,type:"interval"===l&&Ln(y)&&uo(t.getScaleComponent(y).get("type"))?"R":e.bin?"R-RE":"E",index:o.items.length};r.signals={...c(r,"data"),...c(r,"visual")},o.items.push(a[n]=r),o.hasField[n]=a[n],o.hasSelectionId=o.hasSelectionId||n===cu,ke(y)?(r.geoChannel=y,r.channel=Ce(y),o.hasChannel[r.channel]=a[n]):o.hasChannel[y]=a[n]}}else di(Pr(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={...c(t,"data")},o.items.push(t),o.hasField[y]=t,o.hasSelectionId=o.hasSelectionId||y===cu}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 cl(null,s))},signals:(t,e,n)=>{const r=e.name+ll;return n.filter((t=>t.name===r)).length>0||e.project.hasSelectionId?n:n.concat({name:r,value:e.project.items.map(el)})}},hl=dl,pl={defined:t=>"interval"===t.type&&"global"===t.resolve&&t.bind&&"scales"===t.bind,parse:(t,e)=>{const n=e.scales=[];for(const r of e.project.items){const i=r.channel;if(!Ln(i))continue;const o=t.getScaleComponent(i),a=o?o.get("type"):void 0;o&&uo(a)?(o.set("selectionExtent",{param:e.name,field:r.field},!0),n.push(r)):di("Scale bindings are currently only supported for scales with unbinned, continuous domains.")}},topLevelSignals:(t,e,n)=>{const r=e.scales.filter((t=>0===n.filter((e=>e.name===t.signals.data)).length));if(!t.parent||vl(t)||0===r.length)return n;const i=n.filter((t=>t.name===e.name))[0];let o=i.update;if(o.indexOf(Ef)>=0)i.update="{".concat(r.map((t=>"".concat((0,I.m8)(Mt(t.field)),": ").concat(t.signals.data))).join(", "),"}");else{for(const t of r){const e="".concat((0,I.m8)(Mt(t.field)),": ").concat(t.signals.data);o.includes(e)||(o="".concat(o.substring(0,o.length-1),", ").concat(e,"}"))}i.update=o}return n.concat(r.map((t=>({name:t.signals.data}))))},signals:(t,e,n)=>{if(t.parent&&!vl(t))for(const r of e.scales){const t=n.filter((t=>t.name===r.signals.data))[0];t.push="outer",delete t.value,delete t.update}return n}},ml=pl;function gl(t,e){const n=(0,I.m8)(t.scaleName(e));return"domain(".concat(n,")")}function vl(t){var e;return t.parent&&Zm(t.parent)&&(null!==(e=!t.parent.parent)&&void 0!==e?e:vl(t.parent.parent))}const yl="_brush",bl="_scale_trigger",xl="geo_interval_init_tick",Al="_init",_l={defined:t=>"interval"===t.type,parse:(t,e,n)=>{var r;if(t.hasProjection){const t={...(0,j.isObject)(n.select)?n.select:{}};t.fields=[cu],t.encodings||(t.encodings=n.value?bt(n.value):[ne,ee]),n.select={type:"interval",...t}}if(e.translate&&!ml.defined(e)){const t="!event.item || event.item.mark.name !== ".concat((0,I.m8)(e.name+yl));for(const n of e.events){var i;if(!n.between){di("".concat(n," is not an ordered event stream for interval selections."));continue}const e=(0,I.IX)(null!==(i=(r=n.between[0]).filter)&&void 0!==i?i:r.filter=[]);e.indexOf(t)<0&&e.push(t)}}},signals:(t,e,n)=>{const r=e.name,i=r+_f,o=xt(e.project.hasChannel).filter((t=>t.channel===Xt||t.channel===Gt)),a=e.init?e.init[0]:null;if(n.push(...o.reduce(((n,r)=>n.concat(function(t,e,n,r){const i=!t.hasProjection,o=n.channel,a=n.signals.visual,s=(0,I.m8)(i?t.scaleName(o):t.projectionName()),u=t=>"scale(".concat(s,", ").concat(t,")"),c=t.getSizeSignalRef(o===Xt?"width":"height").signal,l="".concat(o,"(unit)"),f=e.events.reduce(((t,e)=>[...t,{events:e.between[0],update:"[".concat(l,", ").concat(l,"]")},{events:e,update:"[".concat(a,"[0], clamp(").concat(l,", 0, ").concat(c,")]")}]),[]);if(i){const i=n.signals.data,c=ml.defined(e),l=t.getScaleComponent(o),d=l?l.get("type"):void 0,h=r?{init:nl(r,!0,u)}:{value:[]};return f.push({events:{signal:e.name+bl},update:uo(d)?"[".concat(u("".concat(i,"[0]")),", ").concat(u("".concat(i,"[1]")),"]"):"[0, 0]"}),c?[{name:i,on:[]}]:[{name:a,...h,on:f},{name:i,...r?{init:nl(r)}:{},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+Al,i=r?{init:"[".concat(n,"[0][").concat(t,"], ").concat(n,"[1][").concat(t,"]]")}:{value:[]};return[{name:a,...i,on:f}]}}(t,e,r,a&&a[r.index]))),[])),t.hasProjection){const s=(0,I.m8)(t.projectionName()),u=t.projectionName()+"_center",{x:c,y:l}=e.project.hasChannel,f=c&&c.signals.visual,d=l&&l.signals.visual,h=c?a&&a[c.index]:"".concat(u,"[0]"),p=l?a&&a[l.index]:"".concat(u,"[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:r+Al,init:"[scale(".concat(s,", [").concat(c?h[0]:h,", ").concat(l?p[0]:p,"]), ")+"scale(".concat(s,", [").concat(c?h[1]:h,", ").concat(l?p[1]:p,"])]")}),!c||!l)){n.find((t=>t.name===u))||n.unshift({name:u,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(Ff(t),"}"),b="vlSelectionTuples(".concat(v,", ").concat(y,")"),x=o.map((t=>t.signals.visual));return n.concat({name:i,on:[{events:[...x.length?[{signal:x.join(" || ")}]:[],...a?[{signal:xl}]:[]],update:b}]})}{if(!ml.defined(e)){const e=r+bl,i=o.map((e=>{const n=e.channel,{data:r,visual:i}=e.signals,o=(0,I.m8)(t.scaleName(n)),a=uo(t.getScaleComponent(n).get("type"))?"+":"";return"(!isArray(".concat(r,") || ")+"(".concat(a,"invert(").concat(o,", ").concat(i,")[0] === ").concat(a).concat(r,"[0] && ")+"".concat(a,"invert(").concat(o,", ").concat(i,")[1] === ").concat(a).concat(r,"[1]))")}));i.length&&n.push({name:e,value:{},on:[{events:o.map((e=>({scale:t.scaleName(e.channel)}))),update:i.join(" && ")+" ? ".concat(e," : {}")}]})}const s=o.map((t=>t.signals.data)),u="unit: ".concat(Ff(t),", fields: ").concat(r+ll,", values");return n.concat({name:i,...a?{init:"{".concat(u,": ").concat(nl(a),"}")}:{},...s.length?{on:[{events:[{signal:s.join(" || ")}],update:"".concat(s.join(" && ")," ? {").concat(u,": [").concat(s,"]} : null")}]}:{}})}},topLevelSignals:(t,e,n)=>{if(Vm(t)&&t.hasProjection&&e.init){n.filter((t=>t.name===xl)).length||n.unshift({name:xl,value:null,on:[{events:"timer{1}",update:"".concat(xl," === null ? {} : ").concat(xl)}]})}return n},marks:(t,e,n)=>{const r=e.name,{x:i,y:o}=e.project.hasChannel,a=null===i||void 0===i?void 0:i.signals.visual,s=null===o||void 0===o?void 0:o.signals.visual,u="data(".concat((0,I.m8)(e.name+Af),")");if(ml.defined(e)||!i&&!o)return n;const c={x:void 0!==i?{signal:"".concat(a,"[0]")}:{value:0},y:void 0!==o?{signal:"".concat(s,"[0]")}:{value:0},x2:void 0!==i?{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(c))c[m]=[{test:"".concat(u,".length && ").concat(u,"[0].unit === ").concat(Ff(t)),...c[m]},{value:0}];const{fill:l,fillOpacity:f,cursor:d,...h}=e.mark,p=bt(h).reduce(((t,e)=>(t[e]=[{test:[void 0!==i&&"".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(r+yl,"_bg"),type:"rect",clip:!0,encode:{enter:{fill:{value:l},fillOpacity:{value:f}},update:c}},...n,{name:r+yl,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...c,...p}}}]}},wl=_l;const El={defined:t=>"point"===t.type,signals:(t,e,n)=>{var r;const i=e.name,o=i+ll,a=e.project,s="(item().isVoronoi ? datum.datum : datum)",u=xt(null!==(r=t.component.selection)&&void 0!==r?r:{}).reduce(((t,e)=>"interval"===e.type?t.concat(e.name+yl):t),[]).map((t=>"indexof(item().mark.name, '".concat(t,"') < 0"))).join(" && "),c="datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0".concat(u?" && ".concat(u):"");let l="unit: ".concat(Ff(t),", ");if(e.project.hasSelectionId)l+="".concat(cu,": ").concat(s,"[").concat((0,I.m8)(cu),"]");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(", ");l+="fields: ".concat(o,", values: [").concat(e,"]")}const f=e.events;return n.concat([{name:i+_f,on:f?[{events:f,update:"".concat(c," ? {").concat(l,"} : null"),force:!0}]:[]}])}},Dl=El;function Fl(t,e,n,r){const i=Ma(e)&&e.condition,o=r(e);if(i){return{[n]:[...(0,I.IX)(i).map((e=>{const n=r(e);if(function(t){return t.param}(e)){const{param:r,empty:i}=e;return{test:yh(t,{param:r,empty:i}),...n}}return{test:xh(t,e.test),...n}})),...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function Cl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";const n=t.encoding[e];return Fl(t,n,e,(e=>kl(e,t.config)))}function kl(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"datum";if(t){if(Ia(t))return yr(t.value);if(ja(t)){const{format:r,formatType:i}=es(t);return aa({fieldOrDatumDef:t,format:r,formatType:i,expr:n,config:e})}}}function Sl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{encoding:n,markDef:r,config:i,stack:o}=t,a=n.tooltip;if((0,I.kJ)(a))return{tooltip:Bl({tooltip:a},o,i,e)};{const s=e.reactiveGeom?"datum.datum":"datum";return Fl(t,a,"tooltip",(t=>{const a=kl(t,i,s);if(a)return a;if(null===t)return;let u=wr("tooltip",r,i);return!0===u&&(u={content:"encoding"}),(0,I.HD)(u)?{value:u}:(0,I.Kn)(u)?cr(u)?u:"encoding"===u.content?Bl(n,o,i,e):{signal:s}:void 0}))}}function Ml(t,e,n){let{reactiveGeom:r}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i={...n,...n.tooltipFormat},o={},a=r?"datum.datum":"datum",s=[];function u(n,r){var u;const c=Je(r),l=Ua(n)?n:{...n,type:t[c].type},f=l.title||ts(l,i),d=(0,I.IX)(f).join(", ");let h;if(xn(r)){const e="x"===r?"x2":"y2",n=ns(t[e]);if(er(l.bin)&&n){const t=Ja(l,{expr:a}),r=Ja(n,{expr:a}),{format:s,formatType:u}=es(l);h=pa(t,r,s,u,i),o[e]=!0}}if((xn(r)||r===Qt||r===Kt)&&e&&e.fieldChannel===r&&"normalize"===e.offset){const{format:t,formatType:e}=es(l);h=aa({fieldOrDatumDef:l,format:t,formatType:e,expr:a,config:i,normalizeStack:!0}).signal}null!==(u=h)&&void 0!==u||(h=kl(l,i,a).signal),s.push({channel:r,key:d,value:h})}Ms(t,((t,e)=>{Na(t)?u(t,e):Ba(t)&&u(t.condition,e)}));const c={};for(const{channel:l,key:f,value:d}of s)o[l]||c[f]||(c[f]=d);return c}function Bl(t,e,n){let{reactiveGeom:r}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Ml(t,e,n,{reactiveGeom:r}),o=At(i).map((t=>{let[e,n]=t;return'"'.concat(e,'": ').concat(n)}));return o.length>0?{signal:"{".concat(o.join(", "),"}")}:void 0}function Ol(t){const{markDef:e,config:n}=t,r=wr("aria",e,n);return!1===r?{}:{...r?{aria:r}:{},...Nl(t),...Tl(t)}}function Nl(t){const{mark:e,markDef:n,config:r}=t;if(!1===r.aria)return{};const i=wr("ariaRoleDescription",n,r);return null!=i?{ariaRoleDescription:{value:i}}:e in hr?{}:{ariaRoleDescription:{value:e}}}function Tl(t){const{encoding:e,markDef:n,config:r,stack:i}=t,o=e.description;if(o)return Fl(t,o,"description",(e=>kl(e,t.config)));const a=wr("description",n,r);if(null!=a)return{description:yr(a)};if(!1===r.aria)return{};const s=Ml(e,i,r);return yt(s)?void 0:{description:{signal:At(s).map(((t,e)=>{let[n,r]=t;return'"'.concat(e>0?"; ":"").concat(n,': " + (').concat(r,")")})).join(" + ")}}}function zl(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{markDef:r,encoding:i,config:o}=e,{vgChannel:a}=n;let{defaultRef:s,defaultValue:u}=n;var c;void 0===s&&(null!==(c=u)&&void 0!==c||(u=wr(t,r,o,{vgChannel:a,ignoreVgConfig:!0})),void 0!==u&&(s=yr(u)));const l=i[t];return Fl(e,l,null!==a&&void 0!==a?a:t,(n=>ea({channel:t,channelDef:n,markDef:r,config:o,scaleName:e.scaleName(t),scale:e.getScaleComponent(t),stack:null,defaultRef:s})))}function Rl(t){var e,n,r,i;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{filled:void 0};const{markDef:a,encoding:s,config:u}=t,{type:c}=a,l=null!==(e=o.filled)&&void 0!==e?e:wr("filled",a,u),f=st(["bar","point","circle","square","geoshape"],c)?"transparent":void 0,d=null!==(n=null!==(r=wr(!0===l?"color":void 0,a,u,{vgChannel:"fill"}))&&void 0!==r?r:u.mark[!0===l&&"color"])&&void 0!==n?n:f,h=null!==(i=wr(!1===l?"color":void 0,a,u,{vgChannel:"stroke"}))&&void 0!==i?i:u.mark[!1===l&&"color"],p=l?"fill":"stroke",m={...d?{fill:yr(d)}:{},...h?{stroke:yr(h)}:{}};return a.color&&(l?a.fill:a.stroke)&&di(Jr("property",{fill:"fill"in a,stroke:"stroke"in a})),{...m,...zl("color",t,{vgChannel:p,defaultValue:l?d:h}),...zl("fill",t,{defaultValue:s.fill?d:void 0}),...zl("stroke",t,{defaultValue:s.stroke?h:void 0})}}function Pl(t){const{encoding:e,mark:n}=t,r=e.order;return!jo(n)&&Ia(r)?Fl(t,r,"zindex",(t=>yr(t.value))):{}}function Ll(t){let{channel:e,markDef:n,encoding:r={},model:i,bandPosition:o}=t;const a="".concat(e,"Offset"),s=n[a],u=r[a];if(("xOffset"===a||"yOffset"===a)&&u){return{offsetType:"encoding",offset:ea({channel:a,channelDef:u,markDef:n,config:null===i||void 0===i?void 0:i.config,scaleName:i.scaleName(a),scale:i.getScaleComponent(a),stack:null,defaultRef:yr(s),bandPosition:o})}}const c=n[a];return c?{offsetType:"visual",offset:c}:{}}function jl(t,e,n){let{defaultPos:r,vgChannel:i}=n;const{encoding:o,markDef:a,config:s,stack:u}=e,c=o[t],l=o[Ve(t)],f=e.scaleName(t),d=e.getScaleComponent(t),{offset:h,offsetType:p}=Ll({channel:t,markDef:a,encoding:o,model:e,bandPosition:.5}),m=Ul({model:e,defaultPos:r,channel:t,scaleName:f,scale:d}),g=!c&&xn(t)&&(o.latitude||o.longitude)?{field:e.getName(t)}:function(t){const{channel:e,channelDef:n,scaleName:r,stack:i,offset:o,markDef:a}=t;if(ja(n)&&i&&e===i.fieldChannel){if(Na(n)){let t=n.bandPosition;if(void 0!==t||"text"!==a.type||"radius"!==e&&"theta"!==e||(t=.5),void 0!==t)return ta({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:t,offset:o})}return Qo(n,r,{suffix:"end"},{offset:o})}return Yo(t)}({channel:t,channelDef:c,channel2Def:l,markDef:a,config:s,scaleName:f,scale:d,stack:u,offset:h,defaultRef:m,bandPosition:"encoding"===p?0:void 0});return g?{[i||t]:g}:void 0}function Ul(t){let{model:e,defaultPos:n,channel:r,scaleName:i,scale:o}=t;const{markDef:a,config:s}=e;return()=>{const t=Je(r),u=$e(r),c=wr(r,a,s,{vgChannel:u});if(void 0!==c)return na(r,c);switch(n){case"zeroOrMin":case"zeroOrMax":if(i){const t=o.get("type");if(st([Yi.LOG,Yi.TIME,Yi.UTC],t));else if(o.domainDefinitelyIncludesZero())return{scale:i,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(r)],mult:.5}}}}const Il={left:"x",center:"xc",right:"x2"},ql={top:"y",middle:"yc",bottom:"y2"};function Wl(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle";if("radius"===t||"theta"===t)return $e(t);const i="x"===t?"align":"baseline",o=wr(i,e,n);let a;return cr(o)?(di(function(t){return"The ".concat(t," for range marks cannot be an expression")}(i)),a=void 0):a=o,"x"===t?Il[a||("top"===r?"left":"center")]:ql[a||r]}function Hl(t,e,n){let{defaultPos:r,defaultPos2:i,range:o}=n;return o?Xl(t,e,{defaultPos:r,defaultPos2:i}):jl(t,e,{defaultPos:r})}function Xl(t,e,n){let{defaultPos:r,defaultPos2:i}=n;const{markDef:o,config:a}=e,s=Ve(t),u=Ye(t),c=function(t,e,n){const{encoding:r,mark:i,markDef:o,stack:a,config:s}=t,u=Je(n),c=Ye(n),l=$e(n),f=r[u],d=t.scaleName(u),h=t.getScaleComponent(u),{offset:p}=Ll(n in r||n in o?{channel:n,markDef:o,encoding:r,model:t}:{channel:u,markDef:o,encoding:r,model:t});if(!f&&("x2"===n||"y2"===n)&&(r.latitude||r.longitude)){const e=Ye(n),r=t.markDef[e];return null!=r?{[e]:{value:r}}:{[l]:{field:t.getName(n)}}}const m=function(t){let{channel:e,channelDef:n,channel2Def:r,markDef:i,config:o,scaleName:a,scale:s,stack:u,offset:c,defaultRef:l}=t;if(ja(n)&&u&&e.charAt(0)===u.fieldChannel.charAt(0))return Qo(n,a,{suffix:"start"},{offset:c});return Yo({channel:e,channelDef:r,scaleName:a,scale:s,stack:u,markDef:i,config:o,offset:c,defaultRef:l})}({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});if(void 0!==m)return{[l]:m};return Gl(n,o)||Gl(n,{[n]:Dr(n,o,s.style),[c]:Dr(c,o,s.style)})||Gl(n,s[i])||Gl(n,s.mark)||{[l]:Ul({model:t,defaultPos:e,channel:n,scaleName:d,scale:h})()}}(e,i,s);return{...jl(t,e,{defaultPos:r,vgChannel:c[u]?Wl(t,o,a):$e(t)}),...c}}function Gl(t,e){const n=Ye(t),r=$e(t);if(void 0!==e[r])return{[r]:na(t,e[r])};if(void 0!==e[t])return{[r]:na(t,e[t])};if(e[n]){const r=e[n];if(!Go(r))return{[n]:na(t,r)};di(function(t){return"Position range does not support relative band size for ".concat(t,".")}(n))}}function Jl(t,e){var n,r;const{config:i,encoding:o,markDef:a}=t,s=a.type,u=Ve(e),c=Ye(e),l=o[e],f=o[u],d=t.getScaleComponent(e),h=d?d.get("type"):void 0,p=a.orient,m=null!==(n=null!==(r=o[c])&&void 0!==r?r:o.size)&&void 0!==n?n:wr("size",a,i,{vgChannel:c}),g=Ke(e),v="bar"===s&&("x"===e?"vertical"===p:"horizontal"===p);return!Na(l)||!(tr(l.bin)||er(l.bin)||l.timeUnit&&!f)||m&&!Go(m)||o[g]||so(h)?(ja(l)&&so(h)||v)&&!f?function(t,e,n){const{markDef:r,encoding:i,config:o,stack:a}=n,s=r.orient,u=n.scaleName(e),c=n.getScaleComponent(e),l=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;(i.size||r.size)&&(m?g=zl("size",n,{vgChannel:l,defaultRef:yr(r.size)}):di(function(t){return'Cannot apply size to non-oriented mark "'.concat(t,'".')}(r.type)));const v=!!g,y=Ca({channel:e,fieldDef:t,markDef:r,config:o,scaleType:null===c||void 0===c?void 0:c.get("type"),useVlSizeChannel:m});g=g||{[l]:$l(l,h||u,p||c,o,y,!!t,r.type)};const b="band"===(null===c||void 0===c?void 0:c.get("type"))&&Go(y)&&!v?"top":"middle",x=Wl(e,r,o,b),A="xc"===x||"yc"===x,{offset:_,offsetType:w}=Ll({channel:e,markDef:r,encoding:i,model:n,bandPosition:A?.5:0}),E=Yo({channel:e,channelDef:t,markDef:r,config:o,scaleName:u,scale:c,stack:a,offset:_,defaultRef:Ul({model:n,defaultPos:"mid",channel:e,scaleName:u,scale:c}),bandPosition:A?"encoding"===w?0:.5:cr(y)?{signal:"(1-".concat(y,")/2")}:Go(y)?(1-y.band)/2:0});if(l)return{[x]:E,...g};{const t=$e(f),e=g[l],n=_?{...e,offset:_}:e;return{[x]:E,[t]:(0,I.kJ)(E)?[E[0],{...E[1],offset:n}]:{...E,offset:n}}}}(l,e,t):Xl(e,t,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"}):function(t){var e,n,r;let{fieldDef:i,fieldDef2:o,channel:a,model:s}=t;const{config:u,markDef:c,encoding:l}=s,f=s.getScaleComponent(a),d=s.scaleName(a),h=f?f.get("type"):void 0,p=f.get("reverse"),m=Ca({channel:a,fieldDef:i,markDef:c,config:u,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!==(r=wr("binSpacing",c,u))&&void 0!==r?r:0,b=Ve(a),x=$e(a),A=$e(b),{offset:_}=Ll({channel:a,markDef:c,encoding:l,model:s,bandPosition:0}),w=cr(m)?{signal:"(1-".concat(m.signal,")/2")}:Go(m)?(1-m.band)/2:.5;if(tr(i.bin)||i.timeUnit)return{[A]:Yl({fieldDef:i,scaleName:d,bandPosition:w,offset:Vl(b,y,p,v,_)}),[x]:Yl({fieldDef:i,scaleName:d,bandPosition:cr(w)?{signal:"1-".concat(w.signal)}:1-w,offset:Vl(a,y,p,v,_)})};if(er(i.bin)){const t=Qo(i,d,{},{offset:Vl(b,y,p,v,_)});if(Na(o))return{[A]:t,[x]:Qo(o,d,{},{offset:Vl(a,y,p,v,_)})};if(nr(i.bin)&&i.bin.step)return{[A]:t,[x]:{signal:'scale("'.concat(d,'", ').concat(Ja(i,{expr:"datum"})," + ").concat(i.bin.step,")"),offset:Vl(a,y,p,v,_)}}}return void di(ui(b))}({fieldDef:l,fieldDef2:f,channel:e,model:t})}function $l(t,e,n,r,i,o,a){if(Go(i)){if(!n)return{mult:i.band,field:{group:t}};{const t=n.get("type");if("band"===t){let t="bandwidth('".concat(e,"')");return 1!==i.band&&(t="".concat(i.band," * ").concat(t)),{signal:"max(0.25, ".concat(t,")")}}1!==i.band&&(di(function(t){return"Cannot use the relative band size with ".concat(t," scale.")}(t)),i=void 0)}}else{if(cr(i))return i;if(i)return{value:i}}if(n){const t=n.get("range");if(lr(t)&&(0,I.hj)(t.step))return{value:t.step-2}}if(!o){const{bandPaddingInner:e,barBandPaddingInner:n,rectBandPaddingInner:i}=r.scale,o=Tt(e,"bar"===a?n:i);if(cr(o))return{signal:"(1 - (".concat(o.signal,")) * ").concat(t)};if((0,I.hj)(o))return{signal:"".concat(1-o," * ").concat(t)};if(or(o))return{signal:"(1 - (".concat(o.expr,")) * ").concat(t)}}return{value:wu(r.view,t)-2}}function Vl(t,e,n,r,i){if(De(t))return 0;const o="x"===t||"y2"===t?-e/2:e/2;if(cr(n)||cr(i)||cr(r)){const t=xr(n),e=xr(i),a=xr(r);return{signal:(a?"".concat(a," + "):"")+(t?"(".concat(t," ? -1 : 1) * "):"")+(e?"(".concat(e," + ").concat(o,")"):o)}}return i=i||0,r+(n?-i-o:+i+o)}function Yl(t){let{fieldDef:e,scaleName:n,bandPosition:r,offset:i}=t;return ta({scaleName:n,fieldOrDatumDef:e,bandPosition:r,offset:i})}const Kl=new Set(["aria","width","height"]);function Zl(t,e){const{fill:n,stroke:r}="include"===e.color?Rl(t):{};return{...tf(t.markDef,e),...Ql(t,"fill",n),...Ql(t,"stroke",r),...zl("opacity",t),...zl("fillOpacity",t),...zl("strokeOpacity",t),...zl("strokeWidth",t),...zl("strokeDash",t),...Pl(t),...Sl(t),...Cl(t,"href"),...Ol(t)}}function Ql(t,e,n){const{config:r,mark:i,markDef:o}=t;if("hide"===wr("invalid",o,r)&&n&&!jo(i)){const r=function(t,e){let{invalid:n=!1,channels:r}=e;const i=r.reduce(((e,n)=>{const r=t.getScaleComponent(n);if(r){const i=r.get("type"),o=t.vgField(n,{expr:"datum"});o&&uo(i)&&(e[o]=!0)}return e}),{}),o=bt(i);if(o.length>0){const t=n?"||":"&&";return o.map((t=>Zo(t,n))).join(" ".concat(t," "))}return}(t,{invalid:!0,channels:Pn});if(r)return{[e]:[{test:r,value:null},...(0,I.IX)(n)]}}return n?{[e]:n}:{}}function tf(t,e){return dr.reduce(((n,r)=>(Kl.has(r)||void 0===t[r]||"ignore"===e[r]||(n[r]=yr(t[r])),n)),{})}function ef(t){const{config:e,markDef:n}=t;if(wr("invalid",n,e)){const e=function(t,e){let{invalid:n=!1,channels:r}=e;const i=r.reduce(((e,n)=>{const r=t.getScaleComponent(n);if(r){var i;const o=r.get("type"),a=t.vgField(n,{expr:"datum",binSuffix:null!==(i=t.stack)&&void 0!==i&&i.impute?"mid":void 0});a&&uo(o)&&(e[a]=!0)}return e}),{}),o=bt(i);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]:yr(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:r,y:i}=e.project.hasChannel,o=t.mark;if(jo(o))return di('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},...Sl(t,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]};let s=0,u=!1;return n.forEach(((e,n)=>{var r;const i=null!==(r=e.name)&&void 0!==r?r:"";i===t.component.mark[0].name?s=n:i.indexOf(rf)>=0&&(u=!0)})),u||n.splice(s+1,0,a),n}},af=of,sf={defined:t=>"point"===t.type&&"global"===t.resolve&&t.bind&&"scales"!==t.bind&&!fu(t.bind),parse:(t,e,n)=>kf(e,n),topLevelSignals:(t,e,n)=>{const r=e.name,i=e.project,o=e.bind,a=e.init&&e.init[0],s=af.defined(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach(((t,i)=>{const u=wt("".concat(r,"_").concat(t.field));var c,l;n.filter((t=>t.name===u)).length||n.unshift({name:u,...a?{init:nl(a[i])}:{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!==(c=null!==(l=o[t.field])&&void 0!==l?l:o[t.channel])&&void 0!==c?c:o})})),n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.filter((t=>t.name===r+_f))[0],a=r+ll,s=i.items.map((t=>wt("".concat(r,"_").concat(t.field)))),u=s.map((t=>"".concat(t," !== null"))).join(" && ");return s.length&&(o.update="".concat(u," ? {fields: ").concat(a,", values: [").concat(s.join(", "),"]} : null")),delete o.value,delete o.on,n}},uf=sf,cf="_toggle",lf={defined:t=>"point"===t.type&&!!t.toggle,signals:(t,e,n)=>n.concat({name:e.name+cf,value:!1,on:[{events:e.events,update:e.toggle}]}),modifyExpr:(t,e)=>{const n=e.name+_f,r=e.name+cf;return"".concat(r," ? null : ").concat(n,", ")+("global"===e.resolve?"".concat(r," ? null : true, "):"".concat(r," ? null : {unit: ").concat(Ff(t),"}, "))+"".concat(r," ? ").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,tl.r)(e.clear,"view"):e.clear)},topLevelSignals:(t,e,n)=>{if(uf.defined(e))for(const r of e.project.items){const t=n.findIndex((t=>t.name===wt("".concat(e.name,"_").concat(r.field))));-1!==t&&n[t].on.push({events:e.clear,update:"null"})}return n},signals:(t,e,n)=>{function r(t,r){-1!==t&&n[t].on&&n[t].on.push({events:e.clear,update:r})}if("interval"===e.type)for(const i of e.project.items){const t=n.findIndex((t=>t.name===i.signals.visual));if(r(t,"[0, 0]"),-1===t){r(n.findIndex((t=>t.name===i.signals.data)),"null")}}else{let t=n.findIndex((t=>t.name===e.name+_f));r(t,"null"),lf.defined(e)&&(t=n.findIndex((t=>t.name===e.name+cf)),r(t,"false"))}return n}},df={defined:t=>{const e="global"===t.resolve&&t.bind&&fu(t.bind),n=1===t.project.items.length&&t.project.items[0].field!==cu;return e&&!n&&di("Legend bindings are only supported for selections over an individual field or encoding channel."),e&&n},parse:(t,e,n)=>{const r=tt(n);if(r.select=(0,I.HD)(r.select)?{type:r.select,toggle:e.toggle}:{...r.select,toggle:e.toggle},kf(e,r),(0,j.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 i;n.filter=(0,I.IX)(null!==(i=n.filter)&&void 0!==i?i:[]),n.filter.includes(t)||n.filter.push(t)}}const o=du(e.bind)?e.bind.legend:"click",a=(0,I.HD)(o)?(0,tl.r)(o,"view"):(0,I.IX)(o);e.bind={legend:{merge:a}}},topLevelSignals:(t,e,n)=>{const r=e.name,i=du(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(wt(a.field),"_legend"),s="".concat(r,"_").concat(t);if(0===n.filter((t=>t.name===s)).length){const r=i.merge.map(o("".concat(t,"_symbols"))).concat(i.merge.map(o("".concat(t,"_labels")))).concat(i.merge.map(o("".concat(t,"_entries"))));n.unshift({name:s,...e.init?{}:{value:null},on:[{events:r,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:"!event.item || !datum ? null : ".concat(s),force:!0}]})}}return n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.find((t=>t.name===r+_f)),a=r+ll,s=i.items.filter((t=>t.hasLegend)).map((t=>wt("".concat(r,"_").concat(wt(t.field),"_legend")))),u=s.map((t=>"".concat(t," !== null"))).join(" && "),c="".concat(u," ? {fields: ").concat(a,", values: [").concat(s.join(", "),"]} : null");e.events&&s.length>0?o.on.push({events:s.map((t=>({signal:t}))),update:c}):s.length>0&&(o.update=c,delete o.value,delete o.on);const l=n.find((t=>t.name===r+cf)),f=du(e.bind)&&e.bind.legend;return l&&(e.events?l.on.push({...l.on[0],events:f}):l.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 r=e.name,i=ml.defined(e),o=r+hf,{x:a,y:s}=e.project.hasChannel;let u=(0,tl.r)(e.translate,"scope");return i||(u=u.map((t=>(t.between[0].markname=r+yl,t)))),n.push({name:o,value:{},on:[{events:u.map((t=>t.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: ".concat(i?gl(t,Xt):"slice(".concat(a.signals.visual,")")):"")+(void 0!==s?", extent_y: ".concat(i?gl(t,Gt):"slice(".concat(s.signals.visual,")")):"")+"}"}]},{name:r+pf,value:{},on:[{events:u,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,r,i){var o,a;const s=e.name,u=s+hf,c=s+pf,l=n.channel,f=ml.defined(e),d=i.filter((t=>t.name===n.signals[f?"data":"visual"]))[0],h=t.getSizeSignalRef(r).signal,p=t.getScaleComponent(l),m=p&&p.get("type"),g=p&&p.get("reverse"),v=f?l===Xt?g?"":"-":g?"-":"":"",y="".concat(u,".extent_").concat(l),b="".concat(v).concat(c,".").concat(l," / ").concat(f?"".concat(h):"span(".concat(y,")")),x=f&&p?"log"===m?"panLog":"symlog"===m?"panSymlog":"pow"===m?"panPow":"panLinear":"panLinear",A=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):"":"",_="".concat(x,"(").concat(y,", ").concat(b).concat(A,")");d.on.push({events:{signal:c},update:f?_:"clampRange(".concat(_,", 0, ").concat(h,")")})}const vf="_zoom_anchor",yf="_zoom_delta",bf={defined:t=>"interval"===t.type&&t.zoom,signals:(t,e,n)=>{const r=e.name,i=ml.defined(e),o=r+yf,{x:a,y:s}=e.project.hasChannel,u=(0,I.m8)(t.scaleName(Xt)),c=(0,I.m8)(t.scaleName(Gt));let l=(0,tl.r)(e.zoom,"scope");return i||(l=l.map((t=>(t.markname=r+yl,t)))),n.push({name:r+vf,on:[{events:l,update:i?"{"+[u?"x: invert(".concat(u,", x(unit))"):"",c?"y: invert(".concat(c,", y(unit))"):""].filter((t=>t)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:l,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,r,i){var o,a;const s=e.name,u=n.channel,c=ml.defined(e),l=i.filter((t=>t.name===n.signals[c?"data":"visual"]))[0],f=t.getSizeSignalRef(r).signal,d=t.getScaleComponent(u),h=d&&d.get("type"),p=c?gl(t,u):l.name,m=s+yf,g="".concat(s).concat(vf,".").concat(u),v=c&&d?"log"===h?"zoomLog":"symlog"===h?"zoomSymlog":"pow"===h?"zoomPow":"zoomLinear":"zoomLinear",y=c?"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,")");l.on.push({events:{signal:m},update:c?b:"clampRange(".concat(b,", 0, ").concat(f,")")})}const Af="_store",_f="_tuple",wf="_modify",Ef="vlSelectionResolve",Df=[Dl,wl,hl,lf,uf,ml,df,ff,mf,bf,af];function Ff(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 r=function(t){let e=t.parent;for(;e&&!Ym(e);)e=e.parent;return e}(t);if(r){const{facet:t}=r;for(const e of Ne)t[e]&&(n+=" + '__facet_".concat(e,"_' + (facet[").concat((0,I.m8)(r.vgField(e)),"])"))}return n}function Cf(t){var e;return xt(null!==(e=t.component.selection)&&void 0!==e?e:{}).reduce(((t,e)=>t||e.project.hasSelectionId),!1)}function kf(t,e){!(0,j.isString)(e.select)&&e.select.on||delete t.events,!(0,j.isString)(e.select)&&e.select.clear||delete t.clear,!(0,j.isString)(e.select)&&e.select.toggle||delete t.toggle}const Sf="Property",Mf="ArrayExpression",Bf="BinaryExpression",Of="CallExpression",Nf="ConditionalExpression",Tf="LogicalExpression",zf="MemberExpression",Rf="ObjectExpression",Pf="UnaryExpression";function Lf(t){this.type=t}var jf,Uf,If,qf,Wf;Lf.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=function(t){switch(t.type){case Mf:return t.elements;case Bf:case Tf:return[t.left,t.right];case Of:return[t.callee].concat(t.arguments);case Nf:return[t.test,t.consequent,t.alternate];case zf:return[t.object,t.property];case Rf:return t.properties;case Sf:return[t.key,t.value];case Pf:return[t.argument];default:return[]}}(this),n=0,r=e.length;n<r;++n)if(e[n].visit(t))return 1};var Hf=1,Xf=2,Gf=3,Jf=4,$f=5,Vf=6,Yf=7,Kf=8;(jf={})[Hf]="Boolean",jf[Xf]="<end>",jf[Gf]="Identifier",jf[Jf]="Keyword",jf[$f]="Null",jf[Vf]="Numeric",jf[Yf]="Punctuator",jf[Kf]="String",jf[9]="RegularExpression";var Zf="ArrayExpression",Qf="BinaryExpression",td="CallExpression",ed="ConditionalExpression",nd="Identifier",rd="Literal",id="LogicalExpression",od="MemberExpression",ad="ObjectExpression",sd="Property",ud="UnaryExpression",cd="Unexpected token %0",ld="Unexpected number",fd="Unexpected string",dd="Unexpected identifier",hd="Unexpected reserved word",pd="Unexpected end of input",md="Invalid regular expression",gd="Invalid regular expression: missing /",vd="Octal literals are not allowed in strict mode.",yd="Duplicate data property in object literal not allowed in strict mode",bd="ILLEGAL",xd="Disabled.",Ad=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]"),_d=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 wd(t,e){if(!t)throw new Error("ASSERT: "+e)}function Ed(t){return t>=48&&t<=57}function Dd(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function Fd(t){return"01234567".indexOf(t)>=0}function Cd(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 kd(t){return 10===t||13===t||8232===t||8233===t}function Sd(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&Ad.test(String.fromCharCode(t))}function Md(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&_d.test(String.fromCharCode(t))}const Bd={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 Od(){for(;If<qf;){const t=Uf.charCodeAt(If);if(!Cd(t)&&!kd(t))break;++If}}function Nd(t){var e,n,r,i=0;for(n="u"===t?4:2,e=0;e<n;++e)If<qf&&Dd(Uf[If])?(r=Uf[If++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):Vd({},cd,bd);return String.fromCharCode(i)}function Td(){var t,e,n,r;for(e=0,"}"===(t=Uf[If])&&Vd({},cd,bd);If<qf&&Dd(t=Uf[If++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&Vd({},cd,bd),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function zd(){var t,e;for(t=Uf.charCodeAt(If++),e=String.fromCharCode(t),92===t&&(117!==Uf.charCodeAt(If)&&Vd({},cd,bd),++If,(t=Nd("u"))&&"\\"!==t&&Sd(t.charCodeAt(0))||Vd({},cd,bd),e=t);If<qf&&Md(t=Uf.charCodeAt(If));)++If,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==Uf.charCodeAt(If)&&Vd({},cd,bd),++If,(t=Nd("u"))&&"\\"!==t&&Md(t.charCodeAt(0))||Vd({},cd,bd),e+=t);return e}function Rd(){var t,e;return t=If,e=92===Uf.charCodeAt(If)?zd():function(){var t,e;for(t=If++;If<qf;){if(92===(e=Uf.charCodeAt(If)))return If=t,zd();if(!Md(e))break;++If}return Uf.slice(t,If)}(),{type:1===e.length?Gf:Bd.hasOwnProperty(e)?Jf:"null"===e?$f:"true"===e||"false"===e?Hf:Gf,value:e,start:t,end:If}}function Pd(){var t,e,n,r,i=If,o=Uf.charCodeAt(If),a=Uf[If];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++If,{type:Yf,value:String.fromCharCode(o),start:i,end:If};default:if(61===(t=Uf.charCodeAt(If+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return If+=2,{type:Yf,value:String.fromCharCode(o)+String.fromCharCode(t),start:i,end:If};case 33:case 61:return If+=2,61===Uf.charCodeAt(If)&&++If,{type:Yf,value:Uf.slice(i,If),start:i,end:If}}}return">>>="===(r=Uf.substr(If,4))?{type:Yf,value:r,start:i,end:If+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:Yf,value:n,start:i,end:If+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:Yf,value:e,start:i,end:If+=2}:("//"===e&&Vd({},cd,bd),"<>=!+-*%&|^/".indexOf(a)>=0?(++If,{type:Yf,value:a,start:i,end:If}):void Vd({},cd,bd))}function Ld(){var t,e,n;if(wd(Ed((n=Uf[If]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=If,t="","."!==n){if(t=Uf[If++],n=Uf[If],"0"===t){if("x"===n||"X"===n)return++If,function(t){let e="";for(;If<qf&&Dd(Uf[If]);)e+=Uf[If++];return 0===e.length&&Vd({},cd,bd),Sd(Uf.charCodeAt(If))&&Vd({},cd,bd),{type:Vf,value:parseInt("0x"+e,16),start:t,end:If}}(e);if(Fd(n))return function(t){let e="0"+Uf[If++];for(;If<qf&&Fd(Uf[If]);)e+=Uf[If++];return(Sd(Uf.charCodeAt(If))||Ed(Uf.charCodeAt(If)))&&Vd({},cd,bd),{type:Vf,value:parseInt(e,8),octal:!0,start:t,end:If}}(e);n&&Ed(n.charCodeAt(0))&&Vd({},cd,bd)}for(;Ed(Uf.charCodeAt(If));)t+=Uf[If++];n=Uf[If]}if("."===n){for(t+=Uf[If++];Ed(Uf.charCodeAt(If));)t+=Uf[If++];n=Uf[If]}if("e"===n||"E"===n)if(t+=Uf[If++],"+"!==(n=Uf[If])&&"-"!==n||(t+=Uf[If++]),Ed(Uf.charCodeAt(If)))for(;Ed(Uf.charCodeAt(If));)t+=Uf[If++];else Vd({},cd,bd);return Sd(Uf.charCodeAt(If))&&Vd({},cd,bd),{type:Vf,value:parseFloat(t),start:e,end:If}}function jd(){var t,e,n,r;return Wf=null,Od(),t=If,e=function(){var t,e,n,r;for(wd("/"===(t=Uf[If]),"Regular expression literal must start with a slash"),e=Uf[If++],n=!1,r=!1;If<qf;)if(e+=t=Uf[If++],"\\"===t)kd((t=Uf[If++]).charCodeAt(0))&&Vd({},gd),e+=t;else if(kd(t.charCodeAt(0)))Vd({},gd);else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||Vd({},gd),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";If<qf&&Md((t=Uf[If]).charCodeAt(0));)++If,"\\"===t&&If<qf?Vd({},cd,bd):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&Vd({},md,n),{value:n,literal:e}}(),r=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";Vd({},md)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(r){Vd({},md)}try{return new RegExp(t,e)}catch(i){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:If}}function Ud(){if(Od(),If>=qf)return{type:Xf,start:If,end:If};const t=Uf.charCodeAt(If);return Sd(t)?Rd():40===t||41===t||59===t?Pd():39===t||34===t?function(){var t,e,n,r,i="",o=!1;for(wd("'"===(t=Uf[If])||'"'===t,"String literal must starts with a quote"),e=If,++If;If<qf;){if((n=Uf[If++])===t){t="";break}if("\\"===n)if((n=Uf[If++])&&kd(n.charCodeAt(0)))"\r"===n&&"\n"===Uf[If]&&++If;else switch(n){case"u":case"x":"{"===Uf[If]?(++If,i+=Td()):i+=Nd(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:Fd(n)?(0!==(r="01234567".indexOf(n))&&(o=!0),If<qf&&Fd(Uf[If])&&(o=!0,r=8*r+"01234567".indexOf(Uf[If++]),"0123".indexOf(n)>=0&&If<qf&&Fd(Uf[If])&&(r=8*r+"01234567".indexOf(Uf[If++]))),i+=String.fromCharCode(r)):i+=n}else{if(kd(n.charCodeAt(0)))break;i+=n}}return""!==t&&Vd({},cd,bd),{type:Kf,value:i,octal:o,start:e,end:If}}():46===t?Ed(Uf.charCodeAt(If+1))?Ld():Pd():Ed(t)?Ld():Pd()}function Id(){const t=Wf;return If=t.end,Wf=Ud(),If=t.end,t}function qd(){const t=If;Wf=Ud(),If=t}function Wd(t,e,n){const r=new Lf("||"===t||"&&"===t?id:Qf);return r.operator=t,r.left=e,r.right=n,r}function Hd(t,e){const n=new Lf(td);return n.callee=t,n.arguments=e,n}function Xd(t){const e=new Lf(nd);return e.name=t,e}function Gd(t){const e=new Lf(rd);return e.value=t.value,e.raw=Uf.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function Jd(t,e,n){const r=new Lf(od);return r.computed="["===t,r.object=e,r.property=n,r.computed||(n.member=!0),r}function $d(t,e,n){const r=new Lf(sd);return r.key=e,r.value=n,r.kind=t,r}function Vd(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,((t,e)=>(wd(e<r.length,"Message reference must be in range"),r[e])));throw(n=new Error(i)).index=If,n.description=i,n}function Yd(t){t.type===Xf&&Vd(t,pd),t.type===Vf&&Vd(t,ld),t.type===Kf&&Vd(t,fd),t.type===Gf&&Vd(t,dd),t.type===Jf&&Vd(t,hd),Vd(t,cd,t.value)}function Kd(t){const e=Id();e.type===Yf&&e.value===t||Yd(e)}function Zd(t){return Wf.type===Yf&&Wf.value===t}function Qd(t){return Wf.type===Jf&&Wf.value===t}function th(){const t=[];for(If=Wf.start,Kd("[");!Zd("]");)Zd(",")?(Id(),t.push(null)):(t.push(dh()),Zd("]")||Kd(","));return Id(),function(t){const e=new Lf(Zf);return e.elements=t,e}(t)}function eh(){If=Wf.start;const t=Id();return t.type===Kf||t.type===Vf?(t.octal&&Vd(t,vd),Gd(t)):Xd(t.value)}function nh(){var t,e,n;return If=Wf.start,(t=Wf).type===Gf?(n=eh(),Kd(":"),$d("init",n,dh())):t.type!==Xf&&t.type!==Yf?(e=eh(),Kd(":"),$d("init",e,dh())):void Yd(t)}function rh(){var t,e,n=[],r={},i=String;for(If=Wf.start,Kd("{");!Zd("}");)e="$"+((t=nh()).key.type===nd?t.key.name:i(t.key.value)),Object.prototype.hasOwnProperty.call(r,e)?Vd({},yd):r[e]=!0,n.push(t),Zd("}")||Kd(",");return Kd("}"),function(t){const e=new Lf(ad);return e.properties=t,e}(n)}const ih={if:1};function oh(){var t,e,n;if(Zd("("))return function(){Kd("(");const t=hh();return Kd(")"),t}();if(Zd("["))return th();if(Zd("{"))return rh();if(t=Wf.type,If=Wf.start,t===Gf||ih[Wf.value])n=Xd(Id().value);else if(t===Kf||t===Vf)Wf.octal&&Vd(Wf,vd),n=Gd(Id());else{if(t===Jf)throw new Error(xd);t===Hf?((e=Id()).value="true"===e.value,n=Gd(e)):t===$f?((e=Id()).value=null,n=Gd(e)):Zd("/")||Zd("/=")?(n=Gd(jd()),qd()):Yd(Id())}return n}function ah(){const t=[];if(Kd("("),!Zd(")"))for(;If<qf&&(t.push(dh()),!Zd(")"));)Kd(",");return Kd(")"),t}function sh(){If=Wf.start;const t=Id();return function(t){return t.type===Gf||t.type===Jf||t.type===Hf||t.type===$f}(t)||Yd(t),Xd(t.value)}function uh(){Kd("[");const t=hh();return Kd("]"),t}function ch(){const t=function(){var t;for(t=oh();;)if(Zd("."))Kd("."),t=Jd(".",t,sh());else if(Zd("("))t=Hd(t,ah());else{if(!Zd("["))break;t=Jd("[",t,uh())}return t}();if(Wf.type===Yf&&(Zd("++")||Zd("--")))throw new Error(xd);return t}function lh(){var t,e;if(Wf.type!==Yf&&Wf.type!==Jf)e=ch();else{if(Zd("++")||Zd("--"))throw new Error(xd);if(Zd("+")||Zd("-")||Zd("~")||Zd("!"))t=Id(),e=lh(),e=function(t,e){const n=new Lf(ud);return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if(Qd("delete")||Qd("void")||Qd("typeof"))throw new Error(xd);e=ch()}}return e}function fh(t){let e=0;if(t.type!==Yf&&t.type!==Jf)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 dh(){var t,e;return t=function(){var t,e,n,r,i,o,a,s,u,c;if(t=Wf,u=lh(),0===(i=fh(r=Wf)))return u;for(r.prec=i,Id(),e=[t,Wf],o=[u,r,a=lh()];(i=fh(Wf))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),e.pop(),n=Wd(s,u,a),o.push(n);(r=Id()).prec=i,o.push(r),e.push(Wf),n=lh(),o.push(n)}for(n=o[c=o.length-1],e.pop();c>1;)e.pop(),n=Wd(o[c-1].value,o[c-2],n),c-=2;return n}(),Zd("?")&&(Id(),e=dh(),Kd(":"),t=function(t,e,n){const r=new Lf(ed);return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,dh())),t}function hh(){const t=dh();if(Zd(","))throw new Error(xd);return t}function ph(t){const e=[];return"Identifier"===t.type?[t.name]:"Literal"===t.type?[t.value]:("MemberExpression"===t.type&&(e.push(...ph(t.object)),e.push(...ph(t.property))),e)}function mh(t){return"MemberExpression"===t.object.type?mh(t.object):"datum"===t.object.name}function gh(t){const e=function(t){If=0,qf=(Uf=t).length,Wf=null,qd();const e=hh();if(Wf.type!==Xf)throw new Error("Unexpect token after expression.");return e}(t),n=new Set;return e.visit((t=>{"MemberExpression"===t.type&&mh(t)&&n.add(ph(t).slice(1).join("."))})),n}class vh extends sl{clone(){return new vh(null,this.model,tt(this.filter))}constructor(t,e,n){super(t),this.model=e,this.filter=n,this.expr=xh(this.model,this.filter,this),this._dependentFields=gh(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return"Filter ".concat(this.expr)}}function yh(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"datum";const i=(0,I.HD)(e)?e:e.param,o=wt(i),a=(0,I.m8)(o+Af);let s;try{s=t.getSelectionComponent(o,i)}catch(d){return"!!".concat(o)}if(s.project.timeUnit){const e=null!==n&&void 0!==n?n:t.component.data.raw,r=s.project.timeUnit.clone();e.parent?r.insertAsParentOf(e):e.parent=r}const u=s.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",c="global"===s.resolve?")":", ".concat((0,I.m8)(s.resolve),")"),l="".concat(u).concat(a,", ").concat(r).concat(c),f="length(data(".concat(a,"))");return!1===e.empty?"".concat(f," && ").concat(l):"!".concat(f," || ").concat(l)}function bh(t,e,n){const r=wt(e),i=n.encoding;let o,a=n.field;try{o=t.getSelectionComponent(r,e)}catch(s){return r}if(i||a){if(i&&!a){const t=o.project.items.filter((t=>t.channel===i));!t.length||t.length>1?(a=o.project.items[0].field,di((t.length?"Multiple ":"No ")+"matching ".concat((0,I.m8)(i)," 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&&di('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)(Mt(a)),"]")}function xh(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)?yh(t,e,n):ji(e)))}function Ah(t,e,n,r){var i,o,a,s,u;null!==(i=t.encode)&&void 0!==i||(t.encode={}),null!==(o=(s=t.encode)[e])&&void 0!==o||(s[e]={}),null!==(a=(u=t.encode[e]).update)&&void 0!==a||(u.update={}),t.encode[e].update[n]=r}function _h(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{header:!1};const{disable:i,orient:o,scale:a,labelExpr:s,title:u,zindex:c,...l}=t.combine();if(!i){for(const t in l){const n=gs[t],r=l[t];if(n&&n!==e&&"both"!==n)delete l[t];else if(ps(r)){const{condition:e,...n}=r,i=(0,I.IX)(e),o=hs[t];if(o){const{vgProp:e,part:r}=o;Ah(l,r,e,[...i.map((t=>{const{test:e,...n}=t;return{test:xh(null,e),...n}})),n]),delete l[t]}else if(null===o){const e={signal:i.map((t=>{const{test:e,...n}=t;return"".concat(xh(null,e)," ? ").concat(br(n)," : ")})).join("")+br(n)};l[t]=e}}else if(cr(r)){const e=hs[t];if(e){const{vgProp:n,part:i}=e;Ah(l,i,n,r),delete l[t]}}st(["labelAlign","labelBaseline"],t)&&null===l[t]&&delete l[t]}if("grid"===e){if(!l.grid)return;if(l.encode){const{grid:t}=l.encode;l.encode={...t?{grid:t}:{}},yt(l.encode)&&delete l.encode}return{scale:a,orient:o,...l,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:Tt(c,0)}}{if(!r.header&&t.mainExtracted)return;if(void 0!==s){var f,d;let t=s;null!==(f=l.encode)&&void 0!==f&&null!==(d=f.labels)&&void 0!==d&&d.update&&cr(l.encode.labels.update.text)&&(t=Bt(s,"datum.label",l.encode.labels.update.text.signal)),Ah(l,"labels","text",{signal:t})}if(null===l.labelAlign&&delete l.labelAlign,l.encode){for(const e of ms)t.hasAxisPart(e)||delete l.encode[e];yt(l.encode)&&delete l.encode}const e=function(t,e){if(t)return(0,I.kJ)(t)&&!ur(t)?t.map((t=>ts(t,e))).join(", "):t}(u,n);return{scale:a,orient:o,grid:!1,...e?{title:e}:{},...l,...!1===n.aria?{aria:!1}:{},zindex:Tt(c,0)}}}}function wh(t){const{axes:e}=t.component,n=[];for(const r of bn)if(e[r])for(const i of e[r])if(!i.get("disable")&&!i.get("gridScale")){const e="x"===r?"height":"width",i=t.getSizeSignalRef(e).signal;e!==i&&n.push({name:e,update:i})}return n}function Eh(t,e,n,r){return Object.assign.apply(null,[{},...t.map((t=>{if("axisOrient"===t){const t="x"===n?"bottom":"left",i=e["x"===n?"axisBottom":"axisLeft"]||{},o=e["x"===n?"axisTop":"axisRight"]||{},a=new Set([...bt(i),...bt(o)]),s={};for(const e of a.values())s[e]={signal:"".concat(r.signal,' === "').concat(t,'" ? ').concat(xr(i[e])," : ").concat(xr(o[e]))};return s}return e[t]}))])}function Dh(t,e){const n=[{}];for(const i of t){var r;let t=null===(r=e[i])||void 0===r?void 0:r.style;if(t){t=(0,I.IX)(t);for(const r of t)n.push(e.style[r])}}return Object.assign.apply(null,n)}function Fh(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Fr(t,n,e);if(void 0!==i)return{configFrom:"style",configValue:i};for(const a of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"]){var o;if(void 0!==(null===(o=r[a])||void 0===o?void 0:o[t]))return{configFrom:a,configValue:r[a][t]}}return{}}const Ch={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:r,scaleType:i}=t;return null!==(e=r.grid)&&void 0!==e?e:function(t,e){return!so(t)&&Na(e)&&!tr(null===e||void 0===e?void 0:e.bin)&&!er(null===e||void 0===e?void 0:e.bin)}(i,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:r,channel:i}=t;return e.labelAlign||Mh(n,r,i)},labelAngle:t=>{let{labelAngle:e}=t;return e},labelBaseline:t=>{let{axis:e,labelAngle:n,orient:r,channel:i}=t;return e.labelBaseline||Sh(n,r,i)},labelFlush:t=>{var e;let{axis:n,fieldOrDatumDef:r,channel:i}=t;return null!==(e=n.labelFlush)&&void 0!==e?e:function(t,e){if("x"===e&&st(["quantitative","temporal"],t))return!0;return}(r.type,i)},labelOverlap:t=>{var e;let{axis:n,fieldOrDatumDef:r,scaleType:i}=t;return null!==(e=n.labelOverlap)&&void 0!==e?e:function(t,e,n,r){if(n&&!(0,I.Kn)(r)||"nominal"!==t&&"ordinal"!==t)return"log"!==e&&"symlog"!==e||"greedy";return}(r.type,i,Na(r)&&!!r.timeUnit,Na(r)?r.sort:void 0)},orient:t=>{let{orient:e}=t;return e},tickCount:t=>{var e;let{channel:n,model:r,axis:i,fieldOrDatumDef:o,scaleType:a}=t;const s="x"===n?"width":"y"===n?"height":void 0,u=s?r.getSizeSignalRef(s):void 0;return null!==(e=i.tickCount)&&void 0!==e?e:function(t){let{fieldOrDatumDef:e,scaleType:n,size:r,values:i}=t;if(!i&&!so(n)&&"log"!==n){if(Na(e)){var o;if(tr(e.bin))return{signal:"ceil(".concat(r.signal,"/10)")};if(e.timeUnit&&st(["month","hours","day","quarter"],null===(o=ki(e.timeUnit))||void 0===o?void 0:o.unit))return}return{signal:"ceil(".concat(r.signal,"/40)")}}return}({fieldOrDatumDef:o,scaleType:a,size:u,values:i.values})},tickMinStep:function(t){let{format:e,fieldOrDatumDef:n}=t;if("d"===e)return 1;if(Na(n)){const{timeUnit:t}=n;if(t){const e=Si(t);if(e)return{signal:e}}}return},title:t=>{let{axis:e,model:n,channel:r}=t;if(void 0!==e.title)return e.title;const i=Bh(n,r);if(void 0!==i)return i;const o=n.typedFieldDef(r),a="x"===r?"x2":"y2",s=n.fieldDef(a);return kr(o?[Ea(o)]:[],Na(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(cr(n))return n;return}(e,n)},zindex:t=>{var e;let{axis:n,fieldOrDatumDef:r,mark:i}=t;return null!==(e=n.zindex)&&void 0!==e?e:function(t,e){if("rect"===t&&$a(e))return 1;return 0}(i,r)}};function kh(t){return"(((".concat(t.signal," % 360) + 360) % 360)")}function Sh(t,e,n,r){if(void 0!==t){if("x"===n){if(cr(t)){const n=kh(t),r=cr(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(r,' ? "bottom" : "top"')}}if(45<t&&t<135||225<t&&t<315)return"middle";if(cr(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(cr(t)){const n=kh(t),i=cr(e)?"(".concat(e.signal,' === "left")'):"left"===e,o=r?'"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(i,' ? "top" : "bottom"')}}if(t<=45||315<=t||135<=t&&t<=225)return r?"middle":null;if(cr(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 Mh(t,e,n){if(void 0===t)return;const r="x"===n,i=r?0:90,o=r?"bottom":"left";if(cr(t)){const n=kh(t),a=cr(e)?"(".concat(e.signal,' === "').concat(o,'")'):e===o;return{signal:"(".concat(i?"(".concat(n," + 90)"):n," % 180 === 0) ? ").concat(r?null:'"center"'," :")+"(".concat(i," < ").concat(n," && ").concat(n," < ").concat(180+i,") === ").concat(a,' ? "left" : "right"')}}if((t+i)%180===0)return r?null:"center";if(cr(e)){const n=i<t&&t<180+i?"===":"!==",r="".concat(e.signal," ").concat(n,' "').concat(o,'"');return{signal:"".concat(r,' ? "left" : "right"')}}return(i<t&&t<180+i)===(e===o)?"left":"right"}function Bh(t,e){const n="x"===e?"x2":"y2",r=t.fieldDef(e),i=t.fieldDef(n),o=r?r.title:void 0,a=i?i.title:void 0;return o&&a?Sr(o,a):o||(a||(void 0!==o?o:void 0!==a?a:void 0))}class Oh extends sl{clone(){return new Oh(null,tt(this.transform))}constructor(t,e){super(t),this.transform=e,this._dependentFields=gh(this.transform.calculate)}static parseAllForSortIndex(t,e){return e.forEachFieldDef(((e,n)=>{if(qa(e)&&xa(e.sort)){const{field:r,timeUnit:i}=e,o=e.sort,a=o.map(((t,e)=>"".concat(ji({field:r,timeUnit:i,equal:t})," ? ").concat(e," : "))).join("")+o.length;t=new Oh(t,{calculate:a,as:Nh(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 Nh(t,e,n){return Ja(t,{prefix:e,suffix:"sort_index",...null!==n&&void 0!==n?n:{}})}function Th(t,e){return st(["top","bottom"],e)?"column":st(["left","right"],e)||"row"===t?"row":"column"}function zh(t,e,n,r){const i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return Tt((e||{})[t],i[t],n.header[t])}function Rh(t,e,n,r){const i={};for(const o of t){const t=zh(o,e||{},n,r);void 0!==t&&(i[o]=t)}return i}const Ph=["row","column"],Lh=["header","footer"];function jh(t,e){const n=t.component.layoutHeaders[e].title,r=t.config?t.config:void 0,i=t.component.layoutHeaders[e].facetFieldDef?t.component.layoutHeaders[e].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=Rh(["titleAnchor","titleAngle","titleOrient"],i.header,r,e),u=Th(e,s),c=Ut(a);return{name:"".concat(e,"-title"),type:"group",role:"".concat(u,"-title"),title:{text:n,..."row"===e?{orient:"left"}:{},style:"guide-title",...Ih(c,u),...Uh(u,c,o),...$h(r,i,e,iu,nu)}}}function Uh(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=Mh(e,"row"===t?"left":"top","row"===t?"y":"x");return n?{align:n}:{}}function Ih(t,e){const n=Sh(t,"row"===e?"left":"top","row"===e?"y":"x",!0);return n?{baseline:n}:{}}function qh(t,e){const n=t.component.layoutHeaders[e],r=[];for(const i of Lh)if(n[i])for(const o of n[i]){const a=Xh(t,e,i,n,o);null!=a&&r.push(a)}return r}function Wh(t,e){const{sort:n}=t;var r;return ba(n)?{field:Ja(n,{expr:"datum"}),order:null!==(r=n.order)&&void 0!==r?r:"ascending"}:(0,I.kJ)(n)?{field:Nh(t,e,{expr:"datum"}),order:"ascending"}:{field:Ja(t,{expr:"datum"}),order:null!==n&&void 0!==n?n:"ascending"}}function Hh(t,e,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:u}=Rh(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],t.header,n,e),c=aa({fieldOrDatumDef:t,format:r,formatType:i,expr:"parent",config:n}).signal,l=Th(e,s);return{text:{signal:u?Bt(Bt(u,"datum.label",c),"datum.value",Ja(t,{expr:"parent"})):c},..."row"===e?{orient:"left"}:{},style:"guide-label",frame:"group",...Ih(o,l),...Uh(l,o,a),...$h(n,t,e,ou,ru)}}function Xh(t,e,n,r,i){if(i){let o=null;const{facetFieldDef:a}=r,s=t.config?t.config:void 0;if(a&&i.labels){const{labelOrient:t}=Rh(["labelOrient"],a.header,s,e);("row"===e&&!st(["top","bottom"],t)||"column"===e&&!st(["left","right"],t))&&(o=Hh(a,e,s))}const u=Ym(t)&&!Aa(t.facet),c=i.axes,l=(null===c||void 0===c?void 0:c.length)>0;if(o||l){const s="row"===e?"height":"width";return{name:t.getName("".concat(e,"_").concat(n)),type:"group",role:"".concat(e,"-").concat(n),...r.facetFieldDef?{from:{data:t.getName("".concat(e,"_domain"))},sort:Wh(a,e)}:{},...l&&u?{from:{data:t.getName("facet_domain_".concat(e))}}:{},...o?{title:o}:{},...i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{},...l?{axes:c}:{}}}}return null}const Gh={column:{start:0,end:1},row:{start:1,end:0}};function Jh(t,e){return Gh[e][t]}function $h(t,e,n,r,i){const o={};for(const a of r){if(!i[a])continue;const r=zh(a,null===e||void 0===e?void 0:e.header,t,n);void 0!==r&&(o[i[a]]=r)}return o}function Vh(t){return[...Yh(t,"width"),...Yh(t,"height"),...Yh(t,"childWidth"),...Yh(t,"childHeight")]}function Yh(t,e){const n="width"===e?"x":"y",r=t.component.layoutSize.get(e);if(!r||"merged"===r)return[];const i=t.getSizeSignalRef(e).signal;if("step"===r){const e=t.getScaleComponent(n);if(e){const r=e.get("type"),o=e.get("range");if(so(r)&&lr(o)){const r=t.scaleName(n);if(Ym(t.parent)){if("independent"===t.parent.component.resolve.scale[n])return[Kh(r,o)]}return[Kh(r,o),{name:i,update:Zh(r,e,"domain('".concat(r,"').length"))}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==r){const e=i.endsWith("width"),n=e?"containerSize()[0]":"containerSize()[1]",r=_u(t.config.view,e?"width":"height"),o="isFinite(".concat(n,") ? ").concat(n," : ").concat(r);return[{name:i,init:o,on:[{update:o,events:"window:resize"}]}]}return[{name:i,value:r}]}function Kh(t,e){const n="".concat(t,"_step");return cr(e.step)?{name:n,update:e.step.signal}:{name:n,value:e.step}}function Zh(t,e,n){const r=e.get("type"),i=e.get("padding"),o=Tt(e.get("paddingOuter"),i);let a=e.get("paddingInner");return a="band"===r?void 0!==a?a:i:1,"bandspace(".concat(n,", ").concat(xr(a),", ").concat(xr(o),") * ").concat(t,"_step")}function Qh(t){return"childWidth"===t?"width":"childHeight"===t?"height":t}function tp(t,e){return bt(t).reduce(((n,r)=>{const i=t[r];return{...n,...Fl(e,i,r,(t=>yr(t.value)))}}),{})}function ep(t,e){if(Ym(e))return"theta"===t?"independent":"shared";if(Zm(e))return"shared";if(Km(e))return xn(t)||"theta"===t||"radius"===t?"independent":"shared";throw new Error("invalid model type for resolve")}function np(t,e){const n=t.scale[e],r=xn(e)?"axis":"legend";return"independent"===n?("shared"===t[r][e]&&di(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[r][e]||"shared"}const rp={...uu,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},ip=bt(rp);class op extends jc{}const ap={symbols:function(t,e){var n,r,i,o;let{fieldOrDatumDef:a,model:s,channel:u,legendCmpt:c,legendType:l}=e;if("symbol"!==l)return;const{markDef:f,encoding:d,config:h,mark:p}=s,m=f.filled&&"trail"!==p;let g={...Ar({},s,Wo),...Rl(s,{filled:m})};const v=null!==(n=c.get("symbolOpacity"))&&void 0!==n?n:h.legend.symbolOpacity,y=null!==(r=c.get("symbolFillColor"))&&void 0!==r?r:h.legend.symbolFillColor,b=null!==(i=c.get("symbolStrokeColor"))&&void 0!==i?i:h.legend.symbolStrokeColor,x=void 0===v?null!==(o=sp(d.opacity))&&void 0!==o?o:f.opacity:void 0;if(g.fill){var A;if("fill"===u||m&&u===oe)delete g.fill;else if(g.fill.field)if(y)delete g.fill;else g.fill=yr(null!==(A=h.legend.symbolBaseFillColor)&&void 0!==A?A:"black"),g.fillOpacity=yr(null!==x&&void 0!==x?x:1);else if((0,I.kJ)(g.fill)){var _,w,E;const t=null!==(_=null!==(w=up(null!==(E=d.fill)&&void 0!==E?E:d.color))&&void 0!==w?w:f.fill)&&void 0!==_?_:m&&f.color;t&&(g.fill=yr(t))}}if(g.stroke)if("stroke"===u||!m&&u===oe)delete g.stroke;else if(g.stroke.field||b)delete g.stroke;else if((0,I.kJ)(g.stroke)){const t=Tt(up(d.stroke||d.color),f.stroke,m?f.color:void 0);t&&(g.stroke={value:t})}if(u!==fe){const t=Na(a)&&lp(s,c,a);t?g.opacity=[{test:t,...yr(null!==x&&void 0!==x?x:1)},yr(h.legend.unselectedOpacity)]:x&&(g.opacity=yr(x))}return g={...g,...t},yt(g)?void 0:g},gradient:function(t,e){var n;let{model:r,legendType:i,legendCmpt:o}=e;if("gradient"!==i)return;const{config:a,markDef:s,encoding:u}=r;let c={};const l=void 0===(null!==(n=o.get("gradientOpacity"))&&void 0!==n?n:a.legend.gradientOpacity)?sp(u.opacity)||s.opacity:void 0;l&&(c.opacity=yr(l));return c={...c,...t},yt(c)?void 0:c},labels:function(t,e){let{fieldOrDatumDef:n,model:r,channel:i,legendCmpt:o}=e;const a=r.legend(i)||{},s=r.config,u=Na(n)?lp(r,o,n):void 0,c=u?[{test:u,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:l,formatType:f}=a;let d;ra(f)?d=ua({fieldOrDatumDef:n,field:"datum.value",format:l,formatType:f,config:s}):void 0===l&&void 0===f&&s.customFormatTypes&&("quantitative"===n.type&&s.numberFormatType?d=ua({fieldOrDatumDef:n,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):"temporal"===n.type&&s.timeFormatType&&Na(n)&&void 0===n.timeUnit&&(d=ua({fieldOrDatumDef:n,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const h={...c?{opacity:c}:{},...d?{text:d}:{},...t};return yt(h)?void 0:h},entries:function(t,e){let{legendCmpt:n}=e;const r=n.get("selections");return null!==r&&void 0!==r&&r.length?{...t,fill:{value:"transparent"}}:t}};function sp(t){return cp(t,((t,e)=>Math.max(t,e.value)))}function up(t){return cp(t,((t,e)=>Tt(t,e.value)))}function cp(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 lp(t,e,n){const r=e.get("selections");if(null===r||void 0===r||!r.length)return;const i=(0,I.m8)(n.field);return r.map((t=>{const e=(0,I.m8)(wt(t)+Af);return"(!length(data(".concat(e,")) || (").concat(t,"[").concat(i,"] && indexof(").concat(t,"[").concat(i,"], datum.value) >= 0))")})).join(" || ")}const fp={direction:t=>{let{direction:e}=t;return e},format:t=>{let{fieldOrDatumDef:e,legend:n,config:r}=t;const{format:i,formatType:o}=n;return ca(e,e.type,i,o,r,!1)},formatType:t=>{let{legend:e,fieldOrDatumDef:n,scaleType:r}=t;const{formatType:i}=e;return la(i,n,r)},gradientLength:t=>{var e,n;const{legend:r,legendConfig:i}=t;return null!==(e=null!==(n=r.gradientLength)&&void 0!==n?n:i.gradientLength)&&void 0!==e?e:function(t){let{legendConfig:e,model:n,direction:r,orient:i,scaleType:o}=t;const{gradientHorizontalMaxLength:a,gradientHorizontalMinLength:s,gradientVerticalMaxLength:u,gradientVerticalMinLength:c}=e;if(co(o))return"horizontal"===r?"top"===i||"bottom"===i?pp(n,"width",s,a):s:pp(n,"height",c,u);return}(t)},labelOverlap:t=>{var e,n;let{legend:r,legendConfig:i,scaleType:o}=t;return null!==(e=null!==(n=r.labelOverlap)&&void 0!==n?n:i.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:r,channel:i,encoding:o}=t;return null!==(e=n.symbolType)&&void 0!==e?e:function(t,e,n,r){if("shape"!==e){var i;const t=null!==(i=up(n))&&void 0!==i?i:r;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"}}(r.type,i,o.shape,r.shape)},title:t=>{let{fieldOrDatumDef:e,config:n}=t;return Za(e,n,{allowDisabling:!0})},type:t=>{let{legendType:e,scaleType:n,channel:r}=t;if(Be(r)&&co(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(cr(n))return n;return}(n,e)}};function dp(t){const{legend:e}=t;return Tt(e.type,function(t){let{channel:e,timeUnit:n,scaleType:r}=t;if(Be(e)){if(st(["quarter","month","day"],n))return"symbol";if(co(r))return"gradient"}return"symbol"}(t))}function hp(t){var e,n;let{legendConfig:r,legendType:i,orient:o,legend:a}=t;return null!==(e=null!==(n=a.direction)&&void 0!==n?n:r[i?"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,i)}function pp(t,e,n,r){const i=t.getSizeSignalRef(e).signal;return{signal:"clamp(".concat(i,", ").concat(n,", ").concat(r,")")}}function mp(t){const e=Vm(t)?function(t){const{encoding:e}=t,n={};for(const r of[oe,...su]){const i=rs(e[r]);i&&t.getScaleComponent(r)&&(r===ue&&Na(i)&&i.type===Vi||(n[r]=vp(t,r)))}return n}(t):function(t){const{legends:e,resolve:n}=t.component;for(const r of t.children){mp(r);for(const i of bt(r.component.legends))n.legend[i]=np(t.component.resolve,i),"shared"===n.legend[i]&&(e[i]=yp(e[i],r.component.legends[i]),e[i]||(n.legend[i]="independent",delete e[i]))}for(const r of bt(e))for(const e of t.children)e.component.legends[r]&&"shared"===n.legend[r]&&delete e.component.legends[r];return e}(t);return t.component.legends=e,e}function gp(t,e,n,r){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===r||void 0===r?void 0:r.title))return!0}return t===(n||{})[e]}function vp(t,e){var n,r,i;let o=t.legend(e);const{markDef:a,encoding:s,config:u}=t,c=u.legend,l=new op({},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 r;const i=null===(r=t.fieldDef(e))||void 0===r?void 0:r.field;for(const u of xt(null!==(o=t.component.selection)&&void 0!==o?o:{})){var o,a;const t=null!==(a=u.project.hasField[i])&&void 0!==a?a:u.project.hasChannel[e];if(t&&df.defined(u)){var s;const e=null!==(s=n.get("selections"))&&void 0!==s?s:[];e.push(u.name),n.set("selections",e,!1),t.hasLegend=!0}}}(t,e,l);const f=void 0!==o?!o:c.disable;if(l.set("disable",f,void 0!==o),f)return l;o=o||{};const d=t.getScaleComponent(e).get("type"),h=rs(s[e]),p=Na(h)?null===(n=ki(h.timeUnit))||void 0===n?void 0:n.unit:void 0,m=o.orient||u.legend.orient||"right",g=dp({legend:o,channel:e,timeUnit:p,scaleType:d}),v={legend:o,channel:e,model:t,markDef:a,encoding:s,fieldOrDatumDef:h,legendConfig:c,config:u,scaleType:d,orient:m,legendType:g,direction:hp({legend:o,legendType:g,orient:m,legendConfig:c})};for(const E of ip){if("gradient"===g&&E.startsWith("symbol")||"symbol"===g&&E.startsWith("gradient"))continue;const n=E in fp?fp[E](v):o[E];if(void 0!==n){const r=gp(n,E,o,t.fieldDef(e));(r||void 0===u.legend[E])&&l.set(E,n,r)}}const y=null!==(r=null===(i=o)||void 0===i?void 0:i.encoding)&&void 0!==r?r:{},b=l.get("selections"),x={},A={fieldOrDatumDef:h,model:t,channel:e,legendCmpt:l,legendType:g};for(const E of["labels","legend","title","symbols","gradient","entries"]){var _;const e=tp(null!==(_=y[E])&&void 0!==_?_:{},t),n=E in ap?ap[E](e,A):e;void 0===n||yt(n)||(x[E]={...null!==b&&void 0!==b&&b.length&&Na(h)?{name:"".concat(wt(h.field),"_legend_").concat(E)}:{},...null!==b&&void 0!==b&&b.length?{interactive:!!b}:{},update:n})}var w;yt(x)||l.set("encode",x,!(null===(w=o)||void 0===w||!w.encoding));return l}function yp(t,e){if(!t)return e.clone();const n=t.getWithExplicit("orient"),r=e.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const c of ip){const n=Hc(t.getWithExplicit(c),e.getWithExplicit(c),c,"legend",((t,e)=>{switch(c){case"symbolType":return bp(t,e);case"title":return Mr(t,e);case"type":return i=!0,Ic("symbol")}return Wc(t,e,c,"legend")}));t.setWithExplicit(c,n)}var o,a,s,u;i&&(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!==(u=s.encode)&&void 0!==u&&u.gradient&&Dt(t.explicit,["encode","gradient"]));return t}function bp(t,e){return"circle"===e.value?e:t}function xp(t){const e=t.component.legends,n={};for(const r of bt(e)){const i=t.getScaleComponent(r),o=it(i.get("domains"));if(n[o])for(const t of n[o]){yp(t,e[r])||n[o].push(e[r])}else n[o]=[e[r].clone()]}return xt(n).flat().map((e=>function(t,e){var n;const{disable:r,labelExpr:i,selections:o,...a}=t.combine();if(r)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 su)a[e]&&delete t[e]}a.title||delete a.title;if(void 0!==i){var s,u;let t=i;null!==(s=a.encode)&&void 0!==s&&null!==(u=s.labels)&&void 0!==u&&u.update&&cr(a.encode.labels.update.text)&&(t=Bt(i,"datum.label",a.encode.labels.update.text.signal)),function(t,e,n,r){var i,o,a,s,u;null!==(i=t.encode)&&void 0!==i||(t.encode={}),null!==(o=(s=t.encode)[e])&&void 0!==o||(s[e]={}),null!==(a=(u=t.encode[e]).update)&&void 0!==a||(u.update={}),t.encode[e].update[n]=r}(a,"labels","text",{signal:t})}return a}(e,t.config))).filter((t=>void 0!==t))}function Ap(t){return Zm(t)||Km(t)?function(t){return t.children.reduce(((t,e)=>t.concat(e.assembleProjections())),_p(t))}(t):_p(t)}function _p(t){const e=t.component.projection;if(!e||e.merged)return[];const n=e.combine(),{name:r}=n;if(e.data){const i={signal:"[".concat(e.size.map((t=>t.signal)).join(", "),"]")},o=e.data.reduce(((e,n)=>{const r=cr(n)?n.signal:"data('".concat(t.lookupDataSource(n),"')");return st(e,r)||e.push(r),e}),[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:r,size:i,fit:{signal:o.length>1?"[".concat(o.join(", "),"]"):o[0]},...n}]}return[{name:r,translate:{signal:"[width / 2, height / 2]"},...n}]}const wp=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class Ep extends jc{constructor(t,e,n,r){super({...e},{name:t}),this.specifiedProjection=e,this.size=n,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function Dp(t){t.component.projection=Vm(t)?function(t){if(t.hasProjection){var e;const n=ar(t.specifiedProjection),r=!(n&&(null!=n.scale||null!=n.translate)),i=r?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,o=r?function(t){const e=[],{encoding:n}=t;for(const r of[[ne,ee],[ie,re]])(rs(n[r[0]])||rs(n[r[1]]))&&e.push({signal:t.getName("geojson_".concat(e.length))});t.channelHasField(ue)&&t.typedFieldDef(ue).type===Vi&&e.push({signal:t.getName("geojson_".concat(e.length))});0===e.length&&e.push(t.requestDataName(Qc.Main));return e}(t):void 0,a=new Ep(t.projectionName(!0),{...null!==(e=ar(t.config.projection))&&void 0!==e?e:{},...null!==n&&void 0!==n?n:{}},i,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 r of t.children)Dp(r);const n=ct(t.children,(t=>{const n=t.component.projection;if(n){if(e){const t=function(t,e){const n=ct(wp,(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),r=new Ep(n,e.specifiedProjection,e.size,tt(e.data));for(const e of t.children){const t=e.component.projection;t&&(t.isFit&&r.data.push(...e.component.projection.data),e.renameProjection(t.get("name"),n),t.merged=!0)}return r}return}(t)}function Fp(t,e,n,r){if(ds(e,n)){var i,o;const a=Vm(t)&&null!==(i=null!==(o=t.axis(n))&&void 0!==o?o:t.legend(n))&&void 0!==i?i:{},s=Ja(e,{expr:"datum"}),u=Ja(e,{expr:"datum",binSuffix:"end"});return{formulaAs:Ja(e,{binSuffix:"range",forAs:!0}),formula:pa(s,u,a.format,a.formatType,r)}}return{}}function Cp(t,e){return"".concat(Qn(t),"_").concat(e)}function kp(t,e,n){var r;const i=Cp(null!==(r=ss(n,void 0))&&void 0!==r?r:{},e);return t.getName("".concat(i,"_bins"))}function Sp(t,e,n){let r,i;r=function(t){return"as"in t}(t)?(0,I.HD)(t.as)?[t.as,"".concat(t.as,"_end")]:[t.as[0],t.as[1]]:[Ja(t,{forAs:!0}),Ja(t,{binSuffix:"end",forAs:!0})];const o={...ss(e,void 0)},a=Cp(o,t.field),{signal:s,extentSignal:u}=function(t,e){return{signal:t.getName("".concat(e,"_bins")),extentSignal:t.getName("".concat(e,"_extent"))}}(n,a);if(rr(o.extent)){const t=o.extent;i=bh(n,t.param,t),delete o.extent}return{key:a,binComponent:{bin:o,field:t.field,as:[r],...s?{signal:s}:{},...u?{extentSignal:u}:{},...i?{span:i}:{}}}}class Mp extends sl{clone(){return new Mp(null,tt(this.bins))}constructor(t,e){super(t),this.bins=e}static makeFromEncoding(t,e){const n=e.reduceFieldDef(((t,n,r)=>{if(Ua(n)&&tr(n.bin)){const{key:i,binComponent:o}=Sp(n,n.bin,e);t[i]={...o,...t[i],...Fp(e,n,r,e.config)}}return t}),{});return yt(n)?null:new Mp(t,n)}static makeFromTransform(t,e,n){const{key:r,binComponent:i}=Sp(e,e.bin,n);return new Mp(t,{[r]:i})}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,...r]=t.as,{extent:i,...o}=t.bin,a={type:"bin",field:Mt(t.field),as:n,signal:t.signal,...rr(i)?{extent:null}:{extent:i},...t.span?{span:{signal:"span(".concat(t.span,")")}}:{},...o};!i&&t.extentSignal&&(e.push({type:"extent",field:Mt(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),e.push(a);for(const s of r)for(let t=0;t<2;t++)e.push({type:"formula",expr:Ja({field:n[t]},{expr:"datum"}),as:s[t]});return t.formula&&e.push({type:"formula",expr:t.formula,as:t.formulaAs}),e}))}}function Bp(t,e,n,r){var i;const o=Vm(r)?r.encoding[Ve(e)]:void 0;if(Ua(n)&&Vm(r)&&ka(n,o,r.markDef,r.config))t.add(Ja(n,{})),t.add(Ja(n,{suffix:"end"})),n.bin&&ds(n,e)&&t.add(Ja(n,{binSuffix:"range"}));else if(ke(e)){const n=Ce(e);t.add(r.getName(n))}else t.add(Ja(n));return qa(n)&&function(t){return(0,j.isObject)(t)&&"field"in t}(null===(i=n.scale)||void 0===i?void 0:i.range)&&t.add(n.scale.range.field),t}class Op extends sl{clone(){return new Op(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 r={},i=new Set;return n?(e.forEachFieldDef(((t,n)=>{const{aggregate:o,field:a}=t;if(o)if("count"===o){var s;null!==(s=r["*"])&&void 0!==s||(r["*"]={}),r["*"].count=new Set([Ja(t,{forAs:!0})])}else{if(Gn(o)||Jn(o)){var u;const t=Gn(o)?"argmin":"argmax",e=o[t];null!==(u=r[e])&&void 0!==u||(r[e]={}),r[e][t]=new Set([Ja({op:t,field:e},{forAs:!0})])}else{var c;null!==(c=r[a])&&void 0!==c||(r[a]={}),r[a][o]=new Set([Ja(t,{forAs:!0})])}var l;if(Ln(n)&&"unaggregated"===e.scaleDomain(n))null!==(l=r[a])&&void 0!==l||(r[a]={}),r[a].min=new Set([Ja({field:a,aggregate:"min"},{forAs:!0})]),r[a].max=new Set([Ja({field:a,aggregate:"max"},{forAs:!0})])}else Bp(i,n,t,e)})),i.size+bt(r).length===0?null:new Op(t,i,r)):null}static makeFromTransform(t,e){const n=new Set,r={};for(const s of e.aggregate){const{op:t,field:e,as:n}=s;var i,o;if(t)if("count"===t)null!==(i=r["*"])&&void 0!==i||(r["*"]={}),r["*"].count=new Set([n||Ja(s,{forAs:!0})]);else null!==(o=r[e])&&void 0!==o||(r[e]={}),r[e][t]=new Set([n||Ja(s,{forAs:!0})])}for(const s of null!==(a=e.groupby)&&void 0!==a?a:[]){var a;n.add(s)}return n.size+bt(r).length===0?null:new Op(t,n,r)}merge(t){return pt(this.dimensions,t.dimensions)?(function(t,e){for(const r of bt(e)){const i=e[r];for(const e of bt(i)){var n;r in t?t[r][e]=new Set([...null!==(n=t[r][e])&&void 0!==n?n:[],...i[e]]):t[r]={[e]:i[e]}}}}(this.measures,t.measures),!0):(function(){li.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 r=this.measures[e][n];0===r.size?t.add("".concat(n,"_").concat(e)):r.forEach(t.add,t)}return t}hash(){return"Aggregate ".concat(ot({dimensions:this.dimensions,measures:this.measures}))}assemble(){const t=[],e=[],n=[];for(const r of bt(this.measures))for(const i of bt(this.measures[r]))for(const o of this.measures[r][i])n.push(o),t.push(i),e.push("*"===r?null:Mt(r));return{type:"aggregate",groupby:[...this.dimensions].map(Mt),ops:t,fields:e,as:n}}}class Np extends sl{constructor(t,e,n,r){super(t),this.model=e,this.name=n,this.data=r;for(const i of Ne){const t=e.facet[i];if(t){const{bin:n,sort:r}=t;this[i]={name:e.getName("".concat(i,"_domain")),fields:[Ja(t),...tr(n)?[Ja(t,{binSuffix:"end"})]:[]],...ba(r)?{sortField:r}:(0,I.kJ)(r)?{sortIndexField:Nh(t,i)}:{}}}}this.childModel=e.child}hash(){let t="Facet";for(const e of Ne)this[e]&&(t+=" ".concat(e.charAt(0),":").concat(ot(this[e])));return t}get fields(){const t=[];for(const n of Ne){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 Ne)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 r=n.get("type"),i=n.get("range");if(so(r)&&lr(i)){const n=Fm(Cm(this.childModel,e));n?t[e]=n:di(Rr(e))}}}return t}assembleRowColumnHeaderData(t,e,n){const r={row:"y",column:"x",facet:void 0}[t],i=[],o=[],a=[];r&&n&&n[r]&&(e?(i.push("distinct_".concat(n[r])),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push("distinct_".concat(n[r])));const{sortField:s,sortIndexField:u}=this[t];if(s){const{op:t=ma,field:e}=s;i.push(e),o.push(t),a.push(Ja(s,{forAs:!0}))}else u&&(i.push(u),o.push("max"),a.push(u));return{name:this[t].name,source:null!==e&&void 0!==e?e:this.data,transform:[{type:"aggregate",groupby:this[t].fields,...i.length?{fields:i,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){const{columns:e}=this.model.layout,{layoutHeaders:n}=this.model.component,r=[],i={};for(const c of Ph){for(const t of Lh){var o;const e=null!==(o=n[c]&&n[c][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){i[c]=!0;break}}}if(i[c]){const t='length(data("'.concat(this.facet.name,'"))'),n="row"===c?e?{signal:"ceil(".concat(t," / ").concat(e,")")}:1:e?{signal:"min(".concat(t,", ").concat(e,")")}:{signal:t};r.push({name:"".concat(this.facet.name,"_").concat(c),transform:[{type:"sequence",start:0,stop:n}]})}}const{row:s,column:u}=i;return(s||u)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let e=null;const n=this.getChildIndependentFieldsWithStep(),{column:r,row:i,facet:o}=this;if(r&&i&&(n.x||n.y)){var a,s;e="cross_".concat(this.column.name,"_").concat(this.row.name);const r=[].concat(null!==(a=n.x)&&void 0!==a?a:[],null!==(s=n.y)&&void 0!==s?s:[]),i=r.map((()=>"distinct"));t.push({name:e,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:r,ops:i}]})}for(const u of[Wt,qt])this[u]&&t.push(this.assembleRowColumnHeaderData(u,e,n));if(o){const e=this.assembleFacetHeaderData(n);e&&t.push(...e)}return t}}function Tp(t){return t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function zp(t){const e={};return K(t.filter,(t=>{if(Pi(t)){let r=null;if(Mi(t))r=gr(t.equal);else if(Oi(t))r=gr(t.lte);else if(Bi(t))r=gr(t.lt);else if(Ni(t))r=gr(t.gt);else if(Ti(t))r=gr(t.gte);else if(zi(t))r=t.range[0];else if(Ri(t)){var n;r=(null!==(n=t.oneOf)&&void 0!==n?n:t.in)[0]}r&&(hi(r)?e[t.field]="date":(0,I.hj)(r)?e[t.field]="number":(0,I.HD)(r)&&(e[t.field]="string")),t.timeUnit&&(e[t.field]="date")}})),e}function Rp(t){const e={};function n(t){var n;cs(t)?e[t.field]="date":"quantitative"===t.type&&(n=t.aggregate,(0,I.HD)(n)&&st(["min","max"],n))?e[t.field]="number":Nt(t.field)>1?t.field in e||(e[t.field]="flatten"):qa(t)&&ba(t.sort)&&Nt(t.sort.field)>1&&(t.sort.field in e||(e[t.sort.field]="flatten"))}if((Vm(t)||Ym(t))&&t.forEachFieldDef(((e,r)=>{if(Ua(e))n(e);else{const i=Je(r),o=t.fieldDef(i);n({...e,type:o.type})}})),Vm(t)){const{mark:n,markDef:r,encoding:i}=t;if(jo(n)&&!t.encoding.order){const t=i["horizontal"===r.orient?"y":"x"];Na(t)&&"quantitative"===t.type&&!(t.field in e)&&(e[t.field]="number")}}return e}class Pp extends sl{clone(){return new Pp(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 r;let i={};const o=e.data;return!Vc(o)&&null!==o&&void 0!==o&&null!==(r=o.format)&&void 0!==r&&r.parse&&(i=o.format.parse),this.makeWithAncestors(t,i,{},n)}static makeWithAncestors(t,e,n,r){for(const a of bt(n)){const t=r.getWithExplicit(a);void 0!==t.value&&(t.explicit||t.value===n[a]||"derived"===t.value||"flatten"===n[a]?delete n[a]:di(qr(a,n[a],t.value)))}for(const a of bt(e)){const t=r.get(a);void 0!==t&&(t===e[a]?delete e[a]:di(qr(a,e[a],t)))}const i=new jc(e,n);r.copyAll(i);const o={};for(const a of bt(i.combine())){const t=i.get(a);null!==t&&(o[a]=t)}return 0===bt(o).length||r.parseNothing?null:new Pp(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===Nt(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||Nt(e)>1)).map((t=>{const e=function(t,e){const n=Ct(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=Tp(e.slice(5,e.length));return"timeParse(".concat(n,",'").concat(t,"')")}if(e.startsWith("utc:")){const t=Tp(e.slice(4,e.length));return"utcParse(".concat(n,",'").concat(t,"')")}return di('Unrecognized parse "'.concat(e,'".')),null}(t,this._parse[t]);if(!e)return null;return{type:"formula",expr:e,as:Ot(t)}})).filter((t=>null!==t))}}class Lp extends sl{clone(){return new Lp(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([cu])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:cu}}}class jp extends sl{clone(){return new jp(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 Up extends sl{clone(){return new Up(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 Ip extends sl{constructor(t){var e;let n;if(super(null),null!==(e=t)&&void 0!==e||(t={name:"source"}),Vc(t)||(n=t.format?{...rt(t.format,["parse"])}:{}),Jc(t))this._data={values:t.values};else if(Gc(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 Kc(t)?this._data={values:[{type:"Sphere"}]}:($c(t)||Vc(t))&&(this._data={});this._generator=Vc(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 qp,Wp=function(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"===typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n},Hp=function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"===typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)};function Xp(t){return t instanceof Ip||t instanceof jp||t instanceof Up}class Gp{constructor(){qp.set(this,void 0),Wp(this,qp,!1,"f")}setModified(){Wp(this,qp,!0,"f")}get modifiedFlag(){return Hp(this,qp,"f")}}qp=new WeakMap;class Jp extends Gp{getNodeDepths(t,e,n){n.set(t,e);for(const r of t.children)this.getNodeDepths(r,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 $p extends Gp{optimize(t){this.run(t);for(const e of t.children)this.optimize(e);return this.modifiedFlag}}class Vp extends $p{mergeNodes(t,e){const n=e.shift();for(const r of e)t.removeChild(r),r.parent=n,r.remove()}run(t){const e=t.children.map((t=>t.hash())),n={};for(let r=0;r<e.length;r++)void 0===n[e[r]]?n[e[r]]=[t.children[r]]:n[e[r]].push(t.children[r]);for(const r of bt(n))n[r].length>1&&(this.setModified(),this.mergeNodes(t,n[r]))}}class Yp extends $p{constructor(t){super(),this.requiresSelectionId=t&&Cf(t)}run(t){t instanceof Lp&&(this.requiresSelectionId&&(Xp(t.parent)||t.parent instanceof Op||t.parent instanceof Pp)||(this.setModified(),t.remove()))}}class Kp extends Gp{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,e){let n=new Set;t instanceof cl&&(n=t.producedFields(),mt(n,e)&&(this.setModified(),t.removeFormulas(e),0===t.producedFields.length&&t.remove()));for(const r of t.children)this.run(r,new Set([...e,...n]))}}class Zp extends $p{constructor(){super()}run(t){t instanceof ul&&!t.isRequired()&&(this.setModified(),t.remove())}}class Qp extends Jp{run(t){if(!Xp(t)&&!(t.numChildren()>1))for(const e of t.children)if(e instanceof Pp)if(t instanceof Pp)this.setModified(),t.merge(e);else{if(vt(t.producedFields(),e.dependentFields()))continue;this.setModified(),e.swapWithParent()}}}class tm extends Jp{run(t){const e=[...t.children],n=t.children.filter((t=>t instanceof Pp));if(t.numChildren()>1&&n.length>=1){const r={},i=new Set;for(const t of n){const e=t.parse;for(const t of bt(e))t in r?r[t]!==e[t]&&i.add(t):r[t]=e[t]}for(const t of i)delete r[t];if(!yt(r)){this.setModified();const n=new Pp(t,r);for(const i of e){if(i instanceof Pp)for(const t of bt(r))delete i.parse[t];t.removeChild(i),i.parent=n,i instanceof Pp&&0===bt(i.parse).length&&i.remove()}}}}}class em extends Jp{run(t){t instanceof ul||t.numChildren()>0||t instanceof Np||t instanceof Ip||(this.setModified(),t.remove())}}class nm extends Jp{run(t){const e=t.children.filter((t=>t instanceof cl)),n=e.pop();for(const r of e)this.setModified(),n.merge(r)}}class rm extends Jp{run(t){const e=t.children.filter((t=>t instanceof Op)),n={};for(const r of e){const t=ot(r.groupBy);t in n||(n[t]=[]),n[t].push(r)}for(const r of bt(n)){const e=n[r];if(e.length>1){const n=e.pop();for(const r of e)n.merge(r)&&(t.removeChild(r),r.parent=n,r.remove(),this.setModified())}}}}class im extends Jp{constructor(t){super(),this.model=t}run(t){const e=!(Xp(t)||t instanceof vh||t instanceof Pp||t instanceof Lp),n=[],r=[];for(const i of t.children)i instanceof Mp&&(e&&!vt(t.producedFields(),i.dependentFields())?n.push(i):r.push(i));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 Mp?t.merge(e,this.model.renameSignal.bind(this.model)):e.swapWithParent()}if(r.length>1){const t=r.pop();for(const e of r)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified()}}}class om extends Jp{run(t){const e=[...t.children];if(!ut(e,(t=>t instanceof ul))||t.numChildren()<=1)return;const n=[];let r;for(const i of e)if(i instanceof ul){let e=i;for(;1===e.numChildren();){const[t]=e.children;if(!(t instanceof ul))break;e=t}n.push(...e.children),r?(t.removeChild(i),i.parent=r.parent,r.parent.removeChild(r),r.parent=e,this.setModified()):r=e}else n.push(i);if(n.length){this.setModified();for(const t of n)t.parent.removeChild(t),t.parent=r}}}class am extends sl{clone(){return new am(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:Ja(t)}hash(){return"JoinAggregateTransform ".concat(ot(this.transform))}assemble(){const t=[],e=[],n=[];for(const i of this.transform.joinaggregate)e.push(i.op),n.push(this.getDefaultName(i)),t.push(void 0===i.field?null:i.field);const r=this.transform.groupby;return{type:"joinaggregate",as:n,ops:e,fields:t,...void 0!==r?{groupby:r}:{}}}}class sm extends sl{clone(){return new sm(null,tt(this._stack))}constructor(t,e){super(t),this._stack=e}static makeFromTransform(t,e){const{stack:n,groupby:r,as:i,offset:o="zero"}=e,a=[],s=[];if(void 0!==e.sort)for(const l of e.sort)a.push(l.field),s.push(Tt(l.order,"ascending"));const u={field:a,order:s};let c;return c=function(t){return(0,I.kJ)(t)&&t.every((t=>(0,I.HD)(t)))&&t.length>1}(i)?i:(0,I.HD)(i)?[i,"".concat(i,"_end")]:["".concat(e.stack,"_start"),"".concat(e.stack,"_end")],new sm(t,{dimensionFieldDefs:[],stackField:n,groupby:r,offset:o,sort:u,facetby:[],as:c})}static makeFromEncoding(t,e){const n=e.stack,{encoding:r}=e;if(!n)return null;const{groupbyChannels:i,fieldChannel:o,offset:a,impute:s}=n,u=i.map((t=>ns(r[t]))).filter((t=>!!t)),c=function(t){return t.stack.stackBy.reduce(((t,e)=>{const n=Ja(e.fieldDef);return n&&t.push(n),t}),[])}(e),l=e.encoding.order;let f;if((0,I.kJ)(l)||Na(l))f=Cr(l);else{const t=Sa(l)?l.sort:"y"===o?"descending":"ascending";f=c.reduce(((e,n)=>(e.field.push(n),e.order.push(t),e)),{field:[],order:[]})}return new sm(t,{dimensionFieldDefs:u,stackField:e.vgField(o),facetby:[],stackby:c,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?[Ja(t,{binSuffix:"mid"})]:[Ja(t,{}),Ja(t,{binSuffix:"end"})]:[Ja(t)])).flat():null!==n&&void 0!==n?n:[]}assemble(){const t=[],{facetby:e,dimensionFieldDefs:n,stackField:r,stackby:i,sort:o,offset:a,impute:s,as:u}=this._stack;if(s)for(const c of n){const{bandPosition:n=.5,bin:o}=c;if(o){const e=Ja(c,{expr:"datum"}),r=Ja(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:"".concat(n,"*").concat(e,"+").concat(1-n,"*").concat(r),as:Ja(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...i,...e],key:Ja(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...e],field:r,sort:o,as:u,offset:a}),t}}class um extends sl{clone(){return new um(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:Ja(t)}hash(){return"WindowTransform ".concat(ot(this.transform))}assemble(){const t=[],e=[],n=[],r=[];for(const f of this.transform.window)e.push(f.op),n.push(this.getDefaultName(f)),r.push(void 0===f.param?null:f.param),t.push(void 0===f.field?null:f.field);const i=this.transform.frame,o=this.transform.groupby;if(i&&null===i[0]&&null===i[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 u;a.push(f.field),s.push(null!==(u=f.order)&&void 0!==u?u:"ascending")}const c={field:a,order:s},l=this.transform.ignorePeers;return{type:"window",params:r,as:n,ops:e,fields:t,sort:c,...void 0!==l?{ignorePeers:l}:{},...void 0!==o?{groupby:o}:{},...void 0!==i?{frame:i}:{}}}}function cm(t){if(t instanceof Np)if(1!==t.numChildren()||t.children[0]instanceof ul){const n=t.model.component.data.main;lm(n);const r=(e=t,function t(n){if(!(n instanceof Np)){const r=n.clone();if(r instanceof ul){const t=fm+r.getSource();r.setSource(t),e.model.component.data.outputNodes[t]=r}else(r instanceof Op||r instanceof sm||r instanceof um||r instanceof am)&&r.addDimensions(e.fields);for(const e of n.children.flatMap(t))e.parent=r;return[r]}return n.children.flatMap(t)}),i=t.children.map(r).flat();for(const t of i)t.parent=n}else{const e=t.children[0];(e instanceof Op||e instanceof sm||e instanceof um||e instanceof am)&&e.addDimensions(t.fields),e.swapWithParent(),cm(t)}else t.children.map(cm);var e}function lm(t){if(t instanceof ul&&t.type===Qc.Main&&1===t.numChildren()){const e=t.children[0];e instanceof Np||(e.swapWithParent(),lm(t))}}const fm="scale_",dm=5;function hm(t){for(const e of t){for(const t of e.children)if(t.parent!==e)return!1;if(!hm(e.children))return!1}return!0}function pm(t,e){let n=!1;for(const r of e)n=t.optimize(r)||n;return n}function mm(t,e,n){let r=t.sources,i=!1;return i=pm(new Zp,r)||i,i=pm(new Yp(e),r)||i,r=r.filter((t=>t.numChildren()>0)),i=pm(new em,r)||i,r=r.filter((t=>t.numChildren()>0)),n||(i=pm(new Qp,r)||i,i=pm(new im(e),r)||i,i=pm(new Kp,r)||i,i=pm(new tm,r)||i,i=pm(new rm,r)||i,i=pm(new nm,r)||i,i=pm(new Vp,r)||i,i=pm(new om,r)||i),t.sources=r,i}class gm{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,e){return new gm((()=>t(e)))}}function vm(t){Vm(t)?function(t){const e=t.component.scales;for(const n of bt(e)){const r=ym(t,n);if(e[n].setWithExplicit("domains",r),_m(t,n),t.component.data.isFaceted){let e=t;for(;!Ym(e)&&e.parent;)e=e.parent;if("shared"===e.component.resolve.scale[n])for(const t of r.value)fr(t)&&(t.data=fm+t.data.replace(fm,""))}}}(t):function(t){for(const n of t.children)vm(n);const e=t.component.scales;for(const n of bt(e)){let r,i=null;for(const e of t.children){const t=e.component.scales[n];if(t){r=void 0===r?t.getWithExplicit("domains"):Hc(r,t.getWithExplicit("domains"),"domains","scale",Em);const e=t.get("selectionExtent");i&&e&&i.param!==e.param&&di(Ur),i=e}}e[n].setWithExplicit("domains",r),i&&e[n].set("selectionExtent",i,!0)}}(t)}function ym(t,e){const n=t.getScaleComponent(e).get("type"),{encoding:r}=t,i=function(t,e,n,r){if("unaggregated"===t){const{valid:t,reason:r}=wm(e,n);if(!t)return void di(r)}else if(void 0===t&&r.useUnaggregatedDomain){const{valid:t}=wm(e,n);if(t)return"unaggregated"}return t}(t.scaleDomain(e),t.typedFieldDef(e),n,t.config.scale);return i!==t.scaleDomain(e)&&(t.specifiedScales[e]={...t.specifiedScales[e],domain:i}),"x"===e&&rs(r.x2)?rs(r.x)?Hc(xm(n,i,t,"x"),xm(n,i,t,"x2"),"domain","scale",Em):xm(n,i,t,"x2"):"y"===e&&rs(r.y2)?rs(r.y)?Hc(xm(n,i,t,"y"),xm(n,i,t,"y2"),"domain","scale",Em):xm(n,i,t,"y2"):xm(n,i,t,e)}function bm(t,e,n){var r;const i=null===(r=ki(n))||void 0===r?void 0:r.unit;return"temporal"===e||i?function(t,e,n){return t.map((t=>{const r=ls(t,{timeUnit:n,type:e});return{signal:"{data: ".concat(r,"}")}}))}(t,e,i):[t]}function xm(t,e,n,r){const{encoding:i}=n,o=rs(i[r]),{type:a}=o,s=o.timeUnit;if(function(t){return null===t||void 0===t?void 0:t.unionWith}(e)){const i=xm(t,void 0,n,r);return Uc([...bm(e.unionWith,a,s),...i.value])}if(cr(e))return Uc([e]);if(e&&"unaggregated"!==e&&!fo(e))return Uc(bm(e,a,s));const u=n.stack;if(u&&r===u.fieldChannel){if("normalize"===u.offset)return Ic([[0,1]]);const t=n.requestDataName(Qc.Main);return Ic([{data:t,field:n.vgField(r,{suffix:"start"})},{data:t,field:n.vgField(r,{suffix:"end"})}])}const c=Ln(r)&&Na(o)?function(t,e,n){if(!so(n))return;const r=t.fieldDef(e),i=r.sort;if(xa(i))return{op:"min",field:Nh(r,e),order:"ascending"};const{stack:o}=t,a=o?new Set([...o.groupbyFields,...o.stackBy.map((t=>t.fieldDef.field))]):void 0;if(ba(i)){return Am(i,o&&!a.has(i.field))}if(ya(i)){const{encoding:e,order:n}=i,r=t.fieldDef(e),{aggregate:s,field:u}=r,c=o&&!a.has(u);if(Gn(s)||Jn(s))return Am({field:Ja(r),order:n},c);if($n(s)||!s)return Am({op:s,field:u,order:n},c)}else{if("descending"===i)return{op:"min",field:t.vgField(e),order:"descending"};if(st(["ascending",void 0],i))return!0}return}(n,r,t):void 0;if(za(o)){return Ic(bm([o.datum],a,s))}const l=o;if("unaggregated"===e){const t=n.requestDataName(Qc.Main),{field:e}=o;return Ic([{data:t,field:Ja({field:e,aggregate:"min"})},{data:t,field:Ja({field:e,aggregate:"max"})}])}if(tr(l.bin)){if(so(t))return Ic("bin-ordinal"===t?[]:[{data:_t(c)?n.requestDataName(Qc.Main):n.requestDataName(Qc.Raw),field:n.vgField(r,ds(l,r)?{binSuffix:"range"}:{}),sort:!0!==c&&(0,I.Kn)(c)?c:{field:n.vgField(r,{}),op:"min"}}]);{const{bin:t}=l;if(tr(t)){const e=kp(n,l.field,t);return Ic([new gm((()=>{const t=n.getSignalName(e);return"[".concat(t,".start, ").concat(t,".stop]")}))])}return Ic([{data:n.requestDataName(Qc.Main),field:n.vgField(r,{})}])}}if(l.timeUnit&&st(["time","utc"],t)&&ka(l,Vm(n)?n.encoding[Ve(r)]:void 0,n.markDef,n.config)){const t=n.requestDataName(Qc.Main);return Ic([{data:t,field:n.vgField(r)},{data:t,field:n.vgField(r,{suffix:"end"})}])}return Ic(c?[{data:_t(c)?n.requestDataName(Qc.Main):n.requestDataName(Qc.Raw),field:n.vgField(r),sort:c}]:[{data:n.requestDataName(Qc.Main),field:n.vgField(r)}])}function Am(t,e){const{op:n,field:r,order:i}=t;return{op:null!==n&&void 0!==n?n:e?"sum":ma,...r?{field:Mt(r)}:{},...i?{order:i}:{}}}function _m(t,e){var n;const r=t.component.scales[e],i=t.specifiedScales[e].domain,o=null===(n=t.fieldDef(e))||void 0===n?void 0:n.bin,a=fo(i)&&i,s=nr(o)&&rr(o.extent)&&o.extent;(a||s)&&r.set("selectionExtent",null!==a&&void 0!==a?a:s,!0)}function wm(t,e){const{aggregate:n,type:r}=t;return n?(0,I.HD)(n)&&!Zn.has(n)?{valid:!1,reason:ei(n)}:"quantitative"===r&&"log"===e?{valid:!1,reason:ni(t)}:{valid:!0}:{valid:!1,reason:ti(t)}}function Em(t,e,n,r){return t.explicit&&e.explicit&&di(function(t,e,n,r){return"Conflicting ".concat(e.toString(),' property "').concat(t.toString(),'" (').concat(it(n)," and ").concat(it(r),"). Using the union of the two domains.")}(n,r,t.value,e.value)),{explicit:t.explicit,value:[...t.value,...e.value]}}function Dm(t){const e=dt(t.map((t=>{if(fr(t)){const{sort:e,...n}=t;return n}return t})),ot),n=dt(t.map((t=>{if(fr(t)){const e=t.sort;return void 0===e||_t(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(fr(e)&&n.length>0){let t=n[0];if(n.length>1){di(oi);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 r=dt(n.map((t=>_t(t)||!("op"in t)||(0,I.HD)(t.op)&&t.op in Xn?t:(di(function(t){return"Dropping sort property ".concat(it(t),' as unioned domains only support boolean or op "count", "min", and "max".')}(t)),!0))),ot);let i;1===r.length?i=r[0]:r.length>1&&(di(oi),i=!0);const o=dt(t.map((t=>fr(t)?t.data:null)),(t=>t));if(1===o.length&&null!==o[0]){return{data:o[0],fields:e.map((t=>t.field)),...i?{sort:i}:{}}}return{fields:e,...i?{sort:i}:{}}}function Fm(t){if(fr(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(fr(n)&&(0,I.HD)(n.field))if(e){if(e!==n.field)return di("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 di("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)){di("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 Cm(t,e){const n=t.component.scales[e].get("domains").map((e=>(fr(e)&&(e.data=t.lookupDataSource(e.data)),e)));return Dm(n)}function km(t){return Zm(t)||Km(t)?t.children.reduce(((t,e)=>t.concat(km(e))),Sm(t)):Sm(t)}function Sm(t){return bt(t.component.scales).reduce(((e,n)=>{const r=t.component.scales[n];if(r.merged)return e;const i=r.combine(),{name:o,type:a,selectionExtent:s,domains:u,range:c,reverse:l,...f}=i,d=function(t,e,n,r){if(xn(n)){if(lr(t))return{step:{signal:"".concat(e,"_step")}}}else if((0,I.Kn)(t)&&fr(t))return{...t,data:r.lookupDataSource(t.data)};return t}(i.range,o,n,t),h=Cm(t,n),p=s?function(t,e,n,r){const i=bh(t,e.param,e);return{signal:uo(n.get("type"))&&(0,I.kJ)(r)&&r[0]>r[1]?"isValid(".concat(i,") && reverse(").concat(i,")"):i}}(t,s,r,h):null;return e.push({name:o,type:a,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...void 0!==l?{reverse:l}:{},...f}),e}),[])}class Mm extends jc{constructor(t,e){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",e)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||ut(this.get("domains"),(t=>(0,I.kJ)(t)&&2===t.length&&t[0]<=0&&t[1]>=0))}}const Bm=["range","scheme"];function Om(t,e){const n=t.fieldDef(e);if(null!==n&&void 0!==n&&n.bin){const{bin:r,field:i}=n,o=Ye(e),a=t.getName(o);if((0,I.Kn)(r)&&r.binned&&void 0!==r.step)return new gm((()=>{const n=t.scaleName(e),i='(domain("'.concat(n,'")[1] - domain("').concat(n,'")[0]) / ').concat(r.step);return"".concat(t.getSignalName(a)," / (").concat(i,")")}));if(tr(r)){const e=kp(t,i,r);return new gm((()=>{const n=t.getSignalName(e),r="(".concat(n,".stop - ").concat(n,".start) / ").concat(n,".step");return"".concat(t.getSignalName(a)," / (").concat(r,")")}))}}}function Nm(t,e){const n=e.specifiedScales[t],{size:r}=e,i=e.getScaleComponent(t).get("type");for(const l of Bm)if(void 0!==n[l]){const r=_o(i,l),o=wo(t,l);if(r)if(o)di(o);else switch(l){case"range":{const r=n.range;if((0,I.kJ)(r)){if(xn(t))return Uc(r.map((t=>{if("width"===t||"height"===t){const n=e.getName(t),r=e.getSignalName.bind(e);return gm.fromName(r,n)}return t})))}else if((0,I.Kn)(r))return Uc({data:e.requestDataName(Qc.Main),field:r.field,sort:{op:"min",field:e.vgField(t)}});return Uc(r)}case"scheme":return Uc(Tm(n[l]))}else di(ri(i,l,t))}const o=t===Xt||"xOffset"===t?"width":"height",a=r[o];if(bu(a))if(xn(t))if(so(i)){const n=zm(a,e,t);if(n)return Uc({step:n})}else di(ii(o));else if(Dn(t)){const n=t===Vt?"x":"y";if("band"===e.getScaleComponent(n).get("type")){const t=Rm(a,i);if(t)return Uc(t)}}const{rangeMin:s,rangeMax:u}=n,c=function(t,e){const{size:n,config:r,mark:i,encoding:o}=e,a=e.getSignalName.bind(e),{type:s}=rs(o[t]),u=e.getScaleComponent(t),c=u.get("type"),{domain:l,domainMid:f}=e.specifiedScales[t];switch(t){case Xt:case Gt:{if(st(["point","band"],c)){const i=Pm(t,n,r.view);if(bu(i)){return{step:zm(i,e,t)}}}const i=Ye(t),o=e.getName(i);return t===Gt&&uo(c)?[gm.fromName(a,o),0]:[0,gm.fromName(a,o)]}case Vt:case Yt:return function(t,e,n){const r=t===Vt?"x":"y",i=e.getScaleComponent(r),o=i.get("type"),a=e.scaleName(r);if("band"===o){const t=Pm(r,e.size,e.config.view);if(bu(t)){const e=Rm(t,n);if(e)return e}return[0,{signal:"bandwidth('".concat(a,"')")}]}{const n=e.encoding[r];if(Na(n)&&n.timeUnit){const t=Si(n.timeUnit,(t=>"scale('".concat(a,"', ").concat(t,")"))),r=e.config.scale.bandWithNestedOffsetPaddingInner;if(r){const e=cr(r)?"".concat(r.signal,"/2"):"".concat(r/2),n=cr(r)?"(1 - ".concat(r.signal,"/2)"):"".concat(1-r/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(r," scale is not discrete."))}}(t,e,c);case ce:{const o=Lm(i,e.component.scales[t].get("zero"),r),a=function(t,e,n,r){const i={x:Om(n,"x"),y:Om(n,"y")};switch(t){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const t=Um(e,i,r.view);return(0,I.hj)(t)?t-1:new gm((()=>"".concat(t.signal," - 1")))}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const t=Um(e,i,r.view);return(0,I.hj)(t)?Math.pow(jm*t,2):new gm((()=>"pow(".concat(jm," * ").concat(t.signal,", 2)")))}}throw new Error(Vr("size",t))}(i,n,e,r);return lo(c)?function(t,e,n){const r=()=>{const r=xr(e),i=xr(t),o="(".concat(r," - ").concat(i,") / (").concat(n," - 1)");return"sequence(".concat(i,", ").concat(r," + ").concat(o,", ").concat(o,")")};return cr(e)?new gm(r):{signal:r()}}(o,a,function(t,e,n,r){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:(di(function(t){return"Domain for ".concat(t," is required for threshold scale.")}(r)),3)}}(c,r,l,t)):[o,a]}case Qt:return[0,2*Math.PI];case le:return[0,360];case Kt:return[0,new gm((()=>{const t=e.getSignalName("width"),n=e.getSignalName("height");return"min(".concat(t,",").concat(n,")/2")}))];case pe:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case me:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case ue:return"symbol";case oe:case ae:case se:return"ordinal"===c?"nominal"===s?"category":"ordinal":void 0!==f?"diverging":"rect"===i||"geoshape"===i?"heatmap":"ramp";case fe:case de:case he:return[r.scale.minOpacity,r.scale.maxOpacity]}}(t,e);return(void 0!==s||void 0!==u)&&_o(i,"rangeMin")&&(0,I.kJ)(c)&&2===c.length?Uc([null!==s&&void 0!==s?s:c[0],null!==u&&void 0!==u?u:c[1]]):Ic(c)}function Tm(t){return function(t){return!(0,I.HD)(t)&&!!t.name}(t)?{scheme:t.name,...rt(t,["name"])}:{scheme:t}}function zm(t,e,n){const{encoding:r}=e,i=e.getScaleComponent(n),o=Ze(n),a=r[o];if("offset"===yu({step:t,offsetIsDiscrete:ja(a)&&Hi(a.type)})&&Es(r,o)){var s;const n=e.getScaleComponent(o),r=e.scaleName(o);let a="domain('".concat(r,"').length");if("band"===n.get("type")){var u,c,l,f;const t=null!==(u=null!==(c=n.get("paddingInner"))&&void 0!==c?c:n.get("padding"))&&void 0!==u?u:0,e=null!==(l=null!==(f=n.get("paddingOuter"))&&void 0!==f?f:n.get("padding"))&&void 0!==l?l:0;a="bandspace(".concat(a,", ").concat(t,", ").concat(e,")")}const h=null!==(s=i.get("paddingInner"))&&void 0!==s?s:i.get("padding");return{signal:"".concat(t.step," * ").concat(a," / (1-").concat((d=h,cr(d)?d.signal:(0,I.m8)(d)),")")}}return t.step;var d}function Rm(t,e){if("offset"===yu({step:t,offsetIsDiscrete:so(e)}))return{step:t.step}}function Pm(t,e,n){const r=t===Xt?"width":"height",i=e[r];return i||Eu(n,r)}function Lm(t,e,n){if(e)return cr(e)?{signal:"".concat(e.signal," ? 0 : ").concat(Lm(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(Vr("size",t))}const jm=.95;function Um(t,e,n){const r=bu(t.width)?t.width.step:wu(n,"width"),i=bu(t.height)?t.height.step:wu(n,"height");return e.x||e.y?new gm((()=>{const t=[e.x?e.x.signal:r,e.y?e.y.signal:i];return"min(".concat(t.join(", "),")")})):Math.min(r,i)}function Im(t,e){Vm(t)?function(t,e){const n=t.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=t;for(const s of bt(n)){const u=a[s],c=n[s],l=t.getScaleComponent(s),f=rs(i[s]),d=u[e],h=l.get("type"),p=l.get("padding"),m=l.get("paddingInner"),g=_o(h,e),v=wo(s,e);if(void 0!==d&&(g?v&&di(v):di(ri(h,e,s))),g&&void 0===v)if(void 0!==d){const t=f.timeUnit,n=f.type;switch(e){case"domainMax":case"domainMin":hi(u[e])||"temporal"===n||t?c.set(e,{signal:ls(u[e],{type:n,timeUnit:t})},!0):c.set(e,u[e],!0);break;default:c.copyKeyFromObject(e,u)}}else{const n=e in qm?qm[e]({model:t,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:m,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:o,config:r,hasNestedOffsetScale:Ds(i,s),hasSecondaryRangeChannel:!!i[Ve(s)]}):r.scale[e];void 0!==n&&c.set(e,n,!1)}}}(t,e):Hm(t,e)}const qm={bins:t=>{let{model:e,fieldOrDatumDef:n}=t;return Na(n)?function(t,e){const n=e.bin;if(tr(n)){const r=kp(t,e.field,n);return new gm((()=>t.getSignalName(r)))}if(er(n)&&nr(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:r,domainMin:i,domainMax:o,fieldOrDatumDef:a}=t;return function(t,e,n,r,i,o){var a;if(null!==(a=ns(o))&&void 0!==a&&a.bin||(0,I.kJ)(n)||null!=i||null!=r||st([Yi.TIME,Yi.UTC],t))return;return!!xn(e)||void 0}(e,n,r,i,o,a)},padding:t=>{let{channel:e,scaleType:n,fieldOrDatumDef:r,markDef:i,config:o}=t;return function(t,e,n,r,i,o){if(xn(t)){if(co(e)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:e,orient:a}=i;if("bar"===e&&(!Na(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===t||"horizontal"===a&&"y"===t))return o.continuousBandSize}if(e===Yi.POINT)return n.pointPadding}return}(e,n,o.scale,r,i,o.bar)},paddingInner:t=>{let{scalePadding:e,channel:n,markDef:r,scaleType:i,config:o,hasNestedOffsetScale:a}=t;return function(t,e,n,r,i){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:r,bandWithNestedOffsetPaddingInner:a}=i;return o?a:Tt(t,"bar"===n?e:r)}if(Dn(e)&&r===Yi.BAND)return i.offsetBandPaddingInner;return}(e,n,r.type,i,o.scale,a)},paddingOuter:t=>{let{scalePadding:e,channel:n,scaleType:r,scalePaddingInner:i,config:o,hasNestedOffsetScale:a}=t;return function(t,e,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(void 0!==t)return;if(xn(e)){const{bandPaddingOuter:t,bandWithNestedOffsetPaddingOuter:e}=i;if(o)return e;if(n===Yi.BAND)return Tt(t,cr(r)?{signal:"".concat(r.signal,"/2")}:r/2)}else if(Dn(e)){if(n===Yi.POINT)return.5;if(n===Yi.BAND)return i.offsetBandPaddingOuter}return}(e,n,r,i,o.scale,a)},reverse:t=>{let{fieldOrDatumDef:e,scaleType:n,channel:r,config:i}=t;return function(t,e,n,r){if("x"===n&&void 0!==r.xReverse)return uo(t)&&"descending"===e?cr(r.xReverse)?{signal:"!".concat(r.xReverse.signal)}:!r.xReverse:r.xReverse;if(uo(t)&&"descending"===e)return!0;return}(n,Na(e)?e.sort:void 0,r,i.scale)},zero:t=>{let{channel:e,fieldOrDatumDef:n,domain:r,markDef:i,scaleType:o,config:a,hasSecondaryRangeChannel:s}=t;return function(t,e,n,r,i,o,a){if(n&&"unaggregated"!==n&&uo(i)){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&&!lo(i))return!0;if((!Na(e)||!e.bin)&&st([...bn,..._n],t)){const{orient:e,type:n}=r;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,r,i,o,a.scale,s)}};function Wm(t){Vm(t)?function(t){const e=t.component.scales;for(const n of Pn){const r=e[n];if(!r)continue;const i=Nm(n,t);r.setWithExplicit("range",i)}}(t):Hm(t,"range")}function Hm(t,e){const n=t.component.scales;for(const r of t.children)"range"===e?Wm(r):Im(r,e);for(const r of bt(n)){let i;for(const n of t.children){const t=n.component.scales[r];if(t){i=Hc(i,t.getWithExplicit(e),e,"scale",qc(((t,n)=>"range"===e&&t.step&&n.step?t.step-n.step:0)))}}n[r].setWithExplicit(e,i)}}function Xm(t,e,n,r){const i=function(t,e,n,r){switch(e.type){case"nominal":case"ordinal":var i;if(Be(t)||"discrete"===Wn(t))return"shape"===t&&"ordinal"===e.type&&di(Qr(t,"ordinal")),"ordinal";if(xn(t)||Dn(t)){if(st(["rect","bar","image","rule"],n.type))return"band";if(r)return"band"}else if("arc"===n.type&&t in An)return"band";return Go(n[Ye(t)])||Wa(e)&&null!==(i=e.axis)&&void 0!==i&&i.tickBand?"band":"point";case"temporal":return Be(t)?"time":"discrete"===Wn(t)?(di(Qr(t,"temporal")),"ordinal"):Na(e)&&e.timeUnit&&ki(e.timeUnit).utc?"utc":"time";case"quantitative":return Be(t)?Na(e)&&tr(e.bin)?"bin-ordinal":"linear":"discrete"===Wn(t)?(di(Qr(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Gr(e.type))}(e,n,r,arguments.length>4&&void 0!==arguments[4]&&arguments[4]),{type:o}=t;return Ln(e)?void 0!==o?function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!Ln(t))return!1;switch(t){case Xt:case Gt:case Vt:case Yt:case Qt:case Kt:return!!co(e)||"band"===e||"point"===e&&!n;case ce:case pe:case fe:case de:case he:case le:return co(e)||lo(e)||st(["band","point","ordinal"],e);case oe:case ae:case se:return"band"!==e;case me:case ue:return"ordinal"===e||lo(e)}}(e,o)?Na(n)&&(a=o,s=n.type,!(st([Gi,$i],s)?void 0===a||so(a):s===Ji?st([Yi.TIME,Yi.UTC,void 0],a):s!==Xi||ro(a)||lo(a)||void 0===a))?(di(function(t,e){return'FieldDef does not work with "'.concat(t,'" scale. We are using "').concat(e,'" scale instead.')}(o,i)),i):o:(di(function(t,e,n){return'Channel "'.concat(t,'" does not work with "').concat(e,'" scale. We are using "').concat(n,'" scale instead.')}(e,o,i)),i):i:null;var a,s}function Gm(t){Vm(t)?t.component.scales=function(t){const{encoding:e,mark:n,markDef:r}=t,i={};for(const a of Pn){const s=rs(e[a]);if(s&&n===Lo&&a===ue&&s.type===Vi)continue;let u=s&&s.scale;if(Dn(a)){if(!Ds(e,Qe(a))){u&&di(Yr(a));continue}}if(s&&null!==u&&!1!==u){var o;null!==(o=u)&&void 0!==o||(u={});const n=Xm(u,a,s,r,Ds(e,a));i[a]=new Mm(t.scaleName("".concat(a),!0),{value:n,explicit:u.type===n})}}return i}(t):t.component.scales=function(t){var e;const n=t.component.scales={},r={},i=t.component.resolve;for(const a of t.children){Gm(a);for(const n of bt(a.component.scales)){var o;if(null!==(o=(e=i.scale)[n])&&void 0!==o||(e[n]=ep(n,t)),"shared"===i.scale[n]){const t=r[n],e=a.component.scales[n].getWithExplicit("type");t?Zi(t.value,e.value)?r[n]=Hc(t,e,"type","scale",Jm):(i.scale[n]="independent",delete r[n]):r[n]=e}}}for(const a of bt(r)){const e=t.scaleName(a,!0),i=r[a];n[a]=new Mm(e,i);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 Jm=qc(((t,e)=>to(t)-to(e)));class $m{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 Vm(t){return"unit"===(null===t||void 0===t?void 0:t.type)}function Ym(t){return"facet"===(null===t||void 0===t?void 0:t.type)}function Km(t){return"concat"===(null===t||void 0===t?void 0:t.type)}function Zm(t){return"layer"===(null===t||void 0===t?void 0:t.type)}class Qm{constructor(t,e,n,r,i,o,a){var s,u;this.type=e,this.parent=n,this.config=i,this.correctDataNames=t=>{var e,n,r;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!==(r=n.facet)&&void 0!==r&&r.data&&(t.from.facet.data=this.lookupDataSource(t.from.facet.data)),t},this.parent=n,this.config=i,this.view=ar(a),this.name=null!==(s=t.name)&&void 0!==s?s:r,this.title=ur(t.title)?{text:t.title}:t.title?ar(t.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new $m,this.projectionNameMap=n?n.projectionNameMap:new $m,this.signalNameMap=n?n.signalNameMap:new $m,this.data=t.data,this.description=t.description,this.transforms=(null!==(u=t.transform)&&void 0!==u?u:[]).map((t=>sc(t)?{filter:Z(t.filter,Ii)}:t)),this.layout="layer"===e||"unit"===e?{}:function(t,e,n){const r=n[e],i={},{spacing:o,columns:a}=r;void 0!==o&&(i.spacing=o),void 0!==a&&(wa(t)&&!Aa(t.facet)||mu(t))&&(i.columns=a),gu(t)&&(i.columns=1);for(const c of Au)if(void 0!==t[c])if("spacing"===c){var s,u;const e=t[c];i[c]=(0,I.hj)(e)?e:{row:null!==(s=e.row)&&void 0!==s?s:o,column:null!==(u=e.column)&&void 0!==u?u:o}}else i[c]=t[c];return i}(t,e,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:wa(t)||(null===n||void 0===n?void 0:n.component.data.isFaceted)&&void 0===t.data},layoutSize:new jc,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]:{};Gm(t),vm(t);for(const n of Ao)Im(t,n);e||Wm(t)}(this)}parseProjection(){Dp(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){mp(this)}assembleEncodeFromView(t){const{style:e,...n}=t,r={};for(const i of bt(n)){const t=n[i];void 0!==t&&(r[i]=yr(t))}return r}assembleGroupEncodeEntry(t){let e={};var n;if((this.view&&(e=this.assembleEncodeFromView(this.view)),!t)&&(this.description&&(e.description=yr(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:r}=this,i=function(t,e){const n={};for(const r of Ne){const i=t[r];if(null!==i&&void 0!==i&&i.facetFieldDef){const{titleAnchor:t,titleOrient:o}=Rh(["titleAnchor","titleOrient"],i.facetFieldDef.header,e,r),a=Th(r,o),s=Jh(t,a);void 0!==s&&(n[a]=s)}}return yt(n)?void 0:n}(n.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...e,...i?{titleBand:i}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let e=[];for(const n of Ne)t[n].title&&e.push(jh(this,n));for(const n of Ph)e=e.concat(qh(this,n));return e}assembleAxes(){return function(t,e){const{x:n=[],y:r=[]}=t;return[...n.map((t=>_h(t,"grid",e))),...r.map((t=>_h(t,"grid",e))),...n.map((t=>_h(t,"main",e))),...r.map((t=>_h(t,"main",e)))].filter((t=>t))}(this.component.axes,this.config)}assembleLegends(){return xp(this)}assembleProjections(){return Ap(this)}assembleTitle(){var t;const{encoding:e,...n}=null!==(t=this.title)&&void 0!==t?t:{},r={...sr(this.config.title).nonMarkTitleProperties,...n,...e?{encode:{update:e}}:{}};if(r.text){var i,o;if(st(["unit","layer"],this.type)){if(st(["middle",void 0],r.anchor))null!==(i=r.frame)&&void 0!==i||(r.frame="group")}else null!==(o=r.anchor)&&void 0!==o||(r.anchor="start");return yt(r)?void 0:r}}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 r=!this.parent||Ym(this.parent)?km(this):[];r.length>0&&(e.scales=r);const i=this.assembleAxes();i.length>0&&(e.axes=i);const o=this.assembleLegends();return o.length>0&&(e.legends=o),e}getName(t){return wt((this.name?"".concat(this.name,"_"):"")+t)}getDataName(t){return this.getName(Qc[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(Ym(this.parent)){const e=wn(Qh(t)),n=this.component.scales[e];if(n&&!n.merged){const t=n.get("type"),r=n.get("range");if(so(t)&&lr(r)){const t=n.get("name"),r=Fm(Cm(this,e));if(r){return{signal:Zh(t,n,Ja({aggregate:"distinct",field:r},{expr:"datum"}))}}return di(Rr(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)&&Ln(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 tg extends Qm{vgField(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.fieldDef(t);if(n)return Ja(n,e)}reduceFieldDef(t,e){return function(t,e,n,r){return t?bt(t).reduce(((n,i)=>{const o=t[i];return(0,I.kJ)(o)?o.reduce(((t,n)=>e.call(r,t,n,i)),n):e.call(r,n,o,i)}),n):n}(this.getMapping(),((e,n,r)=>{const i=ns(n);return i?t(e,i,r):e}),e)}forEachFieldDef(t,e){Ms(this.getMapping(),((e,n)=>{const r=ns(e);r&&t(r,n)}),e)}}class eg extends sl{clone(){return new eg(null,tt(this.transform))}constructor(t,e){var n,r,i;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!==(r=o[0])&&void 0!==r?r:"value",null!==(i=o[1])&&void 0!==i?i:"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 ng extends sl{clone(){return new ng(null,{...this.filter})}constructor(t,e){super(t),this.filter=e}static make(t,e){const{config:n,mark:r,markDef:i}=e;if("filter"!==wr("invalid",i,n))return null;const o=e.reduceFieldDef(((t,n,i)=>{const o=Ln(i)&&e.getScaleComponent(i);if(o){uo(o.get("type"))&&"count"!==n.aggregate&&!jo(r)&&(t[n.field]=n)}return t}),{});return bt(o).length?new ng(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],r=Ja(n,{expr:"datum"});return null!==n&&("temporal"===n.type?t.push("(isDate(".concat(r,") || (isValid(").concat(r,") && isFinite(+").concat(r,")))")):"quantitative"===n.type&&(t.push("isValid(".concat(r,")")),t.push("isFinite(+".concat(r,")")))),t}),[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class rg extends sl{clone(){return new rg(this.parent,tt(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=tt(e);const{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map(((t,e)=>{var n;return null!==(n=r[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 ig extends sl{clone(){return new ig(null,tt(this.transform))}constructor(t,e){var n,r,i;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!==(r=o[0])&&void 0!==r?r:"key",null!==(i=o[1])&&void 0!==i?i:"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 og extends sl{clone(){return new og(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 r of[[ne,ee],[ie,re]]){const i=r.map((t=>{const n=rs(e.encoding[t]);return Na(n)?n.field:za(n)?{expr:"".concat(n.datum)}:Ia(n)?{expr:"".concat(n.value)}:void 0}));(i[0]||i[1])&&(t=new og(t,i,null,e.getName("geojson_".concat(n++))))}if(e.channelHasField(ue)){const r=e.typedFieldDef(ue);r.type===Vi&&(t=new og(t,null,r.field,e.getName("geojson_".concat(n++))))}return t}constructor(t,e,n,r){super(t),this.fields=e,this.geojson=n,this.signal=r}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 ag extends sl{clone(){return new ag(null,this.projection,tt(this.fields),tt(this.as))}constructor(t,e,n,r){super(t),this.projection=e,this.fields=n,this.as=r}static parseAll(t,e){if(!e.projectionName())return t;for(const n of[[ne,ee],[ie,re]]){const r=n.map((t=>{const n=rs(e.encoding[t]);return Na(n)?n.field:za(n)?{expr:"".concat(n.datum)}:Ia(n)?{expr:"".concat(n.value)}:void 0})),i=n[0]===ie?"2":"";(r[0]||r[1])&&(t=new ag(t,e.projectionName(),r,[e.getName("x".concat(i)),e.getName("y".concat(i))]))}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 sg extends sl{clone(){return new sg(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:r}=t,i=[e,n,...r?[r]:[]].join(",");return{signal:"sequence(".concat(i,")")}}static makeFromTransform(t,e){return new sg(t,e)}static makeFromEncoding(t,e){const n=e.encoding,r=n.x,i=n.y;if(Na(r)&&Na(i)){const o=r.impute?r:i.impute?i:void 0;if(void 0===o)return;const a=r.impute?i:i.impute?r:void 0,{method:s,value:u,frame:c,keyvals:l}=o.impute,f=Bs(e.mark,n);return new sg(t,{impute:o.field,key:a.field,...s?{method:s}:{},...void 0!==u?{value:u}:{},...c?{frame:c}:{},...void 0!==l?{keyvals:l}:{},...f.length?{groupby:f}:{}})}return null}hash(){return"Impute ".concat(ot(this.transform))}assemble(){const{impute:t,key:e,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,s={type:"impute",field:t,key:e,...n?{keyvals:uc(n)?this.processSequence(n):n}:{},method:"value",...i?{groupby:i}:{},value:r&&"value"!==r?null:o};if(r&&"value"!==r){return[s,{type:"window",as:["imputed_".concat(t,"_value")],ops:[r],fields:[t],frame:a,ignorePeers:!1,...i?{groupby:i}:{}},{type:"formula",expr:"datum.".concat(t," === null ? datum.imputed_").concat(t,"_value : datum.").concat(t),as:t}]}return[s]}}class ug extends sl{clone(){return new ug(null,tt(this.transform))}constructor(t,e){var n,r,i;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!==(r=o[0])&&void 0!==r?r:e.on,null!==(i=o[1])&&void 0!==i?i: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 cg extends sl{clone(){return new cg(null,tt(this.transform),this.secondary)}constructor(t,e,n){super(t),this.transform=e,this.secondary=n}static make(t,e,n,r){const i=e.component.data.sources,{from:o}=n;let a=null;if(function(t){return"data"in t}(o)){let t=Eg(o.data,i);t||(t=new Ip(o.data),i.push(t));const n=e.getName("lookup_".concat(r));a=new ul(t,n,Qc.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 r;n={as:t,...n};try{r=e.getSelectionComponent(wt(t),t)}catch(s){throw new Error('Lookups can only be performed on selection parameters. "'.concat(t,'" is a variable parameter.'))}if(a=r.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 cg(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)||(di('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 lg extends sl{clone(){return new lg(null,tt(this.transform))}constructor(t,e){var n,r,i;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!==(r=o[0])&&void 0!==r?r:"prob",null!==(i=o[1])&&void 0!==i?i:"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 fg extends sl{clone(){return new fg(null,tt(this.transform))}constructor(t,e){var n,r,i;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!==(r=o[0])&&void 0!==r?r:e.on,null!==(i=o[1])&&void 0!==i?i: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 dg extends sl{clone(){return new dg(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:r,op:i}=this.transform;return{type:"pivot",field:t,value:e,...void 0!==r?{limit:r}:{},...void 0!==i?{op:i}:{},...void 0!==n?{groupby:n}:{}}}}class hg extends sl{clone(){return new hg(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 pg(t){let e=0;return function n(r,i){if(r instanceof Ip&&!r.isGenerator&&!Gc(r.data)){t.push(i);i={name:null,source:i.name,transform:[]}}var o;if(r instanceof Pp&&(r.parent instanceof Ip&&!i.source?(i.format={...null!==(o=i.format)&&void 0!==o?o:{},parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof Np)return i.name||(i.name="data_".concat(e++)),!i.source||i.transform.length>0?(t.push(i),r.data=i.name):r.data=i.source,void t.push(...r.assemble());if((r instanceof jp||r instanceof Up||r instanceof ng||r instanceof vh||r instanceof Oh||r instanceof ag||r instanceof Op||r instanceof cg||r instanceof um||r instanceof am||r instanceof ig||r instanceof rg||r instanceof eg||r instanceof ug||r instanceof lg||r instanceof fg||r instanceof Lp||r instanceof hg||r instanceof dg)&&i.transform.push(r.assemble()),(r instanceof Mp||r instanceof cl||r instanceof sg||r instanceof sm||r instanceof og)&&i.transform.push(...r.assemble()),r instanceof ul)if(i.source&&0===i.transform.length)r.setSource(i.source);else if(r.parent instanceof ul)r.setSource(i.name);else if(i.name||(i.name="data_".concat(e++)),r.setSource(i.name),1===r.numChildren()){t.push(i);i={name:null,source:i.name,transform:[]}}switch(r.numChildren()){case 0:r instanceof ul&&(!i.source||i.transform.length>0)&&t.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name="data_".concat(e++));let o=i.name;!i.source||i.transform.length>0?t.push(i):o=i.source;for(const t of r.children){n(t,{name:null,source:o,transform:[]})}break}}}}function mg(t){return"top"===t||"left"===t||cr(t)?"header":"footer"}function gg(t,e){const{facet:n,config:r,child:i,component:o}=t;if(t.channelHasField(e)){var a;const s=n[e],u=zh("title",null,r,e);let c=Za(s,r,{allowDisabling:!0,includeDefault:void 0===u||!!u});i.component.layoutHeaders[e].title&&(c=(0,I.kJ)(c)?c.join(", "):c,c+=" / ".concat(i.component.layoutHeaders[e].title),i.component.layoutHeaders[e].title=null);const l=zh("labelOrient",s.header,r,e),f=null!==s.header&&Tt(null===(a=s.header)||void 0===a?void 0:a.labels,r.header.labels,!0),d=st(["bottom","right"],l)?"footer":"header";o.layoutHeaders[e]={title:null!==s.header?c:null,facetFieldDef:s,[d]:"facet"===e?[]:[vg(t,e,f)]}}}function vg(t,e,n){const r="row"===e?"height":"width";return{labels:n,sizeSignal:t.child.component.layoutSize.get(r)?t.child.getSizeSignalRef(r):void 0,axes:[]}}function yg(t,e){const{child:n}=t;if(n.component.axes[e]){const{layoutHeaders:i,resolve:o}=t.component;if(o.axis[e]=np(o,e),"shared"===o.axis[e]){const o="x"===e?"column":"row",a=i[o];for(const i of n.component.axes[e]){var r;const e=mg(i.get("orient"));null!==(r=a[e])&&void 0!==r||(a[e]=[vg(t,o,!1)]);const n=_h(i,"main",t.config,{header:!0});n&&a[e][0].axes.push(n),i.mainExtracted=!0}}}}function bg(t){for(const e of t.children)e.parseLayoutSize()}function xg(t,e){const n=Qh(e),r=wn(n),i=t.component.resolve,o=t.component.layoutSize;let a;for(const u of t.children){var s;const e=u.component.layoutSize.getWithExplicit(n),o=null!==(s=i.scale[r])&&void 0!==s?s:ep(r,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=Hc(a,e,n,"")}else a=e}if(a){for(const r of t.children)t.renameSignal(r.getName(n),t.getName(e)),r.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(e,a)}else o.setWithExplicit(e,{explicit:!1,value:void 0})}function Ag(t,e){const n="width"===e?"x":"y",r=t.config,i=t.getScaleComponent(n);if(i){const t=i.get("type"),n=i.get("range");if(so(t)){const t=Eu(r.view,e);return lr(n)||bu(t)?"step":t}return _u(r.view,e)}if(t.hasProjection||"arc"===t.mark)return _u(r.view,e);{const t=Eu(r.view,e);return bu(t)?t.step:t}}function _g(t,e,n){return Ja(e,{suffix:"by_".concat(Ja(t)),...null!==n&&void 0!==n?n:{}})}class wg extends tg{constructor(t,e,n,r){super(t,"facet",e,n,r,t.resolve),this.child=Kg(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Aa(t))return{facet:this.initFacetFieldDef(t,"facet")};const e=bt(t),n={};for(const r of e){if(![qt,Wt].includes(r)){di(Vr(r,"facet"));break}const e=t[r];if(void 0===e.field){di($r(e,r));break}n[r]=this.initFacetFieldDef(e,r)}return n}initFacetFieldDef(t,e){const n=as(t,e);return n.header?n.header=ar(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=Dg(this),this.child.parseData()}parseLayoutSize(){bg(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 Ne)gg(t,e);yg(t,"x"),yg(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 i of Ne)for(const o of Lh){const a=this.component.layoutHeaders[i],s=a[o],{facetFieldDef:u}=a;if(u){const n=zh("titleOrient",u.header,this.config,i);if(["right","bottom"].includes(n)){var e;const r=Th(i,n);null!==(e=t.titleAnchor)&&void 0!==e||(t.titleAnchor={}),t.titleAnchor[r]="end"}}if(null!==s&&void 0!==s&&s[0]){const e="row"===i?"height":"width",s="header"===o?"headerBand":"footerBand";var n,r;if("facet"!==i&&!this.child.component.layoutSize.get(e))null!==(n=t[s])&&void 0!==n||(t[s]={}),t[s][i]=.5;if(a.title)null!==(r=t.offset)&&void 0!==r||(t.offset={}),t.offset["row"===i?"rowTitle":"columnTitle"]=10}}return t}assembleDefaultLayout(){const{column:t,row:e}=this.facet,n=t?this.columnDistinctSignal():e?1:void 0;let r="all";return(e||"independent"!==this.component.resolve.scale.x)&&(t||"independent"!==this.component.resolve.scale.y)||(r="none"),{...this.getHeaderLayoutMixins(),...n?{columns:n}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof wg)){const t=this.getName("column_domain");return{signal:"length(data('".concat(t,"'))")}}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof wg?{...this.channelHasField("column")?{encode:{update:{columns:{field:Ja(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],e=[],n=[];if(this.child instanceof wg){if(this.child.channelHasField("column")){const r=Ja(this.child.facet.column);t.push(r),e.push("distinct"),n.push("distinct_".concat(r))}}else for(const r of bn){const i=this.child.component.scales[r];if(i&&!i.merged){const o=i.get("type"),a=i.get("range");if(so(o)&&lr(a)){const i=Fm(Cm(this.child,r));i?(t.push(i),e.push("distinct"),n.push("distinct_".concat(i))):di(Rr(r))}}}return{fields:t,ops:e,as:n}}assembleFacet(){const{name:t,data:e}=this.component.data.facetRoot,{row:n,column:r}=this.facet,{fields:i,ops:o,as:a}=this.getCardinalityAggregateForChild(),s=[];for(const c of Ne){const t=this.facet[c];if(t){s.push(Ja(t));const{bin:e,sort:u}=t;if(tr(e)&&s.push(Ja(t,{binSuffix:"end"})),ba(u)){const{field:e,op:s=ma}=u,c=_g(t,u);n&&r?(i.push(c),o.push("max"),a.push(c)):(i.push(e),o.push(s),a.push(c))}else if((0,I.kJ)(u)){const e=Nh(t,c);i.push(e),o.push("max"),a.push(e)}}}const u=!!n&&!!r;return{name:t,data:e,groupby:s,...u||i.length>0?{aggregate:{...u?{cross:u}:{},...i.length?{fields:i,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:e}=this,n=e[t];return n?ba(n.sort)?[_g(n,n.sort,{expr:"datum"})]:(0,I.kJ)(n.sort)?[Nh(n,t,{expr:"datum"})]:[Ja(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 Hh(t.facet,"facet",e);const n={row:["top","bottom"],column:["left","right"]};for(const i of Ph)if(t[i]){var r;const o=zh("labelOrient",null===(r=t[i])||void 0===r?void 0:r.header,e,i);if(n[i].includes(o))return Hh(t[i],i,e)}}assembleMarks(){const{child:t}=this,e=function(t){const e=[],n=pg(e);for(const r of t.children)n(r,{source:t.name,name:null,transform:[]});return e}(this.component.data.facetRoot),n=t.assembleGroupEncodeEntry(!1),r=this.assembleLabelTitle()||t.assembleTitle(),i=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...r?{title:r}:{},...i?{style:i}:{},from:{facet:this.assembleFacet()},sort:{field:Ne.map((t=>this.facetSortFields(t))).flat(),order:Ne.map((t=>this.facetSortOrder(t))).flat()},...e.length>0?{data:e}:{},...n?{encode:{update:n}}:{},...t.assembleGroup(il(this,[]))}]}getMapping(){return this.facet}}function Eg(t,e){for(const a of e){var n,r,i,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,u=null===(r=e.format)||void 0===r?void 0:r.feature;if(s&&u)continue;const c=null===(i=t.format)||void 0===i?void 0:i.feature;if((c||u)&&c!==u)continue;const l=null===(o=e.format)||void 0===o?void 0:o.mesh;if(!s&&!l||s===l)if(Jc(t)&&Jc(e)){if(Q(t.values,e.values))return a}else if(Gc(t)&&Gc(e)){if(t.url===e.url)return a}else if($c(t)&&t.name===a.dataName)return a}return null}function Dg(t){var e,n,r;let i=function(t,e){if(t.data||!t.parent){if(null===t.data){const t=new Ip({values:[]});return e.push(t),t}const n=Eg(t.data,e);if(n)return Vc(t.data)||(n.data.format=lt({},t.data.format,n.data.format)),!n.hasName()&&t.data.name&&(n.dataName=t.data.name),n;{const n=new Ip(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,u=!(s&&(Vc(s)||Gc(s)||Jc(s)))&&t.parent?t.parent.component.data.ancestorParse.clone():new Xc;Vc(s)?(Yc(s)?i=new Up(i,s.sequence):Zc(s)&&(i=new jp(i,s.graticule)),u.parseNothing=!0):null===(null===s||void 0===s||null===(e=s.format)||void 0===e?void 0:e.parse)&&(u.parseNothing=!0),i=null!==(n=Pp.makeExplicit(i,t,u))&&void 0!==n?n:i,i=new Lp(i);const c=t.parent&&Zm(t.parent);var l;(Vm(t)||Ym(t))&&(c&&(i=null!==(l=Mp.makeFromEncoding(i,t))&&void 0!==l?l:i));t.transforms.length>0&&(i=function(t,e,n){let r=0;for(const a of e.transforms){let s,u;if(bc(a))u=t=new Oh(t,a),s="derived";else if(sc(a)){var i;const r=zp(a);u=t=null!==(i=Pp.makeWithAncestors(t,{},r,n))&&void 0!==i?i:t,t=new vh(t,e,a.filter)}else if(xc(a))u=t=Mp.makeFromTransform(t,a,e),s="number";else if(_c(a))s="date",void 0===n.getWithExplicit(a.field).value&&(t=new Pp(t,{[a.field]:s}),n.set(a.field,s,!1)),u=t=cl.makeFromTransform(t,a);else if(wc(a))u=t=Op.makeFromTransform(t,a),s="number",Cf(e)&&(t=new Lp(t));else if(cc(a))u=t=cg.make(t,e,a,r++),s="derived";else if(gc(a))u=t=new um(t,a),s="number";else if(vc(a))u=t=new am(t,a),s="number";else if(Ec(a))u=t=sm.makeFromTransform(t,a),s="derived";else if(Dc(a))u=t=new ig(t,a),s="derived";else if(yc(a))u=t=new rg(t,a),s="derived";else if(lc(a))u=t=new dg(t,a),s="derived";else if(mc(a))t=new hg(t,a);else if(Ac(a))u=t=sg.makeFromTransform(t,a),s="derived";else if(fc(a))u=t=new eg(t,a),s="derived";else if(dc(a))u=t=new lg(t,a),s="derived";else if(hc(a))u=t=new fg(t,a),s="derived";else{if(!pc(a)){di("Ignoring an invalid transform: ".concat(it(a),"."));continue}u=t=new ug(t,a),s="derived"}if(u&&void 0!==s)for(const t of null!==(o=u.producedFields())&&void 0!==o?o:[]){var o;n.set(t,s,!1)}}return t}(i,t,u));const f=function(t){const e={};if(Vm(t)&&t.component.selection)for(const n of bt(t.component.selection)){const r=t.component.selection[n];for(const t of r.project.items)!t.channel&&Nt(t.field)>1&&(e[t.field]="flatten")}return e}(t),d=Rp(t);if(i=null!==(r=Pp.makeWithAncestors(i,{},{...f,...d},u))&&void 0!==r?r:i,Vm(t)&&(i=og.parseAll(i,t),i=ag.parseAll(i,t)),Vm(t)||Ym(t)){var h,p;if(!c)i=null!==(p=Mp.makeFromEncoding(i,t))&&void 0!==p?p:i;i=null!==(h=cl.makeFromEncoding(i,t))&&void 0!==h?h:i,i=Oh.parseAllForSortIndex(i,t)}const m=t.getDataName(Qc.Raw),g=new ul(i,m,Qc.Raw,a);if(o[m]=g,i=g,Vm(t)){var v,y;const e=Op.makeFromEncoding(i,t);e&&(i=e,Cf(t)&&(i=new Lp(i))),i=null!==(v=sg.makeFromEncoding(i,t))&&void 0!==v?v:i,i=null!==(y=sm.makeFromEncoding(i,t))&&void 0!==y?y:i}var b;Vm(t)&&(i=null!==(b=ng.make(i,t))&&void 0!==b?b:i);const x=t.getDataName(Qc.Main),A=new ul(i,x,Qc.Main,a);o[x]=A,i=A,Vm(t)&&function(t,e){for(const[r,i]of At(null!==(n=t.component.selection)&&void 0!==n?n:{})){var n;const o=t.getName("lookup_".concat(r));t.component.data.outputNodes[o]=i.materialized=new ul(new vh(e,t,{param:r}),o,Qc.Lookup,t.component.data.outputNodeRefCounts)}}(t,A);let _=null;if(Ym(t)){var w;const e=t.getName("facet");i=null!==(w=function(t,e){const{row:n,column:r}=e;if(n&&r){let e=null;for(const i of[n,r])if(ba(i.sort)){const{field:n,op:r=ma}=i.sort;t=e=new am(t,{joinaggregate:[{op:r,field:n,as:_g(i,i.sort,{forAs:!0})}],groupby:[Ja(i)]})}return e}return null}(i,t.facet))&&void 0!==w?w:i,_=new Np(i,t,e,A.getSource()),o[e]=_}return{...t.component.data,outputNodes:o,outputNodeRefCounts:a,raw:g,main:A,facetRoot:_,ancestorParse:u}}class Fg extends Qm{constructor(t,e,n,r){var i,o,a,s;super(t,"concat",e,n,r,t.resolve),"shared"!==(null===(i=t.resolve)||void 0===i||null===(o=i.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)||di("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)=>Kg(t,this,this.getName("concat_".concat(e)),void 0,r)))}parseData(){this.component.data=Dg(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 gu(t)?t.vconcat:vu(t)?t.hconcat:t.concat}parseLayoutSize(){!function(t){bg(t);const e=1===t.layout.columns?"width":"childWidth",n=void 0===t.layout.columns?"height":"childHeight";xg(t,e),xg(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=Vh(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(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...e?{title:e}:{},...n?{style:n}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}}))}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...null!=t?{columns:t}:{},bounds:"full",align:"each"}}}const Cg={disable:1,gridScale:1,scale:1,...vs,labelExpr:1,encode:1},kg=bt(Cg);class Sg extends jc{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 Sg(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 cr(this.explicit.orient)}}const Mg={bottom:"top",top:"bottom",left:"right",right:"left"};function Bg(t,e){if(!t)return e.map((t=>t.clone()));{if(t.length!==e.length)return;const n=t.length;for(let r=0;r<n;r++){const n=t[r],i=e[r];if(!!n!==!!i)return;if(n&&i){const e=n.getWithExplicit("orient"),o=i.getWithExplicit("orient");if(e.explicit&&o.explicit&&e.value!==o.value)return;t[r]=Og(n,i)}}}return t}function Og(t,e){for(const n of kg){const r=Hc(t.getWithExplicit(n),e.getWithExplicit(n),n,"axis",((t,e)=>{switch(n){case"title":return Mr(t,e);case"gridScale":return{explicit:t.explicit,value:Tt(t.value,e.value)}}return Wc(t,e,n,"axis")}));t.setWithExplicit(n,r)}return t}function Ng(t,e,n,r,i){if("disable"===e)return void 0!==n;switch(n=n||{},e){case"titleAngle":case"labelAngle":return t===(cr(n.labelAngle)?n.labelAngle:Ut(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(t===Bh(r,i))return!0}return t===n[e]}const Tg=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function zg(t,e){var n,r,i,o,a;let s=e.axis(t);const u=new Sg,c=rs(e.encoding[t]),{mark:l,config:f}=e,d=(null===(n=s)||void 0===n?void 0:n.orient)||(null===(r=f["x"===t?"axisX":"axisY"])||void 0===r?void 0:r.orient)||(null===(i=f.axis)||void 0===i?void 0:i.orient)||function(t){return"x"===t?"bottom":"left"}(t),h=e.getScaleComponent(t).get("type"),p=function(t,e,n,r){const i="band"===e?["axisDiscrete","axisBand"]:"point"===e?["axisDiscrete","axisPoint"]:ro(e)?["axisQuantitative"]:"time"===e||"utc"===e?["axisTemporal"]:[],o="x"===t?"axisX":"axisY",a=cr(n)?"axisOrient":"axis".concat(Ft(n)),s=[...i,...i.map((t=>o+t.substr(4)))],u=["axis",a,o];return{vlOnlyAxisConfig:Eh(s,r,t,n),vgAxisConfig:Eh(u,r,t,n),axisConfigStyle:Dh([...u,...s],r)}}(t,h,d,e.config),m=void 0!==s?!s:Fh("disable",f.style,null===(o=s)||void 0===o?void 0:o.style,p).configValue;if(u.set("disable",m,void 0!==s),m)return u;s=s||{};const g=function(t,e,n,r,i){const o=null===e||void 0===e?void 0:e.labelAngle;if(void 0!==o)return cr(o)?o:Ut(o);{const{configValue:o}=Fh("labelAngle",r,null===e||void 0===e?void 0:e.style,i);return void 0!==o?Ut(o):n!==Xt||!st([$i,Gi],t.type)||Na(t)&&t.timeUnit?void 0:270}}(c,s,t,f.style,p),v=la(s.formatType,c,h),y=ca(c,c.type,s.format,s.formatType,f,!0),b={fieldOrDatumDef:c,axis:s,channel:t,model:e,scaleType:h,orient:d,labelAngle:g,format:y,formatType:v,mark:l,config:f};for(const _ of kg){const n=_ in Ch?Ch[_](b):bs(_)?s[_]:void 0,r=void 0!==n,i=Ng(n,_,s,e,t);if(r&&i)u.set(_,n,i);else{const{configValue:t,configFrom:e}=bs(_)&&"values"!==_?Fh(_,f.style,s.style,p):{},o=void 0!==t;r&&!o?u.set(_,n,i):("vgAxisConfig"!==e||Tg.has(_)&&o||ps(t)||cr(t))&&u.set(_,t,!1)}}const x=null!==(a=s.encoding)&&void 0!==a?a:{},A=ms.reduce(((n,r)=>{var i;if(!u.hasAxisPart(r))return n;const o=tp(null!==(i=x[r])&&void 0!==i?i:{},e),a="labels"===r?function(t,e,n){var r;const{encoding:i,config:o}=t,a=null!==(r=rs(i[e]))&&void 0!==r?r:rs(i[Ve(e)]),s=t.axis(e)||{},{format:u,formatType:c}=s;if(ra(c))return{text:ua({fieldOrDatumDef:a,field:"datum.value",format:u,formatType:c,config:o}),...n};if(void 0===u&&void 0===c&&o.customFormatTypes){if("quantitative"===Ta(a)){if(Wa(a)&&"normalize"===a.stack&&o.normalizedNumberFormatType)return{text:ua({fieldOrDatumDef:a,field:"datum.value",format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,config:o}),...n};if(o.numberFormatType)return{text:ua({fieldOrDatumDef:a,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}),...n}}if("temporal"===Ta(a)&&o.timeFormatType&&Na(a)&&!a.timeUnit)return{text:ua({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[r]={update:a}),n}),{});return yt(A)||u.set("encode",A,!!s.encoding||void 0!==s.labelAngle),u}function Rg(t,e,n){const r=ar(t),i=wr("orient",r,n);var o,a;if(r.orient=function(t,e,n){switch(t){case Mo:case Ro:case Po:case No:case Bo:case ko:return}const{x:r,y:i,x2:o,y2:a}=e;switch(t){case Co:if(Na(r)&&(er(r.bin)||Na(i)&&i.aggregate&&!r.aggregate))return"vertical";if(Na(i)&&(er(i.bin)||Na(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o)return(Na(r)&&r.type===Xi&&!tr(r.bin)||La(r))&&Na(i)&&er(i.bin)?"horizontal":"vertical";if(!a)return(Na(i)&&i.type===Xi&&!tr(i.bin)||La(i))&&Na(r)&&er(r.bin)?"vertical":"horizontal"}case Oo:if(o&&(!Na(r)||!er(r.bin))&&a&&(!Na(i)||!er(i.bin)))return;case Fo:if(a)return Na(i)&&er(i.bin)?"horizontal":"vertical";if(o)return Na(r)&&er(r.bin)?"vertical":"horizontal";if(t===Oo){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case So:case To:{const e=Pa(r),o=Pa(i);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(r)&&r.type===Ji,e=Ua(i)&&i.type===Ji;if(t&&!e)return"vertical";if(!t&&e)return"horizontal"}return}}return"vertical"}(r.type,e,i),void 0!==i&&i!==r.orient&&di((o=r.orient,a=i,'Specified orient "'.concat(o,'" overridden with "').concat(a,'".'))),"bar"===r.type&&r.orient){const t=wr("cornerRadiusEnd",r,n);if(void 0!==t){const n="horizontal"===r.orient&&e.x2||"vertical"===r.orient&&e.y2?["cornerRadius"]:Jo[r.orient];for(const e of n)r[e]=t;void 0!==r.cornerRadiusEnd&&delete r.cornerRadiusEnd}}void 0===wr("opacity",r,n)&&(r.opacity=function(t,e){if(st([Mo,To,Ro,Po],t)&&!Fs(e))return.7;return}(r.type,e));return void 0===wr("cursor",r,n)&&(r.cursor=function(t,e,n){if(e.href||t.href||wr("href",t,n))return"pointer";return t.cursor}(r,e,n)),r}function Pg(t,e){const{config:n}=t;return{...Zl(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...jl("x",t,{defaultPos:"mid"}),...jl("y",t,{defaultPos:"mid"}),...zl("size",t),...zl("angle",t),...Lg(t,n,e)}}function Lg(t,e,n){return n?{shape:{value:n}}:zl("shape",t)}const jg={vgMark:"rule",encodeEntry:t=>{const{markDef:e}=t,n=e.orient;return t.encoding.x||t.encoding.y||t.encoding.latitude||t.encoding.longitude?{...Zl(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Hl("x",t,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n}),...Hl("y",t,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n}),...zl("size",t,{vgChannel:"strokeWidth"})}:{}}};function Ug(t,e,n){if(void 0===wr("align",t,n))return"center"}function Ig(t,e,n){if(void 0===wr("baseline",t,n))return"middle"}const qg={vgMark:"rect",encodeEntry:t=>{const{config:e,markDef:n}=t,r=n.orient,i="horizontal"===r?"width":"height",o="horizontal"===r?"height":"width";return{...Zl(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...jl("x",t,{defaultPos:"mid",vgChannel:"xc"}),...jl("y",t,{defaultPos:"mid",vgChannel:"yc"}),...zl("size",t,{defaultValue:Wg(t),vgChannel:i}),[o]:yr(wr("thickness",n,e))}}};function Wg(t){var e;const{config:n,markDef:r}=t,{orient:i}=r,o="horizontal"===i?"width":"height",a=t.getScaleComponent("horizontal"===i?"x":"y"),s=null!==(e=wr("size",r,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&&lr(t)&&(0,I.hj)(t.step))return 3*t.step/4;return 3*wu(n.view,o)/4}}const Hg={arc:{vgMark:"arc",encodeEntry:t=>({...Zl(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...jl("x",t,{defaultPos:"mid"}),...jl("y",t,{defaultPos:"mid"}),...Jl(t,"radius"),...Jl(t,"theta")})},area:{vgMark:"area",encodeEntry:t=>({...Zl(t,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Hl("x",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===t.markDef.orient}),...Hl("y",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===t.markDef.orient}),...ef(t)})},bar:{vgMark:"rect",encodeEntry:t=>({...Zl(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Jl(t,"x"),...Jl(t,"y")})},circle:{vgMark:"symbol",encodeEntry:t=>Pg(t,"circle")},geoshape:{vgMark:"shape",encodeEntry:t=>({...Zl(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&&Na(n)&&n.type===Vi?{field:Ja(n,{expr:"datum"})}:{}}]}},image:{vgMark:"image",encodeEntry:t=>({...Zl(t,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Jl(t,"x"),...Jl(t,"y"),...Cl(t,"url")})},line:{vgMark:"line",encodeEntry:t=>({...Zl(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...jl("x",t,{defaultPos:"mid"}),...jl("y",t,{defaultPos:"mid"}),...zl("size",t,{vgChannel:"strokeWidth"}),...ef(t)})},point:{vgMark:"symbol",encodeEntry:t=>Pg(t)},rect:{vgMark:"rect",encodeEntry:t=>({...Zl(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Jl(t,"x"),...Jl(t,"y")})},rule:jg,square:{vgMark:"symbol",encodeEntry:t=>Pg(t,"square")},text:{vgMark:"text",encodeEntry:t=>{const{config:e,encoding:n}=t;return{...Zl(t,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...jl("x",t,{defaultPos:"mid"}),...jl("y",t,{defaultPos:"mid"}),...Cl(t),...zl("size",t,{vgChannel:"fontSize"}),...zl("angle",t),...nf("align",Ug(t.markDef,n,e)),...nf("baseline",Ig(t.markDef,n,e)),...jl("radius",t,{defaultPos:null}),...jl("theta",t,{defaultPos:null})}}},tick:qg,trail:{vgMark:"trail",encodeEntry:t=>({...Zl(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...jl("x",t,{defaultPos:"mid"}),...jl("y",t,{defaultPos:"mid"}),...zl("size",t),...ef(t)})}};function Xg(t){if(st([So,Fo,zo],t.mark)){const e=Bs(t.mark,t.encoding);if(e.length>0)return function(t,e){return[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:Gg+t.requestDataName(Qc.Main),data:t.requestDataName(Qc.Main),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:$g(t,{fromPrefix:Gg})}]}(t,e)}else if(t.mark===Co){const e=pr.some((e=>wr(e,t.markDef,t.config)));if(t.stack&&!t.fieldDef("size")&&e)return function(t){var e;const[n]=$g(t,{fromPrefix:Jg}),r=t.scaleName(t.stack.fieldChannel),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.vgField(t.stack.fieldChannel,e)},o=(t,e)=>{const n=[i({prefix:"min",suffix:"start",expr:e}),i({prefix:"max",suffix:"start",expr:e}),i({prefix:"min",suffix:"end",expr:e}),i({prefix:"max",suffix:"end",expr:e})];return"".concat(t,"(").concat(n.map((t=>"scale('".concat(r,"',").concat(t,")"))).join(","),")")};let a,s;"x"===t.stack.fieldChannel?(a={...nt(n.encode.update,["y","yc","y2","height",...pr]),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={...rt(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={...rt(n.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of pr){const e=Er(c,t.markDef,t.config);n.encode.update[c]?(a[c]=n.encode.update[c],delete n.encode.update[c]):e&&(a[c]=yr(e)),e&&(n.encode.update[c]={value:0})}const u=[];if((null===(e=t.stack.groupbyChannels)||void 0===e?void 0:e.length)>0)for(const c of t.stack.groupbyChannels){const e=t.fieldDef(c),n=Ja(e);n&&u.push(n),(null!==e&&void 0!==e&&e.bin||null!==e&&void 0!==e&&e.timeUnit)&&u.push(Ja(e,{binSuffix:"end"}))}a=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((e,r)=>{if(n.encode.update[r])return{...e,[r]:n.encode.update[r]};{const n=Er(r,t.markDef,t.config);return void 0!==n?{...e,[r]:yr(n)}:e}}),a),a.stroke&&(a.strokeForeground={value:!0},a.strokeOffset={value:0});return[{type:"group",from:{facet:{data:t.requestDataName(Qc.Main),name:Jg+t.requestDataName(Qc.Main),groupby:u,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:a},marks:[{type:"group",encode:{update:s},marks:[n]}]}]}(t)}return $g(t)}const Gg="faceted_path_";const Jg="stack_group_";function $g(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{fromPrefix:""};const{mark:n,markDef:r,encoding:i,config:o}=t,a=Tt(r.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=_r(r),u=i.key,c=function(t){const{encoding:e,stack:n,mark:r,markDef:i,config:o}=t,a=e.order;if(!(!(0,I.kJ)(a)&&Ia(a)&&at(a.value)||!a&&at(wr("order",i,o)))){if(((0,I.kJ)(a)||Na(a))&&!n)return Cr(a,{expr:"datum"});if(jo(r)){const n="horizontal"===i.orient?"y":"x",r=e[n];if(Na(r)){const e=r.sort;if((0,I.kJ)(e))return{field:Ja(r,{prefix:n,suffix:"sort_index",expr:"datum"})};if(ba(e))return{field:Ja({aggregate:Fs(t.encoding)?e.op:void 0,field:e.field},{expr:"datum"})};if(ya(e))return{field:Ja(t.fieldDef(e.encoding),{expr:"datum"}),order:e.order};if(null===e)return;var s;return{field:Ja(r,{binSuffix:null!==(s=t.stack)&&void 0!==s&&s.impute?"mid":void 0,expr:"datum"})}}}}}(t),l=function(t){if(!t.component.selection)return null;const e=bt(t.component.selection).length;let n=e,r=t.parent;for(;r&&0===n;)n=bt(r.component.selection).length,r=r.parent;return n?{interactive:e>0||"geoshape"===t.mark||!!t.encoding.tooltip}:null}(t),f=wr("aria",r,o),d=Hg[n].postEncodingTransform?Hg[n].postEncodingTransform(t):null;return[{name:t.getName("marks"),type:Hg[n].vgMark,...a?{clip:!0}:{},...s?{style:s}:{},...u?{key:u.field}:{},...c?{sort:c}:{},...l||{},...!1===f?{aria:f}:{},from:{data:e.fromPrefix+t.requestDataName(Qc.Main)},encode:{update:Hg[n].encodeEntry(t)},...d?{transform:d}:{}}]}class Vg extends tg{constructor(t,e,n){var r;let i=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,xu(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:r}=n;if(r)return!1;const i=Er("filled",t,e),o=t.type;return Tt(i,o!==Mo&&o!==So&&o!==Oo)}(a,o,{graticule:t.data&&Zc(t.data)}));const u=this.encoding=function(t,e,n,r){const i={};for(const a of bt(t))He(a)||di("".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=i[t];if(Na(e)){if(Wi(e.type)&&Na(o)&&!e.timeUnit){di(Hr(t));continue}}else a=t,di(Xr(t))}if("angle"!==a||"arc"!==e||t.theta||(di("Arc marks uses theta channel rather than angle, replacing angle with theta."),a=Qt),ks(t,a,e)){if(a===ce&&"line"===e){const e=ns(t[a]);if(null!==e&&void 0!==e&&e.aggregate){di("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))di(Jr("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(Sa(e)){i[a]=e;continue}}i[a]=(0,I.IX)(o).reduce(((t,e)=>(Na(e)?t.push(as(e,a)):di($r(e,a)),t)),[])}}else{if(a===xe&&null===o)i[a]=null;else if(!Na(o)&&!za(o)&&!Ia(o)&&!Ma(o)&&!cr(o)){di($r(o,a));continue}i[a]=is(o,a,r)}}else di(Vr(a,e))}return i}(t.encoding||{},s,a.filled,o);this.markDef=Rg(a,u,o),this.size=function(t){let{encoding:e,size:n}=t;for(const r of bn){const t=Ye(r);bu(n[t])&&Ra(e[r])&&(delete n[t],di(ii(t)))}return n}({encoding:u,size:xu(t)?{...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:i}),this.stack=Xu(this.markDef,u),this.specifiedScales=this.initScales(s,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=t.projection,this.selection=(null!==(r=t.params)&&void 0!==r?r:[]).filter((t=>hu(t)))}get hasProjection(){const{encoding:t}=this,e=this.mark===Lo,n=t&&Se.some((e=>ja(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 Pn.reduce(((t,n)=>{const r=rs(e[n]);var i;r&&(t[n]=this.initScale(null!==(i=r.scale)&&void 0!==i?i:{}));return t}),{})}initScale(t){const{domain:e,range:n}=t,r=ar(t);return(0,I.kJ)(e)&&(r.domain=e.map(gr)),(0,I.kJ)(n)&&(r.range=n.map(gr)),r}initAxes(t){return bn.reduce(((e,n)=>{const r=t[n];if(ja(r)||n===Xt&&ja(t.x2)||n===Gt&&ja(t.y2)){const t=ja(r)?r.axis:void 0;e[n]=t?this.initAxis({...t}):t}return e}),{})}initAxis(t){const e=bt(t),n={};for(const r of e){const e=t[r];n[r]=ps(e)?mr(e):gr(e)}return n}initLegends(t){return zn.reduce(((e,n)=>{const r=rs(t[n]);if(r&&function(t){switch(t){case oe:case ae:case se:case ce:case ue:case fe:case pe:case me:return!0;case de:case he:case le:return!1}}(n)){const t=r.legend;e[n]=t?ar(t):t}return e}),{})}parseData(){this.component.data=Dg(this)}parseLayoutSize(){!function(t){const{size:e,component:n}=t;for(const r of bn){const i=Ye(r);if(e[i]){const t=e[i];n.layoutSize.set(i,bu(t)?"step":t,!0)}else{const e=Ag(t,i);n.layoutSize.set(i,e,!1)}}}(this)}parseSelections(){this.component.selection=function(t,e){const n={},r=t.config.selection;if(!e||!e.length)return n;for(const o of e){const e=wt(o.name),a=o.select,s=(0,I.HD)(a)?a:a.type,u=(0,I.Kn)(a)?tt(a):{type:s},c=r[s];for(const t in c){var i;"fields"!==t&&"encodings"!==t&&("mark"===t&&(u[t]={...c[t],...u[t]}),(void 0===u[t]||!0===u[t])&&(u[t]=tt(null!==(i=c[t])&&void 0!==i?i:u[t])))}const l=n[e]={...u,name:e,type:s,init:o.value,bind:o.bind,events:(0,I.HD)(u.on)?(0,tl.r)(u.on,"scope"):(0,I.IX)(tt(u.on))},f=tt(o);for(const n of Df)n.defined(l)&&n.parse&&n.parse(t,l,f)}return n}(this,this.selection)}parseMarkGroup(){this.component.mark=Xg(this)}parseAxesAndHeaders(){var t;this.component.axes=(t=this,bn.reduce(((e,n)=>(t.component.scales[n]&&(e[n]=[zg(n,t)]),e)),{}))}assembleSelectionTopLevelSignals(t){return function(t,e){let n=!1;for(const i of xt(null!==(r=t.component.selection)&&void 0!==r?r:{})){var r;const o=i.name,a=(0,I.m8)(o+Af);if(0===e.filter((t=>t.name===o)).length){const t="global"===i.resolve?"union":i.resolve,n="point"===i.type?", true, true)":")";e.push({name:i.name,update:"".concat(Ef,"(").concat(a,", ").concat((0,I.m8)(t)).concat(n)})}n=!0;for(const n of Df)n.defined(i)&&n.topLevelSignals&&(e=n.topLevelSignals(t,i,e))}n&&0===e.filter((t=>"unit"===t.name)).length&&e.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]});return al(e)}(this,t)}assembleSignals(){return[...wh(this),...rl(this,[])]}assembleSelectionData(t){return function(t,e){const n=[...e],r=Ff(t,{escape:!1});for(const o of xt(null!==(i=t.component.selection)&&void 0!==i?i:{})){var i;const t={name:o.name+Af};if(o.project.hasSelectionId&&(t.transform=[{type:"collect",sort:{field:cu}}]),o.init){const e=o.project.items.map(el);t.values=o.project.hasSelectionId?o.init.map((t=>({unit:r,[cu]:nl(t,!1)[0]}))):o.init.map((t=>({unit:r,fields:e,values:nl(t,!1)})))}n.filter((t=>t.name===o.name+Af)).length||n.push(t)}return n}(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return Vh(this)}assembleMarks(){var t;let e=null!==(t=this.component.mark)&&void 0!==t?t:[];return this.parent&&Zm(this.parent)||(e=ol(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 ws(this.encoding,t)}fieldDef(t){return ns(this.encoding[t])}typedFieldDef(t){const e=this.fieldDef(t);return Ua(e)?e:null}}class Yg extends Qm{constructor(t,e,n,r,i){super(t,"layer",e,n,i,t.resolve,t.view);const o={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map(((t,e)=>{if(Lu(t))return new Yg(t,this,this.getName("layer_".concat(e)),o,i);if(As(t))return new Vg(t,this,this.getName("layer_".concat(e)),o,i);throw new Error(Br(t))}))}parseData(){this.component.data=Dg(this);for(const t of this.children)t.parseData()}parseLayoutSize(){var t;bg(t=this),xg(t,"width"),xg(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,r={top:0,bottom:0,right:0,left:0};for(const o of t.children){o.parseAxesAndHeaders();for(const r of bt(o.component.axes))n.axis[r]=np(t.component.resolve,r),"shared"===n.axis[r]&&(e[r]=Bg(e[r],o.component.axes[r]),e[r]||(n.axis[r]="independent",delete e[r]))}for(const o of bn){for(const a of t.children)if(a.component.axes[o]){if("independent"===n.axis[o]){var i;e[o]=(null!==(i=e[o])&&void 0!==i?i:[]).concat(a.component.axes[o]);for(const t of a.component.axes[o]){const{value:e,explicit:n}=t.getWithExplicit("orient");if(!cr(e)){if(r[e]>0&&!n){const n=Mg[e];r[e]>r[n]&&t.set("orient",n,!1)}r[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())),wh(this))}assembleLayoutSignals(){return this.children.reduce(((t,e)=>t.concat(e.assembleLayoutSignals())),Vh(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)Vm(n)&&(e=ol(n,e));return e}(this,this.children.flatMap((t=>t.assembleMarks())))}assembleLegends(){return this.children.reduce(((t,e)=>t.concat(e.assembleLegends())),xp(this))}}function Kg(t,e,n,r,i){if(wa(t))return new wg(t,e,n,i);if(Lu(t))return new Yg(t,e,n,r,i);if(As(t))return new Vg(t,e,n,r,i);if(function(t){return gu(t)||vu(t)||mu(t)}(t))return new Fg(t,e,n,i);throw new Error(Br(t))}function Zg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n;e.logger&&(n=e.logger,li=n),e.fieldTitle&&Ka(e.fieldTitle);try{const n=Ou((0,I.fE)(e.config,t.config)),r=Oc(t,n),i=Kg(r,null,"",void 0,n);i.parse(),function(t,e){hm(t.sources);let n=0,r=0;for(let i=0;i<dm&&mm(t,e,!0);i++)n++;t.sources.map(cm);for(let i=0;i<dm&&mm(t,e,!1);i++)r++;hm(t.sources),Math.max(n,r)===dm&&di("Maximum optimization runs(".concat(dm,") reached."))}(i.component.data,i);const o=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;const i=t.config?Ru(t.config):void 0,o=[].concat(t.assembleSelectionData([]),function(t,e){const n=[],r=pg(n);let i=0;for(const u of t.sources){u.hasName()||(u.dataName="source_".concat(i++));const t=u.assemble();r(u,t)}for(const u of n)0===u.transform.length&&delete u.transform;let o=0;for(const[u,c]of n.entries()){var a;0!==(null!==(a=c.transform)&&void 0!==a?a:[]).length||c.source||n.splice(o++,0,n.splice(u,1)[0])}for(const u of n)for(const e of null!==(s=u.transform)&&void 0!==s?s:[]){var s;"lookup"===e.type&&(e.from=t.outputNodes[e.from].getSource())}for(const u of n)u.name in e&&(u.values=e[u.name]);return n}(t.component.data,n)),a=t.assembleProjections(),s=t.assembleTitle(),u=t.assembleGroupStyle(),c=t.assembleGroupEncodeEntry(!0);let l=t.assembleLayoutSignals();l=l.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}:{},...u?{style:u}:{},...c?{encode:{update:c}}:{},data:o,...a.length>0?{projections:a}:{},...t.assembleGroup([...l,...t.assembleSelectionTopLevelSignals([]),...pu(f)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}(i,function(t,e,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");void 0===e?(e={type:"pad"},r.hasAxisOrientSignalRef()&&(e.resize=!0)):(0,I.HD)(e)&&(e={type:e});if(i&&o&&(a=e.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===i&&"step"===o)di(zr()),e.type="pad";else if("step"===i||"step"===o){const t="step"===i?"width":"height";di(zr(wn(t)));const n="width"===t?"height":"width";e.type=function(t){return t?"fit-".concat(wn(t)):"fit"}(n)}var a;return{...1===bt(e).length&&e.type?"pad"===e.type?{}:{autosize:e.type}:{autosize:e},...Lc(n,!1),...Lc(t,!0)}}(t,r.autosize,n,i),t.datasets,t.usermeta);return{spec:o,normalized:r}}finally{e.logger&&fi(),e.fieldTitle&&Ka(Va)}}const Qg="5.9.3";const tv=function(t){const[e,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:e,version:n}};var ev="2.14.0";const nv="#fff",rv="#888",iv={background:"#333",view:{stroke:rv},title:{color:nv,subtitleColor:nv},style:{"guide-label":{fill:nv},"guide-title":{fill:nv}},axis:{domainColor:nv,gridColor:rv,tickColor:nv}},ov="#4572a7",av={background:"#fff",arc:{fill:ov},area:{fill:ov},line:{stroke:ov,strokeWidth:2},path:{stroke:ov},rect:{fill:ov},shape:{stroke:ov},symbol:{fill:ov,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"]}},sv="#30a2da",uv="#cbcbcb",cv="#f0f0f0",lv="#333",fv={arc:{fill:sv},area:{fill:sv},axis:{domainColor:uv,grid:!0,gridColor:uv,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:uv,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:cv,group:{fill:cv},legend:{labelColor:lv,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:lv,titleFontSize:14,titlePadding:10},line:{stroke:sv,strokeWidth:2},path:{stroke:sv,strokeWidth:.5},rect:{fill:sv},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:sv},bar:{binSpacing:2,fill:sv,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},dv="#000",hv={group:{fill:"#e5e5e5"},arc:{fill:dv},area:{fill:dv},line:{stroke:dv},path:{stroke:dv},rect:{fill:dv},shape:{stroke:dv},symbol:{fill:dv,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"]}},pv="Benton Gothic, sans-serif",mv="#82c6df",gv="Benton Gothic Bold, sans-serif",vv="normal",yv={"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"]},bv={background:"#ffffff",title:{anchor:"start",color:"#000000",font:gv,fontSize:22,fontWeight:"normal"},arc:{fill:mv},area:{fill:mv},line:{stroke:mv,strokeWidth:2},path:{stroke:mv},rect:{fill:mv},shape:{stroke:mv},symbol:{fill:mv,size:30},axis:{labelFont:pv,labelFontSize:11.5,labelFontWeight:"normal",titleFont:gv,titleFontSize:13,titleFontWeight:vv},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:pv,labelFontSize:11.5,symbolType:"square",titleFont:gv,titleFontSize:13,titleFontWeight:vv},range:{category:yv["category-6"],diverging:yv["fireandice-6"],heatmap:yv["fire-7"],ordinal:yv["fire-7"],ramp:yv["fire-7"]}},xv="#ab5787",Av="#979797",_v={background:"#f9f9f9",arc:{fill:xv},area:{fill:xv},line:{stroke:xv},path:{stroke:xv},rect:{fill:xv},shape:{stroke:xv},symbol:{fill:xv,size:30},axis:{domainColor:Av,domainWidth:.5,gridWidth:.2,labelColor:Av,tickColor:Av,tickWidth:.2,titleColor:Av},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"]}},wv="#3e5c69",Ev={background:"#fff",arc:{fill:wv},area:{fill:wv},line:{stroke:wv},path:{stroke:wv},rect:{fill:wv},shape:{stroke:wv},symbol:{fill:wv},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"]}},Dv="#1696d2",Fv="#000000",Cv="Lato",kv="Lato",Sv={"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"]},Mv={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:Cv},axisX:{domain:!0,domainColor:Fv,domainWidth:1,grid:!1,labelFontSize:12,labelFont:kv,labelAngle:0,tickColor:Fv,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Cv},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:kv,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Cv,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:kv,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Cv,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:Sv["six-groups-cat-1"],diverging:Sv["diverging-colors"],heatmap:Sv["diverging-colors"],ordinal:Sv["six-groups-seq"],ramp:Sv["shades-blue"]},area:{fill:Dv},rect:{fill:Dv},line:{color:Dv,stroke:Dv,strokeWidth:5},trail:{color:Dv,stroke:Dv,strokeWidth:0,size:1},path:{stroke:Dv,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:Dv,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Dv,stroke:null}},arc:{fill:Dv},shape:{stroke:Dv},symbol:{fill:Dv,size:30}},Bv="#3366CC",Ov="#ccc",Nv="Arial, sans-serif",Tv={arc:{fill:Bv},area:{fill:Bv},path:{stroke:Bv},rect:{fill:Bv},shape:{stroke:Bv},symbol:{stroke:Bv},circle:{fill:Bv},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:Nv,fontSize:12},"guide-title":{font:Nv,fontSize:12},"group-title":{font:Nv,fontSize:12}},title:{font:Nv,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:Ov,tickColor:Ov,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},zv=t=>t*(1/3+1),Rv=zv(9),Pv=zv(10),Lv=zv(12),jv="Segoe UI",Uv="wf_standard-font, helvetica, arial, sans-serif",Iv="#252423",qv="#605E5C",Wv="transparent",Hv="#118DFF",Xv="#DEEFFF",Gv=[Xv,Hv],Jv={view:{stroke:Wv},background:Wv,font:jv,header:{titleFont:Uv,titleFontSize:Lv,titleColor:Iv,labelFont:jv,labelFontSize:Pv,labelColor:qv},axis:{ticks:!1,grid:!1,domain:!1,labelColor:qv,labelFontSize:Rv,titleFont:Uv,titleColor:Iv,titleFontSize:Lv,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:Hv},line:{stroke:Hv,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:jv,fontSize:Rv,fill:qv},arc:{fill:Hv},area:{fill:Hv,line:!0,opacity:.6},path:{stroke:Hv},rect:{fill:Hv},point:{fill:Hv,filled:!0,size:75},shape:{stroke:Hv},symbol:{fill:Hv,strokeWidth:1.5,size:50},legend:{titleFont:jv,titleFontWeight:"bold",titleColor:qv,labelFont:jv,labelFontSize:Pv,labelColor:qv,symbolType:"circle",symbolSize:75},range:{category:[Hv,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:Gv,heatmap:Gv,ordinal:[Xv,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",Hv]}},$v='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',Vv=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Yv=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function Kv(t){let{type:e,background:n}=t;const r="dark"===e?"#161616":"#ffffff",i="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:r,stroke:r},group:{fill:r},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:$v,fontWeight:600},axis:{labelColor:i,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:i,labelAngle:0},style:{"guide-label":{font:$v,fill:i,fontWeight:400},"guide-title":{font:$v,fill:i,fontWeight:400}},range:{category:"dark"===e?Vv:Yv,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 Zv=Kv({type:"light",background:"#ffffff"}),Qv=Kv({type:"light",background:"#f4f4f4"}),ty=Kv({type:"dark",background:"#262626"}),ey=Kv({type:"dark",background:"#161616"}),ny=ev;function ry(t,e){return JSON.stringify(t,function(t){const e=[];return function(n,r){if("object"!==typeof r||null===r)return r;const i=e.indexOf(this)+1;return e.length=i,e.length>t?"[Object]":e.indexOf(r)>=0?"[Circular]":(e.push(r),r)}}(e))}const iy="vg-tooltip-element",oy={offsetX:10,offsetY:10,id:iy,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:ry(t,n)))).join(", "),"]");if((0,I.Kn)(t)){let r="";const{title:i,image:o,...a}=t;i&&(r+="<h2>".concat(e(i),"</h2>")),o&&(r+='<img src="'.concat(e(o),'">'));const s=Object.keys(a);if(s.length>0){r+="<table>";for(const t of s){let i=a[t];void 0!==i&&((0,I.Kn)(i)&&(i=ry(i,n)),r+='<tr><td class="key">'.concat(e(t),'</td><td class="value">').concat(e(i),"</td></tr>"))}r+="</table>"}return r||"{}"}return e(t)}};class ay{constructor(t){this.options={...oy,...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(iy,t)}(e);const n=document.head;n.childNodes.length>0?n.insertBefore(t,n.childNodes[0]):n.appendChild(t)}}tooltipHandler(t,e,n,r){if(this.el=document.getElementById(this.options.id),!this.el){var i;this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip");(null!==(i=document.fullscreenElement)&&void 0!==i?i:document.body).appendChild(this.el)}if(null==r||""===r)return void this.el.classList.remove("visible","".concat(this.options.theme,"-theme"));this.el.innerHTML=this.options.formatTooltip(r,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,r){let i=t.clientX+n;i+e.width>window.innerWidth&&(i=+t.clientX-n-e.width);let o=t.clientY+r;return o+e.height>window.innerHeight&&(o=+t.clientY-r-e.height),{x:i,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 sy,uy,cy;function ly(t){return ly="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},ly(t)}function fy(t){var e=function(t,e){if("object"!==ly(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==ly(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ly(e)?e:String(e)}function dy(t,e,n){return(e=fy(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var py=my;function my(t){var e=this;if(e instanceof my||(e=new my),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,r=arguments.length;n<r;n++)e.push(arguments[n]);return e}function gy(t,e,n){var r=e===t.head?new by(n,null,e,t):new by(n,e,e.next,t);return null===r.next&&(t.tail=r),null===r.prev&&(t.head=r),t.length++,r}function vy(t,e){t.tail=new by(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function yy(t,e){t.head=new by(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function by(t,e,n,r){if(!(this instanceof by))return new by(t,e,n,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}my.Node=by,my.create=my,my.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},my.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++}},my.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++}},my.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)vy(this,arguments[t]);return this.length},my.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)yy(this,arguments[t]);return this.length},my.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}},my.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}},my.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,r=0;null!==n;r++)t.call(e,n.value,r,this),n=n.next},my.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,r=this.length-1;null!==n;r--)t.call(e,n.value,r,this),n=n.prev},my.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},my.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},my.prototype.map=function(t,e){e=e||this;for(var n=new my,r=this.head;null!==r;)n.push(t.call(e,r.value,this)),r=r.next;return n},my.prototype.mapReverse=function(t,e){e=e||this;for(var n=new my,r=this.tail;null!==r;)n.push(t.call(e,r.value,this)),r=r.prev;return n},my.prototype.reduce=function(t,e){var n,r=this.head;if(arguments.length>1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=t(n,r.value,i),r=r.next;return n},my.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=t(n,r.value,i),r=r.prev;return n},my.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},my.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},my.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new my;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,i=this.head;null!==i&&r<t;r++)i=i.next;for(;null!==i&&r<e;r++,i=i.next)n.push(i.value);return n},my.prototype.sliceReverse=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new my;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,i=this.tail;null!==i&&r>e;r--)i=i.prev;for(;null!==i&&r>t;r--,i=i.prev)n.push(i.value);return n},my.prototype.splice=function(t,e){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,r=this.head;null!==r&&n<t;n++)r=r.next;var i=[];for(n=0;r&&n<e;n++)i.push(r.value),r=this.removeNode(r);null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(n=0;n<(arguments.length<=2?0:arguments.length-2);n++)r=gy(this,r,n+2<2||arguments.length<=n+2?void 0:arguments[n+2]);return i},my.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=e,this.tail=t,this};try{(cy||(cy=1,uy=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),uy)(my)}catch(Xb){}const xy=py,Ay=Symbol("max"),_y=Symbol("length"),wy=Symbol("lengthCalculator"),Ey=Symbol("allowStale"),Dy=Symbol("maxAge"),Fy=Symbol("dispose"),Cy=Symbol("noDisposeOnSet"),ky=Symbol("lruList"),Sy=Symbol("cache"),My=Symbol("updateAgeOnGet"),By=()=>1;const Oy=(t,e,n)=>{const r=t[Sy].get(e);if(r){const e=r.value;if(Ny(t,e)){if(zy(t,r),!t[Ey])return}else n&&(t[My]&&(r.value.now=Date.now()),t[ky].unshiftNode(r));return e.value}},Ny=(t,e)=>{if(!e||!e.maxAge&&!t[Dy])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[Dy]&&n>t[Dy]},Ty=t=>{if(t[_y]>t[Ay])for(let e=t[ky].tail;t[_y]>t[Ay]&&null!==e;){const n=e.prev;zy(t,e),e=n}},zy=(t,e)=>{if(e){const n=e.value;t[Fy]&&t[Fy](n.key,n.value),t[_y]-=n.length,t[Sy].delete(n.key),t[ky].removeNode(e)}};class Ry{constructor(t,e,n,r,i){this.key=t,this.value=e,this.length=n,this.now=r,this.maxAge=i||0}}const Py=(t,e,n,r)=>{let i=n.value;Ny(t,i)&&(zy(t,n),t[Ey]||(i=void 0)),i&&e.call(r,i.value,i.key,t)};var Ly=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[Ay]=t.max||1/0;const e=t.length||By;if(this[wy]="function"!==typeof e?By:e,this[Ey]=t.stale||!1,t.maxAge&&"number"!==typeof t.maxAge)throw new TypeError("maxAge must be a number");this[Dy]=t.maxAge||0,this[Fy]=t.dispose,this[Cy]=t.noDisposeOnSet||!1,this[My]=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[Ay]=t||1/0,Ty(this)}get max(){return this[Ay]}set allowStale(t){this[Ey]=!!t}get allowStale(){return this[Ey]}set maxAge(t){if("number"!==typeof t)throw new TypeError("maxAge must be a non-negative number");this[Dy]=t,Ty(this)}get maxAge(){return this[Dy]}set lengthCalculator(t){"function"!==typeof t&&(t=By),t!==this[wy]&&(this[wy]=t,this[_y]=0,this[ky].forEach((t=>{t.length=this[wy](t.value,t.key),this[_y]+=t.length}))),Ty(this)}get lengthCalculator(){return this[wy]}get length(){return this[_y]}get itemCount(){return this[ky].length}rforEach(t,e){e=e||this;for(let n=this[ky].tail;null!==n;){const r=n.prev;Py(this,t,n,e),n=r}}forEach(t,e){e=e||this;for(let n=this[ky].head;null!==n;){const r=n.next;Py(this,t,n,e),n=r}}keys(){return this[ky].toArray().map((t=>t.key))}values(){return this[ky].toArray().map((t=>t.value))}reset(){this[Fy]&&this[ky]&&this[ky].length&&this[ky].forEach((t=>this[Fy](t.key,t.value))),this[Sy]=new Map,this[ky]=new xy,this[_y]=0}dump(){return this[ky].map((t=>!Ny(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[ky]}set(t,e,n){if((n=n||this[Dy])&&"number"!==typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,i=this[wy](e,t);if(this[Sy].has(t)){if(i>this[Ay])return zy(this,this[Sy].get(t)),!1;const o=this[Sy].get(t).value;return this[Fy]&&(this[Cy]||this[Fy](t,o.value)),o.now=r,o.maxAge=n,o.value=e,this[_y]+=i-o.length,o.length=i,this.get(t),Ty(this),!0}const o=new Ry(t,e,i,r,n);return o.length>this[Ay]?(this[Fy]&&this[Fy](t,e),!1):(this[_y]+=o.length,this[ky].unshift(o),this[Sy].set(t,this[ky].head),Ty(this),!0)}has(t){if(!this[Sy].has(t))return!1;const e=this[Sy].get(t).value;return!Ny(this,e)}get(t){return Oy(this,t,!0)}peek(t){return Oy(this,t,!1)}pop(){const t=this[ky].tail;return t?(zy(this,t),t.value):null}del(t){zy(this,this[Sy].get(t))}load(t){this.reset();const e=Date.now();for(let n=t.length-1;n>=0;n--){const r=t[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const t=i-e;t>0&&this.set(r.k,r.v,t)}}}prune(){this[Sy].forEach(((t,e)=>Oy(this,e,!1)))}};const jy=Object.freeze({loose:!0}),Uy=Object.freeze({});var Iy=t=>t?"object"!==typeof t?jy:t:Uy,qy={exports:{}};var Wy={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 Hy="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:r,MAX_LENGTH:i}=Wy,o=Hy,a=(e=t.exports={}).re=[],s=e.safeRe=[],u=e.src=[],c=e.t={};let l=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[f,r]],h=(t,e,n)=>{const r=(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),i=l++;o(t,i,e),c[t]=i,u[i]=e,a[i]=new RegExp(e,n?"g":void 0),s[i]=new RegExp(r,n?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-]".concat(f,"*")),h("MAINVERSION","(".concat(u[c.NUMERICIDENTIFIER],")\\.")+"(".concat(u[c.NUMERICIDENTIFIER],")\\.")+"(".concat(u[c.NUMERICIDENTIFIER],")")),h("MAINVERSIONLOOSE","(".concat(u[c.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(u[c.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(u[c.NUMERICIDENTIFIERLOOSE],")")),h("PRERELEASEIDENTIFIER","(?:".concat(u[c.NUMERICIDENTIFIER],"|").concat(u[c.NONNUMERICIDENTIFIER],")")),h("PRERELEASEIDENTIFIERLOOSE","(?:".concat(u[c.NUMERICIDENTIFIERLOOSE],"|").concat(u[c.NONNUMERICIDENTIFIER],")")),h("PRERELEASE","(?:-(".concat(u[c.PRERELEASEIDENTIFIER],"(?:\\.").concat(u[c.PRERELEASEIDENTIFIER],")*))")),h("PRERELEASELOOSE","(?:-?(".concat(u[c.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(u[c.PRERELEASEIDENTIFIERLOOSE],")*))")),h("BUILDIDENTIFIER","".concat(f,"+")),h("BUILD","(?:\\+(".concat(u[c.BUILDIDENTIFIER],"(?:\\.").concat(u[c.BUILDIDENTIFIER],")*))")),h("FULLPLAIN","v?".concat(u[c.MAINVERSION]).concat(u[c.PRERELEASE],"?").concat(u[c.BUILD],"?")),h("FULL","^".concat(u[c.FULLPLAIN],"$")),h("LOOSEPLAIN","[v=\\s]*".concat(u[c.MAINVERSIONLOOSE]).concat(u[c.PRERELEASELOOSE],"?").concat(u[c.BUILD],"?")),h("LOOSE","^".concat(u[c.LOOSEPLAIN],"$")),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE","".concat(u[c.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),h("XRANGEIDENTIFIER","".concat(u[c.NUMERICIDENTIFIER],"|x|X|\\*")),h("XRANGEPLAIN","[v=\\s]*(".concat(u[c.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(u[c.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(u[c.XRANGEIDENTIFIER],")")+"(?:".concat(u[c.PRERELEASE],")?").concat(u[c.BUILD],"?")+")?)?"),h("XRANGEPLAINLOOSE","[v=\\s]*(".concat(u[c.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(u[c.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(u[c.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(u[c.PRERELEASELOOSE],")?").concat(u[c.BUILD],"?")+")?)?"),h("XRANGE","^".concat(u[c.GTLT],"\\s*").concat(u[c.XRANGEPLAIN],"$")),h("XRANGELOOSE","^".concat(u[c.GTLT],"\\s*").concat(u[c.XRANGEPLAINLOOSE],"$")),h("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:$|[^\\d])"),h("COERCERTL",u[c.COERCE],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM","(\\s*)".concat(u[c.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",h("TILDE","^".concat(u[c.LONETILDE]).concat(u[c.XRANGEPLAIN],"$")),h("TILDELOOSE","^".concat(u[c.LONETILDE]).concat(u[c.XRANGEPLAINLOOSE],"$")),h("LONECARET","(?:\\^)"),h("CARETTRIM","(\\s*)".concat(u[c.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",h("CARET","^".concat(u[c.LONECARET]).concat(u[c.XRANGEPLAIN],"$")),h("CARETLOOSE","^".concat(u[c.LONECARET]).concat(u[c.XRANGEPLAINLOOSE],"$")),h("COMPARATORLOOSE","^".concat(u[c.GTLT],"\\s*(").concat(u[c.LOOSEPLAIN],")$|^$")),h("COMPARATOR","^".concat(u[c.GTLT],"\\s*(").concat(u[c.FULLPLAIN],")$|^$")),h("COMPARATORTRIM","(\\s*)".concat(u[c.GTLT],"\\s*(").concat(u[c.LOOSEPLAIN],"|").concat(u[c.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE","^\\s*(".concat(u[c.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(u[c.XRANGEPLAIN],")")+"\\s*$"),h("HYPHENRANGELOOSE","^\\s*(".concat(u[c.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(u[c.XRANGEPLAINLOOSE],")")+"\\s*$"),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(qy,qy.exports);var Xy=qy.exports;const Gy=/^[0-9]+$/,Jy=(t,e)=>{const n=Gy.test(t),r=Gy.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1};var $y={compareIdentifiers:Jy,rcompareIdentifiers:(t,e)=>Jy(e,t)};const Vy=Hy,{MAX_LENGTH:Yy,MAX_SAFE_INTEGER:Ky}=Wy,{safeRe:Zy,t:Qy}=Xy,tb=Iy,{compareIdentifiers:eb}=$y;var nb=class t{constructor(e,n){if(n=tb(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>Yy)throw new TypeError("version is longer than ".concat(Yy," characters"));Vy("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=e.trim().match(n.loose?Zy[Qy.LOOSE]:Zy[Qy.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Ky||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ky||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ky||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((t=>{if(/^[0-9]+$/.test(t)){const e=+t;if(e>=0&&e<Ky)return e}return t})):this.prerelease=[],this.build=r[5]?r[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(Vy("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)),eb(this.major,e.major)||eb(this.minor,e.minor)||eb(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],r=e.prerelease[n];if(Vy("prerelease compare",n,t,r),void 0===t&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===t)return-1;if(t!==r)return eb(t,r)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{const t=this.build[n],r=e.build[n];if(Vy("prerelease compare",n,t,r),void 0===t&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===t)return-1;if(t!==r)return eb(t,r)}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 r=this.prerelease.length;for(;--r>=0;)"number"===typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(t)}}if(e){let r=[e,t];!1===n&&(r=[e]),0===eb(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}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 rb=nb;var ib=(t,e,n)=>new rb(t,n).compare(new rb(e,n));const ob=ib;const ab=ib;const sb=ib;const ub=ib;const cb=ib;const lb=ib;const fb=(t,e,n)=>0===ob(t,e,n),db=(t,e,n)=>0!==ab(t,e,n),hb=(t,e,n)=>sb(t,e,n)>0,pb=(t,e,n)=>ub(t,e,n)>=0,mb=(t,e,n)=>cb(t,e,n)<0,gb=(t,e,n)=>lb(t,e,n)<=0;var vb,yb,bb,xb,Ab=(t,e,n,r)=>{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 fb(t,n,r);case"!=":return db(t,n,r);case">":return hb(t,n,r);case">=":return pb(t,n,r);case"<":return mb(t,n,r);case"<=":return gb(t,n,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function _b(){if(xb)return bb;xb=1;class t{constructor(e,i){if(i=n(i),e instanceof t)return e.loose===!!i.loose&&e.includePrerelease===!!i.includePrerelease?e:new t(e.raw,i);if(e instanceof r)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.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,F(this.options.includePrerelease)),i("hyphen replace",t),t=t.replace(a[s.COMPARATORTRIM],u),i("comparator trim",t),t=t.replace(a[s.TILDETRIM],c),i("tilde trim",t),t=t.replace(a[s.CARETTRIM],l),i("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=>(i("loose invalid filter",t,this.options),!!t.match(a[s.COMPARATORLOOSE]))))),i("range list",v);const y=new Map,b=v.map((t=>new r(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(Xb){return!1}for(let e=0;e<this.set.length;e++)if(C(this.set[e],t,this.options))return!0;return!1}}bb=t;const e=new Ly({max:1e3}),n=Iy,r=function(){if(yb)return vb;yb=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(r,i){if(i=n(i),r instanceof e){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),a("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===t?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(e){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.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(Xb){return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new u(t.value,r).test(this.value):""===t.operator?""===t.value||new u(this.value,r).test(t.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==t.value)&&!(!r.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,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))||!!(o(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}vb=e;const n=Iy,{safeRe:r,t:i}=Xy,o=Ab,a=Hy,s=nb,u=_b();return vb}(),i=Hy,o=nb,{safeRe:a,t:s,comparatorTrimReplace:u,tildeTrimReplace:c,caretTrimReplace:l}=Xy,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=Wy,h=t=>"<0.0.0-0"===t.value,p=t=>""===t.value,m=(t,e)=>{let n=!0;const r=t.slice();let i=r.pop();for(;n&&r.length;)n=r.every((t=>i.intersects(t,e))),i=r.pop();return n},g=(t,e)=>(i("comp",t,e),t=x(t,e),i("caret",t),t=y(t,e),i("tildes",t),t=_(t,e),i("xrange",t),t=E(t,e),i("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,r,o,a)=>{let s;return i("tilde",t,e,n,r,o,a),v(n)?s="":v(r)?s=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):v(o)?s=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):a?(i("replaceTilde pr",a),s=">=".concat(n,".").concat(r,".").concat(o,"-").concat(a," <").concat(n,".").concat(+r+1,".0-0")):s=">=".concat(n,".").concat(r,".").concat(o," <").concat(n,".").concat(+r+1,".0-0"),i("tilde return",s),s}))},x=(t,e)=>t.trim().split(/\s+/).map((t=>A(t,e))).join(" "),A=(t,e)=>{i("caret",t,e);const n=e.loose?a[s.CARETLOOSE]:a[s.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,((e,n,o,a,s)=>{let u;return i("caret",t,e,n,o,a,s),v(n)?u="":v(o)?u=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):v(a)?u="0"===n?">=".concat(n,".").concat(o,".0").concat(r," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".0").concat(r," <").concat(+n+1,".0.0-0"):s?(i("replaceCaret pr",s),u="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")):(i("no pr"),u="0"===n?"0"===o?">=".concat(n,".").concat(o,".").concat(a).concat(r," <").concat(n,".").concat(o,".").concat(+a+1,"-0"):">=".concat(n,".").concat(o,".").concat(a).concat(r," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".").concat(a," <").concat(+n+1,".0.0-0")),i("caret return",u),u}))},_=(t,e)=>(i("replaceXRanges",t,e),t.split(/\s+/).map((t=>w(t,e))).join(" ")),w=(t,e)=>{t=t.trim();const n=e.loose?a[s.XRANGELOOSE]:a[s.XRANGE];return t.replace(n,((n,r,o,a,s,u)=>{i("xRange",t,n,r,o,a,s,u);const c=v(o),l=c||v(a),f=l||v(s),d=f;return"="===r&&d&&(r=""),u=e.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(l&&(a=0),s=0,">"===r?(r=">=",l?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",l?o=+o+1:a=+a+1),"<"===r&&(u="-0"),n="".concat(r+o,".").concat(a,".").concat(s).concat(u)):l?n=">=".concat(o,".0.0").concat(u," <").concat(+o+1,".0.0-0"):f&&(n=">=".concat(o,".").concat(a,".0").concat(u," <").concat(o,".").concat(+a+1,".0-0")),i("xRange return",n),n}))},E=(t,e)=>(i("replaceStars",t,e),t.trim().replace(a[s.STAR],"")),D=(t,e)=>(i("replaceGTE0",t,e),t.trim().replace(a[e.includePrerelease?s.GTE0PRE:s.GTE0],"")),F=t=>(e,n,r,i,o,a,s,u,c,l,f,d,h)=>(n=v(r)?"":v(i)?">=".concat(r,".0.0").concat(t?"-0":""):v(o)?">=".concat(r,".").concat(i,".0").concat(t?"-0":""):a?">=".concat(n):">=".concat(n).concat(t?"-0":""),u=v(c)?"":v(l)?"<".concat(+c+1,".0.0-0"):v(f)?"<".concat(c,".").concat(+l+1,".0-0"):d?"<=".concat(c,".").concat(l,".").concat(f,"-").concat(d):t?"<".concat(c,".").concat(l,".").concat(+f+1,"-0"):"<=".concat(u),"".concat(n," ").concat(u).trim()),C=(t,e,n)=>{for(let r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let n=0;n<t.length;n++)if(i(t[n].semver),t[n].semver!==r.ANY&&t[n].semver.prerelease.length>0){const r=t[n].semver;if(r.major===e.major&&r.minor===e.minor&&r.patch===e.patch)return!0}return!1}return!0};return bb}const wb=_b();var Eb=(t,e,n)=>{try{e=new wb(e,n)}catch(Xb){return!1}return e.test(t)},Db=hy(Eb);var Fb='.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 Cb(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];for(const i of n)kb(t,i);return t}function kb(t,e){for(const n of Object.keys(e))(0,j.writeConfig)(t,n,e[n],!0)}function Sb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Mb(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Sb(Object(n),!0).forEach((function(e){dy(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Sb(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}const Bb=j;let Ob=o;const Nb="undefined"!==typeof window?window:void 0;void 0===Ob&&null!==Nb&&void 0!==Nb&&null!==(sy=Nb.vl)&&void 0!==sy&&sy.compile&&(Ob=Nb.vl);const Tb={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},zb={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"},Rb={vega:"Vega","vega-lite":"Vega-Lite"},Pb={vega:Bb.version,"vega-lite":Ob?Ob.version:"not available"},Lb={vega:t=>t,"vega-lite":(t,e)=>Ob.compile(t,{config:e}).spec},jb='\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>',Ub="chart-wrapper";function Ib(t,e,n,r){const i="<html><head>".concat(e,'</head><body><pre><code class="json">'),o="</code></pre>".concat(n,"</body></html>"),a=window.open("");a.document.write(i+t+o),a.document.title="".concat(Rb[r]," JSON Source")}function qb(t){return(e=t)&&"load"in e?t:Bb.loader(t);var e}async function Wb(t,e){var n,r;let i,o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,j.isString)(e)?(o=qb(s.loader),i=JSON.parse(await o.load(e))):i=e;const u=function(t){var e,n;const r=null!==(e=null===(n=t.usermeta)||void 0===n?void 0:n.embedOptions)&&void 0!==e?e:{};return(0,j.isString)(r.defaultStyle)&&(r.defaultStyle=!1),r}(i),c=u.loader;var l;o&&!c||(o=qb(null!==(l=s.loader)&&void 0!==l?l:c));const f=await Hb(u,o),d=await Hb(s,o),h=Mb(Mb({},Cb(d,f)),{},{config:(0,j.mergeConfig)(null!==(n=d.config)&&void 0!==n?n:{},null!==(r=f.config)&&void 0!==r?r:{})});return await async function(t,e){var n,r,i,o,s,u,c;let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},f=arguments.length>3?arguments[3]:void 0;const d=l.theme?(0,j.mergeConfig)(a[l.theme],null!==(n=l.config)&&void 0!==n?n:{}):l.config,h=(0,j.isBoolean)(l.actions)?l.actions:Cb({},Tb,null!==(r=l.actions)&&void 0!==r?r:{}),p=Mb(Mb({},zb),l.i18n),m=null!==(i=l.renderer)&&void 0!==i?i:"canvas",g=null!==(o=l.logLevel)&&void 0!==o?o:Bb.Warn,v=null!==(s=l.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!==l.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===l.defaultStyle||!0===l.defaultStyle?Fb.toString():l.defaultStyle,n.appendChild(e)}}const b=function(t,e){if(t.$schema){const r=tv(t.$schema);var n;e&&e!==r.library&&console.warn("The given visualization spec is written in ".concat(Rb[r.library],", but mode argument sets ").concat(null!==(n=Rb[e])&&void 0!==n?n:e,"."));const i=r.library;return Db(Pb[i],"^".concat(r.version.slice(1)))||console.warn("The input spec uses ".concat(Rb[i]," ").concat(r.version,", but the current version of ").concat(Rb[i]," is v").concat(Pb[i],".")),i}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,l.mode);let x=Lb[b](e,d);if("vega-lite"===b&&x.$schema){const t=tv(x.$schema);Db(Pb.vega,"^".concat(t.version.slice(1)))||console.warn("The compiled spec uses Vega ".concat(t.version,", but current version is v").concat(Pb.vega,"."))}y.classList.add("vega-embed"),h&&y.classList.add("has-actions");y.innerHTML="";let A=y;if(h){const t=document.createElement("div");t.classList.add(Ub),y.appendChild(t),A=t}const _=l.patch;_&&(x=_ instanceof Function?_(x):E(x,_,!0,!1).newDocument);l.formatLocale&&Bb.formatLocale(l.formatLocale);l.timeFormatLocale&&Bb.timeFormatLocale(l.timeFormatLocale);if(l.expressionFunctions)for(const a in l.expressionFunctions){const t=l.expressionFunctions[a];"fn"in t?Bb.expressionFunction(a,t.fn,t.visitor):t instanceof Function&&Bb.expressionFunction(a,t)}const{ast:w}=l,D=Bb.parse(x,"vega-lite"===b?{}:d,{ast:w}),F=new(l.viewClass||Bb.View)(D,Mb({loader:f,logLevel:g,renderer:m},w?{expr:null!==(u=null!==(c=Bb.expressionInterpreter)&&void 0!==c?c:l.expr)&&void 0!==u?u:U.N}:{}));if(F.addSignalListener("autosize",((t,e)=>{const{type:n}=e;"fit-x"==n?(A.classList.add("fit-x"),A.classList.remove("fit-y")):"fit-y"==n?(A.classList.remove("fit-x"),A.classList.add("fit-y")):"fit"==n?A.classList.add("fit-x","fit-y"):A.classList.remove("fit-x","fit-y")})),!1!==l.tooltip){const t="function"===typeof l.tooltip?l.tooltip:new ay(!0===l.tooltip?{}:l.tooltip).call;F.tooltip(t)}let C,{hover:k}=l;void 0===k&&(k="vega"===b);if(k){const{hoverSet:t,updateSet:e}="boolean"===typeof k?{}:k;F.hover(t,e)}l&&(null!=l.width&&F.width(l.width),null!=l.height&&F.height(l.height),null!=l.padding&&F.padding(l.padding));if(await F.initialize(A,l.bind).runAsync(),!1!==h){let t=y;if(!1!==l.defaultStyle||l.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=jb,e.append(n),C=t=>{e.contains(t.target)||e.removeAttribute("open")},document.addEventListener("click",C)}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")],r=document.createElement("a"),i=(0,j.isObject)(l.scaleFactor)?l.scaleFactor[e]:l.scaleFactor;r.text=t,r.href="#",r.target="_blank",r.download="".concat(v,".").concat(e),r.addEventListener("mousedown",(async function(t){t.preventDefault();const n=await F.toImageURL(e,i);this.href=n})),n.append(r)}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,r;Ib(L()(e),null!==(n=l.sourceHeader)&&void 0!==n?n:"",null!==(r=l.sourceFooter)&&void 0!==r?r:"",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;Ib(L()(x),null!==(e=l.sourceHeader)&&void 0!==e?e:"",null!==(n=l.sourceFooter)&&void 0!==n?n:"","vega"),t.preventDefault()})),n.append(t)}if(!0===h||!1!==h.editor){var S;const t=null!==(S=l.editorUrl)&&void 0!==S?S:"https://vega.github.io/editor/",r=document.createElement("a");r.text=p.EDITOR_ACTION,r.href="#",r.addEventListener("click",(function(n){!function(t,e,n){const r=t.open(e),{origin:i}=new URL(e);let o=40;t.addEventListener("message",(function e(n){n.source===r&&(o=0,t.removeEventListener("message",e,!1))}),!1),setTimeout((function t(){o<=0||(r.postMessage(n,i),setTimeout(t,250),o-=1)}),250)}(window,t,{config:d,mode:b,renderer:m,spec:L()(e)}),n.preventDefault()})),n.append(r)}}function M(){C&&document.removeEventListener("click",C),F.finalize()}return{view:F,spec:e,vgSpec:x,finalize:M,embedOptions:l}}(t,i,h,o)}async function Hb(t,e){var n;const r=(0,j.isString)(t.config)?JSON.parse(await e.load(t.config)):null!==(n=t.config)&&void 0!==n?n:{},i=(0,j.isString)(t.patch)?JSON.parse(await e.load(t.patch)):t.patch;return Mb(Mb(Mb({},t),i?{patch:i}:{}),r?{config:r}:{})}},77155:(t,e,n)=>{"use strict";n.d(e,{r:()=>g});const r="view",i="[",o="]",a="{",s="}",u=":",c=",",l="@",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||r,m=n||h,y(t.trim()).map(b)}function v(t,e,n,r,i){const o=t.length;let a,s=0;for(;e<o;++e){if(a=t[e],!s&&a===n)return e;i&&i.indexOf(a)>=0?--s:r&&r.indexOf(a)>=0&&++s}return e}function y(t){const e=[],n=t.length;let r=0,u=0;for(;u<n;)u=v(t,u,c,i+a,o+s),e.push(t.substring(r,u).trim()),r=++u;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,r=1;if(r=v(t,r,o,i,o),r===e)throw"Empty between selector: "+t;if(n=y(t.substring(1,r)),2!==n.length)throw"Between selector must have two elements: "+t;if(t=t.slice(r+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 r,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(c);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(_){throw"Invalid throttle specification: "+t}b=(t=t.slice(0,x).trim()).length,x=0}if(!b)throw t;t[0]===l&&(g=++x);r=v(t,x,u),r<b&&(n.push(t.substring(y,r).trim()),y=x=++r);if(x=v(t,x,i),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]!==i)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):(A=n[0],m[A]?e.marktype=n[0]:e.source=n[0])):e.type=n[0];var A;"!"===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)}},60784:(t,e,n)=>{"use strict";n.d(e,{N:()=>h});var r={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},i={"*":(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 r=n?n(e[0]):e[0];return r[t].apply(r,a.call(e,1))};var u={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,r,i,o,a)=>new Date(t,e||0,null!=n?n:1,r||0,i||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 c=["view","item","group","xy","x","y"],l=new Set([Function,eval,setTimeout,setInterval]);"function"===typeof setImmediate&&l.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:r[n]||t.params["$"+n]},MemberExpression:(t,e)=>{const n=!e.computed,r=t(e.object);n&&(t.memberDepth+=1);const i=t(e.property);if(n&&(t.memberDepth-=1),!l.has(r[i]))return r[i];console.error('Prevented interpretation of member "'.concat(i,'" which could lead to insecure code execution'))},CallExpression:(t,e)=>{const n=e.arguments;let r=e.callee.name;return r.startsWith("_")&&(r=r.slice(1)),"if"===r?t(n[0])?t(n[1]):t(n[2]):(t.fn[r]||u[r]).apply(t.fn,n.map(t))},ArrayExpression:(t,e)=>e.elements.map(t),BinaryExpression:(t,e)=>i[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 r=t(n.key);return t.memberDepth-=1,l.has(t(n.value))?console.error('Prevented interpretation of property "'.concat(r,'" which could lead to insecure code execution')):e[r]=t(n.value),e}),{})};function d(t,e,n,r,i,o){const a=t=>f[t.type](a,t);return a.memberDepth=0,a.fn=Object.create(e),a.params=n,a.datum=r,a.event=i,a.item=o,c.forEach((t=>a.fn[t]=function(){return i.vega[t](...arguments)})),a(t)}var h={operator(t,e){const n=e.ast,r=t.functions;return t=>d(n,r,t)},parameter(t,e){const n=e.ast,r=t.functions;return(t,e)=>d(n,r,e,t)},event(t,e){const n=e.ast,r=t.functions;return t=>d(n,r,void 0,void 0,t)},handler(t,e){const n=e.ast,r=t.functions;return(t,e)=>{const i=e.item&&e.item.datum;return d(n,r,t,i,e)}},encode(t,e){const{marktype:n,channels:r}=e,i=t.functions,o="group"===n||"image"===n||"rect"===n;return(t,e)=>{const a=t.datum;let s,u=0;for(const n in r)s=d(r[n].ast,i,e,a,void 0,t),t[n]!==s&&(t[n]=s,u=1);return"rule"!==n&&function(t,e,n){let r;e.x2&&(e.x?(n&&t.x>t.x2&&(r=t.x,t.x=t.x2,t.x2=r),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&&(r=t.y,t.y=t.y2,t.y2=r),t.height=t.y2-t.y):t.y=t.y2-(t.height||0)),e.yc&&(t.y=t.yc-(t.height||0)/2)}(t,r,o),u}}}},15721:(t,e,n)=>{"use strict";function r(t,e,n){return t.fields=e||[],t.fname=n,t}function i(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]):u(t)}n.d(e,{$G:()=>Pt,$m:()=>Ft,BB:()=>zt,Ds:()=>at,Dw:()=>j,EP:()=>f,FP:()=>Lt,HD:()=>_t,He:()=>O,Hq:()=>b,IX:()=>Y,J_:()=>yt,Jy:()=>wt,Kj:()=>At,Kn:()=>F,N3:()=>V,Oj:()=>o,QA:()=>I,Rg:()=>Rt,TS:()=>Ct,TW:()=>bt,We:()=>ut,XW:()=>mt,Xr:()=>ht,ZE:()=>r,ZU:()=>Tt,Zw:()=>q,_k:()=>l,a9:()=>ot,ay:()=>H,bM:()=>p,bV:()=>J,cG:()=>w,dH:()=>X,dI:()=>ct,el:()=>i,fE:()=>k,fj:()=>B,hj:()=>xt,iL:()=>S,id:()=>d,j2:()=>et,jj:()=>x,jn:()=>vt,k:()=>v,kI:()=>_,kJ:()=>D,kX:()=>m,kg:()=>E,l$:()=>K,l7:()=>st,m8:()=>Bt,mJ:()=>U,mK:()=>G,mS:()=>$,mf:()=>Z,nr:()=>ft,qu:()=>tt,rx:()=>kt,sw:()=>Ot,t7:()=>Et,u5:()=>gt,uU:()=>A,vU:()=>c,vk:()=>St,yP:()=>Mt,yR:()=>h,yb:()=>g,yl:()=>pt});const s=t=>function(e){return e[t]},u=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function c(t){throw Error(t)}function l(t){const e=[],n=t.length;let r,i,o,a=null,s=0,u="";function l(){e.push(u+t.substring(r,i)),u="",r=i+1}for(t+="",r=i=0;i<n;++i)if(o=t[i],"\\"===o)u+=t.substring(r,i++),r=i;else if(o===a)l(),a=null,s=-1;else{if(a)continue;r===s&&'"'===o||r===s&&"'"===o?(r=i+1,a=o):"."!==o||s?"["===o?(i>r&&l(),s=r=i+1):"]"===o&&(s||c("Access path missing open bracket: "+t),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&c("Access path missing closing bracket: "+t),a&&c("Access path missing closing quote: "+t),i>r&&(i++,l()),e}function f(t,e,n){const i=l(t);return t=1===i.length?i[0]:t,r((n&&n.get||a)(i),[t],e||t)}const d=f("id"),h=r((t=>t),[],"identity"),p=r((()=>0),[],"zero"),m=r((()=>1),[],"one"),g=r((()=>!0),[],"true"),v=r((()=>!1),[],"false");function y(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const b=0,x=1,A=2,_=3,w=4;function E(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y,r=t||b;return{level(t){return arguments.length?(r=+t,this):r},error(){return r>=x&&n(e||"error","ERROR",arguments),this},warn(){return r>=A&&n(e||"warn","WARN",arguments),this},info(){return r>=_&&n(e||"log","INFO",arguments),this},debug(){return r>=w&&n(e||"log","DEBUG",arguments),this}}}var D=Array.isArray;function F(t){return t===Object(t)}const C=t=>"__proto__"!==t;function k(){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=M(t.signals,e.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;S(t,n,e[n],r)}return t}),{})}function S(t,e,n,r){if(!C(e))return;let i,o;if(F(n)&&!D(n))for(i in o=F(t[e])?t[e]:t[e]={},n)r&&(!0===r||r[i])?S(o,i,n[i]):C(i)&&(o[i]=n[i]);else t[e]=n}function M(t,e){if(null==t)return e;const n={},r=[];function i(t){n[t.name]||(n[t.name]=1,r.push(t))}return e.forEach(i),t.forEach(i),r}function B(t){return t[t.length-1]}function O(t){return null==t||""===t?null:+t}const N=t=>e=>t*Math.exp(e),T=t=>e=>Math.log(t*e),z=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),R=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,P=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function L(t,e,n,r){const i=n(t[0]),o=n(B(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function j(t,e){return L(t,e,O,h)}function U(t,e){var n=Math.sign(t[0]);return L(t,e,T(n),N(n))}function I(t,e,n){return L(t,e,P(n),P(1/n))}function q(t,e,n){return L(t,e,z(n),R(n))}function W(t,e,n,r,i){const o=r(t[0]),a=r(B(t)),s=null!=e?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function H(t,e,n){return W(t,e,n,O,h)}function X(t,e,n){const r=Math.sign(t[0]);return W(t,e,n,T(r),N(r))}function G(t,e,n,r){return W(t,e,n,P(r),P(1/r))}function J(t,e,n,r){return W(t,e,n,z(r),R(r))}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 r,i=t[0],o=t[1];return o<i&&(r=o,o=i,i=r),r=o-i,r>=n-e?[e,n]:[i=Math.min(Math.max(i,e),n-r),i+r]}function Z(t){return"function"===typeof t}const Q="descending";function tt(t,e,n){n=n||{},e=Y(e)||[];const i=[],a=[],s={},u=n.comparator||nt;return Y(t).forEach(((t,r)=>{null!=t&&(i.push(e[r]===Q?-1:1),a.push(t=Z(t)?t:f(t,null,n)),(o(t)||[]).forEach((t=>s[t]=1)))})),0===a.length?null:r(u(a,i),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?rt(t[0],e[0]):it(t,e,t.length),rt=(t,e)=>function(n,r){return et(t(n),t(r))*e},it=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,s=-1;for(;0===a&&++s<n;)o=t[s],a=et(o(r),o(i));return a*e[s]});function ot(t){return Z(t)?t:()=>t}function at(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout((()=>(e(r),n=null)),t)}}function st(t){for(let e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r],e)t[n]=e[n];return t}function ut(t,e){let n,r,i,o,a=0;if(t&&(n=t.length))if(null==e){for(r=t[a];a<n&&(null==r||r!==r);r=t[++a]);for(i=o=r;a<n;++a)r=t[a],null!=r&&(r<i&&(i=r),r>o&&(o=r))}else{for(r=e(t[a]);a<n&&(null==r||r!==r);r=e(t[++a]));for(i=o=r;a<n;++a)r=e(t[a]),null!=r&&(r<i&&(i=r),r>o&&(o=r))}return[i,o]}function ct(t,e){const n=t.length;let r,i,o,a,s,u=-1;if(null==e){for(;++u<n;)if(i=t[u],null!=i&&i>=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++u<n;)i=t[u],null!=i&&(r>i&&(r=i,a=u),o<i&&(o=i,s=u))}else{for(;++u<n;)if(i=e(t[u],u,t),null!=i&&i>=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++u<n;)i=e(t[u],u,t),null!=i&&(r>i&&(r=i,a=u),o<i&&(o=i,s=u))}return[a,s]}const lt=Object.prototype.hasOwnProperty;function ft(t,e){return lt.call(t,e)}const dt={};function ht(t){let e,n={};function r(t){return ft(n,t)&&n[t]!==dt}const i={size:0,empty:0,object:n,has:r,get:t=>r(t)?n[t]:void 0,set(t,e){return r(t)||(++i.size,n[t]===dt&&--i.empty),n[t]=e,this},delete(t){return r(t)&&(--i.size,++i.empty,n[t]=dt),this},clear(){i.size=i.empty=0,i.object=n={}},test(t){return arguments.length?(e=t,i):e},clean(){const t={};let r=0;for(const i in n){const o=n[i];o===dt||e&&e(o)||(t[i]=o,++r)}i.size=r,i.empty=0,i.object=n=t}};return t&&Object.keys(t).forEach((e=>{i.set(e,t[e])})),i}function pt(t,e,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let s,u=t[0],c=B(t);c<u&&(s=u,u=c,c=s),s=Math.abs(e-u);const l=Math.abs(c-e);return s<l&&s<=a?r:l<=a?i:o}function mt(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),st(r,n)}function gt(t,e,n,r){let i,o=e[0],a=e[e.length-1];return o>a&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=t:o<t)&&(r?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 At(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function _t(t){return"string"===typeof t}function wt(t,e,n){t&&(t=e?Y(t).map((t=>t.replace(/\\(.)/g,"$1"))):Y(t));const i=t&&t.length,o=n&&n.get||a,s=t=>o(e?[t]:l(t));let u;if(i)if(1===i){const e=s(t[0]);u=function(t){return""+e(t)}}else{const e=t.map(s);u=function(t){let n=""+e[0](t),r=0;for(;++r<i;)n+="|"+e[r](t);return n}}else u=function(){return""};return r(u,t,"key")}function Et(t,e){const n=t[0],r=B(t),i=+e;return i?1===i?r:n+i*(r-n):n}const Dt=1e4;function Ft(t){let e,n,r;t=+t||Dt;const i=()=>{e={},n={},r=0},o=(i,o)=>(++r>t&&(n=e,e={},r=1),e[i]=o);return i(),{clear:i,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 Ct(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let s=0,u=0,c=0;for(;s<i&&u<o;++c)a[c]=t(e[s],n[u])>0?n[u++]:e[s++];for(;s<i;++s,++c)a[c]=e[s];for(;u<o;++u,++c)a[c]=n[u];return a}function kt(t,e){let n="";for(;--e>=0;)n+=t;return n}function St(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:"left"===r?kt(i,a)+o:"center"===r?kt(i,~~(a/2))+o+kt(i,Math.ceil(a/2)):o+kt(i,a)}function Mt(t){return t&&B(t)-t[0]||0}function Bt(t){return D(t)?"["+t.map(Bt)+"]":F(t)||_t(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function Ot(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t}const Nt=t=>xt(t)||yt(t)?t:Date.parse(t);function Tt(t,e){return e=e||Nt,null==t||""===t?null:e(t)}function zt(t){return null==t||""===t?null:t+""}function Rt(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function Pt(t,e,n,r){const i=null!=r?r:"\u2026",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:"left"===n?i+o.slice(a-s):"center"===n?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i}function Lt(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const r=e(t[i]);r&&n(r,i,t)}}else t.forEach(n)}},40566:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Bounds:()=>Eh,CanvasHandler:()=>ng,CanvasRenderer:()=>sg,DATE:()=>Kt,DAY:()=>Zt,DAYOFYEAR:()=>Qt,Dataflow:()=>to,Debug:()=>m.cG,Error:()=>m.jj,EventStream:()=>ji,Gradient:()=>kd,GroupItem:()=>Fh,HOURS:()=>te,Handler:()=>Pm,Info:()=>m.kI,Item:()=>Dh,MILLISECONDS:()=>re,MINUTES:()=>ee,MONTH:()=>Vt,Marks:()=>Am,MultiPulse:()=>Vi,None:()=>m.Hq,Operator:()=>Ri,Parameters:()=>Ni,Pulse:()=>Xi,QUARTER:()=>$t,RenderType:()=>Zg,Renderer:()=>jm,ResourceLoader:()=>Ch,SECONDS:()=>ne,SVGHandler:()=>cg,SVGRenderer:()=>zg,SVGStringRenderer:()=>Vg,Scenegraph:()=>Sm,TIME_UNITS:()=>ie,Transform:()=>no,View:()=>AN,WEEK:()=>Yt,Warn:()=>m.uU,YEAR:()=>Jt,accessor:()=>m.ZE,accessorFields:()=>m.Oj,accessorName:()=>m.el,array:()=>m.IX,ascending:()=>m.j2,bandwidthNRD:()=>bC,bin:()=>xC,bootstrapCI:()=>wC,boundClip:()=>av,boundContext:()=>$h,boundItem:()=>_m,boundMark:()=>Em,boundStroke:()=>Mh,changeset:()=>Bi,clampRange:()=>m.l$,codegenExpression:()=>mz,compare:()=>m.qu,constant:()=>m.a9,cumulativeLogNormal:()=>LC,cumulativeNormal:()=>OC,cumulativeUniform:()=>HC,dayofyear:()=>fe,debounce:()=>m.Ds,defaultLocale:()=>Wr,definition:()=>io,densityLogNormal:()=>PC,densityNormal:()=>BC,densityUniform:()=>WC,domChild:()=>Nm,domClear:()=>Tm,domCreate:()=>Bm,domFind:()=>Om,dotbin:()=>EC,error:()=>m.vU,expressionFunction:()=>gR,extend:()=>m.l7,extent:()=>m.We,extentIndex:()=>m.dI,falsy:()=>m.k,fastmap:()=>m.Xr,field:()=>m.EP,flush:()=>m.yl,font:()=>hm,fontFamily:()=>dm,fontSize:()=>sm,format:()=>hi,formatLocale:()=>zr,formats:()=>pi,hasOwnProperty:()=>m.nr,id:()=>m.id,identity:()=>m.yR,inferType:()=>ai,inferTypes:()=>si,ingest:()=>Di,inherits:()=>m.XW,inrange:()=>m.u5,interpolate:()=>Yf,interpolateColors:()=>Jf,interpolateRange:()=>Gf,intersect:()=>ev,intersectBoxLine:()=>op,intersectPath:()=>ep,intersectPoint:()=>np,intersectRule:()=>ip,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:()=>_i,key:()=>m.Jy,lerp:()=>m.t7,lineHeight:()=>um,loader:()=>vi,locale:()=>qr,logger:()=>m.kg,lruCache:()=>m.$m,markup:()=>Cg,merge:()=>m.TS,mergeConfig:()=>m.fE,multiLineOffset:()=>lm,one:()=>m.kX,pad:()=>m.vk,panLinear:()=>m.Dw,panLog:()=>m.mJ,panPow:()=>m.QA,panSymlog:()=>m.Zw,parse:()=>TU,parseExpression:()=>dz,parseSelector:()=>vR.r,path:()=>Bu,pathCurves:()=>Md,pathEqual:()=>cv,pathParse:()=>Rd,pathRectangle:()=>ah,pathRender:()=>Jd,pathSymbols:()=>Kd,pathTrail:()=>sh,peek:()=>m.fj,point:()=>Rm,projection:()=>__,quantileLogNormal:()=>jC,quantileNormal:()=>NC,quantileUniform:()=>XC,quantiles:()=>vC,quantizeInterpolator:()=>$f,quarter:()=>m.mS,quartiles:()=>yC,random:()=>AC,randomInteger:()=>FC,randomKDE:()=>zC,randomLCG:()=>DC,randomLogNormal:()=>UC,randomMixture:()=>IC,randomNormal:()=>TC,randomUniform:()=>GC,read:()=>gi,regressionConstant:()=>JC,regressionExp:()=>tk,regressionLinear:()=>ZC,regressionLoess:()=>sk,regressionLog:()=>QC,regressionPoly:()=>rk,regressionPow:()=>ek,regressionQuad:()=>nk,renderModule:()=>tv,repeat:()=>m.rx,resetDefaultLocale:()=>Hr,resetSVGClipId:()=>_h,resetSVGDefIds:()=>lv,responseType:()=>mi,runtimeContext:()=>CO,sampleCurve:()=>fk,sampleLogNormal:()=>RC,sampleNormal:()=>MC,sampleUniform:()=>qC,scale:()=>Rf,sceneEqual:()=>uv,sceneFromJSON:()=>Cm,scenePickVisit:()=>gp,sceneToJSON:()=>Fm,sceneVisit:()=>mp,sceneZOrder:()=>pp,scheme:()=>td,serializeXML:()=>kg,setRandom:()=>_C,span:()=>m.yP,splitAccessPath:()=>m._k,stringValue:()=>m.m8,textMetrics:()=>em,timeBin:()=>en,timeFloor:()=>Ce,timeFormatLocale:()=>Ur,timeInterval:()=>Ne,timeOffset:()=>Re,timeSequence:()=>je,timeUnitSpecifier:()=>ue,timeUnits:()=>ae,toBoolean:()=>m.sw,toDate:()=>m.ZU,toNumber:()=>m.He,toSet:()=>m.Rg,toString:()=>m.BB,transform:()=>oo,transforms:()=>ro,truncate:()=>m.$G,truthy:()=>m.yb,tupleid:()=>wi,typeParsers:()=>ri,utcFloor:()=>Me,utcInterval:()=>Te,utcOffset:()=>Pe,utcSequence:()=>Ue,utcdayofyear:()=>ve,utcquarter:()=>m.N3,utcweek:()=>ye,version:()=>zU,visitArray:()=>m.FP,week:()=>de,writeConfig:()=>m.iL,zero:()=>m.bM,zoomLinear:()=>m.ay,zoomLog:()=>m.dH,zoomPow:()=>m.mK,zoomSymlog:()=>m.bV});var r={};n.r(r),n.d(r,{aggregate:()=>aa,bin:()=>sa,collect:()=>ca,compare:()=>la,countpattern:()=>da,cross:()=>ha,density:()=>va,dotbin:()=>_a,expression:()=>wa,extent:()=>Da,facet:()=>Ca,field:()=>ka,filter:()=>Ma,flatten:()=>Ba,fold:()=>Oa,formula:()=>Na,generate:()=>Ta,impute:()=>Pa,joinaggregate:()=>La,kde:()=>ja,key:()=>Ua,load:()=>qa,lookup:()=>Ha,multiextent:()=>Xa,multivalues:()=>Ja,params:()=>Va,pivot:()=>Ya,prefacet:()=>Ka,project:()=>Za,proxy:()=>Qa,quantile:()=>ts,relay:()=>es,sample:()=>ns,sequence:()=>rs,sieve:()=>is,subflow:()=>Fa,timeunit:()=>os,tupleindex:()=>ss,values:()=>us,window:()=>hs});var i={};n.r(i),n.d(i,{interpolate:()=>cc,interpolateArray:()=>nc,interpolateBasis:()=>cl.Z,interpolateBasisClosed:()=>ll.Z,interpolateCubehelix:()=>nf,interpolateCubehelixLong:()=>rf,interpolateDate:()=>ic,interpolateDiscrete:()=>fl,interpolateHcl:()=>Wl,interpolateHclLong:()=>Hl,interpolateHsl:()=>yl,interpolateHslLong:()=>bl,interpolateHue:()=>hl,interpolateLab:()=>Il,interpolateNumber:()=>oc.Z,interpolateNumberArray:()=>tc,interpolateObject:()=>ac,interpolateRgb:()=>Qu.ZP,interpolateRgbBasis:()=>Qu.hD,interpolateRgbBasisClosed:()=>Qu.YD,interpolateRound:()=>lc,interpolateString:()=>sc.Z,interpolateTransformCss:()=>pl.Y,interpolateTransformSvg:()=>pl.w,interpolateZoom:()=>gl,piecewise:()=>Zc,quantize:()=>of});var o={};n.r(o),n.d(o,{bound:()=>$v,identifier:()=>Kv,mark:()=>Zv,overlap:()=>Qv,render:()=>ay,viewlayout:()=>ky});var a={};n.r(a),n.d(a,{axisticks:()=>My,datajoin:()=>By,encode:()=>Ny,legendentries:()=>Ty,linkpath:()=>jy,pie:()=>Hy,scale:()=>$y,sortitems:()=>Zy,stack:()=>rb});var s={};n.r(s),n.d(s,{contour:()=>X_,geojson:()=>$_,geopath:()=>V_,geopoint:()=>Y_,geoshape:()=>K_,graticule:()=>Z_,heatmap:()=>Q_,isocontour:()=>z_,kde2d:()=>q_,projection:()=>ew});var u={};n.r(u),n.d(u,{force:()=>Pw});var c={};n.r(c),n.d(c,{nest:()=>HE,pack:()=>YE,partition:()=>ZE,stratify:()=>QE,tree:()=>nD,treelinks:()=>rD,treemap:()=>aD});var l={};n.r(l),n.d(l,{label:()=>jD});var f={};n.r(f),n.d(f,{loess:()=>lF,regression:()=>dF});var d={};n.r(d),n.d(d,{voronoi:()=>XF});var h={};n.r(h),n.d(h,{wordcloud:()=>sC});var p={};n.r(p),n.d(p,{crossfilter:()=>pC,resolvefilter:()=>mC});var m=n(15721),g={},v={},y=34,b=10,x=13;function A(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function _(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function w(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function E(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),o=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+w(-e,6):e>9999?"+"+w(e,6):w(e,4))+"-"+w(t.getUTCMonth()+1,2)+"-"+w(t.getUTCDate(),2)+(o?"T"+w(n,2)+":"+w(r,2)+":"+w(i,2)+"."+w(o,3)+"Z":i?"T"+w(n,2)+":"+w(r,2)+":"+w(i,2)+"Z":r||n?"T"+w(n,2)+":"+w(r,2)+"Z":"")}function D(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,u=o<=0,c=!1;function l(){if(u)return v;if(c)return c=!1,g;var e,r,i=a;if(t.charCodeAt(i)===y){for(;a++<o&&t.charCodeAt(a)!==y||t.charCodeAt(++a)===y;);return(e=a)>=o?u=!0:(r=t.charCodeAt(a++))===b?c=!0:r===x&&(c=!0,t.charCodeAt(a)===b&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if((r=t.charCodeAt(e=a++))===b)c=!0;else if(r===x)c=!0,t.charCodeAt(a)===b&&++a;else if(r!==n)continue;return t.slice(i,e)}return u=!0,t.slice(i,o)}for(t.charCodeAt(o-1)===b&&--o,t.charCodeAt(o-1)===x&&--o;(r=l())!==v;){for(var f=[];r!==g&&r!==v;)f.push(r),r=l();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(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,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=A(t);return function(r,i){return e(n(r),i,t)}}(t,e):A(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=_(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=_(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function F(t){return t}function C(t,e){return"string"===typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return k(t,e)}))}:k(t,e)}function k(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,o=S(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function S(t,e){var n=function(t){if(null==t)return F;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,s){s||(e=n=0);var u=2,c=t.length,l=new Array(c);for(l[0]=(e+=t[0])*r+o,l[1]=(n+=t[1])*i+a;u<c;)l[u]=t[u],++u;return l}}(t.transform),r=t.arcs;function i(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],o=0,a=i.length;o<a;++o)e.push(n(i[o],o));t<0&&function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n}(e,a)}function o(t){return n(t)}function a(t){for(var e=[],n=0,r=t.length;n<r;++n)i(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 u(t){return t.map(s)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,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=u(e.arcs);break;case"MultiPolygon":n=e.arcs.map(u);break;default:return null}return{type:r,coordinates:n}}(e)}function M(t,e){var n={},r={},i={},o=[],a=-1;function s(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach((function(t){n[t<0?~t:t]=1})),o.push(i)}}return e.forEach((function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++a],e[a]=n,e[r]=i)})),e.forEach((function(e){var n,o,a=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];t.transform?(n=[0,0],r.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=r[r.length-1];return e<0?[n,i]:[i,n]}(e),s=a[0],u=a[1];if(n=i[s])if(delete i[n.end],n.push(e),n.end=u,o=r[u]){delete r[o.start];var c=o===n?n:n.concat(o);r[c.start=n.start]=i[c.end=o.end]=c}else r[n.start]=i[n.end]=n;else if(n=r[u])if(delete r[n.start],n.unshift(e),n.start=s,o=i[s]){delete i[o.end];var l=o===n?n:o.concat(n);r[l.start=o.start]=i[l.end=n.end]=l}else r[n.start]=i[n.end]=n;else r[(n=[e]).start=s]=i[n.end=u]=n})),s(i,r),s(r,i),e.forEach((function(t){n[t<0?~t:t]||o.push([t])})),o}function B(t){return S(t,O.apply(this,arguments))}function O(t,e,n){var r,i,o;if(arguments.length>1)r=function(t,e,n){var r,i=[],o=[];function a(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:r})}function s(t){t.forEach(a)}function u(t){t.forEach(s)}function c(t){t.forEach(u)}function l(t){switch(r=t,t.type){case"GeometryCollection":t.geometries.forEach(l);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":u(t.arcs);break;case"MultiPolygon":c(t.arcs)}}return l(e),o.forEach(null==n?function(t){i.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,n);else for(i=0,r=new Array(o=t.arcs.length);i<o;++i)r[i]=i;return{type:"MultiLineString",arcs:M(t,r)}}const N=Math.sqrt(50),T=Math.sqrt(10),z=Math.sqrt(2);function R(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=N?10:o>=T?5:o>=z?2:1;let s,u,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),u=Math.round(e*c),s/c<t&&++s,u/c>e&&--u,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),u=Math.round(e/c),s*c<t&&++s,u*c>e&&--u),u<s&&.5<=n&&n<2?R(t,e,2*n):[s,u,c]}function P(t,e,n){if(!((n=+n)>0))return[];if((t=+t)===(e=+e))return[t];const r=e<t,[i,o,a]=r?R(e,t,n):R(t,e,n);if(!(o>=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let c=0;c<s;++c)u[c]=(o-c)/-a;else for(let c=0;c<s;++c)u[c]=(o-c)*a;else if(a<0)for(let c=0;c<s;++c)u[c]=(i+c)/-a;else for(let c=0;c<s;++c)u[c]=(i+c)*a;return u}function L(t,e,n){return R(t=+t,e=+e,n=+n)[2]}function j(t,e,n){n=+n;const r=(e=+e)<(t=+t),i=r?L(e,t,n):L(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}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,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function X(t){return(t=H(Math.abs(t)))?t[1]:NaN}function G(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(X(e)/3)))-X(Math.abs(t)))}function J(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 r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.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 r=n[0],i=n[1],o=i-(U=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.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 rt(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?K:(e=et.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=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)),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"\u2212":t.minus+"",l=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?i:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===d?o:/[%p]/.test(y)?u:"",A=Y[y],_=/[defgprs%]/.test(y);function w(t){var i,o,u,d=b,w=x;if("c"===y)w=A(t)+w,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:A(Math.abs(t),g),v&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0===+t&&"+"!==f&&(E=!1),d=(E?"("===f?f:c:"-"===f||"("===f?"":f)+d,w=("s"===y?nt[8+U/3]:"")+w+(E&&"("===f?")":""),_)for(i=-1,o=t.length;++i<o;)if(48>(u=t.charCodeAt(i))||u>57){w=(46===u?a+t.slice(i+1):t.slice(i))+w,t=t.slice(0,i);break}}m&&!h&&(t=r(t,1/0));var D=d.length+t.length+w.length,F=D<p?new Array(p-D+1).join(e):"";switch(m&&h&&(t=r(F+t,F.length?p-w.length:1/0),F=""),n){case"<":t=d+t+w+F;break;case"=":t=d+F+t+w;break;case"^":t=F.slice(0,D=F.length>>1)+d+t+w+F.slice(D);break;default:t=F+d+t+w}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)),w.toString=function(){return t+""},w}return{format:f,formatPrefix:function(t,e){var n=f(((t=q(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(X(e)/3))),i=Math.pow(10,-r),o=nt[8+r/3];return function(t){return n(i*t)+o}}}}!function(t){Z=rt(t),Q=Z.format,tt=Z.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const it=new Date,ot=new Date;function at(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=e=>(t(e=new Date(+e)),e),i.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),i.round=t=>{const e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r)||!(o>0))return a;let s;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(s<n&&n<r);return a},i.filter=n=>at((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})),n&&(i.count=(e,r)=>(it.setTime(+e),ot.setTime(+r),t(it),t(ot),Math.floor(n(it,ot))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?e=>r(e)%t===0:e=>i.count(0,e)%t===0):i:null)),i}const st=1e3,ut=6e4,ct=36e5,lt=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())*ut)/lt),(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)/lt),(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)/lt),(t=>Math.floor(t/lt))));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())*ut)/ft))}const yt=vt(0),bt=vt(1),xt=vt(2),At=vt(3),_t=vt(4),wt=vt(5),Et=vt(6);yt.range,bt.range,xt.range,At.range,_t.range,wt.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 Ft=Dt(0),Ct=Dt(1),kt=Dt(2),St=Dt(3),Mt=Dt(4),Bt=Dt(5),Ot=Dt(6),Nt=(Ft.range,Ct.range,kt.range,St.range,Mt.range,Bt.range,Ot.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())));Nt.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;Nt.range;const Tt=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()));Tt.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;Tt.range;const zt=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())),Rt=(zt.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()))),Pt=(Rt.range,at((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*st-t.getMinutes()*ut)}),((t,e)=>{t.setTime(+t+e*ct)}),((t,e)=>(e-t)/ct),(t=>t.getHours()))),Lt=(Pt.range,at((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*ct)}),((t,e)=>(e-t)/ct),(t=>t.getUTCHours()))),jt=(Lt.range,at((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*st)}),((t,e)=>{t.setTime(+t+e*ut)}),((t,e)=>(e-t)/ut),(t=>t.getMinutes()))),Ut=(jt.range,at((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*ut)}),((t,e)=>(e-t)/ut),(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,r;function i(t,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=Wt,n=(e,n)=>Wt(t(e),n),r=(e,n)=>t(e)-n):(e=t===Wt||t===Ht?t:Gt,n=t,r=t),{left:i,center:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const o=i(t,e,n,(arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length)-1);return o>n&&r(t[o-1],e)>-r(t[o],e)?o-1:o},right:function(t,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}function Gt(){return 0}const Jt="year",$t="quarter",Vt="month",Yt="week",Kt="date",Zt="day",Qt="dayofyear",te="hours",ee="minutes",ne="seconds",re="milliseconds",ie=[Jt,$t,Vt,Yt,Kt,Zt,Qt,te,ee,ne,re],oe=ie.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={[Jt]:"%Y ",[$t]:"Q%q ",[Vt]:"%b ",[Kt]:"%d ",[Yt]:"W%U ",[Zt]:"%a ",[Qt]:"%j ",[te]:"%H:00",[ee]:"00:%M",[ne]:":%S",[re]:".%L",["".concat(Jt,"-").concat(Vt)]:"%Y-%m ",["".concat(Jt,"-").concat(Vt,"-").concat(Kt)]:"%Y-%m-%d ",["".concat(te,"-").concat(ee)]:"%H:%M"};function ue(t,e){const n=(0,m.l7)({},se,e),r=ae(t),i=r.length;let o,a,s="",u=0;for(u=0;u<i;)for(o=r.length;o>u;--o)if(a=r.slice(u,o).join("-"),null!=n[a]){s+=n[a],u=o;break}return s.trim()}const ce=new Date;function le(t){return ce.setFullYear(t),ce.setMonth(0),ce.setDate(1),ce.setHours(0,0,0,0),ce}function fe(t){return he(new Date(t))}function de(t){return pe(new Date(t))}function he(t){return pt.count(le(t.getFullYear())-1,t)}function pe(t){return yt.count(le(t.getFullYear())-1,t)}function me(t){return le(t).getDay()}function ge(t,e,n,r,i,o,a){if(0<=t&&t<100){const s=new Date(-1,e,n,r,i,o,a);return s.setFullYear(t),s}return new Date(t,e,n,r,i,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 Ft.count(e-1,t)}function Ae(t){return ce.setTime(Date.UTC(t,0,1)),ce.getUTCDay()}function _e(t,e,n,r,i,o,a){if(0<=t&&t<100){const t=new Date(Date.UTC(-1,e,n,r,i,o,a));return t.setUTCFullYear(n.y),t}return new Date(Date.UTC(t,e,n,r,i,o,a))}function we(t,e,n,r,i){const o=e||1,a=(0,m.fj)(t),s=(t,e,i)=>function(t,e,n,r){const i=n<=1?t:r?(e,i)=>r+n*Math.floor((t(e,i)-r)/n):(e,r)=>n*Math.floor(t(e,r)/n);return e?(t,n)=>e(i(t,n),n):i}(n[i=i||t],r[i],t===a&&o,e),u=new Date,c=(0,m.Rg)(t),l=c[Jt]?s(Jt):(0,m.a9)(2012),f=c[Vt]?s(Vt):c[$t]?s($t):m.bM,d=c[Yt]&&c[Zt]?s(Zt,1,Yt+Zt):c[Yt]?s(Yt,1):c[Zt]?s(Zt,1):c[Kt]?s(Kt,1):c[Qt]?s(Qt,1):m.kX,h=c[te]?s(te):m.bM,p=c[ee]?s(ee):m.bM,g=c[ne]?s(ne):m.bM,v=c[re]?s(re):m.bM;return function(t){u.setTime(+t);const e=l(u);return i(e,f(u),d(u,e),h(u),p(u),g(u),v(u))}}function Ee(t,e,n){return e+7*t-(n+6)%7}const De={[Jt]: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(),[re]: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))},Fe={[$t]:t=>3*t,[Yt]:(t,e)=>Ee(t,0,me(e))};function Ce(t,e){return we(t,e||1,De,Fe,ge)}const ke={[Jt]: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(),[re]:t=>t.getUTCMilliseconds(),[Qt]:t=>be(t),[Yt]:t=>xe(t),[Zt]:(t,e)=>Ee(1,t.getUTCDay(),Ae(e)),[Yt+Zt]:(t,e)=>Ee(xe(t),t.getUTCDay(),Ae(e))},Se={[$t]:t=>3*t,[Yt]:(t,e)=>Ee(t,0,Ae(e))};function Me(t,e){return we(t,e||1,ke,Se,_e)}const Be={[Jt]:Nt,[$t]:zt.every(3),[Vt]:zt,[Yt]:yt,[Kt]:pt,[Zt]:pt,[Qt]:pt,[te]:Pt,[ee]:jt,[ne]:It,[re]:qt},Oe={[Jt]:Tt,[$t]:Rt.every(3),[Vt]:Rt,[Yt]:Ft,[Kt]:mt,[Zt]:mt,[Qt]:mt,[te]:Lt,[ee]:Ut,[ne]:It,[re]:qt};function Ne(t){return Be[t]}function Te(t){return Oe[t]}function ze(t,e,n){return t?t.offset(e,n):void 0}function Re(t,e,n){return ze(Ne(t),e,n)}function Pe(t,e,n){return ze(Te(t),e,n)}function Le(t,e,n,r){return t?t.range(e,n,r):void 0}function je(t,e,n,r){return Le(Ne(t),e,n,r)}function Ue(t,e,n,r){return Le(Te(t),e,n,r)}const Ie=1e3,qe=6e4,We=36e5,He=864e5,Xe=2592e6,Ge=31536e6,Je=[Jt,Vt,Kt,te,ee,ne,re],$e=Je.slice(0,-1),Ve=$e.slice(0,-1),Ye=Ve.slice(0,-1),Ke=Ye.slice(0,-1),Ze=[Jt,Vt],Qe=[Jt],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],[[Jt,Yt],1,6048e5],[Ze,1,Xe],[Ze,3,7776e6],[Qe,1,Ge]];function en(t){const e=t.extent,n=t.maxbins||40,r=Math.abs((0,m.yP)(e))/n;let i,o,a=Xt((t=>t[2])).right(tn,r);return a===tn.length?(i=Qe,o=j(e[0]/Ge,e[1]/Ge,n)):a?(a=tn[r/tn[a-1][2]<tn[a][2]/r?a-1:a],i=a[0],o=a[1]):(i=Je,o=Math.max(j(e[0],e[1],n),1)),{units:i,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,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,u=t.shortMonths,c=yn(i),l=bn(i),f=yn(o),d=bn(o),h=yn(a),p=bn(a),m=yn(s),g=bn(s),v=yn(u),y=bn(u),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Un,e:Un,f:Xn,g:nr,G:ir,H:In,I:qn,j:Wn,L:Hn,m:Gn,M:Jn,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Cr,s:kr,S:$n,u:Vn,U:Yn,V:Zn,w:Qn,W:tr,x:null,X:null,y:er,Y:rr,Z:or,"%":Fr},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:ar,e:ar,f:fr,g:_r,G:Er,H:sr,I:ur,j:cr,L:lr,m:dr,M:hr,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Cr,s:kr,S:pr,u:mr,U:gr,V:yr,w:br,W:xr,x:null,X:null,y:Ar,Y:wr,Z:Dr,"%":Fr},A={a:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=v.exec(e.slice(n));return r?(t.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return E(t,e,n,r)},d:Mn,e:Mn,f:Rn,g:Fn,G:Dn,H:On,I:On,j:Bn,L:zn,m:Sn,M:Nn,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=l.get(r[0].toLowerCase()),n+r[0].length):-1},q:kn,Q:Ln,s:jn,S:Tn,u:An,U:_n,V:wn,w:xn,W:En,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:Fn,Y:Dn,Z:Cn,"%":Pn};function _(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===t.charCodeAt(s)&&(a.push(t.slice(u,s)),null!=(i=dn[r=t.charAt(++s)])?r=t.charAt(++s):i="e"===r?" ":"0",(o=e[r])&&(r=o(n,i)),a.push(r),u=s+1);return a.push(t.slice(u,s)),a.join("")}}function w(t,e){return function(n){var r,i,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?(i=(r=rn(on(o.y,0,1))).getUTCDay(),r=i>4||0===i?Ct.ceil(r):Ct(r),r=mt.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=nn(on(o.y,0,1))).getDay(),r=i>4||0===i?bt.ceil(r):bt(r),r=pt.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.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),i="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-(i+5)%7:o.w+7*o.U-(i+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,r){for(var i,o,a=0,s=e.length,u=n.length;a<s;){if(r>=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=A[i in dn?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=_(n,b),b.X=_(r,b),b.c=_(e,b),x.x=_(n,x),x.X=_(r,x),x.c=_(e,x),{format:function(t){var e=_(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=w(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=_(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=w(t+="",!0);return e.toString=function(){return t},e}}}var sn,un,cn,ln,fn,dn={"-":"",_:" ",0:"0"},hn=/^\s*\d+/,pn=/^%/,mn=/[\\^$*+?|[\]().{}]/g;function gn(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}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 r=hn.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function An(t,e,n){var r=hn.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function _n(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function wn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function En(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Dn(t,e,n){var r=hn.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Fn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Cn(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function kn(t,e,n){var r=hn.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function Sn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Mn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Bn(t,e,n){var r=hn.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function On(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Nn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Tn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function zn(t,e,n){var r=hn.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Rn(t,e,n){var r=hn.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Pn(t,e,n){var r=pn.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Ln(t,e,n){var r=hn.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jn(t,e,n){var r=hn.exec(e.slice(n));return r?(t.s=+r[0],n+r[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(Nt(t),t),e,3)}function Hn(t,e){return gn(t.getMilliseconds(),e,3)}function Xn(t,e){return Hn(t,e)+"000"}function Gn(t,e){return gn(t.getMonth()+1,e,2)}function Jn(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(Nt(t)-1,t),e,2)}function Kn(t){var e=t.getDay();return e>=4||0===e?_t(t):_t.ceil(t)}function Zn(t,e){return t=Kn(t),gn(_t.count(Nt(t),t)+(4===Nt(t).getDay()),e,2)}function Qn(t){return t.getDay()}function tr(t,e){return gn(bt.count(Nt(t)-1,t),e,2)}function er(t,e){return gn(t.getFullYear()%100,e,2)}function nr(t,e){return gn((t=Kn(t)).getFullYear()%100,e,2)}function rr(t,e){return gn(t.getFullYear()%1e4,e,4)}function ir(t,e){var n=t.getDay();return gn((t=n>=4||0===n?_t(t):_t.ceil(t)).getFullYear()%1e4,e,4)}function or(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+gn(e/60|0,"0",2)+gn(e%60,"0",2)}function ar(t,e){return gn(t.getUTCDate(),e,2)}function sr(t,e){return gn(t.getUTCHours(),e,2)}function ur(t,e){return gn(t.getUTCHours()%12||12,e,2)}function cr(t,e){return gn(1+mt.count(Tt(t),t),e,3)}function lr(t,e){return gn(t.getUTCMilliseconds(),e,3)}function fr(t,e){return lr(t,e)+"000"}function dr(t,e){return gn(t.getUTCMonth()+1,e,2)}function hr(t,e){return gn(t.getUTCMinutes(),e,2)}function pr(t,e){return gn(t.getUTCSeconds(),e,2)}function mr(t){var e=t.getUTCDay();return 0===e?7:e}function gr(t,e){return gn(Ft.count(Tt(t)-1,t),e,2)}function vr(t){var e=t.getUTCDay();return e>=4||0===e?Mt(t):Mt.ceil(t)}function yr(t,e){return t=vr(t),gn(Mt.count(Tt(t),t)+(4===Tt(t).getUTCDay()),e,2)}function br(t){return t.getUTCDay()}function xr(t,e){return gn(Ct.count(Tt(t)-1,t),e,2)}function Ar(t,e){return gn(t.getUTCFullYear()%100,e,2)}function _r(t,e){return gn((t=vr(t)).getUTCFullYear()%100,e,2)}function wr(t,e){return gn(t.getUTCFullYear()%1e4,e,4)}function Er(t,e){var n=t.getUTCDay();return gn((t=n>=4||0===n?Mt(t):Mt.ceil(t)).getUTCFullYear()%1e4,e,4)}function Dr(){return"+0000"}function Fr(){return"%"}function Cr(t){return+t}function kr(t){return Math.floor(+t/1e3)}function Sr(t){const e={};return n=>e[n]||(e[n]=t(n))}function Mr(t){const e=Sr(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 r=e(n),i=e(".1f")(1)[1],t=>{const e=r(t),n=e.indexOf(i);if(n<0)return e;let o=function(t,e){let n,r=t.lastIndexOf("e");if(r>0)return r;for(r=t.length;--r>e;)if(n=t.charCodeAt(r),n>=48&&n<=57)return r+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 r,i},formatSpan(t,r,i,o){o=q(null==o?",f":o);const a=j(t,r,i),s=Math.max(Math.abs(t),Math.abs(r));let u;if(null==o.precision)switch(o.type){case"s":return isNaN(u=G(a,s))||(o.precision=u),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(u=J(a,s))||(o.precision=u-("e"===o.type));break;case"f":case"%":isNaN(u=$(a))||(o.precision=u-2*("%"===o.type))}return e(o)}}}let Br,Or;function Nr(){return Br=Mr({format:Q,formatPrefix:tt})}function Tr(t){return Mr(rt(t))}function zr(t){return arguments.length?Br=Tr(t):Br}function Rr(t,e,n){n=n||{},(0,m.Kn)(n)||(0,m.vU)("Invalid time multi-format specifier: ".concat(n));const r=e(ne),i=e(ee),o=e(te),a=e(Kt),s=e(Yt),u=e(Vt),c=e($t),l=e(Jt),f=t(n[re]||".%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[Jt]||"%Y");return t=>(r(t)<t?f:i(t)<t?d:o(t)<t?h:a(t)<t?p:u(t)<t?s(t)<t?g:v:l(t)<t?c(t)<t?y:b:x)(t)}function Pr(t){const e=Sr(t.format),n=Sr(t.utcFormat);return{timeFormat:t=>(0,m.HD)(t)?e(t):Rr(e,Ne,t),utcFormat:t=>(0,m.HD)(t)?n(t):Rr(n,Te,t),timeParse:Sr(t.parse),utcParse:Sr(t.utcParse)}}function Lr(){return Or=Pr({format:un,parse:cn,utcFormat:ln,utcParse:fn})}function jr(t){return Pr(an(t))}function Ur(t){return arguments.length?Or=jr(t):Or}!function(t){sn=an(t),un=sn.format,cn=sn.parse,ln=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"]}),Nr(),Lr();const Ir=(t,e)=>(0,m.l7)({},t,e);function qr(t,e){const n=t?Tr(t):zr(),r=e?jr(e):Ur();return Ir(n,r)}function Wr(t,e){const n=arguments.length;return n&&2!==n&&(0,m.vU)("defaultLocale expects either zero or two arguments."),n?Ir(zr(t),Ur(e)):Ir(zr(),Ur())}function Hr(){return Nr(),Lr(),Wr()}const Xr=/^(data:|([A-Za-z]+:)?\/\/)/,Gr=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Jr=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,$r="file://";async function Vr(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function Yr(t,e){e=(0,m.l7)({},this.options,e);const n=this.fileAccess,r={href:null};let i,o,a;const s=Gr.test(t.replace(Jr,""));null!=t&&"string"===typeof t&&s||(0,m.vU)("Sanitize failure, invalid URI: "+(0,m.m8)(t));const u=Xr.test(t);return(a=e.baseURL)&&!u&&(t.startsWith("/")||a.endsWith("/")||(t="/"+t),t=a+t),o=(i=t.startsWith($r))||"file"===e.mode||"http"!==e.mode&&!u&&n,i?t=t.slice($r.length):t.startsWith("//")&&("file"===e.defaultProtocol?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(r,"localFile",{value:!!o}),r.href=t,e.target&&(r.target=e.target+""),e.rel&&(r.rel=e.rel+""),"image"===e.context&&e.crossOrigin&&(r.crossOrigin=e.crossOrigin+""),r}function Kr(t){return t?e=>new Promise(((n,r)=>{t.readFile(e,((t,e)=>{t?r(t):n(e)}))})):Zr}async function Zr(){(0,m.vU)("No file system access.")}function Qr(t){return t?async function(e,n){const r=(0,m.l7)({},this.options.http,n),i=n&&n.response,o=await t(e,r);return o.ok?(0,m.mf)(o[i])?o[i]():o.text():(0,m.vU)(o.status+""+o.statusText)}:ti}async function ti(){(0,m.vU)("No HTTP fetch method available.")}const ei=t=>null!=t&&t===t,ni=t=>!Number.isNaN(+t)&&!(t instanceof Date),ri={boolean:m.sw,integer:m.He,number:m.He,date:m.ZU,string:m.BB,unknown:m.yR},ii=[t=>"true"===t||"false"===t||!0===t||!1===t,t=>ni(t)&&Number.isInteger(+t),ni,t=>!Number.isNaN(Date.parse(t))],oi=["boolean","integer","number","date"];function ai(t,e){if(!t||!t.length)return"unknown";const n=t.length,r=ii.length,i=ii.map(((t,e)=>e+1));for(let o,a,s=0,u=0;s<n;++s)for(a=e?t[s][e]:t[s],o=0;o<r;++o)if(i[o]&&ei(a)&&!ii[o](a)&&(i[o]=0,++u,u===ii.length))return"string";return oi[i.reduce(((t,e)=>0===t?e:t),0)-1]}function si(t,e){return e.reduce(((e,n)=>(e[n]=ai(t,n),e)),{})}function ui(t){const e=function(e,n){const r={delimiter:t};return ci(e,n?(0,m.l7)(n,r):r)};return e.responseType="text",e}function ci(t,e){return e.header&&(t=e.header.map(m.m8).join(e.delimiter)+"\n"+t),D(e.delimiter).parse(t+"")}function li(t,e){const n=e&&e.property?(0,m.EP)(e.property):m.yR;return!(0,m.Kn)(t)||(r=t,"function"===typeof Buffer&&(0,m.mf)(Buffer.isBuffer)&&Buffer.isBuffer(r))?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 r}ci.responseType="text",li.responseType="json";const fi={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function di(t,e){let n,r,i,o;return t=li(t,e),e&&e.feature?(n=C,i=e.feature):e&&e.mesh?(n=B,i=e.mesh,o=fi[e.filter]):(0,m.vU)("Missing TopoJSON feature or mesh parameter."),r=(r=t.objects[i])?n(t,r,o):(0,m.vU)("Invalid TopoJSON object: "+i),r&&r.features||[r]}di.responseType="json";const hi={dsv:ci,csv:ui(","),tsv:ui("\t"),json:li,topojson:di};function pi(t,e){return arguments.length>1?(hi[t]=e,this):(0,m.nr)(hi,t)?hi[t]:null}function mi(t){const e=pi(t);return e&&e.responseType||"text"}function gi(t,e,n,r){const i=pi((e=e||{}).type||"json");return i||(0,m.vU)("Unknown data format type: "+e.type),t=i(t,e),e.parse&&function(t,e,n,r){if(!t.length)return;const i=Ur();n=n||i.timeParse,r=r||i.utcParse;let o,a,s,u,c,l,f=t.columns||Object.keys(t[0]);"auto"===e&&(e=si(t,f));f=Object.keys(e);const d=f.map((t=>{const i=e[t];let o,a;if(i&&(i.startsWith("date:")||i.startsWith("utc:"))){o=i.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]?r:n)(a)}if(!ri[i])throw Error("Illegal format pattern: "+t+":"+i);return ri[i]}));for(s=0,c=t.length,l=f.length;s<c;++s)for(o=t[s],u=0;u<l;++u)a=f[u],o[a]=d[u](o[a])}(t,e.parse,n,r),(0,m.nr)(t,"columns")&&delete t.columns,t}const vi=function(t,e){return n=>({options:n||{},sanitize:Yr,load:Vr,fileAccess:!!e,file:Kr(e),http:Qr(t)})}("undefined"!==typeof fetch&&fetch,null);function yi(t){const e=t||m.yR,n=[],r={};return n.add=t=>{const i=e(t);return r[i]||(r[i]=1,n.push(t)),n},n.remove=t=>{const i=e(t);if(r[i]){r[i]=0;const e=n.indexOf(t);e>=0&&n.splice(e,1)}return n},n}async function bi(t,e){try{await e(t)}catch(n){t.error(n)}}const xi=Symbol("vega_id");let Ai=1;function _i(t){return!(!t||!wi(t))}function wi(t){return t[xi]}function Ei(t,e){return t[xi]=e,t}function Di(t){const e=t===Object(t)?t:{data:t};return wi(e)?e:Ei(e,Ai++)}function Fi(t){return Ci(t,Di({}))}function Ci(t,e){for(const n in t)e[n]=t[n];return e}function ki(t,e){return Ei(e,wi(t))}function Si(t,e){return t?e?(n,r)=>t(n,r)||wi(e(n))-wi(e(r)):(e,n)=>t(e,n)||wi(e)-wi(n):null}function Mi(t){return t&&t.constructor===Bi}function Bi(){const t=[],e=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:Bi,insert(e){const n=(0,m.IX)(e),r=n.length;for(let i=0;i<r;++i)t.push(n[i]);return this},remove(t){const n=(0,m.mf)(t)?r:e,i=(0,m.IX)(t),o=i.length;for(let e=0;e<o;++e)n.push(i[e]);return this},modify(t,e,r){const o={field:e,value:(0,m.a9)(r)};return(0,m.mf)(t)?(o.filter=t,i.push(o)):(o.tuple=t,n.push(o)),this},encode(t,e){return(0,m.mf)(t)?i.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,u){const c={},l={};let f,d,h,p,m,g;for(f=0,d=u.length;f<d;++f)c[wi(u[f])]=1;for(f=0,d=e.length;f<d;++f)m=e[f],c[wi(m)]=-1;for(f=0,d=r.length;f<d;++f)p=r[f],u.forEach((t=>{p(t)&&(c[wi(t)]=-1)}));for(f=0,d=t.length;f<d;++f)m=t[f],g=wi(m),c[g]?c[g]=1:s.add.push(Di(t[f]));for(f=0,d=u.length;f<d;++f)m=u[f],c[wi(m)]<0&&s.rem.push(m);function v(t,e,n){n?t[e]=n(t):s.encode=e,a||(l[wi(t)]=t)}for(f=0,d=n.length;f<d;++f)h=n[f],m=h.tuple,p=h.field,g=c[wi(m)],g>0&&(v(m,p,h.value),s.modifies(p));for(f=0,d=i.length;f<d;++f)h=i[f],p=h.filter,u.forEach((t=>{p(t)&&c[wi(t)]>0&&v(t,h.field,h.value)})),s.modifies(h.field);if(a)s.mod=e.length||r.length?u.filter((t=>c[wi(t)]>0)):u.slice();else for(g in l)s.mod.push(l[g]);return(o||null==o&&(e.length||r.length))&&s.clean(!0),s}}}const Oi="_:mod:_";function Ni(){Object.defineProperty(this,Oi,{writable:!0,value:{}})}Ni.prototype={set(t,e,n,r){const i=this,o=i[t],a=i[Oi];return null!=e&&e>=0?(o[e]!==n||r)&&(o[e]=n,a[e+":"+t]=-1,a[t]=-1):(o!==n||r)&&(i[t]=n,a[t]=(0,m.kJ)(n)?1+n.length:-1),i},modified(t,e){const n=this[Oi];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[Oi]={},this}};let Ti=0;const zi=new Ni;function Ri(t,e,n,r){this.id=++Ti,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,r)}function Pi(t){return function(e){const n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}Ri.prototype={targets(){return this._targets||(this._targets=yi(m.id))},set(t){return this.value!==t?(this.value=t,1):0},skip:Pi(1),modified:Pi(2),parameters(t,e,n){e=!1!==e;const r=this._argval=this._argval||new Ni,i=this._argops=this._argops||[],o=[];let a,s,u,c;const l=(t,n,a)=>{a instanceof Ri?(a!==this&&(e&&a.targets().add(this),o.push(a)),i.push({op:a,name:t,index:n})):r.set(t,n,a)};for(a in t)if(s=t[a],"pulse"===a)(0,m.IX)(s).forEach((t=>{t instanceof Ri?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(r.set(a,-1,Array(u=s.length)),c=0;c<u;++c)l(a,c,s[c]);else l(a,-1,s);return this.marshall().clear(),n&&(i.initonly=!0),o},marshall(t){const e=this._argval||zi,n=this._argops;let r,i,o,a;if(n){const s=n.length;for(i=0;i<s;++i)r=n[i],o=r.op,a=o.modified()&&o.stamp===t,e.set(r.name,r.index,o.value,a);if(n.initonly){for(i=0;i<s;++i)r=n[i],r.op.targets().remove(this);this._argops=null,this._update=null}}return e},detach(){const t=this._argops;let e,n,r,i;if(t)for(e=0,n=t.length;e<n;++e)r=t[e],i=r.op,i._targets&&i._targets.remove(this);this.pulse=null,this.source=null},evaluate(t){const e=this._update;if(e){const n=this.marshall(t.stamp),r=e.call(this,n,t);if(n.clear(),r!==this.value)this.value=r;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 Li=0;function ji(t,e,n){this.id=++Li,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function Ui(t,e,n){return new ji(t,e,n)}ji.prototype={_filter:m.yb,_apply:m.yR,targets(){return this._targets||(this._targets=yi(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,r=n?n.length:0;for(let t=0;t<r;++t)n[t].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},filter(t){const e=Ui(t);return this.targets().add(e),e},apply(t){const e=Ui(null,t);return this.targets().add(e),e},merge(){const t=Ui();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=Ui();return this.targets().add(Ui(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(Ui(null,null,(()=>n=!0))),e.targets().add(Ui(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=m.yb,this._targets=null}};const Ii={skip:!0};function qi(t,e,n,r,i,o){const a=(0,m.l7)({},o,Ii);let s,u;(0,m.mf)(n)||(n=(0,m.a9)(n)),void 0===r?s=e=>t.touch(n(e)):(0,m.mf)(r)?(u=new Ri(null,r,i,!1),s=e=>{u.evaluate(e);const r=n(e),i=u.value;Mi(i)?t.pulse(r,i,o):t.update(r,i,a)}):s=e=>t.update(n(e),r,a),e.apply(s)}function Wi(t,e,n,r,i,o){if(void 0===r)e.targets().add(n);else{const a=o||{},s=new Ri(null,function(t,e){return e=(0,m.mf)(e)?e:(0,m.a9)(e),t?function(n,r){const i=e(n,r);return t.skip()||(t.skip(i!==this.value).value=i),i}:e}(n,r),i,!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 Hi={};function Xi(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 Gi(t,e){const n=[];return(0,m.FP)(t,e,(t=>n.push(t))),n}function Ji(t,e){const n={};return t.visit(e,(t=>{n[wi(t)]=1})),t=>n[wi(t)]?null:t}function $i(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}function Vi(t,e,n,r){const i=this;let o=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n;for(const a of n)if(a.stamp===e){if(a.fields){const t=i.fields||(i.fields={});for(const e in a.fields)t[e]=1}a.changed(i.ADD)&&(o|=i.ADD),a.changed(i.REM)&&(o|=i.REM),a.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}function Yi(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}Xi.prototype={StopPropagation:Hi,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 Xi(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 Xi(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,Ji(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=$i(n.addF,e)),2&t&&(n.remF=$i(n.remF,e)),4&t&&(n.modF=$i(n.modF,e)),16&t&&(n.srcF=$i(n.srcF,e)),n},materialize(t){const e=this;return 1&(t=t||7)&&e.addF&&(e.add=Gi(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=Gi(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=Gi(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,r=e;if(16&t)return(0,m.FP)(n.source,n.srcF,r),n;1&t&&(0,m.FP)(n.add,n.addF,r),2&t&&(0,m.FP)(n.rem,n.remF,r),4&t&&(0,m.FP)(n.mod,n.modF,r);const i=n.source;if(8&t&&i){const t=n.add.length+n.mod.length;t===i.length||(t?(0,m.FP)(i,Ji(n,5),r):(0,m.FP)(i,n.srcF,r))}return n}},(0,m.XW)(Vi,Xi,{fork(t){const e=new Xi(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,r=n.pulses,i=r.length;let o=0;if(t&n.SOURCE)for(;o<i;++o)r[o].visit(t,e);else for(;o<i;++o)r[o].stamp===n.stamp&&r[o].visit(t,e);return n}});const Ki={skip:!1,force:!1};function Zi(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),Qi(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let r;return e.length?(r=e[0],e[0]=n,function(t,e,n){const r=e,i=t.length,o=t[e];let a,s=1+(e<<1);for(;s<i;)a=s+1,a<i&&n(t[s],t[a])>=0&&(s=a),t[e]=t[s],s=1+((e=s)<<1);t[e]=o,Qi(t,r,e,n)}(e,0,t)):r=n,r}}}function Qi(t,e,n,r){let i,o;const a=t[n];for(;n>e&&(o=n-1>>1,i=t[o],r(a,i)<0);)t[n]=i,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=Wr();try{this._loader=vi()}catch(t){}this._touched=yi(m.id),this._input={},this._pulse=null,this._heap=Zi(((t,e)=>t.qrank-e.qrank)),this._postrun=[]}function eo(t){return function(){return this._log[t].apply(this,arguments)}}function no(t,e){Ri.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,r){let i,o=1;return t instanceof Ri?i=t:t&&t.prototype instanceof Ri?i=new t:(0,m.mf)(t)?i=new Ri(null,t):(o=0,i=new Ri(t,e)),this.rank(i),o&&(r=n,n=e),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},connect:function(t,e){const n=t.rank,r=e.length;for(let i=0;i<r;++i)if(n<e[i].rank)return void this.rerank(t)},rank:function(t){t.rank=++this._rank},rerank:function(t){const e=[t];let n,r,i;for(;e.length;)if(this.rank(n=e.pop()),r=n._targets)for(i=r.length;--i>=0;)e.push(n=r[i]),n===t&&(0,m.vU)("Cycle detected in dataflow graph.")},pulse:function(t,e,n){this.touch(t,n||Ki);const r=new Xi(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,i),this},touch:function(t,e){const n=e||Ki;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},update:function(t,e,n){const r=n||Ki;return(t.set(e)||r.force)&&this.touch(t,r),this},changeset:Bi,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 gi(t,e,n.timeParse,n.utcParse)},preload:async function(t,e,n){const r=this,i=r._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}(r);i.requests+=1;const o=await r.request(e,n);return r.pulse(t,r.changeset().remove(m.yb).insert(o.data||[])),i.done(),o},request:async function(t,e){const n=this;let r,i=0;try{r=await n.loader().load(t,{context:"dataflow",response:mi(e&&e.type)});try{r=n.parse(r,e)}catch(o){i=-2,n.warn("Data ingestion failed",t,o)}}catch(o){i=-1,n.warn("Loading failed",t,o)}return{data:r,status:i}},events:function(t,e,n,r){const i=this,o=Ui(n,r),a=function(t){t.dataflow=i;try{o.receive(t)}catch(e){i.error(e)}finally{i.run()}};let s;s="string"===typeof t&&"undefined"!==typeof document?document.querySelectorAll(t):(0,m.IX)(t);const u=s.length;for(let c=0;c<u;++c)s[c].addEventListener(e,a);return o},on:function(t,e,n,r,i){return(t instanceof Ri?Wi:qi)(this,t,e,n,r,i),this},evaluate:async function(t,e,n){const r=this,i=[];if(r._pulse)return Yi(r);if(r._pending&&await r._pending,e&&await bi(r,e),!r._touched.length)return r.debug("Dataflow invoked, but nothing to do."),r;const o=++r._clock;r._pulse=new Xi(r,o,t),r._touched.forEach((t=>r._enqueue(t,!0))),r._touched=yi(m.id);let a,s,u,c=0;try{for(;r._heap.size()>0;)a=r._heap.pop(),a.rank===a.qrank?(s=a.run(r._getPulse(a,t)),s.then?s=await s:s.async&&(i.push(s.async),s=Hi),s!==Hi&&a._targets&&a._targets.forEach((t=>r._enqueue(t))),++c):r._enqueue(a,!0)}catch(l){r._heap.clear(),u=l}if(r._input={},r._pulse=null,r.debug("Pulse ".concat(o,": ").concat(c," operators")),u&&(r._postrun=[],r.error(u)),r._postrun.length){const t=r._postrun.sort(((t,e)=>e.priority-t.priority));r._postrun=[];for(let e=0;e<t.length;++e)await bi(r,t[e].callback)}return n&&await bi(r,n),i.length&&Promise.all(i).then((t=>r.runAsync(null,(()=>{t.forEach((t=>{try{t(r)}catch(l){r.error(l)}}))})))),r},run:function(t,e,n){return this._pulse?Yi(this):(this.evaluate(t,e,n),this)},runAsync:async function(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running},runAfter:function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(r){this.error(r)}},_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,r=this._clock;return n&&(0,m.kJ)(n)?new Vi(this,r,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!==Hi&&(t.source=e.source);return t}(this._pulse,n&&n.pulse)}},(0,m.XW)(no,Ri,{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 ro={};function io(t){const e=oo(t);return e&&e.Definition||null}function oo(t){return t=t&&t.toLowerCase(),(0,m.nr)(ro,t)?ro[t]:null}function ao(t,e){let n;if(void 0===e)for(const r of t)null!=r&&(n<r||void 0===n&&r>=r)&&(n=r);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function so(t,e){let n;if(void 0===e)for(const r of t)null!=r&&(n>r||void 0===n&&r>=r)&&(n=r);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function uo(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Wt;if(t===Wt)return co;if("function"!==typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function co(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}function lo(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,i=arguments.length>4?arguments[4]:void 0;if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?co:uo(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);lo(t,e,Math.max(n,Math.floor(e-a*u/o+c)),Math.min(r,Math.floor(e+(o-a)*u/o+c)),i)}const o=t[e];let a=n,s=r;for(fo(t,n,e),i(t[r],o)>0&&fo(t,n,r);a<s;){for(fo(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?fo(t,n,s):(++s,fo(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function fo(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}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 r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return so(t);if(e>=1)return ao(t);var r,i=(r-1)*e,o=Math.floor(i),a=ao(lo(t,o).subarray(0,o+1));return a+(so(t.subarray(o+1))-a)*(i-o)}}function mo(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ho;if((r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function go(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let a of t)null!=a&&(a=+a)>=a&&(n=a-i,i+=n/++r,o+=n*(a-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}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 r of t)r=e(r,++n,t),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function yo(t,e,n){const r=Float64Array.from(vo(t,n));return r.sort(Wt),e.map((t=>mo(r,t)))}function bo(t,e){return yo(t,[.25,.5,.75],e)}function xo(t,e){const n=t.length,r=go(t,e),i=bo(t,e),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}var Ao=Math.random;function _o(t,e,n,r){r=r||(t=>t);const i=t.length,o=new Float64Array(i);let a,s=0,u=1,c=r(t[0]),l=c,f=c+e;for(;u<i;++u){if(a=r(t[u]),a>=f){for(l=(c+l)/2;s<u;++s)o[s]=l;f=a+e,c=a}l=a}for(l=(c+l)/2;s<u;++s)o[s]=l;return n?function(t,e){const n=t.length;let r,i,o=0,a=1;for(;t[o]===t[a];)++a;for(;a<n;){for(r=a+1;t[a]===t[r];)++r;if(t[a]-t[a-1]<e){for(i=a+(o+r-a-a>>1);i<a;)t[i++]=t[a];for(;i>a;)t[i--]=t[o]}o=a,a=r}return t}(o,e+e/4):o}const wo=Math.sqrt(2*Math.PI),Eo=Math.SQRT2;let Do=NaN;function Fo(t,e){t=t||0,e=null==e?1:e;let n,r,i=0,o=0;if(Do===Do)i=Do,Do=NaN;else{do{i=2*Ao()-1,o=2*Ao()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,Do=o*r}return t+i*e}function Co(t,e,n){const r=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*wo)}function ko(t,e,n){const r=(t-(e=e||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const t=Math.exp(-i*i/2);let e;i<7.07106781186547?(e=.0352624965998911*i+.700383064443688,e=e*i+6.37396220353165,e=e*i+33.912866078383,e=e*i+112.079291497871,e=e*i+221.213596169931,e=e*i+220.206867912376,o=t*e,e=.0883883476483184*i+1.75566716318264,e=e*i+16.064177579207,e=e*i+86.7807322029461,e=e*i+296.564248779674,e=e*i+637.333633378831,e=e*i+793.826512519948,e=e*i+440.413735824752,o/=e):(e=i+.65,e=i+4/e,e=i+3/e,e=i+2/e,e=i+1/e,o=t/e/2.506628274631)}return r>0?1-o:o}function So(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*Eo*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 Mo(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Fo(n,r),pdf:t=>Co(t,n,r),cdf:t=>ko(t,n,r),icdf:t=>So(t,n,r)};return i.mean(t).stdev(e)}function Bo(t,e){const n=Mo();let r=0;const i={data(n){return arguments.length?(t=n,r=n?n.length:0,i.bandwidth(e)):t},bandwidth(n){return arguments.length?(!(e=n)&&t&&(e=xo(t)),i):e},sample:()=>t[~~(Ao()*r)]+e*n.sample(),pdf(i){let o=0,a=0;for(;a<r;++a)o+=n.pdf((i-t[a])/e);return o/e/r},cdf(i){let o=0,a=0;for(;a<r;++a)o+=n.cdf((i-t[a])/e);return o/r},icdf(){throw Error("KDE icdf not supported.")}};return i.data(t)}function Oo(t,e){return t=t||0,e=null==e?1:e,Math.exp(t+Fo()*e)}function No(t,e,n){if(t<=0)return 0;e=e||0,n=null==n?1:n;const r=(Math.log(t)-e)/n;return Math.exp(-.5*r*r)/(n*wo*t)}function To(t,e,n){return ko(Math.log(t),e,n)}function zo(t,e,n){return Math.exp(So(t,e,n))}function Ro(t,e){return null==e&&(e=null==t?1:t,t=0),t+(e-t)*Ao()}function Po(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=e&&t<=n?1/(n-e):0}function Lo(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}const Uo=.5*Math.PI/180;function Io(t,e,n,r){n=n||25,r=Math.max(n,r||200);const i=e=>[e,t(e)],o=e[0],a=e[1],s=a-o,u=s/r,c=[i(o)],l=[];if(n===r){for(let t=1;t<r;++t)c.push(i(o+t/n*s));return c.push(i(a)),c}l.push(i(a));for(let m=n;--m>0;)l.push(i(o+m/n*s));let f=c[0],d=l[l.length-1];const h=1/s,p=function(t,e){let n=t,r=t;const i=e.length;for(let o=0;o<i;++o){const t=e[o][1];t<n&&(n=t),t>r&&(r=t)}return 1/(r-n)}(f[1],l);for(;d;){const t=i((f[0]+d[0])/2);t[0]-f[0]>=u&&qo(f,t,d,h,p)>Uo?l.push(t):(f=d,c.push(d),l.pop()),d=l[l.length-1]}return c}function qo(t,e,n,r,i){const o=Math.atan2(i*(n[1]-t[1]),r*(n[0]-t[0])),a=Math.atan2(i*(e[1]-t[1]),r*(e[0]-t[0]));return Math.abs(o-a)}function Wo(t,e){return po(t,.5,e)}function Ho(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}function Xo(t){return t&&t.length?1===t.length?t[0]:(e=t,t=>{const n=e.length;let r=1,i=String(e[0](t));for(;r<n;++r)i+="|"+e[r](t);return i}):function(){return""};var e}function Go(t,e,n){return n||t+(e?"_"+e:"")}const Jo=()=>{},$o={init:Jo,add:Jo,rem:Jo,idx:0},Vo={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}},Yo=Object.keys(Vo).filter((t=>"__count__"!==t));function Ko(t,e){return Vo[t](e)}function Zo(t,e){return t.idx-e.idx}function Qo(){this.valid=0,this.missing=0,this._ops.forEach((t=>t.init(this)))}function ta(t,e){null!=t&&""!==t?t===t&&(++this.valid,this._ops.forEach((n=>n.add(this,t,e)))):++this.missing}function ea(t,e){null!=t&&""!==t?t===t&&(--this.valid,this._ops.forEach((n=>n.rem(this,t,e)))):--this.missing}function na(t){return this._out.forEach((e=>t[e.out]=e.value(this))),t}function ra(t,e){const n=e||m.yR,r=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]=Vo[t]())}))};return t.forEach(n),Object.values(e).sort(Zo)}(t),i=t.slice().sort(Zo);function o(t){this._ops=r,this._out=i,this.cell=t,this.init()}return o.prototype.init=Qo,o.prototype.add=ta,o.prototype.rem=ea,o.prototype.set=na,o.prototype.get=n,o.fields=t.map((t=>t.out)),o}function ia(t){this._key=t?(0,m.EP)(t):wi,this.reset()}[...Yo,"__count__"].forEach((t=>{Vo[t]=function(t,e){return n=>(0,m.l7)({name:t,out:n||t},$o,e)}(t,Vo[t])}));const oa=ia.prototype;function aa(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}oa.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},oa.add=function(t){this._add.push(t)},oa.rem=function(t){this._rem.push(t)},oa.values=function(){if(this._get=null,0===this._rem.length)return this._add;const t=this._add,e=this._rem,n=this._key,r=t.length,i=e.length,o=Array(r-i),a={};let s,u,c;for(s=0;s<i;++s)a[n(e[s])]=1;for(s=0,u=0;s<r;++s)a[n(c=t[s])]?a[n(c)]=0:o[u++]=c;return this._rem=[],this._add=o},oa.distinct=function(t){const e=this.values(),n={};let r,i=e.length,o=0;for(;--i>=0;)r=t(e[i])+"",(0,m.nr)(n,r)||(n[r]=1,++o);return o},oa.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},oa.argmin=function(t){return this.extent(t)[0]||{}},oa.argmax=function(t){return this.extent(t)[1]||{}},oa.min=function(t){const e=this.extent(t)[0];return null!=e?t(e):void 0},oa.max=function(t){const e=this.extent(t)[1];return null!=e?t(e):void 0},oa.quartile=function(t){return this._get===t&&this._q||(this._q=bo(this.values(),t),this._get=t),this._q},oa.q1=function(t){return this.quartile(t)[0]},oa.q2=function(t){return this.quartile(t)[1]},oa.q3=function(t){return this.quartile(t)[2]},oa.ci=function(t){return this._get===t&&this._ci||(this._ci=function(t,e,n,r){if(!t.length)return[void 0,void 0];const i=Float64Array.from(vo(t,r)),o=i.length,a=e;let s,u,c,l;for(c=0,l=Array(a);c<a;++c){for(s=0,u=0;u<o;++u)s+=i[~~(Ao()*o)];l[c]=s/o}return l.sort(Wt),[po(l,n/2),po(l,1-n/2)]}(this.values(),1e3,.05,t),this._get=t),this._ci},oa.ci0=function(t){return this.ci(t)[0]},oa.ci1=function(t){return this.ci(t)[1]},aa.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Yo},{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)(aa,no,{transform(t,e){const n=this,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.modified();return n.stamp=r.stamp,n.value&&(i||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?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)))),r.modifies(n._outputs),n._drop=!1!==t.drop,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),e.clean()&&n._drop&&r.clean(!0).runAfter((()=>this.clean())),n.changes(r)},cross(){const t=this,e=t.value,n=t._dnames,r=n.map((()=>({}))),i=n.length;function o(t){let e,o,a,s;for(e in t)for(a=t[e].tuple,o=0;o<i;++o)r[o][s=a[n[o]]]=s}o(t._prev),o(e),function o(a,s,u){const c=n[u],l=r[u++];for(const n in l){const r=a?a+"|"+n:n;s[c]=l[n],u<i?o(r,s,u):e[r]||t.cell(r,s)}}("",{},0)},init(t){const e=this._inputs=[],n=this._outputs=[],r={};function i(t){const n=(0,m.IX)((0,m.Oj)(t)),i=n.length;let o,a=0;for(;a<i;++a)r[o=n[a]]||(r[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 i(t),n.push(e),e})),this.cellkey=t.key?t.key:Xo(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=t.fields||[null],a=t.ops||["count"],s=t.as||[],u=o.length,c={};let l,f,d,h,p,g;for(u!==a.length&&(0,m.vU)("Unmatched number of fields and aggregate ops."),g=0;g<u;++g)l=o[g],f=a[g],null==l&&"count"!==f&&(0,m.vU)("Null aggregate field specified."),h=(0,m.el)(l),p=Go(f,h,s[g]),n.push(p),"count"!==f?(d=c[h],d||(i(l),d=c[h]=[],d.field=l,this._measures.push(d)),"count"!==f&&(this._countOnly=!1),d.push(Ko(f,p))):this._counts.push(p);return this._measures=this._measures.map((t=>ra(t,t.field))),Object.create(null)},cellkey:Xo(),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 r=0;r<e;++r)n.agg[r]=new t[r](n)}return n.store&&(n.data=new ia),n},newtuple(t,e){const n=this._dnames,r=this._dims,i=r.length,o={};for(let a=0;a<i;++a)o[n[a]]=r[a](t);return e?ki(e.tuple,o):Di(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 r=n.agg;for(let i=0,o=r.length;i<o;++i)r[i].add(r[i].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 r=n.agg;for(let i=0,o=r.length;i<o;++i)r[i].rem(r[i].get(t),t)},celltuple(t){const e=t.tuple,n=this._counts;t.store&&t.data.values();for(let r=0,i=n.length;r<i;++r)e[n[r]]=t.num;if(!this._countOnly){const n=t.agg;for(let t=0,r=n.length;t<r;++t)n[t].set(e)}return e},changes(t){const e=this._adds,n=this._mods,r=this._prev,i=this._drop,o=t.add,a=t.rem,s=t.mod;let u,c,l,f;if(r)for(c in r)u=r[c],i&&!u.num||a.push(u.tuple);for(l=0,f=this._alen;l<f;++l)o.push(this.celltuple(e[l])),e[l]=null;for(l=0,f=this._mlen;l<f;++l)u=n[l],(0===u.num&&i?a:s).push(this.celltuple(u)),n[l]=null;return this._alen=this._mlen=0,this._prev=null,t}});function sa(t){no.call(this,null,t)}function ua(t,e,n){const r=t;let i=e||[],o=n||[],a={},s=0;return{add:t=>o.push(t),remove:t=>a[r(t)]=++s,size:()=>i.length,data:(t,e)=>(s&&(i=i.filter((t=>!a[r(t)])),a={},s=0),e&&t&&i.sort(t),o.length&&(i=t?(0,m.TS)(t,i,o.sort(t)):i.concat(o),o=[]),i)}}function ca(t){no.call(this,[],t)}function la(t){Ri.call(this,null,fa,t)}function fa(t){return this.value&&!t.modified()?this.value:(0,m.qu)(t.fields,t.orders)}function da(t){no.call(this,null,t)}function ha(t){no.call(this,null,t)}sa.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)(sa,no,{transform(t,e){const n=!1!==t.interval,r=this._bins(t),i=r.start,o=r.step,a=t.as||["bin0","bin1"],s=a[0],u=a[1];let c;return c=t.modified()?(e=e.reflow(!0)).SOURCE:e.modified((0,m.Oj)(t.field))?e.ADD_MOD:e.ADD,e.visit(c,n?t=>{const e=r(t);t[s]=e,t[u]=null==e?null:i+o*(1+(e-i)/o)}:t=>t[s]=r(t)),e.modifies(n?a:s)},_bins(t){if(this.value&&!t.modified())return this.value;const e=t.field,n=function(t){const e=t.maxbins||20,n=t.base||10,r=Math.log(n),i=t.divide||[5,2];let o,a,s,u,c,l,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(u=h/e,c=0,l=t.steps.length;c<l&&t.steps[c]<u;++c);o=t.steps[Math.max(0,c-1)]}else{for(a=Math.ceil(Math.log(e)/r),s=t.minstep||0,o=Math.max(s,Math.pow(n,Math.round(Math.log(h)/r)-a));Math.ceil(h/o)>e;)o*=n;for(c=0,l=i.length;c<l;++c)u=o/i[c],u>=s&&h/u<=e&&(o=u)}u=Math.log(o);const p=u>=0?0:1+~~(-u/r),m=Math.pow(n,-p-1);return(t.nice||void 0===t.nice)&&(u=Math.floor(f/o+m)*o,f=f<u?u-o:u,d=Math.ceil(d/o)*o),{start:f,stop:d===f?f+o:d,step:o}}(t),r=n.step;let i,o,a=n.start,s=a+Math.ceil((n.stop-a)/r)*r;null!=(i=t.anchor)&&(o=i-(a+r*Math.floor((i-a)/r)),a+=o,s+=o);const u=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-r)),a+r*Math.floor(1e-14+(n-a)/r))};return u.start=a,u.stop=n.stop,u.step=r,this.value=(0,m.ZE)(u,(0,m.Oj)(e),t.name||"bin_"+(0,m.el)(e))}}),ca.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},(0,m.XW)(ca,no,{transform(t,e){const n=e.fork(e.ALL),r=ua(wi,this.value,n.materialize(n.ADD).add),i=t.sort,o=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(Si(i),o),e.source&&e.source.root&&(this.value.root=e.source.root),n}}),(0,m.XW)(la,Ri),da.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)(da,no,{transform(t,e){const n=e=>n=>{for(var r,i=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)||[],u=0,c=i.length;u<c;++u)a.test(r=i[u])||e(r)},r=this._parameterCheck(t,e),i=this._counts,o=this._match,a=this._stop,s=t.field,u=t.as||["text","count"],c=n((t=>i[t]=1+(i[t]||0))),l=n((t=>i[t]-=1));return r?e.visit(e.SOURCE,c):(e.visit(e.ADD,c),e.visit(e.REM,l)),this._finish(e,u)},_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,r=this._tuples||(this._tuples={}),i=e[0],o=e[1],a=t.fork(t.NO_SOURCE|t.NO_FIELDS);let s,u,c;for(s in n)u=r[s],c=n[s]||0,!u&&c?(r[s]=u=Di({}),u[i]=s,u[o]=c,a.add.push(u)):0===c?(u&&a.rem.push(u),n[s]=null,r[s]=null):u[o]!==c&&(u[o]=c,a.mod.push(u));return a.modifies(e)}}),ha.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)(ha,no,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.as||["a","b"],i=r[0],o=r[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,r){for(var i,o,a=[],s={},u=t.length,c=0;c<u;++c)for(s[e]=o=t[c],i=0;i<u;++i)s[n]=t[i],r(s)&&(a.push(Di(s)),(s={})[e]=o);return a}(s,i,o,t.filter||m.yb)):n.mod=s,n.source=this.value,n.modifies(r)}});const pa={kde:Bo,mixture:function(t,e){let n,r=0;const i={weights(t){return arguments.length?(n=function(t){const e=[];let n,i=0;for(n=0;n<r;++n)i+=e[n]=null==t[n]?1:+t[n];for(n=0;n<r;++n)e[n]/=i;return e}(e=t||[]),i):e},distributions(n){return arguments.length?(n?(r=n.length,t=n):(r=0,t=[]),i.weights(e)):t},sample(){const e=Ao();let i=t[r-1],o=n[0],a=0;for(;a<r-1;o+=n[++a])if(e<o){i=t[a];break}return i.sample()},pdf(e){let i=0,o=0;for(;o<r;++o)i+=n[o]*t[o].pdf(e);return i},cdf(e){let i=0,o=0;for(;o<r;++o)i+=n[o]*t[o].cdf(e);return i},icdf(){throw Error("Mixture icdf not supported.")}};return i.distributions(t).weights(e)},normal:Mo,lognormal:function(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Oo(n,r),pdf:t=>No(t,n,r),cdf:t=>To(t,n,r),icdf:t=>zo(t,n,r)};return i.mean(t).stdev(e)},uniform:function(t,e){let n,r;const i={min(t){return arguments.length?(n=t||0,i):n},max(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Ro(n,r),pdf:t=>Po(t,n,r),cdf:t=>Lo(t,n,r),icdf:t=>jo(t,n,r)};return null==e&&(e=null==t?1:t,t=0),i.min(t).max(e)}},ma="function";function ga(t,e){const n=t[ma];(0,m.nr)(pa,n)||(0,m.vU)("Unknown distribution function: "+n);const r=pa[n]();for(const i in t)"field"===i?r.data((t.from||e()).map(t[i])):"distributions"===i?r[i](t[i].map((t=>ga(t,e)))):typeof r[i]===ma&&r[i](t[i]);return r}function va(t){no.call(this,null,t)}const ya=[{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}]}],ba={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:ya},{name:"weights",type:"number",array:!0}]};function xa(t,e){return t?t.map(((t,n)=>e[n]||(0,m.el)(t))):null}function Aa(t,e,n){const r=[],i=t=>t(u);let o,a,s,u,c,l;if(null==e)r.push(t.map(n));else for(o={},a=0,s=t.length;a<s;++a)u=t[a],c=e.map(i),l=o[c],l||(o[c]=l=[],l.dims=c,r.push(l)),l.push(n(u));return r}va.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:ya.concat(ba)},{name:"as",type:"string",array:!0,default:["value","density"]}]},(0,m.XW)(va,no,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=ga(t.distribution,function(t){return()=>t.materialize(t.SOURCE).source}(e)),i=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||r.data||(0,m.vU)("Missing density extent parameter."),a=r[a];const s=t.as||["value","density"],u=Io(a,t.extent||(0,m.We)(r.data()),i,o).map((t=>{const e={};return e[s[0]]=t[0],e[s[1]]=t[1],Di(e)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});function _a(t){no.call(this,null,t)}_a.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 wa(t){Ri.call(this,null,Ea,t),this.modified(!0)}function Ea(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 Da(t){no.call(this,[void 0,void 0],t)}function Fa(t,e){Ri.call(this,t),this.parent=e,this.count=0}function Ca(t){no.call(this,{},t),this._keys=(0,m.Xr)();const e=this._targets=[];e.active=0,e.forEach=t=>{for(let n=0,r=e.active;n<r;++n)t(e[n],n,e)}}function ka(t){Ri.call(this,null,Sa,t)}function Sa(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 Ma(t){no.call(this,(0,m.Xr)(),t)}function Ba(t){no.call(this,[],t)}function Oa(t){no.call(this,[],t)}function Na(t){no.call(this,null,t)}function Ta(t){no.call(this,[],t)}(0,m.XW)(_a,no,{transform(t,e){if(this.value&&!t.modified()&&!e.changed())return e;const n=e.materialize(e.SOURCE).source,r=Aa(e.source,t.groupby,m.yR),i=t.smooth||!1,o=t.field,a=t.step||((t,e)=>(0,m.yP)((0,m.We)(t,e))/30)(n,o),s=Si(((t,e)=>o(t)-o(e))),u=t.as||"bin",c=r.length;let l,f=1/0,d=-1/0,h=0;for(;h<c;++h){const t=r[h].sort(s);l=-1;for(const e of _o(t,a,i,o))e<f&&(f=e),e>d&&(d=e),t[++l][u]=e}return this.value={start:f,stop:d,step:a},e.reflow(!0).modifies(u)}}),(0,m.XW)(wa,Ri),Da.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},(0,m.XW)(Da,no,{transform(t,e){const n=this.value,r=t.field,i=e.changed()||e.modified(r.fields)||t.modified("field");let o=n[0],a=n[1];if((i||null==o)&&(o=1/0,a=-1/0),e.visit(i?e.SOURCE:e.ADD,(t=>{const e=(0,m.He)(r(t));null!=e&&(e<o&&(o=e),e>a&&(a=e))})),!Number.isFinite(o)||!Number.isFinite(a)){let t=(0,m.el)(r);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)(Fa,Ri,{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)(Ca,no,{activate(t){this._targets[this._targets.active++]=t},subflow(t,e,n,r){const i=this.value;let o,a,s=(0,m.nr)(i,t)&&i[t];return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(a=r||(a=this._group[t])&&a.tuple,o=n.dataflow,s=new Fa(n.fork(n.NO_SOURCE),this),o.add(s).connect(e(o,t,a)),i[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 r=t[n].detachSubflow;r&&r(),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,r=t?t.length:0;let i=0;for(;i<r;++i)e[i]=t[i];for(;i<n&&null!=e[i];++i)e[i]=null;e.active=r},transform(t,e){const n=e.dataflow,r=t.key,i=t.subflow,o=this._keys,a=t.modified("key"),s=t=>this.subflow(t,i,e);return this._group=t.group||{},this.initTargets(),e.visit(e.REM,(t=>{const e=wi(t),n=o.get(e);void 0!==n&&(o.delete(e),s(n).rem(t))})),e.visit(e.ADD,(t=>{const e=r(t);o.set(wi(t),e),s(e).add(t)})),a||e.modified(r.fields)?e.visit(e.MOD,(t=>{const e=wi(t),n=o.get(e),i=r(t);n===i?s(i).mod(t):(o.set(e,i),s(n).rem(t),s(i).add(t))})):e.changed(e.MOD)&&e.visit(e.MOD,(t=>{s(o.get(wi(t))).mod(t)})),a&&e.visit(e.REFLOW,(t=>{const e=wi(t),n=o.get(e),i=r(t);n!==i&&(o.set(e,i),s(n).rem(t),s(i).add(t))})),e.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),e}}),(0,m.XW)(ka,Ri),Ma.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},(0,m.XW)(Ma,no,{transform(t,e){const n=e.dataflow,r=this.value,i=e.fork(),o=i.add,a=i.rem,s=i.mod,u=t.expr;let c=!0;function l(e){const n=wi(e),i=u(e,t),l=r.get(n);i&&l?(r.delete(n),o.push(e)):i||l?c&&i&&!l&&s.push(e):(r.set(n,1),a.push(e))}return e.visit(e.REM,(t=>{const e=wi(t);r.has(e)?r.delete(e):a.push(t)})),e.visit(e.ADD,(e=>{u(e,t)?o.push(e):r.set(wi(e),1)})),e.visit(e.MOD,l),t.modified()&&(c=!1,e.visit(e.REFLOW,l)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),Ba.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)(Ba,no,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=xa(r,t.as||[]),o=t.index||null,a=i.length;return n.rem=this.value,e.visit(e.SOURCE,(t=>{const e=r.map((e=>e(t))),s=e.reduce(((t,e)=>Math.max(t,e.length)),0);let u,c,l,f=0;for(;f<s;++f){for(c=Fi(t),u=0;u<a;++u)c[i[u]]=null==(l=e[u][f])?null:l;o&&(c[o]=f),n.add.push(c)}})),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(i)}}),Oa.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)(Oa,no,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=r.map(m.el),o=t.as||["key","value"],a=o[0],s=o[1],u=r.length;return n.rem=this.value,e.visit(e.SOURCE,(t=>{for(let e,o=0;o<u;++o)e=Fi(t),e[a]=i[o],e[s]=r[o](t),n.add.push(e)})),this.value=n.source=n.add,n.modifies(o)}}),Na.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)(Na,no,{transform(t,e){const n=t.expr,r=t.as,i=t.modified(),o=t.initonly?e.ADD:i?e.SOURCE:e.modified(n.fields)||e.modified(r)?e.ADD_MOD:e.ADD;return i&&(e=e.materialize().reflow(!0)),t.initonly||e.modifies(r),e.visit(o,(e=>e[r]=n(e,t)))}}),(0,m.XW)(Ta,no,{transform(t,e){const n=e.fork(e.ALL),r=t.generator;let i,o,a,s=this.value,u=t.size-s.length;if(u>0){for(i=[];--u>=0;)i.push(a=Di(r(t))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(i):i}else o=s.slice(0,-u),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-u);return n.source=this.value=s,n}});const za={value:"value",median:Wo,mean:function(t,e){let n=0,r=0;if(void 0===e)for(let i of t)null!=i&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},min:so,max:ao},Ra=[];function Pa(t){no.call(this,[],t)}function La(t){aa.call(this,t)}function ja(t){no.call(this,null,t)}function Ua(t){Ri.call(this,null,Ia,t)}function Ia(t){return this.value&&!t.modified()?this.value:(0,m.Jy)(t.fields,t.flat)}function qa(t){no.call(this,[],t),this._pending=null}function Wa(t,e,n){n.forEach(Di);const r=e.fork(e.NO_FIELDS&e.NO_SOURCE);return r.rem=t.value,t.value=r.source=r.add=n,t._pending=null,r.rem.length&&r.clean(!0),r}function Ha(t){no.call(this,{},t)}function Xa(t){Ri.call(this,null,Ga,t)}function Ga(t){if(this.value&&!t.modified())return this.value;const e=t.extents,n=e.length;let r,i,o=1/0,a=-1/0;for(r=0;r<n;++r)i=e[r],i[0]<o&&(o=i[0]),i[1]>a&&(a=i[1]);return[o,a]}function Ja(t){Ri.call(this,null,$a,t)}function $a(t){return this.value&&!t.modified()?this.value:t.values.reduce(((t,e)=>t.concat(e)),[])}function Va(t){no.call(this,null,t)}function Ya(t){aa.call(this,t)}function Ka(t){Ca.call(this,t)}function Za(t){no.call(this,null,t)}function Qa(t){no.call(this,null,t)}function ts(t){no.call(this,null,t)}Pa.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)(Pa,no,{transform(t,e){var n,r,i,o,a,s,u,c,l,f,d=e.fork(e.ALL),h=function(t){var e,n=t.method||za.value;if(null!=za[n])return n===za.value?(e=void 0!==t.value?t.value:0,()=>e):za[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,r){var i,o,a,s,u,c,l,f,d=t=>t(f),h=[],p=r?r.slice():[],m={},g={};for(p.forEach(((t,e)=>m[t]=e+1)),s=0,l=t.length;s<l;++s)c=n(f=t[s]),u=m[c]||(m[c]=p.push(c)),(a=g[o=(i=e?e.map(d):Ra)+""])||(a=g[o]=[],h.push(a),a.values=i),a[u-1]=f;return h.domain=p,h}(e.source,t.groupby,t.key,t.keyvals),x=[],A=this.value,_=b.domain.length;for(a=0,c=b.length;a<c;++a)for(i=(n=b[a]).values,r=NaN,u=0;u<_;++u)if(null==n[u]){for(o=b.domain[u],f={_impute:!0},s=0,l=i.length;s<l;++s)f[y[s]]=i[s];f[v]=o,f[g]=Number.isNaN(r)?r=h(n,p):r,x.push(Di(f))}return x.length&&(d.add=d.materialize(d.ADD).add.concat(x)),A.length&&(d.rem=d.materialize(d.REM).rem.concat(A)),this.value=x,d}}),La.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:Yo},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]},(0,m.XW)(La,aa,{transform(t,e){const n=this,r=t.modified();let i;return n.value&&(r||e.modified(n._inputs,!0))?(i=n.value=r?n.init(t):{},e.visit(e.SOURCE,(t=>n.add(t)))):(i=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,i[n.cellkey(t)].tuple)})),e.reflow(r).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,r;for(n=0,r=this._alen;n<r;++n)this.celltuple(t[n]),t[n]=null;for(n=0,r=this._mlen;n<r;++n)this.celltuple(e[n]),e[n]=null;this._alen=this._mlen=0}}),ja.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)(ja,no,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=e.materialize(e.SOURCE).source,i=Aa(r,t.groupby,t.field),o=(t.groupby||[]).map(m.el),a=t.bandwidth,s=t.cumulative?"cdf":"pdf",u=t.as||["value","density"],c=[];let l=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&&(l||(l=(0,m.We)(r,t.field)),f=d=t.steps||d),i.forEach((e=>{const n=Bo(e,a)[s],r=t.counts?e.length:1;Io(n,l||(0,m.We)(e),f,d).forEach((t=>{const n={};for(let r=0;r<o.length;++r)n[o[r]]=e.dims[r];n[u[0]]=t[0],n[u[1]]=t[1]*r,c.push(Di(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}}),(0,m.XW)(Ua,Ri),(0,m.XW)(qa,no,{transform(t,e){const n=e.dataflow;if(this._pending)return Wa(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 Wa(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=>Wa(this,e,(0,m.IX)(t.data))))}}),Ha.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)(Ha,no,{transform(t,e){const n=t.fields,r=t.index,i=t.values,o=null==t.default?null:t.default,a=t.modified(),s=n.length;let u,c,l,f=a?e.SOURCE:e.ADD,d=e,h=t.as;return i?(c=i.length,s>1&&!h&&(0,m.vU)('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*c&&(0,m.vU)('The "as" parameter has too few output field names.'),h=h||i.map(m.el),u=function(t){for(var e,a,u=0,l=0;u<s;++u)if(null==(a=r.get(n[u](t))))for(e=0;e<c;++e,++l)t[h[l]]=o;else for(e=0;e<c;++e,++l)t[h[l]]=i[e](a)}):(h||(0,m.vU)("Missing output field names."),u=function(t){for(var e,i=0;i<s;++i)e=r.get(n[i](t)),t[h[i]]=null==e?o:e}),a?d=e.reflow(!0):(l=n.some((t=>e.modified(t.fields))),f|=l?e.MOD:0),e.visit(f,u),d.modifies(h)}}),(0,m.XW)(Xa,Ri),(0,m.XW)(Ja,Ri),(0,m.XW)(Va,no,{transform(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),Ya.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:Yo,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},(0,m.XW)(Ya,aa,{_transform:aa.prototype.transform,transform(t,e){return this._transform(function(t,e){const n=t.field,r=t.value,i=("count"===t.op?"__count__":t.op)||"sum",o=(0,m.Oj)(n).concat((0,m.Oj)(r)),a=function(t,e,n){const r={},i=[];return n.visit(n.SOURCE,(e=>{const n=t(e);r[n]||(r[n]=1,i.push(n))})),i.sort(m.j2),e?i.slice(0,e):i}(n,t.limit||0,e);e.changed()&&t.set("__pivot__",null,null,!0);return{key:t.key,groupby:t.groupby,ops:a.map((()=>i)),fields:a.map((t=>function(t,e,n,r){return(0,m.ZE)((r=>e(r)===t?n(r):NaN),r,t+"")}(t,n,r,o))),as:a.map((t=>t+"")),modified:t.modified.bind(t)}}(t,e),e)}}),(0,m.XW)(Ka,Ca,{transform(t,e){const n=t.subflow,r=t.field,i=t=>this.subflow(wi(t),n,e,t);return(t.modified("field")||r&&e.modified((0,m.Oj)(r)))&&(0,m.vU)("PreFacet does not support field modification."),this.initTargets(),r?(e.visit(e.MOD,(t=>{const e=i(t);r(t).forEach((t=>e.mod(t)))})),e.visit(e.ADD,(t=>{const e=i(t);r(t).forEach((t=>e.add(Di(t))))})),e.visit(e.REM,(t=>{const e=i(t);r(t).forEach((t=>e.rem(t)))}))):(e.visit(e.MOD,(t=>i(t).mod(t))),e.visit(e.ADD,(t=>i(t).add(t))),e.visit(e.REM,(t=>i(t).rem(t)))),e.clean()&&e.runAfter((()=>this.clean())),e}}),Za.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)(Za,no,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=xa(t.fields,t.as||[]),o=r?(t,e)=>function(t,e,n,r){for(let i=0,o=n.length;i<o;++i)e[r[i]]=n[i](t);return e}(t,e,r,i):Ci;let a;return this.value?a=this.value:(e=e.addAll(),a=this.value={}),e.visit(e.REM,(t=>{const e=wi(t);n.rem.push(a[e]),a[e]=null})),e.visit(e.ADD,(t=>{const e=o(t,Di({}));a[wi(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{n.mod.push(o(t,a[wi(t)]))})),n}}),(0,m.XW)(Qa,no,{transform(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}}),ts.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 es(t){no.call(this,null,t)}function ns(t){no.call(this,[],t),this.count=0}function rs(t){no.call(this,null,t)}function is(t){no.call(this,null,t),this.modified(!0)}function os(t){no.call(this,null,t)}(0,m.XW)(ts,no,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.as||["prob","value"];if(this.value&&!t.modified()&&!e.changed())return n.source=this.value,n;const i=Aa(e.materialize(e.SOURCE).source,t.groupby,t.field),o=(t.groupby||[]).map(m.el),a=[],s=t.step||.01,u=t.probs||Ho(s/2,1-1e-14,s),c=u.length;return i.forEach((t=>{const e=yo(t,u);for(let n=0;n<c;++n){const i={};for(let e=0;e<o.length;++e)i[o[e]]=t.dims[e];i[r[0]]=u[n],i[r[1]]=e[n],a.push(Di(i))}})),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}}),(0,m.XW)(es,no,{transform(t,e){let n,r;return this.value?r=this.value:(n=e=e.addAll(),r=this.value={}),t.derive&&(n=e.fork(e.NO_SOURCE),e.visit(e.REM,(t=>{const e=wi(t);n.rem.push(r[e]),r[e]=null})),e.visit(e.ADD,(t=>{const e=Fi(t);r[wi(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{const e=r[wi(t)];for(const r in t)e[r]=t[r],n.modifies(r);n.mod.push(e)}))),n}}),ns.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},(0,m.XW)(ns,no,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.modified("size"),i=t.size,o=this.value.reduce(((t,e)=>(t[wi(e)]=1,t)),{});let a=this.value,s=this.count,u=0;function c(t){let e,r;a.length<i?a.push(t):(r=~~((s+1)*Ao()),r<a.length&&r>=u&&(e=a[r],o[wi(e)]&&n.rem.push(e),a[r]=t)),++s}if(e.rem.length&&(e.visit(e.REM,(t=>{const e=wi(t);o[e]&&(o[e]=-1,n.rem.push(t)),--s})),a=a.filter((t=>-1!==o[wi(t)]))),(e.rem.length||r)&&a.length<i&&e.source&&(u=s=a.length,e.visit(e.SOURCE,(t=>{o[wi(t)]||c(t)})),u=-1),r&&a.length>i){const t=a.length-i;for(let e=0;e<t;++e)o[wi(a[e])]=-1,n.rem.push(a[e]);a=a.slice(t)}return e.mod.length&&e.visit(e.MOD,(t=>{o[wi(t)]&&n.mod.push(t)})),e.add.length&&e.visit(e.ADD,c),(e.add.length||u<0)&&(n.add=a.filter((t=>!o[wi(t)]))),this.count=s,this.value=n.source=a,n}}),rs.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)(rs,no,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=Ho(t.start,t.stop,t.step||1).map((t=>{const e={};return e[r]=t,Di(e)})),n.add=e.add.concat(this.value),n}}),(0,m.XW)(is,no,{transform(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});const as=["unit0","unit1"];function ss(t){no.call(this,(0,m.Xr)(),t)}function us(t){no.call(this,null,t)}os.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:ie,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:as}]},(0,m.XW)(os,no,{transform(t,e){const n=t.field,r=!1!==t.interval,i="utc"===t.timezone,o=this._floor(t,e),a=(i?Te:Ne)(o.unit).offset,s=t.as||as,u=s[0],c=s[1],l=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 i,s;null==e?(t[u]=null,r&&(t[c]=null)):(t[u]=i=s=o(e),r&&(t[c]=s=a(i,l)),i<f&&(f=i),s>d&&(d=s))})),o.start=f,o.stop=d,e.modifies(r?s:u)},_floor(t,e){const n="utc"===t.timezone,{units:r,step:i}=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(r),a=this.value||{},s=(n?Me:Ce)(o,i);return s.unit=(0,m.fj)(o),s.units=o,s.step=i,s.start=a.start,s.stop=a.stop,this.value=s}}),(0,m.XW)(ss,no,{transform(t,e){const n=e.dataflow,r=t.field,i=this.value,o=t=>i.set(r(t),t);let a=!0;return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,(t=>i.delete(r(t)))),e.visit(e.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()}}),(0,m.XW)(us,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(Si(t.sort)):e.source).map(t.field))}});const cs={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){const t=cs.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,r=e.compare;let i=e.index;if(t<i){for(;i+1<n.length&&!r(n[i],n[i+1]);)++i;t=i}return(1+t)/n.length}}},ntile:function(t,e){(e=+e)>0||(0,m.vU)("ntile num must be greater than zero.");const n=cs.cume_dist(),r=n.next;return{init:n.init,next:t=>Math.ceil(e*r(t))}},lag:function(t,e){return e=+e||1,{next:n=>{const r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{const r=n.index+e,i=n.data;return r<i.length?t(i[r]):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 r=n.i0+(e-1);return r<n.i1?t(n.data[r]):null}}},prev_value:function(t){let e;return{init:()=>e=null,next:n=>{const r=t(n.data[n.index]);return null!=r?e=r:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:r=>{const i=r.data;return r.index<=n?e:(n=function(t,e,n){for(let r=e.length;n<r;++n){if(null!=t(e[n]))return n}return-1}(t,i,r.index))<0?(n=i.length,e=null):e=t(i[n])}}}};const ls=Object.keys(cs);function fs(t){const e=(0,m.IX)(t.ops),n=(0,m.IX)(t.fields),r=(0,m.IX)(t.params),i=(0,m.IX)(t.as),o=this.outputs=[],a=this.windows=[],s={},u={},c=[],l=[];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=Go(t,h,i[e]);if(d(s),o.push(p),(0,m.nr)(cs,t))a.push(function(t,e,n,r){const i=cs[t](e,n);return{init:i.init||m.bM,update:function(t,e){e[r]=i.next(t)}}}(t,n[e],r[e],p));else{if(null==s&&"count"!==t&&(0,m.vU)("Null aggregate field specified."),"count"===t)return void c.push(p);f=!1;let e=u[h];e||(e=u[h]=[],e.field=s,l.push(e)),e.push(Ko(t,p))}})),(c.length||l.length)&&(this.cell=function(t,e,n){t=t.map((t=>ra(t,t.field)));const r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,o=r.agg=Array(i),a=0;a<i;++a)o[a]=new t[a](r);if(r.store)var s=r.data=new ia;return r.add=function(t){if(r.num+=1,!n){s&&s.add(t);for(let e=0;e<i;++e)o[e].add(o[e].get(t),t)}},r.rem=function(t){if(r.num-=1,!n){s&&s.rem(t);for(let e=0;e<i;++e)o[e].rem(o[e].get(t),t)}},r.set=function(t){let i,a;for(s&&s.values(),i=0,a=e.length;i<a;++i)t[e[i]]=r.num;if(!n)for(i=0,a=o.length;i<a;++i)o[i].set(t)},r.init=function(){r.num=0,s&&s.reset();for(let t=0;t<i;++t)o[t].init()},r}(l,c,f)),this.inputs=Object.keys(s)}const ds=fs.prototype;function hs(t){no.call(this,{},t),this._mlen=0,this._mods=[]}function ps(t,e,n,r){const i=r.sort,o=i&&!r.ignorePeers,a=r.frame||[null,0],s=t.data(n),u=s.length,c=o?Xt(i):null,l={i0:0,i1:0,p0:0,p1:0,index:0,data:s,compare:i||(0,m.a9)(-1)};e.init();for(let f=0;f<u;++f)ms(l,a,f,u),o&&gs(l,c),e.update(l,s[f])}function ms(t,e,n,r){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]?r:Math.min(r,n+Math.abs(e[1])+1),t.index=n}function gs(t,e){const n=t.i0,r=t.i1-1,i=t.compare,o=t.data,a=o.length-1;n>0&&!i(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),r<a&&!i(o[r],o[r+1])&&(t.i1=e.right(o,o[r]))}function vs(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 ys(t){this._context=t}function bs(){}function xs(t){this._context=t}function As(t){this._context=t}function _s(t,e){this._basis=new ys(t),this._beta=e}ds.init=function(){this.windows.forEach((t=>t.init())),this.cell&&this.cell.init()},ds.update=function(t,e){const n=this.cell,r=this.windows,i=t.data,o=r&&r.length;let a;if(n){for(a=t.p0;a<t.i0;++a)n.rem(i[a]);for(a=t.p1;a<t.i1;++a)n.add(i[a]);n.set(e)}for(a=0;a<o;++a)r[a].update(t,e)},hs.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:ls.concat(Yo)},{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)(hs,no,{transform(t,e){this.stamp=e.stamp;const n=t.modified(),r=Si(t.sort),i=Xo(t.groupby),o=t=>this.group(i(t));let a=this.state;a&&!n||(a=this.state=new fs(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,u=this._mlen;s<u;++s)ps(this._mods[s],a,r,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]=ua(wi),e.stamp=-1),e.stamp<this.stamp&&(e.stamp=this.stamp,this._mods[this._mlen++]=e),e}}),ys.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:vs(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:vs(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},xs.prototype={areaStart:bs,areaEnd:bs,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:vs(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},As.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,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:vs(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},_s.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 r,i=t[0],o=e[0],a=t[n]-i,s=e[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*a),this._beta*e[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const ws=function t(e){function n(t){return 1===e?new ys(t):new _s(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Es(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 Ds(t,e){this._context=t,this._k=(1-e)/6}Ds.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:Es(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:Es(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 Fs=function t(e){function n(t){return new Ds(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Cs(t,e){this._context=t,this._k=(1-e)/6}Cs.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:Es(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 ks=function t(e){function n(t){return new Cs(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Ss(t,e){this._context=t,this._k=(1-e)/6}Ss.prototype={areaStart:bs,areaEnd:bs,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:Es(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 Ms=function t(e){function n(t){return new Ss(t,e)}return n.tension=function(e){return t(+e)},n}(0),Bs=Math.abs,Os=Math.atan2,Ns=Math.cos,Ts=Math.max,zs=Math.min,Rs=Math.sin,Ps=Math.sqrt,Ls=1e-12,js=Math.PI,Us=js/2,Is=2*js;function qs(t){return t>=1?Us:t<=-1?-Us:Math.asin(t)}function Ws(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Ls){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>Ls){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/l,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Hs(t,e){this._context=t,this._alpha=e}Hs.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,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:Ws(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 Xs=function t(e){function n(t){return e?new Hs(t,e):new Ds(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Gs(t,e){this._context=t,this._alpha=e}Gs.prototype={areaStart:bs,areaEnd:bs,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,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:Ws(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 Js=function t(e){function n(t){return e?new Gs(t,e):new Ss(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function $s(t,e){this._context=t,this._alpha=e}$s.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,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:Ws(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 Vs=function t(e){function n(t){return e?new $s(t,e):new Cs(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Ys(t){this._context=t}function Ks(t){return new Ys(t)}function Zs(t){this._context=t}function Qs(t){return t<0?-1:1}function tu(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Qs(o)+Qs(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function eu(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function nu(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function ru(t){this._context=t}function iu(t){this._context=new ou(t)}function ou(t){this._context=t}function au(t){this._context=t}function su(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/o[e-1],o[e]-=n,a[e]-=n*a[e-1];for(i[r-1]=a[r-1]/o[r-1],e=r-2;e>=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}function uu(t,e){this._context=t,this._t=e}function cu(t){return function(){return t}}Ys.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)}}},Zs.prototype={areaStart:bs,areaEnd:bs,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))}},ru.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:nu(this,this._t0,eu(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,nu(this,eu(this,n=tu(this,t,e)),n);break;default:nu(this,this._t0,n=tu(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(iu.prototype=Object.create(ru.prototype)).point=function(t,e){ru.prototype.point.call(this,e,t)},ou.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,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},au.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 r=su(t),i=su(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[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)}},uu.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 lu,fu,du,hu,pu,mu,gu,vu,yu,bu,xu,Au,_u,wu,Eu=n(50669);const Du=Math.PI,Fu=2*Du,Cu=1e-6,ku=Fu-Cu;function Su(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class Mu{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Su:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error("invalid digits: ".concat(t));if(e>15)return Su;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append(lu||(lu=(0,Eu.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(fu||(fu=(0,Eu.Z)(["Z"]))))}lineTo(t,e){this._append(du||(du=(0,Eu.Z)(["L",",",""])),this._x1=+t,this._y1=+e)}quadraticCurveTo(t,e,n,r){this._append(hu||(hu=(0,Eu.Z)(["Q",",",",",",",""])),+t,+e,this._x1=+n,this._y1=+r)}bezierCurveTo(t,e,n,r,i,o){this._append(pu||(pu=(0,Eu.Z)(["C",",",",",",",",",",",""])),+t,+e,+n,+r,this._x1=+i,this._y1=+o)}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error("negative radius: ".concat(i));let o=this._x1,a=this._y1,s=n-t,u=r-e,c=o-t,l=a-e,f=c*c+l*l;if(null===this._x1)this._append(mu||(mu=(0,Eu.Z)(["M",",",""])),this._x1=t,this._y1=e);else if(f>Cu)if(Math.abs(l*s-u*c)>Cu&&i){let d=n-o,h=r-a,p=s*s+u*u,m=d*d+h*h,g=Math.sqrt(p),v=Math.sqrt(f),y=i*Math.tan((Du-Math.acos((p+f-m)/(2*g*v)))/2),b=y/v,x=y/g;Math.abs(b-1)>Cu&&this._append(vu||(vu=(0,Eu.Z)(["L",",",""])),t+b*c,e+b*l),this._append(yu||(yu=(0,Eu.Z)(["A",",",",0,0,",",",",",""])),i,i,+(l*d>c*h),this._x1=t+x*s,this._y1=e+x*u)}else this._append(gu||(gu=(0,Eu.Z)(["L",",",""])),this._x1=t,this._y1=e);else;}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error("negative radius: ".concat(n));let a=n*Math.cos(r),s=n*Math.sin(r),u=t+a,c=e+s,l=1^o,f=o?r-i:i-r;null===this._x1?this._append(bu||(bu=(0,Eu.Z)(["M",",",""])),u,c):(Math.abs(this._x1-u)>Cu||Math.abs(this._y1-c)>Cu)&&this._append(xu||(xu=(0,Eu.Z)(["L",",",""])),u,c),n&&(f<0&&(f=f%Fu+Fu),f>ku?this._append(Au||(Au=(0,Eu.Z)(["A",",",",0,1,",",",",","A",",",",0,1,",",",",",""])),n,n,l,t-a,e-s,n,n,l,this._x1=u,this._y1=c):f>Cu&&this._append(_u||(_u=(0,Eu.Z)(["A",",",",0,",",",",",",",""])),n,n,+(f>=Du),l,this._x1=t+n*Math.cos(i),this._y1=e+n*Math.sin(i)))}rect(t,e,n,r){this._append(wu||(wu=(0,Eu.Z)(["M",",","h","v","h","Z"])),this._x0=this._x1=+t,this._y0=this._y1=+e,n=+n,+r,-n)}toString(){return this._}}function Bu(){return new Mu}function Ou(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 Mu(e)}function Nu(t){return t.innerRadius}function Tu(t){return t.outerRadius}function zu(t){return t.startAngle}function Ru(t){return t.endAngle}function Pu(t){return t&&t.padAngle}function Lu(t,e,n,r,i,o,a){var s=t-n,u=e-r,c=(a?o:-o)/Ps(s*s+u*u),l=c*u,f=-c*s,d=t+l,h=e+f,p=n+l,m=r+f,g=(d+p)/2,v=(h+m)/2,y=p-d,b=m-h,x=y*y+b*b,A=i-o,_=d*m-p*h,w=(b<0?-1:1)*Ps(Ts(0,A*A*x-_*_)),E=(_*b-y*w)/x,D=(-_*y-b*w)/x,F=(_*b+y*w)/x,C=(-_*y+b*w)/x,k=E-g,S=D-v,M=F-g,B=C-v;return k*k+S*S>M*M+B*B&&(E=F,D=C),{cx:E,cy:D,x01:-l,y01:-f,x11:E*(i/A-1),y11:D*(i/A-1)}}Bu.prototype=Mu.prototype;Array.prototype.slice;function ju(t){return"object"===typeof t&&"length"in t?t:Array.from(t)}function Uu(t){return t[0]}function Iu(t){return t[1]}function qu(t,e){var n=cu(!0),r=null,i=Ks,o=null,a=Ou(s);function s(s){var u,c,l,f=(s=ju(s)).length,d=!1;for(null==r&&(o=i(l=a())),u=0;u<=f;++u)!(u<f&&n(c=s[u],u,s))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+t(c,u,s),+e(c,u,s));if(l)return o=null,l+""||null}return t="function"===typeof t?t:void 0===t?Uu:cu(t),e="function"===typeof e?e:void 0===e?Iu:cu(e),s.x=function(e){return arguments.length?(t="function"===typeof e?e:cu(+e),s):t},s.y=function(t){return arguments.length?(e="function"===typeof t?t:cu(+t),s):e},s.defined=function(t){return arguments.length?(n="function"===typeof t?t:cu(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),s):r},s}function Wu(t,e,n){var r=null,i=cu(!0),o=null,a=Ks,s=null,u=Ou(c);function c(c){var l,f,d,h,p,m=(c=ju(c)).length,g=!1,v=new Array(m),y=new Array(m);for(null==o&&(s=a(p=u())),l=0;l<=m;++l){if(!(l<m&&i(h=c[l],l,c))===g)if(g=!g)f=l,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=l-1;d>=f;--d)s.point(v[d],y[d]);s.lineEnd(),s.areaEnd()}g&&(v[l]=+t(h,l,c),y[l]=+e(h,l,c),s.point(r?+r(h,l,c):v[l],n?+n(h,l,c):y[l]))}if(p)return s=null,p+""||null}function l(){return qu().defined(i).curve(a).context(o)}return t="function"===typeof t?t:void 0===t?Uu:cu(+t),e="function"===typeof e?e:cu(void 0===e?0:+e),n="function"===typeof n?n:void 0===n?Iu:cu(+n),c.x=function(e){return arguments.length?(t="function"===typeof e?e:cu(+e),r=null,c):t},c.x0=function(e){return arguments.length?(t="function"===typeof e?e:cu(+e),c):t},c.x1=function(t){return arguments.length?(r=null==t?null:"function"===typeof t?t:cu(+t),c):r},c.y=function(t){return arguments.length?(e="function"===typeof t?t:cu(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"===typeof t?t:cu(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"===typeof t?t:cu(+t),c):n},c.lineX0=c.lineY0=function(){return l().x(t).y(e)},c.lineY1=function(){return l().x(t).y(n)},c.lineX1=function(){return l().x(r).y(e)},c.defined=function(t){return arguments.length?(i="function"===typeof t?t:cu(!!t),c):i},c.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),c):o},c}Ps(3);const Hu={draw(t,e){const n=Ps(e/js);t.moveTo(n,0),t.arc(0,0,n,0,Is)}},Xu=(Ps(1/3),Rs(js/10)/Rs(7*js/10));Rs(Is/10),Ns(Is/10),Ps(3),Ps(3),Ps(3),Ps(12);function Gu(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 Ju=()=>"undefined"!==typeof Image?Image:null,$u=Xt(Wt),Vu=$u.right,Yu=$u.left,Ku=(Xt(ho).center,Vu);var Zu=n(52017),Qu=n(30975);function tc(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}}function ec(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function nc(t,e){return(ec(e)?tc:rc)(t,e)}function rc(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=cc(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}function ic(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}var oc=n(74552);function ac(t,e){var n,r={},i={};for(n in null!==t&&"object"===typeof t||(t={}),null!==e&&"object"===typeof e||(e={}),e)n in t?r[n]=cc(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var sc=n(71413),uc=n(31874);function cc(t,e){var n,r=typeof e;return null==e||"boolean"===r?(0,uc.Z)(e):("number"===r?oc.Z:"string"===r?(n=(0,Zu.ZP)(e))?(e=n,Qu.ZP):sc.Z:e instanceof Zu.ZP?Qu.ZP:e instanceof Date?ic:ec(e)?tc:Array.isArray(e)?rc:"function"!==typeof e.valueOf&&"function"!==typeof e.toString||isNaN(e)?ac:oc.Z)(t,e)}function lc(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function fc(t){return+t}var dc=[0,1];function hc(t){return t}function pc(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function mc(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=pc(i,r),o=n(a,o)):(r=pc(r,i),o=n(o,a)),function(t){return o(r(t))}}function gc(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=pc(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=Ku(t,e,1,r)-1;return o[n](i[n](e))}}function vc(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function yc(){var t,e,n,r,i,o,a=dc,s=dc,u=cc,c=hc;function l(){var t=Math.min(a.length,s.length);return c!==hc&&(c=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])),r=t>2?gc:mc,i=o=null,f}function f(e){return null==e||isNaN(e=+e)?n:(i||(i=r(a.map(t),s,u)))(t(c(e)))}return f.invert=function(n){return c(e((o||(o=r(s,a.map(t),oc.Z)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,fc),l()):a.slice()},f.range=function(t){return arguments.length?(s=Array.from(t),l()):s.slice()},f.rangeRound=function(t){return s=Array.from(t),u=lc,l()},f.clamp=function(t){return arguments.length?(c=!!t||hc,l()):c!==hc},f.interpolate=function(t){return arguments.length?(u=t,l()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,l()}}function bc(){return yc()(hc,hc)}function xc(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Ac(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 _c(t,e,n,r){var i,o=j(t,e,n);switch((r=q(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=G(o,a))||(r.precision=i),tt(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=J(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=$(o))||(r.precision=i-2*("%"===r.type))}return Q(r)}function wc(t){var e=t.domain;return t.ticks=function(t){var n=e();return P(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return _c(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,s=o.length-1,u=o[a],c=o[s],l=10;for(c<u&&(i=u,u=c,c=i,i=a,a=s,s=i);l-- >0;){if((i=L(u,c,n))===r)return o[a]=u,o[s]=c,e(o);if(i>0)u=Math.floor(u/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function Ec(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),t[r]=e.floor(o),t[i]=e.ceil(a),t}function Dc(t){return Math.log(t)}function Fc(t){return Math.exp(t)}function Cc(t){return-Math.log(-t)}function kc(t){return-Math.exp(-t)}function Sc(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Mc(t){return(e,n)=>-t(-e,n)}function Bc(t){const e=t(Dc,Fc),n=e.domain;let r,i,o=10;function a(){return r=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),i=function(t){return 10===t?Sc:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(r=Mc(r),i=Mc(i),t(Cc,kc)):t(Dc,Fc),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 u=s<a;u&&([a,s]=[s,a]);let c,l,f=r(a),d=r(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(c=1;c<o;++c)if(l=f<0?c/i(-f):c*i(f),!(l<a)){if(l>s)break;p.push(l)}}else for(;f<=d;++f)for(c=o-1;c>=1;--c)if(l=f>0?c/i(-f):c*i(f),!(l<a)){if(l>s)break;p.push(l)}2*p.length<h&&(p=P(a,s,h))}else p=P(f,d,Math.min(d-f,h)).map(i);return u?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/i(Math.round(r(t)));return e*o<o-.5&&(e*=o),e<=a?n(t):""}},e.nice=()=>n(Ec(n(),{floor:t=>i(Math.floor(r(t))),ceil:t=>i(Math.ceil(r(t)))})),e}function Oc(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Nc(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Tc(t){return t<0?-t*t:t*t}function zc(t){var e=t(hc,hc),n=1;return e.exponent=function(e){return arguments.length?1===(n=+e)?t(hc,hc):.5===n?t(Nc,Tc):t(Oc(n),Oc(1/n)):n},wc(e)}function Rc(){var t=zc(yc());return t.copy=function(){return vc(t,Rc()).exponent(t.exponent())},xc.apply(t,arguments),t}function Pc(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Lc(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function jc(t){var e=1,n=t(Pc(e),Lc(e));return n.constant=function(n){return arguments.length?t(Pc(e=+n),Lc(e)):e},wc(n)}function Uc(t,e,n,r,i,o){const a=[[It,1,st],[It,5,5e3],[It,15,15e3],[It,30,3e4],[o,1,ut],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,ct],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,lt],[r,2,1728e5],[n,1,ft],[e,1,dt],[e,3,7776e6],[t,1,ht]];function s(e,n,r){const i=Math.abs(n-e)/r,o=Xt((t=>{let[,,e]=t;return e})).right(a,i);if(o===a.length)return t.every(j(e/ht,n/ht,r));if(0===o)return qt.every(Math.max(j(e,n,r),1));const[s,u]=a[i/a[o-1][2]<a[o][2]/i?o-1:o];return s.every(u)}return[function(t,e,n){const r=e<t;r&&([t,e]=[e,t]);const i=n&&"function"===typeof n.range?n:s(t,e,n),o=i?i.range(t,+e+1):[];return r?o.reverse():o},s]}const[Ic,qc]=Uc(Tt,Rt,Ft,gt,Lt,Ut),[Wc,Hc]=Uc(Nt,zt,yt,pt,Pt,jt);function Xc(t){return new Date(t)}function Gc(t){return t instanceof Date?+t:+new Date(+t)}function Jc(t,e,n,r,i,o,a,s,u,c){var l=bc(),f=l.invert,d=l.domain,h=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),b=c("%B"),x=c("%Y");function A(t){return(u(t)<t?h:s(t)<t?p:a(t)<t?m:o(t)<t?g:r(t)<t?i(t)<t?v:y:n(t)<t?b:x)(t)}return l.invert=function(t){return new Date(f(t))},l.domain=function(t){return arguments.length?d(Array.from(t,Gc)):d().map(Xc)},l.ticks=function(e){var n=d();return t(n[0],n[n.length-1],null==e?10:e)},l.tickFormat=function(t,e){return null==e?A:c(e)},l.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(Ec(n,t)):l},l.copy=function(){return vc(l,Jc(t,e,n,r,i,o,a,s,u,c))},l}function $c(){var t,e,n,r,i,o=0,a=1,s=hc,u=!1;function c(e){return null==e||isNaN(e=+e)?i:s(0===n?.5:(e=(r(e)-t)*n,u?Math.max(0,Math.min(1,e)):e))}function l(t){return function(e){var n,r;return arguments.length?([n,r]=e,s=t(n,r),c):[s(0),s(1)]}}return c.domain=function(i){return arguments.length?([o,a]=i,t=r(o=+o),e=r(a=+a),n=t===e?0:1/(e-t),c):[o,a]},c.clamp=function(t){return arguments.length?(u=!!t,c):u},c.interpolator=function(t){return arguments.length?(s=t,c):s},c.range=l(cc),c.rangeRound=l(lc),c.unknown=function(t){return arguments.length?(i=t,c):i},function(i){return r=i,t=i(o),e=i(a),n=t===e?0:1/(e-t),c}}function Vc(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Yc(){var t=wc($c()(hc));return t.copy=function(){return Vc(t,Yc())},Ac.apply(t,arguments)}function Kc(){var t=zc($c());return t.copy=function(){return Vc(t,Kc()).exponent(t.exponent())},Ac.apply(t,arguments)}function Zc(t,e){void 0===e&&(e=t,t=cc);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(t){var e=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return o[e](t-e)}}function Qc(){var t,e,n,r,i,o,a,s=0,u=.5,c=1,l=1,f=hc,d=!1;function h(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(l*t<l*e?r:i),f(d?Math.max(0,Math.min(1,t)):t))}function p(t){return function(e){var n,r,i;return arguments.length?([n,r,i]=e,f=Zc(t,[n,r,i]),h):[f(0),f(.5),f(1)]}}return h.domain=function(a){return arguments.length?([s,u,c]=a,t=o(s=+s),e=o(u=+u),n=o(c=+c),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),l=e<t?-1:1,h):[s,u,c]},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(cc),h.rangeRound=p(lc),h.unknown=function(t){return arguments.length?(a=t,h):a},function(a){return o=a,t=a(s),e=a(u),n=a(c),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),l=e<t?-1:1,h}}function tl(){var t=zc(Qc());return t.copy=function(){return Vc(t,tl()).exponent(t.exponent())},Ac.apply(t,arguments)}class el extends Map{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:al;if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[n,r]of t)this.set(n,r)}get(t){return super.get(rl(this,t))}has(t){return super.has(rl(this,t))}set(t,e){return super.set(il(this,t),e)}delete(t){return super.delete(ol(this,t))}}class nl extends Set{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:al;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(rl(this,t))}add(t){return super.add(il(this,t))}delete(t){return super.delete(ol(this,t))}}function rl(t,e){let{_intern:n,_key:r}=t;const i=r(e);return n.has(i)?n.get(i):e}function il(t,e){let{_intern:n,_key:r}=t;const i=r(e);return n.has(i)?n.get(i):(n.set(i,e),e)}function ol(t,e){let{_intern:n,_key:r}=t;const i=r(e);return n.has(i)&&(e=n.get(i),n.delete(i)),e}function al(t){return null!==t&&"object"===typeof t?t.valueOf():t}const sl=Symbol("implicit");function ul(){var t=new el,e=[],n=[],r=sl;function i(i){let o=t.get(i);if(void 0===o){if(r!==sl)return r;t.set(i,o=e.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new el;for(const r of n)t.has(r)||t.set(r,e.push(r)-1);return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return ul(e,n).unknown(r)},xc.apply(i,arguments),i}var cl=n(5535),ll=n(20943);function fl(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var dl=n(97017);function hl(t,e){var n=(0,dl.wx)(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}var pl=n(18959);function ml(t){return((t=Math.exp(t))+1/t)/2}const gl=function t(e,n,r){function i(t,i){var o,a,s=t[0],u=t[1],c=t[2],l=i[0],f=i[1],d=i[2],h=l-s,p=f-u,m=h*h+p*p;if(m<1e-12)a=Math.log(d/c)/e,o=function(t){return[s+t*h,u+t*p,c*Math.exp(e*t*a)]};else{var g=Math.sqrt(m),v=(d*d-c*c+r*m)/(2*c*n*g),y=(d*d-c*c-r*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 r=t*a,i=ml(b),o=c/(n*g)*(i*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(e*r+b)-function(t){return((t=Math.exp(t))-1/t)/2}(b));return[s+o*h,u+o*p,c*i/ml(e*r+b)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4);function vl(t){return function(e,n){var r=t((e=(0,Zu.Ym)(e)).h,(n=(0,Zu.Ym)(n)).h),i=(0,dl.ZP)(e.s,n.s),o=(0,dl.ZP)(e.l,n.l),a=(0,dl.ZP)(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}const yl=vl(dl.wx);var bl=vl(dl.ZP),xl=n(20322);const Al=Math.PI/180,_l=180/Math.PI,wl=.96422,El=1,Dl=.82521,Fl=4/29,Cl=6/29,kl=3*Cl*Cl,Sl=.008856451679035631;function Ml(t){if(t instanceof Ol)return new Ol(t.l,t.a,t.b,t.opacity);if(t instanceof jl)return Ul(t);t instanceof Zu.Ss||(t=(0,Zu.SU)(t));var e,n,r=Rl(t.r),i=Rl(t.g),o=Rl(t.b),a=Nl((.2225045*r+.7168786*i+.0606169*o)/El);return r===i&&i===o?e=n=a:(e=Nl((.4360747*r+.3850649*i+.1430804*o)/wl),n=Nl((.0139322*r+.0971045*i+.7141733*o)/Dl)),new Ol(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Bl(t,e,n,r){return 1===arguments.length?Ml(t):new Ol(t,e,n,null==r?1:r)}function Ol(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Nl(t){return t>Sl?Math.pow(t,1/3):t/kl+Fl}function Tl(t){return t>Cl?t*t*t:kl*(t-Fl)}function zl(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Rl(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Pl(t){if(t instanceof jl)return new jl(t.h,t.c,t.l,t.opacity);if(t instanceof Ol||(t=Ml(t)),0===t.a&&0===t.b)return new jl(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*_l;return new jl(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Ll(t,e,n,r){return 1===arguments.length?Pl(t):new jl(t,e,n,null==r?1:r)}function jl(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function Ul(t){if(isNaN(t.h))return new Ol(t.l,0,0,t.opacity);var e=t.h*Al;return new Ol(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function Il(t,e){var n=(0,dl.ZP)((t=Bl(t)).l,(e=Bl(e)).l),r=(0,dl.ZP)(t.a,e.a),i=(0,dl.ZP)(t.b,e.b),o=(0,dl.ZP)(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=o(e),t+""}}function ql(t){return function(e,n){var r=t((e=Ll(e)).h,(n=Ll(n)).h),i=(0,dl.ZP)(e.c,n.c),o=(0,dl.ZP)(e.l,n.l),a=(0,dl.ZP)(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}(0,xl.Z)(Ol,Bl,(0,xl.l)(Zu.Il,{brighter(t){return new Ol(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Ol(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=wl*Tl(e),t=El*Tl(t),n=Dl*Tl(n),new Zu.Ss(zl(3.1338561*e-1.6168667*t-.4906146*n),zl(-.9787684*e+1.9161415*t+.033454*n),zl(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),(0,xl.Z)(jl,Ll,(0,xl.l)(Zu.Il,{brighter(t){return new jl(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new jl(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return Ul(this).rgb()}}));const Wl=ql(dl.wx);var Hl=ql(dl.ZP),Xl=-.14861,Gl=1.78277,Jl=-.29227,$l=-.90649,Vl=1.97294,Yl=Vl*$l,Kl=Vl*Gl,Zl=Gl*Jl-$l*Xl;function Ql(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof tf)return new tf(t.h,t.s,t.l,t.opacity);t instanceof Zu.Ss||(t=(0,Zu.SU)(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Zl*r+Yl*e-Kl*n)/(Zl+Yl-Kl),o=r-i,a=(Vl*(n-i)-Jl*o)/$l,s=Math.sqrt(a*a+o*o)/(Vl*i*(1-i)),u=s?Math.atan2(a,o)*_l-120:NaN;return new tf(u<0?u+360:u,s,i,t.opacity)}(t):new tf(t,e,n,null==r?1:r)}function tf(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function ef(t){return function e(n){function r(e,r){var i=t((e=Ql(e)).h,(r=Ql(r)).h),o=(0,dl.ZP)(e.s,r.s),a=(0,dl.ZP)(e.l,r.l),s=(0,dl.ZP)(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}(0,xl.Z)(tf,Ql,(0,xl.l)(Zu.Il,{brighter(t){return t=null==t?Zu.J5:Math.pow(Zu.J5,t),new tf(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Zu.xV:Math.pow(Zu.xV,t),new tf(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Al,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new Zu.Ss(255*(e+n*(Xl*r+Gl*i)),255*(e+n*(Jl*r+$l*i)),255*(e+n*(Vl*r)),this.opacity)}}));const nf=ef(dl.wx);var rf=ef(dl.ZP);function of(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}function af(t,e,n){const r=t-e+2*n;return t?r>0?r:1:0}const sf="linear",uf="log",cf="pow",lf="sqrt",ff="symlog",df="time",hf="utc",pf="sequential",mf="diverging",gf="quantile",vf="quantize",yf="threshold",bf="ordinal",xf="point",Af="band",_f="bin-ordinal",wf="continuous",Ef="discrete",Df="discretizing",Ff="interpolating",Cf="temporal";function kf(){const t=ul().unknown(void 0),e=t.domain,n=t.range;let r,i,o=[0,1],a=!1,s=0,u=0,c=.5;function l(){const t=e().length,l=o[1]<o[0],f=o[1-l],d=af(t,s,u);let h=o[l-0];r=(f-h)/(d||1),a&&(r=Math.floor(r)),h+=(f-h-r*(t-s))*c,i=r*(1-s),a&&(h=Math.round(h),i=Math.round(i));const p=Ho(t).map((t=>h+r*t));return n(l?p.reverse():p)}return delete t.unknown,t.domain=function(t){return arguments.length?(e(t),l()):e()},t.range=function(t){return arguments.length?(o=[+t[0],+t[1]],l()):o.slice()},t.rangeRound=function(t){return o=[+t[0],+t[1]],a=!0,l()},t.bandwidth=function(){return i},t.step=function(){return r},t.round=function(t){return arguments.length?(a=!!t,l()):a},t.padding=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),s=u,l()):s},t.paddingInner=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),l()):s},t.paddingOuter=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),l()):u},t.align=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),l()):c},t.invertRange=function(t){if(null==t[0]||null==t[1])return;const r=o[1]<o[0],a=r?n().reverse():n(),s=a.length-1;let u,c,l,f=+t[0],d=+t[1];return f!==f||d!==d||(d<f&&(l=f,f=d,d=l),d<a[0]||f>o[1-r])?void 0:(u=Math.max(0,Vu(a,f)-1),c=f===d?u:Vu(a,d)-1,f-a[u]>i+1e-10&&++u,r&&(l=u,u=s-c,c=s-l),u>c?void 0:e().slice(u,c+1))},t.invert=function(e){const n=t.invertRange([e,e]);return n?n[0]:n},t.copy=function(){return kf().domain(e()).range(o).round(a).paddingInner(s).paddingOuter(u).align(c)},l()}function Sf(t){const e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return Sf(e())},t}var Mf=Array.prototype.map;const Bf=Array.prototype.slice;const Of=new Map,Nf=Symbol("vega_scale");function Tf(t){return t[Nf]=!0,t}function zf(t){return t&&!0===t[Nf]}function Rf(t,e,n){return arguments.length>1?(Of.set(t,function(t,e,n){const r=function(){const n=e();return n.invertRange||(n.invertRange=n.invert?function(t){return function(e){let n,r=e[0],i=e[1];return i<r&&(n=r,r=i,i=n),[t.invert(r),t.invert(i)]}}(n):n.invertExtent?function(t){return function(e){const n=t.range();let r,i,o,a,s=e[0],u=e[1],c=-1;for(u<s&&(i=s,s=u,u=i),o=0,a=n.length;o<a;++o)n[o]>=s&&n[o]<=u&&(c<0&&(c=o),r=o);if(!(c<0))return s=t.invertExtent(n[c]),u=t.invertExtent(n[r]),[void 0===s[0]?s[1]:s[0],void 0===u[1]?u[0]:u[1]]}}(n):void 0),n.type=t,Tf(n)};return r.metadata=(0,m.Rg)((0,m.IX)(n)),r}(t,e,n)),this):Pf(t)?Of.get(t):void 0}function Pf(t){return Of.has(t)}function Lf(t,e){const n=Of.get(t);return n&&n.metadata[e]}function jf(t){return Lf(t,wf)}function Uf(t){return Lf(t,Ef)}function If(t){return Lf(t,Df)}function qf(t){return Lf(t,uf)}function Wf(t){return Lf(t,Ff)}function Hf(t){return Lf(t,gf)}Rf("identity",(function t(e){var n;function r(t){return null==t||isNaN(t=+t)?n:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,fc),r):e.slice()},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return t(e).unknown(n)},e=arguments.length?Array.from(e,fc):[0,1],wc(r)})),Rf(sf,(function t(){var e=bc();return e.copy=function(){return vc(e,t())},xc.apply(e,arguments),wc(e)}),wf),Rf(uf,(function t(){const e=Bc(yc()).domain([1,10]);return e.copy=()=>vc(e,t()).base(e.base()),xc.apply(e,arguments),e}),[wf,uf]),Rf(cf,Rc,wf),Rf(lf,(function(){return Rc.apply(null,arguments).exponent(.5)}),wf),Rf(ff,(function t(){var e=jc(yc());return e.copy=function(){return vc(e,t()).constant(e.constant())},xc.apply(e,arguments)}),wf),Rf(df,(function(){return xc.apply(Jc(Wc,Hc,Nt,zt,yt,pt,Pt,jt,It,un).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[wf,Cf]),Rf(hf,(function(){return xc.apply(Jc(Ic,qc,Tt,Rt,Ft,mt,Lt,Ut,It,ln).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[wf,Cf]),Rf(pf,Yc,[wf,Ff]),Rf("".concat(pf,"-").concat(sf),Yc,[wf,Ff]),Rf("".concat(pf,"-").concat(uf),(function t(){var e=Bc($c()).domain([1,10]);return e.copy=function(){return Vc(e,t()).base(e.base())},Ac.apply(e,arguments)}),[wf,Ff,uf]),Rf("".concat(pf,"-").concat(cf),Kc,[wf,Ff]),Rf("".concat(pf,"-").concat(lf),(function(){return Kc.apply(null,arguments).exponent(.5)}),[wf,Ff]),Rf("".concat(pf,"-").concat(ff),(function t(){var e=jc($c());return e.copy=function(){return Vc(e,t()).constant(e.constant())},Ac.apply(e,arguments)}),[wf,Ff]),Rf("".concat(mf,"-").concat(sf),(function t(){var e=wc(Qc()(hc));return e.copy=function(){return Vc(e,t())},Ac.apply(e,arguments)}),[wf,Ff]),Rf("".concat(mf,"-").concat(uf),(function t(){var e=Bc(Qc()).domain([.1,1,10]);return e.copy=function(){return Vc(e,t()).base(e.base())},Ac.apply(e,arguments)}),[wf,Ff,uf]),Rf("".concat(mf,"-").concat(cf),tl,[wf,Ff]),Rf("".concat(mf,"-").concat(lf),(function(){return tl.apply(null,arguments).exponent(.5)}),[wf,Ff]),Rf("".concat(mf,"-").concat(ff),(function t(){var e=jc(Qc());return e.copy=function(){return Vc(e,t()).constant(e.constant())},Ac.apply(e,arguments)}),[wf,Ff]),Rf(gf,(function t(){var e,n=[],r=[],i=[];function o(){var t=0,e=Math.max(1,r.length);for(i=new Array(e-1);++t<e;)i[t-1]=mo(n,t/e);return a}function a(t){return null==t||isNaN(t=+t)?e:r[Ku(i,t)]}return a.invertExtent=function(t){var e=r.indexOf(t);return e<0?[NaN,NaN]:[e>0?i[e-1]:n[0],e<i.length?i[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?(r=Array.from(t),o()):r.slice()},a.unknown=function(t){return arguments.length?(e=t,a):e},a.quantiles=function(){return i.slice()},a.copy=function(){return t().domain(n).range(r).unknown(e)},xc.apply(a,arguments)}),[Df,gf]),Rf(vf,(function t(){var e,n=0,r=1,i=1,o=[.5],a=[0,1];function s(t){return null!=t&&t<=t?a[Ku(o,t,0,i)]:e}function u(){var t=-1;for(o=new Array(i);++t<i;)o[t]=((t+1)*r-(t-i)*n)/(i+1);return s}return s.domain=function(t){return arguments.length?([n,r]=t,n=+n,r=+r,u()):[n,r]},s.range=function(t){return arguments.length?(i=(a=Array.from(t)).length-1,u()):a.slice()},s.invertExtent=function(t){var e=a.indexOf(t);return e<0?[NaN,NaN]:e<1?[n,o[0]]:e>=i?[o[i-1],r]:[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,r]).range(a).unknown(e)},xc.apply(wc(s),arguments)}),Df),Rf(yf,(function t(){var e,n=[.5],r=[0,1],i=1;function o(t){return null!=t&&t<=t?r[Ku(n,t,0,i)]:e}return o.domain=function(t){return arguments.length?(n=Array.from(t),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var e=r.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(r).unknown(e)},xc.apply(o,arguments)}),Df),Rf(_f,(function t(){let e=[],n=[];function r(t){return null==t||t!==t?void 0:n[(Ku(e,t)-1)%n.length]}return r.domain=function(t){return arguments.length?(e=function(t){return Mf.call(t,m.He)}(t),r):e.slice()},r.range=function(t){return arguments.length?(n=Bf.call(t),r):n.slice()},r.tickFormat=function(t,n){return _c(e[0],(0,m.fj)(e),null==t?10:t,n)},r.copy=function(){return t().domain(r.domain()).range(r.range())},r}),[Ef,Df]),Rf(bf,ul,Ef),Rf(Af,kf,Ef),Rf(xf,(function(){return Sf(kf().paddingInner(1))}),Ef);const Xf=["clamp","base","constant","exponent"];function Gf(t,e){const n=e[0],r=(0,m.fj)(e)-n;return function(e){return t(n+e*r)}}function Jf(t,e,n){return Zc(Yf(e||"rgb",n),t)}function $f(t,e){const n=new Array(e),r=e+1;for(let i=0;i<e;)n[i]=t(++i/r);return n}function Vf(t,e,n){const r=n-e;let i,o,a;return r&&Number.isFinite(r)?(i=(o=t.type).indexOf("-"),o=i<0?o:o.slice(i+1),a=Rf(o)().domain([e,n]).range([0,1]),Xf.forEach((e=>t[e]?a[e](t[e]()):0)),a):(0,m.a9)(.5)}function Yf(t,e){const n=i[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 Kf(t){const e=t.length/6|0,n=new Array(e);for(let r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}function Zf(t,e){for(const n in t)td(n,e(t[n]))}const Qf={};function td(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(Qf[t]=e,this):Qf[t]}Zf({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"},Kf),Zf({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=>Jf(Kf(t))));const ed="symbol",nd="discrete",rd=t=>(0,m.kJ)(t)?t.map((t=>String(t))):String(t),id=(t,e)=>t[1]-e[1],od=(t,e)=>e[1]-t[1];function ad(t,e,n){let r;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)&&(r=e.step,e=e.interval),(0,m.HD)(e)&&(e=t.type===df?Ne(e):t.type==hf?Te(e):(0,m.vU)("Only time and utc scales accept interval strings."),r&&(e=e.every(r))),e}function sd(t,e,n){let r=t.range(),i=r[0],o=(0,m.fj)(r),a=id;if(i>o&&(r=o,o=i,i=r,a=od),i=Math.floor(i),o=Math.ceil(o),e=e.map((e=>[e,t(e)])).filter((t=>i<=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 ud(t,e){return t.bins?sd(t,t.bins):t.ticks?t.ticks(e):t.domain()}function cd(t,e,n,r,i,o){const a=e.type;let s=rd;if(a===df||i===df)s=t.timeFormat(r);else if(a===hf||i===hf)s=t.utcFormat(r);else if(qf(a)){const i=t.formatFloat(r);if(o||e.bins)s=i;else{const t=ld(e,n,!1);s=e=>t(e)?i(e):""}}else if(e.tickFormat){const i=e.domain();s=t.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=t.format(r));return s}function ld(t,e,n){const r=ud(t,e),i=t.base(),o=Math.log(i),a=Math.max(1,i*e/r.length),s=t=>{let e=t/Math.pow(i,Math.round(Math.log(t)/o));return e*i<i-.5&&(e*=i),e<=a};return n?r.filter(s):s}const fd={[gf]:"quantiles",[vf]:"thresholds",[yf]:"domain"},dd={[gf]:"quantiles",[vf]:"domain"};function hd(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===uf?ld(t,e,!0):fd[t.type]?function(t){const e=[-1/0].concat(t);return e.max=1/0,e}(t[fd[t.type]]()):ud(t,e)}const pd=t=>fd[t.type]||t.bins;function md(t,e,n,r,i,o,a){const s=dd[e.type]&&o!==df&&o!==hf?function(t,e,n){const r=e[dd[e.type]](),i=r.length;let o,a=i>1?r[1]-r[0]:r[0];for(o=1;o<i;++o)a=Math.min(a,r[o]-r[o-1]);return t.formatSpan(0,a,30,n)}(t,e,i):cd(t,e,n,i,o,a);return r===ed&&pd(e)?gd(s):r===nd?yd(s):bd(s)}const gd=t=>(e,n,r)=>{const i=vd(r[n+1],vd(r.max,1/0)),o=xd(e,t),a=xd(i,t);return o&&a?o+" \u2013 "+a:a?"< "+a:"\u2265 "+o},vd=(t,e)=>null!=t?t:e,yd=t=>(e,n)=>n?t(e):null,bd=t=>e=>t(e),xd=(t,e)=>Number.isFinite(t)?e(t):null;function Ad(t,e,n,r){const i=r||e.type;return(0,m.HD)(n)&&function(t){return Lf(t,Cf)}(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==df?n||i!==hf?md(t,e,5,null,n,r,!0):t.utcFormat("%A, %d %B %Y, %X UTC"):t.timeFormat("%A, %d %B %Y, %X")}function _d(t,e,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=Ad(t,e,n.format,n.formatType);if(If(e.type)){const t=hd(e).slice(1).map(i),n=t.length;return"".concat(n," boundar").concat(1===n?"y":"ies",": ").concat(t.join(", "))}if(Uf(e.type)){const t=e.domain(),n=t.length,o=n>r?t.slice(0,r-2).map(i).join(", ")+", ending with "+t.slice(-1).map(i):t.map(i).join(", ");return"".concat(n," value").concat(1===n?"":"s",": ").concat(o)}{const t=e.domain();return"values from ".concat(i(t[0])," to ").concat(i((0,m.fj)(t)))}}let wd=0;const Ed="p_";function Dd(t){return t&&t.gradient}function Fd(t,e,n){const r=t.gradient;let i=t.id,o="radial"===r?Ed:"";return i||(i=t.id="gradient_"+wd++,"radial"===r?(t.x1=Cd(t.x1,.5),t.y1=Cd(t.y1,.5),t.r1=Cd(t.r1,0),t.x2=Cd(t.x2,.5),t.y2=Cd(t.y2,.5),t.r2=Cd(t.r2,.5),o=Ed):(t.x1=Cd(t.x1,0),t.y1=Cd(t.y1,0),t.x2=Cd(t.x2,1),t.y2=Cd(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function Cd(t,e){return null!=t?t:e}function kd(t,e){var n,r=[];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:r,stop:function(t,e){return r.push({offset:t,color:e}),n}}}const Sd={basis:{curve:function(t){return new ys(t)}},"basis-closed":{curve:function(t){return new xs(t)}},"basis-open":{curve:function(t){return new As(t)}},bundle:{curve:ws,tension:"beta",value:.85},cardinal:{curve:Fs,tension:"tension",value:0},"cardinal-open":{curve:ks,tension:"tension",value:0},"cardinal-closed":{curve:Ms,tension:"tension",value:0},"catmull-rom":{curve:Xs,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Js,tension:"alpha",value:.5},"catmull-rom-open":{curve:Vs,tension:"alpha",value:.5},linear:{curve:Ks},"linear-closed":{curve:function(t){return new Zs(t)}},monotone:{horizontal:function(t){return new iu(t)},vertical:function(t){return new ru(t)}},natural:{curve:function(t){return new au(t)}},step:{curve:function(t){return new uu(t,.5)}},"step-after":{curve:function(t){return new uu(t,1)}},"step-before":{curve:function(t){return new uu(t,0)}}};function Md(t,e,n){var r=(0,m.nr)(Sd,t)&&Sd[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const Bd={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Od=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Nd=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,Td=/^((\s+,?\s*)|(,\s*))/,zd=/^[01]/;function Rd(t){const e=[];return(t.match(Od)||[]).forEach((t=>{let n=t[0];const r=n.toLowerCase(),i=Bd[r],o=function(t,e,n){const r=[];for(let i=0;e&&i<n.length;)for(let o=0;o<e;++o){const e="a"!==t||3!==o&&4!==o?Nd:zd,a=n.slice(i).match(e);if(null===a)throw Error("Invalid SVG path, incorrect parameter type");i+=a[0].length,r.push(+a[0]);const s=n.slice(i).match(Td);null!==s&&(i+=s[0].length)}return r}(r,i,t.slice(1).trim()),a=o.length;if(a<i||a&&a%i!==0)throw Error("Invalid SVG path, incorrect parameter count");if(e.push([n,...o.slice(0,i)]),a!==i){"m"===r&&(n="M"===n?"L":"l");for(let t=i;t<a;t+=i)e.push([n,...o.slice(t,t+i)])}})),e}const Pd=Math.PI/180,Ld=Math.PI/2,jd=2*Math.PI,Ud=Math.sqrt(3)/2;var Id={},qd={},Wd=[].join;function Hd(t){const e=Wd.call(t);if(qd[e])return qd[e];var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7];const l=c*a,f=-u*s,d=u*a,h=c*s,p=Math.cos(i),m=Math.sin(i),g=Math.cos(o),v=Math.sin(o),y=.5*(o-i),b=Math.sin(.5*y),x=8/3*b*b/Math.sin(y),A=n+p-x*m,_=r+m+x*p,w=n+g,E=r+v,D=w+x*v,F=E-x*g;return qd[e]=[l*A+f*_,d*A+h*_,l*D+f*F,d*D+h*F,l*w+f*E,d*w+h*E]}const Xd=["l",0,0,0,0,0,0,0];function Gd(t,e,n){const r=Xd[0]=t[0];if("a"===r||"A"===r)Xd[1]=e*t[1],Xd[2]=n*t[2],Xd[3]=t[3],Xd[4]=t[4],Xd[5]=t[5],Xd[6]=e*t[6],Xd[7]=n*t[7];else if("h"===r||"H"===r)Xd[1]=e*t[1];else if("v"===r||"V"===r)Xd[1]=n*t[1];else for(var i=1,o=t.length;i<o;++i)Xd[i]=(i%2==1?e:n)*t[i];return Xd}function Jd(t,e,n,r,i,o){var a,s,u,c,l,f=null,d=0,h=0,p=0,m=0,g=0,v=0;null==n&&(n=0),null==r&&(r=0),null==i&&(i=1),null==o&&(o=i),t.beginPath&&t.beginPath();for(var y=0,b=e.length;y<b;++y){switch(a=e[y],1===i&&1===o||(a=Gd(a,i,o)),a[0]){case"l":d+=a[1],h+=a[2],t.lineTo(d+n,h+r);break;case"L":d=a[1],h=a[2],t.lineTo(d+n,h+r);break;case"h":d+=a[1],t.lineTo(d+n,h+r);break;case"H":d=a[1],t.lineTo(d+n,h+r);break;case"v":h+=a[1],t.lineTo(d+n,h+r);break;case"V":h=a[1],t.lineTo(d+n,h+r);break;case"m":g=d+=a[1],v=h+=a[2],t.moveTo(d+n,h+r);break;case"M":g=d=a[1],v=h=a[2],t.moveTo(d+n,h+r);break;case"c":s=d+a[5],u=h+a[6],p=d+a[3],m=h+a[4],t.bezierCurveTo(d+a[1]+n,h+a[2]+r,p+n,m+r,s+n,u+r),d=s,h=u;break;case"C":d=a[5],h=a[6],p=a[3],m=a[4],t.bezierCurveTo(a[1]+n,a[2]+r,p+n,m+r,d+n,h+r);break;case"s":s=d+a[3],u=h+a[4],p=2*d-p,m=2*h-m,t.bezierCurveTo(p+n,m+r,d+a[1]+n,h+a[2]+r,s+n,u+r),p=d+a[1],m=h+a[2],d=s,h=u;break;case"S":s=a[3],u=a[4],p=2*d-p,m=2*h-m,t.bezierCurveTo(p+n,m+r,a[1]+n,a[2]+r,s+n,u+r),d=s,h=u,p=a[1],m=a[2];break;case"q":s=d+a[3],u=h+a[4],p=d+a[1],m=h+a[2],t.quadraticCurveTo(p+n,m+r,s+n,u+r),d=s,h=u;break;case"Q":s=a[3],u=a[4],t.quadraticCurveTo(a[1]+n,a[2]+r,s+n,u+r),d=s,h=u,p=a[1],m=a[2];break;case"t":s=d+a[1],u=h+a[2],null===f[0].match(/[QqTt]/)?(p=d,m=h):"t"===f[0]?(p=2*d-c,m=2*h-l):"q"===f[0]&&(p=2*d-p,m=2*h-m),c=p,l=m,t.quadraticCurveTo(p+n,m+r,s+n,u+r),h=u,p=(d=s)+a[1],m=h+a[2];break;case"T":s=a[1],u=a[2],p=2*d-p,m=2*h-m,t.quadraticCurveTo(p+n,m+r,s+n,u+r),d=s,h=u;break;case"a":$d(t,d+n,h+r,[a[1],a[2],a[3],a[4],a[5],a[6]+d+n,a[7]+h+r]),d+=a[6],h+=a[7];break;case"A":$d(t,d+n,h+r,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+r]),d=a[6],h=a[7];break;case"z":case"Z":d=g,h=v,t.closePath()}f=a}}function $d(t,e,n,r){const i=function(t,e,n,r,i,o,a,s,u){const c=Wd.call(arguments);if(Id[c])return Id[c];const l=a*Pd,f=Math.sin(l),d=Math.cos(l),h=d*(s-t)*.5+f*(u-e)*.5,p=d*(u-e)*.5-f*(s-t)*.5;let m=h*h/((n=Math.abs(n))*n)+p*p/((r=Math.abs(r))*r);m>1&&(m=Math.sqrt(m),n*=m,r*=m);const g=d/n,v=f/n,y=-f/r,b=d/r,x=g*s+v*u,A=y*s+b*u,_=g*t+v*e,w=y*t+b*e;let E=1/((_-x)*(_-x)+(w-A)*(w-A))-.25;E<0&&(E=0);let D=Math.sqrt(E);o==i&&(D=-D);const F=.5*(x+_)-D*(w-A),C=.5*(A+w)+D*(_-x),k=Math.atan2(A-C,x-F);let S=Math.atan2(w-C,_-F)-k;S<0&&1===o?S+=jd:S>0&&0===o&&(S-=jd);const M=Math.ceil(Math.abs(S/(Ld+.001))),B=[];for(let O=0;O<M;++O){const t=k+O*S/M,e=k+(O+1)*S/M;B[O]=[F,C,t,e,n,r,f,d]}return Id[c]=B}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],e,n);for(let o=0;o<i.length;++o){const e=Hd(i[o]);t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5])}}const Vd=.5773502691896257,Yd={circle:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,jd)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/2.5;t.moveTo(-n,-r),t.lineTo(-n,r),t.lineTo(-r,r),t.lineTo(-r,n),t.lineTo(r,n),t.lineTo(r,r),t.lineTo(n,r),t.lineTo(n,-r),t.lineTo(r,-r),t.lineTo(r,-n),t.lineTo(-r,-n),t.lineTo(-r,-r),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),r=-n/2;t.rect(r,r,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/7,i=n/2.5,o=n/8;t.moveTo(-r,n),t.lineTo(r,n),t.lineTo(r,-o),t.lineTo(i,-o),t.lineTo(0,-n),t.lineTo(-i,-o),t.lineTo(-r,-o),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,r=Ud*n,i=r-n*Vd,o=n/4;t.moveTo(0,-r-i),t.lineTo(-o,r-i),t.lineTo(o,r-i),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,r=Ud*n,i=r-n*Vd;t.moveTo(0,-r-i),t.lineTo(-n,r-i),t.lineTo(n,r-i),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,r=Ud*n;t.moveTo(0,-r),t.lineTo(-n,r),t.lineTo(n,r),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,r=Ud*n;t.moveTo(0,r),t.lineTo(-n,-r),t.lineTo(n,-r),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,r=Ud*n;t.moveTo(r,0),t.lineTo(-r,-n),t.lineTo(-r,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,r=Ud*n;t.moveTo(-r,0),t.lineTo(r,-n),t.lineTo(r,n),t.closePath()}},stroke:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function Kd(t){return(0,m.nr)(Yd,t)?Yd[t]:function(t){if(!(0,m.nr)(Zd,t)){const e=Rd(t);Zd[t]={draw:function(t,n){Jd(t,e,0,0,Math.sqrt(n)/2)}}}return Zd[t]}(t)}var Zd={};const Qd=.448084975506;function th(t){return t.x}function eh(t){return t.y}function nh(t){return t.width}function rh(t){return t.height}function ih(t){return"function"===typeof t?t:()=>+t}function oh(t,e,n){return Math.max(e,Math.min(t,n))}function ah(){var t=th,e=eh,n=nh,r=rh,i=ih(0),o=i,a=i,s=i,u=null;function c(c,l,f){var d,h=null!=l?l:+t.call(this,c),p=null!=f?f:+e.call(this,c),m=+n.call(this,c),g=+r.call(this,c),v=Math.min(m,g)/2,y=oh(+i.call(this,c),0,v),b=oh(+o.call(this,c),0,v),x=oh(+a.call(this,c),0,v),A=oh(+s.call(this,c),0,v);if(u||(u=d=Bu()),y<=0&&b<=0&&x<=0&&A<=0)u.rect(h,p,m,g);else{var _=h+m,w=p+g;u.moveTo(h+y,p),u.lineTo(_-b,p),u.bezierCurveTo(_-Qd*b,p,_,p+Qd*b,_,p+b),u.lineTo(_,w-A),u.bezierCurveTo(_,w-Qd*A,_-Qd*A,w,_-A,w),u.lineTo(h+x,w),u.bezierCurveTo(h+Qd*x,w,h,w-Qd*x,h,w-x),u.lineTo(h,p+y),u.bezierCurveTo(h,p+Qd*y,h+Qd*y,p,h+y,p),u.closePath()}if(d)return u=null,d+""||null}return c.x=function(e){return arguments.length?(t=ih(e),c):t},c.y=function(t){return arguments.length?(e=ih(t),c):e},c.width=function(t){return arguments.length?(n=ih(t),c):n},c.height=function(t){return arguments.length?(r=ih(t),c):r},c.cornerRadius=function(t,e,n,r){return arguments.length?(i=ih(t),o=null!=e?ih(e):i,s=null!=n?ih(n):i,a=null!=r?ih(r):o,c):i},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}function sh(){var t,e,n,r,i,o,a,s,u=null;function c(t,e,n){const r=n/2;if(i){var c=a-e,l=t-o;if(c||l){var f=Math.sqrt(c*c+l*l),d=(c/=f)*s,h=(l/=f)*s,p=Math.atan2(l,c);u.moveTo(o-d,a-h),u.lineTo(t-c*r,e-l*r),u.arc(t,e,r,p-Math.PI,p),u.lineTo(o+d,a+h),u.arc(o,a,s,p,p+Math.PI)}else u.arc(t,e,r,0,jd);u.closePath()}else i=1;o=t,a=e,s=r}function l(o){var a,s,l,f=o.length,d=!1;for(null==u&&(u=l=Bu()),a=0;a<=f;++a)!(a<f&&r(s=o[a],a,o))===d&&(d=!d)&&(i=0),d&&c(+t(s,a,o),+e(s,a,o),+n(s,a,o));if(l)return u=null,l+""||null}return l.x=function(e){return arguments.length?(t=e,l):t},l.y=function(t){return arguments.length?(e=t,l):e},l.size=function(t){return arguments.length?(n=t,l):n},l.defined=function(t){return arguments.length?(r=t,l):r},l.context=function(t){return arguments.length?(u=null==t?null:t,l):u},l}function uh(t,e){return null!=t?t:e}const ch=t=>t.x||0,lh=t=>t.y||0,fh=t=>!(!1===t.defined),dh=function(){var t=Nu,e=Tu,n=cu(0),r=null,i=zu,o=Ru,a=Pu,s=null,u=Ou(c);function c(){var c,l,f=+t.apply(this,arguments),d=+e.apply(this,arguments),h=i.apply(this,arguments)-Us,p=o.apply(this,arguments)-Us,m=Bs(p-h),g=p>h;if(s||(s=c=u()),d<f&&(l=d,d=f,f=l),d>Ls)if(m>Is-Ls)s.moveTo(d*Ns(h),d*Rs(h)),s.arc(0,0,d,h,p,!g),f>Ls&&(s.moveTo(f*Ns(p),f*Rs(p)),s.arc(0,0,f,p,h,g));else{var v,y,b=h,x=p,A=h,_=p,w=m,E=m,D=a.apply(this,arguments)/2,F=D>Ls&&(r?+r.apply(this,arguments):Ps(f*f+d*d)),C=zs(Bs(d-f)/2,+n.apply(this,arguments)),k=C,S=C;if(F>Ls){var M=qs(F/f*Rs(D)),B=qs(F/d*Rs(D));(w-=2*M)>Ls?(A+=M*=g?1:-1,_-=M):(w=0,A=_=(h+p)/2),(E-=2*B)>Ls?(b+=B*=g?1:-1,x-=B):(E=0,b=x=(h+p)/2)}var O=d*Ns(b),N=d*Rs(b),T=f*Ns(_),z=f*Rs(_);if(C>Ls){var R,P=d*Ns(x),L=d*Rs(x),j=f*Ns(A),U=f*Rs(A);if(m<js)if(R=function(t,e,n,r,i,o,a,s){var u=n-t,c=r-e,l=a-i,f=s-o,d=f*u-l*c;if(!(d*d<Ls))return[t+(d=(l*(e-o)-f*(t-i))/d)*u,e+d*c]}(O,N,j,U,P,L,T,z)){var I=O-R[0],q=N-R[1],W=P-R[0],H=L-R[1],X=1/Rs(function(t){return t>1?0:t<-1?js:Math.acos(t)}((I*W+q*H)/(Ps(I*I+q*q)*Ps(W*W+H*H)))/2),G=Ps(R[0]*R[0]+R[1]*R[1]);k=zs(C,(f-G)/(X-1)),S=zs(C,(d-G)/(X+1))}else k=S=0}E>Ls?S>Ls?(v=Lu(j,U,O,N,d,S,g),y=Lu(P,L,T,z,d,S,g),s.moveTo(v.cx+v.x01,v.cy+v.y01),S<C?s.arc(v.cx,v.cy,S,Os(v.y01,v.x01),Os(y.y01,y.x01),!g):(s.arc(v.cx,v.cy,S,Os(v.y01,v.x01),Os(v.y11,v.x11),!g),s.arc(0,0,d,Os(v.cy+v.y11,v.cx+v.x11),Os(y.cy+y.y11,y.cx+y.x11),!g),s.arc(y.cx,y.cy,S,Os(y.y11,y.x11),Os(y.y01,y.x01),!g))):(s.moveTo(O,N),s.arc(0,0,d,b,x,!g)):s.moveTo(O,N),f>Ls&&w>Ls?k>Ls?(v=Lu(T,z,P,L,f,-k,g),y=Lu(O,N,j,U,f,-k,g),s.lineTo(v.cx+v.x01,v.cy+v.y01),k<C?s.arc(v.cx,v.cy,k,Os(v.y01,v.x01),Os(y.y01,y.x01),!g):(s.arc(v.cx,v.cy,k,Os(v.y01,v.x01),Os(v.y11,v.x11),!g),s.arc(0,0,f,Os(v.cy+v.y11,v.cx+v.x11),Os(y.cy+y.y11,y.cx+y.x11),g),s.arc(y.cx,y.cy,k,Os(y.y11,y.x11),Os(y.y01,y.x01),!g))):s.arc(0,0,f,_,A,g):s.lineTo(T,z)}else s.moveTo(0,0);if(s.closePath(),c)return s=null,c+""||null}return c.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-js/2;return[Ns(r)*n,Rs(r)*n]},c.innerRadius=function(e){return arguments.length?(t="function"===typeof e?e:cu(+e),c):t},c.outerRadius=function(t){return arguments.length?(e="function"===typeof t?t:cu(+t),c):e},c.cornerRadius=function(t){return arguments.length?(n="function"===typeof t?t:cu(+t),c):n},c.padRadius=function(t){return arguments.length?(r=null==t?null:"function"===typeof t?t:cu(+t),c):r},c.startAngle=function(t){return arguments.length?(i="function"===typeof t?t:cu(+t),c):i},c.endAngle=function(t){return arguments.length?(o="function"===typeof t?t:cu(+t),c):o},c.padAngle=function(t){return arguments.length?(a="function"===typeof t?t:cu(+t),c):a},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c}().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)),hh=Wu().x(ch).y1(lh).y0((t=>(t.y||0)+(t.height||0))).defined(fh),ph=Wu().y(lh).x1(ch).x0((t=>(t.x||0)+(t.width||0))).defined(fh),mh=qu().x(ch).y(lh).defined(fh),gh=ah().x(ch).y(lh).width((t=>t.width||0)).height((t=>t.height||0)).cornerRadius((t=>uh(t.cornerRadiusTopLeft,t.cornerRadius)||0),(t=>uh(t.cornerRadiusTopRight,t.cornerRadius)||0),(t=>uh(t.cornerRadiusBottomRight,t.cornerRadius)||0),(t=>uh(t.cornerRadiusBottomLeft,t.cornerRadius)||0)),vh=function(t,e){let n=null,r=Ou(i);function i(){let i;if(n||(n=i=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return t="function"===typeof t?t:cu(t||Hu),e="function"===typeof e?e:cu(void 0===e?64:+e),i.type=function(e){return arguments.length?(t="function"===typeof e?e:cu(e),i):t},i.size=function(t){return arguments.length?(e="function"===typeof t?t:cu(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i}().type((t=>Kd(t.shape||"circle"))).size((t=>uh(t.size,64))),yh=sh().x(ch).y(lh).defined(fh).size((t=>t.size||1));function bh(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function xh(t,e,n,r){return gh.context(t)(e,n,r)}var Ah=1;function _h(){Ah=1}function wh(t,e,n){var r=e.clip,i=t._defs,o=e.clip_id||(e.clip_id="clip"+Ah++),a=i.clipping[o]||(i.clipping[o]={id:o});return(0,m.mf)(r)?a.path=r(null):bh(n)?a.path=xh(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function Eh(t){this.clear(),t&&this.union(t)}function Dh(t){this.mark=t,this.bounds=this.bounds||new Eh}function Fh(t){Dh.call(this,t),this.items=this.items||[]}function Ch(t){this._pending=0,this._loader=t||vi()}function kh(t){t._pending+=1}function Sh(t){t._pending-=1}function Mh(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const r=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(r+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,r):0))}return t}Eh.prototype={clone(){return new Eh(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,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),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 r=this.rotatedPoints(t,e,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(t,e,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(t),u=Math.sin(t),c=e-e*s+n*u,l=n-e*u-n*s;return[s*r-u*i+c,u*r+s*i+l,s*r-u*a+c,u*r+s*a+l,s*o-u*i+c,u*o+s*i+l,s*o-u*a+c,u*o+s*a+l]},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)(Fh,Dh),Ch.prototype={pending(){return this._pending},sanitizeURL(t){const e=this;return kh(e),e._loader.sanitize(t,{context:"href"}).then((t=>(Sh(e),t))).catch((()=>(Sh(e),null)))},loadImage(t){const e=this,n=Ju();return kh(e),e._loader.sanitize(t,{context:"image"}).then((t=>{const r=t.href;if(!r||!n)throw{url:r};const i=new n,o=(0,m.nr)(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>Sh(e),i.onerror=()=>Sh(e),i.src=r,i})).catch((t=>(Sh(e),{complete:!1,width:0,height:0,src:t&&t.url||""})))},ready(){const t=this;return new Promise((e=>{!function n(r){t.pending()?setTimeout((()=>{n(!0)}),10):e(r)}(!1)}))}};const Bh=jd-1e-8;let Oh,Nh,Th,zh,Rh,Ph,Lh,jh;const Uh=(t,e)=>Oh.add(t,e),Ih=(t,e)=>Uh(Nh=t,Th=e),qh=t=>Uh(t,Oh.y1),Wh=t=>Uh(Oh.x1,t),Hh=(t,e)=>Rh*t+Lh*e,Xh=(t,e)=>Ph*t+jh*e,Gh=(t,e)=>Uh(Hh(t,e),Xh(t,e)),Jh=(t,e)=>Ih(Hh(t,e),Xh(t,e));function $h(t,e){return Oh=t,e?(zh=e*Pd,Rh=jh=Math.cos(zh),Ph=Math.sin(zh),Lh=-Ph):(Rh=jh=1,zh=Ph=Lh=0),Vh}const Vh={beginPath(){},closePath(){},moveTo:Jh,lineTo:Jh,rect(t,e,n,r){zh?(Gh(t+n,e),Gh(t+n,e+r),Gh(t,e+r),Jh(t,e)):(Uh(t+n,e+r),Ih(t,e))},quadraticCurveTo(t,e,n,r){const i=Hh(t,e),o=Xh(t,e),a=Hh(n,r),s=Xh(n,r);Yh(Nh,i,a,qh),Yh(Th,o,s,Wh),Ih(a,s)},bezierCurveTo(t,e,n,r,i,o){const a=Hh(t,e),s=Xh(t,e),u=Hh(n,r),c=Xh(n,r),l=Hh(i,o),f=Xh(i,o);Kh(Nh,a,u,l,qh),Kh(Th,s,c,f,Wh),Ih(l,f)},arc(t,e,n,r,i,o){if(r+=zh,i+=zh,Nh=n*Math.cos(i)+t,Th=n*Math.sin(i)+e,Math.abs(i-r)>Bh)Uh(t-n,e-n),Uh(t+n,e+n);else{const a=r=>Uh(n*Math.cos(r)+t,n*Math.sin(r)+e);let s,u;if(a(r),a(i),i!==r)if((r%=jd)<0&&(r+=jd),(i%=jd)<0&&(i+=jd),i<r&&(o=!o,s=r,r=i,i=s),o)for(i-=jd,s=r-r%Ld,u=0;u<4&&s>i;++u,s-=Ld)a(s);else for(s=r-r%Ld+Ld,u=0;u<4&&s<i;++u,s+=Ld)a(s)}}};function Yh(t,e,n,r){const i=(t-e)/(t+n-2*e);0<i&&i<1&&r(t+(e-t)*i)}function Kh(t,e,n,r,i){const o=r-t+3*e-3*n,a=t+n-2*e,s=t-e;let u,c=0,l=0;Math.abs(o)>1e-14?(u=a*a+s*o,u>=0&&(u=Math.sqrt(u),c=(-a+u)/o,l=(-a-u)/o)):c=.5*s/a,0<c&&c<1&&i(Zh(c,t,e,n,r)),0<l&&l<1&&i(Zh(l,t,e,n,r))}function Zh(t,e,n,r,i){const o=1-t,a=o*o,s=t*t;return a*o*e+3*a*t*n+3*o*s*r+s*t*i}var Qh=(Qh=Gu(1,1))?Qh.getContext("2d"):null;const tp=new Eh;function ep(t){return function(e,n){if(!Qh)return!0;t(Qh,e),tp.clear().union(e.bounds).intersect(n).round();const{x1:r,y1:i,x2:o,y2:a}=tp;for(let t=i;t<=a;++t)for(let e=r;e<=o;++e)if(Qh.isPointInPath(e,t))return!0;return!1}}function np(t,e){return e.contains(t.x||0,t.y||0)}function rp(t,e){const n=t.x||0,r=t.y||0,i=t.width||0,o=t.height||0;return e.intersects(tp.set(n,r,n+i,r+o))}function ip(t,e){const n=t.x||0,r=t.y||0;return op(e,n,r,null!=t.x2?t.x2:n,null!=t.y2?t.y2:r)}function op(t,e,n,r,i){const{x1:o,y1:a,x2:s,y2:u}=t,c=r-e,l=i-n;let f,d,h,p,m=0,g=1;for(p=0;p<4;++p){if(0===p&&(f=-c,d=-(o-e)),1===p&&(f=c,d=s-e),2===p&&(f=-l,d=-(a-n)),3===p&&(f=l,d=u-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 ap(t,e){t.globalCompositeOperation=e.blend||"source-over"}function sp(t,e){return null==t?e:t}function up(t,e){const n=e.length;for(let r=0;r<n;++r)t.addColorStop(e[r].offset,e[r].color);return t}function cp(t,e,n){return Dd(n)?function(t,e,n){const r=n.width(),i=n.height();let o;if("radial"===e.gradient)o=t.createRadialGradient(n.x1+sp(e.x1,.5)*r,n.y1+sp(e.y1,.5)*i,Math.max(r,i)*sp(e.r1,0),n.x1+sp(e.x2,.5)*r,n.y1+sp(e.y2,.5)*i,Math.max(r,i)*sp(e.r2,.5));else{const a=sp(e.x1,0),s=sp(e.y1,0),u=sp(e.x2,1),c=sp(e.y2,0);if(a!==u&&s!==c&&r!==i){const n=Gu(Math.ceil(r),Math.ceil(i)),o=n.getContext("2d");return o.scale(r,i),o.fillStyle=up(o.createLinearGradient(a,s,u,c),e.stops),o.fillRect(0,0,r,i),t.createPattern(n,"no-repeat")}o=t.createLinearGradient(n.x1+a*r,n.y1+s*i,n.x1+u*r,n.y1+c*i)}return up(o,e.stops)}(t,n,e.bounds):n}function lp(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=cp(t,e,e.fill),!0)}var fp=[];function dp(t,e,n){var r=null!=(r=e.strokeWidth)?r:1;return!(r<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=cp(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||fp),t.lineDashOffset=e.strokeDashOffset||0),!0))}function hp(t,e){return t.zindex-e.zindex||t.index-e.index}function pp(t){if(!t.zdirty)return t.zitems;var e,n,r,i=t.items,o=[];for(n=0,r=i.length;n<r;++n)(e=i[n]).index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(hp)}function mp(t,e){var n,r,i=t.items;if(!i||!i.length)return;const o=pp(t);if(o&&o.length){for(n=0,r=i.length;n<r;++n)i[n].zindex||e(i[n]);i=o}for(n=0,r=i.length;n<r;++n)e(i[n])}function gp(t,e){var n,r,i=t.items;if(!i||!i.length)return null;const o=pp(t);for(o&&o.length&&(i=o),r=i.length;--r>=0;)if(n=e(i[r]))return n;if(i===o)for(r=(i=t.items).length;--r>=0;)if(!i[r].zindex&&(n=e(i[r])))return n;return null}function vp(t){return function(e,n,r){mp(n,(n=>{r&&!r.intersects(n.bounds)||bp(t,e,n,n)}))}}function yp(t){return function(e,n,r){!n.items.length||r&&!r.intersects(n.bounds)||bp(t,e,n.items[0],n.items)}}function bp(t,e,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(t(e,r)||(ap(e,n),n.fill&&lp(e,n,i)&&e.fill(),n.stroke&&dp(e,n,i)&&e.stroke()))}function xp(t){return t=t||m.yb,function(e,n,r,i,o,a){return r*=e.pixelRatio,i*=e.pixelRatio,gp(n,(n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return t(e,n,r,i,o,a)?n:void 0}))}}function Ap(t,e){return function(n,r,i,o){var a,s,u=Array.isArray(r)?r[0]:r,c=null==e?u.fill:e,l=u.stroke&&n.isPointInStroke;return l&&(a=u.strokeWidth,s=u.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!t(n,r)&&(c&&n.isPointInPath(i,o)||l&&n.isPointInStroke(i,o))}}function _p(t){return xp(Ap(t))}function wp(t,e){return"translate("+t+","+e+")"}function Ep(t){return"rotate("+t+")"}function Dp(t){return wp(t.x||0,t.y||0)}function Fp(t,e,n){function r(t,n){var r=n.x||0,i=n.y||0,o=n.angle||0;t.translate(r,i),o&&t.rotate(o*=Pd),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-r,-i)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",function(t){return wp(t.x||0,t.y||0)+(t.angle?" "+Ep(t.angle):"")}(n)),t("d",e(null,n))},bound:function(t,n){return e($h(t,n.angle),n),Mh(t,n).translate(n.x||0,n.y||0)},draw:vp(r),pick:_p(r),isect:n||ep(r)}}var Cp=Fp("arc",(function(t,e){return dh.context(t)(e)}));function kp(t,e,n){function r(t,n){t.beginPath(),e(t,n)}const i=Ap(r);return{type:t,tag:"path",nested:!0,attr:function(t,n){var r=n.mark.items;r.length&&t("d",e(null,r))},bound:function(t,n){var r=n.items;return 0===r.length?t:(e($h(t),r),Mh(t,r[0]))},draw:yp(r),pick:function(t,e,n,r,o,a){var s=e.items,u=e.bounds;return!s||!s.length||u&&!u.contains(o,a)?null:(n*=t.pixelRatio,r*=t.pixelRatio,i(t,s,n,r)?s[0]:null)},isect:np,tip:n}}var Sp=kp("area",(function(t,e){const n=e[0],r=n.interpolate||"linear";return("horizontal"===n.orient?ph:hh).curve(Md(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i="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&&(r=Math.abs(t[a][o]-i))<s&&(s=r,n=t[a]);return n}));function Mp(t,e){t.beginPath(),bh(e)?xh(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}function Bp(t){const e=sp(t.strokeWidth,1);return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function Op(t,e){const n=Bp(e);t("d",xh(null,e,n,n))}function Np(t,e,n,r){const i=Bp(e);t.beginPath(),xh(t,e,(n||0)+i,(r||0)+i)}const Tp=Ap(Np),zp=Ap(Np,!1),Rp=Ap(Np,!0);var Pp={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",Dp(e))},bound:function(t,e){if(!e.clip&&e.items){const n=e.items,r=n.length;for(let e=0;e<r;++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),Mh(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){mp(e,(e=>{const r=e.x||0,i=e.y||0,o=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(Np(t,e,r,i),ap(t,e),e.fill&&lp(t,e,a)&&t.fill(),e.stroke&&!o&&dp(t,e,a)&&t.stroke()),t.save(),t.translate(r,i),e.clip&&Mp(t,e),n&&n.translate(-r,-i),mp(e,(e=>{this.draw(t,e,n)})),n&&n.translate(r,i),t.restore(),o&&e.stroke&&a&&(Np(t,e,r,i),ap(t,e),dp(t,e,a)&&t.stroke())}))},pick:function(t,e,n,r,i,o){if(e.bounds&&!e.bounds.contains(i,o)||!e.items)return null;const a=n*t.pixelRatio,s=r*t.pixelRatio;return gp(e,(u=>{let c,l,f;const d=u.bounds;if(d&&!d.contains(i,o))return;l=u.x||0,f=u.y||0;const h=l+(u.width||0),p=f+(u.height||0),m=u.clip;if(m&&(i<l||i>h||o<f||o>p))return;if(t.save(),t.translate(l,f),l=i-l,f=o-f,m&&bh(u)&&!Rp(t,u,a,s))return t.restore(),null;const g=u.strokeForeground,v=!1!==e.interactive;return v&&g&&u.stroke&&zp(t,u,a,s)?(t.restore(),u):(c=gp(u,(t=>function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,l,f)?this.pick(t,n,r,l,f):null)),!c&&v&&(u.fill||!g&&u.stroke)&&Tp(t,u,a,s)&&(c=u),t.restore(),c||null)}))},isect:rp,content:function(t,e,n){t("clip-path",e.clip?wh(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),Op(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?Op(t,e):t("d","")}},Lp={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function jp(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 Up(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 Ip(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 qp(t,e){return"center"===t?e/2:"right"===t?e:0}function Wp(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var Hp={type:"image",tag:"image",nested:!1,attr:function(t,e,n){const r=jp(e,n),i=Up(e,r),o=Ip(e,r),a=(e.x||0)-qp(e.align,i),s=(e.y||0)-Wp(e.baseline,o);t("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",Lp["xmlns:xlink"],"xlink:href"),t("transform",wp(a,s)),t("width",i),t("height",o),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){const n=e.image,r=Up(e,n),i=Ip(e,n),o=(e.x||0)-qp(e.align,r),a=(e.y||0)-Wp(e.baseline,i);return t.set(o,a,o+r,a+i)},draw:function(t,e,n){mp(e,(e=>{if(n&&!n.intersects(e.bounds))return;const r=jp(e,this);let i=Up(e,r),o=Ip(e,r);if(0===i||0===o)return;let a,s,u,c,l=(e.x||0)-qp(e.align,i),f=(e.y||0)-Wp(e.baseline,o);!1!==e.aspect&&(s=r.width/r.height,u=e.width/e.height,s===s&&u===u&&s!==u&&(u<s?(c=i/s,f+=(o-c)/2,o=c):(c=o*s,l+=(i-c)/2,i=c))),(r.complete||r.toDataURL)&&(ap(t,e),t.globalAlpha=null!=(a=e.opacity)?a:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(r,l,f,i,o))}))},pick:xp(),isect:m.yb,get:jp,xOffset:qp,yOffset:Wp},Xp=kp("line",(function(t,e){const n=e[0],r=n.interpolate||"linear";return mh.curve(Md(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i=Math.pow(t[0].strokeWidth||1,2),o=t.length;--o>=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(r=t[o].y-e[1])*r<i)return t[o];return null}));function Gp(t,e){var n=e.path;if(null==n)return!0;var r=e.x||0,i=e.y||0,o=e.scaleX||1,a=e.scaleY||1,s=(e.angle||0)*Pd,u=e.pathCache;u&&u.path===n||((e.pathCache=u=Rd(n)).path=n),s&&t.rotate&&t.translate?(t.translate(r,i),t.rotate(s),Jd(t,u,0,0,o,a),t.rotate(-s),t.translate(-r,-i)):Jd(t,u,r,i,o,a)}var Jp={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,r=e.scaleY||1;1===n&&1===r||t("vector-effect","non-scaling-stroke"),t("transform",function(t){return wp(t.x||0,t.y||0)+(t.angle?" "+Ep(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 Gp($h(t,e.angle),e)?t.set(0,0,0,0):Mh(t,e,!0)},draw:vp(Gp),pick:_p(Gp),isect:ep(Gp)};function $p(t,e){t.beginPath(),xh(t,e)}var Vp={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",xh(null,e))},bound:function(t,e){var n,r;return Mh(t.set(n=e.x||0,r=e.y||0,n+e.width||0,r+e.height||0),e)},draw:vp($p),pick:_p($p),isect:rp};function Yp(t,e,n){var r,i,o,a;return!(!e.stroke||!dp(t,e,n))&&(r=e.x||0,i=e.y||0,o=null!=e.x2?e.x2:r,a=null!=e.y2?e.y2:i,t.beginPath(),t.moveTo(r,i),t.lineTo(o,a),!0)}var Kp={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",Dp(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,r;return Mh(t.set(n=e.x||0,r=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:r),e)},draw:function(t,e,n){mp(e,(e=>{if(!n||n.intersects(e.bounds)){var r=null==e.opacity?1:e.opacity;r&&Yp(t,e,r)&&(ap(t,e),t.stroke())}}))},pick:xp((function(t,e,n,r){return!!t.isPointInStroke&&(Yp(t,e,1)&&t.isPointInStroke(n,r))})),isect:ip},Zp=Fp("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),Qp=Fp("symbol",(function(t,e){return vh.context(t)(e)}),np);const tm=(0,m.$m)();var em={height:sm,measureWidth:om,estimateWidth:rm,width:rm,canvas:nm};function nm(t){em.width=t&&Qh?om:rm}function rm(t,e){return im(fm(t,e),sm(t))}function im(t,e){return~~(.8*t.length*e)}function om(t,e){return sm(t)<=0||!(e=fm(t,e))?0:am(e,hm(t))}function am(t,e){const n="(".concat(e,") ").concat(t);let r=tm.get(n);return void 0===r&&(Qh.font=e,r=Qh.measureText(t).width,tm.set(n,r)),r}function sm(t){return null!=t.fontSize?+t.fontSize||0:11}function um(t){return null!=t.lineHeight?t.lineHeight:sm(t)+2}function cm(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 lm(t){const e=cm(t);return((0,m.kJ)(e)?e.length-1:0)*um(t)}function fm(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,r=function(t){if(em.width===om){const e=hm(t);return t=>am(t,e)}{const e=sm(t);return t=>im(t,e)}}(t);if(r(e)<n)return e;var i,o=t.ellipsis||"\u2026",a="rtl"===t.dir,s=0,u=e.length;if(n-=r(o),a){for(;s<u;)i=s+u>>>1,r(e.slice(i))>n?s=i+1:u=i;return o+e.slice(s)}for(;s<u;)i=1+(s+u>>>1),r(e.slice(0,i))<n?s=i:u=i-1;return e.slice(0,s)+o}(t,n):n}function dm(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function hm(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+sm(t)+"px "+dm(t,e)}function pm(t){var e=t.baseline,n=sm(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*um(t):"line-bottom"===e?.29*n-.5*um(t):0)}nm(!0);const mm={left:"start",center:"middle",right:"end"},gm=new Eh;function vm(t){var e,n=t.x||0,r=t.y||0,i=t.radius||0;return i&&(e=(t.theta||0)-Ld,n+=i*Math.cos(e),r+=i*Math.sin(e)),gm.x1=n,gm.y1=r,gm}function ym(t,e,n){var r,i=em.height(e),o=e.align,a=vm(e),s=a.x1,u=a.y1,c=e.dx||0,l=(e.dy||0)+pm(e)-Math.round(.8*i),f=cm(e);if((0,m.kJ)(f)?(i+=um(e)*(f.length-1),r=f.reduce(((t,n)=>Math.max(t,em.width(e,n))),0)):r=em.width(e,f),"center"===o?c-=r/2:"right"===o&&(c-=r),t.set(c+=s,l+=u,c+r,l+i),e.angle&&!n)t.rotate(e.angle*Pd,s,u);else if(2===n)return t.rotatedPoints(e.angle*Pd,s,u);return t}var bm={type:"text",tag:"text",nested:!1,attr:function(t,e){var n,r=e.dx||0,i=(e.dy||0)+pm(e),o=vm(e),a=o.x1,s=o.y1,u=e.angle||0;t("text-anchor",mm[e.align]||"start"),u?(n=wp(a,s)+" "+Ep(u),(r||i)&&(n+=" "+wp(r,i))):n=wp(a+r,s+i),t("transform",n)},bound:ym,draw:function(t,e,n){mp(e,(e=>{var r,i,o,a,s,u,c,l=null==e.opacity?1:e.opacity;if(!(n&&!n.intersects(e.bounds)||0===l||e.fontSize<=0||null==e.text||0===e.text.length)){if(t.font=hm(e),t.textAlign=e.align||"left",i=(r=vm(e)).x1,o=r.y1,e.angle&&(t.save(),t.translate(i,o),t.rotate(e.angle*Pd),i=o=0),i+=e.dx||0,o+=(e.dy||0)+pm(e),u=cm(e),ap(t,e),(0,m.kJ)(u))for(s=um(e),a=0;a<u.length;++a)c=fm(e,u[a]),e.fill&&lp(t,e,l)&&t.fillText(c,i,o),e.stroke&&dp(t,e,l)&&t.strokeText(c,i,o),o+=s;else c=fm(e,u),e.fill&&lp(t,e,l)&&t.fillText(c,i,o),e.stroke&&dp(t,e,l)&&t.strokeText(c,i,o);e.angle&&t.restore()}}))},pick:xp((function(t,e,n,r,i,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var a=vm(e),s=a.x1,u=a.y1,c=ym(gm,e,1),l=-e.angle*Pd,f=Math.cos(l),d=Math.sin(l),h=f*i-d*o+(s-f*s+d*u),p=d*i+f*o+(u-d*s-f*u);return c.contains(h,p)})),isect:function(t,e){const n=ym(gm,t,2);return op(e,n[0],n[1],n[2],n[3])||op(e,n[0],n[1],n[4],n[5])||op(e,n[4],n[5],n[6],n[7])||op(e,n[2],n[3],n[6],n[7])}},xm=kp("trail",(function(t,e){return yh.context(t)(e)}),(function(t,e){for(var n,r,i=t.length;--i>=0;)if(!1!==t[i].defined&&(n=t[i].x-e[0])*n+(r=t[i].y-e[1])*r<(n=t[i].size||1)*n)return t[i];return null})),Am={arc:Cp,area:Sp,group:Pp,image:Hp,line:Xp,path:Jp,rect:Vp,rule:Kp,shape:Zp,symbol:Qp,text:bm,trail:xm};function _m(t,e,n){var r=Am[t.mark.marktype],i=e||r.bound;return r.nested&&(t=t.mark),i(t.bounds||(t.bounds=new Eh),t,n)}var wm={mark:null};function Em(t,e,n){var r,i,o,a,s=Am[t.marktype],u=s.bound,c=t.items,l=c&&c.length;if(s.nested)return l?o=c[0]:(wm.mark=t,o=wm),a=_m(o,u,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new Eh,l)for(r=0,i=c.length;r<i;++r)e.union(_m(c[r],u,n));return t.bounds=e}const Dm=["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 Fm(t,e){return JSON.stringify(t,Dm,e)}function Cm(t){return km("string"===typeof t?JSON.parse(t):t)}function km(t){var e,n,r,i=t.marktype,o=t.items;if(o)for(n=0,r=o.length;n<r;++n)e=i?"mark":"group",o[n][e]=t,o[n].zindex&&(o[n][e].zdirty=!0),"group"===(i||e)&&km(o[n]);return i&&Em(t),t}function Sm(t){arguments.length?this.root=Cm(t):(this.root=Mm({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Fh(this.root)])}function Mm(t,e){const n={bounds:new Eh,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 Bm(t,e,n){return!t&&"undefined"!==typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function Om(t,e){e=e.toLowerCase();for(var n=t.childNodes,r=0,i=n.length;r<i;++r)if(n[r].tagName.toLowerCase()===e)return n[r]}function Nm(t,e,n,r){var i,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(i=o||null,o=Bm(t.ownerDocument,n,r),t.insertBefore(o,i)),o}function Tm(t,e){for(var n=t.childNodes,r=n.length;r>e;)t.removeChild(n[--r]);return t}function zm(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function Rm(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function Pm(t,e){this._active=null,this._handlers={},this._loader=t||vi(),this._tooltip=e||Lm}function Lm(t,e,n,r){t.element().setAttribute("title",r||"")}function jm(t){this._el=null,this._bgcolor=null,this._loader=new Ch(t)}Sm.prototype={toJSON(t){return Fm(this.root,t||0)},mark(t,e,n){const r=Mm(t,e=e||this.root.items[0]);return e.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}},Pm.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 r=t?t.length:0;--r>=0;)if(t[r].type===e&&(!n||t[r].handler===n))return r;return-1},handlers(t){const e=this._handlers,n=[];if(t)n.push(...e[this.eventName(t)]);else for(const r in e)n.push(...e[r]);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),r=Bm(null,"a");for(const t in e)r.setAttribute(t,e[t]);r.dispatchEvent(n)})).catch((()=>{}))},handleTooltip(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,r){var i,o,a=t&&t.mark;if(a&&(i=Am[a.marktype]).tip){for((o=Rm(e,n))[0]-=r[0],o[1]-=r[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=i.tip(a.items,o)}return t}(e,t,this.canvas(),this._origin);const r=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,r)}},getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),r=this._origin,i=t.bounds,o=i.width(),a=i.height();let s=i.x1+r[0]+n.left,u=i.y1+r[1]+n.top;for(;t.mark&&(t=t.mark.group);)s+=t.x||0,u+=t.y||0;return{x:s,y:u,width:o,height:a,left:s,top:u,right:s+o,bottom:u+a}}},jm.prototype={initialize(t,e,n,r,i){return this._el=t,this.resize(e,n,r,i)},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,r){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=r||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,r=n._loader[t](e);if(!n._ready){const t=n._call;n._ready=n._loader.ready().then((e=>{e&&t(),n._ready=null}))}return r},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const Um="dragenter",Im="dragleave",qm="dragover",Wm="mousedown",Hm="mousemove",Xm="mouseout",Gm="mouseover",Jm="click",$m="mousewheel",Vm="touchstart",Ym="touchmove",Km="touchend",Zm=["keydown","keypress","keyup",Um,Im,qm,Wm,"mouseup",Hm,Xm,Gm,Jm,"dblclick","wheel",$m,Vm,Ym,Km],Qm=Hm,tg=Xm,eg=Jm;function ng(t,e){Pm.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}function rg(t,e){(t=>t===Vm||t===Ym||t===Km?[Vm,Ym,Km]:[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 ig(t,e,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||this.fire(n,r),this._active=o,this.fire(e,r)),this.fire(t,r)}}function og(t){return function(e){this.fire(t,e),this._active=null}}(0,m.XW)(ng,Pm,{initialize(t,e,n){return this._canvas=t&&Om(t,"canvas"),[Jm,Wm,Hm,Xm,Im].forEach((t=>rg(this,t))),Pm.prototype.initialize.call(this,t,e,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:Zm,DOMMouseScroll(t){this.fire($m,t)},mousemove:ig(Hm,Gm,Xm),dragover:ig(qm,Um,Im),mouseout:og(Xm),dragleave:og(Im),mousedown(t){this._down=this._active,this.fire(Wm,t)},click(t){this._down===this._active&&(this.fire(Jm,t),this._down=null)},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Vm,t,!0)},touchmove(t){this.fire(Ym,t,!0)},touchend(t){this.fire(Km,t,!0),this._touch=null},fire(t,e,n){const r=n?this._touch:this._active,i=this._handlers[t];if(e.vegaType=t,t===eg&&r&&r.href?this.handleHref(e,r,r.href):t!==Qm&&t!==tg||this.handleTooltip(e,r,t!==tg),i)for(let o=0,a=i.length;o<a;++o)i[o].handler.call(this._obj,e,r)},on(t,e){const n=this.eventName(t),r=this._handlers;return this._handlerIndex(r[n],t,e)<0&&(rg(this,t),(r[n]||(r[n]=[])).push({type:t,handler:e})),this},off(t,e){const n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&r.splice(i,1),this},pickEvent(t){const e=Rm(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,r,i){const o=this.context();return Am[t.marktype].pick.call(this,o,t,e,n,r,i)}});var ag="undefined"!==typeof window&&window.devicePixelRatio||1;function sg(t){jm.call(this,t),this._options={},this._redraw=!1,this._dirty=new Eh,this._tempb=new Eh}const ug=jm.prototype;function cg(t,e){Pm.call(this,t,e);const n=this;n._hrefHandler=lg(n,((t,e)=>{e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=lg(n,((t,e)=>{n.handleTooltip(t,e,t.type!==tg)}))}(0,m.XW)(sg,jm,{initialize(t,e,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Gu(1,1,this._options.type),t&&this._canvas&&(Tm(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),ug.initialize.call(this,t,e,n,r,i)},resize(t,e,n,r){if(ug.resize.call(this,t,e,n,r),this._canvas)!function(t,e,n,r,i,o){const a="undefined"!==typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,s=t.getContext("2d"),u=a?ag:i;t.width=e*u,t.height=n*u;for(const c in o)s[c]=o[c];a&&1!==u&&(t.style.width=e+"px",t.style.height=n+"px"),s.pixelRatio=u,s.setTransform(u,0,0,u,u*r[0],u*r[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,r=this._width,i=this._height,o=this._dirty,a=((t,e,n)=>(new Eh).set(0,0,e,n).translate(-t[0],-t[1]))(n,r,i);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],r,i),this.draw(e,t,s),e.restore(),o.clear(),this},draw(t,e,n){const r=Am[e.marktype];e.clip&&function(t,e){var n=e.clip;t.save(),(0,m.mf)(n)?(t.beginPath(),n(t),t.clip()):Mp(t,e.group)}(t,e),r.draw.call(this,t,e,n),e.clip&&t.restore()},clear(t,e,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(t,e,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(t,e,n,r))}});const lg=(t,e)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,e.call(t._obj,n,r)};(0,m.XW)(cg,Pm,{initialize(t,e,n){let r=this._svg;return r&&(r.removeEventListener(eg,this._hrefHandler),r.removeEventListener(Qm,this._tooltipHandler),r.removeEventListener(tg,this._tooltipHandler)),this._svg=r=t&&Om(t,"svg"),r&&(r.addEventListener(eg,this._hrefHandler),r.addEventListener(Qm,this._tooltipHandler),r.addEventListener(tg,this._tooltipHandler)),Pm.prototype.initialize.call(this,t,e,n)},canvas(){return this._svg},on(t,e){const n=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[n],t,e)<0){const i={type:t,handler:e,listener:lg(this,e)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},off(t,e){const n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});const fg="aria-hidden",dg="aria-label",hg="role",pg="aria-roledescription",mg="graphics-object",gg="graphics-symbol",vg=(t,e,n)=>({[hg]:t,[pg]:e,[dg]:n||void 0}),yg=(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"]),bg={axis:{desc:"axis",caption:function(t){const e=t.datum,n=t.orient,r=e.title?Eg(t):null,i=t.context,o=i.scales[e.scale].value,a=i.dataflow.locale(),s=o.type;return"".concat("left"===n||"right"===n?"Y":"X","-axis")+(r?" titled '".concat(r,"'"):"")+" for a ".concat(Uf(s)?"discrete":s," scale")+" with ".concat(_d(a,o,t))}},legend:{desc:"legend",caption:function(t){const e=t.datum,n=e.title?Eg(t):null,r="".concat(e.type||""," legend").trim(),i=e.scales,o=Object.keys(i),a=t.context,s=a.scales[i[o[0]]].value,u=a.dataflow.locale();return function(t){return t.length?t[0].toUpperCase()+t.slice(1):t}(r)+(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(_d(u,s,t))}},"title-text":{desc:"title",caption:t=>"Title text '".concat(wg(t),"'")},"title-subtitle":{desc:"subtitle",caption:t=>"Subtitle text '".concat(wg(t),"'")}},xg={ariaRole:hg,ariaRoleDescription:pg,description:dg};function Ag(t,e){const n=!1===e.aria;if(t(fg,n||void 0),n||null==e.description)for(const r in xg)t(xg[r],void 0);else{const n=e.mark.marktype;t(dg,e.description),t(hg,e.ariaRole||("group"===n?mg:gg)),t(pg,e.ariaRoleDescription||"".concat(n," mark"))}}function _g(t){return!1===t.aria?{[fg]:!0}:yg[t.role]?null:bg[t.role]?function(t,e){try{const n=t.items[0],r=e.caption||(()=>"");return vg(e.role||gg,e.desc,n.description||r(n))}catch(n){return null}}(t,bg[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some((t=>null!=t.description&&!1!==t.aria));return vg(n?mg:gg,"".concat(e," mark container"),t.description)}(t)}function wg(t){return(0,m.IX)(t.text).join(" ")}function Eg(t){try{return(0,m.IX)((0,m.fj)(t.items).items[0].text).join(" ")}catch(e){return null}}const Dg=t=>(t+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),Fg=t=>Dg(t).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
");function Cg(){let t="",e="",n="";const r=[],i=()=>e=n="",o=(t,n)=>(null!=n&&(e+=" ".concat(t,'="').concat(Fg(n),'"')),a),a={open(s){(o=>{e&&(t+="".concat(e,">").concat(n),i()),r.push(o)})(s),e="<"+s;for(var u=arguments.length,c=new Array(u>1?u-1:0),l=1;l<u;l++)c[l-1]=arguments[l];for(const t of c)for(const e in t)o(e,t[e]);return a},close(){const o=r.pop();return t+=e?e+(n?">".concat(n,"</").concat(o,">"):"/>"):"</".concat(o,">"),i(),a},attr:o,text:t=>(n+=Dg(t),a),toString:()=>t};return a}const kg=t=>Sg(Cg(),t)+"";function Sg(t,e){if(t.open(e.tagName),e.hasAttributes()){const n=e.attributes,r=n.length;for(let e=0;e<r;++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):Sg(t,e)}return t.close()}const Mg={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"},Bg={blend:"mix-blend-mode"},Og={fill:"none","stroke-miterlimit":10},Ng="http://www.w3.org/2000/xmlns/",Tg=Lp.xmlns;function zg(t){jm.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const Rg=jm.prototype;function Pg(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 Lg(t,e,n){let r,i,o;if("radial"===e.gradient){let r=Nm(t,n++,"pattern",Tg);Gg(r,{id:Ed+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),r=Nm(r,0,"rect",Tg),Gg(r,{width:1,height:1,fill:"url(".concat($g(),"#").concat(e.id,")")}),Gg(t=Nm(t,n++,"radialGradient",Tg),{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else Gg(t=Nm(t,n++,"linearGradient",Tg),{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(r=0,i=e.stops.length;r<i;++r)o=Nm(t,r,"stop",Tg),o.setAttribute("offset",e.stops[r].offset),o.setAttribute("stop-color",e.stops[r].color);return Tm(t,r),n}function jg(t,e,n){let r;return(t=Nm(t,n,"clipPath",Tg)).setAttribute("id",e.id),e.path?(r=Nm(t,0,"path",Tg),r.setAttribute("d",e.path)):(r=Nm(t,0,"rect",Tg),Gg(r,{x:0,y:0,width:e.width,height:e.height})),Tm(t,1),n+1}function Ug(t,e,n,r,i){let o,a=t._svg;if(!a&&(o=e.ownerDocument,a=Bm(o,r,Tg),t._svg=a,t.mark&&(a.__data__=t,a.__values__={fill:"default"},"g"===r))){const e=Bm(o,"path",Tg);a.appendChild(e),e.__data__=t;const n=Bm(o,"g",Tg);a.appendChild(n),n.__data__=t;const r=Bm(o,"path",Tg);a.appendChild(r),r.__data__=t,r.__values__={fill:"default"}}return(a.ownerSVGElement!==i||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)(zg,jm,{initialize(t,e,n,r,i){return this._defs={},this._clearDefs(),t&&(this._svg=Nm(t,0,"svg",Tg),this._svg.setAttributeNS(Ng,"xmlns",Tg),this._svg.setAttributeNS(Ng,"xmlns:xlink",Lp["xmlns:xlink"]),this._svg.setAttribute("version",Lp.version),this._svg.setAttribute("class","marks"),Tm(t,1),this._root=Nm(this._svg,0,"g",Tg),Gg(this._root,Og),Tm(this._svg,1)),this.background(this._bgcolor),Rg.initialize.call(this,t,e,n,r,i)},background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),Rg.background.apply(this,arguments)},resize(t,e,n,r){return Rg.resize.call(this,t,e,n,r),this._svg&&(Gg(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=Nm(t,0,"rect",Tg),Gg(n,{width:this._width,height:this._height,fill:e}));const r=kg(t);return e&&(t.removeChild(n),this._svg.style.setProperty("background-color",e)),r},_render(t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t),Tm(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,r,i,o,a,s,u;for(a=0,s=t.length;a<s;++a)n=t[a],r=n.mark,r.marktype!==i&&(i=r.marktype,o=Am[i]),r.zdirty&&r.dirty!==e&&(this._dirtyAll=!1,Pg(n,e),r.items.forEach((t=>{t.dirty=e}))),r.zdirty||(n.exit?(o.nested&&r.items.length?(u=r.items[0],u._svg&&this._update(o,u._svg,u)):n._svg&&(u=n._svg.parentNode,u&&u.removeChild(n._svg)),n._svg=null):(n=o.nested?r.items[0]:n,n._update!==e&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,Pg(n,e)),n._update=e)));return!this._dirtyAll},mark(t,e,n){if(!this.isDirty(e))return e._svg;const r=this._svg,i=Am[e.marktype],o=!1===e.interactive?"none":null,a="g"===i.tag,s=Ug(e,t,n,"g",r);s.setAttribute("class",zm(e));const u=_g(e);for(const d in u)Jg(s,d,u[d]);a||Jg(s,"pointer-events",o),Jg(s,"clip-path",e.clip?wh(this,e,e.group):null);let c=null,l=0;const f=t=>{const e=this.isDirty(t),n=Ug(t,s,c,i.tag,r);e&&(this._update(i,n,t),a&&function(t,e,n){e=e.lastChild.previousSibling;let r,i=0;mp(n,(n=>{r=t.mark(e,n,r),++i})),Tm(e,1+i)}(this,n,t)),c=n,++l};return i.nested?e.items.length&&f(e.items[0]):mp(e,f),Tm(s,l),s},_update(t,e,n){Ig=e,qg=e.__values__,Ag(Hg,n),t.attr(Hg,n,this);const r=Wg[t.type];r&&r.call(this,t,e,n),Ig&&this.style(Ig,n)},style(t,e){if(null!=e){for(const n in Mg){let r="font"===n?dm(e):e[n];if(r===qg[n])continue;const i=Mg[n];null==r?t.removeAttribute(i):(Dd(r)&&(r=Fd(r,this._defs.gradient,$g())),t.setAttribute(i,r+"")),qg[n]=r}for(const n in Bg)Xg(t,Bg[n],e[n])}},defs(){const t=this._svg,e=this._defs;let n=e.el,r=0;for(const i in e.gradient)n||(e.el=n=Nm(t,1,"defs",Tg)),r=Lg(n,e.gradient[i],r);for(const i in e.clipping)n||(e.el=n=Nm(t,1,"defs",Tg)),r=jg(n,e.clipping[i],r);n&&(0===r?(t.removeChild(n),e.el=null):Tm(n,r))},_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}});let Ig=null,qg=null;const Wg={group(t,e,n){const r=Ig=e.childNodes[2];qg=r.__values__,t.foreground(Hg,n,this),qg=e.__values__,Ig=e.childNodes[1],t.content(Hg,n,this);const i=Ig=e.childNodes[0];t.background(Hg,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==qg.events&&(Jg(r,"pointer-events",o),Jg(i,"pointer-events",o),qg.events=o),n.strokeForeground&&n.stroke){const t=n.fill;Jg(r,"display",null),this.style(i,n),Jg(i,"stroke",null),t&&(n.fill=null),qg=r.__values__,this.style(r,n),t&&(n.fill=t),Ig=null}else Jg(r,"display","none")},image(t,e,n){!1===n.smooth?(Xg(e,"image-rendering","optimizeSpeed"),Xg(e,"image-rendering","pixelated")):Xg(e,"image-rendering",null)},text(t,e,n){const r=cm(n);let i,o,a,s;(0,m.kJ)(r)?(o=r.map((t=>fm(n,t))),i=o.join("\n"),i!==qg.text&&(Tm(e,0),a=e.ownerDocument,s=um(n),o.forEach(((t,r)=>{const i=Bm(a,"tspan",Tg);i.__data__=n,i.textContent=t,r&&(i.setAttribute("x",0),i.setAttribute("dy",s)),e.appendChild(i)})),qg.text=i)):(o=fm(n,r),o!==qg.text&&(e.textContent=o,qg.text=o)),Jg(e,"font-family",dm(n)),Jg(e,"font-size",sm(n)+"px"),Jg(e,"font-style",n.fontStyle),Jg(e,"font-variant",n.fontVariant),Jg(e,"font-weight",n.fontWeight)}};function Hg(t,e,n){e!==qg[t]&&(n?function(t,e,n,r){null!=n?t.setAttributeNS(r,e,n):t.removeAttributeNS(r,e)}(Ig,t,e,n):Jg(Ig,t,e),qg[t]=e)}function Xg(t,e,n){n!==qg[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),qg[e]=n)}function Gg(t,e){for(const n in e)Jg(t,n,e[n])}function Jg(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function $g(){let t;return"undefined"===typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function Vg(t){jm.call(this,t),this._text=null,this._defs={gradient:{},clipping:{}}}(0,m.XW)(Vg,jm,{svg(){return this._text},_render(t){const e=Cg();e.open("svg",(0,m.l7)({},Lp,{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",Og,{transform:"translate("+this._origin+")"}),this.mark(e,t),e.close(),this.defs(e),this._text=e.close()+"",this},mark(t,e){const n=Am[e.marktype],r=n.tag,i=[Ag,n.attr];t.open("g",{class:zm(e),"clip-path":e.clip?wh(this,e,e.group):null},_g(e),{"pointer-events":"g"!==r&&!1===e.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&t.open("a",a),t.open(r,this.attr(e,o,i,"g"!==r?r:null)),"text"===r){const e=cm(o);if((0,m.kJ)(e)){const n={x:0,dy:um(o)};for(let r=0;r<e.length;++r)t.open("tspan",r?n:null).text(fm(o,e[r])).close()}else t.text(fm(o,e))}else if("g"===r){const r=o.strokeForeground,i=o.fill,a=o.stroke;r&&a&&(o.stroke=null),t.open("path",this.attr(e,o,n.background,"bgrect")).close(),t.open("g",this.attr(e,o,n.content)),mp(o,(e=>this.mark(t,e))),t.close(),r&&a?(i&&(o.fill=null),o.stroke=a,t.open("path",this.attr(e,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):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]):mp(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,r){const i={},o=(t,e,n,r)=>{i[r||t]=e};return Array.isArray(n)?n.forEach((t=>t(o,e,this))):n(o,e,this),r&&function(t,e,n,r,i){let o;if(null==e)return t;"bgrect"===r&&!1===n.interactive&&(t["pointer-events"]="none");if("bgfore"===r&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===r&&!1===e.smooth&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]);"text"===r&&(t["font-family"]=dm(e),t["font-size"]=sm(e)+"px",t["font-style"]=e.fontStyle,t["font-variant"]=e.fontVariant,t["font-weight"]=e.fontWeight);for(const a in Mg){let n=e[a];const r=Mg[a];("transparent"!==n||"fill"!==r&&"stroke"!==r)&&null!=n&&(Dd(n)&&(n=Fd(n,i.gradient,"")),t[r]=n)}for(const a in Bg){const t=e[a];null!=t&&(o=o||[],o.push("".concat(Bg[a],": ").concat(t,";")))}o&&(t.style=o.join(" "))}(i,e,t,r,this._defs),i},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 r=e[n],i=r.stops;"radial"===r.gradient?(t.open("pattern",{id:Ed+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:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):t.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let e=0;e<i.length;++e)t.open("stop",{offset:i[e].offset,"stop-color":i[e].color}).close();t.close()}for(const e in n){const r=n[e];t.open("clipPath",{id:e}),r.path?t.open("path",{d:r.path}).close():t.open("rect",{x:0,y:0,width:r.width,height:r.height}).close(),t.close()}t.close()}}});const Yg="canvas",Kg="none",Zg={Canvas:Yg,PNG:"png",SVG:"svg",None:Kg},Qg={};function tv(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(Qg[t]=e,this):Qg[t]}function ev(t,e,n){const r=[],i=(new Eh).union(e),o=t.marktype;return o?nv(t,i,n,r):"group"===o?rv(t,i,n,r):(0,m.vU)("Intersect scene must be mark node or group item.")}function nv(t,e,n,r){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 i=t.items,o=t.marktype,a=i.length;let s=0;if("group"===o)for(;s<a;++s)rv(i[s],e,n,r);else for(const t=Am[o].isect;s<a;++s){const n=i[s];iv(n,e,t)&&r.push(n)}}return r}function rv(t,e,n,r){n&&n(t.mark)&&iv(t,e,Am.group.isect)&&r.push(t);const i=t.items,o=i&&i.length;if(o){const a=t.x||0,s=t.y||0;e.translate(-a,-s);for(let t=0;t<o;++t)nv(i[t],e,n,r);e.translate(a,s)}return r}function iv(t,e,n){const r=t.bounds;return e.encloses(r)||e.intersects(r)&&n(t,e)}Qg[Yg]=Qg.png={renderer:sg,headless:sg,handler:ng},Qg.svg={renderer:zg,headless:Vg,handler:cg},Qg[Kg]={};const ov=new Eh;function av(t){const e=t.clip;if((0,m.mf)(e))e($h(ov.clear()));else{if(!e)return;ov.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(ov)}const sv=1e-9;function uv(t,e,n){return t===e||("path"===n?cv(t,e):t instanceof Date&&e instanceof Date?+t===+e:(0,m.hj)(t)&&(0,m.hj)(e)?Math.abs(t-e)<=sv:t&&e&&((0,m.Kn)(t)||(0,m.Kn)(e))?function(t,e){var n,r,i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(i.sort(),o.sort(),r=i.length-1;r>=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(!uv(t[n=i[r]],e[n],n))return!1;return typeof t===typeof e}(t,e):t==e)}function cv(t,e){return uv(Rd(t),Rd(e))}function lv(){_h(),wd=0}const fv="top",dv="left",hv="right",pv="bottom",mv="top-left",gv="top-right",vv="bottom-left",yv="bottom-right",bv="start",xv="middle",Av="end",_v="x",wv="y",Ev="group",Dv="axis",Fv="title",Cv="frame",kv="scope",Sv="legend",Mv="row-header",Bv="row-footer",Ov="row-title",Nv="column-header",Tv="column-footer",zv="column-title",Rv="padding",Pv="symbol",Lv="fit",jv="fit-x",Uv="fit-y",Iv="pad",qv="none",Wv="all",Hv="each",Xv="flush",Gv="column",Jv="row";function $v(t){no.call(this,null,t)}function Vv(t,e,n){return e(t.bounds.clear(),t,n)}(0,m.XW)($v,no,{transform(t,e){const n=e.dataflow,r=t.mark,i=r.marktype,o=Am[i],a=o.bound;let s,u=r.bounds;if(o.nested)r.items.length&&n.dirty(r.items[0]),u=Vv(r,a),r.items.forEach((t=>{t.bounds.clear().union(u)}));else if(i===Ev||t.modified())switch(e.visit(e.MOD,(t=>n.dirty(t))),u.clear(),r.items.forEach((t=>u.union(Vv(t,a)))),r.role){case Dv:case Sv:case Fv:e.reflow()}else s=e.changed(e.REM),e.visit(e.ADD,(t=>{u.union(Vv(t,a))})),e.visit(e.MOD,(t=>{s=s||u.alignsWith(t.bounds),n.dirty(t),u.union(Vv(t,a))})),s&&(u.clear(),r.items.forEach((t=>u.union(t.bounds))));return av(r),e.modifies("bounds")}});const Yv=":vega_identifier:";function Kv(t){no.call(this,0,t)}function Zv(t){no.call(this,null,t)}function Qv(t){no.call(this,null,t)}Kv.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},(0,m.XW)(Kv,no,{transform(t,e){const n=(i=e.dataflow)._signals[Yv]||(i._signals[Yv]=i.add(0)),r=t.as;var i;let o=n.value;return e.visit(e.ADD,(t=>t[r]=t[r]||++o)),n.set(this.value=o),e}}),(0,m.XW)(Zv,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 r=n.marktype===Ev?Fh:Dh;return e.visit(e.ADD,(t=>r.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 ty={parity:t=>t.filter(((t,e)=>e%2?t.opacity=0:1)),greedy:(t,e)=>{let n;return t.filter(((t,r)=>r&&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),ny=(t,e)=>{for(var n,r=1,i=t.length,o=t[0].bounds;r<i;o=n,++r)if(ey(o,n=t[r].bounds,e))return!0},ry=t=>{const e=t.bounds;return e.width()>1&&e.height()>1},iy=t=>(t.forEach((t=>t.opacity=1)),t),oy=(t,e)=>t.reflow(e.modified()).modifies("opacity");function ay(t){no.call(this,null,t)}(0,m.XW)(Qv,no,{transform(t,e){const n=ty[t.method]||ty.parity,r=t.separation||0;let i,o,a=e.materialize(e.SOURCE).source;if(!a||!a.length)return;if(!t.method)return t.modified("method")&&(iy(a),e=oy(e,t)),e;if(a=a.filter(ry),!a.length)return;if(t.sort&&(a=a.slice().sort(t.sort)),i=iy(a),e=oy(e,t),i.length>=3&&ny(i,r)){do{i=n(i,r)}while(i.length>=3&&ny(i,r));i.length<3&&!(0,m.fj)(a).opacity&&(i.length>1&&((0,m.fj)(i).opacity=0),(0,m.fj)(a).opacity=1)}t.boundScale&&t.boundTolerance>=0&&(o=((t,e,n)=>{var r=t.range(),i=new Eh;return e===fv||e===pv?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),t=>i.encloses(t.bounds)})(t.boundScale,t.boundOrient,+t.boundTolerance),a.forEach((t=>{o(t)||(t.opacity=0)})));const s=i[0].mark.bounds.clear();return a.forEach((t=>{t.opacity&&s.union(t.bounds)})),e}}),(0,m.XW)(ay,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 sy=new Eh;function uy(t,e,n){return t[e]===n?0:(t[e]=n,1)}function cy(t){var e=t.items[0].orient;return e===dv||e===hv}function ly(t,e,n,r){var i,o,a=e.items[0],s=a.datum,u=null!=a.translate?a.translate:.5,c=a.orient,l=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[l[2]].items[0],v=a.titlePadding,y=a.bounds,b=g&&lm(g),x=0,A=0;switch(sy.clear().union(y),y.clear(),(i=l[0])>-1&&y.union(a.items[i].bounds),(i=l[1])>-1&&y.union(a.items[i].bounds),c){case fv:x=h||0,A=-d,o=Math.max(p,Math.min(m,-y.y1)),y.add(0,-o).add(f,0),g&&fy(t,g,o,v,b,0,-1,y);break;case dv:x=-d,A=h||0,o=Math.max(p,Math.min(m,-y.x1)),y.add(-o,0).add(0,f),g&&fy(t,g,o,v,b,1,-1,y);break;case hv:x=n+d,A=h||0,o=Math.max(p,Math.min(m,y.x2)),y.add(0,0).add(o,f),g&&fy(t,g,o,v,b,1,1,y);break;case pv:x=h||0,A=r+d,o=Math.max(p,Math.min(m,y.y2)),y.add(0,0).add(f,o),g&&fy(t,g,o,v,0,0,1,y);break;default:x=a.x,A=a.y}return Mh(y.translate(x,A),a),uy(a,"x",x+u)|uy(a,"y",A+u)&&(a.bounds=sy,t.dirty(a),a.bounds=y,t.dirty(a)),a.mark.bounds.clear().union(y)}function fy(t,e,n,r,i,o,a,s){const u=e.bounds;if(e.auto){const s=a*(n+i+r);let c=0,l=0;t.dirty(e),o?c=(e.x||0)-(e.x=s):l=(e.y||0)-(e.y=s),e.mark.bounds.clear().union(u.translate(-c,-l)),t.dirty(e)}s.union(u)}const dy=(t,e)=>Math.floor(Math.min(t,e)),hy=(t,e)=>Math.ceil(Math.max(t,e));function py(t){return(new Eh).set(0,0,t.width||0,t.height||0)}function my(t){const e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function gy(t,e,n){const r=(0,m.Kn)(t)?t[e]:t;return null!=r?r:void 0!==n?n:0}function vy(t){return t<0?Math.ceil(-t):0}function yy(t,e,n){var r,i,o,a,s,u,c,l,f,d,h,p=!n.nodirty,m=n.bounds===Xv?py:my,g=sy.set(0,0,0,0),v=gy(n.align,Gv),y=gy(n.align,Jv),b=gy(n.padding,Gv),x=gy(n.padding,Jv),A=n.columns||e.length,_=A<=0?1:Math.ceil(e.length/A),w=e.length,E=Array(w),D=Array(A),F=0,C=Array(w),k=Array(_),S=0,M=Array(w),B=Array(w),O=Array(w);for(i=0;i<A;++i)D[i]=0;for(i=0;i<_;++i)k[i]=0;for(i=0;i<w;++i)u=e[i],s=O[i]=m(u),u.x=u.x||0,M[i]=0,u.y=u.y||0,B[i]=0,o=i%A,a=~~(i/A),F=Math.max(F,c=Math.ceil(s.x2)),S=Math.max(S,l=Math.ceil(s.y2)),D[o]=Math.max(D[o],c),k[a]=Math.max(k[a],l),E[i]=b+vy(s.x1),C[i]=x+vy(s.y1),p&&t.dirty(e[i]);for(i=0;i<w;++i)i%A===0&&(E[i]=0),i<A&&(C[i]=0);if(v===Hv)for(o=1;o<A;++o){for(h=0,i=o;i<w;i+=A)h<E[i]&&(h=E[i]);for(i=o;i<w;i+=A)E[i]=h+D[o-1]}else if(v===Wv){for(h=0,i=0;i<w;++i)i%A&&h<E[i]&&(h=E[i]);for(i=0;i<w;++i)i%A&&(E[i]=h+F)}else for(v=!1,o=1;o<A;++o)for(i=o;i<w;i+=A)E[i]+=D[o-1];if(y===Hv)for(a=1;a<_;++a){for(h=0,r=(i=a*A)+A;i<r;++i)h<C[i]&&(h=C[i]);for(i=a*A;i<r;++i)C[i]=h+k[a-1]}else if(y===Wv){for(h=0,i=A;i<w;++i)h<C[i]&&(h=C[i]);for(i=A;i<w;++i)C[i]=h+S}else for(y=!1,a=1;a<_;++a)for(r=(i=a*A)+A;i<r;++i)C[i]+=k[a-1];for(f=0,i=0;i<w;++i)f=E[i]+(i%A?f:0),M[i]+=f-e[i].x;for(o=0;o<A;++o)for(d=0,i=o;i<w;i+=A)d+=C[i],B[i]+=d-e[i].y;if(v&&gy(n.center,Gv)&&_>1)for(i=0;i<w;++i)(f=(s=v===Wv?F:D[i%A])-O[i].x2-e[i].x-M[i])>0&&(M[i]+=f/2);if(y&&gy(n.center,Jv)&&1!==A)for(i=0;i<w;++i)(d=(s=y===Wv?S:k[~~(i/A)])-O[i].y2-e[i].y-B[i])>0&&(B[i]+=d/2);for(i=0;i<w;++i)g.union(O[i].translate(M[i],B[i]));switch(f=gy(n.anchor,_v),d=gy(n.anchor,wv),gy(n.anchor,Gv)){case Av:f-=g.width();break;case xv:f-=g.width()/2}switch(gy(n.anchor,Jv)){case Av:d-=g.height();break;case xv:d-=g.height()/2}for(f=Math.round(f),d=Math.round(d),g.clear(),i=0;i<w;++i)e[i].mark.bounds.clear();for(i=0;i<w;++i)(u=e[i]).x+=M[i]+=f,u.y+=B[i]+=d,g.union(u.mark.bounds.union(u.bounds.translate(M[i],B[i]))),p&&t.dirty(u);return g}function by(t,e,n){var r,i,o,a,s,u,c,l=function(t){var e,n,r=t.items,i=r.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o<i;++o)if(n=(e=r[o]).items,e.marktype===Ev)switch(e.role){case Dv:case Sv:case Fv:break;case Mv:a.rowheaders.push(...n);break;case Bv:a.rowfooters.push(...n);break;case Nv:a.colheaders.push(...n);break;case Tv:a.colfooters.push(...n);break;case Ov:a.rowtitle=n[0];break;case zv:a.coltitle=n[0];break;default:a.marks.push(...n)}return a}(e),f=l.marks,d=n.bounds===Xv?xy:Ay,h=n.offset,p=n.columns||f.length,m=p<=0?1:Math.ceil(f.length/p),g=m*p;const v=yy(t,f,n);v.empty()&&v.set(0,0,0,0),l.rowheaders&&(u=gy(n.headerBand,Jv,null),r=_y(t,l.rowheaders,f,p,m,-gy(h,"rowHeader"),dy,0,d,"x1",0,p,1,u)),l.colheaders&&(u=gy(n.headerBand,Gv,null),i=_y(t,l.colheaders,f,p,p,-gy(h,"columnHeader"),dy,1,d,"y1",0,1,p,u)),l.rowfooters&&(u=gy(n.footerBand,Jv,null),o=_y(t,l.rowfooters,f,p,m,gy(h,"rowFooter"),hy,0,d,"x2",p-1,p,1,u)),l.colfooters&&(u=gy(n.footerBand,Gv,null),a=_y(t,l.colfooters,f,p,p,gy(h,"columnFooter"),hy,1,d,"y2",g-p,1,p,u)),l.rowtitle&&(s=gy(n.titleAnchor,Jv),c=gy(h,"rowTitle"),c=s===Av?o+c:r-c,u=gy(n.titleBand,Jv,.5),wy(t,l.rowtitle,c,0,v,u)),l.coltitle&&(s=gy(n.titleAnchor,Gv),c=gy(h,"columnTitle"),c=s===Av?a+c:i-c,u=gy(n.titleBand,Gv,.5),wy(t,l.coltitle,c,1,v,u))}function xy(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 Ay(t,e){return t.bounds[e]}function _y(t,e,n,r,i,o,a,s,u,c,l,f,d,h){var p,m,g,v,y,b,x,A,_,w=n.length,E=0,D=0;if(!w)return E;for(p=l;p<w;p+=f)n[p]&&(E=a(E,u(n[p],c)));if(!e.length)return E;for(e.length>i&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),E+=o,m=0,v=e.length;m<v;++m)t.dirty(e[m]),e[m].mark.bounds.clear();for(p=l,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?(A=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),_=E):(A=E,_=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),y.union(b.bounds.translate(A-(b.x||0),_-(b.y||0))),b.x=A,b.y=_,t.dirty(b),D=a(D,y[c])}return D}function wy(t,e,n,r,i,o){if(e){t.dirty(e);var a=n,s=n;r?a=Math.round(i.x1+o*i.width()):s=Math.round(i.y1+o*i.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 Ey(t,e,n,r,i,o,a){const s=function(t,e){const n=t[e]||{};return(e,r)=>null!=n[e]?n[e]:null!=t[e]?t[e]:r}(n,e),u=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)),c=s("anchor",bv),l=c===Av?1:c===xv?.5:0,f={align:Hv,bounds:s("bounds",Xv),columns:"vertical"===s("direction")?1:t.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(e){case dv:f.anchor={x:Math.floor(r.x1)-u,column:Av,y:l*(a||r.height()+2*r.y1),row:c};break;case hv:f.anchor={x:Math.ceil(r.x2)+u,y:l*(a||r.height()+2*r.y1),row:c};break;case fv:f.anchor={y:Math.floor(i.y1)-u,row:Av,x:l*(o||i.width()+2*i.x1),column:c};break;case pv:f.anchor={y:Math.ceil(i.y2)+u,x:l*(o||i.width()+2*i.x1),column:c};break;case mv:f.anchor={x:u,y:u};break;case gv:f.anchor={x:o-u,y:u,column:Av};break;case vv:f.anchor={x:u,y:a-u,row:Av};break;case yv:f.anchor={x:o-u,y:a-u,column:Av,row:Av}}return f}function Dy(t,e){var n,r,i=e.items[0],o=i.datum,a=i.orient,s=i.bounds,u=i.x,c=i.y;return i._bounds?i._bounds.clear().union(s):i._bounds=s.clone(),s.clear(),function(t,e,n){var r=e.padding,i=r-n.x,o=r-n.y;if(e.datum.title){var a=e.items[1].items[0],s=a.anchor,u=e.titlePadding||0,c=r-a.x,l=r-a.y;switch(a.orient){case dv:i+=Math.ceil(a.bounds.width())+u;break;case hv:case pv:break;default:o+=a.bounds.height()+u}switch((i||o)&&Cy(t,n,i,o),a.orient){case dv:l+=Fy(e,n,a,s,1,1);break;case hv:c+=Fy(e,n,a,Av,0,0)+u,l+=Fy(e,n,a,s,1,1);break;case pv:c+=Fy(e,n,a,s,0,0),l+=Fy(e,n,a,Av,-1,0,1)+u;break;default:c+=Fy(e,n,a,s,0,0)}(c||l)&&Cy(t,a,c,l),(c=Math.round(a.bounds.x1-r))<0&&(Cy(t,n,-c,0),Cy(t,a,-c,0))}else(i||o)&&Cy(t,n,i,o)}(t,i,i.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}(i,s),n=2*i.padding,r=2*i.padding,s.empty()||(n=Math.ceil(s.width()+n),r=Math.ceil(s.height()+r)),o.type===Pv&&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}))}(i.items[0].items[0].items[0].items),a!==qv&&(i.x=u=0,i.y=c=0),i.width=n,i.height=r,Mh(s.set(u,c,u+n,c+r),i),i.mark.bounds.clear().union(s),i}function Fy(t,e,n,r,i,o,a){const s="symbol"!==t.datum.type,u=n.datum.vgrad,c=(!s||!o&&u||a?e:e.items[0]).bounds[i?"y2":"x2"]-t.padding,l=u&&o?c:0,f=u&&o?0:c,d=i<=0?0:lm(n);return Math.round(r===bv?l:r===Av?f-d:.5*(c-d))}function Cy(t,e,n,r){e.x+=n,e.y+=r,e.bounds.translate(n,r),e.mark.bounds.translate(n,r),t.dirty(e)}function ky(t){no.call(this,null,t)}function Sy(t,e){let n=0;if(void 0===e)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function My(t){no.call(this,null,t)}function By(t){no.call(this,null,t)}function Oy(){return Di({})}function Ny(t){no.call(this,null,t)}function Ty(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&&by(n,e,t.layout),function(t,e,n){var r,i,o,a,s,u=e.items,c=Math.max(0,e.width||0),l=Math.max(0,e.height||0),f=(new Eh).set(0,0,c,l),d=f.clone(),h=f.clone(),p=[];for(a=0,s=u.length;a<s;++a)switch((i=u[a]).role){case Dv:(cy(i)?d:h).union(ly(t,i,c,l));break;case Fv:r=i;break;case Sv:p.push(Dy(t,i));break;case Cv:case kv:case Mv:case Bv:case Ov:case Nv:case Tv:case zv:d.union(i.bounds),h.union(i.bounds);break;default:f.union(i.bounds)}if(p.length){const e={};p.forEach((t=>{(o=t.orient||hv)!==qv&&(e[o]||(e[o]=[])).push(t)}));for(const r in e){const i=e[r];yy(t,i,Ey(i,r,n.legends,d,h,c,l))}p.forEach((e=>{const r=e.bounds;if(r.equals(e._bounds)||(e.bounds=e._bounds,t.dirty(e),e.bounds=r,t.dirty(e)),!n.autosize||n.autosize.type!==Lv&&n.autosize.type!==jv&&n.autosize.type!==Uv)f.union(r);else switch(e.orient){case dv:case hv:f.add(r.x1,0).add(r.x2,0);break;case fv:case pv:f.add(0,r.y1).add(0,r.y2)}}))}f.union(d).union(h),r&&f.union(function(t,e,n,r,i){var o,a=e.items[0],s=a.frame,u=a.orient,c=a.anchor,l=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=u===dv||u===hv?r:n,m=0,g=0,v=0,y=0,b=0;if(s!==Ev?u===dv?(m=i.y2,p=i.y1):u===hv?(m=i.y1,p=i.y2):(m=i.x1,p=i.x2):u===dv&&(m=r,p=0),o=c===bv?m:c===Av?p:(m+p)/2,h&&h.text){switch(u){case fv:case pv:b=d.bounds.height()+f;break;case dv:y=d.bounds.width()+f;break;case hv:y=-d.bounds.width()-f}sy.clear().union(h.bounds),sy.translate(y-(h.x||0),b-(h.y||0)),uy(h,"x",y)|uy(h,"y",b)&&(t.dirty(h),h.bounds.clear().union(sy),h.mark.bounds.clear().union(sy),t.dirty(h)),sy.clear().union(h.bounds)}else sy.clear();switch(sy.union(d.bounds),u){case fv:g=o,v=i.y1-sy.height()-l;break;case dv:g=i.x1-sy.width()-l,v=o;break;case hv:g=i.x2+sy.width()+l,v=o;break;case pv:g=o,v=i.y2+l;break;default:g=a.x,v=a.y}return uy(a,"x",g)|uy(a,"y",v)&&(sy.translate(g,v),t.dirty(a),a.bounds.clear().union(sy),e.bounds.clear().union(sy),t.dirty(a)),a.bounds}(t,r,c,l,f));e.clip&&f.set(0,0,e.width||0,e.height||0);!function(t,e,n,r){const i=r.autosize||{},o=i.type;if(t._autosize<1||!o)return;let a=t._width,s=t._height,u=Math.max(0,e.width||0),c=Math.max(0,Math.ceil(-n.x1)),l=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-l));if(i.contains===Rv){const e=t.padding();a-=e.left+e.right,s-=e.top+e.bottom}o===qv?(c=0,f=0,u=a,l=s):o===Lv?(u=Math.max(0,a-c-d),l=Math.max(0,s-f-h)):o===jv?(u=Math.max(0,a-c-d),s=l+f+h):o===Uv?(a=u+c+d,l=Math.max(0,s-f-h)):o===Iv&&(a=u+c+d,s=l+f+h);t._resizeView(a,s,u,l,[c,f],i.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)(My,no,{transform(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.scale,a=ad(o,null==t.count?t.values?t.values.length:10:t.count,t.minstep),s=t.format||cd(n,o,a,t.formatSpecifier,t.formatType,!!t.values),u=t.values?sd(o,t.values,a):ud(o,a);return i&&(r.rem=i),i=u.map(((t,e)=>Di({index:e/(u.length-1||1),value:t,label:s(t)}))),t.extra&&i.length&&i.push(Di({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),(0,m.XW)(By,no,{transform(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.item||Oy,o=t.key||wi,a=this.value;return(0,m.kJ)(r.encode)&&(r.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--,r.add.push(n)):r.mod.push(n):(n=i(t),a.set(e,n),r.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,r.mod.push(n))})),e.visit(e.REM,(t=>{const e=o(t),n=a.get(e);t!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)})),e.changed(e.ADD_MOD)&&r.modifies("datum"),(e.clean()||t.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),(0,m.XW)(Ny,no,{transform(t,e){var n=e.fork(e.ADD_REM),r=t.mod||!1,i=t.encoders,o=e.encode;if((0,m.kJ)(o)){if(!n.changed()&&!o.every((t=>i[t])))return e.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=i.update||m.k,u=i.enter||m.k,c=i.exit||m.k,l=(o&&!a?i[o]:s)||m.k;if(e.changed(e.ADD)&&(e.visit(e.ADD,(e=>{u(e,t),s(e,t)})),n.modifies(u.output),n.modifies(s.output),l!==m.k&&l!==s&&(e.visit(e.ADD,(e=>{l(e,t)})),n.modifies(l.output))),e.changed(e.REM)&&c!==m.k&&(e.visit(e.REM,(e=>{c(e,t)})),n.modifies(c.output)),a||l!==m.k){const i=e.MOD|(t.modified()?e.REFLOW:0);a?(e.visit(i,(e=>{const i=u(e,t)||r;(l(e,t)||i)&&n.mod.push(e)})),n.mod.length&&n.modifies(u.output)):e.visit(i,(e=>{(l(e,t)||r)&&n.mod.push(e)})),n.mod.length&&n.modifies(l.output)}return n.changed()?n:e.StopPropagation}}),(0,m.XW)(Ty,no,{transform(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n,r,i,o,a,s=e.dataflow.locale(),u=e.fork(e.NO_SOURCE|e.NO_FIELDS),c=this.value,l=t.type||ed,f=t.scale,d=+t.limit,h=ad(f,null==t.count?5:t.count,t.minstep),p=!!t.values||l===ed,g=t.format||md(s,f,h,l,t.formatSpecifier,t.formatType,p),v=t.values||hd(f,h);return c&&(u.rem=c),l===ed?(d&&v.length>d?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),c=v.slice(0,d-1),a=!0):c=v,(0,m.mf)(i=t.size)?(t.values||0!==f(c[0])||(c=c.slice(1)),o=c.reduce(((e,n)=>Math.max(e,i(n,t))),0)):i=(0,m.a9)(o=i||8),c=c.map(((e,n)=>Di({index:n,label:g(e,n,c),value:e,offset:o,size:i(e,t)}))),a&&(a=v[c.length],c.push(Di({index:c.length,label:"\u2026".concat(v.length-c.length," entries"),value:a,offset:o,size:i(a,t)})))):"gradient"===l?(n=f.domain(),r=Vf(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)]),c=v.map(((t,e)=>Di({index:e,label:g(t,e,v),value:t,perc:r(t)})))):(i=v.length-1,r=function(t){const e=t.domain(),n=e.length-1;let r=+e[0],i=+(0,m.fj)(e),o=i-r;if(t.type===yf){const t=n?o/n:.1;r-=t,i+=t,o=i-r}return t=>(t-r)/o}(f),c=v.map(((t,e)=>Di({index:e,label:g(t,e,v),value:t,perc:e?r(t):0,perc2:e===i?1:r(v[e+1])})))),u.source=c,u.add=c,this.value=c,u}});const zy=t=>t.source.x,Ry=t=>t.source.y,Py=t=>t.target.x,Ly=t=>t.target.y;function jy(t){no.call(this,{},t)}jy.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)(jy,no,{transform(t,e){var n=t.sourceX||zy,r=t.sourceY||Ry,i=t.targetX||Py,o=t.targetY||Ly,a=t.as||"path",s=t.orient||"vertical",u=t.shape||"line",c=Wy.get(u+"-"+s)||Wy.get(u);return c||(0,m.vU)("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,(t=>{t[a]=c(n(t),r(t),i(t),o(t))})),e.reflow(t.modified()).modifies(a)}});const Uy=(t,e,n,r)=>"M"+t+","+e+"L"+n+","+r,Iy=(t,e,n,r)=>{var i=n-t,o=r-e,a=Math.hypot(i,o)/2;return"M"+t+","+e+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r},qy=(t,e,n,r)=>{const i=n-t,o=r-e,a=.2*(i+o),s=.2*(o-i);return"M"+t+","+e+"C"+(t+a)+","+(e+s)+" "+(n+s)+","+(r-a)+" "+n+","+r},Wy=(0,m.Xr)({line:Uy,"line-radial":(t,e,n,r)=>Uy(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),arc:Iy,"arc-radial":(t,e,n,r)=>Iy(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),curve:qy,"curve-radial":(t,e,n,r)=>qy(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(t,e,n,r)=>"M"+t+","+e+"V"+r+"H"+n,"orthogonal-vertical":(t,e,n,r)=>"M"+t+","+e+"H"+n+"V"+r,"orthogonal-radial":(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n);return"M"+e*i+","+e*o+"A"+e+","+e+" 0 0,"+((Math.abs(n-t)>Math.PI?n<=t:n>t)?1:0)+" "+e*a+","+e*s+"L"+r*a+","+r*s},"diagonal-horizontal":(t,e,n,r)=>{const i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(t,e,n,r)=>{const i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n),u=(e+r)/2;return"M"+e*i+","+e*o+"C"+u*i+","+u*o+" "+u*a+","+u*s+" "+r*a+","+r*s}});function Hy(t){no.call(this,null,t)}Hy.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)(Hy,no,{transform(t,e){var n,r,i,o=t.as||["startAngle","endAngle"],a=o[0],s=o[1],u=t.field||m.kX,c=t.startAngle||0,l=null!=t.endAngle?t.endAngle:2*Math.PI,f=e.source,d=f.map(u),h=d.length,p=c,g=(l-c)/Sy(d),v=Ho(h);for(t.sort&&v.sort(((t,e)=>d[t]-d[e])),n=0;n<h;++n)i=d[v[n]],(r=f[v[n]])[a]=p,r[s]=p+=i*g;return this.value=d,e.reflow(t.modified()).modifies(o)}});const Xy=5;function Gy(t){return jf(t)&&t!==pf}const Jy=(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 $y(t){no.call(this,null,t),this.modified(!0)}function Vy(t,e,n){if(qf(t)){var r=Math.abs(e.reduce(((t,e)=>t+(e<0?-1:e>0?1:0)),0));r!==e.length&&n.warn("Log scale domain includes zero: "+(0,m.m8)(e))}return e}function Yy(t,e,n){return(0,m.mf)(t)&&(e||n)?Gf(t,Ky(e||[0,1],n)):t}function Ky(t,e){return e?t.slice().reverse():t}function Zy(t){no.call(this,null,t)}(0,m.XW)($y,no,{transform(t,e){var n=e.dataflow,r=this.value,i=function(t){var e,n=t.type,r="";if(n===pf)return pf+"-"+sf;(function(t){const e=t.type;return jf(e)&&e!==df&&e!==hf&&(t.scheme||t.range&&t.range.length&&t.range.every(m.HD))})(t)&&(r=2===(e=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(null!=t.domainMid):0)?pf+"-":3===e?mf+"-":"");return(r+n||sf).toLowerCase()}(t);for(i in r&&i===r.type||(this.value=r=Rf(i)()),t)if(!Jy[i]){if("padding"===i&&Gy(r.type))continue;(0,m.mf)(r[i])?r[i](t[i]):n.warn("Unsupported scale property: "+i)}return function(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(null!=e.rangeStep)o=function(t,e,n){t!==Af&&t!==xf&&(0,m.vU)("Only band and point scales support rangeStep.");var r=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,i=t===xf?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*af(n,i,r)]}(r,e,n);else if(e.scheme&&(o=function(t,e,n){var r,i=e.schemeExtent;(0,m.kJ)(e.scheme)?r=Jf(e.scheme,e.interpolate,e.interpolateGamma):(r=td(e.scheme.toLowerCase()))||(0,m.vU)("Unrecognized scheme name: ".concat(e.scheme));return n=t===yf?n+1:t===_f?n-1:t===gf||t===vf?+e.schemeCount||Xy:n,Wf(t)?Yy(r,i,e.reverse):(0,m.mf)(r)?$f(Yy(r,i),n):t===bf?r:r.slice(0,n)}(r,e,n),(0,m.mf)(o))){if(t.interpolator)return t.interpolator(o);(0,m.vU)("Scale type ".concat(r," does not support interpolating color schemes."))}if(o&&Wf(r))return t.interpolator(Jf(Ky(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(Yf(e.interpolate,e.interpolateGamma)):(0,m.mf)(t.round)?t.round(i):(0,m.mf)(t.rangeRound)&&t.interpolate(i?lc:cc);o&&t.range(Ky(o,e.reverse))}(r,t,function(t,e,n){let r=e.bins;if(r&&!(0,m.kJ)(r)){const e=t.domain(),n=e[0],i=(0,m.fj)(e),o=r.step;let a=null==r.start?n:r.start,s=null==r.stop?i:r.stop;o||(0,m.vU)("Scale bins parameter missing step property."),a<n&&(a=o*Math.ceil(n/o)),s>i&&(s=o*Math.floor(i/o)),r=Ho(a,s+o/2,o)}r?t.bins=r:t.bins&&delete t.bins;t.type===_f&&(r?e.domain||e.domainRaw||(t.domain(r),n=r.length):t.bins=t.domain());return n}(r,t,function(t,e,n){const r=function(t,e,n){return e?(t.domain(Vy(t.type,e,n)),e.length):-1}(t,e.domainRaw,n);if(r>-1)return r;var i,o,a=e.domain,s=t.type,u=e.zero||void 0===e.zero&&function(t){const e=t.type;return!t.bins&&(e===sf||e===cf||e===lf)}(t);if(!a)return 0;Gy(s)&&e.padding&&a[0]!==(0,m.fj)(a)&&(a=function(t,e,n,r,i,o){var a=Math.abs((0,m.fj)(n)-n[0]),s=a/(a-2*r),u=t===uf?(0,m.dH)(e,null,s):t===lf?(0,m.mK)(e,null,s,.5):t===cf?(0,m.mK)(e,null,s,i||1):t===ff?(0,m.bV)(e,null,s,o||1):(0,m.ay)(e,null,s);return e=e.slice(),e[0]=u[0],e[e.length-1]=u[1],e}(s,a,e.range,e.padding,e.exponent,e.constant));if((u||null!=e.domainMin||null!=e.domainMax||null!=e.domainMid)&&(i=(a=a.slice()).length-1||1,u&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=e.domainMin&&(a[0]=e.domainMin),null!=e.domainMax&&(a[i]=e.domainMax),null!=e.domainMid)){const t=(o=e.domainMid)>a[i]?i+1:o<a[0]?0:i;t!==i&&n.warn("Scale domainMid exceeds domain min or max.",o),a.splice(t,0,o)}t.domain(Vy(s,a,n)),s===bf&&t.unknown(e.domainImplicit?sl:void 0);e.nice&&t.nice&&t.nice(!0!==e.nice&&ad(t,e.nice)||null);return a.length}(r,t,n))),e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),(0,m.XW)(Zy,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(Si(t.sort)),this.modified(n),e}});const Qy="zero",tb="center",eb="normalize",nb=["y0","y1"];function rb(t){no.call(this,null,t)}function ib(t,e,n,r,i){for(var o,a=(e-t.sum)/2,s=t.length,u=0;u<s;++u)(o=t[u])[r]=a,o[i]=a+=Math.abs(n(o))}function ob(t,e,n,r,i){for(var o,a=1/t.sum,s=0,u=t.length,c=0,l=0;c<u;++c)(o=t[c])[r]=s,o[i]=s=a*(l+=Math.abs(n(o)))}function ab(t,e,n,r,i){for(var o,a,s=0,u=0,c=t.length,l=0;l<c;++l)(o=+n(a=t[l]))<0?(a[r]=u,a[i]=u+=o):(a[r]=s,a[i]=s+=o)}rb.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:Qy,values:[Qy,tb,eb]},{name:"as",type:"string",array:!0,length:2,default:nb}]},(0,m.XW)(rb,no,{transform(t,e){var n,r,i,o,a=t.as||nb,s=a[0],u=a[1],c=Si(t.sort),l=t.field||m.kX,f=t.offset===tb?ib:t.offset===eb?ob:ab;for(n=function(t,e,n,r){var i,o,a,s,u,c,l,f,d,h=[],p=t=>t(u);if(null==e)h.push(t.slice());else for(i={},o=0,a=t.length;o<a;++o)u=t[o],(l=i[c=e.map(p)])||(i[c]=l=[],h.push(l)),l.push(u);for(c=0,d=0,s=h.length;c<s;++c){for(o=0,f=0,a=(l=h[c]).length;o<a;++o)f+=Math.abs(r(l[o]));l.sum=f,f>d&&(d=f),n&&l.sort(n)}return h.max=d,h}(e.source,t.groupby,c,l),r=0,i=n.length,o=n.max;r<i;++r)f(n[r],o,l,s,u);return e.reflow(t.modified()).modifies(a)}});const sb=t=>t;function ub(t,e){t&&lb.hasOwnProperty(t.type)&&lb[t.type](t,e)}var cb={Feature:function(t,e){ub(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)ub(n[r].geometry,e)}},lb={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,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){fb(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)fb(n[r],e,0)},Polygon:function(t,e){db(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)db(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)ub(n[r],e)}};function fb(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function db(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)fb(t[n],e,1);e.polygonEnd()}function hb(t,e){t&&cb.hasOwnProperty(t.type)?cb[t.type](t,e):ub(t,e)}class pb{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],o=t+i,a=Math.abs(t)<Math.abs(i)?t-(o-i):i-(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,r,i=this._n,o=0;if(i>0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}var mb=1e-6,gb=1e-12,vb=Math.PI,yb=vb/2,bb=vb/4,xb=2*vb,Ab=180/vb,_b=vb/180,wb=Math.abs,Eb=Math.atan,Db=Math.atan2,Fb=Math.cos,Cb=Math.ceil,kb=Math.exp,Sb=(Math.floor,Math.hypot),Mb=Math.log,Bb=Math.pow,Ob=Math.sin,Nb=Math.sign||function(t){return t>0?1:t<0?-1:0},Tb=Math.sqrt,zb=Math.tan;function Rb(t){return t>1?0:t<-1?vb:Math.acos(t)}function Pb(t){return t>1?yb:t<-1?-yb:Math.asin(t)}function Lb(){}var jb,Ub,Ib,qb,Wb=new pb,Hb=new pb,Xb={point:Lb,lineStart:Lb,lineEnd:Lb,polygonStart:function(){Xb.lineStart=Gb,Xb.lineEnd=Vb},polygonEnd:function(){Xb.lineStart=Xb.lineEnd=Xb.point=Lb,Wb.add(wb(Hb)),Hb=new pb},result:function(){var t=Wb/2;return Wb=new pb,t}};function Gb(){Xb.point=Jb}function Jb(t,e){Xb.point=$b,jb=Ib=t,Ub=qb=e}function $b(t,e){Hb.add(qb*t-Ib*e),Ib=t,qb=e}function Vb(){$b(jb,Ub)}const Yb=Xb;var Kb=1/0,Zb=Kb,Qb=-Kb,tx=Qb,ex={point:function(t,e){t<Kb&&(Kb=t);t>Qb&&(Qb=t);e<Zb&&(Zb=e);e>tx&&(tx=e)},lineStart:Lb,lineEnd:Lb,polygonStart:Lb,polygonEnd:Lb,result:function(){var t=[[Kb,Zb],[Qb,tx]];return Qb=tx=-(Zb=Kb=1/0),t}};const nx=ex;var rx,ix,ox,ax,sx=0,ux=0,cx=0,lx=0,fx=0,dx=0,hx=0,px=0,mx=0,gx={point:vx,lineStart:yx,lineEnd:Ax,polygonStart:function(){gx.lineStart=_x,gx.lineEnd=wx},polygonEnd:function(){gx.point=vx,gx.lineStart=yx,gx.lineEnd=Ax},result:function(){var t=mx?[hx/mx,px/mx]:dx?[lx/dx,fx/dx]:cx?[sx/cx,ux/cx]:[NaN,NaN];return sx=ux=cx=lx=fx=dx=hx=px=mx=0,t}};function vx(t,e){sx+=t,ux+=e,++cx}function yx(){gx.point=bx}function bx(t,e){gx.point=xx,vx(ox=t,ax=e)}function xx(t,e){var n=t-ox,r=e-ax,i=Tb(n*n+r*r);lx+=i*(ox+t)/2,fx+=i*(ax+e)/2,dx+=i,vx(ox=t,ax=e)}function Ax(){gx.point=vx}function _x(){gx.point=Ex}function wx(){Dx(rx,ix)}function Ex(t,e){gx.point=Dx,vx(rx=ox=t,ix=ax=e)}function Dx(t,e){var n=t-ox,r=e-ax,i=Tb(n*n+r*r);lx+=i*(ox+t)/2,fx+=i*(ax+e)/2,dx+=i,hx+=(i=ax*t-ox*e)*(ox+t),px+=i*(ax+e),mx+=3*i,vx(ox=t,ax=e)}const Fx=gx;function Cx(t){this._context=t}Cx.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,xb)}},result:Lb};var kx,Sx,Mx,Bx,Ox,Nx=new pb,Tx={point:Lb,lineStart:function(){Tx.point=zx},lineEnd:function(){kx&&Rx(Sx,Mx),Tx.point=Lb},polygonStart:function(){kx=!0},polygonEnd:function(){kx=null},result:function(){var t=+Nx;return Nx=new pb,t}};function zx(t,e){Tx.point=Rx,Sx=Bx=t,Mx=Ox=e}function Rx(t,e){Bx-=t,Ox-=e,Nx.add(Tb(Bx*Bx+Ox*Ox)),Bx=t,Ox=e}const Px=Tx;var Lx,jx,Ux,Ix;let qx,Wx,Hx,Xx;class Gx{constructor(t){this._append=null==t?Jx:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError("invalid digits: ".concat(t));if(e>15)return Jx;if(e!==qx){const t=10**e;qx=e,Wx=function(e){let n=1;this._+=e[0];for(const r=e.length;n<r;++n)this._+=Math.round(arguments[n]*t)/t+e[n]}}return Wx}(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(Lx||(Lx=(0,Eu.Z)(["M",",",""])),t,e),this._point=1;break;case 1:this._append(jx||(jx=(0,Eu.Z)(["L",",",""])),t,e);break;default:if(this._append(Ux||(Ux=(0,Eu.Z)(["M",",",""])),t,e),this._radius!==Hx||this._append!==Wx){const t=this._radius,e=this._;this._="",this._append(Ix||(Ix=(0,Eu.Z)(["m0,","a",","," 0 1,1 0,","a",","," 0 1,1 0,","z"])),t,t,t,-2*t,t,t,2*t),Hx=t,Wx=this._append,Xx=this._,this._=e}this._+=Xx}}result(){const t=this._;return this._="",t.length?t:null}}function Jx(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function $x(t,e){let n,r,i=3,o=4.5;function a(t){return t&&("function"===typeof o&&r.pointRadius(+o.apply(this,arguments)),hb(t,n(r))),r.result()}return a.area=function(t){return hb(t,n(Yb)),Yb.result()},a.measure=function(t){return hb(t,n(Px)),Px.result()},a.bounds=function(t){return hb(t,n(nx)),nx.result()},a.centroid=function(t){return hb(t,n(Fx)),Fx.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,sb):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new Gx(i)):new Cx(e=t),"function"!==typeof o&&r.pointRadius(o),a):e},a.pointRadius=function(t){return arguments.length?(o="function"===typeof t?t:(r.pointRadius(+t),+t),a):o},a.digits=function(t){if(!arguments.length)return i;if(null==t)i=null;else{const e=Math.floor(t);if(!(e>=0))throw new RangeError("invalid digits: ".concat(t));i=e}return null===e&&(r=new Gx(i)),a},a.projection(t).digits(i).context(e)}function Vx(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:Lb,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Yx(t,e){return wb(t[0]-e[0])<mb&&wb(t[1]-e[1])<mb}function Kx(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Zx(t,e,n,r,i){var o,a,s=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(Yx(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a[0]+=2*mb}s.push(n=new Kx(r,t,null,!0)),u.push(n.o=new Kx(r,null,n,!1)),s.push(n=new Kx(a,t,null,!1)),u.push(n.o=new Kx(a,null,n,!0))}})),s.length){for(u.sort(e),Qx(s),Qx(u),o=0,a=u.length;o<a;++o)u[o].e=n=!n;for(var c,l,f=s[0];;){for(var d=f,h=!0;d.v;)if((d=d.n)===f)return;c=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(o=0,a=c.length;o<a;++o)i.point((l=c[o])[0],l[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(h)for(c=d.p.z,o=c.length-1;o>=0;--o)i.point((l=c[o])[0],l[1]);else r(d.x,d.p.x,-1,i);d=d.p}c=(d=d.o).z,h=!h}while(!d.v);i.lineEnd()}}}function Qx(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function tA(t){return[Db(t[1],t[0]),Pb(t[2])]}function eA(t){var e=t[0],n=t[1],r=Fb(n);return[r*Fb(e),r*Ob(e),Ob(n)]}function nA(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function rA(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 iA(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function oA(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function aA(t){var e=Tb(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function sA(t){return wb(t[0])<=vb?t[0]:Nb(t[0])*((wb(t[0])+vb)%xb-vb)}function uA(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function cA(t,e,n,r){return function(i){var o,a,s,u=e(i),c=Vx(),l=e(c),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=uA(a);var t=function(t,e){var n=sA(e),r=e[1],i=Ob(r),o=[Ob(n),-Fb(n),0],a=0,s=0,u=new pb;1===i?r=yb+mb:-1===i&&(r=-yb-mb);for(var c=0,l=t.length;c<l;++c)if(d=(f=t[c]).length)for(var f,d,h=f[d-1],p=sA(h),m=h[1]/2+bb,g=Ob(m),v=Fb(m),y=0;y<d;++y,p=x,g=_,v=w,h=b){var b=f[y],x=sA(b),A=b[1]/2+bb,_=Ob(A),w=Fb(A),E=x-p,D=E>=0?1:-1,F=D*E,C=F>vb,k=g*_;if(u.add(Db(k*D*Ob(F),v*w+k*Fb(F))),a+=C?E+D*xb:E,C^p>=n^x>=n){var S=rA(eA(h),eA(b));aA(S);var M=rA(o,S);aA(M);var B=(C^E>=0?-1:1)*Pb(M[2]);(r>B||r===B&&(S[0]||S[1]))&&(s+=C^E>=0?1:-1)}}return(a<-mb||a<mb&&u<-gb)^1&s}(o,r);a.length?(f||(i.polygonStart(),f=!0),Zx(a,fA,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(e,n){t(e,n)&&i.point(e,n)}function p(t,e){u.point(t,e)}function m(){d.point=p,u.lineStart()}function g(){d.point=h,u.lineEnd()}function v(t,e){s.push([t,e]),l.point(t,e)}function y(){l.lineStart(),s=[]}function b(){v(s[0][0],s[0][1]),l.lineEnd();var t,e,n,r,u=l.clean(),d=c.result(),h=d.length;if(s.pop(),o.push(s),s=null,h)if(1&u){if((e=(n=d[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else h>1&&2&u&&d.push(d.pop().concat(d.shift())),a.push(d.filter(lA))}return d}}function lA(t){return t.length>1}function fA(t,e){return((t=t.x)[0]<0?t[1]-yb-mb:yb-t[1])-((e=e.x)[0]<0?e[1]-yb-mb:yb-e[1])}const dA=cA((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?vb:-vb,u=wb(o-n);wb(u-vb)<mb?(t.point(n,r=(r+a)/2>0?yb:-yb),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=vb&&(wb(n-i)<mb&&(n-=i*mb),wb(o-s)<mb&&(o-=s*mb),r=function(t,e,n,r){var i,o,a=Ob(t-n);return wb(a)>mb?Eb((Ob(e)*(o=Fb(r))*Ob(n)-Ob(r)*(i=Fb(e))*Ob(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*yb,r.point(-vb,i),r.point(0,i),r.point(vb,i),r.point(vb,0),r.point(vb,-i),r.point(0,-i),r.point(-vb,-i),r.point(-vb,0),r.point(-vb,i);else if(wb(t[0]-e[0])>mb){var o=t[0]<e[0]?vb:-vb;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-vb,-yb]);function hA(t,e,n,r,i,o){if(n){var a=Fb(e),s=Ob(e),u=r*n;null==i?(i=e+r*xb,o=e-u/2):(i=pA(a,i),o=pA(a,o),(r>0?i<o:i>o)&&(i+=r*xb));for(var c,l=i;r>0?l>o:l<o;l-=u)c=tA([a,-s*Fb(l),-s*Ob(l)]),t.point(c[0],c[1])}}function pA(t,e){(e=eA(e))[0]-=t,aA(e);var n=Rb(-e[1]);return((-e[2]<0?-n:n)+xb-mb)%xb}var mA=1e9,gA=-mA;function vA(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,c){var l=0,f=0;if(null==i||(l=a(i,s))!==(f=a(o,s))||u(i,o)<0^s>0)do{c.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+s+4)%4)!==f);else c.point(o[0],o[1])}function a(r,i){return wb(r[0]-t)<mb?i>0?0:3:wb(r[0]-n)<mb?i>0?2:1:wb(r[1]-e)<mb?i>0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r: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 u,c,l,f,d,h,p,m,g,v,y,b=a,x=Vx(),A={point:_,lineStart:function(){A.point=w,c&&c.push(l=[]);v=!0,g=!1,p=m=NaN},lineEnd:function(){u&&(w(f,d),h&&g&&x.rejoin(),u.push(x.result()));A.point=_,g&&b.lineEnd()},polygonStart:function(){b=x,u=[],c=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;n<i;++n)for(var o,a,s=c[n],u=1,l=s.length,f=s[0],d=f[0],h=f[1];u<l;++u)o=d,a=h,d=(f=s[u])[0],h=f[1],a<=r?h>r&&(d-o)*(r-a)>(h-a)*(t-o)&&++e:h<=r&&(d-o)*(r-a)<(h-a)*(t-o)&&--e;return e}(),n=y&&e,i=(u=uA(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Zx(u,s,e,o,a),a.polygonEnd());b=a,u=c=l=null}};function _(t,e){i(t,e)&&b.point(t,e)}function w(o,a){var s=i(o,a);if(c&&l.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 u=[p=Math.max(gA,Math.min(mA,p)),m=Math.max(gA,Math.min(mA,m))],x=[o=Math.max(gA,Math.min(mA,o)),a=Math.max(gA,Math.min(mA,a))];!function(t,e,n,r,i,o){var a,s=t[0],u=t[1],c=0,l=1,f=e[0]-s,d=e[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a<c)return;a<l&&(l=a)}else if(f>0){if(a>l)return;a>c&&(c=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>l)return;a>c&&(c=a)}else if(f>0){if(a<c)return;a<l&&(l=a)}if(a=r-u,d||!(a>0)){if(a/=d,d<0){if(a<c)return;a<l&&(l=a)}else if(d>0){if(a>l)return;a>c&&(c=a)}if(a=o-u,d||!(a<0)){if(a/=d,d<0){if(a>l)return;a>c&&(c=a)}else if(d>0){if(a<c)return;a<l&&(l=a)}return c>0&&(t[0]=s+c*f,t[1]=u+c*d),l<1&&(e[0]=s+l*f,e[1]=u+l*d),!0}}}}}(u,x,t,e,n,r)?s&&(b.lineStart(),b.point(o,a),y=!1):(g||(b.lineStart(),b.point(u[0],u[1])),b.point(x[0],x[1]),s||b.lineEnd(),y=!1)}p=o,m=a,g=s}return A}}function yA(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function bA(t,e){return wb(t)>vb&&(t-=Math.round(t/xb)*xb),[t,e]}function xA(t,e,n){return(t%=xb)?e||n?yA(_A(t),wA(e,n)):_A(t):e||n?wA(e,n):bA}function AA(t){return function(e,n){return wb(e+=t)>vb&&(e-=Math.round(e/xb)*xb),[e,n]}}function _A(t){var e=AA(t);return e.invert=AA(-t),e}function wA(t,e){var n=Fb(t),r=Ob(t),i=Fb(e),o=Ob(e);function a(t,e){var a=Fb(e),s=Fb(t)*a,u=Ob(t)*a,c=Ob(e),l=c*n+s*r;return[Db(u*i-l*o,s*n-c*r),Pb(l*i+u*o)]}return a.invert=function(t,e){var a=Fb(e),s=Fb(t)*a,u=Ob(t)*a,c=Ob(e),l=c*i-u*o;return[Db(u*i+c*o,s*n+l*r),Pb(l*n-s*r)]},a}function EA(t){return function(e){var n=new DA;for(var r in t)n[r]=t[r];return n.stream=e,n}}function DA(){}function FA(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),hb(n,t.stream(nx)),e(nx.result()),null!=r&&t.clipExtent(r),t}function CA(t,e,n){return FA(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function kA(t,e,n){return CA(t,[[0,0],e],n)}function SA(t,e,n){return FA(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function MA(t,e,n){return FA(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}bA.invert=bA,DA.prototype={constructor:DA,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 BA=16,OA=Fb(30*_b);function NA(t,e){return+e?function(t,e){function n(r,i,o,a,s,u,c,l,f,d,h,p,m,g){var v=c-r,y=l-i,b=v*v+y*y;if(b>4*e&&m--){var x=a+d,A=s+h,_=u+p,w=Tb(x*x+A*A+_*_),E=Pb(_/=w),D=wb(wb(_)-1)<mb||wb(o-f)<mb?(o+f)/2:Db(A,x),F=t(D,E),C=F[0],k=F[1],S=C-r,M=k-i,B=y*S-v*M;(B*B/b>e||wb((v*S+y*M)/b-.5)>.3||a*d+s*h+u*p<OA)&&(n(r,i,o,a,s,u,C,k,D,x/=w,A/=w,_,m,g),g.point(C,k),n(C,k,D,x,A,_,c,l,f,d,h,p,m,g))}}return function(e){var r,i,o,a,s,u,c,l,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,r){n=t(n,r),e.point(n[0],n[1])}function v(){l=NaN,m.point=y,e.lineStart()}function y(r,i){var o=eA([r,i]),a=t(r,i);n(l,f,c,d,h,p,l=a[0],f=a[1],c=r,d=o[0],h=o[1],p=o[2],BA,e),e.point(l,f)}function b(){m.point=g,e.lineEnd()}function x(){v(),m.point=A,m.lineEnd=_}function A(t,e){y(r=t,e),i=l,o=f,a=d,s=h,u=p,m.point=y}function _(){n(l,f,c,d,h,p,i,o,r,a,s,u,BA,e),m.lineEnd=b,b()}return m}}(t,e):function(t){return EA({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var TA=EA({point:function(t,e){this.stream.point(t*_b,e*_b)}});function zA(t,e,n,r,i,o){if(!o)return function(t,e,n,r,i){function o(o,a){return[e+t*(o*=r),n-t*(a*=i)]}return o.invert=function(o,a){return[(o-e)/t*r,(n-a)/t*i]},o}(t,e,n,r,i);var a=Fb(o),s=Ob(o),u=a*t,c=s*t,l=a/t,f=s/t,d=(s*n-a*e)/t,h=(s*e+a*n)/t;function p(t,o){return[u*(t*=r)-c*(o*=i)+e,n-c*t-u*o]}return p.invert=function(t,e){return[r*(l*t-f*e+d),i*(h-f*t-l*e)]},p}function RA(t){return PA((function(){return t}))()}function PA(t){var e,n,r,i,o,a,s,u,c,l,f=150,d=480,h=250,p=0,m=0,g=0,v=0,y=0,b=0,x=1,A=1,_=null,w=dA,E=null,D=sb,F=.5;function C(t){return u(t[0]*_b,t[1]*_b)}function k(t){return(t=u.invert(t[0],t[1]))&&[t[0]*Ab,t[1]*Ab]}function S(){var t=zA(f,0,0,x,A,b).apply(null,e(p,m)),r=zA(f,d-t[0],h-t[1],x,A,b);return n=xA(g,v,y),s=yA(e,r),u=yA(n,s),a=NA(s,F),M()}function M(){return c=l=null,C}return C.stream=function(t){return c&&l===t?c:c=TA(function(t){return EA({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(w(a(D(l=t)))))},C.preclip=function(t){return arguments.length?(w=t,_=void 0,M()):w},C.postclip=function(t){return arguments.length?(D=t,E=r=i=o=null,M()):D},C.clipAngle=function(t){return arguments.length?(w=+t?function(t){var e=Fb(t),n=6*_b,r=e>0,i=wb(e)>mb;function o(t,n){return Fb(t)*Fb(n)>e}function a(t,n,r){var i=[1,0,0],o=rA(eA(t),eA(n)),a=nA(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var c=e*a/u,l=-e*s/u,f=rA(i,o),d=oA(i,c);iA(d,oA(o,l));var h=f,p=nA(d,h),m=nA(h,h),g=p*p-m*(nA(d,d)-1);if(!(g<0)){var v=Tb(g),y=oA(h,(-p-v)/m);if(iA(y,d),y=tA(y),!r)return y;var b,x=t[0],A=n[0],_=t[1],w=n[1];A<x&&(b=x,x=A,A=b);var E=A-x,D=wb(E-vb)<mb;if(!D&&w<_&&(b=_,_=w,w=b),D||E<mb?D?_+w>0^y[1]<(wb(y[0]-x)<mb?_:w):_<=y[1]&&y[1]<=w:E>vb^(x<=y[0]&&y[0]<=A)){var F=oA(h,(-p+v)/m);return iA(F,d),[y,tA(F)]}}}function s(e,n){var i=r?t:vb-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return cA(o,(function(t){var e,n,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(f,d){var h,p=[f,d],m=o(f,d),g=r?m?0:s(f,d):m?s(f+(f<0?vb:-vb),d):0;if(!e&&(c=u=m)&&t.lineStart(),m!==u&&(!(h=a(e,p))||Yx(e,h)||Yx(p,h))&&(p[2]=1),m!==u)l=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(i&&e&&r^m){var v;g&n||!(v=a(p,e,!0))||(l=0,r?(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&&Yx(e,p)||t.point(p[0],p[1]),e=p,u=m,n=g},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),(function(e,r,i,o){hA(o,t,n,i,e,r)}),r?[0,-t]:[-vb,t-vb])}(_=t*_b):(_=null,dA),M()):_*Ab},C.clipExtent=function(t){return arguments.length?(D=null==t?(E=r=i=o=null,sb):vA(E=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),M()):null==E?null:[[E,r],[i,o]]},C.scale=function(t){return arguments.length?(f=+t,S()):f},C.translate=function(t){return arguments.length?(d=+t[0],h=+t[1],S()):[d,h]},C.center=function(t){return arguments.length?(p=t[0]%360*_b,m=t[1]%360*_b,S()):[p*Ab,m*Ab]},C.rotate=function(t){return arguments.length?(g=t[0]%360*_b,v=t[1]%360*_b,y=t.length>2?t[2]%360*_b:0,S()):[g*Ab,v*Ab,y*Ab]},C.angle=function(t){return arguments.length?(b=t%360*_b,S()):b*Ab},C.reflectX=function(t){return arguments.length?(x=t?-1:1,S()):x<0},C.reflectY=function(t){return arguments.length?(A=t?-1:1,S()):A<0},C.precision=function(t){return arguments.length?(a=NA(s,F=t*t),M()):Tb(F)},C.fitExtent=function(t,e){return CA(C,t,e)},C.fitSize=function(t,e){return kA(C,t,e)},C.fitWidth=function(t,e){return SA(C,t,e)},C.fitHeight=function(t,e){return MA(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&k,S()}}function LA(t){var e=0,n=vb/3,r=PA(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*_b,n=t[1]*_b):[e*Ab,n*Ab]},i}function jA(t,e){var n=Ob(t),r=(n+Ob(e))/2;if(wb(r)<mb)return function(t){var e=Fb(t);function n(t,n){return[t*e,Ob(n)/e]}return n.invert=function(t,n){return[t/e,Pb(n*e)]},n}(t);var i=1+n*(2*r-n),o=Tb(i)/r;function a(t,e){var n=Tb(i-2*r*Ob(e))/r;return[n*Ob(t*=r),o-n*Fb(t)]}return a.invert=function(t,e){var n=o-e,a=Db(t,wb(n))*Nb(n);return n*r<0&&(a-=vb*Nb(t)*Nb(n)),[a/r,Pb((i-(t*t+n*n)*r*r)/(2*r))]},a}function UA(){return LA(jA).scale(155.424).center([0,33.6442])}function IA(){return UA().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function qA(t){return function(e,n){var r=Fb(e),i=Fb(n),o=t(r*i);return o===1/0?[2,0]:[o*i*Ob(e),o*Ob(n)]}}function WA(t){return function(e,n){var r=Tb(e*e+n*n),i=t(r),o=Ob(i),a=Fb(i);return[Db(e*o,r*a),Pb(r&&n*o/r)]}}var HA=qA((function(t){return Tb(2/(1+t))}));HA.invert=WA((function(t){return 2*Pb(t/2)}));var XA=qA((function(t){return(t=Rb(t))&&t/Ob(t)}));function GA(t,e){return[t,Mb(zb((yb+e)/2))]}function JA(t){var e,n,r,i=RA(t),o=i.center,a=i.scale,s=i.translate,u=i.clipExtent,c=null;function l(){var o=vb*a(),s=i(function(t){function e(e){return(e=t(e[0]*_b,e[1]*_b))[0]*=Ab,e[1]*=Ab,e}return t=xA(t[0]*_b,t[1]*_b,t.length>2?t[2]*_b:0),e.invert=function(e){return(e=t.invert(e[0]*_b,e[1]*_b))[0]*=Ab,e[1]*=Ab,e},e}(i.rotate()).invert([0,0]));return u(null==c?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===GA?[[Math.max(s[0]-o,c),e],[Math.min(s[0]+o,n),r]]:[[c,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),l()):a()},i.translate=function(t){return arguments.length?(s(t),l()):s()},i.center=function(t){return arguments.length?(o(t),l()):o()},i.clipExtent=function(t){return arguments.length?(null==t?c=e=n=r=null:(c=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),l()):null==c?null:[[c,e],[n,r]]},l()}function $A(t){return zb((yb+t)/2)}function VA(t,e){var n=Fb(t),r=t===e?Ob(t):Mb(n/Fb(e))/Mb($A(e)/$A(t)),i=n*Bb($A(t),r)/r;if(!r)return GA;function o(t,e){i>0?e<-yb+mb&&(e=-yb+mb):e>yb-mb&&(e=yb-mb);var n=i/Bb($A(e),r);return[n*Ob(r*t),i-n*Fb(r*t)]}return o.invert=function(t,e){var n=i-e,o=Nb(r)*Tb(t*t+n*n),a=Db(t,wb(n))*Nb(n);return n*r<0&&(a-=vb*Nb(t)*Nb(n)),[a/r,2*Eb(Bb(i/o,1/r))-yb]},o}function YA(t,e){return[t,e]}function KA(t,e){var n=Fb(t),r=t===e?Ob(t):(n-Fb(e))/(e-t),i=n/r+t;if(wb(r)<mb)return YA;function o(t,e){var n=i-e,o=r*t;return[n*Ob(o),i-n*Fb(o)]}return o.invert=function(t,e){var n=i-e,o=Db(t,wb(n))*Nb(n);return n*r<0&&(o-=vb*Nb(t)*Nb(n)),[o/r,i-Nb(r)*Tb(t*t+n*n)]},o}XA.invert=WA((function(t){return t})),GA.invert=function(t,e){return[t,2*Eb(kb(e))-yb]},YA.invert=YA;var ZA=1.340264,QA=-.081106,t_=893e-6,e_=.003796,n_=Tb(3)/2;function r_(t,e){var n=Pb(n_*Ob(e)),r=n*n,i=r*r*r;return[t*Fb(n)/(n_*(ZA+3*QA*r+i*(7*t_+9*e_*r))),n*(ZA+QA*r+i*(t_+e_*r))]}function i_(t,e){var n=Fb(e),r=Fb(t)*n;return[n*Ob(t)/r,Ob(e)/r]}function o_(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function a_(t,e){return[Fb(e)*Ob(t),Ob(e)]}function s_(t,e){var n=Fb(e),r=1+Fb(t)*n;return[n*Ob(t)/r,Ob(e)/r]}function u_(t,e){return[Mb(zb((yb+e)/2)),-t]}r_.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(ZA+QA*i+o*(t_+e_*i))-e)/(ZA+3*QA*i+o*(7*t_+9*e_*i)))*r)*i*i,!(wb(n)<gb));++a);return[n_*t*(ZA+3*QA*i+o*(7*t_+9*e_*i))/Fb(r),Pb(Ob(r)/n_)]},i_.invert=WA(Eb),o_.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(wb(n)>mb&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},a_.invert=WA(Pb),s_.invert=WA((function(t){return 2*Eb(t)})),u_.invert=function(t,e){return[-e,2*Eb(kb(t))-yb]};var c_=Math.abs,l_=(Math.atan,Math.atan2,Math.ceil,Math.cos),f_=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),d_=(Math.tan,1e-6),h_=Math.PI,p_=h_/2,m_=(Math.SQRT1_2,v_(2));v_(h_);function g_(t){return t>1?p_:t<-1?-p_:Math.asin(t)}function v_(t){return t>0?Math.sqrt(t):0}function y_(t,e){var n,r=t*f_(e),i=30;do{e-=n=(e+f_(e)-r)/(1+l_(e))}while(c_(n)>d_&&--i>0);return e/2}var b_=function(t,e,n){function r(r,i){return[t*r*l_(i=y_(n,i)),e*f_(i)]}return r.invert=function(r,i){return i=g_(i/e),[r/(t*l_(i)),g_((2*i+f_(2*i))/n)]},r}(m_/p_,m_,h_);const x_=$x(),A_=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function __(t,e){if(!t||"string"!==typeof t)throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(E_[t]=function(t,e){return function n(){const r=e();return r.type=t,r.path=$x().projection(r),r.copy=r.copy||function(){const t=n();return A_.forEach((e=>{r[e]&&t[e](r[e]())})),t.path.pointRadius(r.path.pointRadius()),t},Tf(r)}}(t,e),this):E_[t]||null}function w_(t){return t&&t.path||x_}const E_={albers:IA,albersusa:function(){var t,e,n,r,i,o,a=IA(),s=UA().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=UA().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,e){o=[t,e]}};function l(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(r.point(e,a),o)||(i.point(e,a),o)}function f(){return t=e=null,l}return l.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(t)},l.stream=function(n){return t&&e===n?t:t=function(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i<e;)t[i].point(n,r)},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),u.stream(n)])},l.precision=function(t){return arguments.length?(a.precision(t),s.precision(t),u.precision(t),f()):a.precision()},l.scale=function(t){return arguments.length?(a.scale(t),s.scale(.35*t),u.scale(t),l.translate(a.translate())):a.scale()},l.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),o=+t[0],l=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,l-.238*e],[o+.455*e,l+.238*e]]).stream(c),r=s.translate([o-.307*e,l+.201*e]).clipExtent([[o-.425*e+mb,l+.12*e+mb],[o-.214*e-mb,l+.234*e-mb]]).stream(c),i=u.translate([o-.205*e,l+.212*e]).clipExtent([[o-.214*e+mb,l+.166*e+mb],[o-.115*e-mb,l+.234*e-mb]]).stream(c),f()},l.fitExtent=function(t,e){return CA(l,t,e)},l.fitSize=function(t,e){return kA(l,t,e)},l.fitWidth=function(t,e){return SA(l,t,e)},l.fitHeight=function(t,e){return MA(l,t,e)},l.scale(1070)},azimuthalequalarea:function(){return RA(HA).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return RA(XA).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return LA(VA).scale(109.5).parallels([30,30])},conicequalarea:UA,conicequidistant:function(){return LA(KA).scale(131.154).center([0,13.9389])},equalEarth:function(){return RA(r_).scale(177.158)},equirectangular:function(){return RA(YA).scale(152.63)},gnomonic:function(){return RA(i_).scale(144.049).clipAngle(60)},identity:function(){var t,e,n,r,i,o,a,s=1,u=0,c=0,l=1,f=1,d=0,h=null,p=1,m=1,g=EA({point:function(t,e){var n=b([t,e]);this.stream.point(n[0],n[1])}}),v=sb;function y(){return p=s*l,m=s*f,o=a=null,b}function b(n){var r=n[0]*p,i=n[1]*m;if(d){var o=i*t-r*e;r=r*t+i*e,i=o}return[r+u,i+c]}return b.invert=function(n){var r=n[0]-u,i=n[1]-c;if(d){var o=i*t+r*e;r=r*t-i*e,i=o}return[r/p,i/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=r=i=null,y()):v},b.clipExtent=function(t){return arguments.length?(v=null==t?(h=n=r=i=null,sb):vA(h=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),y()):null==h?null:[[h,n],[r,i]]},b.scale=function(t){return arguments.length?(s=+t,y()):s},b.translate=function(t){return arguments.length?(u=+t[0],c=+t[1],y()):[u,c]},b.angle=function(n){return arguments.length?(e=Ob(d=n%360*_b),t=Fb(d),y()):d*Ab},b.reflectX=function(t){return arguments.length?(l=t?-1:1,y()):l<0},b.reflectY=function(t){return arguments.length?(f=t?-1:1,y()):f<0},b.fitExtent=function(t,e){return CA(b,t,e)},b.fitSize=function(t,e){return kA(b,t,e)},b.fitWidth=function(t,e){return SA(b,t,e)},b.fitHeight=function(t,e){return MA(b,t,e)},b},mercator:function(){return JA(GA).scale(961/xb)},mollweide:function(){return RA(b_).scale(169.529)},naturalEarth1:function(){return RA(o_).scale(175.295)},orthographic:function(){return RA(a_).scale(249.5).clipAngle(90+mb)},stereographic:function(){return RA(s_).scale(250).clipAngle(142)},transversemercator:function(){var t=JA(u_),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 RU in E_)__(RU,E_[RU]);function D_(t,e,n){var r=Ho(t,e-mb,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function F_(t,e,n){var r=Ho(t,e-mb,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function C_(){var t,e,n,r,i,o,a,s,u,c,l,f,d=10,h=d,p=90,m=360,g=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return Ho(Cb(r/p)*p,n,p).map(l).concat(Ho(Cb(s/m)*m,a,m).map(f)).concat(Ho(Cb(e/d)*d,t,d).filter((function(t){return wb(t%p)>mb})).map(u)).concat(Ho(Cb(o/h)*h,i,h).filter((function(t){return wb(t%m)>mb})).map(c))}return v.lines=function(){return y().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(a).slice(1),l(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?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),v.precision(g)):[[r,s],[n,a]]},v.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),v.precision(g)):[[e,o],[t,i]]},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,u=D_(o,i,90),c=F_(e,t,g),l=D_(s,a,90),f=F_(r,n,g),v):g},v.extentMajor([[-180,-90+mb],[180,90-mb]]).extentMinor([[-180,-80-mb],[180,80+mb]])}function k_(){}const S_=[[],[[[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 M_(){var t=1,e=1,n=a;function r(t,e){return e.map((e=>i(t,e)))}function i(r,i){var a=[],s=[];return function(n,r,i){var a,s,u,c,l,f,d=new Array,h=new Array;a=s=-1,c=n[0]>=r,S_[c<<1].forEach(p);for(;++a<t-1;)u=c,c=n[a+1]>=r,S_[u|c<<1].forEach(p);S_[c<<0].forEach(p);for(;++s<e-1;){for(a=-1,c=n[s*t+t]>=r,l=n[s*t]>=r,S_[c<<1|l<<2].forEach(p);++a<t-1;)u=c,c=n[s*t+t+a+1]>=r,f=l,l=n[s*t+a+1]>=r,S_[u|c<<1|l<<2|f<<3].forEach(p);S_[c|l<<3].forEach(p)}a=-1,l=n[s*t]>=r,S_[l<<2].forEach(p);for(;++a<t-1;)f=l,l=n[s*t+a+1]>=r,S_[l<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+a,t[0][1]+s],u=[t[1][0]+a,t[1][1]+s],c=o(r),l=o(u);(e=h[c])?(n=d[l])?(delete h[e.end],delete d[n.start],e===n?(e.ring.push(u),i(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(u),h[e.end=l]=e):(e=d[l])?(n=h[c])?(delete d[e.start],delete h[n.end],e===n?(e.ring.push(u),i(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(r),d[e.start=c]=e):d[c]=h[l]={start:c,end:l,ring:[r,u]}}S_[l<<3].forEach(p)}(r,i,(t=>{n(t,r,i),function(t){var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];for(;++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}(t)>0?a.push([t]):s.push(t)})),s.forEach((t=>{for(var e,n=0,r=a.length;n<r;++n)if(-1!==B_((e=a[n])[0],t))return void e.push(t)})),{type:"MultiPolygon",value:i,coordinates:a}}function o(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,r,i){n.forEach((n=>{var o,a=n[0],s=n[1],u=0|a,c=0|s,l=r[c*t+u];a>0&&a<t&&u===a&&(o=r[c*t+u-1],n[0]=a+(i-o)/(l-o)-.5),s>0&&s<e&&c===s&&(o=r[(c-1)*t+u],n[1]=s+(i-o)/(l-o)-.5)}))}return r.contour=i,r.size=function(n){if(!arguments.length)return[t,e];var i=Math.floor(n[0]),o=Math.floor(n[1]);return i>=0&&o>=0||(0,m.vU)("invalid size"),t=i,e=o,r},r.smooth=function(t){return arguments.length?(n=t?a:k_,r):n===a},r}function B_(t,e){for(var n,r=-1,i=e.length;++r<i;)if(n=O_(t,e[r]))return n;return 0}function O_(t,e){for(var n=e[0],r=e[1],i=-1,o=0,a=t.length,s=a-1;o<a;s=o++){var u=t[o],c=u[0],l=u[1],f=t[s],d=f[0],h=f[1];if(N_(u,f,e))return 0;l>r!==h>r&&n<(d-c)*(r-l)/(h-l)+c&&(i=-i)}return i}function N_(t,e,n){var r,i,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)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}function T_(t,e,n){return function(r){var i=(0,m.We)(r),o=n?Math.min(i[0],0):i[0],a=i[1],s=a-o,u=e?j(o,a,t):s/(t+1);return Ho(o+u,a,u)}}function z_(t){no.call(this,null,t)}function R_(t,e,n,r,i){const o=t.x1||0,a=t.y1||0,s=e*n<0;function u(t){t.forEach(c)}function c(t){s&&t.reverse(),t.forEach(l)}function l(t){t[0]=(t[0]-o)*e+r,t[1]=(t[1]-a)*n+i}return function(t){return t.coordinates.forEach(u),t}}function P_(t,e,n){const r=t>=0?t:xo(e,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function L_(t){return(0,m.mf)(t)?t:(0,m.a9)(+t)}function j_(){var t=t=>t[0],e=t=>t[1],n=m.kX,r=[-1,-1],i=960,o=500,a=2;function s(s,u){const c=P_(r[0],s,t)>>a,l=P_(r[1],s,e)>>a,f=c?c+2:0,d=l?l+2:0,h=2*f+(i>>a),p=2*d+(o>>a),m=new Float32Array(h*p),g=new Float32Array(h*p);let v=m;s.forEach((r=>{const i=f+(+t(r)>>a),o=d+(+e(r)>>a);i>=0&&i<h&&o>=0&&o<p&&(m[i+o*h]+=+n(r))})),c>0&&l>0?(U_(h,p,m,g,c),I_(h,p,g,m,l),U_(h,p,m,g,c),I_(h,p,g,m,l),U_(h,p,m,g,c),I_(h,p,g,m,l)):c>0?(U_(h,p,m,g,c),U_(h,p,g,m,c),U_(h,p,m,g,c),v=g):l>0&&(I_(h,p,m,g,l),I_(h,p,g,m,l),I_(h,p,m,g,l),v=g);const y=u?Math.pow(2,-2*a):1/Sy(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+(i>>a),y2:d+(o>>a)}}return s.x=function(e){return arguments.length?(t=L_(e),s):t},s.y=function(t){return arguments.length?(e=L_(t),s):e},s.weight=function(t){return arguments.length?(n=L_(t),s):n},s.size=function(t){if(!arguments.length)return[i,o];var e=+t[0],n=+t[1];return e>=0&&n>=0||(0,m.vU)("invalid size"),i=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"),r=t,s):r},s}function U_(t,e,n,r,i){const o=1+(i<<1);for(let a=0;a<e;++a)for(let e=0,s=0;e<t+i;++e)e<t&&(s+=n[e+a*t]),e>=i&&(e>=o&&(s-=n[e-o+a*t]),r[e-i+a*t]=s/Math.min(e+1,t-1+o-e,o))}function I_(t,e,n,r,i){const o=1+(i<<1);for(let a=0;a<t;++a)for(let s=0,u=0;s<e+i;++s)s<e&&(u+=n[a+s*t]),s>=i&&(s>=o&&(u-=n[a+(s-o)*t]),r[a+(s-i)*t]=u/Math.min(s+1,e-1+o-s,o))}function q_(t){no.call(this,null,t)}z_.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)(z_,no,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=t.field||m.yR,o=M_().smooth(!1!==t.smooth),a=t.thresholds||function(t,e,n){const r=T_(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(t.map((t=>ao(e(t).values))))}(r,i,t),s=null===t.as?null:t.as||"contour",u=[];return r.forEach((e=>{const n=i(e),r=o.size([n.width,n.height])(n.values,(0,m.kJ)(a)?a:a(n.values));!function(t,e,n,r){let i=r.scale||e.scale,o=r.translate||e.translate;(0,m.mf)(i)&&(i=i(n,r));(0,m.mf)(o)&&(o=o(n,r));if((1===i||null==i)&&!o)return;const a=((0,m.hj)(i)?i:i[0])||1,s=((0,m.hj)(i)?i:i[1])||1,u=o&&o[0]||0,c=o&&o[1]||0;t.forEach(R_(e,a,s,u,c))}(r,n,e,t),r.forEach((t=>{u.push(Ci(e,Di(null!=s?{[s]:t}:t)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}}),q_.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 W_=["x","y","weight","size","cellSize","bandwidth"];function H_(t,e){return W_.forEach((n=>null!=e[n]?t[n](e[n]):0)),t}function X_(t){no.call(this,null,t)}(0,m.XW)(q_,no,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=function(t,e){var n,r,i,o,a,s,u=[],c=t=>t(o);if(null==e)u.push(t);else for(n={},r=0,i=t.length;r<i;++r)o=t[r],(s=n[a=e.map(c)])||(n[a]=s=[],s.dims=a,u.push(s)),s.push(o);return u}(e.materialize(e.SOURCE).source,t.groupby),o=(t.groupby||[]).map(m.el),a=H_(j_(),t),s=t.as||"grid";return n=i.map((e=>Di(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&&(r.rem=this.value),this.value=r.source=r.add=n,r}}),X_.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)(X_,no,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),o=M_().smooth(!1!==t.smooth),a=t.values,s=t.thresholds||T_(t.count||10,t.nice,!!a),u=t.size;return a||(a=e.materialize(e.SOURCE).source,r=R_(n=H_(j_(),t)(a,!0),n.scale||1,n.scale||1,0,0),u=[n.width,n.height],a=n.values),s=(0,m.kJ)(s)?s:s(a),a=o.size(u)(a,s),r&&a.forEach(r),this.value&&(i.rem=this.value),this.value=i.source=i.add=(a||[]).map(Di),i}});const G_="Feature",J_="FeatureCollection";function $_(t){no.call(this,null,t)}function V_(t){no.call(this,null,t)}function Y_(t){no.call(this,null,t)}function K_(t){no.call(this,null,t)}function Z_(t){no.call(this,[],t),this.generator=C_()}function Q_(t){no.call(this,null,t)}function tw(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 ew(t){no.call(this,null,t),this.modified(!0)}function nw(t,e,n){(0,m.mf)(t[e])&&t[e](n)}function rw(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,c,l,f,d,h=t._root,p={data:r},m=t._x0,g=t._y0,v=t._x1,y=t._y1;if(!h)return t._root=p,t;for(;h.length;)if((c=e>=(o=(m+v)/2))?m=o:v=o,(l=n>=(a=(g+y)/2))?g=a:y=a,i=h,!(h=h[f=l<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,h.data),u=+t._y.call(null,h.data),e===s&&n===u)return p.next=h,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(o=(m+v)/2))?m=o:v=o,(l=n>=(a=(g+y)/2))?g=a:y=a}while((f=l<<1|c)===(d=(u>=a)<<1|s>=o));return i[d]=h,i[f]=p,t}function iw(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function ow(t){return t[0]}function aw(t){return t[1]}function sw(t,e,n){var r=new uw(null==e?ow:e,null==n?aw:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function uw(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function cw(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}$_.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},(0,m.XW)($_,no,{transform(t,e){var n,r=this._features,i=this._points,o=t.fields,a=o&&o[0],s=o&&o[1],u=t.geojson||!o&&m.yR,c=e.ADD;n=t.modified()||e.changed(e.REM)||e.modified((0,m.Oj)(u))||a&&e.modified((0,m.Oj)(a))||s&&e.modified((0,m.Oj)(s)),this.value&&!n||(c=e.SOURCE,this._features=r=[],this._points=i=[]),u&&e.visit(c,(t=>r.push(u(t)))),a&&s&&(e.visit(c,(t=>{var e=a(t),n=s(t);null!=e&&null!=n&&(e=+e)===e&&(n=+n)===n&&i.push([e,n])})),r=r.concat({type:G_,geometry:{type:"MultiPoint",coordinates:i}})),this.value={type:J_,features:r}}}),V_.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)(V_,no,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||m.yR,o=t.as||"path",a=n.SOURCE;!r||t.modified()?(this.value=r=w_(t.projection),n.materialize().reflow()):a=i===m.yR||e.modified(i.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}(r,t.pointRadius);return n.visit(a,(t=>t[o]=r(i(t)))),r.pointRadius(s),n.modifies(o)}}),Y_.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)(Y_,no,{transform(t,e){var n,r=t.projection,i=t.fields[0],o=t.fields[1],a=t.as||["x","y"],s=a[0],u=a[1];function c(t){const e=r([i(t),o(t)]);e?(t[s]=e[0],t[u]=e[1]):(t[s]=void 0,t[u]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,c):(n=e.modified(i.fields)||e.modified(o.fields),e.visit(n?e.ADD_MOD:e.ADD,c)),e.modifies(a)}}),K_.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)(K_,no,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.as||"shape",o=n.ADD;return r&&!t.modified()||(this.value=r=function(t,e,n){const r=null==n?n=>t(e(n)):r=>{var i=t.pointRadius(),o=t.pointRadius(n)(e(r));return t.pointRadius(i),o};return r.context=e=>(t.context(e),r),r}(w_(t.projection),t.field||(0,m.EP)("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(t=>t[i]=r)),n.modifies(i)}}),Z_.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)(Z_,no,{transform(t,e){var n,r=this.value,i=this.generator;if(!r.length||t.modified())for(const o in t)(0,m.mf)(i[o])&&i[o](t[o]);return n=i(),r.length?e.mod.push(ki(r[0],n)):e.add.push(Di(n)),r[0]=n,e}}),Q_.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)(Q_,no,{transform(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,r="shared"===t.resolve,i=t.field||m.yR,o=function(t,e){let n;(0,m.mf)(t)?(n=n=>t(n,e),n.dep=tw(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,Zu.B8)(t(n,e)),n.dep=tw(t)):n=(0,m.a9)((0,Zu.B8)(t||"#888"));return n}(t.color,t),s=t.as||"image",u={$x:0,$y:0,$value:0,$max:r?ao(n.map((t=>ao(i(t).values)))):0};return n.forEach((t=>{const e=i(t),n=(0,m.l7)({},t,u);r||(n.$max=ao(e.values||[])),t[s]=function(t,e,n,r){const i=t.width,o=t.height,a=t.x1||0,s=t.y1||0,u=t.x2||i,c=t.y2||o,l=t.values,f=l?t=>l[t]:m.bM,d=Gu(u-a,c-s),h=d.getContext("2d"),p=h.getImageData(0,0,u-a,c-s),g=p.data;for(let m=s,v=0;m<c;++m){e.$y=m-s;for(let t=a,o=m*i;t<u;++t,v+=4){e.$x=t-a,e.$value=f(t+o);const i=n(e);g[v+0]=i.r,g[v+1]=i.g,g[v+2]=i.b,g[v+3]=~~(255*r(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)(ew,no,{transform(t,e){let n=this.value;return!n||t.modified("type")?(this.value=n=function(t){const e=__((t||"mercator").toLowerCase());e||(0,m.vU)("Unrecognized projection type: "+t);return e()}(t.type),A_.forEach((e=>{null!=t[e]&&nw(n,e,t[e])}))):A_.forEach((e=>{t.modified(e)&&nw(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:J_,features:t.reduce(((t,e)=>t.concat(function(t){return t.type===J_?t.features:(0,m.IX)(t).filter((t=>null!=t)).map((t=>t.type===G_?t:{type:G_,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 lw=sw.prototype=uw.prototype;function fw(t){return function(){return t}}function dw(t){return 1e-6*(t()-.5)}function hw(t){return t.x+t.vx}function pw(t){return t.y+t.vy}lw.copy=function(){var t,e,n=new uw(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=cw(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=cw(e));return n},lw.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return rw(this.cover(e,n),e,n,t)},lw.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,c=1/0,l=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<u&&(u=r),r>l&&(l=r),i<c&&(c=i),i>f&&(f=i));if(u>l||c>f)return this;for(this.cover(u,c).cover(l,f),n=0;n<o;++n)rw(this,a[n],s[n],t[n]);return this},lw.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,u=i-n||1,c=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=c,c=a,u*=2,s){case 0:i=n+u,o=r+u;break;case 1:n=i-u,o=r+u;break;case 2:i=n+u,r=o-u;break;case 3:n=i-u,r=o-u}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},lw.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},lw.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]]},lw.find=function(t,e,n){var r,i,o,a,s,u,c,l=this._x0,f=this._y0,d=this._x1,h=this._y1,p=[],m=this._root;for(m&&p.push(new iw(m,l,f,d,h)),null==n?n=1/0:(l=t-n,f=e-n,d=t+n,h=e+n,n*=n);u=p.pop();)if(!(!(m=u.node)||(i=u.x0)>d||(o=u.y0)>h||(a=u.x1)<l||(s=u.y1)<f))if(m.length){var g=(i+a)/2,v=(o+s)/2;p.push(new iw(m[3],g,v,a,s),new iw(m[2],i,v,g,s),new iw(m[1],g,o,a,v),new iw(m[0],i,o,g,v)),(c=(e>=v)<<1|t>=g)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}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 A=Math.sqrt(n=x);l=t-A,f=e-A,d=t+A,h=e+A,r=m.data}}return r},lw.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,u,c,l,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((c=o>=(s=(p+g)/2))?p=s:g=s,(l=a>=(u=(m+v)/2))?m=u:v=u,e=h,!(h=h[f=l<<1|c]))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(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i: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=i,this)},lw.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},lw.root=function(){return this._root},lw.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},lw.visit=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new iw(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var c=(r+o)/2,l=(i+a)/2;(n=u[3])&&s.push(new iw(n,c,l,o,a)),(n=u[2])&&s.push(new iw(n,r,l,c,a)),(n=u[1])&&s.push(new iw(n,c,i,o,l)),(n=u[0])&&s.push(new iw(n,r,i,c,l))}return this},lw.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new iw(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.x1,c=e.y1,l=(a+u)/2,f=(s+c)/2;(o=i[0])&&n.push(new iw(o,a,s,l,f)),(o=i[1])&&n.push(new iw(o,l,s,u,f)),(o=i[2])&&n.push(new iw(o,a,f,l,c)),(o=i[3])&&n.push(new iw(o,l,f,u,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},lw.x=function(t){return arguments.length?(this._x=t,this):this._x},lw.y=function(t){return arguments.length?(this._y=t,this):this._y};var mw={value:()=>{}};function gw(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new vw(r)}function vw(t){this._=t}function yw(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function bw(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=mw,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}vw.prototype=gw.prototype={constructor:vw,on:function(t,e){var n,r,i=this._,o=(r=i,(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&&!r.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)i[n]=bw(i[n],t.name,e);else if(null==e)for(n in i)i[n]=bw(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=yw(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new vw(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const xw=gw;var Aw=n(89121);const _w=1664525,ww=1013904223,Ew=4294967296;function Dw(t){return t.x}function Fw(t){return t.y}var Cw=10,kw=Math.PI*(3-Math.sqrt(5));function Sw(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=(0,Aw.HT)(f),c=xw("tick","end"),l=function(){let t=1;return()=>(t=(_w*t+ww)%Ew)/Ew}();function f(){d(),c.call("tick",e),n<r&&(u.stop(),c.call("end",e))}function d(r){var u,c,l=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),u=0;u<l;++u)null==(c=t[u]).fx?c.x+=c.vx*=a:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=a:(c.y=c.fy,c.vy=0);return e}function h(){for(var e,n=0,r=t.length;n<r;++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 i=Cw*Math.sqrt(.5+n),o=n*kw;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,l),e}return null==t&&(t=[]),h(),e={tick:d,restart:function(){return u.restart(f),e},stop:function(){return u.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?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},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?(l=t,s.forEach(p),e):l},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,r){var i,o,a,s,u,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c<l;++c)(a=(i=e-(s=t[c]).x)*i+(o=n-s.y)*o)<r&&(u=s,r=a);return u},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}}function Mw(t){return t.index}function Bw(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}const Ow={center:function(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;i<a;++i)s+=(o=n[i]).x,u+=o.y;for(s=(s/a-t)*r,u=(u/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=u}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i},collide:function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,u,c,l,f,d,h=e.length,p=0;p<o;++p)for(a=sw(e,hw,pw).visitAfter(s),t=0;t<h;++t)u=e[t],f=n[u.index],d=f*f,c=u.x+u.vx,l=u.y+u.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>c+p||o<c-p||n>l+p||a<l-p;if(s.index>u.index){var m=c-s.x-s.vx,g=l-s.y-s.vy,v=m*m+g*g;v<p*p&&(0===m&&(v+=(m=dw(r))*m),0===g&&(v+=(g=dw(r))*g),v=(p-(v=Math.sqrt(v)))/v*i,u.vx+=(m*=v)*(p=(h*=h)/(d+h)),u.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 u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!==typeof t&&(t=fw(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,u()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"===typeof e?e:fw(+e),u(),a):t},a},nbody:function(){var t,e,n,r,i,o=fw(-30),a=1,s=1/0,u=.81;function c(n){var i,o=t.length,a=sw(t,Dw,Fw).visitAfter(f);for(r=n,i=0;i<o;++i)e=t[i],a.visit(d)}function l(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function f(t){var e,n,r,o,a,s=0,u=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,u+=n,r+=n*e.x,o+=n*e.y);t.x=r/u,t.y=o/u}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function d(t,o,c,l){if(!t.value)return!0;var f=t.x-e.x,d=t.y-e.y,h=l-o,p=f*f+d*d;if(h*h/u<p)return p<s&&(0===f&&(p+=(f=dw(n))*f),0===d&&(p+=(d=dw(n))*d),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*r/p,e.vy+=d*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=dw(n))*f),0===d&&(p+=(d=dw(n))*d),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(h=i[t.data.index]*r/p,e.vx+=f*h,e.vy+=d*h)}while(t=t.next)}}return c.initialize=function(e,r){t=e,n=r,l()},c.strength=function(t){return arguments.length?(o="function"===typeof t?t:fw(+t),l(),c):o},c.distanceMin=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.distanceMax=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c.theta=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c},link:function(t){var e,n,r,i,o,a,s=Mw,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=fw(30),l=1;function f(r){for(var i=0,s=t.length;i<l;++i)for(var u,c,f,d,h,p,m,g=0;g<s;++g)c=(u=t[g]).source,d=(f=u.target).x+f.vx-c.x-c.vx||dw(a),h=f.y+f.vy-c.y-c.vy||dw(a),d*=p=((p=Math.sqrt(d*d+h*h))-n[g])/p*r*e[g],h*=p,f.vx-=d*(m=o[g]),f.vy-=h*m,c.vx+=d*(m=1-m),c.vy+=h*m}function d(){if(r){var a,u,c=r.length,l=t.length,f=new Map(r.map(((t,e)=>[s(t,e,r),t])));for(a=0,i=new Array(c);a<l;++a)(u=t[a]).index=a,"object"!==typeof u.source&&(u.source=Bw(f,u.source)),"object"!==typeof u.target&&(u.target=Bw(f,u.target)),i[u.source.index]=(i[u.source.index]||0)+1,i[u.target.index]=(i[u.target.index]||0)+1;for(a=0,o=new Array(l);a<l;++a)u=t[a],o[a]=i[u.source.index]/(i[u.source.index]+i[u.target.index]);e=new Array(l),h(),n=new Array(l),p()}}function h(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+u(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){r=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?(l=+t,f):l},f.strength=function(t){return arguments.length?(u="function"===typeof t?t:fw(+t),h(),f):u},f.distance=function(t){return arguments.length?(c="function"===typeof t?t:fw(+t),p(),f):c},f},x:function(t){var e,n,r,i=fw(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!==typeof t&&(t=fw(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"===typeof t?t:fw(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"===typeof e?e:fw(+e),a(),o):t},o},y:function(t){var e,n,r,i=fw(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!==typeof t&&(t=fw(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"===typeof t?t:fw(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"===typeof e?e:fw(+e),a(),o):t},o}},Nw="forces",Tw=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],zw=["static","iterations"],Rw=["x","y","vx","vy"];function Pw(t){no.call(this,null,t)}function Lw(t,e,n,r){var i,o,a,s,u=(0,m.IX)(e.forces);for(i=0,o=Tw.length;i<o;++i)(a=Tw[i])!==Nw&&e.modified(a)&&t[a](e[a]);for(i=0,o=u.length;i<o;++i)s=Nw+i,(a=n||e.modified(Nw,i)?Uw(u[i]):r&&jw(u[i],r)?t.force(s):null)&&t.force(s,a);for(o=t.numForces||0;i<o;++i)t.force(Nw+i,null);return t.numForces=u.length,t}function jw(t,e){var n,r;for(n in t)if((0,m.mf)(r=t[n])&&e.modified((0,m.Oj)(r)))return 1;return 0}function Uw(t){var e,n;for(n in(0,m.nr)(Ow,t.force)||(0,m.vU)("Unrecognized force: "+t.force),e=Ow[t.force](),t)(0,m.mf)(e[n])&&Iw(e[n],t[n],t);return e}function Iw(t,e,n){t((0,m.mf)(e)?t=>e(t,n):e)}function qw(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function Ww(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Xw)):void 0===e&&(e=Hw);for(var n,r,i,o,a,s=new $w(t),u=[s];n=u.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new $w(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Jw)}function Hw(t){return t.children}function Xw(t){return Array.isArray(t)?t[1]:null}function Gw(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Jw(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function $w(t){this.data=t,this.depth=this.height=0,this.parent=null}function Vw(t){return null==t?null:Yw(t)}function Yw(t){if("function"!==typeof t)throw new Error;return t}function Kw(){return 0}function Zw(t){return function(){return t}}Pw.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:Rw}]},(0,m.XW)(Pw,no,{transform(t,e){var n,r,i=this.value,o=e.changed(e.ADD_REM),a=t.modified(Tw),s=t.iterations||300;if(i?(o&&(e.modifies("index"),i.nodes(e.source)),(a||e.changed(e.MOD))&&Lw(i,t,0,e)):(this.value=i=function(t,e){const n=Sw(t),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),Lw(n,e,!0).on("end",(()=>o=!0))}(e.source,t),i.on("tick",(n=e.dataflow,r=this,()=>n.touch(r).run())),t.static||(o=!0,i.tick()),e.modifies("index")),a||o||t.modified(zw)||e.changed()&&t.restart)if(i.alpha(Math.max(i.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/s)),t.static)for(i.stop();--s>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return e.StopPropagation;return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let s,u=this._argops,c=0,l=u.length;c<l;++c)if(s=u[c],s.name===Nw&&"link"===s.op._argval.force)for(var r,i=s.op._argops,o=0,a=i.length;o<a;++o)if("links"===i[o].name&&(r=i[o].op.source)){n.pulse(r,n.changeset().reflow());break}return e.reflow(t.modified()).modifies(Rw)}}),$w.prototype=Ww.prototype={constructor:$w,count:function(){return this.eachAfter(qw)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],u=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)t.call(e,o,++u,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(t.call(e,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].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(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},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 Ww(this).eachBefore(Gw)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n])}while(o.length)}};const Qw=1664525,tE=1013904223,eE=4294967296;function nE(t,e){for(var n,r,i=0,o=(t=function(t,e){let n,r,i=t.length;for(;i;)r=e()*i--|0,n=t[i],t[i]=t[r],t[r]=n;return t}(Array.from(t),e)).length,a=[];i<o;)n=t[i],r&&oE(r,n)?++i:(r=sE(a=rE(a,n)),i=0);return r}function rE(t,e){var n,r;if(aE(e,t))return[e];for(n=0;n<t.length;++n)if(iE(e,t[n])&&aE(uE(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(iE(uE(t[n],t[r]),e)&&iE(uE(t[n],e),t[r])&&iE(uE(t[r],e),t[n])&&aE(cE(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function iE(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function oE(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function aE(t,e){for(var n=0;n<e.length;++n)if(!oE(t,e[n]))return!1;return!0}function sE(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return uE(t[0],t[1]);case 3:return cE(t[0],t[1],t[2])}}function uE(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,s=e.r,u=o-n,c=a-r,l=s-i,f=Math.sqrt(u*u+c*c);return{x:(n+o+u/f*l)/2,y:(r+a+c/f*l)/2,r:(f+i+s)/2}}function cE(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,s=e.y,u=e.r,c=n.x,l=n.y,f=n.r,d=r-a,h=r-c,p=i-s,m=i-l,g=u-o,v=f-o,y=r*r+i*i-o*o,b=y-a*a-s*s+u*u,x=y-c*c-l*l+f*f,A=h*p-d*m,_=(p*x-m*b)/(2*A)-r,w=(m*g-p*v)/A,E=(h*b-d*x)/(2*A)-i,D=(d*v-h*g)/A,F=w*w+D*D-1,C=2*(o+_*w+E*D),k=_*_+E*E-o*o,S=-(Math.abs(F)>1e-6?(C+Math.sqrt(C*C-4*F*k))/(2*F):k/C);return{x:r+_+w*S,y:i+E+D*S,r:S}}function lE(t,e,n){var r,i,o,a,s=t.x-e.x,u=t.y-e.y,c=s*s+u*u;c?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(c+a-i)/(2*c),o=Math.sqrt(Math.max(0,a/c-r*r)),n.x=t.x-r*s-o*u,n.y=t.y-r*u+o*s):(r=(c+i-a)/(2*c),o=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-o*u,n.y=e.y+r*u+o*s)):(n.x=e.x+n.r,n.y=e.y)}function fE(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function dE(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function hE(t){this._=t,this.next=null,this.previous=null}function pE(t,e){if(!(o=(t=function(t){return"object"===typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,r,i,o,a,s,u,c,l,f,d;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;lE(r,n,i=t[2]),n=new hE(n),r=new hE(r),i=new hE(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(u=3;u<o;++u){lE(n._,r._,i=t[u]),i=new hE(i),c=r.next,l=n.previous,f=r._.r,d=n._.r;do{if(f<=d){if(fE(c._,i._)){r=c,n.next=r,r.previous=n,--u;continue t}f+=c._.r,c=c.next}else{if(fE(l._,i._)){(n=l).next=r,r.previous=n,--u;continue t}d+=l._.r,l=l.previous}}while(c!==l.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=dE(n);(i=i.next)!==r;)(s=dE(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=nE(n,e),u=0;u<o;++u)(n=t[u]).x-=i.x,n.y-=i.y;return i.r}function mE(t){return Math.sqrt(t.value)}function gE(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function vE(t,e,n){return function(r){if(i=r.children){var i,o,a,s=i.length,u=t(r)*e||0;if(u)for(o=0;o<s;++o)i[o].r+=u;if(a=pE(i,n),u)for(o=0;o<s;++o)i[o].r-=u;r.r=a+u}}}function yE(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 bE(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 xE(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,c=t.value&&(r-e)/t.value;++s<u;)(o=a[s]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*c}var AE={depth:-1},_E={},wE={};function EE(t){return t.id}function DE(t){return t.parentId}function FE(){var t,e=EE,n=DE;function r(r){var i,o,a,s,u,c,l,f,d=Array.from(r),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,r)))),n=e.map(CE),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(CE(t)),d.push(wE));h=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,i=d.length;a<i;++a)o=d[a],c=d[a]=new $w(o),null!=(l=h(o,a,r))&&(l+="")&&(f=c.id=l,m.set(f,m.has(f)?_E:c)),null!=(l=p(o,a,r))&&(l+="")&&(c.parent=l);for(a=0;a<i;++a)if(l=(c=d[a]).parent){if(!(u=m.get(l)))throw new Error("missing: "+l);if(u===_E)throw new Error("ambiguous: "+l);u.children?u.children.push(c):u.children=[c],c.parent=u}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=t){for(;s.data===wE&&1===s.children.length;)s=s.children[0],--i;for(let t=d.length-1;t>=0&&(c=d[t]).data===wE;--t)c.data=null}if(s.parent=AE,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(Jw),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=Vw(t),r):e},r.parentId=function(t){return arguments.length?(n=Vw(t),r):n},r.path=function(e){return arguments.length?(t=Vw(e),r):t},r}function CE(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 SE(t,e){return t.parent===e.parent?1:2}function ME(t){var e=t.children;return e?e[0]:t.t}function BE(t){var e=t.children;return e?e[e.length-1]:t.t}function OE(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function NE(t,e,n){return t.a.parent===e.parent?t.a:n}function TE(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 zE(t,e){return t.parent===e.parent?1:2}function RE(t,e){return t+e.x}function PE(t,e){return Math.max(t,e.y)}function LE(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,c=t.value&&(i-n)/t.value;++s<u;)(o=a[s]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*c}TE.prototype=Object.create($w.prototype);var jE=(1+Math.sqrt(5))/2;function UE(t,e,n,r,i,o){for(var a,s,u,c,l,f,d,h,p,m,g,v=[],y=e.children,b=0,x=0,A=y.length,_=e.value;b<A;){u=i-n,c=o-r;do{l=y[x++].value}while(!l&&x<A);for(f=d=l,g=l*l*(m=Math.max(c/u,u/c)/(_*t)),p=Math.max(d/g,g/f);x<A;++x){if(l+=s=y[x].value,s<f&&(f=s),s>d&&(d=s),g=l*l*m,(h=Math.max(d/g,g/f))>p){l-=s;break}p=h}v.push(a={value:l,dice:u<c,children:y.slice(b,x)}),a.dice?xE(a,n,r,i,_?r+=c*l/_:o):LE(a,n,r,_?n+=u*l/_:i,o),_-=l,b=x}return v}const IE=function t(e){function n(t,n,r,i,o){UE(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(jE),qE=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,u,c,l,f=-1,d=a.length,h=t.value;++f<d;){for(u=(s=a[f]).children,c=s.value=0,l=u.length;c<l;++c)s.value+=u[c].value;s.dice?xE(s,n,r,i,h?r+=(o-r)*s.value/h:o):LE(s,n,r,h?n+=(i-n)*s.value/h:i,o),h-=s.value}else t._squarify=a=UE(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(jE);function WE(t,e,n){const r={};return t.each((t=>{const i=t.data;n(i)&&(r[e(i)]=t)})),t.lookup=r,t}function HE(t){no.call(this,null,t)}HE.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const XE=t=>t.values;function GE(){const t=[],e={entries:t=>r(n(t,0),0),key:n=>(t.push(n),e)};function n(e,r){if(r>=t.length)return e;const i=e.length,o=t[r++],a={},s={};let u,c,l,f=-1;for(;++f<i;)u=o(c=e[f])+"",(l=a[u])?l.push(c):a[u]=[c];for(u in a)s[u]=n(a[u],r);return s}function r(e,n){if(++n>t.length)return e;const i=[];for(const t in e)i.push({key:t,values:r(e[t],n)});return i}return e}function JE(t){no.call(this,null,t)}(0,m.XW)(HE,no,{transform(t,e){e.source||(0,m.vU)("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),i=e.clone(),o=this.value;return(!o||r||e.changed())&&(o&&o.each((t=>{t.children&&_i(t.data)&&i.rem.push(t.data)})),this.value=o=Ww({values:(0,m.IX)(t.keys).reduce(((t,e)=>(t.key(e),t)),GE()).entries(i.source)},XE),n&&o.each((t=>{t.children&&(t=Di(t.data),i.add.push(t),i.source.push(t))})),WE(o,wi,wi)),i.source.root=o,i}});const $E=(t,e)=>t.parent===e.parent?1:2;(0,m.XW)(JE,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),r=this.fields,i=e.source.root,o=t.as||r;t.field?i.sum(t.field):i.count(),t.sort&&i.sort(Si(t.sort,(t=>t.data))),function(t,e,n){for(let r,i=0,o=e.length;i<o;++i)r=e[i],r in n&&t[r](n[r])}(n,this.params,t),n.separation&&n.separation(!1!==t.separation?$E:m.kX);try{this.value=n(i)}catch(a){(0,m.vU)(a)}return i.each((t=>function(t,e,n){const r=t.data,i=e.length-1;for(let o=0;o<i;++o)r[n[o]]=t[e[o]];r[n[i]]=t.children?t.children.length:0}(t,r,o))),e.reflow(t.modified()).modifies(o).modifies("leaf")}});const VE=["x","y","r","depth","children"];function YE(t){JE.call(this,t)}YE.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:VE.length,default:VE}]},(0,m.XW)(YE,JE,{layout:function(){var t=null,e=1,n=1,r=Kw;function i(i){const o=function(){let t=1;return()=>(t=(Qw*t+tE)%eE)/eE}();return i.x=e/2,i.y=n/2,t?i.eachBefore(gE(t)).eachAfter(vE(r,.5,o)).eachBefore(yE(1)):i.eachBefore(gE(mE)).eachAfter(vE(Kw,1,o)).eachAfter(vE(r,i.r/Math.min(e,n),o)).eachBefore(yE(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=Vw(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"===typeof t?t:Zw(+t),i):r},i},params:["radius","size","padding"],fields:VE});const KE=["x0","y0","x1","y1","depth","children"];function ZE(t){JE.call(this,t)}function QE(t){no.call(this,null,t)}ZE.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:KE.length,default:KE}]},(0,m.XW)(ZE,JE,{layout:function(){var t=1,e=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/o,i.eachBefore(function(t,e){return function(r){r.children&&xE(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,o=r.y0,a=r.x1-n,s=r.y1-n;a<i&&(i=a=(i+a)/2),s<o&&(o=s=(o+s)/2),r.x0=i,r.y0=o,r.x1=a,r.y1=s}}(e,o)),r&&i.eachBefore(bE),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(n){return arguments.length?(t=+n[0],e=+n[1],i):[t,e]},i.padding=function(t){return arguments.length?(n=+t,i):n},i},params:["size","round","padding"],fields:KE}),QE.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},(0,m.XW)(QE,no,{transform(t,e){e.source||(0,m.vU)("Stratify transform requires an upstream data source.");let n=this.value;const r=t.modified(),i=e.fork(e.ALL).materialize(e.SOURCE),o=!n||r||e.changed(e.ADD_REM)||e.modified(t.key.fields)||e.modified(t.parentKey.fields);return i.source=i.source.slice(),o&&(n=i.source.length?WE(FE().id(t.key).parentId(t.parentKey)(i.source),t.key,m.yb):WE(FE()([{}]),t.key,t.key)),i.source.root=this.value=n,i}});const tD={tidy:function(){var t=SE,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,o,a=new TE(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new TE(r[i],i)),n.parent=e;return(a.parent=new TE(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var c=i,l=i,f=i;i.eachBefore((function(t){t.x<c.x&&(c=t),t.x>l.x&&(l=t),t.depth>f.depth&&(f=t)}));var d=c===l?1:t(c,l)/2,h=d-c.x,p=e/(l.x+d+h),m=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+h)*p,t.y=t.depth*m}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,u=o.parent.children[0],c=o.m,l=a.m,f=s.m,d=u.m;s=BE(s),o=ME(o),s&&o;)u=ME(u),(a=BE(a)).a=e,(i=s.z+f-o.z-c+t(s._,o._))>0&&(OE(NE(s,e,r),e,i),c+=i,l+=i),f+=s.m,c+=o.m,d+=u.m,l+=a.m;s&&!BE(a)&&(a.t=s,a.m+=f-l),o&&!ME(u)&&(u.t=o,u.m+=c-d,r=e)}return r}(e,i,e.parent.A||r[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 i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},cluster:function(){var t=zE,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(RE,0)/t.length}(n),e.y=function(t){return 1+t.reduce(PE,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}(i),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),c=s.x-t(s,u)/2,l=u.x+t(u,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-c)/(l-c)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}},eD=["x","y","depth","children"];function nD(t){JE.call(this,t)}function rD(t){no.call(this,[],t)}nD.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)(nD,JE,{layout(t){const e=t||"tidy";if((0,m.nr)(tD,e))return tD[e]();(0,m.vU)("Unrecognized Tree layout method: "+e)},params:["size","nodeSize"],fields:eD}),rD.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},(0,m.XW)(rD,no,{transform(t,e){const n=this.value,r=e.source&&e.source.root,i=e.fork(e.NO_SOURCE),o={};return r||(0,m.vU)("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(i.rem=n,e.visit(e.SOURCE,(t=>o[wi(t)]=1)),r.each((t=>{const e=t.data,n=t.parent&&t.parent.data;n&&o[wi(e)]&&o[wi(n)]&&i.add.push(Di({source:n,target:e}))})),this.value=i.add):e.changed(e.MOD)&&(e.visit(e.MOD,(t=>o[wi(t)]=1)),n.forEach((t=>{(o[wi(t.source)]||o[wi(t.target)])&&i.mod.push(t)}))),i}});const iD={binary:function(t,e,n,r,i){var o,a,s=t.children,u=s.length,c=new Array(u+1);for(c[0]=a=o=0;o<u;++o)c[o+1]=a+=s[o].value;!function t(e,n,r,i,o,a,u){if(e>=n-1){var l=s[e];return l.x0=i,l.y0=o,l.x1=a,void(l.y1=u)}var f=c[e],d=r/2+f,h=e+1,p=n-1;for(;h<p;){var m=h+p>>>1;c[m]<d?h=m+1:p=m}d-c[h-1]<c[h]-d&&e+1<h&&--h;var g=c[h]-f,v=r-g;if(a-i>u-o){var y=r?(i*v+a*g)/r:a;t(e,h,g,i,o,y,u),t(h,n,v,y,o,a,u)}else{var b=r?(o*v+u*g)/r:u;t(e,h,g,i,o,a,b),t(h,n,v,i,b,a,u)}}(0,u,t.value,e,n,r,i)},dice:xE,slice:LE,slicedice:function(t,e,n,r,i){(1&t.depth?LE:xE)(t,e,n,r,i)},squarify:IE,resquarify:qE},oD=["x0","y0","x1","y1","depth","children"];function aD(t){JE.call(this,t)}function sD(t,e,n){return t.fields=e||[],t.fname=n,t}function uD(t){return 1===t.length?cD(t[0]):lD(t)}aD.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:oD.length,default:oD}]},(0,m.XW)(aD,JE,{layout(){const t=function(){var t=IE,e=!1,n=1,r=1,i=[0],o=Kw,a=Kw,s=Kw,u=Kw,c=Kw;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(bE),t}function f(e){var n=i[e.depth],r=e.x0+n,l=e.y0+n,f=e.x1-n,d=e.y1-n;f<r&&(r=f=(r+f)/2),d<l&&(l=d=(l+d)/2),e.x0=r,e.y0=l,e.x1=f,e.y1=d,e.children&&(n=i[e.depth+1]=o(e)/2,r+=c(e)-n,l+=a(e)-n,(f-=s(e)-n)<r&&(r=f=(r+f)/2),(d-=u(e)-n)<l&&(l=d=(l+d)/2),t(e,r,l,f,d))}return l.round=function(t){return arguments.length?(e=!!t,l):e},l.size=function(t){return arguments.length?(n=+t[0],r=+t[1],l):[n,r]},l.tile=function(e){return arguments.length?(t=Yw(e),l):t},l.padding=function(t){return arguments.length?l.paddingInner(t).paddingOuter(t):l.paddingInner()},l.paddingInner=function(t){return arguments.length?(o="function"===typeof t?t:Zw(+t),l):o},l.paddingOuter=function(t){return arguments.length?l.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):l.paddingTop()},l.paddingTop=function(t){return arguments.length?(a="function"===typeof t?t:Zw(+t),l):a},l.paddingRight=function(t){return arguments.length?(s="function"===typeof t?t:Zw(+t),l):s},l.paddingBottom=function(t){return arguments.length?(u="function"===typeof t?t:Zw(+t),l):u},l.paddingLeft=function(t){return arguments.length?(c="function"===typeof t?t:Zw(+t),l):c},l}();return t.ratio=e=>{const n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=e=>{(0,m.nr)(iD,e)?t.tile(iD[e]):(0,m.vU)("Unrecognized Treemap layout method: "+e)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:oD});const cD=t=>function(e){return e[t]},lD=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function fD(t){throw Error(t)}function dD(t){const e=[],n=t.length;let r,i,o,a=null,s=0,u="";function c(){e.push(u+t.substring(r,i)),u="",r=i+1}for(t+="",r=i=0;i<n;++i)if(o=t[i],"\\"===o)u+=t.substring(r,i),u+=t.substring(++i,++i),r=i;else if(o===a)c(),a=null,s=-1;else{if(a)continue;r===s&&'"'===o||r===s&&"'"===o?(r=i+1,a=o):"."!==o||s?"["===o?(i>r&&c(),s=r=i+1):"]"===o&&(s||fD("Access path missing open bracket: "+t),s>0&&c(),s=0,r=i+1):i>r?c():r=i+1}return s&&fD("Access path missing closing bracket: "+t),a&&fD("Access path missing closing quote: "+t),i>r&&(i++,c()),e}function hD(t,e,n){const r=dD(t);return t=1===r.length?r[0]:t,sD((n&&n.get||uD)(r),[t],e||t)}hD("id"),sD((t=>t),[],"identity"),sD((()=>0),[],"zero"),sD((()=>1),[],"one"),sD((()=>!0),[],"true"),sD((()=>!1),[],"false");var pD=Array.isArray;function mD(t){return null!=t?pD(t)?t:[t]:[]}function gD(t){return"function"===typeof t}Object.prototype.hasOwnProperty;const vD=4278190080;function yD(t,e,n){return new Uint32Array(t.getImageData(0,0,e,n).data.buffer)}function bD(t,e,n){if(!e.length)return;const r=e[0].mark.marktype;"group"===r?e.forEach((e=>{e.items.forEach((e=>bD(t,e.items,n)))})):Am[r].draw(t,{items:n?e.map(xD):e})}function xD(t){const e=Ci(t,{});return e.stroke&&0!==e.strokeOpacity||e.fill&&0!==e.fillOpacity?{...e,strokeOpacity:1,stroke:"#000",fillOpacity:0}:e}const AD=5,_D=31,wD=32,ED=new Uint32Array(wD+1),DD=new Uint32Array(wD+1);DD[0]=0,ED[0]=~DD[0];for(let RU=1;RU<=wD;++RU)DD[RU]=DD[RU-1]<<1|1,ED[RU]=~DD[RU];function FD(t,e,n){const r=Math.max(1,Math.sqrt(t*e/1e6)),i=~~((t+2*n+r)/r),o=~~((e+2*n+r)/r),a=t=>~~((t+n)/r);return a.invert=t=>t*r-n,a.bitmap=()=>function(t,e){const n=new Uint32Array(~~((t*e+wD)/wD));function r(t,e){n[t]|=e}function i(t,e){n[t]&=e}return{array:n,get:(e,r)=>{const i=r*t+e;return n[i>>>AD]&1<<(i&_D)},set:(e,n)=>{const i=n*t+e;r(i>>>AD,1<<(i&_D))},clear:(e,n)=>{const r=n*t+e;i(r>>>AD,~(1<<(r&_D)))},getRange:(e,r,i,o)=>{let a,s,u,c,l=o;for(;l>=r;--l)if(a=l*t+e,s=l*t+i,u=a>>>AD,c=s>>>AD,u===c){if(n[u]&ED[a&_D]&DD[1+(s&_D)])return!0}else{if(n[u]&ED[a&_D])return!0;if(n[c]&DD[1+(s&_D)])return!0;for(let t=u+1;t<c;++t)if(n[t])return!0}return!1},setRange:(e,n,i,o)=>{let a,s,u,c,l;for(;n<=o;++n)if(a=n*t+e,s=n*t+i,u=a>>>AD,c=s>>>AD,u===c)r(u,ED[a&_D]&DD[1+(s&_D)]);else for(r(u,ED[a&_D]),r(c,DD[1+(s&_D)]),l=u+1;l<c;++l)r(l,4294967295)},clearRange:(e,n,r,o)=>{let a,s,u,c,l;for(;n<=o;++n)if(a=n*t+e,s=n*t+r,u=a>>>AD,c=s>>>AD,u===c)i(u,DD[a&_D]|ED[1+(s&_D)]);else for(i(u,DD[a&_D]),i(c,ED[1+(s&_D)]),l=u+1;l<c;++l)i(l,0)},outOfBounds:(n,r,i,o)=>n<0||r<0||o>=e||i>=t}}(i,o),a.ratio=r,a.padding=n,a.width=t,a.height=e,a}function CD(t,e,n,r,i,o){let a=n/2;return t-a<0||t+a>i||e-(a=r/2)<0||e+a>o}function kD(t,e,n,r,i,o,a,s){const u=i*o/(2*r),c=t(e-u),l=t(e+u),f=t(n-(o/=2)),d=t(n+o);return a.outOfBounds(c,f,l,d)||a.getRange(c,f,l,d)||s&&s.getRange(c,f,l,d)}const SD=[-1,-1,1,1],MD=[-1,1,-1,1];const BD=["right","center","left"],OD=["bottom","middle","top"];function ND(t,e,n,r,i,o,a,s,u,c,l,f){return!(i.outOfBounds(t,n,e,r)||(f&&o||i).getRange(t,n,e,r))}const TD={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},zD={naive:function(t,e,n,r){const i=t.width,o=t.height;return function(t){const e=t.datum.datum.items[r].items,n=e.length,a=t.datum.fontSize,s=em.width(t.datum,t.datum.text);let u,c,l,f,d,h,p,m=0;for(let r=0;r<n;++r)u=e[r].x,l=e[r].y,c=void 0===e[r].x2?u:e[r].x2,f=void 0===e[r].y2?l:e[r].y2,d=(u+c)/2,h=(l+f)/2,p=Math.abs(c-u+f-l),p>=m&&(m=p,t.x=d,t.y=h);return d=s/2,h=a/2,u=t.x-d,c=t.x+d,l=t.y-h,f=t.y+h,t.align="center",u<0&&c<=i?t.align="left":0<=u&&i<c&&(t.align="right"),t.baseline="middle",l<0&&f<=o?t.baseline="top":0<=l&&o<f&&(t.baseline="bottom"),!0}},"reduced-search":function(t,e,n,r){const i=t.width,o=t.height,a=e[0],s=e[1];function u(e,n,r,u,c){const l=t.invert(e),f=t.invert(n);let d,h=r,p=o;if(!CD(l,f,u,c,i,o)&&!kD(t,l,f,c,u,h,a,s)&&!kD(t,l,f,c,u,c,a,null)){for(;p-h>=1;)d=(h+p)/2,kD(t,l,f,c,u,d,a,s)?p=d:h=d;if(h>r)return[l,f,h,!0]}}return function(e){const s=e.datum.datum.items[r].items,c=s.length,l=e.datum.fontSize,f=em.width(e.datum,e.datum.text);let d,h,p,m,g,v,y,b,x,A,_,w,E,D,F,C,k,S=n?l:0,M=!1,B=!1,O=0;for(let r=0;r<c;++r){for(d=s[r].x,p=s[r].y,h=void 0===s[r].x2?d:s[r].x2,m=void 0===s[r].y2?p:s[r].y2,d>h&&(k=d,d=h,h=k),p>m&&(k=p,p=m,m=k),x=t(d),_=t(h),A=~~((x+_)/2),w=t(p),D=t(m),E=~~((w+D)/2),y=A;y>=x;--y)for(b=E;b>=w;--b)C=u(y,b,S,f,l),C&&([e.x,e.y,S,M]=C);for(y=A;y<=_;++y)for(b=E;b<=D;++b)C=u(y,b,S,f,l),C&&([e.x,e.y,S,M]=C);M||n||(F=Math.abs(h-d+m-p),g=(d+h)/2,v=(p+m)/2,F>=O&&!CD(g,v,f,l,i,o)&&!kD(t,g,v,l,f,l,a,null)&&(O=F,e.x=g,e.y=v,B=!0))}return!(!M&&!B)&&(g=f/2,v=l/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,r){const i=t.width,o=t.height,a=e[0],s=e[1],u=t.bitmap();return function(e){const c=e.datum.datum.items[r].items,l=c.length,f=e.datum.fontSize,d=em.width(e.datum,e.datum.text),h=[];let p,m,g,v,y,b,x,A,_,w,E,D,F=n?f:0,C=!1,k=!1,S=0;for(let r=0;r<l;++r){for(p=c[r].x,g=c[r].y,m=void 0===c[r].x2?p:c[r].x2,v=void 0===c[r].y2?g:c[r].y2,h.push([t((p+m)/2),t((g+v)/2)]);h.length;)if([x,A]=h.pop(),!(a.get(x,A)||s.get(x,A)||u.get(x,A))){u.set(x,A);for(let t=0;t<4;++t)y=x+SD[t],b=A+MD[t],u.outOfBounds(y,b,y,b)||h.push([y,b]);if(y=t.invert(x),b=t.invert(A),_=F,w=o,!CD(y,b,d,f,i,o)&&!kD(t,y,b,f,d,_,a,s)&&!kD(t,y,b,f,d,f,a,null)){for(;w-_>=1;)E=(_+w)/2,kD(t,y,b,f,d,E,a,s)?w=E:_=E;_>F&&(e.x=y,e.y=b,F=_,C=!0)}}C||n||(D=Math.abs(m-p+v-g),y=(p+m)/2,b=(g+v)/2,D>=S&&!CD(y,b,d,f,i,o)&&!kD(t,y,b,f,d,f,a,null)&&(S=D,e.x=y,e.y=b,k=!0))}return!(!C&&!k)&&(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 RD(t,e,n,r,i,o,a,s,u,c,l){if(!t.length)return t;const f=Math.max(r.length,i.length),d=function(t,e){const n=new Float64Array(e),r=t.length;for(let i=0;i<r;++i)n[i]=t[i]||0;for(let i=r;i<e;++i)n[i]=n[r-1];return n}(r,f),h=function(t,e){const n=new Int8Array(e),r=t.length;for(let i=0;i<r;++i)n[i]|=TD[t[i]];for(let i=r;i<e;++i)n[i]=n[r-1];return n}(i,f),p=(x=t[0].datum)&&x.mark&&x.mark.marktype,m="group"===p&&t[0].datum.items[u].marktype,g="area"===m,v=function(t,e,n,r){const i=t=>[t.x,t.x,t.x,t.y,t.y,t.y];return t?"line"===t||"area"===t?t=>i(t.datum):"line"===e?t=>{const e=t.datum.items[r].items;return i(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]}:i}(p,m,s,u),y=null===c||c===1/0,b=g&&"naive"===l;var x;let A=-1,_=-1;const w=t.map((t=>{const e=y?em.width(t,t.text):void 0;return A=Math.max(A,e),_=Math.max(_,t.fontSize),{datum:t,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:v(t),textWidth:e}}));c=null===c||c===1/0?Math.max(A,_)+Math.max(...r):c;const E=FD(e[0],e[1],c);let D;if(!b){n&&w.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 r=(p&&a||g)&&t.map((t=>t.datum));D=o.length||r?function(t,e,n,r,i){const o=t.width,a=t.height,s=r||i,u=Gu(o,a).getContext("2d"),c=Gu(o,a).getContext("2d"),l=s&&Gu(o,a).getContext("2d");n.forEach((t=>bD(u,t,!1))),bD(c,e,!1),s&&bD(l,e,!0);const f=yD(u,o,a),d=yD(c,o,a),h=s&&yD(l,o,a),p=t.bitmap(),m=s&&t.bitmap();let g,v,y,b,x,A,_,w;for(v=0;v<a;++v)for(g=0;g<o;++g)x=v*o+g,A=f[x]&vD,w=d[x]&vD,_=s&&h[x]&vD,(A||_||w)&&(y=t(g),b=t(v),i||!A&&!w||p.set(y,b),s&&(A||_)&&m.set(y,b));return[p,m]}(E,r||[],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&&w)}const F=g?zD[l](E,D,a,u):function(t,e,n,r){const i=t.width,o=t.height,a=e[0],s=e[1],u=r.length;return function(e){var c;const l=e.boundary,f=e.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>i||l[3]>o)return!1;let d,h,p,m,g,v,y,b,x,A,_,w,E,D,F,C=null!==(c=e.textWidth)&&void 0!==c?c:0;for(let i=0;i<u;++i){if(d=(3&n[i])-1,h=(n[i]>>>2&3)-1,p=0===d&&0===h||r[i]<0,m=d&&h?Math.SQRT1_2:1,g=r[i]<0?-1:1,v=l[1+d]+r[i]*d*m,_=l[4+h]+g*f*h/2+r[i]*h*m,b=_-f/2,x=_+f/2,w=t(v),D=t(b),F=t(x),!C){if(!ND(w,w,D,F,a,s,0,0,0,0,0,p))continue;C=em.width(e.datum,e.datum.text)}if(A=v+g*C*d/2,v=A-C/2,y=A+C/2,w=t(v),E=t(y),ND(w,E,D,F,a,s,0,0,0,0,0,p))return e.x=d?d*g<0?y:v:A,e.y=h?h*g<0?x:b:_,e.align=BD[d*g+1],e.baseline=OD[h*g+1],a.setRange(w,D,E,F),!0}return!1}}(E,D,h,d);return w.forEach((t=>t.opacity=+F(t))),w}const PD=["x","y","opacity","align","baseline"],LD=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function jD(t){no.call(this,null,t)}jD.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:LD},{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:PD.length,default:PD}]},function(t,e,n){const r=t.prototype=Object.create(e.prototype);Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),function(t){for(let e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r],e)t[n]=e[n]}(r,n)}(jD,no,{transform(t,e){const n=t.modified();if(!(n||e.changed(e.ADD_REM)||function(n){const r=t[n];return gD(r)&&e.modified(r.fields)}("sort")))return;t.size&&2===t.size.length||fD("Size parameter should be specified as a [width, height] array.");const r=t.as||PD;return RD(e.materialize(e.SOURCE).source||[],t.size,t.sort,mD(null==t.offset?1:t.offset),mD(t.anchor||LD),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[r[0]]=t.x,e[r[1]]=t.y,e[r[2]]=t.opacity,e[r[3]]=t.align,e[r[4]]=t.baseline})),e.reflow(n).modifies(r)}});Math.random;Math.sqrt(2*Math.PI),Math.SQRT2;function UD(t,e,n){let r=0,i=0;for(const o of t){const t=n(o);null==e(o)||null==t||isNaN(t)||(r+=(t-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function ID(t,e,n,r){const i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]}function qD(t,e,n,r){t=t.filter((t=>{let r=e(t),i=n(t);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i})),r&&t.sort(((t,n)=>e(t)-e(n)));const i=t.length,o=new Float64Array(i),a=new Float64Array(i);let s,u,c,l=0,f=0,d=0;for(c of t)o[l]=s=+e(c),a[l]=u=+n(c),++l,f+=(s-f)/l,d+=(u-d)/l;for(l=0;l<i;++l)o[l]-=f,a[l]-=d;return[o,a,f,d]}function WD(t,e,n,r){let i,o,a=-1;for(const s of t)i=e(s),o=n(s),null!=i&&(i=+i)>=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function HD(t,e,n,r,i){let o=0,a=0;return WD(t,e,n,((t,e)=>{const n=e-i(t),s=e-r;o+=n*n,a+=s*s})),1-o/a}function XD(t,e,n){let r=0,i=0,o=0,a=0,s=0;WD(t,e,n,((t,e)=>{++s,r+=(t-r)/s,i+=(e-i)/s,o+=(t*e-o)/s,a+=(t*t-a)/s}));const u=ID(r,i,o,a),c=t=>u[0]+u[1]*t;return{coef:u,predict:c,rSquared:HD(t,e,n,i,c)}}function GD(t,e,n){const[r,i,o,a]=qD(t,e,n),s=r.length;let u,c,l,f,d=0,h=0,p=0,m=0,g=0;for(u=0;u<s;)c=r[u],l=i[u++],f=c*c,d+=(f-d)/u,h+=(f*c-h)/u,p+=(f*f-p)/u,m+=(c*l-m)/u,g+=(f*l-g)/u;const v=p-d*d,y=d*v-h*h,b=(g*d-m*h)/y,x=(m*v-g*h)/y,A=-b*d,_=t=>b*(t-=o)*t+x*t+A+a;return{coef:[A-x*o+b*o*o+a,x-2*b*o,b],predict:_,rSquared:HD(t,e,n,a,_)}}function JD(t,e,n,r){const i=Array(t);let o,a,s,u;for(o=0;o<t;++o)i[o]=0;for(o=t-1;o>=0;--o)for(s=e[o],u=1,i[o]+=s,a=1;a<=o;++a)u*=(o+1-a)/a,i[o-a]+=s*Math.pow(n,a)*u;return i[0]+=r,i}function $D(t){return(t=1-t*t*t)*t*t}function VD(t,e,n){const r=t[e];let i=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}const YD=.5*Math.PI/180;function KD(t,e,n,r,i){const o=Math.atan2(i*(n[1]-t[1]),r*(n[0]-t[0])),a=Math.atan2(i*(e[1]-t[1]),r*(e[0]-t[0]));return Math.abs(o-a)}function ZD(t,e,n){return t.fields=e||[],t.fname=n,t}function QD(t){return null==t?null:t.fname}function tF(t){return 1===t.length?eF(t[0]):nF(t)}const eF=t=>function(e){return e[t]},nF=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function rF(t){throw Error(t)}function iF(t){const e=[],n=t.length;let r,i,o,a=null,s=0,u="";function c(){e.push(u+t.substring(r,i)),u="",r=i+1}for(t+="",r=i=0;i<n;++i)if(o=t[i],"\\"===o)u+=t.substring(r,i),u+=t.substring(++i,++i),r=i;else if(o===a)c(),a=null,s=-1;else{if(a)continue;r===s&&'"'===o||r===s&&"'"===o?(r=i+1,a=o):"."!==o||s?"["===o?(i>r&&c(),s=r=i+1):"]"===o&&(s||rF("Access path missing open bracket: "+t),s>0&&c(),s=0,r=i+1):i>r?c():r=i+1}return s&&rF("Access path missing closing bracket: "+t),a&&rF("Access path missing closing quote: "+t),i>r&&(i++,c()),e}function oF(t,e,n){const r=iF(t);return t=1===r.length?r[0]:t,ZD((n&&n.get||tF)(r),[t],e||t)}oF("id"),ZD((t=>t),[],"identity"),ZD((()=>0),[],"zero"),ZD((()=>1),[],"one"),ZD((()=>!0),[],"true"),ZD((()=>!1),[],"false");Array.isArray;const aF=Object.prototype.hasOwnProperty;function sF(t,e){return aF.call(t,e)}function uF(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),function(t){for(let e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r],e)t[n]=e[n];return t}(r,n)}function cF(t,e){var n,r,i,o,a,s,u=[],c=function(t){return t(o)};if(null==e)u.push(t);else for(n={},r=0,i=t.length;r<i;++r)o=t[r],(s=n[a=e.map(c)])||(n[a]=s=[],s.dims=a,u.push(s)),s.push(o);return u}function lF(t){no.call(this,null,t)}lF.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}]},uF(lF,no,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=cF(e.materialize(e.SOURCE).source,t.groupby),i=(t.groupby||[]).map(QD),o=i.length,a=t.as||[QD(t.x),QD(t.y)],s=[];r.forEach((e=>{(function(t,e,n,r){const[i,o,a,s]=qD(t,e,n,!0),u=i.length,c=Math.max(2,~~(r*u)),l=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=2;){const t=[0,c-1];for(let n=0;n<u;++n){const e=i[n],r=t[0],a=t[1],s=e-i[r]>i[a]-e?r:a;let u=0,c=0,h=0,p=0,m=0;const g=1/Math.abs(i[s]-e||1);for(let t=r;t<=a;++t){const n=i[t],r=o[t],a=$D(Math.abs(e-n)*g)*d[t],s=n*a;u+=a,c+=s,h+=r*a,p+=r*s,m+=n*s}const[v,y]=ID(c/u,h/u,p/u,m/u);l[n]=v+y*e,f[n]=Math.abs(o[n]-l[n]),VD(i,n+1,t)}if(2===h)break;const e=Wo(f);if(Math.abs(e)<1e-12)break;for(let n,r,i=0;i<u;++i)n=f[i]/(6*e),d[i]=n>=1?1e-12:(r=1-n*n)*r}return function(t,e,n,r){const i=t.length,o=[];let a,s=0,u=0,c=[];for(;s<i;++s)a=t[s]+n,c[0]===a?c[1]+=(e[s]-c[1])/++u:(u=0,c[1]+=r,c=[a,e[s]],o.push(c));return c[1]+=r,o}(i,l,a,s)})(e,t.x,t.y,t.bandwidth||.3).forEach((t=>{const n={};for(let r=0;r<o;++r)n[i[r]]=e.dims[r];n[a[0]]=t[0],n[a[1]]=t[1],s.push(Di(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=s}return n}});const fF={constant:UD,linear:XD,log:function(t,e,n){let r=0,i=0,o=0,a=0,s=0;WD(t,e,n,((t,e)=>{++s,t=Math.log(t),r+=(t-r)/s,i+=(e-i)/s,o+=(t*e-o)/s,a+=(t*t-a)/s}));const u=ID(r,i,o,a),c=t=>u[0]+u[1]*Math.log(t);return{coef:u,predict:c,rSquared:HD(t,e,n,i,c)}},exp:function(t,e,n){const[r,i,o,a]=qD(t,e,n);let s,u,c,l=0,f=0,d=0,h=0,p=0;WD(t,e,n,((t,e)=>{s=r[p++],u=Math.log(e),c=s*e,l+=(e*u-l)/p,f+=(c-f)/p,d+=(c*u-d)/p,h+=(s*c-h)/p}));const[m,g]=ID(f/a,l/a,d/a,h/a),v=t=>Math.exp(m+g*(t-o));return{coef:[Math.exp(m-g*o),g],predict:v,rSquared:HD(t,e,n,a,v)}},pow:function(t,e,n){let r=0,i=0,o=0,a=0,s=0,u=0;WD(t,e,n,((t,e)=>{const n=Math.log(t),c=Math.log(e);++u,r+=(n-r)/u,i+=(c-i)/u,o+=(n*c-o)/u,a+=(n*n-a)/u,s+=(e-s)/u}));const c=ID(r,i,o,a),l=t=>c[0]*Math.pow(t,c[1]);return c[0]=Math.exp(c[0]),{coef:c,predict:l,rSquared:HD(t,e,n,s,l)}},quad:GD,poly:function(t,e,n,r){if(0===r)return UD(t,e,n);if(1===r)return XD(t,e,n);if(2===r)return GD(t,e,n);const[i,o,a,s]=qD(t,e,n),u=i.length,c=[],l=[],f=r+1;let d,h,p,m,g;for(d=0;d<f;++d){for(p=0,m=0;p<u;++p)m+=Math.pow(i[p],d)*o[p];for(c.push(m),g=new Float64Array(f),h=0;h<f;++h){for(p=0,m=0;p<u;++p)m+=Math.pow(i[p],d+h);g[h]=m}l.push(g)}l.push(c);const v=function(t){const e=t.length-1,n=[];let r,i,o,a,s;for(r=0;r<e;++r){for(a=r,i=r+1;i<e;++i)Math.abs(t[r][i])>Math.abs(t[r][a])&&(a=i);for(o=r;o<e+1;++o)s=t[o][r],t[o][r]=t[o][a],t[o][a]=s;for(i=r+1;i<e;++i)for(o=e;o>=r;o--)t[o][i]-=t[o][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(s=0,o=i+1;o<e;++o)s+=t[o][i]*n[o];n[i]=(t[e][i]-s)/t[i][i]}return n}(l),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:JD(f,v,-a,s),predict:y,rSquared:HD(t,e,n,s,y)}}};function dF(t){no.call(this,null,t)}dF.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(fF)},{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}]},uF(dF,no,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=cF(e.materialize(e.SOURCE).source,t.groupby),i=(t.groupby||[]).map(QD),o=t.method||"linear",a=null==t.order?3:t.order,s=((t,e)=>"poly"===t?e:"quad"===t?2:1)(o,a),u=t.as||[QD(t.x),QD(t.y)],c=fF[o],l=[];let f=t.extent;sF(fF,o)||rF("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),r.forEach((n=>{if(n.length<=s)return void e.dataflow.warn("Skipping regression with more parameters than data points.");const r=c(n,t.x,t.y,a);if(t.params)return void l.push(Di({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const d=f||function(t,e){let n,r,i,o,a=0;if(t&&(n=t.length))if(null==e){for(r=t[a];a<n&&(null==r||r!==r);r=t[++a]);for(i=o=r;a<n;++a)r=t[a],null!=r&&(r<i&&(i=r),r>o&&(o=r))}else{for(r=e(t[a]);a<n&&(null==r||r!==r);r=e(t[++a]));for(i=o=r;a<n;++a)r=e(t[a]),null!=r&&(r<i&&(i=r),r>o&&(o=r))}return[i,o]}(n,t.x),h=t=>{const e={};for(let r=0;r<i.length;++r)e[i[r]]=n.dims[r];e[u[0]]=t[0],e[u[1]]=t[1],l.push(Di(e))};"linear"===o||"constant"===o?d.forEach((t=>h([t,r.predict(t)]))):function(t,e,n,r){n=n||25,r=Math.max(n,r||200);const i=e=>[e,t(e)],o=e[0],a=e[1],s=a-o,u=s/r,c=[i(o)],l=[];if(n===r){for(let t=1;t<r;++t)c.push(i(o+t/n*s));return c.push(i(a)),c}l.push(i(a));for(let m=n;--m>0;)l.push(i(o+m/n*s));let f=c[0],d=l[l.length-1];const h=1/s,p=function(t,e){let n=t,r=t;const i=e.length;for(let o=0;o<i;++o){const t=e[o][1];t<n&&(n=t),t>r&&(r=t)}return 1/(r-n)}(f[1],l);for(;d;){const t=i((f[0]+d[0])/2);t[0]-f[0]>=u&&KD(f,t,d,h,p)>YD?l.push(t):(f=d,c.push(d),l.pop()),d=l[l.length-1]}return c}(r.predict,d,25,200).forEach(h)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});const hF=134217729,pF=33306690738754706e-32;function mF(t,e,n,r,i){let o,a,s,u,c=e[0],l=r[0],f=0,d=0;l>c===l>-c?(o=c,c=e[++f]):(o=l,l=r[++d]);let h=0;if(f<t&&d<n)for(l>c===l>-c?(a=c+o,s=o-(a-c),c=e[++f]):(a=l+o,s=o-(a-l),l=r[++d]),o=a,0!==s&&(i[h++]=s);f<t&&d<n;)l>c===l>-c?(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=e[++f]):(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=r[++d]),o=a,0!==s&&(i[h++]=s);for(;f<t;)a=o+c,u=a-o,s=o-(a-u)+(c-u),c=e[++f],o=a,0!==s&&(i[h++]=s);for(;d<n;)a=o+l,u=a-o,s=o-(a-u)+(l-u),l=r[++d],o=a,0!==s&&(i[h++]=s);return 0===o&&0!==h||(i[h++]=o),h}function gF(t){return new Float64Array(t)}const vF=22204460492503146e-32,yF=11093356479670487e-47,bF=gF(4),xF=gF(8),AF=gF(12),_F=gF(16),wF=gF(4);function EF(t,e,n,r,i,o){const a=(e-o)*(n-i),s=(t-i)*(r-o),u=a-s;if(0===a||0===s||a>0!==s>0)return u;const c=Math.abs(a+s);return Math.abs(u)>=33306690738754716e-32*c?u:-function(t,e,n,r,i,o,a){let s,u,c,l,f,d,h,p,m,g,v,y,b,x,A,_,w,E;const D=t-i,F=n-i,C=e-o,k=r-o;x=D*k,d=hF*D,h=d-(d-D),p=D-h,d=hF*k,m=d-(d-k),g=k-m,A=p*g-(x-h*m-p*m-h*g),_=C*F,d=hF*C,h=d-(d-C),p=C-h,d=hF*F,m=d-(d-F),g=F-m,w=p*g-(_-h*m-p*m-h*g),v=A-w,f=A-v,bF[0]=A-(v+f)+(f-w),y=x+v,f=y-x,b=x-(y-f)+(v-f),v=b-_,f=b-v,bF[1]=b-(v+f)+(f-_),E=y+v,f=E-y,bF[2]=y-(E-f)+(v-f),bF[3]=E;let S=function(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}(4,bF),M=vF*a;if(S>=M||-S>=M)return S;if(f=t-D,s=t-(D+f)+(f-i),f=n-F,c=n-(F+f)+(f-i),f=e-C,u=e-(C+f)+(f-o),f=r-k,l=r-(k+f)+(f-o),0===s&&0===u&&0===c&&0===l)return S;if(M=yF*a+pF*Math.abs(S),S+=D*l+k*s-(C*c+F*u),S>=M||-S>=M)return S;x=s*k,d=hF*s,h=d-(d-s),p=s-h,d=hF*k,m=d-(d-k),g=k-m,A=p*g-(x-h*m-p*m-h*g),_=u*F,d=hF*u,h=d-(d-u),p=u-h,d=hF*F,m=d-(d-F),g=F-m,w=p*g-(_-h*m-p*m-h*g),v=A-w,f=A-v,wF[0]=A-(v+f)+(f-w),y=x+v,f=y-x,b=x-(y-f)+(v-f),v=b-_,f=b-v,wF[1]=b-(v+f)+(f-_),E=y+v,f=E-y,wF[2]=y-(E-f)+(v-f),wF[3]=E;const B=mF(4,bF,4,wF,xF);x=D*l,d=hF*D,h=d-(d-D),p=D-h,d=hF*l,m=d-(d-l),g=l-m,A=p*g-(x-h*m-p*m-h*g),_=C*c,d=hF*C,h=d-(d-C),p=C-h,d=hF*c,m=d-(d-c),g=c-m,w=p*g-(_-h*m-p*m-h*g),v=A-w,f=A-v,wF[0]=A-(v+f)+(f-w),y=x+v,f=y-x,b=x-(y-f)+(v-f),v=b-_,f=b-v,wF[1]=b-(v+f)+(f-_),E=y+v,f=E-y,wF[2]=y-(E-f)+(v-f),wF[3]=E;const O=mF(B,xF,4,wF,AF);x=s*l,d=hF*s,h=d-(d-s),p=s-h,d=hF*l,m=d-(d-l),g=l-m,A=p*g-(x-h*m-p*m-h*g),_=u*c,d=hF*u,h=d-(d-u),p=u-h,d=hF*c,m=d-(d-c),g=c-m,w=p*g-(_-h*m-p*m-h*g),v=A-w,f=A-v,wF[0]=A-(v+f)+(f-w),y=x+v,f=y-x,b=x-(y-f)+(v-f),v=b-_,f=b-v,wF[1]=b-(v+f)+(f-_),E=y+v,f=E-y,wF[2]=y-(E-f)+(v-f),wF[3]=E;const N=mF(O,AF,4,wF,_F);return _F[N-1]}(t,e,n,r,i,o,c)}gF(4),gF(4),gF(4),gF(4),gF(4),gF(4),gF(4),gF(4),gF(4),gF(8),gF(8),gF(8),gF(4),gF(8),gF(8),gF(8),gF(12);gF(192),gF(192);gF(4),gF(4),gF(4),gF(4),gF(4),gF(4),gF(4),gF(4),gF(8),gF(8),gF(8),gF(8),gF(8),gF(8),gF(8),gF(8),gF(8),gF(4),gF(4),gF(4),gF(8),gF(16),gF(16),gF(16),gF(32),gF(32),gF(48),gF(64);gF(1152),gF(1152);gF(4),gF(4),gF(4),gF(4),gF(4),gF(4),gF(4),gF(4),gF(4),gF(4),gF(24),gF(24),gF(24),gF(24),gF(24),gF(24),gF(24),gF(24),gF(24),gF(24),gF(1152),gF(1152),gF(1152),gF(1152),gF(1152),gF(2304),gF(2304),gF(3456),gF(5760),gF(8),gF(8),gF(8),gF(16),gF(24),gF(48),gF(48),gF(96),gF(192),gF(384),gF(384),gF(384),gF(768);gF(96),gF(96),gF(96),gF(1152);const DF=Math.pow(2,-52),FF=new Uint32Array(512);class CF{static from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NF,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:TF;const r=t.length,i=new Float64Array(2*r);for(let o=0;o<r;o++){const r=t[o];i[2*o]=e(r),i[2*o+1]=n(r)}return new CF(i)}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:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,s=1/0,u=-1/0,c=-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>u&&(u=e),n>c&&(c=n),this._ids[D]=D}const l=(a+u)/2,f=(s+c)/2;let d,h,p,m=1/0;for(let D=0;D<o;D++){const e=kF(l,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=kF(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=MF(g,v,y,b,t[2*D],t[2*D+1]);e<x&&(p=D,x=e)}let A=t[2*p],_=t[2*p+1];if(x===1/0){for(let r=0;r<o;r++)this._dists[r]=t[2*r]-t[0]||t[2*r+1]-t[1];BF(this._ids,this._dists,0,o-1);const e=new Uint32Array(o);let n=0;for(let t=0,r=-1/0;t<o;t++){const i=this._ids[t];this._dists[i]>r&&(e[n++]=i,r=this._dists[i])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(EF(g,v,y,b,A,_)<0){const t=h,e=y,n=b;h=p,y=A,b=_,p=t,A=e,_=n}const w=function(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,c=o-e,l=a*a+s*s,f=u*u+c*c,d=.5/(a*c-s*u),h=t+(c*l-s*f)*d,p=e+(a*f-u*l)*d;return{x:h,y:p}}(g,v,y,b,A,_);this._cx=w.x,this._cy=w.y;for(let D=0;D<o;D++)this._dists[D]=kF(t[2*D],t[2*D+1],w.x,w.y);BF(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,r[d]=0,r[h]=1,r[p]=2,i.fill(-1),i[this._hashKey(g,v)]=d,i[this._hashKey(y,b)]=h,i[this._hashKey(A,_)]=p,this.trianglesLen=0,this._addTriangle(d,h,p,-1,-1,-1);for(let D,F,C=0;C<this._ids.length;C++){const o=this._ids[C],a=t[2*o],s=t[2*o+1];if(C>0&&Math.abs(a-D)<=DF&&Math.abs(s-F)<=DF)continue;if(D=a,F=s,o===d||o===h||o===p)continue;let u=0;for(let t=0,e=this._hashKey(a,s);t<this._hashSize&&(u=i[(e+t)%this._hashSize],-1===u||u===n[u]);t++);u=e[u];let c,l=u;for(;c=n[l],EF(a,s,t[2*l],t[2*l+1],t[2*c],t[2*c+1])>=0;)if(l=c,l===u){l=-1;break}if(-1===l)continue;let f=this._addTriangle(l,o,n[l],-1,-1,r[l]);r[o]=this._legalize(f+2),r[l]=f,E++;let m=n[l];for(;c=n[m],EF(a,s,t[2*m],t[2*m+1],t[2*c],t[2*c+1])<0;)f=this._addTriangle(m,o,c,r[o],-1,r[m]),r[o]=this._legalize(f+2),n[m]=m,E--,m=c;if(l===u)for(;c=e[l],EF(a,s,t[2*c],t[2*c+1],t[2*l],t[2*l+1])<0;)f=this._addTriangle(c,o,l,-1,r[l],r[c]),this._legalize(f+2),r[c]=f,n[l]=l,E--,l=c;this._hullStart=e[o]=l,n[l]=e[m]=o,n[o]=m,i[this._hashKey(a,s)]=o,i[this._hashKey(t[2*l],t[2*l+1])]=l}this.hull=new Uint32Array(E);for(let D=0,F=this._hullStart;D<E;D++)this.hull[D]=F,F=n[F];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:r}=this;let i=0,o=0;for(;;){const a=n[t],s=t-t%3;if(o=s+(t+2)%3,-1===a){if(0===i)break;t=FF[--i];continue}const u=a-a%3,c=s+(t+1)%3,l=u+(a+2)%3,f=e[o],d=e[t],h=e[c],p=e[l];if(SF(r[2*f],r[2*f+1],r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1])){e[t]=p,e[a]=f;const r=n[l];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===l){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(a,n[o]),this._link(o,l);const s=u+(a+1)%3;i<FF.length&&(FF[i++]=s)}else{if(0===i)break;t=FF[--i]}}return o}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,r,i,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=e,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,i),this._link(a+2,o),this.trianglesLen+=3,a}}function kF(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function SF(t,e,n,r,i,o,a,s){const u=t-a,c=e-s,l=n-a,f=r-s,d=i-a,h=o-s,p=l*l+f*f,m=d*d+h*h;return u*(f*m-p*h)-c*(l*m-p*d)+(u*u+c*c)*(l*h-f*d)<0}function MF(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,c=o-e,l=a*a+s*s,f=u*u+c*c,d=.5/(a*c-s*u),h=(c*l-s*f)*d,p=(a*f-u*l)*d;return h*h+p*p}function BF(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=t[i],o=e[r];let a=i-1;for(;a>=n&&e[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=n+1,o=r;OF(t,n+r>>1,i),e[t[n]]>e[t[r]]&&OF(t,n,r),e[t[i]]>e[t[r]]&&OF(t,i,r),e[t[n]]>e[t[i]]&&OF(t,n,i);const a=t[i],s=e[a];for(;;){do{i++}while(e[t[i]]<s);do{o--}while(e[t[o]]>s);if(o<i)break;OF(t,i,o)}t[n+1]=t[o],t[o]=a,r-i+1>=o-n?(BF(t,e,i,r),BF(t,e,n,o-1)):(BF(t,e,n,o-1),BF(t,e,i,r))}}function OF(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function NF(t){return t[0]}function TF(t){return t[1]}const zF=1e-6;class RF{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 r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+="M".concat(r,",").concat(i):(Math.abs(this._x1-r)>zF||Math.abs(this._y1-i)>zF)&&(this._+="L"+r+","+i),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=r,",").concat(this._y1=i))}rect(t,e,n,r){this._+="M".concat(this._x0=this._x1=+t,",").concat(this._y0=this._y1=+e,"h").concat(+n,"v").concat(+r,"h").concat(-n,"Z")}value(){return this._||null}}class PF{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 LF{constructor(t){let[e,n,r,i]=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,960,500];if(!((r=+r)>=(e=+e))||!((i=+i)>=(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=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this,i=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],r=2*n[p+1],o=2*n[p+2],a=t[e],s=t[e+1],u=t[r],c=t[r+1],l=t[o],f=t[o+1],g=u-a,v=c-s,y=l-a,b=f-s,x=2*(g*b-v*y);if(Math.abs(x)<1e-9){let e=1e9;const r=2*n[0];e*=Math.sign((t[r]-a)*b-(t[r+1]-s)*y),d=(a+l)/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}i[m]=d,i[m+1]=h}let o,a,s,u=e[e.length-1],c=4*u,l=t[2*u],f=t[2*u+1];r.fill(0);for(let d=0;d<e.length;++d)u=e[d],o=c,a=l,s=f,c=4*u,l=t[2*u],f=t[2*u+1],r[o+2]=r[c]=s-f,r[o+3]=r[c+1]=l-a}render(t){const e=null==t?t=new RF:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:o,vectors:a}=this;if(i.length<=1)return null;for(let c=0,l=n.length;c<l;++c){const e=n[c];if(e<c)continue;const r=2*Math.floor(c/3),i=2*Math.floor(e/3),a=o[r],s=o[r+1],u=o[i],l=o[i+1];this._renderSegment(a,s,u,l,t)}let s,u=i[i.length-1];for(let c=0;c<i.length;++c){s=u,u=i[c];const e=2*Math.floor(r[u]/3),n=o[e],l=o[e+1],f=4*s,d=this._project(n,l,a[f+2],a[f+3]);d&&this._renderSegment(n,l,d[0],d[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new RF: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 RF:void 0,r=this._clip(t);if(null===r||!r.length)return;e.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let o=2;o<i;o+=2)r[o]===r[o-2]&&r[o+1]===r[o-1]||e.lineTo(r[o],r[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 PF;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,r,i){let o;const a=this._regioncode(t,e),s=this._regioncode(n,r);0===a&&0===s?(i.moveTo(t,e),i.lineTo(n,r)):(o=this._clipSegment(t,e,n,r,a,s))&&(i.moveTo(o[0],o[1]),i.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 r=0,i=e.length;r<i;r+=2)for(let o=0,a=t.length;o<a;o+=2)if(e[r]==t[o]&&e[r+1]==t[o+1]&&e[(r+2)%i]==t[(o+a-2)%a]&&e[(r+3)%i]==t[(o+a-1)%a]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:r,triangles:i}}=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,i[s]!==t)break;s=r[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,r=4*t;return n[r]||n[r+1]?this._clipInfinite(t,e,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,e)}_clipFinite(t,e){const n=e.length;let r,i,o,a,s=null,u=e[n-2],c=e[n-1],l=this._regioncode(u,c),f=0;for(let d=0;d<n;d+=2)if(r=u,i=c,u=e[d],c=e[d+1],o=l,l=this._regioncode(u,c),0===o&&0===l)a=f,f=0,s?s.push(u,c):s=[u,c];else{let e,n,d,h,p;if(0===o){if(null===(e=this._clipSegment(r,i,u,c,o,l)))continue;[n,d,h,p]=e}else{if(null===(e=this._clipSegment(u,c,r,i,l,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,r,i,o){for(;;){if(0===i&&0===o)return[t,e,n,r];if(i&o)return null;let a,s,u=i||o;8&u?(a=t+(n-t)*(this.ymax-e)/(r-e),s=this.ymax):4&u?(a=t+(n-t)*(this.ymin-e)/(r-e),s=this.ymin):2&u?(s=e+(r-e)*(this.xmax-t)/(n-t),a=this.xmax):(s=e+(r-e)*(this.xmin-t)/(n-t),a=this.xmin),i?(t=a,e=s,i=this._regioncode(t,e)):(n=a,r=s,o=this._regioncode(n,r))}}_clipInfinite(t,e,n,r,i,o){let a,s=Array.from(e);if((a=this._project(s[0],s[1],n,r))&&s.unshift(a[0],a[1]),(a=this._project(s[s.length-2],s[s.length-1],i,o))&&s.push(a[0],a[1]),s=this._clipFinite(t,s))for(let u,c=0,l=s.length,f=this._edgecode(s[l-2],s[l-1]);c<l;c+=2)u=f,f=this._edgecode(s[c],s[c+1]),u&&f&&(c=this._edge(t,u,f,s,c),l=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,r,i){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}r[i]===n&&r[i+1]===o||!this.contains(t,n,o)||(r.splice(i,0,n,o),i+=2)}if(r.length>4)for(let o=0;o<r.length;o+=2){const t=(o+2)%r.length,e=(o+4)%r.length;(r[o]===r[t]&&r[t]===r[e]||r[o+1]===r[t+1]&&r[t+1]===r[e+1])&&(r.splice(t,2),o-=2)}return i}_project(t,e,n,r){let i,o,a,s=1/0;if(r<0){if(e<=this.ymin)return null;(i=(this.ymin-e)/r)<s&&(a=this.ymin,o=t+(s=i)*n)}else if(r>0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)<s&&(a=this.ymax,o=t+(s=i)*n)}if(n>0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)<s&&(o=this.xmax,a=e+(s=i)*r)}else if(n<0){if(t<=this.xmin)return null;(i=(this.xmin-t)/n)<s&&(o=this.xmin,a=e+(s=i)*r)}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 jF=2*Math.PI,UF=Math.pow;function IF(t){return t[0]}function qF(t){return t[1]}function WF(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class HF{static from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:IF,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:qF,r=arguments.length>3?arguments[3]:void 0;return new HF("length"in t?function(t,e,n,r){const i=t.length,o=new Float64Array(2*i);for(let a=0;a<i;++a){const i=t[a];o[2*a]=e.call(r,i,a,t),o[2*a+1]=n.call(r,i,a,t)}return o}(t,e,n,r):Float64Array.from(function*(t,e,n,r){let i=0;for(const o of t)yield e.call(r,o,i,t),yield n.call(r,o,i,t),++i}(t,e,n,r)))}constructor(t){this._delaunator=new CF(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 r=0;r<e.length;r+=3){const t=2*e[r],i=2*e[r+1],o=2*e[r+2];if((n[o]-n[t])*(n[i+1]-n[t+1])-(n[i]-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],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let o=0,a=e.length/2;o<a;++o){const t=WF(e[2*o],e[2*o+1],i);e[2*o]=t[0],e[2*o+1]=t[1]}this._delaunator=new CF(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let s=0,u=n.length;s<u;++s){const t=i[s%3===2?s-2:s+1];-1!==n[s]&&-1!==o[t]||(o[t]=s)}for(let s=0,u=r.length;s<u;++s)a[r[s]]=s;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new LF(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,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 u=s,c=-1;do{if(yield c=o[u],u=u%3===2?u-2:u+1,o[u]!==t)return;if(u=i[u],-1===u){const e=n[(r[t]+1)%n.length];return void(e!==c&&(yield e))}}while(u!==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 r=n;let i;for(;(i=this._step(n,t,e))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:u}=this;if(-1===r[t]||!u.length)return(t+1)%(u.length>>1);let c=t,l=UF(e-u[2*t],2)+UF(n-u[2*t+1],2);const f=r[t];let d=f;do{let r=s[d];const f=UF(e-u[2*r],2)+UF(n-u[2*r+1],2);if(f<l&&(l=f,c=r),d=d%3===2?d-2:d+1,s[d]!==t)break;if(d=a[d],-1===d){if(d=i[(o[t]+1)%i.length],d!==r&&UF(e-u[2*d],2)+UF(n-u[2*d+1],2)<l)return d;break}}while(d!==f);return c}render(t){const e=null==t?t=new RF:void 0,{points:n,halfedges:r,triangles:i}=this;for(let o=0,a=r.length;o<a;++o){const e=r[o];if(e<o)continue;const a=2*i[o],s=2*i[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 RF:void 0,{points:r}=this;for(let i=0,o=r.length;i<o;i+=2){const n=r[i],o=r[i+1];t.moveTo(n+e,o),t.arc(n,o,e,0,jF)}return n&&n.value()}renderHull(t){const e=null==t?t=new RF:void 0,{hull:n,points:r}=this,i=2*n[0],o=n.length;t.moveTo(r[i],r[i+1]);for(let a=1;a<o;++a){const e=2*n[a];t.lineTo(r[e],r[e+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new PF;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new RF:void 0,{points:r,triangles:i}=this,o=2*i[t*=3],a=2*i[t+1],s=2*i[t+2];return e.moveTo(r[o],r[o+1]),e.lineTo(r[a],r[a+1]),e.lineTo(r[s],r[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 PF;return this.renderTriangle(t,e),e.value()}}function XF(t){no.call(this,null,t)}XF.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 GF=[-1e5,-1e5,1e5,1e5];function JF(t){const e=t[0][0],n=t[0][1];let r=t.length-1;for(;t[r][0]===e&&t[r][1]===n;--r);return"M"+t.slice(0,r+1).join("L")+"Z"}(0,m.XW)(XF,no,{transform(t,e){const n=t.as||"path",r=e.source;if(!r||!r.length)return e;let i=t.size;i=i?[0,0,i[0],i[1]]:(i=t.extent)?[i[0][0],i[0][1],i[1][0],i[1][1]]:GF;const o=this.value=HF.from(r,t.x,t.y).voronoi(i);for(let a=0,s=r.length;a<s;++a){const t=o.cellPolygon(a);r[a][n]=t?JF(t):null}return e.reflow(t.modified()).modifies(n)}});var $F=Math.PI/180,VF=64,YF=2048;function KF(){var t,e,n,r,i,o,a,s=[256,256],u=nC,c=[],l=Math.random,f={};function d(t,e,n){for(var r,i,o,a=e.x,c=e.y,f=Math.sqrt(s[0]*s[0]+s[1]*s[1]),d=u(s),h=l()<.5?1:-1,p=-h;(r=d(p+=h))&&(i=~~r[0],o=~~r[1],!(Math.min(Math.abs(i),Math.abs(o))>=f));)if(e.x=a+i,e.y=c+o,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>s[0]||e.y+e.y1>s[1])&&(!n||!QF(e,t,s[0]))&&(!n||eC(e,n))){for(var m,g=e.sprite,v=e.width>>5,y=s[0]>>5,b=e.x-(v<<4),x=127&b,A=32-x,_=e.y1-e.y0,w=(e.y+e.y0)*y+(b>>5),E=0;E<_;E++){m=0;for(var D=0;D<=v;D++)t[w+D]|=m<<A|(D<v?(m=g[E*v+D])>>>x:0);w+=y}return e.sprite=null,!0}return!1}return f.layout=function(){for(var u=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(VF<<5)/e,t.height=YF/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(Gu()),f=function(t){var e=[],n=-1;for(;++n<t;)e[n]=0;return e}((s[0]>>5)*s[1]),h=null,p=c.length,m=-1,g=[],v=c.map((s=>({text:t(s),font:e(s),style:r(s),weight:i(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]*(l()+.5)>>1,y.y=s[1]*(l()+.5)>>1,ZF(u,y,v,m),y.hasText&&d(f,y,h)&&(g.push(y),h?tC(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?(c=t,f):c},f.size=function(t){return arguments.length?(s=[+t[0],+t[1]],f):s},f.font=function(t){return arguments.length?(e=rC(t),f):e},f.fontStyle=function(t){return arguments.length?(r=rC(t),f):r},f.fontWeight=function(t){return arguments.length?(i=rC(t),f):i},f.rotate=function(t){return arguments.length?(o=rC(t),f):o},f.text=function(e){return arguments.length?(t=rC(e),f):t},f.spiral=function(t){return arguments.length?(u=iC[t]||t,f):u},f.fontSize=function(t){return arguments.length?(n=rC(t),f):n},f.padding=function(t){return arguments.length?(a=rC(t),f):a},f.random=function(t){return arguments.length?(l=t,f):l},f}function ZF(t,e,n,r){if(!e.sprite){var i=t.context,o=t.ratio;i.clearRect(0,0,(VF<<5)/o,YF/o);var a,s,u,c,l,f=0,d=0,h=0,p=n.length;for(--r;++r<p;){if(e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font,a=i.measureText(e.text+"m").width*o,u=e.size<<1,e.rotate){var m=Math.sin(e.rotate*$F),g=Math.cos(e.rotate*$F),v=a*g,y=a*m,b=u*g,x=u*m;a=Math.max(Math.abs(v+x),Math.abs(v-x))+31>>5<<5,u=~~Math.max(Math.abs(y+b),Math.abs(y-b))}else a=a+31>>5<<5;if(u>h&&(h=u),f+a>=VF<<5&&(f=0,d+=h,h=0),d+u>=YF)break;i.translate((f+(a>>1))/o,(d+(u>>1))/o),e.rotate&&i.rotate(e.rotate*$F),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=a,e.height=u,e.xoff=f,e.yoff=d,e.x1=a>>1,e.y1=u>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,f+=a}for(var A=i.getImageData(0,0,(VF<<5)/o,YF/o).data,_=[];--r>=0;)if((e=n[r]).hasText){for(s=(a=e.width)>>5,u=e.y1-e.y0,c=0;c<u*s;c++)_[c]=0;if(null==(f=e.xoff))return;d=e.yoff;var w=0,E=-1;for(l=0;l<u;l++){for(c=0;c<a;c++){var D=s*l+(c>>5),F=A[(d+l)*(VF<<5)+(f+c)<<2]?1<<31-c%32:0;_[D]|=F,w|=F}w?E=l:(e.y0++,u--,l--,d++)}e.y1=e.y0+E,e.sprite=_.slice(0,(e.y1-e.y0)*s)}}}function QF(t,e,n){n>>=5;for(var r,i=t.sprite,o=t.width>>5,a=t.x-(o<<4),s=127&a,u=32-s,c=t.y1-t.y0,l=(t.y+t.y0)*n+(a>>5),f=0;f<c;f++){r=0;for(var d=0;d<=o;d++)if((r<<u|(d<o?(r=i[f*o+d])>>>s:0))&e[l+d])return!0;l+=n}return!1}function tC(t,e){var n=t[0],r=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>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function eC(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 nC(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function rC(t){return"function"===typeof t?t:function(){return t}}var iC={archimedean:nC,rectangular:function(t){var e=4*t[0]/t[1],n=0,r=0;return function(t){var i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};const oC=["x","y","font","fontSize","fontStyle","fontWeight","angle"],aC=["text","font","rotate","fontSize","fontStyle","fontWeight"];function sC(t){no.call(this,KF(),t)}sC.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:oC}]},(0,m.XW)(sC,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)||aC.some((function(n){const r=t[n];return(0,m.mf)(r)&&e.modified(r.fields)}))))return;const r=e.materialize(e.SOURCE).source,i=this.value,o=t.as||oC;let a,s=t.fontSize||14;if((0,m.mf)(s)?a=t.fontSizeRange:s=(0,m.a9)(s),a){const t=s,e=Rf("sqrt")().domain((0,m.We)(r,t)).range(a);s=n=>e(t(n))}r.forEach((t=>{t[o[0]]=NaN,t[o[1]]=NaN,t[o[3]]=0}));const u=i.words(r).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(Ao).layout(),c=i.size(),l=c[0]>>1,f=c[1]>>1,d=u.length;for(let h,p,m=0;m<d;++m)h=u[m],p=h.datum,p[o[0]]=h.x+l,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 uC=t=>new Uint8Array(t),cC=t=>new Uint16Array(t),lC=t=>new Uint32Array(t);function fC(t,e,n){const r=(e<257?uC:e<65537?cC:lC)(t);return n&&r.set(n),r}function dC(t,e,n){const r=1<<e;return{one:r,zero:~r,range:n.slice(),bisect:t.bisect,index:t.index,size:t.size,onAdd(t,e){const n=this,i=n.bisect(n.range,t.value),o=t.index,a=i[0],s=i[1],u=o.length;let c;for(c=0;c<a;++c)e[o[c]]|=r;for(c=s;c<u;++c)e[o[c]]|=r;return n}}}function hC(){let t=lC(0),e=[],n=0;return{insert:function(r,i,o){if(!i.length)return[];const a=n,s=i.length,u=lC(s);let c,l,f,d=Array(s);for(f=0;f<s;++f)d[f]=r(i[f]),u[f]=f;if(d=function(t,e){return t.sort.call(e,((e,n)=>{const r=t[e],i=t[n];return r<i?-1:r>i?1:0})),function(t,e){return Array.from(e,(e=>t[e]))}(t,e)}(d,u),a)c=e,l=t,e=Array(a+s),t=lC(a+s),function(t,e,n,r,i,o,a,s,u){let c,l=0,f=0;for(c=0;l<r&&f<a;++c)e[l]<i[f]?(s[c]=e[l],u[c]=n[l++]):(s[c]=i[f],u[c]=o[f++]+t);for(;l<r;++l,++c)s[c]=e[l],u[c]=n[l];for(;f<a;++f,++c)s[c]=i[f],u[c]=o[f]+t}(o,c,l,a,d,u,s,e,t);else{if(o>0)for(f=0;f<s;++f)u[f]+=o;e=d,t=u}return n=a+s,{index:u,value:d}},remove:function(r,i){const o=n;let a,s,u;for(s=0;!i[t[s]]&&s<o;++s);for(u=s;s<o;++s)i[a=t[s]]||(t[u]=a,e[u]=e[s],++u);n=o-r},bisect:function(t,r){let i;return r?i=r.length:(r=e,i=n),[Yu(r,t[0],0,i),Vu(r,t[1],0,i)]},reindex:function(e){for(let r=0,i=n;r<i;++r)t[r]=e[t[r]]},index:()=>t,size:()=>n}}function pC(t){no.call(this,function(){let t=8,e=[],n=lC(0),r=fC(0,t),i=fC(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,r=0,i=e.length,o=t.length;r<o;++r)n=t[r],n._index=i++,e.push(n)},remove(t,n){const o=e.length,a=Array(o-t),s=e;let u,c,l;for(c=0;!n[c]&&c<o;++c)a[c]=e[c],s[c]=c;for(l=c;c<o;++c)u=e[c],n[c]?s[c]=-1:(s[c]=l,r[l]=r[c],i[l]=i[c],a[l]=u,u._index=l++),r[c]=0;return e=a,s},size:()=>e.length,curr:()=>r,prev:()=>i,reset:t=>i[t]=r[t],all:()=>t<257?255:t<65537?65535:4294967295,set(t,e){r[t]|=e},clear(t,e){r[t]&=~e},resize(e,n){(e>r.length||n>t)&&(t=Math.max(n,t),r=fC(e,t,r),i=fC(e,t))}}}(),t),this._indices=null,this._dims=null}function mC(t){no.call(this,null,t)}function*gC(t,e){if(null==e)for(let n of t)null!=n&&""!==n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)r=e(r,++n,t),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function vC(t,e,n){const r=Float64Array.from(gC(t,n));return r.sort(Wt),e.map((t=>mo(r,t)))}function yC(t,e){return vC(t,[.25,.5,.75],e)}function bC(t,e){const n=t.length,r=go(t,e),i=yC(t,e),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function xC(t){const e=t.maxbins||20,n=t.base||10,r=Math.log(n),i=t.divide||[5,2];let o,a,s,u,c,l,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(u=h/e,c=0,l=t.steps.length;c<l&&t.steps[c]<u;++c);o=t.steps[Math.max(0,c-1)]}else{for(a=Math.ceil(Math.log(e)/r),s=t.minstep||0,o=Math.max(s,Math.pow(n,Math.round(Math.log(h)/r)-a));Math.ceil(h/o)>e;)o*=n;for(c=0,l=i.length;c<l;++c)u=o/i[c],u>=s&&h/u<=e&&(o=u)}u=Math.log(o);const p=u>=0?0:1+~~(-u/r),m=Math.pow(n,-p-1);return(t.nice||void 0===t.nice)&&(u=Math.floor(f/o+m)*o,f=f<u?u-o:u,d=Math.ceil(d/o)*o),{start:f,stop:d===f?f+o:d,step:o}}pC.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)(pC,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,r=t.query,i=this._indices={},o=this._dims=[],a=r.length;let s,u,c=0;for(;c<a;++c)s=n[c].fname,u=i[s]||(i[s]=hC()),o.push(dC(u,c,r[c]));return this.eval(t,e)},reinit(t,e){const n=e.materialize().fork(),r=t.fields,i=t.query,o=this._indices,a=this._dims,s=this.value,u=s.curr(),c=s.prev(),l=s.all(),f=n.rem=n.add,d=n.mod,h=i.length,p={};let m,g,v,y,b,x,A,_,w;if(c.set(u),e.rem.length&&(b=this.remove(t,e,n)),e.add.length&&s.add(e.add),e.mod.length)for(x={},y=e.mod,A=0,_=y.length;A<_;++A)x[y[A]._index]=1;for(A=0;A<h;++A)w=r[A],(!a[A]||t.modified("fields",A)||e.modified(w.fields))&&(v=w.fname,(m=p[v])||(o[v]=g=hC(),p[v]=m=g.insert(w,e.source,0)),a[A]=dC(g,A,i[A]).onAdd(m,u));for(A=0,_=s.data().length;A<_;++A)b[A]||(c[A]!==u[A]?f.push(A):x[A]&&u[A]!==l&&d.push(A));return s.mask=(1<<h)-1,n},eval(t,e){const n=e.materialize().fork(),r=this._dims.length;let i=0;return e.rem.length&&(this.remove(t,e,n),i|=(1<<r)-1),t.modified("query")&&!t.modified("fields")&&(i|=this.update(t,e,n)),e.add.length&&(this.insert(t,e,n),i|=(1<<r)-1),e.mod.length&&(this.modify(e,n),i|=(1<<r)-1),this.value.mask=i,n},insert(t,e,n){const r=e.add,i=this.value,o=this._dims,a=this._indices,s=t.fields,u={},c=n.add,l=i.size()+r.length,f=o.length;let d,h,p,m=i.size();i.resize(l,f),i.add(r);const g=i.curr(),v=i.prev(),y=i.all();for(d=0;d<f;++d)h=s[d].fname,p=u[h]||(u[h]=a[h].insert(s[d],r,m)),o[d].onAdd(p,g);for(;m<l;++m)v[m]=y,g[m]!==y&&c.push(m)},modify(t,e){const n=e.mod,r=this.value,i=r.curr(),o=r.all(),a=t.mod;let s,u,c;for(s=0,u=a.length;s<u;++s)c=a[s]._index,i[c]!==o&&n.push(c)},remove(t,e,n){const r=this._indices,i=this.value,o=i.curr(),a=i.prev(),s=i.all(),u={},c=n.rem,l=e.rem;let f,d,h,p;for(f=0,d=l.length;f<d;++f)h=l[f]._index,u[h]=1,a[h]=p=o[h],o[h]=s,p!==s&&c.push(h);for(h in r)r[h].remove(d,u);return this.reindex(e,d,u),u},reindex(t,e,n){const r=this._indices,i=this.value;t.runAfter((()=>{const t=i.remove(e,n);for(const e in r)r[e].reindex(t)}))},update(t,e,n){const r=this._dims,i=t.query,o=e.stamp,a=r.length;let s,u,c=0;for(n.filters=0,u=0;u<a;++u)t.modified("query",u)&&(s=u,++c);if(1===c)c=r[s].one,this.incrementOne(r[s],i[s],n.add,n.rem);else for(u=0,c=0;u<a;++u)t.modified("query",u)&&(c|=r[u].one,this.incrementAll(r[u],i[u],o,n.add),n.rem=n.add);return c},incrementAll(t,e,n,r){const i=this.value,o=i.seen(),a=i.curr(),s=i.prev(),u=t.index(),c=t.bisect(t.range),l=t.bisect(e),f=l[0],d=l[1],h=c[0],p=c[1],m=t.one;let g,v,y;if(f<h)for(g=f,v=Math.min(h,d);g<v;++g)y=u[g],o[y]!==n&&(s[y]=a[y],o[y]=n,r.push(y)),a[y]^=m;else if(f>h)for(g=h,v=Math.min(f,p);g<v;++g)y=u[g],o[y]!==n&&(s[y]=a[y],o[y]=n,r.push(y)),a[y]^=m;if(d>p)for(g=Math.max(f,p),v=d;g<v;++g)y=u[g],o[y]!==n&&(s[y]=a[y],o[y]=n,r.push(y)),a[y]^=m;else if(d<p)for(g=Math.max(h,d),v=p;g<v;++g)y=u[g],o[y]!==n&&(s[y]=a[y],o[y]=n,r.push(y)),a[y]^=m;t.range=e.slice()},incrementOne(t,e,n,r){const i=this.value.curr(),o=t.index(),a=t.bisect(t.range),s=t.bisect(e),u=s[0],c=s[1],l=a[0],f=a[1],d=t.one;let h,p,m;if(u<l)for(h=u,p=Math.min(l,c);h<p;++h)m=o[h],i[m]^=d,n.push(m);else if(u>l)for(h=l,p=Math.min(u,f);h<p;++h)m=o[h],i[m]^=d,r.push(m);if(c>f)for(h=Math.max(u,f),p=c;h<p;++h)m=o[h],i[m]^=d,n.push(m);else if(c<f)for(h=Math.max(l,c),p=f;h<p;++h)m=o[h],i[m]^=d,r.push(m);t.range=e.slice()}}),mC.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)(mC,no,{transform(t,e){const n=~(t.ignore||0),r=t.filter,i=r.mask;if(0===(i&n))return e.StopPropagation;const o=e.fork(e.ALL),a=r.data(),s=r.curr(),u=r.prev(),c=t=>s[t]&n?null:a[t];return o.filter(o.MOD,c),i&i-1?(o.filter(o.ADD,(t=>{const e=s[t]&n;return!e&&e^u[t]&n?a[t]:null})),o.filter(o.REM,(t=>{const e=s[t]&n;return e&&!(e^e^u[t]&n)?a[t]:null}))):(o.filter(o.ADD,c),o.filter(o.REM,(t=>(s[t]&n)===i?a[t]:null))),o.filter(o.SOURCE,(t=>c(t._index)))}});var AC=Math.random;function _C(t){AC=t}function wC(t,e,n,r){if(!t.length)return[void 0,void 0];const i=Float64Array.from(gC(t,r)),o=i.length,a=e;let s,u,c,l;for(c=0,l=Array(a);c<a;++c){for(s=0,u=0;u<o;++u)s+=i[~~(AC()*o)];l[c]=s/o}return l.sort(Wt),[po(l,n/2),po(l,1-n/2)]}function EC(t,e,n,r){r=r||(t=>t);const i=t.length,o=new Float64Array(i);let a,s=0,u=1,c=r(t[0]),l=c,f=c+e;for(;u<i;++u){if(a=r(t[u]),a>=f){for(l=(c+l)/2;s<u;++s)o[s]=l;f=a+e,c=a}l=a}for(l=(c+l)/2;s<u;++s)o[s]=l;return n?function(t,e){const n=t.length;let r,i,o=0,a=1;for(;t[o]===t[a];)++a;for(;a<n;){for(r=a+1;t[a]===t[r];)++r;if(t[a]-t[a-1]<e){for(i=a+(o+r-a-a>>1);i<a;)t[i++]=t[a];for(;i>a;)t[i--]=t[o]}o=a,a=r}return t}(o,e+e/4):o}function DC(t){return function(){return(t=(1103515245*t+12345)%2147483647)/2147483647}}function FC(t,e){let n,r,i;null==e&&(e=t,t=0);const o={min(t){return arguments.length?(n=t||0,i=r-n,o):n},max(t){return arguments.length?(r=t||0,i=r-n,o):r},sample:()=>n+Math.floor(i*AC()),pdf:t=>t===Math.floor(t)&&t>=n&&t<r?1/i:0,cdf(t){const e=Math.floor(t);return e<n?0:e>=r?1:(e-n+1)/i},icdf:t=>t>=0&&t<=1?n-1+Math.floor(t*i):NaN};return o.min(t).max(e)}const CC=Math.sqrt(2*Math.PI),kC=Math.SQRT2;let SC=NaN;function MC(t,e){t=t||0,e=null==e?1:e;let n,r,i=0,o=0;if(SC===SC)i=SC,SC=NaN;else{do{i=2*AC()-1,o=2*AC()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,SC=o*r}return t+i*e}function BC(t,e,n){const r=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*CC)}function OC(t,e,n){const r=(t-(e=e||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const t=Math.exp(-i*i/2);let e;i<7.07106781186547?(e=.0352624965998911*i+.700383064443688,e=e*i+6.37396220353165,e=e*i+33.912866078383,e=e*i+112.079291497871,e=e*i+221.213596169931,e=e*i+220.206867912376,o=t*e,e=.0883883476483184*i+1.75566716318264,e=e*i+16.064177579207,e=e*i+86.7807322029461,e=e*i+296.564248779674,e=e*i+637.333633378831,e=e*i+793.826512519948,e=e*i+440.413735824752,o/=e):(e=i+.65,e=i+4/e,e=i+3/e,e=i+2/e,e=i+1/e,o=t/e/2.506628274631)}return r>0?1-o:o}function NC(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*kC*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 TC(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>MC(n,r),pdf:t=>BC(t,n,r),cdf:t=>OC(t,n,r),icdf:t=>NC(t,n,r)};return i.mean(t).stdev(e)}function zC(t,e){const n=TC();let r=0;const i={data(n){return arguments.length?(t=n,r=n?n.length:0,i.bandwidth(e)):t},bandwidth(n){return arguments.length?(!(e=n)&&t&&(e=bC(t)),i):e},sample:()=>t[~~(AC()*r)]+e*n.sample(),pdf(i){let o=0,a=0;for(;a<r;++a)o+=n.pdf((i-t[a])/e);return o/e/r},cdf(i){let o=0,a=0;for(;a<r;++a)o+=n.cdf((i-t[a])/e);return o/r},icdf(){throw Error("KDE icdf not supported.")}};return i.data(t)}function RC(t,e){return t=t||0,e=null==e?1:e,Math.exp(t+MC()*e)}function PC(t,e,n){if(t<=0)return 0;e=e||0,n=null==n?1:n;const r=(Math.log(t)-e)/n;return Math.exp(-.5*r*r)/(n*CC*t)}function LC(t,e,n){return OC(Math.log(t),e,n)}function jC(t,e,n){return Math.exp(NC(t,e,n))}function UC(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>RC(n,r),pdf:t=>PC(t,n,r),cdf:t=>LC(t,n,r),icdf:t=>jC(t,n,r)};return i.mean(t).stdev(e)}function IC(t,e){let n,r=0;const i={weights(t){return arguments.length?(n=function(t){const e=[];let n,i=0;for(n=0;n<r;++n)i+=e[n]=null==t[n]?1:+t[n];for(n=0;n<r;++n)e[n]/=i;return e}(e=t||[]),i):e},distributions(n){return arguments.length?(n?(r=n.length,t=n):(r=0,t=[]),i.weights(e)):t},sample(){const e=AC();let i=t[r-1],o=n[0],a=0;for(;a<r-1;o+=n[++a])if(e<o){i=t[a];break}return i.sample()},pdf(e){let i=0,o=0;for(;o<r;++o)i+=n[o]*t[o].pdf(e);return i},cdf(e){let i=0,o=0;for(;o<r;++o)i+=n[o]*t[o].cdf(e);return i},icdf(){throw Error("Mixture icdf not supported.")}};return i.distributions(t).weights(e)}function qC(t,e){return null==e&&(e=null==t?1:t,t=0),t+(e-t)*AC()}function WC(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=e&&t<=n?1/(n-e):0}function HC(t,e,n){return null==n&&(n=null==e?1:e,e=0),t<e?0:t>n?1:(t-e)/(n-e)}function XC(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function GC(t,e){let n,r;const i={min(t){return arguments.length?(n=t||0,i):n},max(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>qC(n,r),pdf:t=>WC(t,n,r),cdf:t=>HC(t,n,r),icdf:t=>XC(t,n,r)};return null==e&&(e=null==t?1:t,t=0),i.min(t).max(e)}function JC(t,e,n){let r=0,i=0;for(const o of t){const t=n(o);null==e(o)||null==t||isNaN(t)||(r+=(t-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function $C(t,e,n,r){const i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]}function VC(t,e,n,r){t=t.filter((t=>{let r=e(t),i=n(t);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i})),r&&t.sort(((t,n)=>e(t)-e(n)));const i=t.length,o=new Float64Array(i),a=new Float64Array(i);let s,u,c,l=0,f=0,d=0;for(c of t)o[l]=s=+e(c),a[l]=u=+n(c),++l,f+=(s-f)/l,d+=(u-d)/l;for(l=0;l<i;++l)o[l]-=f,a[l]-=d;return[o,a,f,d]}function YC(t,e,n,r){let i,o,a=-1;for(const s of t)i=e(s),o=n(s),null!=i&&(i=+i)>=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function KC(t,e,n,r,i){let o=0,a=0;return YC(t,e,n,((t,e)=>{const n=e-i(t),s=e-r;o+=n*n,a+=s*s})),1-o/a}function ZC(t,e,n){let r=0,i=0,o=0,a=0,s=0;YC(t,e,n,((t,e)=>{++s,r+=(t-r)/s,i+=(e-i)/s,o+=(t*e-o)/s,a+=(t*t-a)/s}));const u=$C(r,i,o,a),c=t=>u[0]+u[1]*t;return{coef:u,predict:c,rSquared:KC(t,e,n,i,c)}}function QC(t,e,n){let r=0,i=0,o=0,a=0,s=0;YC(t,e,n,((t,e)=>{++s,t=Math.log(t),r+=(t-r)/s,i+=(e-i)/s,o+=(t*e-o)/s,a+=(t*t-a)/s}));const u=$C(r,i,o,a),c=t=>u[0]+u[1]*Math.log(t);return{coef:u,predict:c,rSquared:KC(t,e,n,i,c)}}function tk(t,e,n){const[r,i,o,a]=VC(t,e,n);let s,u,c,l=0,f=0,d=0,h=0,p=0;YC(t,e,n,((t,e)=>{s=r[p++],u=Math.log(e),c=s*e,l+=(e*u-l)/p,f+=(c-f)/p,d+=(c*u-d)/p,h+=(s*c-h)/p}));const[m,g]=$C(f/a,l/a,d/a,h/a),v=t=>Math.exp(m+g*(t-o));return{coef:[Math.exp(m-g*o),g],predict:v,rSquared:KC(t,e,n,a,v)}}function ek(t,e,n){let r=0,i=0,o=0,a=0,s=0,u=0;YC(t,e,n,((t,e)=>{const n=Math.log(t),c=Math.log(e);++u,r+=(n-r)/u,i+=(c-i)/u,o+=(n*c-o)/u,a+=(n*n-a)/u,s+=(e-s)/u}));const c=$C(r,i,o,a),l=t=>c[0]*Math.pow(t,c[1]);return c[0]=Math.exp(c[0]),{coef:c,predict:l,rSquared:KC(t,e,n,s,l)}}function nk(t,e,n){const[r,i,o,a]=VC(t,e,n),s=r.length;let u,c,l,f,d=0,h=0,p=0,m=0,g=0;for(u=0;u<s;)c=r[u],l=i[u++],f=c*c,d+=(f-d)/u,h+=(f*c-h)/u,p+=(f*f-p)/u,m+=(c*l-m)/u,g+=(f*l-g)/u;const v=p-d*d,y=d*v-h*h,b=(g*d-m*h)/y,x=(m*v-g*h)/y,A=-b*d,_=t=>b*(t-=o)*t+x*t+A+a;return{coef:[A-x*o+b*o*o+a,x-2*b*o,b],predict:_,rSquared:KC(t,e,n,a,_)}}function rk(t,e,n,r){if(0===r)return JC(t,e,n);if(1===r)return ZC(t,e,n);if(2===r)return nk(t,e,n);const[i,o,a,s]=VC(t,e,n),u=i.length,c=[],l=[],f=r+1;let d,h,p,m,g;for(d=0;d<f;++d){for(p=0,m=0;p<u;++p)m+=Math.pow(i[p],d)*o[p];for(c.push(m),g=new Float64Array(f),h=0;h<f;++h){for(p=0,m=0;p<u;++p)m+=Math.pow(i[p],d+h);g[h]=m}l.push(g)}l.push(c);const v=function(t){const e=t.length-1,n=[];let r,i,o,a,s;for(r=0;r<e;++r){for(a=r,i=r+1;i<e;++i)Math.abs(t[r][i])>Math.abs(t[r][a])&&(a=i);for(o=r;o<e+1;++o)s=t[o][r],t[o][r]=t[o][a],t[o][a]=s;for(i=r+1;i<e;++i)for(o=e;o>=r;o--)t[o][i]-=t[o][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(s=0,o=i+1;o<e;++o)s+=t[o][i]*n[o];n[i]=(t[e][i]-s)/t[i][i]}return n}(l),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:ik(f,v,-a,s),predict:y,rSquared:KC(t,e,n,s,y)}}function ik(t,e,n,r){const i=Array(t);let o,a,s,u;for(o=0;o<t;++o)i[o]=0;for(o=t-1;o>=0;--o)for(s=e[o],u=1,i[o]+=s,a=1;a<=o;++a)u*=(o+1-a)/a,i[o-a]+=s*Math.pow(n,a)*u;return i[0]+=r,i}const ok=2,ak=1e-12;function sk(t,e,n,r){const[i,o,a,s]=VC(t,e,n,!0),u=i.length,c=Math.max(2,~~(r*u)),l=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=ok;){const t=[0,c-1];for(let n=0;n<u;++n){const e=i[n],r=t[0],a=t[1],s=e-i[r]>i[a]-e?r:a;let u=0,c=0,h=0,p=0,m=0;const g=1/Math.abs(i[s]-e||1);for(let t=r;t<=a;++t){const n=i[t],r=o[t],a=uk(Math.abs(e-n)*g)*d[t],s=n*a;u+=a,c+=s,h+=r*a,p+=r*s,m+=n*s}const[v,y]=$C(c/u,h/u,p/u,m/u);l[n]=v+y*e,f[n]=Math.abs(o[n]-l[n]),ck(i,n+1,t)}if(h===ok)break;const e=Wo(f);if(Math.abs(e)<ak)break;for(let n,r,i=0;i<u;++i)n=f[i]/(6*e),d[i]=n>=1?ak:(r=1-n*n)*r}return function(t,e,n,r){const i=t.length,o=[];let a,s=0,u=0,c=[];for(;s<i;++s)a=t[s]+n,c[0]===a?c[1]+=(e[s]-c[1])/++u:(u=0,c[1]+=r,c=[a,e[s]],o.push(c));return c[1]+=r,o}(i,l,a,s)}function uk(t){return(t=1-t*t*t)*t*t}function ck(t,e,n){const r=t[e];let i=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}const lk=.5*Math.PI/180;function fk(t,e,n,r){n=n||25,r=Math.max(n,r||200);const i=e=>[e,t(e)],o=e[0],a=e[1],s=a-o,u=s/r,c=[i(o)],l=[];if(n===r){for(let t=1;t<r;++t)c.push(i(o+t/n*s));return c.push(i(a)),c}l.push(i(a));for(let m=n;--m>0;)l.push(i(o+m/n*s));let f=c[0],d=l[l.length-1];const h=1/s,p=function(t,e){let n=t,r=t;const i=e.length;for(let o=0;o<i;++o){const t=e[o][1];t<n&&(n=t),t>r&&(r=t)}return 1/(r-n)}(f[1],l);for(;d;){const t=i((f[0]+d[0])/2);t[0]-f[0]>=u&&dk(f,t,d,h,p)>lk?l.push(t):(f=d,c.push(d),l.pop()),d=l[l.length-1]}return c}function dk(t,e,n,r,i){const o=Math.atan2(i*(n[1]-t[1]),r*(n[0]-t[0])),a=Math.atan2(i*(e[1]-t[1]),r*(e[0]-t[0]));return Math.abs(o-a)}const hk="Literal",pk="Property",mk="ArrayExpression",gk="BinaryExpression",vk="CallExpression",yk="ConditionalExpression",bk="LogicalExpression",xk="MemberExpression",Ak="ObjectExpression",_k="UnaryExpression";function wk(t){this.type=t}var Ek,Dk,Fk,Ck,kk;wk.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=function(t){switch(t.type){case mk:return t.elements;case gk:case bk:return[t.left,t.right];case vk:return[t.callee].concat(t.arguments);case yk:return[t.test,t.consequent,t.alternate];case xk:return[t.object,t.property];case Ak:return t.properties;case pk:return[t.key,t.value];case _k:return[t.argument];default:return[]}}(this),n=0,r=e.length;n<r;++n)if(e[n].visit(t))return 1};var Sk=1,Mk=2,Bk=3,Ok=4,Nk=5,Tk=6,zk=7,Rk=8;(Ek={})[Sk]="Boolean",Ek[Mk]="<end>",Ek[Bk]="Identifier",Ek[Ok]="Keyword",Ek[Nk]="Null",Ek[Tk]="Numeric",Ek[zk]="Punctuator",Ek[Rk]="String",Ek[9]="RegularExpression";var Pk="ArrayExpression",Lk="BinaryExpression",jk="CallExpression",Uk="ConditionalExpression",Ik="Identifier",qk="Literal",Wk="LogicalExpression",Hk="MemberExpression",Xk="ObjectExpression",Gk="Property",Jk="UnaryExpression",$k="Unexpected token %0",Vk="Unexpected number",Yk="Unexpected string",Kk="Unexpected identifier",Zk="Unexpected reserved word",Qk="Unexpected end of input",tS="Invalid regular expression",eS="Invalid regular expression: missing /",nS="Octal literals are not allowed in strict mode.",rS="Duplicate data property in object literal not allowed in strict mode",iS="ILLEGAL",oS="Disabled.",aS=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]"),sS=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 uS(t,e){if(!t)throw new Error("ASSERT: "+e)}function cS(t){return t>=48&&t<=57}function lS(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function fS(t){return"01234567".indexOf(t)>=0}function dS(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 hS(t){return 10===t||13===t||8232===t||8233===t}function pS(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&aS.test(String.fromCharCode(t))}function mS(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&sS.test(String.fromCharCode(t))}const gS={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 vS(){for(;Fk<Ck;){const t=Dk.charCodeAt(Fk);if(!dS(t)&&!hS(t))break;++Fk}}function yS(t){var e,n,r,i=0;for(n="u"===t?4:2,e=0;e<n;++e)Fk<Ck&&lS(Dk[Fk])?(r=Dk[Fk++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):TS({},$k,iS);return String.fromCharCode(i)}function bS(){var t,e,n,r;for(e=0,"}"===(t=Dk[Fk])&&TS({},$k,iS);Fk<Ck&&lS(t=Dk[Fk++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&TS({},$k,iS),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function xS(){var t,e;for(t=Dk.charCodeAt(Fk++),e=String.fromCharCode(t),92===t&&(117!==Dk.charCodeAt(Fk)&&TS({},$k,iS),++Fk,(t=yS("u"))&&"\\"!==t&&pS(t.charCodeAt(0))||TS({},$k,iS),e=t);Fk<Ck&&mS(t=Dk.charCodeAt(Fk));)++Fk,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==Dk.charCodeAt(Fk)&&TS({},$k,iS),++Fk,(t=yS("u"))&&"\\"!==t&&mS(t.charCodeAt(0))||TS({},$k,iS),e+=t);return e}function AS(){var t,e;return t=Fk,e=92===Dk.charCodeAt(Fk)?xS():function(){var t,e;for(t=Fk++;Fk<Ck;){if(92===(e=Dk.charCodeAt(Fk)))return Fk=t,xS();if(!mS(e))break;++Fk}return Dk.slice(t,Fk)}(),{type:1===e.length?Bk:gS.hasOwnProperty(e)?Ok:"null"===e?Nk:"true"===e||"false"===e?Sk:Bk,value:e,start:t,end:Fk}}function _S(){var t,e,n,r,i=Fk,o=Dk.charCodeAt(Fk),a=Dk[Fk];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++Fk,{type:zk,value:String.fromCharCode(o),start:i,end:Fk};default:if(61===(t=Dk.charCodeAt(Fk+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return Fk+=2,{type:zk,value:String.fromCharCode(o)+String.fromCharCode(t),start:i,end:Fk};case 33:case 61:return Fk+=2,61===Dk.charCodeAt(Fk)&&++Fk,{type:zk,value:Dk.slice(i,Fk),start:i,end:Fk}}}return">>>="===(r=Dk.substr(Fk,4))?{type:zk,value:r,start:i,end:Fk+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:zk,value:n,start:i,end:Fk+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:zk,value:e,start:i,end:Fk+=2}:("//"===e&&TS({},$k,iS),"<>=!+-*%&|^/".indexOf(a)>=0?(++Fk,{type:zk,value:a,start:i,end:Fk}):void TS({},$k,iS))}function wS(){var t,e,n;if(uS(cS((n=Dk[Fk]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=Fk,t="","."!==n){if(t=Dk[Fk++],n=Dk[Fk],"0"===t){if("x"===n||"X"===n)return++Fk,function(t){let e="";for(;Fk<Ck&&lS(Dk[Fk]);)e+=Dk[Fk++];return 0===e.length&&TS({},$k,iS),pS(Dk.charCodeAt(Fk))&&TS({},$k,iS),{type:Tk,value:parseInt("0x"+e,16),start:t,end:Fk}}(e);if(fS(n))return function(t){let e="0"+Dk[Fk++];for(;Fk<Ck&&fS(Dk[Fk]);)e+=Dk[Fk++];return(pS(Dk.charCodeAt(Fk))||cS(Dk.charCodeAt(Fk)))&&TS({},$k,iS),{type:Tk,value:parseInt(e,8),octal:!0,start:t,end:Fk}}(e);n&&cS(n.charCodeAt(0))&&TS({},$k,iS)}for(;cS(Dk.charCodeAt(Fk));)t+=Dk[Fk++];n=Dk[Fk]}if("."===n){for(t+=Dk[Fk++];cS(Dk.charCodeAt(Fk));)t+=Dk[Fk++];n=Dk[Fk]}if("e"===n||"E"===n)if(t+=Dk[Fk++],"+"!==(n=Dk[Fk])&&"-"!==n||(t+=Dk[Fk++]),cS(Dk.charCodeAt(Fk)))for(;cS(Dk.charCodeAt(Fk));)t+=Dk[Fk++];else TS({},$k,iS);return pS(Dk.charCodeAt(Fk))&&TS({},$k,iS),{type:Tk,value:parseFloat(t),start:e,end:Fk}}function ES(){var t,e,n,r;return kk=null,vS(),t=Fk,e=function(){var t,e,n,r;for(uS("/"===(t=Dk[Fk]),"Regular expression literal must start with a slash"),e=Dk[Fk++],n=!1,r=!1;Fk<Ck;)if(e+=t=Dk[Fk++],"\\"===t)hS((t=Dk[Fk++]).charCodeAt(0))&&TS({},eS),e+=t;else if(hS(t.charCodeAt(0)))TS({},eS);else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||TS({},eS),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";Fk<Ck&&mS((t=Dk[Fk]).charCodeAt(0));)++Fk,"\\"===t&&Fk<Ck?TS({},$k,iS):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&TS({},tS,n),{value:n,literal:e}}(),r=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";TS({},tS)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(r){TS({},tS)}try{return new RegExp(t,e)}catch(i){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:Fk}}function DS(){if(vS(),Fk>=Ck)return{type:Mk,start:Fk,end:Fk};const t=Dk.charCodeAt(Fk);return pS(t)?AS():40===t||41===t||59===t?_S():39===t||34===t?function(){var t,e,n,r,i="",o=!1;for(uS("'"===(t=Dk[Fk])||'"'===t,"String literal must starts with a quote"),e=Fk,++Fk;Fk<Ck;){if((n=Dk[Fk++])===t){t="";break}if("\\"===n)if((n=Dk[Fk++])&&hS(n.charCodeAt(0)))"\r"===n&&"\n"===Dk[Fk]&&++Fk;else switch(n){case"u":case"x":"{"===Dk[Fk]?(++Fk,i+=bS()):i+=yS(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:fS(n)?(0!==(r="01234567".indexOf(n))&&(o=!0),Fk<Ck&&fS(Dk[Fk])&&(o=!0,r=8*r+"01234567".indexOf(Dk[Fk++]),"0123".indexOf(n)>=0&&Fk<Ck&&fS(Dk[Fk])&&(r=8*r+"01234567".indexOf(Dk[Fk++]))),i+=String.fromCharCode(r)):i+=n}else{if(hS(n.charCodeAt(0)))break;i+=n}}return""!==t&&TS({},$k,iS),{type:Rk,value:i,octal:o,start:e,end:Fk}}():46===t?cS(Dk.charCodeAt(Fk+1))?wS():_S():cS(t)?wS():_S()}function FS(){const t=kk;return Fk=t.end,kk=DS(),Fk=t.end,t}function CS(){const t=Fk;kk=DS(),Fk=t}function kS(t,e,n){const r=new wk("||"===t||"&&"===t?Wk:Lk);return r.operator=t,r.left=e,r.right=n,r}function SS(t,e){const n=new wk(jk);return n.callee=t,n.arguments=e,n}function MS(t){const e=new wk(Ik);return e.name=t,e}function BS(t){const e=new wk(qk);return e.value=t.value,e.raw=Dk.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function OS(t,e,n){const r=new wk(Hk);return r.computed="["===t,r.object=e,r.property=n,r.computed||(n.member=!0),r}function NS(t,e,n){const r=new wk(Gk);return r.key=e,r.value=n,r.kind=t,r}function TS(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,((t,e)=>(uS(e<r.length,"Message reference must be in range"),r[e])));throw(n=new Error(i)).index=Fk,n.description=i,n}function zS(t){t.type===Mk&&TS(t,Qk),t.type===Tk&&TS(t,Vk),t.type===Rk&&TS(t,Yk),t.type===Bk&&TS(t,Kk),t.type===Ok&&TS(t,Zk),TS(t,$k,t.value)}function RS(t){const e=FS();e.type===zk&&e.value===t||zS(e)}function PS(t){return kk.type===zk&&kk.value===t}function LS(t){return kk.type===Ok&&kk.value===t}function jS(){const t=[];for(Fk=kk.start,RS("[");!PS("]");)PS(",")?(FS(),t.push(null)):(t.push(KS()),PS("]")||RS(","));return FS(),function(t){const e=new wk(Pk);return e.elements=t,e}(t)}function US(){Fk=kk.start;const t=FS();return t.type===Rk||t.type===Tk?(t.octal&&TS(t,nS),BS(t)):MS(t.value)}function IS(){var t,e,n;return Fk=kk.start,(t=kk).type===Bk?(n=US(),RS(":"),NS("init",n,KS())):t.type!==Mk&&t.type!==zk?(e=US(),RS(":"),NS("init",e,KS())):void zS(t)}function qS(){var t,e,n=[],r={},i=String;for(Fk=kk.start,RS("{");!PS("}");)e="$"+((t=IS()).key.type===Ik?t.key.name:i(t.key.value)),Object.prototype.hasOwnProperty.call(r,e)?TS({},rS):r[e]=!0,n.push(t),PS("}")||RS(",");return RS("}"),function(t){const e=new wk(Xk);return e.properties=t,e}(n)}const WS={if:1};function HS(){var t,e,n;if(PS("("))return function(){RS("(");const t=ZS();return RS(")"),t}();if(PS("["))return jS();if(PS("{"))return qS();if(t=kk.type,Fk=kk.start,t===Bk||WS[kk.value])n=MS(FS().value);else if(t===Rk||t===Tk)kk.octal&&TS(kk,nS),n=BS(FS());else{if(t===Ok)throw new Error(oS);t===Sk?((e=FS()).value="true"===e.value,n=BS(e)):t===Nk?((e=FS()).value=null,n=BS(e)):PS("/")||PS("/=")?(n=BS(ES()),CS()):zS(FS())}return n}function XS(){const t=[];if(RS("("),!PS(")"))for(;Fk<Ck&&(t.push(KS()),!PS(")"));)RS(",");return RS(")"),t}function GS(){Fk=kk.start;const t=FS();return function(t){return t.type===Bk||t.type===Ok||t.type===Sk||t.type===Nk}(t)||zS(t),MS(t.value)}function JS(){RS("[");const t=ZS();return RS("]"),t}function $S(){const t=function(){var t;for(t=HS();;)if(PS("."))RS("."),t=OS(".",t,GS());else if(PS("("))t=SS(t,XS());else{if(!PS("["))break;t=OS("[",t,JS())}return t}();if(kk.type===zk&&(PS("++")||PS("--")))throw new Error(oS);return t}function VS(){var t,e;if(kk.type!==zk&&kk.type!==Ok)e=$S();else{if(PS("++")||PS("--"))throw new Error(oS);if(PS("+")||PS("-")||PS("~")||PS("!"))t=FS(),e=VS(),e=function(t,e){const n=new wk(Jk);return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if(LS("delete")||LS("void")||LS("typeof"))throw new Error(oS);e=$S()}}return e}function YS(t){let e=0;if(t.type!==zk&&t.type!==Ok)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 KS(){var t,e;return t=function(){var t,e,n,r,i,o,a,s,u,c;if(t=kk,u=VS(),0===(i=YS(r=kk)))return u;for(r.prec=i,FS(),e=[t,kk],o=[u,r,a=VS()];(i=YS(kk))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),e.pop(),n=kS(s,u,a),o.push(n);(r=FS()).prec=i,o.push(r),e.push(kk),n=VS(),o.push(n)}for(n=o[c=o.length-1],e.pop();c>1;)e.pop(),n=kS(o[c-1].value,o[c-2],n),c-=2;return n}(),PS("?")&&(FS(),e=KS(),RS(":"),t=function(t,e,n){const r=new wk(Uk);return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,KS())),t}function ZS(){const t=KS();if(PS(","))throw new Error(oS);return t}var QS={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 tM(t){function e(e,n,r){return i=>function(e,n,r,i){let o=t(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+e+(i<0?"":0===i?"()":"("+n.slice(1).map(t).join(",")+")")}(e,i,n,r)}const n="new Date",r="String",i="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",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,m.vU)("Missing arguments to clamp function."),e.length>3&&(0,m.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:i,test:e("test",i),if:function(e){e.length<3&&(0,m.vU)("Missing arguments to if function."),e.length>3&&(0,m.vU)("Too many arguments to if function.");const n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}var eM,nM,rM,iM,oM,aM,sM,uM,cM,lM,fM,dM,hM,pM,mM,gM,vM=new pb,yM=new pb,bM={point:Lb,lineStart:Lb,lineEnd:Lb,polygonStart:function(){vM=new pb,bM.lineStart=xM,bM.lineEnd=AM},polygonEnd:function(){var t=+vM;yM.add(t<0?xb+t:t),this.lineStart=this.lineEnd=this.point=Lb},sphere:function(){yM.add(xb)}};function xM(){bM.point=_M}function AM(){wM(eM,nM)}function _M(t,e){bM.point=wM,eM=t,nM=e,rM=t*=_b,iM=Fb(e=(e*=_b)/2+bb),oM=Ob(e)}function wM(t,e){var n=(t*=_b)-rM,r=n>=0?1:-1,i=r*n,o=Fb(e=(e*=_b)/2+bb),a=Ob(e),s=oM*a,u=iM*o+s*Fb(i),c=s*r*Ob(i);vM.add(Db(c,u)),rM=t,iM=o,oM=a}function EM(t){return yM=new pb,hb(t,bM),2*yM}var DM,FM,CM,kM,SM,MM,BM,OM,NM,TM,zM,RM,PM,LM,jM,UM,IM={point:qM,lineStart:HM,lineEnd:XM,polygonStart:function(){IM.point=GM,IM.lineStart=JM,IM.lineEnd=$M,pM=new pb,bM.polygonStart()},polygonEnd:function(){bM.polygonEnd(),IM.point=qM,IM.lineStart=HM,IM.lineEnd=XM,vM<0?(aM=-(uM=180),sM=-(cM=90)):pM>mb?cM=90:pM<-mb&&(sM=-90),gM[0]=aM,gM[1]=uM},sphere:function(){aM=-(uM=180),sM=-(cM=90)}};function qM(t,e){mM.push(gM=[aM=t,uM=t]),e<sM&&(sM=e),e>cM&&(cM=e)}function WM(t,e){var n=eA([t*_b,e*_b]);if(hM){var r=rA(hM,n),i=rA([r[1],-r[0],0],r);aA(i),i=tA(i);var o,a=t-lM,s=a>0?1:-1,u=i[0]*Ab*s,c=wb(a)>180;c^(s*lM<u&&u<s*t)?(o=i[1]*Ab)>cM&&(cM=o):c^(s*lM<(u=(u+360)%360-180)&&u<s*t)?(o=-i[1]*Ab)<sM&&(sM=o):(e<sM&&(sM=e),e>cM&&(cM=e)),c?t<lM?VM(aM,t)>VM(aM,uM)&&(uM=t):VM(t,uM)>VM(aM,uM)&&(aM=t):uM>=aM?(t<aM&&(aM=t),t>uM&&(uM=t)):t>lM?VM(aM,t)>VM(aM,uM)&&(uM=t):VM(t,uM)>VM(aM,uM)&&(aM=t)}else mM.push(gM=[aM=t,uM=t]);e<sM&&(sM=e),e>cM&&(cM=e),hM=n,lM=t}function HM(){IM.point=WM}function XM(){gM[0]=aM,gM[1]=uM,IM.point=qM,hM=null}function GM(t,e){if(hM){var n=t-lM;pM.add(wb(n)>180?n+(n>0?360:-360):n)}else fM=t,dM=e;bM.point(t,e),WM(t,e)}function JM(){bM.lineStart()}function $M(){GM(fM,dM),bM.lineEnd(),wb(pM)>mb&&(aM=-(uM=180)),gM[0]=aM,gM[1]=uM,hM=null}function VM(t,e){return(e-=t)<0?e+360:e}function YM(t,e){return t[0]-e[0]}function KM(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function ZM(t){var e,n,r,i,o,a,s;if(cM=uM=-(aM=sM=1/0),mM=[],hb(t,IM),n=mM.length){for(mM.sort(YM),e=1,o=[r=mM[0]];e<n;++e)KM(r,(i=mM[e])[0])||KM(r,i[1])?(VM(r[0],i[1])>VM(r[0],r[1])&&(r[1]=i[1]),VM(i[0],r[1])>VM(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(s=VM(r[1],i[0]))>a&&(a=s,aM=i[0],uM=r[1])}return mM=gM=null,aM===1/0||sM===1/0?[[NaN,NaN],[NaN,NaN]]:[[aM,sM],[uM,cM]]}var QM={sphere:Lb,point:tB,lineStart:nB,lineEnd:oB,polygonStart:function(){QM.lineStart=aB,QM.lineEnd=sB},polygonEnd:function(){QM.lineStart=nB,QM.lineEnd=oB}};function tB(t,e){t*=_b;var n=Fb(e*=_b);eB(n*Fb(t),n*Ob(t),Ob(e))}function eB(t,e,n){++DM,CM+=(t-CM)/DM,kM+=(e-kM)/DM,SM+=(n-SM)/DM}function nB(){QM.point=rB}function rB(t,e){t*=_b;var n=Fb(e*=_b);LM=n*Fb(t),jM=n*Ob(t),UM=Ob(e),QM.point=iB,eB(LM,jM,UM)}function iB(t,e){t*=_b;var n=Fb(e*=_b),r=n*Fb(t),i=n*Ob(t),o=Ob(e),a=Db(Tb((a=jM*o-UM*i)*a+(a=UM*r-LM*o)*a+(a=LM*i-jM*r)*a),LM*r+jM*i+UM*o);FM+=a,MM+=a*(LM+(LM=r)),BM+=a*(jM+(jM=i)),OM+=a*(UM+(UM=o)),eB(LM,jM,UM)}function oB(){QM.point=tB}function aB(){QM.point=uB}function sB(){cB(RM,PM),QM.point=tB}function uB(t,e){RM=t,PM=e,t*=_b,e*=_b,QM.point=cB;var n=Fb(e);LM=n*Fb(t),jM=n*Ob(t),UM=Ob(e),eB(LM,jM,UM)}function cB(t,e){t*=_b;var n=Fb(e*=_b),r=n*Fb(t),i=n*Ob(t),o=Ob(e),a=jM*o-UM*i,s=UM*r-LM*o,u=LM*i-jM*r,c=Sb(a,s,u),l=Pb(c),f=c&&-l/c;NM.add(f*a),TM.add(f*s),zM.add(f*u),FM+=l,MM+=l*(LM+(LM=r)),BM+=l*(jM+(jM=i)),OM+=l*(UM+(UM=o)),eB(LM,jM,UM)}function lB(t){DM=FM=CM=kM=SM=MM=BM=OM=0,NM=new pb,TM=new pb,zM=new pb,hb(t,QM);var e=+NM,n=+TM,r=+zM,i=Sb(e,n,r);return i<gb&&(e=MM,n=BM,r=OM,FM<mb&&(e=CM,n=kM,r=SM),(i=Sb(e,n,r))<gb)?[NaN,NaN]:[Db(n,e)*Ab,Pb(r/i)*Ab]}function fB(t){return t instanceof nl?t:new nl(t)}const dB="intersect",hB="union",pB="_vgsid_",mB=(0,m.EP)(pB),gB="E",vB="R",yB="R-E",bB="R-LE",xB="R-RE",AB="index:unit";function _B(t,e){for(var n,r,i=e.fields,o=e.values,a=i.length,s=0;s<a;++s)if((r=i[s]).getter=m.EP.getter||(0,m.EP)(r.field),n=r.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)),r.type===gB){if((0,m.kJ)(o[s])?o[s].indexOf(n)<0:n!==o[s])return!1}else if(r.type===vB){if(!(0,m.u5)(n,o[s]))return!1}else if(r.type===xB){if(!(0,m.u5)(n,o[s],!0,!1))return!1}else if(r.type===yB){if(!(0,m.u5)(n,o[s],!1,!1))return!1}else if(r.type===bB&&!(0,m.u5)(n,o[s],!1,!0))return!1;return!0}function wB(t,e,n){for(var r,i,o,a,s,u=this.context.data[t],c=u?u.values.value:[],l=u?u[AB]&&u[AB].value:void 0,f=n===dB,d=c.length,h=0;h<d;++h)if(r=c[h],l&&f){if(-1===(o=(i=i||{})[a=r.unit]||0))continue;if(s=_B(e,r),i[a]=s?-1:++o,s&&1===l.size)return!0;if(!s&&o===l.get(a).count)return!1}else if(f^(s=_B(e,r)))return s;return d&&f}const EB=Xt(mB),DB=EB.left,FB=EB.right;function CB(t,e,n){const r=this.context.data[t],i=r?r.values.value:[],o=r?r[AB]&&r[AB].value:void 0,a=n===dB,s=mB(e),u=DB(i,s);if(u===i.length)return!1;if(mB(i[u])!==s)return!1;if(o&&a){if(1===o.size)return!0;if(FB(i,s)-u<o.size)return!1}return!0}function kB(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)))}:{[pB]:mB(t.datum)},e)))}function SB(t,e,n,r){for(var i,o,a,s,u,c,l,f,d,h,p,g,v=this.context.data[t],y=v?v.values.value:[],b={},x={},A={},_=y.length,w=0;w<_;++w)if(s=(i=y[w]).unit,o=i.fields,a=i.values,o&&a){for(p=0,g=o.length;p<g;++p)u=o[p],f=(l=b[u.field]||(b[u.field]={}))[s]||(l[s]=[]),A[u.field]=d=u.type.charAt(0),h=MB["".concat(d,"_union")],l[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 u=pB,c=mB(i),(f=(l=b[u]||(b[u]={}))[s]||(l[s]=[])).push(c),n&&(f=x[s]||(x[s]=[])).push({[pB]:c});if(e=e||hB,b[pB]?b[pB]=MB["".concat(pB,"_").concat(e)](...Object.values(b[pB])):Object.keys(b).forEach((t=>{b[t]=Object.keys(b[t]).map((e=>b[t][e])).reduce(((n,r)=>void 0===n?r:MB["".concat(A[t],"_").concat(e)](n,r)))})),y=Object.keys(x),n&&y.length){b[r?"vlPoint":"vlMulti"]=e===hB?{or:y.reduce(((t,e)=>(t.push(...x[e]),t)),[])}:{and:y.map((t=>({or:x[t]})))}}return b}var MB={["".concat(pB,"_union")]:function(){const t=new nl;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(const i of n)for(const e of i)t.add(e);return t},["".concat(pB,"_intersect")]:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];t=new nl(t),n=n.map(fB);t:for(const i of t)for(const e of n)if(!e.has(i)){t.delete(i);continue t}return t},E_union:function(t,e){if(!t.length)return e;for(var n=0,r=e.length;n<r;++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]),r=(0,m.He)(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]<r&&(t[1]=r),t):[n,r]},R_intersect:function(t,e){var n=(0,m.He)(e[0]),r=(0,m.He)(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?r<t[0]||t[1]<n?[]:(t[0]<n&&(t[0]=n),t[1]>r&&(t[1]=r),t):[n,r]}};function BB(t,e,n,r){e[0].type!==hk&&(0,m.vU)("First argument to selection functions must be a string literal.");const i=e[0].value,o="unit",a="@"+o,s=":"+i;(e.length>=2&&(0,m.fj)(e).value)!==dB||(0,m.nr)(r,a)||(r[a]=n.getData(i).indataRef(n,o)),(0,m.nr)(r,s)||(r[s]=n.getData(i).tuplesRef())}function OB(t){const e=this.context.data[t];return e?e.values.value:[]}const NB=t=>function(e,n){return this.context.dataflow.locale()[t](n)(e)},TB=NB("format"),zB=NB("timeFormat"),RB=NB("utcFormat"),PB=NB("timeParse"),LB=NB("utcParse"),jB=new Date(2e3,0,1);function UB(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(jB.setYear(2e3),jB.setMonth(t),jB.setDate(e),zB.call(this,jB,n)):""}const IB="%",qB="$";function WB(t,e,n,r){e[0].type!==hk&&(0,m.vU)("First argument to data functions must be a string literal.");const i=e[0].value,o=":"+i;if(!(0,m.nr)(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(a){}}function HB(t,e,n,r){if(e[0].type===hk)XB(n,r,e[0].value);else for(t in n.scales)XB(n,r,t)}function XB(t,e,n){const r=IB+n;if(!(0,m.nr)(e,r))try{e[r]=t.scaleRef(n)}catch(i){}}function GB(t,e){if((0,m.mf)(t))return t;if((0,m.HD)(t)){const n=e.scales[t];return n&&zf(n.value)?n.value:void 0}}function JB(t,e,n){e.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0,n._bandwidth=HB,n._range=HB,n._scale=HB;const r=e=>"_["+(e.type===hk?(0,m.m8)(IB+e.value):(0,m.m8)(IB)+"+"+t(e))+"]";return{_bandwidth:t=>"this.__bandwidth(".concat(r(t[0]),")"),_range:t=>"".concat(r(t[0]),".range()"),_scale:e=>"".concat(r(e[0]),"(").concat(t(e[1]),")")}}function $B(t,e){return function(n,r,i){if(n){const e=GB(n,(i||this).context);return e&&e.path[t](r)}return e(r)}}const VB=$B("area",EM),YB=$B("bounds",ZM),KB=$B("centroid",lB);function ZB(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(r){t.warn(r)}return n[n.length-1]}function QB(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function tO(t){const e=(0,Zu.B8)(t);return.2126*QB(e.r)+.7152*QB(e.g)+.0722*QB(e.b)}function eO(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,r=t.length;n<r;++n)if(!eO(t[n],e[n]))return!1;return!0}(t,e):!(!(0,m.Kn)(t)||!(0,m.Kn)(e))&&nO(t,e))}function nO(t,e){for(const n in t)if(!eO(t[n],e[n]))return!1;return!0}function rO(t){return e=>nO(t,e)}const iO={};function oO(t){return(0,m.kJ)(t)||ArrayBuffer.isView(t)?t:null}function aO(t){return oO(t)||((0,m.HD)(t)?t:null)}const sO=t=>t.data;function uO(t,e){const n=OB.call(e,t);return n.root&&n.root.lookup||{}}const cO=()=>"undefined"!==typeof window&&window||null;function lO(t,e,n){if(!t)return[];const[r,i]=t,o=(new Eh).set(r[0],r[1],i[0],i[1]);return ev(n||this.context.dataflow.scenegraph().root,o,function(t){let e=null;if(t){const n=(0,m.IX)(t.marktype),r=(0,m.IX)(t.markname);e=t=>(!n.length||n.some((e=>t.marktype===e)))&&(!r.length||r.some((e=>t.name===e)))}return e}(e))}const fO={random:()=>Ao(),cumulativeNormal:ko,cumulativeLogNormal:To,cumulativeUniform:Lo,densityNormal:Co,densityLogNormal:No,densityUniform:Po,quantileNormal:So,quantileLogNormal:zo,quantileUniform:jo,sampleNormal:Fo,sampleLogNormal:Oo,sampleUniform:Ro,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:_i,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),r=1;r<e;r++)n[r-1]=arguments[r];return aO(t).indexOf(...n)},join:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return oO(t).join(...n)},lastindexof:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return aO(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 oO(t).slice().reverse()},slice:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return aO(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=iO[e]||(iO[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:Zu.B8,lab:Bl,hcl:Ll,hsl:Zu.Ym,luminance:tO,contrast:function(t,e){const n=tO(t),r=tO(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},sequence:Ho,format:TB,utcFormat:RB,utcParse:LB,utcOffset:Pe,utcSequence:Ue,timeFormat:zB,timeParse:PB,timeOffset:Re,timeSequence:je,timeUnitSpecifier:ue,monthFormat:function(t){return UB.call(this,t,1,"%B")},monthAbbrevFormat:function(t){return UB.call(this,t,1,"%b")},dayFormat:function(t){return UB.call(this,0,2+t,"%A")},dayAbbrevFormat:function(t){return UB.call(this,0,2+t,"%a")},quarter:m.mS,utcquarter:m.N3,week:de,utcweek:ye,dayofyear:fe,utcdayofyear:ve,warn:function(){return ZB(this.context.dataflow,"warn",arguments)},info:function(){return ZB(this.context.dataflow,"info",arguments)},debug:function(){return ZB(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:lO,clampRange:m.l$,pinchDistance:function(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+r*r)},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=cO();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=cO();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return af(t||0,e||0,n||0)},setdata:function(t,e){const n=this.context.dataflow,r=this.context.data[t].input;return n.pulse(r,n.changeset().remove(m.yb).insert(e)),1},pathShape:function(t){let e=null;return function(n){return n?Jd(n,e=e||Rd(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,r=t.mark.source;n.pulse(r,n.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,r,i,o){const a=this.context.dataflow,s=this.context.data[t],u=s.input,c=a.stamp();let l,f,d=s.changes;if(!1===a._trigger||!(u.value.length||e||r))return 0;if((!d||d.stamp<c)&&(s.changes=d=a.changeset(),d.stamp=c,a.runAfter((()=>{s.modified=!0,a.pulse(u,d).run()}),!0,1)),n&&(l=!0===n?m.yb:(0,m.kJ)(n)||_i(n)?n:rO(n),d.remove(l)),e&&d.insert(e),r&&(l=rO(r),u.value.some(l)?d.remove(l):d.insert(r)),i)for(f in o)d.modify(i,f,o[f]);return 1},lassoAppend:function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const i=(t=(0,m.IX)(t))[t.length-1];return void 0===i||Math.sqrt((i[0]-e)**2+(i[1]-n)**2)>r?[...t,[e,n]]:t},lassoPath:function(t){return(0,m.IX)(t).reduce(((e,n,r)=>{let[i,o]=n;return e+(0==r?"M ".concat(i,",").concat(o," "):r===t.length-1?" Z":"L ".concat(i,",").concat(o," "))}),"")},intersectLasso:function(t,e,n){const{x:r,y:i,mark:o}=n,a=(new Eh).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[s,u]of e)s<a.x1&&(a.x1=s),s>a.x2&&(a.x2=s),u<a.y1&&(a.y1=u),u>a.y2&&(a.y2=u);return a.translate(r,i),lO([[a.x1,a.y1],[a.x2,a.y2]],t,o).filter((t=>function(t,e,n){let r=0;for(let i=0,o=n.length-1;i<n.length;o=i++){const[a,s]=n[o],[u,c]=n[i];c>e!=s>e&&t<(a-u)*(e-c)/(s-c)+u&&r++}return 1&r}(t.x,t.y,e)))}},dO=["view","item","group","xy","x","y"],hO="this.",pO={},mO={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>"_[".concat((0,m.m8)(qB+t),"]"),functions:function(t){const e=tM(t);dO.forEach((t=>e[t]="event.vega."+t));for(const n in fO)e[n]=hO+n;return(0,m.l7)(e,JB(t,fO,pO)),e},constants:QS,visitors:pO},gO=function(t){const e=(t=t||{}).allowed?(0,m.Rg)(t.allowed):{},n=t.forbidden?(0,m.Rg)(t.forbidden):{},r=t.constants||QS,i=(t.functions||tM)(f),o=t.globalvar,a=t.fieldvar,s=(0,m.mf)(o)?o:t=>"".concat(o,'["').concat(t,'"]');let u={},c={},l=0;function f(t){if((0,m.HD)(t))return t;const e=d[t.type];return null==e&&(0,m.vU)("Unsupported type: "+t.type),e(t)}const d={Literal:t=>t.raw,Identifier:t=>{const i=t.name;return l>0?i:(0,m.nr)(n,i)?(0,m.vU)("Illegal identifier: "+i):(0,m.nr)(r,i)?r[i]:(0,m.nr)(e,i)?i:(u[i]=1,s(i))},MemberExpression:t=>{const e=!t.computed,n=f(t.object);e&&(l+=1);const r=f(t.property);return n===a&&(c[function(t){const e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(r)]=1),e&&(l-=1),n+(e?"."+r:"["+r+"]")},CallExpression:t=>{"Identifier"!==t.callee.type&&(0,m.vU)("Illegal callee type: "+t.callee.type);const e=t.callee.name,n=t.arguments,r=(0,m.nr)(i,e)&&i[e];return r||(0,m.vU)("Unrecognized function: "+e),(0,m.mf)(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:t=>"["+t.elements.map(f).join(",")+"]",BinaryExpression:t=>"("+f(t.left)+" "+t.operator+" "+f(t.right)+")",UnaryExpression:t=>"("+t.operator+f(t.argument)+")",ConditionalExpression:t=>"("+f(t.test)+"?"+f(t.consequent)+":"+f(t.alternate)+")",LogicalExpression:t=>"("+f(t.left)+t.operator+f(t.right)+")",ObjectExpression:t=>"{"+t.properties.map(f).join(",")+"}",Property:t=>{l+=1;const e=f(t.key);return l-=1,e+":"+f(t.value)}};function h(t){const e={code:f(t),globals:Object.keys(u),fields:Object.keys(c)};return u={},c={},e}return h.functions=i,h.constants=r,h}(mO);function vO(t,e,n){return 1===arguments.length?fO[t]:(fO[t]=e,n&&(pO[t]=n),gO&&(gO.functions[t]=hO+t),this)}function yO(t,e){const n={};let r;try{r=function(t){Fk=0,Ck=(Dk=t).length,kk=null,CS();const e=ZS();if(kk.type!==Mk)throw new Error("Unexpect token after expression.");return e}(t=(0,m.HD)(t)?t:(0,m.m8)(t)+"")}catch(o){(0,m.vU)("Expression parse error: "+t)}r.visit((t=>{if(t.type!==vk)return;const r=t.callee.name,i=mO.visitors[r];i&&i(r,t.arguments,e,n)}));const i=gO(r);return i.globals.forEach((t=>{const r=qB+t;!(0,m.nr)(n,r)&&e.getSignal(t)&&(n[r]=e.signalRef(t))})),{$expr:(0,m.l7)({code:i.code},e.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}vO("bandwidth",(function(t,e){const n=GB(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),HB),vO("copy",(function(t,e){const n=GB(t,(e||this).context);return n?n.copy():void 0}),HB),vO("domain",(function(t,e){const n=GB(t,(e||this).context);return n?n.domain():[]}),HB),vO("range",(function(t,e){const n=GB(t,(e||this).context);return n&&n.range?n.range():[]}),HB),vO("invert",(function(t,e,n){const r=GB(t,(n||this).context);return r?(0,m.kJ)(e)?(r.invertRange||r.invert)(e):(r.invert||r.invertExtent)(e):void 0}),HB),vO("scale",(function(t,e,n){const r=GB(t,(n||this).context);return r?r(e):void 0}),HB),vO("gradient",(function(t,e,n,r,i){t=GB(t,(i||this).context);const o=kd(e,n);let a=t.domain(),s=a[0],u=(0,m.fj)(a),c=m.yR;return u-s?c=Vf(t,s,u):t=(t.interpolator?Rf("sequential")().interpolator(t.interpolator()):Rf("linear")().interpolate(t.interpolate()).range(t.range())).domain([s=0,u=1]),t.ticks&&(a=t.ticks(+r||15),s!==a[0]&&a.unshift(s),u!==(0,m.fj)(a)&&a.push(u)),a.forEach((e=>o.stop(c(e),t(e)))),o}),HB),vO("geoArea",VB,HB),vO("geoBounds",YB,HB),vO("geoCentroid",KB,HB),vO("geoShape",(function(t,e,n){const r=GB(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}}),HB),vO("indata",(function(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(t,e,n,r){e[0].type!==hk&&(0,m.vU)("First argument to indata must be a string literal."),e[1].type!==hk&&(0,m.vU)("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,a="@"+o;(0,m.nr)(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),vO("data",OB,WB),vO("treePath",(function(t,e,n){const r=uO(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(sO):void 0}),WB),vO("treeAncestors",(function(t,e){const n=uO(t,this)[e];return n?n.ancestors().map(sO):void 0}),WB),vO("vlSelectionTest",wB,BB),vO("vlSelectionIdTest",CB,BB),vO("vlSelectionResolve",SB,BB),vO("vlSelectionTuples",kB);const bO=(0,m.Rg)(["rule"]),xO=(0,m.Rg)(["group","image","rect"]);function AO(t){return(t+"").toLowerCase()}function _O(t,e,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...e.concat(n));return t&&t.functions?r.bind(t.functions):r}var wO={operator:(t,e)=>_O(t,["_"],e.code),parameter:(t,e)=>_O(t,["datum","_"],e.code),event:(t,e)=>_O(t,["event"],e.code),handler:(t,e)=>_O(t,["_","event"],"var datum=event.item&&event.item.datum;return ".concat(e.code,";")),encode:(t,e)=>{const{marktype:n,channels:r}=e;let i="var o=item,datum=o.datum,m=0,$;";for(const o in r){const t="o["+(0,m.m8)(o)+"]";i+="$=".concat(r[o].code,";if(").concat(t,"!==$)").concat(t,"=$,m=1;")}return i+=function(t,e){let n="";return bO[e]||(t.x2&&(t.x?(xO[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?(xO[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}(r,n),i+="return m;",_O(t,["item","_"],i)},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 r=Function("a","b","var u, v; return "+t.map(((t,r)=>{const i=e[r];let o,a;return t.path?(o="a".concat(t.path),a="b".concat(t.path)):((n=n||{})["f"+r]=t,o="this.f".concat(r,"(a)"),a="this.f".concat(r,"(b)")),function(t,e,n,r){return"((u = ".concat(t,") < (v = ").concat(e,") || u == null) && v != null ? ").concat(n,"\n : (u > v || v == null) && u != null ? ").concat(r,"\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ").concat(n,"\n : v !== v && u === u ? ").concat(r," : ")}(o,a,-i,i)})).join("")+"0;");return n?r.bind(n):r}}};function EO(t,e,n){if(!t||!(0,m.Kn)(t))return t;for(let r,i=0,o=DO.length;i<o;++i)if(r=DO[i],(0,m.nr)(t,r.key))return r.parse(t,e,n);return t}var DO=[{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 r="e:"+t.$expr.code;return e.fn[r]||(e.fn[r]=(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,r={};for(const i in n){const t=n[i];r[i]=(0,m.ZE)(e.encodeExpression(t.$expr),t.$fields),r[i].output=t.$output}return r}},{key:"$compare",parse:function(t,e){const n="c:"+t.$compare+"_"+t.$order,r=(0,m.IX)(t.$compare).map((t=>t&&t.$tupleid?wi:t));return e.fn[n]||(e.fn[n]=(0,m.qu)(r,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,r,i){const o=e.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(i),a.detachSubflow=()=>e.detach(o),a}}},{key:"$tupleid",parse:function(){return wi}}];const FO={skip:!0};function CO(t,e,n,r){return new kO(t,e,n,r)}function kO(t,e,n,r){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=r||wO,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function SO(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 MO(t,e){t&&(null==e?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}kO.prototype=SO.prototype={fork(){const t=new SO(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,r=n.dataflow,i=t.value;if(n.set(t.id,e),function(t){return"collect"===AO(t)}(t.type)&&i&&(i.$ingest?r.ingest(e,i.$ingest,i.$format):i.$request?r.preload(e,i.$request,i.$format):r.pulse(e,r.changeset().insert(i))),t.root&&(n.root=e),t.parent){let i=n.get(t.parent.$ref);i?(r.connect(i,[e]),e.targets().add(i)):(n.unresolved=n.unresolved||[]).push((()=>{i=n.get(t.parent.$ref),r.connect(i,[e]),e.targets().add(i)}))}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data)for(const o in t.data){const r=n.data[o]||(n.data[o]={});t.data[o].forEach((t=>r[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[AO(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,r,i){this.dataflow.on(e,n,r,i,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"===AO(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 r in t){const i=t[r];e[r]=(0,m.kJ)(i)?i.map((t=>EO(t,n,e))):EO(i,n,e)}return e},parseStream:function(t){var e,n=this,r=null!=t.filter?n.eventExpression(t.filter):void 0,i=null!=t.stream?n.get(t.stream):void 0;t.source?i=n.events(t.source,t.type,r):t.merge&&(i=(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))),i=i.between(e[0],e[1])),t.filter&&(i=i.filter(r)),null!=t.throttle&&(i=i.throttle(+t.throttle)),null!=t.debounce&&(i=i.debounce(+t.debounce)),null==i&&(0,m.vU)("Invalid stream definition: "+JSON.stringify(t)),t.consume&&i.consume(!0),n.stream(t,i)},parseUpdate:function(t){var e,n=this,r=(0,m.Kn)(r=t.source)?r.$ref:r,i=n.get(r),o=t.update,a=void 0;i||(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,i,e,o,a)},getState:function(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach((n=>{const i=e.signals[n];t.signals(n,i)&&(r[n]=i.value)}))}if(t.data){var i=n.data={};Object.keys(e.data).forEach((n=>{const r=e.data[n];t.data(n,r)&&(i[n]=r.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,r=t.data,i=t.signals;Object.keys(i||{}).forEach((t=>{n.update(e.signals[t],i[t],FO)})),Object.keys(r||{}).forEach((t=>{n.pulse(e.data[t].input,n.changeset().remove(m.yb).insert(r[t]))})),(t.subcontext||[]).forEach(((t,n)=>{const r=e.subcontext[n];r&&r.setState(t)}))}};const BO="default";function OO(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 NO(t,e){var n=t._runtime.data;return(0,m.nr)(n,e)||(0,m.vU)("Unrecognized data set: "+e),n[e]}function TO(t,e){Mi(e)||(0,m.vU)("Second argument to changes must be a changeset.");const n=NO(this,t);return n.modified=!0,this.pulse(n.input,e)}function zO(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function RO(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function PO(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function LO(t,e,n){var r,i,o=t._renderer,a=o&&o.canvas();return a&&(i=PO(t),(r=Rm(e.changedTouches?e.changedTouches[0]:e,a))[0]-=i[0],r[1]-=i[1]),e.dataflow=t,e.item=n,e.vega=function(t,e,n){const r=e?"group"===e.mark.marktype?e:e.mark.group:null;function i(t){var n,i=r;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(t){if(!t)return n;(0,m.HD)(t)&&(t=i(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:i,xy:o,x:t=>o(t)[0],y:t=>o(t)[1]}}(t,n,r),e}const jO="view",UO={trap:!1};function IO(t,e,n,r){t._eventListeners.push({type:n,sources:(0,m.IX)(e),handler:r})}function qO(t,e,n){const r=t._eventConfig&&t._eventConfig[e];return!(!1===r||(0,m.Kn)(r)&&!r[n])||(t.warn("Blocked ".concat(e," ").concat(n," event listener.")),!1)}function WO(t){return t.item}function HO(t){return t.item.mark.source}function XO(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}function GO(t,e,n){const r=document.createElement(t);for(const i in e)r.setAttribute(i,e[i]);return null!=n&&(r.textContent=n),r}const JO="vega-bind",$O="vega-bind-name",VO="vega-bind-radio";function YO(t,e,n,r){const i=n.event||"input",o=()=>t.update(e.value);r.signal(n.signal,e.value),e.addEventListener(i,o),IO(r,e,i,o),t.set=t=>{e.value=t,e.dispatchEvent(function(t){return"undefined"!==typeof Event?new Event(t):{type:t}}(i))}}function KO(t,e,n,r){const i=r.signal(n.signal),o=GO("div",{class:JO}),a="radio"===n.input?o:o.appendChild(GO("label"));a.appendChild(GO("span",{class:$O},n.name||n.signal)),e.appendChild(o);let s=ZO;switch(n.input){case"checkbox":s=QO;break;case"select":s=tN;break;case"radio":s=eN;break;case"range":s=nN}s(t,a,n,i)}function ZO(t,e,n,r){const i=GO("input");for(const o in n)"signal"!==o&&"element"!==o&&i.setAttribute("input"===o?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",(()=>t.update(i.value))),t.elements=[i],t.set=t=>i.value=t}function QO(t,e,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=GO("input",i);e.appendChild(o),o.addEventListener("change",(()=>t.update(o.checked))),t.elements=[o],t.set=t=>o.checked=!!t||null}function tN(t,e,n,r){const i=GO("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((t,e)=>{const n={value:t};rN(t,r)&&(n.selected=!0),i.appendChild(GO("option",n,(o[e]||t)+""))})),e.appendChild(i),i.addEventListener("change",(()=>{t.update(n.options[i.selectedIndex])})),t.elements=[i],t.set=t=>{for(let e=0,r=n.options.length;e<r;++e)if(rN(n.options[e],t))return void(i.selectedIndex=e)}}function eN(t,e,n,r){const i=GO("span",{class:VO}),o=n.labels||[];e.appendChild(i),t.elements=n.options.map(((e,a)=>{const s={type:"radio",name:n.signal,value:e};rN(e,r)&&(s.checked=!0);const u=GO("input",s);u.addEventListener("change",(()=>t.update(e)));const c=GO("label",{},(o[a]||e)+"");return c.prepend(u),i.appendChild(c),u})),t.set=e=>{const n=t.elements,r=n.length;for(let t=0;t<r;++t)rN(n[t].value,e)&&(n[t].checked=!0)}}function nN(t,e,n,r){r=void 0!==r?r:(+n.max+ +n.min)/2;const i=null!=n.max?n.max:Math.max(100,+r)||100,o=n.min||Math.min(0,i,+r)||0,a=n.step||j(o,i,100),s=GO("input",{type:"range",name:n.signal,min:o,max:i,step:a});s.value=r;const u=GO("span",{},+r);e.appendChild(s),e.appendChild(u);const c=()=>{u.textContent=s.value,t.update(+s.value)};s.addEventListener("input",c),s.addEventListener("change",c),t.elements=[s],t.set=t=>{s.value=t,u.textContent=t}}function rN(t,e){return t===e||t+""===e+""}function iN(t,e,n,r,i,o){return(e=e||new r(t.loader())).initialize(n,zO(t),RO(t),PO(t),i,o).background(t.background())}function oN(t,e){return e?function(){try{e.apply(this,arguments)}catch(n){t.error(n)}}:null}function aN(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(r){e=null,t.error(r)}return e}const sN=t=>+t||0;function uN(t){return(0,m.Kn)(t)?{top:sN(t.top),bottom:sN(t.bottom),left:sN(t.left),right:sN(t.right)}:(t=>({top:t,bottom:t,left:t,right:t}))(sN(t))}async function cN(t,e,n,r){const i=tv(e),o=i&&i.headless;return o||(0,m.vU)("Unrecognized renderer type: "+e),await t.runAsync(),iN(t,null,null,o,n,r).renderAsync(t._scenegraph.root)}var lN="width",fN="height",dN="padding",hN={skip:!0};function pN(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===dN?r.left+r.right:0)}function mN(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===dN?r.top+r.bottom:0)}function gN(t,e){return e.modified&&(0,m.kJ)(e.input.value)&&t.indexOf("_:vega:_")}function vN(t,e){return!("parent"===t||e instanceof ro.proxy)}function yN(t,e,n,r){const i=t.element();i&&i.setAttribute("title",function(t){return null==t?"":(0,m.kJ)(t)?bN(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)?bN(n):xN(n))})).join("\n")):t+"";var e}(r))}function bN(t){return"["+t.map(xN).join(", ")+"]"}function xN(t){return(0,m.kJ)(t)?"[\u2026]":(0,m.Kn)(t)&&!(0,m.J_)(t)?"{\u2026}":t}function AN(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 r=(0,m.l7)({},t.locale,e.locale);n.locale(qr(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=e.renderer||Zg.Canvas,n._scenegraph=new Sm;const r=n._scenegraph.root;n._renderer=null,n._tooltip=e.tooltip||yN,n._redraw=!0,n._handler=(new ng).scene(r),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 i=function(t,e,n){return CO(t,ro,fO,n).parse(e)}(n,t,e.expr);n._runtime=i,n._signals=i.signals,n._bind=(t.bindings||[]).map((t=>({state:null,param:(0,m.l7)({},t)}))),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=pN(n,n._width),n._viewHeight=mN(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(t){var e=t._signals,n=e[lN],r=e[fN],i=e[dN];function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,(e=>{t._width=e.size,t._viewWidth=pN(t,e.size),o()}),{size:n}),t._resizeHeight=t.add(null,(e=>{t._height=e.size,t._viewHeight=mN(t,e.size),o()}),{size:r});const a=t.add(null,o,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,a.rank=i.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:BO,item:null}));t.on(t.events("view","mousemove"),e,((t,n)=>{const r=e.value,i=r?(0,m.HD)(r)?r:r.user:BO,o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}})),t.add(null,(function(e){let n=e.cursor,r=this.value;return(0,m.HD)(n)||(r=n.item,n=n.user),OO(t,n&&n!==BO?n:r||n),r}),{cursor:e})}(n),n.description(t.description),e.hover&&n.hover(),e.container&&n.initialize(e.container,e.bind)}function _N(t,e){return(0,m.nr)(t._signals,e)?t._signals[e]:(0,m.vU)("Unrecognized signal name: "+(0,m.m8)(e))}function wN(t,e){const n=(t._targets||[]).filter((t=>t._update&&t._update.handler===e));return n.length?n[0]:null}function EN(t,e,n,r){let i=wN(n,r);return i||(i=oN(t,(()=>r(e,n.value))),i.handler=r,t.on(n,null,i)),t}function DN(t,e,n){const r=wN(e,n);return r&&e._targets.remove(r),t}(0,m.XW)(AN,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=PO(t),n=zO(t),r=RO(t);t._renderer.background(t.background()),t._renderer.resize(n,r,e),t._handler.origin(e),t._resizeListeners.forEach((e=>{try{e(n,r)}catch(i){t.error(i)}}))}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(r){this.error(r)}return n&&bi(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&&MO(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 r=_N(this,t);return 1===arguments.length?r.value:this.update(r,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",uN(t)):uN(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?(tv(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(_N(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(t,e,n,r,i,o){this.runAfter((a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal(lN,n,hN),a._resizeWidth.skip(!0)),a.height()!==r&&(s=1,a.signal(fN,r,hN),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]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),s&&a.run("enter"),o&&a.runAfter((t=>t.resize()))}),!1,1)},addEventListener(t,e,n){let r=e;return n&&!1===n.trap||(r=oN(this,e),r.raw=e),this._handler.on(t,r),this},removeEventListener(t,e){for(var n,r,i=this._handler.handlers(t),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,t===r&&(e===n||e===n.raw)){this._handler.off(r,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 EN(this,t,_N(this,t),e)},removeSignalListener(t,e){return DN(this,_N(this,t),e)},addDataListener(t,e){return EN(this,t,NO(this,t).values,e)},removeDataListener(t,e){return DN(this,NO(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=OO(this,null);this._globalCursor=!!t,e&&OO(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 r=new Aw.B7,i=e;return null==e?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(t,e,n){e=+e,n=null==n?(0,Aw.zO)():+n,r._restart((function o(a){a+=i,r._restart(o,i+=e,n),t(a)}),e,n)},r.restart(t,e,n),r)}((function(e){t({timestamp:Date.now(),elapsed:e})}),e))},events:function(t,e,n){var r,i=this,o=new ji(n),a=function(n,r){i.runAsync(null,(()=>{t===jO&&function(t,e){var n=t._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[e]:i?!i[e]:t.preventDefault()))}(i,e)&&n.preventDefault(),o.receive(LO(i,n,r))}))};if("timer"===t)qO(i,"timer",e)&&i.timer(a,e);else if(t===jO)qO(i,"view",e)&&i.addEventListener(e,a,UO);else if("window"===t?qO(i,"window",e)&&"undefined"!==typeof window&&(r=[window]):"undefined"!==typeof document&&qO(i,"selector",e)&&(r=Array.from(document.querySelectorAll(t))),r){for(var s=0,u=r.length;s<u;++s)r[s].addEventListener(e,a);IO(i,r,e,a)}else i.warn("Can not resolve event source: "+t);return o},finalize:function(){var t,e,n,r=this._tooltip,i=this._timers,o=this._eventListeners;for(t=i.length;--t>=0;)i[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 r&&r.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",WO),HO,XO(t)),this.on(this.events("view","mouseout",WO),HO,XO(e)),this},data:function(t,e){return arguments.length<2?NO(this,t).values.value:TO.call(this,t,Bi().remove(m.yb).insert(e))},change:TO,insert:function(t,e){return TO.call(this,t,Bi().insert(e))},remove:function(t,e){return TO.call(this,t,Bi().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,r=n._renderType,i=n._eventConfig.bind,o=tv(r);t=n._el=t?aN(n,t,!0):null,function(t){const e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),MO(e,t.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||ng,s=t?o.renderer:o.headless;return n._renderer=s?iN(n,n._renderer,t,s):null,n._handler=function(t,e,n,r){const i=new r(t.loader(),oN(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,PO(t),t);return e&&e.handlers().forEach((t=>{i.on(t.type,t.handler)})),i}(n,n._handler,t,a),n._redraw=!0,t&&"none"!==i&&(e=e?n._elBind=aN(n,e,!0):t.appendChild(GO("form",{class:"vega-bindings"})),n._bind.forEach((t=>{t.param.element&&"container"!==i&&(t.element=aN(n,t.param.element,!!t.param.input))})),n._bind.forEach((t=>{!function(t,e,n){if(!e)return;const r=n.param;let i=n.state;i||(i=n.state={elements:null,active:!1,set:null,update:e=>{e!=t.signal(r.signal)&&t.runAsync(null,(()=>{i.source=!0,t.signal(r.signal,e)}))}},r.debounce&&(i.update=(0,m.Ds)(r.debounce,i.update))),(null==r.input&&r.element?YO:KO)(i,e,r,t),i.active||(t.on(t._signals[r.signal],null,(()=>{i.source?i.source=!1:i.set(t.signal(r.signal))})),i.active=!0)}(n,t.element||e,t)}))),n},toImageURL:async function(t,e){t!==Zg.Canvas&&t!==Zg.SVG&&t!==Zg.PNG&&(0,m.vU)("Unrecognized image type: "+t);const n=await cN(this,t,e);return t===Zg.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 cN(this,Zg.Canvas,t,e)).canvas()},toSVG:async function(t){return(await cN(this,Zg.SVG,t)).svg()},getState:function(t){return this._runtime.getState(t||{data:gN,signals:vN,recurse:!0})},setState:function(t){return this.runAsync(null,(e=>{e._trigger=!1,e._runtime.setState(t)}),(t=>{t._trigger=!0})),this}});const FN="Literal",CN="Property",kN="ArrayExpression",SN="BinaryExpression",MN="CallExpression",BN="ConditionalExpression",ON="LogicalExpression",NN="MemberExpression",TN="ObjectExpression",zN="UnaryExpression";function RN(t){this.type=t}var PN,LN,jN,UN,IN;RN.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=function(t){switch(t.type){case kN:return t.elements;case SN:case ON:return[t.left,t.right];case MN:return[t.callee].concat(t.arguments);case BN:return[t.test,t.consequent,t.alternate];case NN:return[t.object,t.property];case TN:return t.properties;case CN:return[t.key,t.value];case zN:return[t.argument];default:return[]}}(this),n=0,r=e.length;n<r;++n)if(e[n].visit(t))return 1};var qN=1,WN=2,HN=3,XN=4,GN=5,JN=6,$N=7,VN=8;(PN={})[qN]="Boolean",PN[WN]="<end>",PN[HN]="Identifier",PN[XN]="Keyword",PN[GN]="Null",PN[JN]="Numeric",PN[$N]="Punctuator",PN[VN]="String",PN[9]="RegularExpression";var YN="ArrayExpression",KN="BinaryExpression",ZN="CallExpression",QN="ConditionalExpression",tT="Identifier",eT="Literal",nT="LogicalExpression",rT="MemberExpression",iT="ObjectExpression",oT="Property",aT="UnaryExpression",sT="Unexpected token %0",uT="Unexpected number",cT="Unexpected string",lT="Unexpected identifier",fT="Unexpected reserved word",dT="Unexpected end of input",hT="Invalid regular expression",pT="Invalid regular expression: missing /",mT="Octal literals are not allowed in strict mode.",gT="Duplicate data property in object literal not allowed in strict mode",vT="ILLEGAL",yT="Disabled.",bT=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]"),xT=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 AT(t,e){if(!t)throw new Error("ASSERT: "+e)}function _T(t){return t>=48&&t<=57}function wT(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function ET(t){return"01234567".indexOf(t)>=0}function DT(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 FT(t){return 10===t||13===t||8232===t||8233===t}function CT(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&bT.test(String.fromCharCode(t))}function kT(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&xT.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 MT(){for(;jN<UN;){const t=LN.charCodeAt(jN);if(!DT(t)&&!FT(t))break;++jN}}function BT(t){var e,n,r,i=0;for(n="u"===t?4:2,e=0;e<n;++e)jN<UN&&wT(LN[jN])?(r=LN[jN++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):JT({},sT,vT);return String.fromCharCode(i)}function OT(){var t,e,n,r;for(e=0,"}"===(t=LN[jN])&&JT({},sT,vT);jN<UN&&wT(t=LN[jN++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&JT({},sT,vT),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function NT(){var t,e;for(t=LN.charCodeAt(jN++),e=String.fromCharCode(t),92===t&&(117!==LN.charCodeAt(jN)&&JT({},sT,vT),++jN,(t=BT("u"))&&"\\"!==t&&CT(t.charCodeAt(0))||JT({},sT,vT),e=t);jN<UN&&kT(t=LN.charCodeAt(jN));)++jN,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==LN.charCodeAt(jN)&&JT({},sT,vT),++jN,(t=BT("u"))&&"\\"!==t&&kT(t.charCodeAt(0))||JT({},sT,vT),e+=t);return e}function TT(){var t,e;return t=jN,e=92===LN.charCodeAt(jN)?NT():function(){var t,e;for(t=jN++;jN<UN;){if(92===(e=LN.charCodeAt(jN)))return jN=t,NT();if(!kT(e))break;++jN}return LN.slice(t,jN)}(),{type:1===e.length?HN:ST.hasOwnProperty(e)?XN:"null"===e?GN:"true"===e||"false"===e?qN:HN,value:e,start:t,end:jN}}function zT(){var t,e,n,r,i=jN,o=LN.charCodeAt(jN),a=LN[jN];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++jN,{type:$N,value:String.fromCharCode(o),start:i,end:jN};default:if(61===(t=LN.charCodeAt(jN+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return jN+=2,{type:$N,value:String.fromCharCode(o)+String.fromCharCode(t),start:i,end:jN};case 33:case 61:return jN+=2,61===LN.charCodeAt(jN)&&++jN,{type:$N,value:LN.slice(i,jN),start:i,end:jN}}}return">>>="===(r=LN.substr(jN,4))?{type:$N,value:r,start:i,end:jN+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:$N,value:n,start:i,end:jN+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:$N,value:e,start:i,end:jN+=2}:("//"===e&&JT({},sT,vT),"<>=!+-*%&|^/".indexOf(a)>=0?(++jN,{type:$N,value:a,start:i,end:jN}):void JT({},sT,vT))}function RT(){var t,e,n;if(AT(_T((n=LN[jN]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=jN,t="","."!==n){if(t=LN[jN++],n=LN[jN],"0"===t){if("x"===n||"X"===n)return++jN,function(t){let e="";for(;jN<UN&&wT(LN[jN]);)e+=LN[jN++];return 0===e.length&&JT({},sT,vT),CT(LN.charCodeAt(jN))&&JT({},sT,vT),{type:JN,value:parseInt("0x"+e,16),start:t,end:jN}}(e);if(ET(n))return function(t){let e="0"+LN[jN++];for(;jN<UN&&ET(LN[jN]);)e+=LN[jN++];return(CT(LN.charCodeAt(jN))||_T(LN.charCodeAt(jN)))&&JT({},sT,vT),{type:JN,value:parseInt(e,8),octal:!0,start:t,end:jN}}(e);n&&_T(n.charCodeAt(0))&&JT({},sT,vT)}for(;_T(LN.charCodeAt(jN));)t+=LN[jN++];n=LN[jN]}if("."===n){for(t+=LN[jN++];_T(LN.charCodeAt(jN));)t+=LN[jN++];n=LN[jN]}if("e"===n||"E"===n)if(t+=LN[jN++],"+"!==(n=LN[jN])&&"-"!==n||(t+=LN[jN++]),_T(LN.charCodeAt(jN)))for(;_T(LN.charCodeAt(jN));)t+=LN[jN++];else JT({},sT,vT);return CT(LN.charCodeAt(jN))&&JT({},sT,vT),{type:JN,value:parseFloat(t),start:e,end:jN}}function PT(){var t,e,n,r;return IN=null,MT(),t=jN,e=function(){var t,e,n,r;for(AT("/"===(t=LN[jN]),"Regular expression literal must start with a slash"),e=LN[jN++],n=!1,r=!1;jN<UN;)if(e+=t=LN[jN++],"\\"===t)FT((t=LN[jN++]).charCodeAt(0))&&JT({},pT),e+=t;else if(FT(t.charCodeAt(0)))JT({},pT);else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||JT({},pT),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";jN<UN&&kT((t=LN[jN]).charCodeAt(0));)++jN,"\\"===t&&jN<UN?JT({},sT,vT):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&JT({},hT,n),{value:n,literal:e}}(),r=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";JT({},hT)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(r){JT({},hT)}try{return new RegExp(t,e)}catch(i){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:jN}}function LT(){if(MT(),jN>=UN)return{type:WN,start:jN,end:jN};const t=LN.charCodeAt(jN);return CT(t)?TT():40===t||41===t||59===t?zT():39===t||34===t?function(){var t,e,n,r,i="",o=!1;for(AT("'"===(t=LN[jN])||'"'===t,"String literal must starts with a quote"),e=jN,++jN;jN<UN;){if((n=LN[jN++])===t){t="";break}if("\\"===n)if((n=LN[jN++])&&FT(n.charCodeAt(0)))"\r"===n&&"\n"===LN[jN]&&++jN;else switch(n){case"u":case"x":"{"===LN[jN]?(++jN,i+=OT()):i+=BT(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:ET(n)?(0!==(r="01234567".indexOf(n))&&(o=!0),jN<UN&&ET(LN[jN])&&(o=!0,r=8*r+"01234567".indexOf(LN[jN++]),"0123".indexOf(n)>=0&&jN<UN&&ET(LN[jN])&&(r=8*r+"01234567".indexOf(LN[jN++]))),i+=String.fromCharCode(r)):i+=n}else{if(FT(n.charCodeAt(0)))break;i+=n}}return""!==t&&JT({},sT,vT),{type:VN,value:i,octal:o,start:e,end:jN}}():46===t?_T(LN.charCodeAt(jN+1))?RT():zT():_T(t)?RT():zT()}function jT(){const t=IN;return jN=t.end,IN=LT(),jN=t.end,t}function UT(){const t=jN;IN=LT(),jN=t}function IT(t,e,n){const r=new RN("||"===t||"&&"===t?nT:KN);return r.operator=t,r.left=e,r.right=n,r}function qT(t,e){const n=new RN(ZN);return n.callee=t,n.arguments=e,n}function WT(t){const e=new RN(tT);return e.name=t,e}function HT(t){const e=new RN(eT);return e.value=t.value,e.raw=LN.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function XT(t,e,n){const r=new RN(rT);return r.computed="["===t,r.object=e,r.property=n,r.computed||(n.member=!0),r}function GT(t,e,n){const r=new RN(oT);return r.key=e,r.value=n,r.kind=t,r}function JT(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,((t,e)=>(AT(e<r.length,"Message reference must be in range"),r[e])));throw(n=new Error(i)).index=jN,n.description=i,n}function $T(t){t.type===WN&&JT(t,dT),t.type===JN&&JT(t,uT),t.type===VN&&JT(t,cT),t.type===HN&&JT(t,lT),t.type===XN&&JT(t,fT),JT(t,sT,t.value)}function VT(t){const e=jT();e.type===$N&&e.value===t||$T(e)}function YT(t){return IN.type===$N&&IN.value===t}function KT(t){return IN.type===XN&&IN.value===t}function ZT(){const t=[];for(jN=IN.start,VT("[");!YT("]");)YT(",")?(jT(),t.push(null)):(t.push(lz()),YT("]")||VT(","));return jT(),function(t){const e=new RN(YN);return e.elements=t,e}(t)}function QT(){jN=IN.start;const t=jT();return t.type===VN||t.type===JN?(t.octal&&JT(t,mT),HT(t)):WT(t.value)}function tz(){var t,e,n;return jN=IN.start,(t=IN).type===HN?(n=QT(),VT(":"),GT("init",n,lz())):t.type!==WN&&t.type!==$N?(e=QT(),VT(":"),GT("init",e,lz())):void $T(t)}function ez(){var t,e,n=[],r={},i=String;for(jN=IN.start,VT("{");!YT("}");)e="$"+((t=tz()).key.type===tT?t.key.name:i(t.key.value)),Object.prototype.hasOwnProperty.call(r,e)?JT({},gT):r[e]=!0,n.push(t),YT("}")||VT(",");return VT("}"),function(t){const e=new RN(iT);return e.properties=t,e}(n)}const nz={if:1};function rz(){var t,e,n;if(YT("("))return function(){VT("(");const t=fz();return VT(")"),t}();if(YT("["))return ZT();if(YT("{"))return ez();if(t=IN.type,jN=IN.start,t===HN||nz[IN.value])n=WT(jT().value);else if(t===VN||t===JN)IN.octal&&JT(IN,mT),n=HT(jT());else{if(t===XN)throw new Error(yT);t===qN?((e=jT()).value="true"===e.value,n=HT(e)):t===GN?((e=jT()).value=null,n=HT(e)):YT("/")||YT("/=")?(n=HT(PT()),UT()):$T(jT())}return n}function iz(){const t=[];if(VT("("),!YT(")"))for(;jN<UN&&(t.push(lz()),!YT(")"));)VT(",");return VT(")"),t}function oz(){jN=IN.start;const t=jT();return function(t){return t.type===HN||t.type===XN||t.type===qN||t.type===GN}(t)||$T(t),WT(t.value)}function az(){VT("[");const t=fz();return VT("]"),t}function sz(){const t=function(){var t;for(t=rz();;)if(YT("."))VT("."),t=XT(".",t,oz());else if(YT("("))t=qT(t,iz());else{if(!YT("["))break;t=XT("[",t,az())}return t}();if(IN.type===$N&&(YT("++")||YT("--")))throw new Error(yT);return t}function uz(){var t,e;if(IN.type!==$N&&IN.type!==XN)e=sz();else{if(YT("++")||YT("--"))throw new Error(yT);if(YT("+")||YT("-")||YT("~")||YT("!"))t=jT(),e=uz(),e=function(t,e){const n=new RN(aT);return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if(KT("delete")||KT("void")||KT("typeof"))throw new Error(yT);e=sz()}}return e}function cz(t){let e=0;if(t.type!==$N&&t.type!==XN)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 lz(){var t,e;return t=function(){var t,e,n,r,i,o,a,s,u,c;if(t=IN,u=uz(),0===(i=cz(r=IN)))return u;for(r.prec=i,jT(),e=[t,IN],o=[u,r,a=uz()];(i=cz(IN))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),e.pop(),n=IT(s,u,a),o.push(n);(r=jT()).prec=i,o.push(r),e.push(IN),n=uz(),o.push(n)}for(n=o[c=o.length-1],e.pop();c>1;)e.pop(),n=IT(o[c-1].value,o[c-2],n),c-=2;return n}(),YT("?")&&(jT(),e=lz(),VT(":"),t=function(t,e,n){const r=new RN(QN);return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,lz())),t}function fz(){const t=lz();if(YT(","))throw new Error(yT);return t}function dz(t){jN=0,UN=(LN=t).length,IN=null,UT();const e=fz();if(IN.type!==WN)throw new Error("Unexpect token after expression.");return e}var hz={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 pz(t){function e(e,n,r){return i=>function(e,n,r,i){let o=t(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+e+(i<0?"":0===i?"()":"("+n.slice(1).map(t).join(",")+")")}(e,i,n,r)}const n="new Date",r="String",i="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,m.vU)("Missing arguments to clamp function."),e.length>3&&(0,m.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:i,test:e("test",i),if:function(e){e.length<3&&(0,m.vU)("Missing arguments to if function."),e.length>3&&(0,m.vU)("Too many arguments to if function.");const n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function mz(t){const e=(t=t||{}).allowed?(0,m.Rg)(t.allowed):{},n=t.forbidden?(0,m.Rg)(t.forbidden):{},r=t.constants||hz,i=(t.functions||pz)(f),o=t.globalvar,a=t.fieldvar,s=(0,m.mf)(o)?o:t=>"".concat(o,'["').concat(t,'"]');let u={},c={},l=0;function f(t){if((0,m.HD)(t))return t;const e=d[t.type];return null==e&&(0,m.vU)("Unsupported type: "+t.type),e(t)}const d={Literal:t=>t.raw,Identifier:t=>{const i=t.name;return l>0?i:(0,m.nr)(n,i)?(0,m.vU)("Illegal identifier: "+i):(0,m.nr)(r,i)?r[i]:(0,m.nr)(e,i)?i:(u[i]=1,s(i))},MemberExpression:t=>{const e=!t.computed,n=f(t.object);e&&(l+=1);const r=f(t.property);return n===a&&(c[function(t){const e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(r)]=1),e&&(l-=1),n+(e?"."+r:"["+r+"]")},CallExpression:t=>{"Identifier"!==t.callee.type&&(0,m.vU)("Illegal callee type: "+t.callee.type);const e=t.callee.name,n=t.arguments,r=(0,m.nr)(i,e)&&i[e];return r||(0,m.vU)("Unrecognized function: "+e),(0,m.mf)(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:t=>"["+t.elements.map(f).join(",")+"]",BinaryExpression:t=>"("+f(t.left)+" "+t.operator+" "+f(t.right)+")",UnaryExpression:t=>"("+t.operator+f(t.argument)+")",ConditionalExpression:t=>"("+f(t.test)+"?"+f(t.consequent)+":"+f(t.alternate)+")",LogicalExpression:t=>"("+f(t.left)+t.operator+f(t.right)+")",ObjectExpression:t=>"{"+t.properties.map(f).join(",")+"}",Property:t=>{l+=1;const e=f(t.key);return l-=1,e+":"+f(t.value)}};function h(t){const e={code:f(t),globals:Object.keys(u),fields:Object.keys(c)};return u={},c={},e}return h.functions=i,h.constants=r,h}var gz=Math.random;const vz=Math.sqrt(2*Math.PI),yz=Math.SQRT2;let bz=NaN;function xz(t,e){t=t||0,e=null==e?1:e;let n,r,i=0,o=0;if(bz===bz)i=bz,bz=NaN;else{do{i=2*gz()-1,o=2*gz()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,bz=o*r}return t+i*e}function Az(t,e,n){const r=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*vz)}function _z(t,e,n){const r=(t-(e=e||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const t=Math.exp(-i*i/2);let e;i<7.07106781186547?(e=.0352624965998911*i+.700383064443688,e=e*i+6.37396220353165,e=e*i+33.912866078383,e=e*i+112.079291497871,e=e*i+221.213596169931,e=e*i+220.206867912376,o=t*e,e=.0883883476483184*i+1.75566716318264,e=e*i+16.064177579207,e=e*i+86.7807322029461,e=e*i+296.564248779674,e=e*i+637.333633378831,e=e*i+793.826512519948,e=e*i+440.413735824752,o/=e):(e=i+.65,e=i+4/e,e=i+3/e,e=i+2/e,e=i+1/e,o=t/e/2.506628274631)}return r>0?1-o:o}function wz(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*yz*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 Ez(t,e){return t=t||0,e=null==e?1:e,Math.exp(t+xz()*e)}function Dz(t,e,n){if(t<=0)return 0;e=e||0,n=null==n?1:n;const r=(Math.log(t)-e)/n;return Math.exp(-.5*r*r)/(n*vz*t)}function Fz(t,e,n){return _z(Math.log(t),e,n)}function Cz(t,e,n){return Math.exp(wz(t,e,n))}function kz(t,e){return null==e&&(e=null==t?1:t,t=0),t+(e-t)*gz()}function Sz(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=e&&t<=n?1/(n-e):0}function Mz(t,e,n){return null==n&&(n=null==e?1:e,e=0),t<e?0:t>n?1:(t-e)/(n-e)}function Bz(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}Math.PI;function Oz(t){const e=this.context.data[t];return e?e.values.value:[]}const Nz=t=>function(e,n){return this.context.dataflow.locale()[t](n)(e)},Tz=Nz("format"),zz=Nz("timeFormat"),Rz=Nz("utcFormat"),Pz=Nz("timeParse"),Lz=Nz("utcParse"),jz=new Date(2e3,0,1);function Uz(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(jz.setYear(2e3),jz.setMonth(t),jz.setDate(e),zz.call(this,jz,n)):""}const Iz="%";function qz(t,e,n,r){e[0].type!==FN&&(0,m.vU)("First argument to data functions must be a string literal.");const i=e[0].value,o=":"+i;if(!(0,m.nr)(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(a){}}function Wz(t,e,n,r){if(e[0].type===FN)Hz(n,r,e[0].value);else for(t in n.scales)Hz(n,r,t)}function Hz(t,e,n){const r=Iz+n;if(!(0,m.nr)(e,r))try{e[r]=t.scaleRef(n)}catch(i){}}function Xz(t,e){if((0,m.mf)(t))return t;if((0,m.HD)(t)){const n=e.scales[t];return n&&zf(n.value)?n.value:void 0}}function Gz(t,e,n){e.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0,n._bandwidth=Wz,n._range=Wz,n._scale=Wz;const r=e=>"_["+(e.type===FN?(0,m.m8)(Iz+e.value):(0,m.m8)(Iz)+"+"+t(e))+"]";return{_bandwidth:t=>"this.__bandwidth(".concat(r(t[0]),")"),_range:t=>"".concat(r(t[0]),".range()"),_scale:e=>"".concat(r(e[0]),"(").concat(t(e[1]),")")}}function Jz(t,e){return function(n,r,i){if(n){const e=Xz(n,(i||this).context);return e&&e.path[t](r)}return e(r)}}const $z=Jz("area",EM),Vz=Jz("bounds",ZM),Yz=Jz("centroid",lB);function Kz(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(r){t.warn(r)}return n[n.length-1]}function Zz(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Qz(t){const e=(0,Zu.B8)(t);return.2126*Zz(e.r)+.7152*Zz(e.g)+.0722*Zz(e.b)}function tR(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,r=t.length;n<r;++n)if(!tR(t[n],e[n]))return!1;return!0}(t,e):!(!(0,m.Kn)(t)||!(0,m.Kn)(e))&&eR(t,e))}function eR(t,e){for(const n in t)if(!tR(t[n],e[n]))return!1;return!0}function nR(t){return e=>eR(t,e)}const rR={};function iR(t){return(0,m.kJ)(t)||ArrayBuffer.isView(t)?t:null}function oR(t){return iR(t)||((0,m.HD)(t)?t:null)}const aR=t=>t.data;function sR(t,e){const n=Oz.call(e,t);return n.root&&n.root.lookup||{}}const uR=()=>"undefined"!==typeof window&&window||null;function cR(t,e,n){if(!t)return[];const[r,i]=t,o=(new Eh).set(r[0],r[1],i[0],i[1]);return ev(n||this.context.dataflow.scenegraph().root,o,function(t){let e=null;if(t){const n=(0,m.IX)(t.marktype),r=(0,m.IX)(t.markname);e=t=>(!n.length||n.some((e=>t.marktype===e)))&&(!r.length||r.some((e=>t.name===e)))}return e}(e))}const lR={random:()=>gz(),cumulativeNormal:_z,cumulativeLogNormal:Fz,cumulativeUniform:Mz,densityNormal:Az,densityLogNormal:Dz,densityUniform:Sz,quantileNormal:wz,quantileLogNormal:Cz,quantileUniform:Bz,sampleNormal:xz,sampleLogNormal:Ez,sampleUniform:kz,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:_i,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),r=1;r<e;r++)n[r-1]=arguments[r];return oR(t).indexOf(...n)},join:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return iR(t).join(...n)},lastindexof:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return oR(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 iR(t).slice().reverse()},slice:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return oR(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=rR[e]||(rR[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:Zu.B8,lab:Bl,hcl:Ll,hsl:Zu.Ym,luminance:Qz,contrast:function(t,e){const n=Qz(t),r=Qz(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},sequence:Ho,format:Tz,utcFormat:Rz,utcParse:Lz,utcOffset:Pe,utcSequence:Ue,timeFormat:zz,timeParse:Pz,timeOffset:Re,timeSequence:je,timeUnitSpecifier:ue,monthFormat:function(t){return Uz.call(this,t,1,"%B")},monthAbbrevFormat:function(t){return Uz.call(this,t,1,"%b")},dayFormat:function(t){return Uz.call(this,0,2+t,"%A")},dayAbbrevFormat:function(t){return Uz.call(this,0,2+t,"%a")},quarter:m.mS,utcquarter:m.N3,week:de,utcweek:ye,dayofyear:fe,utcdayofyear:ve,warn:function(){return Kz(this.context.dataflow,"warn",arguments)},info:function(){return Kz(this.context.dataflow,"info",arguments)},debug:function(){return Kz(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:cR,clampRange:m.l$,pinchDistance:function(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.hypot(n,r)},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=uR();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=uR();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return af(t||0,e||0,n||0)},setdata:function(t,e){const n=this.context.dataflow,r=this.context.data[t].input;return n.pulse(r,n.changeset().remove(m.yb).insert(e)),1},pathShape:function(t){let e=null;return function(n){return n?Jd(n,e=e||Rd(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,r=t.mark.source;n.pulse(r,n.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,r,i,o){const a=this.context.dataflow,s=this.context.data[t],u=s.input,c=a.stamp();let l,f,d=s.changes;if(!1===a._trigger||!(u.value.length||e||r))return 0;if((!d||d.stamp<c)&&(s.changes=d=a.changeset(),d.stamp=c,a.runAfter((()=>{s.modified=!0,a.pulse(u,d).run()}),!0,1)),n&&(l=!0===n?m.yb:(0,m.kJ)(n)||_i(n)?n:nR(n),d.remove(l)),e&&d.insert(e),r&&(l=nR(r),u.value.some(l)?d.remove(l):d.insert(r)),i)for(f in o)d.modify(i,f,o[f]);return 1},lassoAppend:function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const i=(t=(0,m.IX)(t))[t.length-1];return void 0===i||Math.hypot(i[0]-e,i[1]-n)>r?[...t,[e,n]]:t},lassoPath:function(t){return(0,m.IX)(t).reduce(((e,n,r)=>{let[i,o]=n;return e+(0==r?"M ".concat(i,",").concat(o," "):r===t.length-1?" Z":"L ".concat(i,",").concat(o," "))}),"")},intersectLasso:function(t,e,n){const{x:r,y:i,mark:o}=n,a=(new Eh).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[s,u]of e)s<a.x1&&(a.x1=s),s>a.x2&&(a.x2=s),u<a.y1&&(a.y1=u),u>a.y2&&(a.y2=u);return a.translate(r,i),cR([[a.x1,a.y1],[a.x2,a.y2]],t,o).filter((t=>function(t,e,n){let r=0;for(let i=0,o=n.length-1;i<n.length;o=i++){const[a,s]=n[o],[u,c]=n[i];c>e!=s>e&&t<(a-u)*(e-c)/(s-c)+u&&r++}return 1&r}(t.x,t.y,e)))}},fR=["view","item","group","xy","x","y"],dR="this.",hR={},pR={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>"_[".concat((0,m.m8)("$"+t),"]"),functions:function(t){const e=pz(t);fR.forEach((t=>e[t]="event.vega."+t));for(const n in lR)e[n]=dR+n;return(0,m.l7)(e,Gz(t,lR,hR)),e},constants:hz,visitors:hR},mR=mz(pR);function gR(t,e,n){return 1===arguments.length?lR[t]:(lR[t]=e,n&&(hR[t]=n),mR&&(mR.functions[t]=dR+t),this)}gR("bandwidth",(function(t,e){const n=Xz(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),Wz),gR("copy",(function(t,e){const n=Xz(t,(e||this).context);return n?n.copy():void 0}),Wz),gR("domain",(function(t,e){const n=Xz(t,(e||this).context);return n?n.domain():[]}),Wz),gR("range",(function(t,e){const n=Xz(t,(e||this).context);return n&&n.range?n.range():[]}),Wz),gR("invert",(function(t,e,n){const r=Xz(t,(n||this).context);return r?(0,m.kJ)(e)?(r.invertRange||r.invert)(e):(r.invert||r.invertExtent)(e):void 0}),Wz),gR("scale",(function(t,e,n){const r=Xz(t,(n||this).context);return r?r(e):void 0}),Wz),gR("gradient",(function(t,e,n,r,i){t=Xz(t,(i||this).context);const o=kd(e,n);let a=t.domain(),s=a[0],u=(0,m.fj)(a),c=m.yR;return u-s?c=Vf(t,s,u):t=(t.interpolator?Rf("sequential")().interpolator(t.interpolator()):Rf("linear")().interpolate(t.interpolate()).range(t.range())).domain([s=0,u=1]),t.ticks&&(a=t.ticks(+r||15),s!==a[0]&&a.unshift(s),u!==(0,m.fj)(a)&&a.push(u)),a.forEach((e=>o.stop(c(e),t(e)))),o}),Wz),gR("geoArea",$z,Wz),gR("geoBounds",Vz,Wz),gR("geoCentroid",Yz,Wz),gR("geoShape",(function(t,e,n){const r=Xz(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}}),Wz),gR("indata",(function(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(t,e,n,r){e[0].type!==FN&&(0,m.vU)("First argument to indata must be a string literal."),e[1].type!==FN&&(0,m.vU)("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,a="@"+o;(0,m.nr)(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),gR("data",Oz,qz),gR("treePath",(function(t,e,n){const r=sR(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(aR):void 0}),qz),gR("treeAncestors",(function(t,e){const n=sR(t,this)[e];return n?n.ancestors().map(aR):void 0}),qz),gR("vlSelectionTest",wB,BB),gR("vlSelectionIdTest",CB,BB),gR("vlSelectionResolve",SB,BB),gR("vlSelectionTuples",kB);var vR=n(77155);function yR(t){return(0,m.Kn)(t)?t:{type:t||"pad"}}const bR=t=>+t||0,xR=t=>({top:t,bottom:t,left:t,right:t});function AR(t){return(0,m.Kn)(t)?t.signal?t:{top:bR(t.top),bottom:bR(t.bottom),left:bR(t.left),right:bR(t.right)}:xR(bR(t))}const _R=t=>(0,m.Kn)(t)&&!(0,m.kJ)(t)?(0,m.l7)({},t):{value:t};function wR(t,e,n,r){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[r||"enter"][e]={value:n},1}return 0}function ER(t,e,n){for(const r in e)wR(t,r,e[r]);for(const r in n)wR(t,r,n[r],"update")}function DR(t,e,n){for(const r in e)n&&(0,m.nr)(n,r)||(t[r]=(0,m.l7)(t[r]||{},e[r]));return t}function FR(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}const CR="mark",kR="frame",SR="scope",MR="axis",BR="axis-domain",OR="axis-grid",NR="axis-label",TR="axis-tick",zR="axis-title",RR="legend",PR="legend-band",LR="legend-entry",jR="legend-gradient",UR="legend-label",IR="legend-symbol",qR="legend-title",WR="title",HR="title-text",XR="title-subtitle";function GR(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const JR=t=>(0,m.HD)(t)?(0,m.m8)(t):t.signal?"(".concat(t.signal,")"):KR(t);function $R(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(JR(t.gradient)),"gradient(".concat(e.join(","),")")}(t);let e=t.signal?"(".concat(t.signal,")"):t.color?function(t){return t.c?VR("hcl",t.h,t.c,t.l):t.h||t.s?VR("hsl",t.h,t.s,t.l):t.l||t.a?VR("lab",t.l,t.a,t.b):t.r||t.g||t.b?VR("rgb",t.r,t.g,t.b):null}(t.color):null!=t.field?KR(t.field):void 0!==t.value?(0,m.m8)(t.value):void 0;return null!=t.scale&&(e=function(t,e){const n=JR(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?"":"*"+YR(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(YR(t.exponent),")")),null!=t.mult&&(e+="*".concat(YR(t.mult))),null!=t.offset&&(e+="+".concat(YR(t.offset))),t.round&&(e="round(".concat(e,")")),e}const VR=(t,e,n,r)=>"(".concat(t,"(").concat([e,n,r].map($R).join(","),")+'')");function YR(t){return(0,m.Kn)(t)?"("+$R(t)+")":t}function KR(t){return ZR((0,m.Kn)(t)?t:{datum:t})}function ZR(t){let e,n,r;if(t.signal)e="datum",r=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?(r=t.parent,e+=".datum"):r=t.group}else t.datum?(e="datum",r=t.datum):(0,m.vU)("Invalid field reference: "+(0,m.m8)(t));return t.signal||(r=(0,m.HD)(r)?(0,m._k)(r).map(m.m8).join("]["):ZR(r)),e+"["+r+"]"}function QR(t,e,n,r,i,o){const a={};(o=o||{}).encoders={$encode:a},t=function(t,e,n,r,i){const o={},a={};let s,u,c,l;for(u in u="lineBreak","text"!==e||null==i[u]||FR(u,t)||GR(o,u,i[u]),("legend"==n||String(n).startsWith("axis"))&&(n=null),l=n===kR?i.group:n===CR?(0,m.l7)({},i.mark,i[e]):null,l)c=FR(u,t)||("fill"===u||"stroke"===u)&&(FR("fill",t)||FR("stroke",t)),c||GR(o,u,l[u]);for(u in(0,m.IX)(r).forEach((e=>{const n=i.style&&i.style[e];for(const r in n)FR(r,t)||GR(o,r,n[r])})),t=(0,m.l7)({},t),o)l=o[u],l.signal?(s=s||{})[u]=l:a[u]=l;return t.enter=(0,m.l7)(a,t.enter),s&&(t.update=(0,m.l7)(s,t.update)),t}(t,e,n,r,i.config);for(const s in t)a[s]=tP(t[s],e,o,i);return o}function tP(t,e,n,r){const i={},o={};for(const s in t)null!=t[s]&&(i[s]=eP((a=t[s],(0,m.kJ)(a)?function(t){let e="";return t.forEach((t=>{const n=$R(t);e+=t.test?"(".concat(t.test,")?").concat(n,":"):n})),":"===(0,m.fj)(e)&&(e+="null"),e}(a):$R(a)),r,n,o));var a;return{$expr:{marktype:e,channels:i},$fields:Object.keys(o),$output:Object.keys(t)}}function eP(t,e,n,r){const i=yO(t,e);return i.$fields.forEach((t=>r[t]=1)),(0,m.l7)(n,i.$params),i.$expr}const nP="outer",rP=["value","update","init","react","bind"];function iP(t,e){(0,m.vU)(t+' for "outer" push: '+(0,m.m8)(e))}function oP(t,e){const n=t.name;if(t.push===nP)e.signals[n]||iP("No prior signal definition",n),rP.forEach((e=>{void 0!==t[e]&&iP("Invalid property ",e)}));else{const r=e.addSignal(n,t.value);!1===t.react&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function aP(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function sP(t,e,n,r){return new aP(t,e,n,r)}function uP(t,e){return sP("operator",t,e)}function cP(t){const e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function lP(t,e){return e?{$field:t,$name:e}:{$field:t}}const fP=lP("key");function dP(t,e){return{$compare:t,$order:e}}const hP="descending";function pP(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const mP="scope",gP="view";function vP(t){return t&&t.signal}function yP(t){if(vP(t))return!0;if((0,m.Kn)(t))for(const e in t)if(yP(t[e]))return!0;return!1}function bP(t,e){return null!=t?t:e}function xP(t){return t&&t.signal||t}const AP="timer";function _P(t,e){return(t.merge?wP:t.stream?EP:t.type?DP:(0,m.vU)("Invalid stream specification: "+(0,m.m8)(t)))(t,e)}function wP(t,e){const n=t.merge.map((t=>_P(t,e))),r=FP({merge:n},t,e);return e.addStream(r).id}function EP(t,e){const n=FP({stream:_P(t.stream,e)},t,e);return e.addStream(n).id}function DP(t,e){let n;t.type===AP?(n=e.event(AP,t.throttle),t={between:t.between,filter:t.filter}):n=e.event(function(t){return t===mP?gP:t||gP}(t.source),t.type);const r=FP({stream:n},t,e);return 1===Object.keys(r).length?n:e.addStream(r).id}function FP(t,e,n){let r=e.between;return r&&(2!==r.length&&(0,m.vU)('Stream "between" parameter must have 2 entries: '+(0,m.m8)(e)),t.between=[_P(r[0],n),_P(r[1],n)]),r=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&r.push(function(t,e,n){const r="event.item";return r+(t&&"*"!==t?"&&"+r+".mark.marktype==='"+t+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(e?"&&"+r+".mark.name==='"+e+"'":"")}(e.marktype,e.markname,e.markrole)),e.source===mP&&r.push("inScope(event.item)"),r.length&&(t.filter=yO("("+r.join(")&&(")+")",n).$expr),null!=(r=e.throttle)&&(t.throttle=+r),null!=(r=e.debounce)&&(t.debounce=+r),e.consume&&(t.consume=!0),t}const CP={code:"_.$value",ast:{type:"Identifier",value:"value"}};function kP(t,e,n){const r=t.encode,i={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,vR.r)(o,e.isSubscope()?mP:gP)),o=(0,m.IX)(o).filter((t=>t.signal||t.scale?(s.push(t),0):1)),s.length>1&&(s=[SP(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&(0,m.vU)("Signal encode and update are mutually exclusive."),a="encode(item(),"+(0,m.m8)(r)+")"),i.update=(0,m.HD)(a)?yO(a,e):null!=a.expr?yO(a.expr,e):null!=a.value?a.value:null!=a.signal?{$expr:CP,$params:{$value:e.signalRef(a.signal)}}:(0,m.vU)("Invalid signal update specification."),t.force&&(i.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):_P(t,e)}}(t,e),i))))}function SP(t){return{signal:"["+t.map((t=>t.scale?'scale("'+t.scale+'")':t.signal))+"]"}}const MP=t=>(e,n,r)=>sP(t,n,e||void 0,r),BP=MP("aggregate"),OP=MP("axisticks"),NP=MP("bound"),TP=MP("collect"),zP=MP("compare"),RP=MP("datajoin"),PP=MP("encode"),LP=MP("expression"),jP=MP("facet"),UP=MP("field"),IP=MP("key"),qP=MP("legendentries"),WP=MP("load"),HP=MP("mark"),XP=MP("multiextent"),GP=MP("multivalues"),JP=MP("overlap"),$P=MP("params"),VP=MP("prefacet"),YP=MP("projection"),KP=MP("proxy"),ZP=MP("relay"),QP=MP("render"),tL=MP("scale"),eL=MP("sieve"),nL=MP("sortitems"),rL=MP("viewlayout"),iL=MP("values");let oL=0;const aL={min:"min",max:"max",count:"sum"};function sL(t,e){const n=e.getScale(t.name).params;let r;for(r in n.domain=fL(t.domain,t,e),null!=t.range&&(n.range=bL(t,e,n)),null!=t.interpolate&&function(t,e){e.interpolate=uL(t.type||t),null!=t.gamma&&(e.interpolateGamma=uL(t.gamma))}(t.interpolate,n),null!=t.nice&&(n.nice=function(t){return(0,m.Kn)(t)?{interval:uL(t.interval),step:uL(t.step)}:uL(t)}(t.nice)),null!=t.bins&&(n.bins=function(t,e){return t.signal||(0,m.kJ)(t)?cL(t,e):e.objectProperty(t)}(t.bins,e)),t)(0,m.nr)(n,r)||"name"===r||(n[r]=uL(t[r],e))}function uL(t,e){return(0,m.Kn)(t)?t.signal?e.signalRef(t.signal):(0,m.vU)("Unsupported object: "+(0,m.m8)(t)):t}function cL(t,e){return t.signal?e.signalRef(t.signal):t.map((t=>uL(t,e)))}function lL(t){(0,m.vU)("Can not find data set: "+(0,m.m8)(t))}function fL(t,e,n){if(t)return t.signal?n.signalRef(t.signal):((0,m.kJ)(t)?dL:t.fields?pL:hL)(t,e,n);null==e.domainMin&&null==e.domainMax||(0,m.vU)("No scale domain defined for domainMin/domainMax to override.")}function dL(t,e,n){return t.map((t=>uL(t,n)))}function hL(t,e,n){const r=n.getData(t.data);return r||lL(t.data),Uf(e.type)?r.valuesRef(n,t.field,gL(t.sort,!1)):Hf(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)}function pL(t,e,n){const r=t.data,i=t.fields.reduce(((t,e)=>(e=(0,m.HD)(e)?{data:r,field:e}:(0,m.kJ)(e)||e.signal?function(t,e){const n="_:vega:_"+oL++,r=TP({});if((0,m.kJ)(t))r.value={$ingest:t};else if(t.signal){const i="setdata("+(0,m.m8)(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,eL({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t)),[]);return(Uf(e.type)?mL:Hf(e.type)?vL:yL)(t,n,i)}function mL(t,e,n){const r=gL(t.sort,!0);let i,o;const a=n.map((t=>{const n=e.getData(t.data);return n||lL(t.data),n.countsRef(e,t.field,r)})),s={groupby:fP,pulse:a};r&&(i=r.op||"count",o=r.field?pP(i,r.field):"count",s.ops=[aL[i]],s.fields=[e.fieldRef(o)],s.as=[o]),i=e.add(BP(s));const u=e.add(TP({pulse:cP(i)}));return o=e.add(iL({field:fP,sort:e.sortRef(r),pulse:cP(u)})),cP(o)}function gL(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field&&t.op&&!aL[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 vL(t,e,n){const r=n.map((t=>{const n=e.getData(t.data);return n||lL(t.data),n.domainRef(e,t.field)}));return cP(e.add(GP({values:r})))}function yL(t,e,n){const r=n.map((t=>{const n=e.getData(t.data);return n||lL(t.data),n.extentRef(e,t.field)}));return cP(e.add(XP({extents:r})))}function bL(t,e,n){const r=e.config.range;let i=t.range;if(i.signal)return e.signalRef(i.signal);if((0,m.HD)(i)){if(r&&(0,m.nr)(r,i))return bL(t=(0,m.l7)({},t,{range:r[i]}),e,n);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=Uf(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:(0,m.vU)("Unrecognized scale range value: "+(0,m.m8)(i))}else{if(i.scheme)return n.scheme=(0,m.kJ)(i.scheme)?cL(i.scheme,e):uL(i.scheme,e),i.extent&&(n.schemeExtent=cL(i.extent,e)),void(i.count&&(n.schemeCount=uL(i.count,e)));if(i.step)return void(n.rangeStep=uL(i.step,e));if(Uf(t.type)&&!(0,m.kJ)(i))return fL(i,t,e);(0,m.kJ)(i)||(0,m.vU)("Unsupported range type: "+(0,m.m8)(i))}return i.map((t=>((0,m.kJ)(t)?cL:uL)(t,e)))}function xL(t,e,n){return(0,m.kJ)(t)?t.map((t=>xL(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 AL="top",_L="left",wL="right",EL="bottom",DL="center",FL="vertical",CL="start",kL="end",SL="index",ML="label",BL="offset",OL="perc",NL="perc2",TL="value",zL="guide-label",RL="guide-title",PL="group-title",LL="group-subtitle",jL="symbol",UL="gradient",IL="discrete",qL="size",WL=[qL,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],HL={name:1,style:1,interactive:1},XL={value:0},GL={value:1},JL="group",$L="rect",VL="rule",YL="symbol",KL="text";function ZL(t){return t.type=JL,t.interactive=t.interactive||!1,t}function QL(t,e){const n=(n,r)=>bP(t[n],bP(e[n],r));return n.isVertical=n=>FL===bP(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>bP(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>bP(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>bP(t.columns,bP(e.columns,+n.isVertical(!0))),n}function tj(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 ej(t,e,n){return"item.anchor === '".concat(CL,"' ? ").concat(t," : item.anchor === '").concat(kL,"' ? ").concat(e," : ").concat(n)}const nj=ej((0,m.m8)(_L),(0,m.m8)(wL),(0,m.m8)(DL));function rj(t,e){return e?t?(0,m.Kn)(t)?Object.assign({},t,{offset:rj(t.offset,e)}):{value:t,offset:e}:e:t}function ij(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=DR(t.encode,e,HL)):t.interactive=!1,t}function oj(t,e,n,r){const i=QL(t,n),o=i.isVertical(),a=i.gradientThickness(),s=i.gradientLength();let u,c,l,f,d;o?(c=[0,1],l=[0,0],f=a,d=s):(c=[0,0],l=[1,0],f=s,d=a);const h={enter:u={opacity:XL,x:XL,y:XL,width:_R(f),height:_R(d)},update:(0,m.l7)({},u,{opacity:GL,fill:{gradient:e,start:c,stop:l}}),exit:{opacity:XL}};return ER(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),ij({type:$L,role:jR,encode:h},r)}function aj(t,e,n,r,i){const o=QL(t,n),a=o.isVertical(),s=o.gradientThickness(),u=o.gradientLength();let c,l,f,d,h="";a?(c="y",f="y2",l="x",d="width",h="1-"):(c="x",f="x2",l="y",d="height");const p={opacity:XL,fill:{scale:e,field:TL}};p[c]={signal:h+"datum."+OL,mult:u},p[l]=XL,p[f]={signal:h+"datum."+NL,mult:u},p[d]=_R(s);const g={enter:p,update:(0,m.l7)({},p,{opacity:GL}),exit:{opacity:XL}};return ER(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),ij({type:$L,role:PR,key:TL,from:i,encode:g},r)}const sj="datum.".concat(OL,'<=0?"').concat(_L,'":datum.').concat(OL,'>=1?"').concat(wL,'":"').concat(DL,'"'),uj="datum.".concat(OL,'<=0?"').concat(EL,'":datum.').concat(OL,'>=1?"').concat(AL,'":"').concat("middle",'"');function cj(t,e,n,r){const i=QL(t,e),o=i.isVertical(),a=_R(i.gradientThickness()),s=i.gradientLength();let u,c,l,f,d=i("labelOverlap"),h="";const p={enter:u={opacity:XL},update:c={opacity:GL,text:{field:ML}},exit:{opacity:XL}};return ER(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:bP(t.labelLimit,e.gradientLabelLimit)}),o?(u.align={value:"left"},u.baseline=c.baseline={signal:uj},l="y",f="x",h="1-"):(u.align=c.align={signal:sj},u.baseline={value:"top"},l="x",f="y"),u[l]=c[l]={signal:h+"datum."+OL,mult:s},u[f]=c[f]=a,a.offset=bP(t.labelOffset,e.gradientLabelOffset)||0,d=d?{separation:i("labelSeparation"),method:d,order:"datum."+SL}:void 0,ij({type:KL,role:UR,style:zL,key:TL,from:r,encode:p,overlap:d},n)}function lj(t,e,n,r,i){const o=QL(t,e),a=n.entries,s=!(!a||!a.interactive),u=a?a.name:void 0,c=o("clipHeight"),l=o("symbolOffset"),f={data:"value"},d="(".concat(i,") ? datum.").concat(BL," : datum.").concat(qL),h=c?_R(c):{field:qL},p="datum.".concat(SL),m="max(1, ".concat(i,")");let g,v,y,b,x;h.mult=.5,g={enter:v={opacity:XL,x:{signal:d,mult:.5,offset:l},y:h},update:y={opacity:GL,x:v.x,y:v.y},exit:{opacity:XL}};let A=null,_=null;t.fill||(A=e.symbolBaseFillColor,_=e.symbolBaseStrokeColor),ER(g,{fill:o("symbolFillColor",A),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",_),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),WL.forEach((e=>{t[e]&&(y[e]=v[e]={scale:t[e],field:TL})}));const w=ij({type:YL,role:IR,key:TL,from:f,clip:!!c||void 0,encode:g},n.symbols),E=_R(l);E.offset=o("labelOffset"),g={enter:v={opacity:XL,x:{signal:d,offset:E},y:h},update:y={opacity:GL,text:{field:ML},x:v.x,y:v.y},exit:{opacity:XL}},ER(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=ij({type:KL,role:UR,style:zL,key:TL,from:f,encode:g},n.labels);return g={enter:{noBound:{value:!c},width:XL,height:c?_R(c):XL,opacity:XL},exit:{opacity:XL},update:y={opacity:GL,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(i,")?").concat(y.column.signal,":").concat(p),ZL({role:SR,from:r={facet:{data:r,name:"value",groupby:SL}},encode:DR(g,a,HL),marks:[w,D],name:u,interactive:s,sort:x})}const fj='item.orient === "left"',dj='item.orient === "right"',hj="(".concat(fj," || ").concat(dj,")"),pj="datum.vgrad && ".concat(hj),mj=ej('"top"','"bottom"','"middle"'),gj=ej('"right"','"left"','"center"'),vj="datum.vgrad && ".concat(dj," ? (").concat(gj,") : (").concat(hj," && !(datum.vgrad && ").concat(fj,')) ? "left" : ').concat(nj),yj="item._anchor || (".concat(hj,' ? "middle" : "start")'),bj="".concat(pj," ? (").concat(fj," ? -90 : 90) : 0"),xj="".concat(hj," ? (datum.vgrad ? (").concat(dj,' ? "bottom" : "top") : ').concat(mj,') : "top"');function Aj(t,e){let n;return(0,m.Kn)(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+_j(t.path)+")":t.sphere&&(n="geoShape("+_j(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function _j(t){return(0,m.Kn)(t)&&t.signal?t.signal:(0,m.m8)(t)}function wj(t){const e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")&&e.indexOf("title")?t.type===JL?SR:e||CR:e}function Ej(t){return{marktype:t.type,name:t.name||void 0,role:t.role||wj(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function Dj(t,e){return t&&t.signal?e.signalRef(t.signal):!1!==t}function Fj(t,e){const n=io(t.type);n||(0,m.vU)("Unrecognized transform type: "+(0,m.m8)(t.type));const r=sP(n.type.toLowerCase(),null,Cj(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r}function Cj(t,e,n){const r={},i=t.params.length;for(let o=0;o<i;++o){const i=t.params[o];r[i.name]=kj(i,e,n)}return r}function kj(t,e,n){const r=t.type,i=e[t.name];return"index"===r?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!==i?"param"===r?function(t,e,n){const r=e[t.name];return t.array?((0,m.kJ)(r)||(0,m.vU)("Expected an array of sub-parameters. Instead: "+(0,m.m8)(r)),r.map((e=>Mj(t,e,n)))):Mj(t,r,n)}(t,e,n):"projection"===r?n.projectionRef(e[t.name]):t.array&&!vP(i)?i.map((e=>Sj(t,e,n))):Sj(t,i,n):void(t.required&&(0,m.vU)("Missing required "+(0,m.m8)(e.type)+" parameter: "+(0,m.m8)(t.name)))}function Sj(t,e,n){const r=t.type;if(vP(e))return Tj(r)?(0,m.vU)("Expression references can not be signals."):zj(r)?n.fieldRef(e):Rj(r)?n.compareRef(e):n.signalRef(e.signal);{const i=t.expr||zj(r);return i&&Bj(e)?n.exprRef(e.expr,e.as):i&&Oj(e)?lP(e.field,e.as):Tj(r)?yO(e,n):Nj(r)?cP(n.getData(e).values):zj(r)?lP(e):Rj(r)?n.compareRef(e):e}}function Mj(t,e,n){const r=t.params.length;let i;for(let a=0;a<r;++a){i=t.params[a];for(const t in i.key)if(i.key[t]!==e[t]){i=null;break}if(i)break}i||(0,m.vU)("Unsupported parameter: "+(0,m.m8)(e));const o=(0,m.l7)(Cj(i,e,n),i.key);return cP(n.add($P(o)))}const Bj=t=>t&&t.expr,Oj=t=>t&&t.field,Nj=t=>"data"===t,Tj=t=>"expr"===t,zj=t=>"field"===t,Rj=t=>"compare"===t;function Pj(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:cP(e.getData(t.data).output)}function Lj(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}function jj(t){return(0,m.HD)(t)?t:null}function Uj(t,e,n){const r=pP(n.op,n.field);let i;if(e.ops){for(let o=0,a=e.as.length;o<a;++o)if(e.as[o]===r)return}else e.ops=["count"],e.fields=[null],e.as=["count"];n.op&&(e.ops.push((i=n.op.signal)?t.signalRef(i):n.op),e.fields.push(t.fieldRef(n.field)),e.as.push(r))}function Ij(t,e,n,r,i,o,a){const s=e[n]||(e[n]={}),u=function(t){return(0,m.Kn)(t)?(t.order===hP?"-":"+")+pP(t.op,t.field):""}(o);let c,l,f=jj(i);if(null!=f&&(t=e.scope,f+=u?"|"+u:"",c=s[f]),!c){const n=o?{field:fP,pulse:e.countsRef(t,i,o)}:{field:t.fieldRef(i),pulse:cP(e.output)};u&&(n.sort=t.sortRef(o)),l=t.add(sP(r,void 0,n)),a&&(e.index[i]=l),c=cP(l),null!=f&&(s[f]=c)}return c}function qj(t,e,n){const r=t.remove,i=t.insert,o=t.toggle,a=t.modify,s=t.values,u=e.add(uP()),c=yO("if("+t.trigger+',modify("'+n+'",'+[i,r,o,a,s].map((t=>null==t?"null":t)).join(",")+"),0)",e);u.update=c.$expr,u.params=c.$params}function Wj(t,e){const n=wj(t),r=t.type===JL,i=t.from&&t.from.facet,o=t.overlap;let a,s,u,c,l,f,d,h=t.layout||n===SR||n===kR;const p=n===CR||h||i,g=function(t,e,n){let r,i,o,a,s;return t?(r=t.facet)&&(e||(0,m.vU)("Only group marks can be faceted."),null!=r.field?a=s=Pj(r,n):(t.data?s=cP(n.getData(t.data).aggregate):(o=Fj((0,m.l7)({type:"aggregate",groupby:(0,m.IX)(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=Pj(r,n),a=s=cP(n.add(o))),i=n.keyRef(r.groupby,!0))):a=cP(n.add(TP(null,[{}]))),a||(a=Pj(t,n)),{key:i,pulse:a,parent:s}}(t.from,r,e);s=e.add(RP({key:g.key||(t.key?lP(t.key):void 0),pulse:g.pulse,clean:!r}));const v=cP(s);s=u=e.add(TP({pulse:v})),s=e.add(HP({markdef:Ej(t),interactive:Dj(t.interactive,e),clip:Aj(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:cP(s)}));const y=cP(s);s=c=e.add(PP(QR(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=Fj(t,e),r=n.metadata;(r.generates||r.changes)&&(0,m.vU)("Mark transforms should not generate new data."),r.nomod||(c.params.mod=!0),n.params.pulse=cP(s),e.add(s=n)})),t.sort&&(s=e.add(nL({sort:e.compareRef(t.sort),pulse:cP(s)})));const b=cP(s);(i||h)&&(h=e.add(rL({layout:e.objectProperty(t.layout),legends:e.legends,mark:y,pulse:b})),f=cP(h));const x=e.add(NP({mark:y,pulse:f||b}));d=cP(x),r&&(p&&(a=e.operators,a.pop(),h&&a.pop()),e.pushState(b,f||d,v),i?function(t,e,n){const r=t.from.facet,i=r.name,o=Pj(r,e);let a;r.name||(0,m.vU)("Facet must have a name: "+(0,m.m8)(r)),r.data||(0,m.vU)("Facet must reference a data set: "+(0,m.m8)(r)),r.field?a=e.add(VP({field:e.fieldRef(r.field),pulse:o})):r.groupby?a=e.add(jP({key:e.keyRef(r.groupby),group:cP(e.proxy(n.parent)),pulse:o})):(0,m.vU)("Facet must specify groupby or field: "+(0,m.m8)(r));const s=e.fork(),u=s.add(TP()),c=s.add(eL({pulse:cP(u)}));s.addData(i,new Lj(s,u,u,c)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(t).toRuntime()}}(t,e,g):p?function(t,e,n){const r=e.add(VP({pulse:n.pulse})),i=e.fork();i.add(eL()),i.addSignal("parent",null),r.params.subflow={$subflow:i.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 r=t.method,i=t.bound,o=t.separation,a={separation:vP(o)?n.signalRef(o.signal):o,method:vP(r)?n.signalRef(r.signal):r,pulse:e};t.order&&(a.sort=n.compareRef({field:t.order}));if(i){const t=i.tolerance;a.boundTolerance=vP(t)?n.signalRef(t.signal):+t,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return cP(n.add(JP(a)))}(o,d,e));const A=e.add(QP({pulse:d})),_=e.add(eL({pulse:cP(A)},void 0,e.parent()));null!=t.name&&(l=t.name,e.addData(l,new Lj(e,u,A,_)),t.on&&t.on.forEach((t=>{(t.insert||t.remove||t.toggle)&&(0,m.vU)("Marks only support modify triggers."),qj(t,e,l)})))}function Hj(t,e){const n=e.config.legend,r=t.encode||{},i=QL(t,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,u=o.style,c={};let l,f,d,h=0;WL.forEach((e=>t[e]?(c[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||jL;t.type||1!==function(t){return WL.reduce(((e,n)=>e+(t[n]?1:0)),0)}(t)||!t.fill&&!t.stroke||(n=jf(e)?UL:If(e)?IL:jL);return n!==UL?n:If(e)?IL:UL}(t,e.scaleType(h)),g={title:null!=t.title,scales:c,type:p,vgrad:"symbol"!==p&&i.isVertical()},v=cP(e.add(TP(null,[g]))),y=cP(e.add(qP(f={type:p,scale:e.scaleRef(h),count:e.objectProperty(i("tickCount")),limit:e.property(i("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return p===UL?(d=[oj(t,h,n,r.gradient),cj(t,n,r.labels,y)],f.count=f.count||e.signalRef("max(2,2*floor((".concat(xP(i.gradientLength()),")/100))"))):p===IL?d=[aj(t,h,n,r.gradient,y),cj(t,n,r.labels,y)]:(l=function(t,e){const n=QL(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,n),d=[lj(t,n,r,y,xP(l.columns))],f.size=function(t,e,n){const r=xP(Gj("size",t,n)),i=xP(Gj("strokeWidth",t,n)),o=xP(function(t,e,n){return tj("fontSize",t)||function(t,e,n){const r=e.config.style[n];return r&&r[t]}("fontSize",e,n)}(n[1].encode,e,zL));return yO("max(ceil(sqrt(".concat(r,")+").concat(i,"),").concat(o,")"),e)}(t,e,d[0].marks)),d=[ZL({role:LR,from:v,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:l,interactive:s})],g.title&&d.push(function(t,e,n,r){const i=QL(t,e),o={enter:{opacity:XL},update:{opacity:GL,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:XL}};return ER(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:yj},angle:{signal:bj},align:{signal:vj},baseline:{signal:xj},text:t.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),ij({type:KL,role:qR,style:RL,from:r,encode:o},n)}(t,n,r.title,v)),Wj(ZL({role:RR,from:v,encode:DR(Xj(i,t,n),o,HL),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:u}),e)}function Xj(t,e,n){const r={enter:{},update:{}};return ER(r,{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}),r}function Gj(t,e,n){return e[t]?'scale("'.concat(e[t],'",datum)'):tj(t,n[0].encode)}Lj.fromEntries=function(t,e){const n=e.length,r=e[n-1],i=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=cP(e[s-1]),t.add(e[s]),"aggregate"===e[s].type&&(a=e[s]);return new Lj(t,o,i,r,a)},Lj.prototype={countsRef(t,e,n){const r=this,i=r.counts||(r.counts={}),o=jj(e);let a,s,u;return null!=o&&(t=r.scope,a=i[o]),a?n&&n.field&&Uj(t,a.agg.params,n):(u={groupby:t.fieldRef(e,"key"),pulse:cP(r.output)},n&&n.field&&Uj(t,u,n),s=t.add(BP(u)),a=t.add(TP({pulse:cP(s)})),a={agg:s,ref:cP(a)},null!=o&&(i[o]=a)),a.ref},tuplesRef(){return cP(this.values)},extentRef(t,e){return Ij(t,this,"extent","extent",e,!1)},domainRef(t,e){return Ij(t,this,"domain","values",e,!1)},valuesRef(t,e,n){return Ij(t,this,"vals","values",e,n||!0)},lookupRef(t,e){return Ij(t,this,"lookup","tupleindex",e,!1)},indataRef(t,e){return Ij(t,this,"indata","tupleindex",e,!0,!0)}};const Jj='item.orient==="'.concat(_L,'"?-90:item.orient==="').concat(wL,'"?90:0');function $j(t,e){const n=QL(t=(0,m.HD)(t)?{text:t}:t,e.config.title),r=t.encode||{},i=r.group||{},o=i.name||void 0,a=i.interactive,s=i.style,u=[],c=cP(e.add(TP(null,[{}])));return u.push(function(t,e,n,r){const i={value:0},o=t.text,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return ER(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")}),ij({type:KL,role:HR,style:PL,from:r,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),c)),t.subtitle&&u.push(function(t,e,n,r){const i={value:0},o=t.subtitle,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return ER(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")}),ij({type:KL,role:XR,style:LL,from:r,encode:a},n)}(t,n,r.subtitle,c)),Wj(ZL({role:WR,from:c,encode:Vj(n,i),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:s}),e)}function Vj(t,e){const n={enter:{},update:{}};return ER(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:nj},angle:{signal:Jj},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),DR(n,e,HL)}function Yj(t,e){const n=[];t.transform&&t.transform.forEach((t=>{n.push(Fj(t,e))})),t.on&&t.on.forEach((n=>{qj(n,e,t.name)})),e.addDataPipeline(t.name,function(t,e,n){const r=[];let i,o,a,s,u,c=null,l=!1,f=!1;t.values?vP(t.values)||yP(t.format)?(r.push(Zj(e,t)),r.push(c=Kj())):r.push(c=Kj({$ingest:t.values,$format:t.format})):t.url?yP(t.url)||yP(t.format)?(r.push(Zj(e,t)),r.push(c=Kj())):r.push(c=Kj({$request:t.url,$format:t.format})):t.source&&(c=i=(0,m.IX)(t.source).map((t=>cP(e.getData(t).output))),r.push(null));for(o=0,a=n.length;o<a;++o)s=n[o],u=s.metadata,c||u.source||r.push(c=Kj()),r.push(s),u.generates&&(f=!0),u.modifies&&!f&&(l=!0),u.source?c=s:u.changes&&(c=null);i&&(a=i.length-1,r[0]=ZP({derive:l,pulse:a?i:i[0]}),(l||a)&&r.splice(1,0,Kj()));c||r.push(Kj());return r.push(eL({})),r}(t,e,n))}function Kj(t){const e=TP({},t);return e.metadata={source:!0},e}function Zj(t,e){return WP({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 Qj=t=>t===EL||t===AL,tU=(t,e,n)=>vP(t)?sU(t.signal,e,n):t===_L||t===AL?e:n,eU=(t,e,n)=>vP(t)?oU(t.signal,e,n):Qj(t)?e:n,nU=(t,e,n)=>vP(t)?aU(t.signal,e,n):Qj(t)?n:e,rU=(t,e,n)=>vP(t)?uU(t.signal,e,n):t===AL?{value:e}:{value:n},iU=(t,e,n)=>vP(t)?cU(t.signal,e,n):t===wL?{value:e}:{value:n},oU=(t,e,n)=>lU("".concat(t," === '").concat(AL,"' || ").concat(t," === '").concat(EL,"'"),e,n),aU=(t,e,n)=>lU("".concat(t," !== '").concat(AL,"' && ").concat(t," !== '").concat(EL,"'"),e,n),sU=(t,e,n)=>dU("".concat(t," === '").concat(_L,"' || ").concat(t," === '").concat(AL,"'"),e,n),uU=(t,e,n)=>dU("".concat(t," === '").concat(AL,"'"),e,n),cU=(t,e,n)=>dU("".concat(t," === '").concat(wL,"'"),e,n),lU=(t,e,n)=>(e=null!=e?_R(e):e,n=null!=n?_R(n):n,fU(e)&&fU(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||[])),fU=t=>null==t||1===Object.keys(t).length,dU=(t,e,n)=>({signal:"".concat(t," ? (").concat(pU(e),") : (").concat(pU(n),")")}),hU=(t,e,n,r,i)=>({signal:(null!=r?"".concat(t," === '").concat(_L,"' ? (").concat(pU(r),") : "):"")+(null!=n?"".concat(t," === '").concat(EL,"' ? (").concat(pU(n),") : "):"")+(null!=i?"".concat(t," === '").concat(wL,"' ? (").concat(pU(i),") : "):"")+(null!=e?"".concat(t," === '").concat(AL,"' ? (").concat(pU(e),") : "):"")+"(null)"}),pU=t=>vP(t)?t.signal:null==t?null:(0,m.m8)(t),mU=(t,e)=>0===e?0:vP(t)?{signal:"(".concat(t.signal,") * ").concat(e)}:{value:t*e},gU=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function vU(t,e,n,r){let i;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":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=t[5].toLowerCase()+t.slice(6)}return r[RL][i]}if(t.startsWith("label")){switch(t){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=t[5].toLowerCase()+t.slice(6)}return r[zL][i]}return null}function yU(t){const e={};for(const n of t)if(n)for(const t in n)e[t]=1;return Object.keys(e)}function bU(t,e){return{scale:t.scale,range:e}}function xU(t,e,n,r,i){const o=QL(t,e),a=t.orient,s=t.gridScale,u=tU(a,1,-1),c=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=vP(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=vP(e)?{signal:"(".concat(e.signal,") * (").concat(t||0,")")}:e*(t||0);return t}(t.offset,u);let l,f,d;const h={enter:l={opacity:XL},update:d={opacity:GL},exit:f={opacity:XL}};ER(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:TL,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=eU(a,{signal:"height"},{signal:"width"}),v=s?{scale:s,range:0,mult:u,offset:c}:{value:0,offset:c},y=s?{scale:s,range:1,mult:u,offset:c}:(0,m.l7)(g,{mult:u,offset:c});return l.x=d.x=eU(a,p,v),l.y=d.y=nU(a,p,v),l.x2=d.x2=nU(a,y),l.y2=d.y2=eU(a,y),f.x=eU(a,p),f.y=nU(a,p),ij({type:VL,role:OR,key:TL,from:r,encode:h},n)}function AU(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}function _U(t,e,n,r){const i=QL(t,e),o=t.orient,a=tU(o,-1,1);let s,u;const c={enter:s={opacity:XL,anchor:_R(i("titleAnchor",null)),align:{signal:nj}},update:u=(0,m.l7)({},s,{opacity:GL,text:_R(t.title)}),exit:{opacity:XL}},l={signal:'lerp(range("'.concat(t.scale,'"), ').concat(ej(0,1,.5),")")};return u.x=eU(o,l),u.y=nU(o,l),s.angle=eU(o,XL,mU(a,90)),s.baseline=eU(o,rU(o,EL,AL),{value:EL}),u.angle=s.angle,u.baseline=s.baseline,ER(c,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function(t,e,n,r){const i=(t,e)=>null!=t?(n.update[e]=gU(_R(t),n.update[e]),!1):!FR(e,r),o=i(t("titleX"),"x"),a=i(t("titleY"),"y");n.enter.auto=a===o?_R(a):eU(e,_R(a),_R(o))}(i,o,c,n),c.update.align=gU(c.update.align,s.align),c.update.angle=gU(c.update.angle,s.angle),c.update.baseline=gU(c.update.baseline,s.baseline),ij({type:KL,role:zR,style:RL,from:r,encode:c},n)}function wU(t,e){const n=function(t,e){var n,r,i,o=e.config,a=o.style,s=o.axis,u="band"===e.scaleType(t.scale)&&o.axisBand,c=t.orient;if(vP(c)){const t=yU([o.axisX,o.axisY]),e=yU([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(i of(n={},t))n[i]=eU(c,vU(i,o.axisX,s,a),vU(i,o.axisY,s,a));for(i of(r={},e))r[i]=hU(c.signal,vU(i,o.axisTop,s,a),vU(i,o.axisBottom,s,a),vU(i,o.axisLeft,s,a),vU(i,o.axisRight,s,a))}else n=c===AL||c===EL?o.axisX:o.axisY,r=o["axis"+c[0].toUpperCase()+c.slice(1)];return n||r||u?(0,m.l7)({},s,n,r,u):s}(t,e),r=t.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,s=i.style,u=QL(t,n),c=function(t){const e=t("tickBand");let n,r,i=t("tickOffset");return e?e.signal?(n={signal:"(".concat(e.signal,") === 'extent' ? 1 : 0.5")},r={signal:"(".concat(e.signal,") === 'extent'")},(0,m.Kn)(i)||(i={signal:"(".concat(e.signal,") === 'extent' ? 0 : ").concat(i)})):"extent"===e?(n=1,r=!0,i=0):(n=.5,r=!1):(n=t("bandPosition"),r=t("tickExtra")),{extra:r,band:n,offset:i}}(u),l={scale:t.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:null!=t.title},f=cP(e.add(TP({},[l]))),d=cP(e.add(OP({scale:e.scaleRef(t.scale),extra:e.property(c.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 l.grid&&h.push(xU(t,n,r.grid,d,c)),l.ticks&&(p=u("tickSize"),h.push(function(t,e,n,r,i,o){const a=QL(t,e),s=t.orient,u=tU(s,-1,1);let c,l,f;const d={enter:c={opacity:XL},update:f={opacity:GL},exit:l={opacity:XL}};ER(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=_R(i);h.mult=u;const p={scale:t.scale,field:TL,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=c.y=eU(s,XL,p),f.y2=c.y2=eU(s,h),l.x=eU(s,p),f.x=c.x=nU(s,XL,p),f.x2=c.x2=nU(s,h),l.y=nU(s,p),ij({type:VL,role:TR,key:TL,from:r,encode:d},n)}(t,n,r.ticks,d,p,c))),l.labels&&(p=l.ticks?p:0,h.push(function(t,e,n,r,i,o){const a=QL(t,e),s=t.orient,u=t.scale,c=tU(s,-1,1),l=xP(a("labelFlush")),f=xP(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,m=0===l||!!l;const g=_R(i);g.mult=c,g.offset=_R(a("labelPadding")||0),g.offset.mult=c;const v={scale:u,field:TL,band:.5,offset:rj(o.offset,a("labelOffset"))},y=eU(s,m?AU(u,l,'"left"','"right"','"center"'):{value:"center"},iU(s,"left","right")),b=eU(s,rU(s,"bottom","top"),m?AU(u,l,'"top"','"bottom"','"middle"'):{value:"middle"}),x=AU(u,l,"-(".concat(f,")"),f,0);m=m&&f;const A={opacity:XL,x:eU(s,v,g),y:nU(s,v,g)},_={enter:A,update:p={opacity:GL,text:{field:ML},x:A.x,y:A.y,align:y,baseline:b},exit:{opacity:XL,x:A.x,y:A.y}};ER(_,{dx:!d&&m?eU(s,x):null,dy:!h&&m?nU(s,x):null}),ER(_,{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 w=a("labelBound");let E=a("labelOverlap");return E=E||w?{separation:a("labelSeparation"),method:E,order:"datum.index",bound:w?{scale:u,orient:s,tolerance:w}:null}:void 0,p.align!==y&&(p.align=gU(p.align,y)),p.baseline!==b&&(p.baseline=gU(p.baseline,b)),ij({type:KL,role:NR,style:zL,key:TL,from:r,encode:_,overlap:E},n)}(t,n,r.labels,d,p,c))),l.domain&&h.push(function(t,e,n,r){const i=QL(t,e),o=t.orient;let a,s;const u={enter:a={opacity:XL},update:s={opacity:GL},exit:{opacity:XL}};ER(u,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const c=bU(t,0),l=bU(t,1);return a.x=s.x=eU(o,c,XL),a.x2=s.x2=eU(o,l),a.y=s.y=nU(o,c,XL),a.y2=s.y2=nU(o,l),ij({type:VL,role:BR,from:r,encode:u},n)}(t,n,r.domain,f)),l.title&&h.push(_U(t,n,r.title,f)),Wj(ZL({role:MR,from:f,encode:DR(EU(u,t),i,HL),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:a,style:s}),e)}function EU(t,e){const n={enter:{},update:{}};return ER(n,{orient:t("orient"),offset:t("offset")||0,position:bP(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 DU(t,e,n){const r=(0,m.IX)(t.signals),i=(0,m.IX)(t.scales);return n||r.forEach((t=>oP(t,e))),(0,m.IX)(t.projections).forEach((t=>function(t,e){const n=e.config.projection||{},r={};for(const i in t)"name"!==i&&(r[i]=xL(t[i],i,e));for(const i in n)null==r[i]&&(r[i]=xL(n[i],i,e));e.addProjection(t.name,r)}(t,e))),i.forEach((t=>function(t,e){const n=t.type||"linear";Pf(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=>Yj(t,e))),i.forEach((t=>sL(t,e))),(n||r).forEach((t=>function(t,e){const n=e.getSignal(t.name);let r=t.update;t.init&&(r?(0,m.vU)("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=yO(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach((t=>kP(t,e,n.id)))}(t,e))),(0,m.IX)(t.axes).forEach((t=>wU(t,e))),(0,m.IX)(t.marks).forEach((t=>Wj(t,e))),(0,m.IX)(t.legends).forEach((t=>Hj(t,e))),t.title&&$j(t.title,e),e.parseLambdas(),e}const FU=t=>DR({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t);function CU(t,e){const n=e.config,r=cP(e.root=e.add(uP())),i=function(t,e){const n=n=>bP(t[n],e[n]),r=[kU("background",n("background")),kU("autosize",yR(n("autosize"))),kU("padding",AR(n("padding"))),kU("width",n("width")||0),kU("height",n("height")||0)],i=r.reduce(((t,e)=>(t[e.name]=e,t)),{}),o={};return(0,m.IX)(t.signals).forEach((t=>{(0,m.nr)(i,t.name)?t=(0,m.l7)(i[t.name],t):r.push(t),o[t.name]=t})),(0,m.IX)(e.signals).forEach((t=>{(0,m.nr)(o,t.name)||(0,m.nr)(i,t.name)||r.push(t)})),r}(t,n);i.forEach((t=>oP(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(TP()),a=e.add(PP(QR(FU(t.encode),JL,kR,t.style,e,{pulse:cP(o)}))),s=e.add(rL({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:r,pulse:cP(a)}));e.operators.pop(),e.pushState(cP(a),cP(s),null),DU(t,e,i),e.operators.push(s);let u=e.add(NP({mark:r,pulse:cP(s)}));return u=e.add(QP({pulse:cP(u)})),u=e.add(eL({pulse:cP(u)})),e.addData("root",new Lj(e,o,o,u)),e}function kU(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function SU(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 MU(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 BU(t){return((0,m.kJ)(t)?OU:NU)(t)}function OU(t){const e=t.length;let n="[";for(let r=0;r<e;++r){const e=t[r];n+=(r>0?",":"")+((0,m.Kn)(e)?e.signal||BU(e):(0,m.m8)(e))}return n+"]"}function NU(t){let e,n,r="{",i=0;for(e in t)n=t[e],r+=(++i>1?",":"")+(0,m.m8)(e)+":"+((0,m.Kn)(n)?n.signal||BU(n):(0,m.m8)(n));return r+"}"}function TU(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",r="#888",i="#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:i},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:r,grid:!1,gridWidth:1,gridColor:i,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:r,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:i,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:r,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),CU(t,new SU(e,n)).toRuntime()}SU.prototype=MU.prototype={parse(t){return DU(t,this)},fork(){return new MU(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 aP?cP(t):t;return this.add(KP({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 r,i;t&&(r=t.data||(t.data={}),i=r[e]||(r[e]=[]),i.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 r in e.index)n(e.index[r],t,"index:"+r)}return this},pushState(t,e,n){this._encode.push(cP(this.add(eL({pulse:t})))),this._parent.push(e),this._lookup.push(n?cP(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 lP(t,e);t.signal||(0,m.vU)("Unsupported field reference: "+(0,m.m8)(t));const n=t.signal;let r=this.field[n];if(!r){const t={name:this.signalRef(n)};e&&(t.as=e),this.field[n]=r=cP(this.add(UP(t)))}return r},compareRef(t){let e=!1;const n=t=>vP(t)?(e=!0,this.signalRef(t.signal)):function(t){return t&&t.expr}(t)?(e=!0,this.exprRef(t.expr)):t,r=(0,m.IX)(t.field).map(n),i=(0,m.IX)(t.order).map(n);return e?cP(this.add(zP({fields:r,orders:i}))):dP(r,i)},keyRef(t,e){let n=!1;const r=this.signals;return t=(0,m.IX)(t).map((t=>vP(t)?(n=!0,cP(r[t.signal])):t)),n?cP(this.add(IP({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=pP(t.op,t.field),n=t.order||"ascending";return n.signal?cP(this.add(zP({fields:e,orders:this.signalRef(n.signal)}))):dP(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}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 aP?e:this.add(uP(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]?cP(this.signals[t]):((0,m.nr)(this.lambdas,t)||(this.lambdas[t]=this.add(uP(null))),cP(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;e<n;++e){const n=t[e],r=yO(n,this),i=this.lambdas[n];i.params=r.$params,i.update=r.$expr}},property(t){return t&&t.signal?this.signalRef(t.signal):t},objectProperty(t){return t&&(0,m.Kn)(t)?this.signalRef(t.signal||BU(t)):t},exprRef(t,e){const n={expr:yO(t,this)};return e&&(n.expr.$name=e),cP(this.add(LP(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,tL(e))},addProjection(t,e){this.addScaleProj(t,YP(e))},getScale(t){return this.scales[t]||(0,m.vU)("Unrecognized scale name: "+(0,m.m8)(t)),this.scales[t]},scaleRef(t){return cP(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,Lj.fromEntries(this,e))}};var zU="5.25.0";(0,m.l7)(ro,r,o,a,s,u,l,c,f,d,h,p)},76248:t=>{"use strict";var e=/("(?:[^\\"]|\\.)*")|[:,]/g;t.exports=function(t,n){var r,i,o;return n=n||{},r=JSON.stringify([1],void 0,void 0===n.indent?2:n.indent).slice(2,-3),i=""===r?1/0:void 0===n.maxLength?80:n.maxLength,o=n.replacer,function t(n,a,s){var u,c,l,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=i-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+r,l=[],c=0,Array.isArray(n))for(v="[",u="]",p=n.length;c<p;c++)l.push(t(n[c],m,c===p-1?0:1)||"null");else for(v="{",u="}",p=(h=Object.keys(n)).length;c<p;c++)f=h[c],d=JSON.stringify(f)+": ",void 0!==(b=t(n[f],m,d.length+(c===p-1?0:1)))&&l.push(d+b);if(l.length>0)return[v,r+l.join(",\n"+m),u].join("\n"+a)}return y}(t,"",0)}}}]);
|