/**
 * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0.
 * Original file: /npm/vega-embed@7.1.0/build/embed.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import e from"/npm/json-stringify-pretty-compact@%5E4.0.0/+esm";import*as t from"/npm/vega@*/+esm";import{isString as r,mergeConfig as n,isBoolean as o,logger as i,isObject as s,writeConfig as a}from"/npm/vega@*/+esm";import{expressionInterpreter as c}from"/npm/vega-interpreter@%5E2.0.0/+esm";import*as p from"/npm/vega-lite@*/+esm";import l from"/npm/vega-schema-url-parser@%5E3.0.2/+esm";import*as u from"/npm/vega-themes@3.0.0/+esm";import{Handler as h}from"/npm/vega-tooltip@1.0.0/+esm";var f="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function d(){throw new Error("setTimeout has not been defined")}function E(){throw new Error("clearTimeout has not been defined")}var m=d,v=E;function g(e){if(m===setTimeout)return setTimeout(e,0);if((m===d||!m)&&setTimeout)return m=setTimeout,setTimeout(e,0);try{return m(e,0)}catch(t){try{return m.call(null,e,0)}catch(t){return m.call(this,e,0)}}}"function"==typeof f.setTimeout&&(m=setTimeout),"function"==typeof f.clearTimeout&&(v=clearTimeout);var w,O=[],I=!1,R=-1;function $(){I&&w&&(I=!1,w.length?O=w.concat(O):R=-1,O.length&&A())}function A(){if(!I){var e=g($);I=!0;for(var t=O.length;t;){for(w=O,O=[];++R<t;)w&&w[R].run();R=-1,t=O.length}w=null,I=!1,function(e){if(v===clearTimeout)return clearTimeout(e);if((v===E||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(e);try{return v(e)}catch(t){try{return v.call(null,e)}catch(t){return v.call(this,e)}}}(e)}}function N(e,t){this.fun=e,this.array=t}N.prototype.run=function(){this.fun.apply(null,this.array)};function L(){}var T=L,y=L,b=L,S=L,_=L,P=L,x=L;var D=f.performance||{},C=D.now||D.mozNow||D.msNow||D.oNow||D.webkitNow||function(){return(new Date).getTime()};var F=new Date;var M,j={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];O.push(new N(e,t)),1!==O.length||I||g(A)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:T,addListener:y,once:b,off:S,removeListener:_,removeAllListeners:P,emit:x,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*C.call(D),r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r-=e[0],(n-=e[1])<0&&(r--,n+=1e9)),[r,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-F)/1e3}},G=(M=function(e,t){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},M(e,t)},function(e,t){function r(){this.constructor=e}M(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),U=Object.prototype.hasOwnProperty;
/*!
 * https://github.com/Starcounter-Jack/JSON-Patch
 * (c) 2017-2022 Joachim Wester
 * MIT licensed
 */function k(e,t){return U.call(e,t)}function X(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var o in e)k(e,o)&&n.push(o);return n}function V(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function H(e){for(var t,r=0,n=e.length;r<n;){if(!((t=e.charCodeAt(r))>=48&&t<=57))return!1;r++}return!0}function B(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function z(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function W(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(W(e[t]))return!0}else if("object"==typeof e)for(var n=X(e),o=n.length,i=0;i<o;i++)if(W(e[n[i]]))return!0;return!1}function J(e,t){var r=[e];for(var n in t){var o="object"==typeof t[n]?JSON.stringify(t[n],null,2):t[n];void 0!==o&&r.push(n+": "+o)}return r.join("\n")}var Y=function(e){function t(t,r,n,o,i){var s=this.constructor,a=e.call(this,J(t,{name:r,index:n,operation:o,tree:i}))||this;return a.name=r,a.index=n,a.operation=o,a.tree=i,Object.setPrototypeOf(a,s.prototype),a.message=J(t,{name:r,index:n,operation:o,tree:i}),a}return G(t,e),t}(Error),q=Y,Q=V,K={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=ee(r,this.path);n&&(n=V(n));var o=te(r,{op:"remove",path:this.from}).removed;return te(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=ee(r,this.from);return te(r,{op:"add",path:this.path,value:V(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:ie(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},Z={add:function(e,t,r){return H(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:K.move,copy:K.copy,test:K.test,_get:K._get};function ee(e,t){if(""==t)return e;var r={op:"_get",path:t};return te(e,r),r.value}function te(e,t,r,n,o,i){if(void 0===r&&(r=!1),void 0===n&&(n=!0),void 0===o&&(o=!0),void 0===i&&(i=0),r&&("function"==typeof r?r(t,0,e,t.path):ne(t,0)),""===t.path){var s={newDocument:e};if("add"===t.op)return s.newDocument=t.value,s;if("replace"===t.op)return s.newDocument=t.value,s.removed=e,s;if("move"===t.op||"copy"===t.op)return s.newDocument=ee(e,t.from),"move"===t.op&&(s.removed=e),s;if("test"===t.op){if(s.test=ie(e,t.value),!1===s.test)throw new q("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return s.newDocument=e,s}if("remove"===t.op)return s.removed=e,s.newDocument=null,s;if("_get"===t.op)return t.value=e,s;if(r)throw new q("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return s}n||(e=V(e));var a=(t.path||"").split("/"),c=e,p=1,l=a.length,u=void 0,h=void 0,f=void 0;for(f="function"==typeof r?r:ne;;){if((h=a[p])&&-1!=h.indexOf("~")&&(h=z(h)),o&&("__proto__"==h||"prototype"==h&&p>0&&"constructor"==a[p-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(r&&void 0===u&&(void 0===c[h]?u=a.slice(0,p).join("/"):p==l-1&&(u=t.path),void 0!==u&&f(t,0,e,u)),p++,Array.isArray(c)){if("-"===h)h=c.length;else{if(r&&!H(h))throw new q("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",i,t,e);H(h)&&(h=~~h)}if(p>=l){if(r&&"add"===t.op&&h>c.length)throw new q("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);if(!1===(s=Z[t.op].call(t,c,h,e)).test)throw new q("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return s}}else if(p>=l){if(!1===(s=K[t.op].call(t,c,h,e)).test)throw new q("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return s}if(c=c[h],r&&p<l&&(!c||"object"!=typeof c))throw new q("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",i,t,e)}}function re(e,t,r,n,o){if(void 0===n&&(n=!0),void 0===o&&(o=!0),r&&!Array.isArray(t))throw new q("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=V(e));for(var i=new Array(t.length),s=0,a=t.length;s<a;s++)i[s]=te(e,t[s],r,!0,o,s),e=i[s].newDocument;return i.newDocument=e,i}function ne(e,t,r,n){if("object"!=typeof e||null===e||Array.isArray(e))throw new q("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(!K[e.op])throw new q("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r);if("string"!=typeof e.path)throw new q("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new q('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new q("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new q("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&W(e.value))throw new q("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r)if("add"==e.op){var o=e.path.split("/").length,i=n.split("/").length;if(o!==i+1&&o!==i)throw new q("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==n)throw new q("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if("move"===e.op||"copy"===e.op){var s=oe([{op:"_get",path:e.from,value:void 0}],r);if(s&&"OPERATION_PATH_UNRESOLVABLE"===s.name)throw new q("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}function oe(e,t,r){try{if(!Array.isArray(e))throw new q("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)re(V(t),V(e),r||!0);else{r=r||ne;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(e){if(e instanceof q)return e;throw e}}function ie(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,n,o,i=Array.isArray(e),s=Array.isArray(t);if(i&&s){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!ie(e[r],t[r]))return!1;return!0}if(i!=s)return!1;var a=Object.keys(e);if((n=a.length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!t.hasOwnProperty(a[r]))return!1;for(r=n;0!=r--;)if(!ie(e[o=a[r]],t[o]))return!1;return!0}return e!=e&&t!=t}var se=Object.freeze({__proto__:null,JsonPatchError:q,_areEquals:ie,applyOperation:te,applyPatch:re,applyReducer:function(e,t,r){var n=te(e,t);if(!1===n.test)throw new q("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument},deepClone:Q,getValueByPointer:ee,validate:oe,validator:ne}),ae=new WeakMap,ce=function(e){this.observers=new Map,this.obj=e},pe=function(e,t){this.callback=e,this.observer=t};
/*!
 * https://github.com/Starcounter-Jack/JSON-Patch
 * (c) 2017-2021 Joachim Wester
 * MIT license
 */function le(e,t){void 0===t&&(t=!1);var r=ae.get(e.object);ue(r.value,e.object,e.patches,"",t),e.patches.length&&re(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function ue(e,t,r,n,o){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var i=X(t),s=X(e),a=!1,c=s.length-1;c>=0;c--){var p=e[u=s[c]];if(!k(t,u)||void 0===t[u]&&void 0!==p&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+B(u),value:V(p)}),r.push({op:"remove",path:n+"/"+B(u)}),a=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}));else{var l=t[u];"object"==typeof p&&null!=p&&"object"==typeof l&&null!=l&&Array.isArray(p)===Array.isArray(l)?ue(p,l,r,n+"/"+B(u),o):p!==l&&(o&&r.push({op:"test",path:n+"/"+B(u),value:V(p)}),r.push({op:"replace",path:n+"/"+B(u),value:V(l)}))}}if(a||i.length!=s.length)for(c=0;c<i.length;c++){var u;k(e,u=i[c])||void 0===t[u]||r.push({op:"add",path:n+"/"+B(u),value:V(t[u])})}}}var he,fe,de,Ee,me=Object.freeze({__proto__:null,compare:function(e,t,r){void 0===r&&(r=!1);var n=[];return ue(e,t,n,"",r),n},generate:le,observe:function(e,t){var r,n=function(e){return ae.get(e)}(e);if(n){var o=function(e,t){return e.observers.get(t)}(n,t);r=o&&o.observer}else n=new ce(e),ae.set(e,n);if(r)return r;if(r={},n.value=V(e),t){r.callback=t,r.next=null;var i=function(){le(r)},s=function(){clearTimeout(r.next),r.next=setTimeout(i)};"undefined"!=typeof window&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return r.patches=[],r.object=e,r.unobserve=function(){le(r),clearTimeout(r.next),function(e,t){e.observers.delete(t.callback)}(n,r),"undefined"!=typeof window&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},n.observers.set(t,new pe(t,r)),r},unobserve:function(e,t){t.unobserve()}});function ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ge(){if(Ee)return de;Ee=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return de=r=>r?"object"!=typeof r?e:r:t}Object.assign({},se,me,{JsonPatchError:Y,deepClone:V,escapePathComponent:B,unescapePathComponent:z});var we,Oe,Ie,Re,$e,Ae,Ne,Le,Te,ye,be,Se,_e,Pe,xe,De,Ce,Fe,Me,je,Ge,Ue,ke,Xe,Ve,He,Be,ze,We,Je,Ye,qe={exports:{}};function Qe(){if(Oe)return we;Oe=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return we={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function Ke(){if(Re)return Ie;Re=1;const e=j.env&&j.env.NODE_DEBUG&&/\bsemver\b/i.test(j.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return Ie=e}function Ze(){return $e||($e=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=Qe(),i=Ke(),s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],p=t.safeSrc=[],l=t.t={};let u=0;const h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",o],[h,n]],d=(e,t,r)=>{const n=(e=>{for(const[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),o=u++;i(e,o,t),l[e]=o,c[o]=t,p[o]=n,s[o]=new RegExp(t,r?"g":void 0),a[o]=new RegExp(n,r?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),d("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${h}+`),d("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),d("FULL",`^${c[l.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),d("LOOSE",`^${c[l.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),d("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),d("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),d("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),d("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?`+`(?:${c[l.BUILD]})?(?:$|[^\\d])`),d("COERCERTL",c[l.COERCE],!0),d("COERCERTLFULL",c[l.COERCEFULL],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(qe,qe.exports)),qe.exports}function et(){if(Te)return Le;Te=1;const e=Ke(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Qe(),{safeRe:n,t:o}=Ze(),i=ge(),{compareIdentifiers:s}=function(){if(Ne)return Ae;Ne=1;const e=/^[0-9]+$/,t=(t,r)=>{const n=e.test(t),o=e.test(r);return n&&o&&(t=+t,r=+r),t===r?0:n&&!o?-1:o&&!n?1:t<r?-1:1};return Ae={compareIdentifiers:t,rcompareIdentifiers:(e,r)=>t(r,e)}}();class a{constructor(s,c){if(c=i(c),s instanceof a){if(s.loose===!!c.loose&&s.includePrerelease===!!c.includePrerelease)return s;s=s.version}else if("string"!=typeof s)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",s,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const p=s.trim().match(c.loose?n[o.LOOSE]:n[o.FULL]);if(!p)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+p[1],this.minor=+p[2],this.patch=+p[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");p[4]?this.prerelease=p[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<r)return t}return e})):this.prerelease=[],this.build=p[5]?p[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof a)){if("string"==typeof t&&t===this.version)return 0;t=new a(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof a||(e=new a(e,this.options)),s(this.major,e.major)||s(this.minor,e.minor)||s(this.patch,e.patch)}comparePre(t){if(t instanceof a||(t=new a(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],o=t.prerelease[r];if(e("prerelease compare",r,n,o),void 0===n&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===n)return-1;if(n!==o)return s(n,o)}while(++r)}compareBuild(t){t instanceof a||(t=new a(t,this.options));let r=0;do{const n=this.build[r],o=t.build[r];if(e("build compare",r,n,o),void 0===n&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===n)return-1;if(n!==o)return s(n,o)}while(++r)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?n[o.PRERELEASELOOSE]:n[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===s(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Le=a}function tt(){if(be)return ye;be=1;const e=et();return ye=(t,r,n)=>new e(t,n).compare(new e(r,n))}function rt(){if(Ve)return Xe;Ve=1;const e=function(){if(_e)return Se;_e=1;const e=tt();return Se=(t,r,n)=>0===e(t,r,n)}(),t=function(){if(xe)return Pe;xe=1;const e=tt();return Pe=(t,r,n)=>0!==e(t,r,n)}(),r=function(){if(Ce)return De;Ce=1;const e=tt();return De=(t,r,n)=>e(t,r,n)>0}(),n=function(){if(Me)return Fe;Me=1;const e=tt();return Fe=(t,r,n)=>e(t,r,n)>=0}(),o=function(){if(Ge)return je;Ge=1;const e=tt();return je=(t,r,n)=>e(t,r,n)<0}(),i=function(){if(ke)return Ue;ke=1;const e=tt();return Ue=(t,r,n)=>e(t,r,n)<=0}();return Xe=(s,a,c,p)=>{switch(a){case"===":return"object"==typeof s&&(s=s.version),"object"==typeof c&&(c=c.version),s===c;case"!==":return"object"==typeof s&&(s=s.version),"object"==typeof c&&(c=c.version),s!==c;case"":case"=":case"==":return e(s,c,p);case"!=":return t(s,c,p);case">":return r(s,c,p);case">=":return n(s,c,p);case"<":return o(s,c,p);case"<=":return i(s,c,p);default:throw new TypeError(`Invalid operator: ${a}`)}}}function nt(){if(We)return ze;We=1;const e=/\s+/g;class t{constructor(r,i){if(i=n(i),r instanceof t)return r.loose===!!i.loose&&r.includePrerelease===!!i.includePrerelease?r:new t(r.raw,i);if(r instanceof o)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=r.trim().replace(e," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!d(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&E(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&h)|(this.options.loose&&f))+":"+e,n=r.get(t);if(n)return n;const s=this.options.loose,E=s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(E,T(this.options.includePrerelease)),i("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],p),i("comparator trim",e),e=e.replace(a[c.TILDETRIM],l),i("tilde trim",e),e=e.replace(a[c.CARETTRIM],u),i("caret trim",e);let m=e.split(" ").map((e=>v(e,this.options))).join(" ").split(/\s+/).map((e=>L(e,this.options)));s&&(m=m.filter((e=>(i("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE]))))),i("range list",m);const g=new Map,w=m.map((e=>new o(e,this.options)));for(const e of w){if(d(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const O=[...g.values()];return r.set(t,O),O}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>m(t,r)&&e.set.some((e=>m(e,r)&&t.every((t=>e.every((e=>t.intersects(e,r)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(y(this.set[t],e,this.options))return!0;return!1}}ze=t;const r=new(fe?he:(fe=1,he=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}})),n=ge(),o=function(){if(Be)return He;Be=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(n,o){if(o=r(o),n instanceof t){if(n.loose===!!o.loose)return n;n=n.value}n=n.trim().split(/\s+/).join(" "),s("comparator",n,o),this.options=o,this.loose=!!o.loose,this.parse(n),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const r=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],i=t.match(r);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==i[1]?i[1]:"","="===this.operator&&(this.operator=""),i[2]?this.semver=new a(i[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(e){return!1}return i(t,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,n).test(this.value):""===e.operator?""===e.value||new c(this.value,n).test(e.semver):!((n=r(n)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(i(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(i(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}He=t;const r=ge(),{safeRe:n,t:o}=Ze(),i=rt(),s=Ke(),a=et(),c=nt();return He}(),i=Ke(),s=et(),{safeRe:a,t:c,comparatorTrimReplace:p,tildeTrimReplace:l,caretTrimReplace:u}=Ze(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:f}=Qe(),d=e=>"<0.0.0-0"===e.value,E=e=>""===e.value,m=(e,t)=>{let r=!0;const n=e.slice();let o=n.pop();for(;r&&n.length;)r=n.every((e=>o.intersects(e,t))),o=n.pop();return r},v=(e,t)=>(i("comp",e,t),e=I(e,t),i("caret",e),e=w(e,t),i("tildes",e),e=$(e,t),i("xrange",e),e=N(e,t),i("stars",e),e),g=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,t)=>e.trim().split(/\s+/).map((e=>O(e,t))).join(" "),O=(e,t)=>{const r=t.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(r,((t,r,n,o,s)=>{let a;return i("tilde",e,t,r,n,o,s),g(r)?a="":g(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:g(o)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:s?(i("replaceTilde pr",s),a=`>=${r}.${n}.${o}-${s} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${o} <${r}.${+n+1}.0-0`,i("tilde return",a),a}))},I=(e,t)=>e.trim().split(/\s+/).map((e=>R(e,t))).join(" "),R=(e,t)=>{i("caret",e,t);const r=t.loose?a[c.CARETLOOSE]:a[c.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,o,s,a)=>{let c;return i("caret",e,t,r,o,s,a),g(r)?c="":g(o)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:g(s)?c="0"===r?`>=${r}.${o}.0${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.0${n} <${+r+1}.0.0-0`:a?(i("replaceCaret pr",a),c="0"===r?"0"===o?`>=${r}.${o}.${s}-${a} <${r}.${o}.${+s+1}-0`:`>=${r}.${o}.${s}-${a} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${s}-${a} <${+r+1}.0.0-0`):(i("no pr"),c="0"===r?"0"===o?`>=${r}.${o}.${s}${n} <${r}.${o}.${+s+1}-0`:`>=${r}.${o}.${s}${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${s} <${+r+1}.0.0-0`),i("caret return",c),c}))},$=(e,t)=>(i("replaceXRanges",e,t),e.split(/\s+/).map((e=>A(e,t))).join(" ")),A=(e,t)=>{e=e.trim();const r=t.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(r,((r,n,o,s,a,c)=>{i("xRange",e,r,n,o,s,a,c);const p=g(o),l=p||g(s),u=l||g(a),h=u;return"="===n&&h&&(n=""),c=t.includePrerelease?"-0":"",p?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(l&&(s=0),a=0,">"===n?(n=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):"<="===n&&(n="<",l?o=+o+1:s=+s+1),"<"===n&&(c="-0"),r=`${n+o}.${s}.${a}${c}`):l?r=`>=${o}.0.0${c} <${+o+1}.0.0-0`:u&&(r=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),i("xRange return",r),r}))},N=(e,t)=>(i("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),L=(e,t)=>(i("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),T=e=>(t,r,n,o,i,s,a,c,p,l,u,h)=>`${r=g(n)?"":g(o)?`>=${n}.0.0${e?"-0":""}`:g(i)?`>=${n}.${o}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=g(p)?"":g(l)?`<${+p+1}.0.0-0`:g(u)?`<${p}.${+l+1}.0-0`:h?`<=${p}.${l}.${u}-${h}`:e?`<${p}.${l}.${+u+1}-0`:`<=${c}`}`.trim(),y=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(i(e[r].semver),e[r].semver!==o.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0};return ze}var ot=function(){if(Ye)return Je;Ye=1;const e=nt();return Je=(t,r,n)=>{try{r=new e(r,n)}catch(e){return!1}return r.test(t)},Je}(),it=ve(ot);var st='.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 at(e,...t){for(const r of t)ct(e,r);return e}function ct(e,t){for(const r of Object.keys(t))a(e,r,t[r],!0)}const pt="7.1.0",lt=t;let ut=p;const ht="undefined"!=typeof window?window:void 0;void 0===ut&&ht?.vl?.compile&&(ut=ht.vl);const ft={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},dt={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"},Et={vega:"Vega","vega-lite":"Vega-Lite"},mt={vega:lt.version,"vega-lite":ut?ut.version:"not available"},vt={vega:e=>e,"vega-lite":(e,t,r)=>ut.compile(e,{config:r,logger:t}).spec},gt='\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>',wt="chart-wrapper";function Ot(e,t,r,n){const o=`<html><head>${t}</head><body><pre><code class="json">`,i=`</code></pre>${r}</body></html>`,s=window.open("");s.document.write(o+e+i),s.document.title=`${Et[n]} JSON Source`}function It(e,t,r){if(e.$schema){const n=l(e.$schema);r&&r!==n.library&&t.warn(`The given visualization spec is written in ${Et[n.library]}, but mode argument sets ${Et[r]??r}.`);const o=n.library;return it(mt[o],`^${n.version.slice(1)}`)||t.warn(`The input spec uses ${Et[o]} ${n.version}, but the current version of ${Et[o]} is v${mt[o]}.`),o}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":r??"vega"}function Rt(e){return!(!e||!("load"in e))}function $t(e){return Rt(e)?e:lt.loader(e)}async function At(t,a,p={}){let f,d;r(a)?(d=$t(p.loader),f=JSON.parse(await d.load(a))):f=a;const E=function(e){const t=e.usermeta?.embedOptions??{};return r(t.defaultStyle)&&(t.defaultStyle=!1),t}(f),m=E.loader;d&&!m||(d=$t(p.loader??m));const v=await Nt(E,d),g=await Nt(p,d),w={...at(g,v),config:n(g.config??{},v.config??{})};return await async function(t,r,a={},p){const f=a.theme?n(u[a.theme],a.config??{}):a.config,d=o(a.actions)?a.actions:at({},ft,a.actions??{}),E={...dt,...a.i18n},m=a.renderer??"svg",v=a.logger??i(lt.Warn);void 0!==a.logLevel&&v.level(a.logLevel);const g=a.downloadFileName??"visualization",w="string"==typeof t?document.querySelector(t):t;if(!w)throw new Error(`${t} does not exist`);if(!1!==a.defaultStyle){const e="vega-embed-style",{root:t,rootContainer:r}=function(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}(w);if(!t.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerHTML=void 0===a.defaultStyle||!0===a.defaultStyle?st.toString():a.defaultStyle,r.appendChild(t)}}const O=It(r,v,a.mode);let I=vt[O](r,v,f);if("vega-lite"===O&&I.$schema){const e=l(I.$schema);it(mt.vega,`^${e.version.slice(1)}`)||v.warn(`The compiled spec uses Vega ${e.version}, but current version is v${mt.vega}.`)}w.classList.add("vega-embed"),d&&w.classList.add("has-actions");w.innerHTML="";let R=w;if(d){const e=document.createElement("div");e.classList.add(wt),w.appendChild(e),R=e}const $=a.patch;$&&(I=$ instanceof Function?$(I):re(I,$,!0,!1).newDocument);a.formatLocale&&lt.formatLocale(a.formatLocale);a.timeFormatLocale&&lt.timeFormatLocale(a.timeFormatLocale);if(a.expressionFunctions)for(const e in a.expressionFunctions){const t=a.expressionFunctions[e];"fn"in t?lt.expressionFunction(e,t.fn,t.visitor):t instanceof Function&&lt.expressionFunction(e,t)}const{ast:A}=a,N=lt.parse(I,"vega-lite"===O?{}:f,{ast:A}),L=new(a.viewClass||lt.View)(N,{loader:p,logger:v,renderer:m,...A?{expr:lt.expressionInterpreter??a.expr??c}:{}});if(L.addSignalListener("autosize",((e,t)=>{const{type:r}=t;"fit-x"==r?(R.classList.add("fit-x"),R.classList.remove("fit-y")):"fit-y"==r?(R.classList.remove("fit-x"),R.classList.add("fit-y")):"fit"==r?R.classList.add("fit-x","fit-y"):R.classList.remove("fit-x","fit-y")})),!1!==a.tooltip){const{loader:e,tooltip:t}=a,r=e&&!Rt(e)?e?.baseURL:void 0,n="function"==typeof t?t:new h({baseURL:r,...!0===t?{}:t}).call;L.tooltip(n)}let T,{hover:y}=a;void 0===y&&(y="vega"===O);if(y){const{hoverSet:e,updateSet:t}="boolean"==typeof y?{}:y;L.hover(e,t)}a&&(null!=a.width&&L.width(a.width),null!=a.height&&L.height(a.height),null!=a.padding&&L.padding(a.padding));if(await L.initialize(R,a.bind).runAsync(),!1!==d){let t=w;if(!1!==a.defaultStyle||a.forceActionsMenu){const e=document.createElement("details");e.title=E.CLICK_TO_VIEW_ACTIONS,w.append(e),t=e;const r=document.createElement("summary");r.innerHTML=gt,e.append(r),T=t=>{e.contains(t.target)||e.removeAttribute("open")},document.addEventListener("click",T)}const n=document.createElement("div");if(t.append(n),n.classList.add("vega-actions"),!0===d||!1!==d.export)for(const e of["svg","png"])if(!0===d||!0===d.export||d.export[e]){const t=E[`${e.toUpperCase()}_ACTION`],r=document.createElement("a"),o=s(a.scaleFactor)?a.scaleFactor[e]:a.scaleFactor;r.text=t,r.href="#",r.target="_blank",r.download=`${g}.${e}`,r.addEventListener("mousedown",(async function(t){t.preventDefault();const r=await L.toImageURL(e,o);this.href=r})),n.append(r)}if(!0===d||!1!==d.source){const t=document.createElement("a");t.text=E.SOURCE_ACTION,t.href="#",t.addEventListener("click",(function(t){Ot(e(r),a.sourceHeader??"",a.sourceFooter??"",O),t.preventDefault()})),n.append(t)}if("vega-lite"===O&&(!0===d||!1!==d.compiled)){const t=document.createElement("a");t.text=E.COMPILED_ACTION,t.href="#",t.addEventListener("click",(function(t){Ot(e(I),a.sourceHeader??"",a.sourceFooter??"","vega"),t.preventDefault()})),n.append(t)}if(!0===d||!1!==d.editor){const t=a.editorUrl??"https://vega.github.io/editor/",o=document.createElement("a");o.text=E.EDITOR_ACTION,o.href="#",o.addEventListener("click",(function(n){!function(e,t,r){const n=e.open(t),{origin:o}=new URL(t);let i=40;e.addEventListener("message",(function t(r){r.source===n&&(i=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){i<=0||(n.postMessage(r,o),setTimeout(e,250),i-=1)}),250)}(window,t,{config:f,mode:$?"vega":O,renderer:m,spec:e($?I:r)}),n.preventDefault()})),n.append(o)}}function b(){T&&document.removeEventListener("click",T),L.finalize()}return{view:L,spec:r,vgSpec:I,finalize:b,embedOptions:a}}(t,f,w,d)}async function Nt(e,t){const n=r(e.config)?JSON.parse(await t.load(e.config)):e.config??{},o=r(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...o?{patch:o}:{},...n?{config:n}:{}}}export{ft as DEFAULT_ACTIONS,At as default,It as guessMode,lt as vega,ut as vegaLite,pt as version};
//# sourceMappingURL=/sm/653675dfeefa61ae79decb87ba4e7ae413bdf55fe400dc8813e6b27656a161c8.map