@milaboratories/graph-maker 1.1.91 → 1.1.93
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.
- package/dist/graph-maker.js +17 -14
- package/dist/graph-maker.umd.cjs +4 -4
- package/package.json +2 -2
package/dist/graph-maker.umd.cjs
CHANGED
|
@@ -33,7 +33,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
33
33
|
<rect x="3" y="3" width="18" height="18" rx="2" fill="#110529"/>
|
|
34
34
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.5431 8.51724L10.3333 16.0875L6.45691 12.0172L7.54312 10.9828L10.3333 13.9125L16.4569 7.48276L17.5431 8.51724Z" fill="white"/>
|
|
35
35
|
</svg>
|
|
36
|
-
`,dse=["innerHTML"],Ase={class:"dropdown-list-item__title-container"},pse={class:"dropdown-list-item__title text-s"},hse={key:0,class:"dropdown-list-item__description text-description"},mse={key:1,class:"dropdown-list-item__icon flex-self-start"},vse=d.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(e){const t=e,n=d.computed(()=>{const i=[];return t.size==="small"&&i.push("dropdown-list-item__small"),t.isSelected&&i.push("dropdown-list-item__selected"),t.isHovered&&i.push("hovered-item"),i.join(" ")}),r=d.computed(()=>{const i=["dropdown-list-item__checkbox","flex-self-start"];return t.isSelected&&i.push("checked"),i.join(" ")}),a=d.computed(()=>t.isSelected?fse:cse);return(i,o)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass([n.value,"dropdown-list-item"])},[t.useCheckbox?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(r.value),innerHTML:a.value},null,10,dse)):d.createCommentVNode("",!0),o[1]||(o[1]=d.createTextVNode()),d.createElementVNode("div",Ase,[d.createElementVNode("div",pse,d.toDisplayString(i.option.label),1),o[0]||(o[0]=d.createTextVNode()),i.option.description?(d.openBlock(),d.createElementBlock("div",hse,d.toDisplayString(i.option.description),1)):d.createCommentVNode("",!0)]),o[2]||(o[2]=d.createTextVNode()),!t.useCheckbox&&t.isSelected?(d.openBlock(),d.createElementBlock("div",mse)):d.createCommentVNode("",!0)],2))}});function gse(e){return e()}function yse(e){let t=!1;return function(...n){t||(requestAnimationFrame(()=>{e(...n),t=!1}),t=!0)}}function wse(e){return new Promise(t=>setTimeout(t,e))}function Cse(e,t){const n=setTimeout(e,t);return()=>{clearTimeout(n)}}function bse(e){return function(t){return 1-e(1-t)}}function Ese(e){const{duration:t,draw:n,timing:r}=e,a=performance.now();let i=!1;return requestAnimationFrame(function o(s){let c=(s-a)/t;(c>1||i)&&(c=1);const f=r(c);n(f),c<1&&requestAnimationFrame(o)}),function(){i=!0}}function xse(e,t,n=!0){let r=0,a;return function(...i){a=()=>{e.apply(this,i),r=new Date().getTime()+t,a=null,n&&setTimeout(()=>{a==null||a()},t)},new Date().getTime()>r&&a()}}function GR(e){if(!Array.isArray(e))throw Error("Invalid component options: "+String(e));return e.map(t=>({label:"label"in t?t.label:t.text,value:t.value,description:t.description}))}function YR(e,t){const n=yse(()=>{if(e.value){const{scrollTop:r,scrollLeft:a,scrollHeight:i,scrollWidth:o,clientHeight:s,clientWidth:c}=document.documentElement,f=e.value.getBoundingClientRect();t({scrollTop:r,scrollLeft:a,scrollHeight:i,scrollWidth:o,clientHeight:s,clientWidth:c,offsetY:r+f.y,offsetX:a+f.x,top:f.top,right:f.right,bottom:f.bottom,left:f.left,width:f.width,height:f.height,x:f.x,y:f.y})}});d.onMounted(n),IC(window,"scroll",n,{capture:!0,passive:!0}),IC(window,"resize",n,{passive:!0}),IC(window,"adjust",n,!0)}const Sse=d.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(e){const t=e,n=d.computed(()=>t.size==="large"?"--mask-size: 24px":""),r=d.computed(()=>`mask-16 mask-${t.name}`);return(a,i)=>(d.openBlock(),d.createElementBlock("i",{style:d.normalizeStyle(n.value),class:d.normalizeClass([r.value,a.$style.icon])},null,6))}}),Bse="_icon_1ugxm_2",kse={icon:Bse},Tse={$style:kse},WR=J5(Sse,[["__cssModules",Tse]]),_se=d.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(e){const t=e,n=d.computed(()=>`mask-24 mask-${t.name}`);return(r,a)=>(d.openBlock(),d.createElementBlock("i",{class:d.normalizeClass([n.value,r.$style.icon])},null,2))}}),Pse="_icon_1ugxm_2",Mse={icon:Pse},Dse={$style:Mse},Hse=J5(_se,[["__cssModules",Dse]]);function Ise(e,t){const n=d.ref();return YR(e,r=>{n.value=r}),d.computed(()=>{const r=d.unref(n),a=d.unref(t),i=a.position??"top",o=a.gap??8;if(!r)return"";const s=r.offsetY+Math.floor(r.height/2),c=r.offsetX+Math.floor(r.width/2);return i==="top-left"?`left: ${r.offsetX}px; top: ${r.offsetY-o}px;`:i==="top"?`left: ${c}px; top: ${r.offsetY-o}px;`:i==="right"?`left: ${r.offsetX+r.width+o}px; top: ${s}px;`:i==="left"?`right: ${r.scrollWidth-r.x+o}px; top: ${s}px;`:i==="southwest"?`left: ${r.offsetX+r.width}px; top: ${r.offsetY+r.height+o}px;`:""})}function XR(e,t){return t(e)}function KR(e,t){if(e!=null)return t(e)}function Lse(e){return Array.isArray(e)?e:[e]}function Rse(e,t){IC(document,"click",n=>{document.contains(n.target)&&(Lse(e).map(r=>r.value).filter(r=>!!r).some(r=>r==null?void 0:r.contains(n.target))||t())})}const Nse={},$se={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Fse(e,t){return d.openBlock(),d.createElementBlock("svg",$se,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const Vse=J5(Nse,[["render",Fse]]),LS=new Map,Ose={name:"PlTooltip"},Qse=d.defineComponent({...Ose,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"},maxWidth:{default:"300px"}},emits:["tooltip:close"],setup(e,{emit:t}){const n=t,r=Symbol(),a=e,i=d.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});LS.set(r,()=>f()),d.watch(()=>i.open,x=>{requestAnimationFrame(()=>{i.tooltipOpen=x})});let o=()=>{};const s=xse(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),c=()=>{i.open=!0;for(const[x,k]of LS.entries())x!==r&&k()},f=()=>{i.open=!1,n("tooltip:close")},A=async()=>{a.hide||(s(),i.over=!0,o(),await wse(100),i.over&&c())},h=()=>{i.over=!1,o=Cse(()=>{i.over||f()},a.closeDelay)};d.watch(()=>a.hide,x=>{x&&f()});const m=d.ref(),g=d.ref(),b=Ise(m,d.toRef(a));Rse([m,g],()=>f());const C=d.computed(()=>({"--pl-tooltip-max-width":a.maxWidth}));return d.onUnmounted(()=>{LS.delete(r)}),(x,k)=>(d.openBlock(),d.createBlock(d.resolveDynamicComponent(x.element),d.mergeProps(x.$attrs,{ref_key:"rootRef",ref:m,onClick:A,onMouseover:A,onMouseleave:h}),{default:d.withCtx(()=>[d.renderSlot(x.$slots,"default"),k[1]||(k[1]=d.createTextVNode()),x.$slots.tooltip&&i.open?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:"body"},[d.createVNode(d.Transition,{name:"tooltip-transition"},{default:d.withCtx(()=>[i.tooltipOpen?(d.openBlock(),d.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:d.normalizeStyle(d.unref(b))},[d.createElementVNode("div",{ref_key:"tooltip",ref:g,class:d.normalizeClass(["pl-tooltip",x.position]),style:d.normalizeStyle(C.value),onMouseover:A,onMouseleave:h},[d.createElementVNode("div",null,[d.renderSlot(x.$slots,"tooltip")]),k[0]||(k[0]=d.createTextVNode()),d.createVNode(Vse)],38)],4)):d.createCommentVNode("",!0)]),_:3})])):d.createCommentVNode("",!0)]),_:3},16))}}),zse={inheritAttrs:!1},Use={class:"double-contour"};function jse(e,t,n,r,a,i){return d.openBlock(),d.createElementBlock("div",Use,[d.createElementVNode("div",d.normalizeProps(d.guardReactiveProps(e.$attrs)),[d.renderSlot(e.$slots,"default")],16)])}const Gse=J5(zse,[["render",jse]]);function Yse(e){d.onMounted(e),d.onUpdated(e)}const RS=new WeakMap,NS=new ResizeObserver(e=>{for(const t of e)KR(RS.get(t.target),n=>n(t))});function Wse(e,t){RS.set(e,t),NS.unobserve(e),NS.observe(e)}function Xse(e){NS.unobserve(e),RS.delete(e)}const Kse=8,ZR=4;function Zse(e,t="label"){const n=new Set;Yse(()=>{KR(e==null?void 0:e.value,r=>{const a=r.querySelector(t);a&&(n.add(a),Wse(a,()=>{const i=gse(()=>a.getBoundingClientRect().width+XR(Kse,o=>Number.isNaN(o)?ZR:o+ZR));r.style.getPropertyValue("--label-offset-right-x")!==`${i}px`&&r.style.setProperty("--label-offset-right-x",`${i}px`)}))})}),d.onBeforeUnmount(()=>{Array.from(n.values()).map(r=>Xse(r))})}const Jse=d.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(e){const t=e,n=d.computed(()=>t.size==="large"?"--icon-size: 24px":""),r=d.computed(()=>`icon-16 icon-${t.name}`);return(a,i)=>(d.openBlock(),d.createElementBlock("i",{style:d.normalizeStyle(n.value),class:d.normalizeClass([r.value,a.$style.icon])},null,6))}}),qse="_icon_1ugxm_2",eue={icon:qse},tue={$style:eue},q5=J5(Jse,[["__cssModules",tue]]);function JR(e){return e!==null&&typeof e=="object"}function Ky(e,t){return JR(e)&&JR(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(n=>Ky(e[n],t[n])):e===t}const nue=d.defineComponent({__name:"LongText",setup(e){d.useCssVars(A=>({"5deba9de":o.value}));const t=d.ref(!1),n=d.ref(),r=d.ref(!1),a=d.computed(()=>r.value&&t.value?"ui-lt-animate":""),i=tse(A=>r.value=A,500),o=d.computed(()=>{var A;return n.value?`${((A=n.value)==null?void 0:A.innerHTML.length)*.4}s`:"5s"});function s(){const A=jR(n.value,"span cannot be empty");t.value=A.clientWidth<A.scrollWidth}function c(){s(),i(!0)}function f(){i(!1)}return(A,h)=>(d.openBlock(),d.createElementBlock("div",d.mergeProps(A.$attrs,{class:"ui-lt-container"}),[d.createElementVNode("span",{onMouseover:c,onMouseleave:f},[d.createElementVNode("span",{ref_key:"span",ref:n,class:d.normalizeClass(a.value)},[d.renderSlot(A.$slots,"default")],2)],32)],16))}});function rue(e,t){const n=e.scrollTop,r=e.getBoundingClientRect().height,a=t.offsetTop,i=t.getBoundingClientRect().height;return a+i<r+n&&a>n}function aue(e,t){const n=e.scrollTop,r=e.getBoundingClientRect().height,a=t.offsetTop,i=t.getBoundingClientRect().height;return a+i<r+n?"ceil":a>n?"floor":"visible"}function iue(e,t,n={}){const r=e.scrollTop,a=e.getBoundingClientRect().height,i=t.getBoundingClientRect().height,o=t.offsetTop,s=aue(e,t);if(s==="visible")return;const c=f=>{const A=s==="floor"?o-(a-i):o;e.scrollTop=r+f*(A-r)};rue(e,t)||Ese({duration:n.duration||100,timing:bse(f=>f),draw:c})}const oue=d.defineComponent({__name:"DropdownOverlay",props:{root:{},gap:{}},setup(e,{expose:t}){const n=e,r=d.reactive({optionsHeight:0}),a=d.reactive({top:"0px",left:"0px",width:"0px"}),i=d.toRef(n,"root"),o=d.ref();return t({scrollIntoActive:()=>{const s=o.value;s&&ese(s.querySelector(".hovered-item"),c=>{iue(s,c)})},listRef:o}),d.watch(o,s=>{s&&requestAnimationFrame(()=>{const c=s.getBoundingClientRect();r.optionsHeight=c.height,window.dispatchEvent(new CustomEvent("adjust"))})}),YR(i,s=>{const c=document.body.getBoundingClientRect(),f=s.top-c.top,A=s.left-c.left,h=n.gap??0,m=f+s.height+h;m+r.optionsHeight>s.clientHeight?a.top=f-r.optionsHeight-h+"px":a.top=m+"px",a.left=A+"px",a.width=s.width+"px"}),(s,c)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createElementVNode("div",d.mergeProps({ref_key:"listRef",ref:o},s.$attrs,{style:a,tabindex:"-1"}),[d.renderSlot(s.$slots,"default",{ref:"list"})],16)]))}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const qR=()=>{};function lue(e,t){function n(...r){return new Promise((a,i)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(a).catch(i)})}return n}function sue(e,t={}){let n,r,a=qR;const i=o=>{clearTimeout(o),a(),a=qR};return o=>{const s=d.toValue(e),c=d.toValue(t.maxWait);return n&&i(n),s<=0||c!==void 0&&c<=0?(r&&(i(r),r=null),Promise.resolve(o())):new Promise((f,A)=>{a=t.rejectOnCancel?A:f,c&&!r&&(r=setTimeout(()=>{n&&i(n),r=null,f(o())},c)),n=setTimeout(()=>{r&&i(r),r=null,f(o())},s)})}}function uue(e,t=200,n={}){return lue(sue(t,n),e)}function cue(e,t=200,n={}){const r=d.ref(e.value),a=uue(()=>{r.value=e.value},t,n);return d.watch(e,()=>a()),r}var Oi;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Oi||(Oi={}));var $S;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})($S||($S={}));const Nn=Oi.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rm=e=>{switch(typeof e){case"undefined":return Nn.undefined;case"string":return Nn.string;case"number":return isNaN(e)?Nn.nan:Nn.number;case"boolean":return Nn.boolean;case"function":return Nn.function;case"bigint":return Nn.bigint;case"symbol":return Nn.symbol;case"object":return Array.isArray(e)?Nn.array:e===null?Nn.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Nn.promise:typeof Map<"u"&&e instanceof Map?Nn.map:typeof Set<"u"&&e instanceof Set?Nn.set:typeof Date<"u"&&e instanceof Date?Nn.date:Nn.object;default:return Nn.unknown}},an=Oi.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),fue=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");let Rp=class Nee extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(i){return i.message},r={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let s=r,c=0;for(;c<o.path.length;){const f=o.path[c];c===o.path.length-1?(s[f]=s[f]||{_errors:[]},s[f]._errors.push(n(o))):s[f]=s[f]||{_errors:[]},s=s[f],c++}}};return a(this),r}static assert(t){if(!(t instanceof Nee))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oi.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Rp.create=e=>new Rp(e);const Zy=(e,t)=>{let n;switch(e.code){case an.invalid_type:e.received===Nn.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case an.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Oi.jsonStringifyReplacer)}`;break;case an.unrecognized_keys:n=`Unrecognized key(s) in object: ${Oi.joinValues(e.keys,", ")}`;break;case an.invalid_union:n="Invalid input";break;case an.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Oi.joinValues(e.options)}`;break;case an.invalid_enum_value:n=`Invalid enum value. Expected ${Oi.joinValues(e.options)}, received '${e.received}'`;break;case an.invalid_arguments:n="Invalid function arguments";break;case an.invalid_return_type:n="Invalid function return type";break;case an.invalid_date:n="Invalid date";break;case an.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Oi.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case an.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case an.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case an.custom:n="Invalid input";break;case an.invalid_intersection_types:n="Intersection results could not be merged";break;case an.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case an.not_finite:n="Number must be finite";break;default:n=t.defaultError,Oi.assertNever(e)}return{message:n}};let eN=Zy;function due(e){eN=e}function LC(){return eN}const RC=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const c=r.filter(f=>!!f).slice().reverse();for(const f of c)s=f(o,{data:t,defaultError:s}).message;return{...a,path:i,message:s}},Aue=[];function Mn(e,t){const n=LC(),r=RC({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Zy?void 0:Zy].filter(a=>!!a)});e.common.issues.push(r)}class ff{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return Aa;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const i=await a.key,o=await a.value;r.push({key:i,value:o})}return ff.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return Aa;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(r[i.value]=o.value)}return{status:t.value,value:r}}}const Aa=Object.freeze({status:"aborted"}),NC=e=>({status:"dirty",value:e}),Of=e=>({status:"valid",value:e}),FS=e=>e.status==="aborted",VS=e=>e.status==="dirty",e7=e=>e.status==="valid",t7=e=>typeof Promise<"u"&&e instanceof Promise;function $C(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function tN(e,t,n,r,a){if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var vr;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(vr||(vr={}));var n7,r7;let L0=class{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const nN=(e,t)=>{if(e7(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Rp(e.common.issues);return this._error=n,this._error}}};function Ha(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(i,o)=>{var s,c;const{message:f}=e;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:(s=f??r)!==null&&s!==void 0?s:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(c=f??n)!==null&&c!==void 0?c:o.defaultError}},description:a}}let Ka=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return rm(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:rm(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ff,ctx:{common:t.parent.common,data:t.data,parsedType:rm(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(t7(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const a={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:rm(t)},i=this._parseSync({data:t,path:a.path,parent:a});return nN(a,i)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:rm(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(t7(a)?a:Promise.resolve(a));return nN(r,i)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const o=t(a),s=()=>i.addIssue({code:an.custom,...r(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new $p({schema:this,typeName:ta.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return R0.create(this,this._def)}nullable(){return lm.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Uv.create(this,this._def)}promise(){return t3.create(this,this._def)}or(t){return u7.create([this,t],this._def)}and(t){return c7.create(this,t,this._def)}transform(t){return new $p({...Ha(this._def),schema:this,typeName:ta.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new h7({...Ha(this._def),innerType:this,defaultValue:n,typeName:ta.ZodDefault})}brand(){return new zS({typeName:ta.ZodBranded,type:this,...Ha(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new m7({...Ha(this._def),innerType:this,catchValue:n,typeName:ta.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return US.create(this,t)}readonly(){return v7.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const pue=/^c[^\s-]{8,}$/i,hue=/^[0-9a-z]+$/,mue=/^[0-9A-HJKMNP-TV-Z]{26}$/,vue=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,gue=/^[a-z0-9_-]{21}$/i,yue=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,wue=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cue="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let OS;const bue=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Eue=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,xue=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,rN="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Sue=new RegExp(`^${rN}$`);function aN(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Bue(e){return new RegExp(`^${aN(e)}$`)}function iN(e){let t=`${rN}T${aN(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function kue(e,t){return!!((t==="v4"||!t)&&bue.test(e)||(t==="v6"||!t)&&Eue.test(e))}class Np extends Ka{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Nn.string){const a=this._getOrReturnCtx(t);return Mn(a,{code:an.invalid_type,expected:Nn.string,received:a.parsedType}),Aa}const n=new ff;let r;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=t.data.length>a.value,o=t.data.length<a.value;(i||o)&&(r=this._getOrReturnCtx(t,r),i?Mn(r,{code:an.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&Mn(r,{code:an.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")wue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"email",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")OS||(OS=new RegExp(Cue,"u")),OS.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"emoji",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")vue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"uuid",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")gue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"nanoid",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")pue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"cuid",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")hue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"cuid2",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")mue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"ulid",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),Mn(r,{validation:"url",code:an.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"regex",code:an.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?iN(a).test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Sue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?Bue(a).test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?yue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"duration",code:an.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?kue(t.data,a.version)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"ip",code:an.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?xue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"base64",code:an.invalid_string,message:a.message}),n.dirty()):Oi.assertNever(a);return{status:n.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:an.invalid_string,...vr.errToObj(r)})}_addCheck(t){return new Np({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...vr.errToObj(t)})}url(t){return this._addCheck({kind:"url",...vr.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...vr.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...vr.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...vr.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...vr.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...vr.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...vr.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...vr.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...vr.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...vr.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...vr.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...vr.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...vr.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...vr.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...vr.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...vr.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...vr.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...vr.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...vr.errToObj(n)})}nonempty(t){return this.min(1,vr.errToObj(t))}trim(){return new Np({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Np({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Np({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Np.create=e=>{var t;return new Np({checks:[],typeName:ta.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ha(e)})};function Tue(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,i=parseInt(e.toFixed(a).replace(".","")),o=parseInt(t.toFixed(a).replace(".",""));return i%o/Math.pow(10,a)}let a7=class TI extends Ka{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Nn.number){const a=this._getOrReturnCtx(t);return Mn(a,{code:an.invalid_type,expected:Nn.number,received:a.parsedType}),Aa}let n;const r=new ff;for(const a of this._def.checks)a.kind==="int"?Oi.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="multipleOf"?Tue(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.not_finite,message:a.message}),r.dirty()):Oi.assertNever(a);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,vr.toString(n))}gt(t,n){return this.setLimit("min",t,!1,vr.toString(n))}lte(t,n){return this.setLimit("max",t,!0,vr.toString(n))}lt(t,n){return this.setLimit("max",t,!1,vr.toString(n))}setLimit(t,n,r,a){return new TI({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:vr.toString(a)}]})}_addCheck(t){return new TI({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:vr.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:vr.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:vr.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:vr.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:vr.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:vr.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:vr.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:vr.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:vr.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Oi.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};a7.create=e=>new a7({checks:[],typeName:ta.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ha(e)});class am extends Ka{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Nn.bigint){const a=this._getOrReturnCtx(t);return Mn(a,{code:an.invalid_type,expected:Nn.bigint,received:a.parsedType}),Aa}let n;const r=new ff;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):Oi.assertNever(a);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,vr.toString(n))}gt(t,n){return this.setLimit("min",t,!1,vr.toString(n))}lte(t,n){return this.setLimit("max",t,!0,vr.toString(n))}lt(t,n){return this.setLimit("max",t,!1,vr.toString(n))}setLimit(t,n,r,a){return new am({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:vr.toString(a)}]})}_addCheck(t){return new am({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:vr.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:vr.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:vr.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:vr.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:vr.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}am.create=e=>{var t;return new am({checks:[],typeName:ta.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ha(e)})};let i7=class extends Ka{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Nn.boolean){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.boolean,received:n.parsedType}),Aa}return Of(t.data)}};i7.create=e=>new i7({typeName:ta.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ha(e)});let o7=class $ee extends Ka{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Nn.date){const a=this._getOrReturnCtx(t);return Mn(a,{code:an.invalid_type,expected:Nn.date,received:a.parsedType}),Aa}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return Mn(a,{code:an.invalid_date}),Aa}const n=new ff;let r;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Oi.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new $ee({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:vr.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:vr.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};o7.create=e=>new o7({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ta.ZodDate,...Ha(e)});let FC=class extends Ka{_parse(t){if(this._getType(t)!==Nn.symbol){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.symbol,received:n.parsedType}),Aa}return Of(t.data)}};FC.create=e=>new FC({typeName:ta.ZodSymbol,...Ha(e)});class l7 extends Ka{_parse(t){if(this._getType(t)!==Nn.undefined){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.undefined,received:n.parsedType}),Aa}return Of(t.data)}}l7.create=e=>new l7({typeName:ta.ZodUndefined,...Ha(e)});class s7 extends Ka{_parse(t){if(this._getType(t)!==Nn.null){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.null,received:n.parsedType}),Aa}return Of(t.data)}}s7.create=e=>new s7({typeName:ta.ZodNull,...Ha(e)});let Jy=class extends Ka{constructor(){super(...arguments),this._any=!0}_parse(t){return Of(t.data)}};Jy.create=e=>new Jy({typeName:ta.ZodAny,...Ha(e)});class zv extends Ka{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Of(t.data)}}zv.create=e=>new zv({typeName:ta.ZodUnknown,...Ha(e)});class Fh extends Ka{_parse(t){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.never,received:n.parsedType}),Aa}}Fh.create=e=>new Fh({typeName:ta.ZodNever,...Ha(e)});let VC=class extends Ka{_parse(t){if(this._getType(t)!==Nn.undefined){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.void,received:n.parsedType}),Aa}return Of(t.data)}};VC.create=e=>new VC({typeName:ta.ZodVoid,...Ha(e)});let Uv=class zx extends Ka{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Nn.array)return Mn(n,{code:an.invalid_type,expected:Nn.array,received:n.parsedType}),Aa;if(a.exactLength!==null){const o=n.data.length>a.exactLength.value,s=n.data.length<a.exactLength.value;(o||s)&&(Mn(n,{code:o?an.too_big:an.too_small,minimum:s?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(Mn(n,{code:an.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(Mn(n,{code:an.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,s)=>a.type._parseAsync(new L0(n,o,n.path,s)))).then(o=>ff.mergeArray(r,o));const i=[...n.data].map((o,s)=>a.type._parseSync(new L0(n,o,n.path,s)));return ff.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new zx({...this._def,minLength:{value:t,message:vr.toString(n)}})}max(t,n){return new zx({...this._def,maxLength:{value:t,message:vr.toString(n)}})}length(t,n){return new zx({...this._def,exactLength:{value:t,message:vr.toString(n)}})}nonempty(t){return this.min(1,t)}};Uv.create=(e,t)=>new Uv({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ta.ZodArray,...Ha(t)});function qy(e){if(e instanceof VA){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=R0.create(qy(r))}return new VA({...e._def,shape:()=>t})}else return e instanceof Uv?new Uv({...e._def,type:qy(e.element)}):e instanceof R0?R0.create(qy(e.unwrap())):e instanceof lm?lm.create(qy(e.unwrap())):e instanceof om?om.create(e.items.map(t=>qy(t))):e}let VA=class B0 extends Ka{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Oi.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Nn.object){const c=this._getOrReturnCtx(t);return Mn(c,{code:an.invalid_type,expected:Nn.object,received:c.parsedType}),Aa}const{status:n,ctx:r}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Fh&&this._def.unknownKeys==="strip"))for(const c in r.data)i.includes(c)||o.push(c);const s=[];for(const c of i){const f=a[c],A=r.data[c];s.push({key:{status:"valid",value:c},value:f._parse(new L0(r,A,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Fh){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of o)s.push({key:{status:"valid",value:f},value:{status:"valid",value:r.data[f]}});else if(c==="strict")o.length>0&&(Mn(r,{code:an.unrecognized_keys,keys:o}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of o){const A=r.data[f];s.push({key:{status:"valid",value:f},value:c._parse(new L0(r,A,r.path,f)),alwaysSet:f in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of s){const A=await f.key,h=await f.value;c.push({key:A,value:h,alwaysSet:f.alwaysSet})}return c}).then(c=>ff.mergeObjectSync(n,c)):ff.mergeObjectSync(n,s)}get shape(){return this._def.shape()}strict(t){return vr.errToObj,new B0({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var a,i,o,s;const c=(o=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=vr.errToObj(t).message)!==null&&s!==void 0?s:c}:{message:c}}}:{}})}strip(){return new B0({...this._def,unknownKeys:"strip"})}passthrough(){return new B0({...this._def,unknownKeys:"passthrough"})}extend(t){return new B0({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new B0({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ta.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new B0({...this._def,catchall:t})}pick(t){const n={};return Oi.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new B0({...this._def,shape:()=>n})}omit(t){const n={};return Oi.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new B0({...this._def,shape:()=>n})}deepPartial(){return qy(this)}partial(t){const n={};return Oi.objectKeys(this.shape).forEach(r=>{const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}),new B0({...this._def,shape:()=>n})}required(t){const n={};return Oi.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof R0;)a=a._def.innerType;n[r]=a}}),new B0({...this._def,shape:()=>n})}keyof(){return sN(Oi.objectKeys(this.shape))}};VA.create=(e,t)=>new VA({shape:()=>e,unknownKeys:"strip",catchall:Fh.create(),typeName:ta.ZodObject,...Ha(t)}),VA.strictCreate=(e,t)=>new VA({shape:()=>e,unknownKeys:"strict",catchall:Fh.create(),typeName:ta.ZodObject,...Ha(t)}),VA.lazycreate=(e,t)=>new VA({shape:e,unknownKeys:"strip",catchall:Fh.create(),typeName:ta.ZodObject,...Ha(t)});class u7 extends Ka{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new Rp(s.ctx.common.issues));return Mn(n,{code:an.invalid_union,unionErrors:o}),Aa}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of r){const f={...n,common:{...n.common,issues:[]},parent:null},A=c._parseSync({data:n.data,path:n.path,parent:f});if(A.status==="valid")return A;A.status==="dirty"&&!i&&(i={result:A,ctx:f}),f.common.issues.length&&o.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(c=>new Rp(c));return Mn(n,{code:an.invalid_union,unionErrors:s}),Aa}}get options(){return this._def.options}}u7.create=(e,t)=>new u7({options:e,typeName:ta.ZodUnion,...Ha(t)});const im=e=>e instanceof f7?im(e.schema):e instanceof $p?im(e.innerType()):e instanceof d7?[e.value]:e instanceof A7?e.options:e instanceof p7?Oi.objectValues(e.enum):e instanceof h7?im(e._def.innerType):e instanceof l7?[void 0]:e instanceof s7?[null]:e instanceof R0?[void 0,...im(e.unwrap())]:e instanceof lm?[null,...im(e.unwrap())]:e instanceof zS||e instanceof v7?im(e.unwrap()):e instanceof m7?im(e._def.innerType):[];let oN=class Fee extends Ka{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Nn.object)return Mn(n,{code:an.invalid_type,expected:Nn.object,received:n.parsedType}),Aa;const r=this.discriminator,a=n.data[r],i=this.optionsMap.get(a);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Mn(n,{code:an.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Aa)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const a=new Map;for(const i of n){const o=im(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of o){if(a.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);a.set(s,i)}}return new Fee({typeName:ta.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:a,...Ha(r)})}};function QS(e,t){const n=rm(e),r=rm(t);if(e===t)return{valid:!0,data:e};if(n===Nn.object&&r===Nn.object){const a=Oi.objectKeys(t),i=Oi.objectKeys(e).filter(s=>a.indexOf(s)!==-1),o={...e,...t};for(const s of i){const c=QS(e[s],t[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(n===Nn.array&&r===Nn.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const o=e[i],s=t[i],c=QS(o,s);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return n===Nn.date&&r===Nn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class c7 extends Ka{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(i,o)=>{if(FS(i)||FS(o))return Aa;const s=QS(i.value,o.value);return s.valid?((VS(i)||VS(o))&&n.dirty(),{status:n.value,value:s.data}):(Mn(r,{code:an.invalid_intersection_types}),Aa)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}c7.create=(e,t,n)=>new c7({left:e,right:t,typeName:ta.ZodIntersection,...Ha(n)});let om=class Vee extends Ka{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Nn.array)return Mn(r,{code:an.invalid_type,expected:Nn.array,received:r.parsedType}),Aa;if(r.data.length<this._def.items.length)return Mn(r,{code:an.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Aa;!this._def.rest&&r.data.length>this._def.items.length&&(Mn(r,{code:an.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((i,o)=>{const s=this._def.items[o]||this._def.rest;return s?s._parse(new L0(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>ff.mergeArray(n,i)):ff.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new Vee({...this._def,rest:t})}};om.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new om({items:e,typeName:ta.ZodTuple,rest:null,...Ha(t)})};let lN=class _I extends Ka{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Nn.object)return Mn(r,{code:an.invalid_type,expected:Nn.object,received:r.parsedType}),Aa;const a=[],i=this._def.keyType,o=this._def.valueType;for(const s in r.data)a.push({key:i._parse(new L0(r,s,r.path,s)),value:o._parse(new L0(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?ff.mergeObjectAsync(n,a):ff.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ka?new _I({keyType:t,valueType:n,typeName:ta.ZodRecord,...Ha(r)}):new _I({keyType:Np.create(),valueType:t,typeName:ta.ZodRecord,...Ha(n)})}},OC=class extends Ka{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Nn.map)return Mn(r,{code:an.invalid_type,expected:Nn.map,received:r.parsedType}),Aa;const a=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([s,c],f)=>({key:a._parse(new L0(r,s,r.path,[f,"key"])),value:i._parse(new L0(r,c,r.path,[f,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const c of o){const f=await c.key,A=await c.value;if(f.status==="aborted"||A.status==="aborted")return Aa;(f.status==="dirty"||A.status==="dirty")&&n.dirty(),s.set(f.value,A.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const c of o){const f=c.key,A=c.value;if(f.status==="aborted"||A.status==="aborted")return Aa;(f.status==="dirty"||A.status==="dirty")&&n.dirty(),s.set(f.value,A.value)}return{status:n.value,value:s}}}};OC.create=(e,t,n)=>new OC({valueType:t,keyType:e,typeName:ta.ZodMap,...Ha(n)});let QC=class PI extends Ka{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Nn.set)return Mn(r,{code:an.invalid_type,expected:Nn.set,received:r.parsedType}),Aa;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(Mn(r,{code:an.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(Mn(r,{code:an.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const f=new Set;for(const A of c){if(A.status==="aborted")return Aa;A.status==="dirty"&&n.dirty(),f.add(A.value)}return{status:n.value,value:f}}const s=[...r.data.values()].map((c,f)=>i._parse(new L0(r,c,r.path,f)));return r.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(t,n){return new PI({...this._def,minSize:{value:t,message:vr.toString(n)}})}max(t,n){return new PI({...this._def,maxSize:{value:t,message:vr.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};QC.create=(e,t)=>new QC({valueType:e,minSize:null,maxSize:null,typeName:ta.ZodSet,...Ha(t)});class e3 extends Ka{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Nn.function)return Mn(n,{code:an.invalid_type,expected:Nn.function,received:n.parsedType}),Aa;function r(s,c){return RC({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,LC(),Zy].filter(f=>!!f),issueData:{code:an.invalid_arguments,argumentsError:c}})}function a(s,c){return RC({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,LC(),Zy].filter(f=>!!f),issueData:{code:an.invalid_return_type,returnTypeError:c}})}const i={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof t3){const s=this;return Of(async function(...c){const f=new Rp([]),A=await s._def.args.parseAsync(c,i).catch(m=>{throw f.addIssue(r(c,m)),f}),h=await Reflect.apply(o,this,A);return await s._def.returns._def.type.parseAsync(h,i).catch(m=>{throw f.addIssue(a(h,m)),f})})}else{const s=this;return Of(function(...c){const f=s._def.args.safeParse(c,i);if(!f.success)throw new Rp([r(c,f.error)]);const A=Reflect.apply(o,this,f.data),h=s._def.returns.safeParse(A,i);if(!h.success)throw new Rp([a(A,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e3({...this._def,args:om.create(t).rest(zv.create())})}returns(t){return new e3({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new e3({args:t||om.create([]).rest(zv.create()),returns:n||zv.create(),typeName:ta.ZodFunction,...Ha(r)})}}class f7 extends Ka{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}f7.create=(e,t)=>new f7({getter:e,typeName:ta.ZodLazy,...Ha(t)});class d7 extends Ka{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Mn(n,{received:n.data,code:an.invalid_literal,expected:this._def.value}),Aa}return{status:"valid",value:t.data}}get value(){return this._def.value}}d7.create=(e,t)=>new d7({value:e,typeName:ta.ZodLiteral,...Ha(t)});function sN(e,t){return new A7({values:e,typeName:ta.ZodEnum,...Ha(t)})}let A7=class MI extends Ka{constructor(){super(...arguments),n7.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Mn(n,{expected:Oi.joinValues(r),received:n.parsedType,code:an.invalid_type}),Aa}if($C(this,n7)||tN(this,n7,new Set(this._def.values)),!$C(this,n7).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Mn(n,{received:n.data,code:an.invalid_enum_value,options:r}),Aa}return Of(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return MI.create(t,{...this._def,...n})}exclude(t,n=this._def){return MI.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}};n7=new WeakMap,A7.create=sN;let p7=class extends Ka{constructor(){super(...arguments),r7.set(this,void 0)}_parse(t){const n=Oi.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Nn.string&&r.parsedType!==Nn.number){const a=Oi.objectValues(n);return Mn(r,{expected:Oi.joinValues(a),received:r.parsedType,code:an.invalid_type}),Aa}if($C(this,r7)||tN(this,r7,new Set(Oi.getValidEnumValues(this._def.values))),!$C(this,r7).has(t.data)){const a=Oi.objectValues(n);return Mn(r,{received:r.data,code:an.invalid_enum_value,options:a}),Aa}return Of(t.data)}get enum(){return this._def.values}};r7=new WeakMap,p7.create=(e,t)=>new p7({values:e,typeName:ta.ZodNativeEnum,...Ha(t)});class t3 extends Ka{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Nn.promise&&n.common.async===!1)return Mn(n,{code:an.invalid_type,expected:Nn.promise,received:n.parsedType}),Aa;const r=n.parsedType===Nn.promise?n.data:Promise.resolve(n.data);return Of(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}t3.create=(e,t)=>new t3({type:e,typeName:ta.ZodPromise,...Ha(t)});class $p extends Ka{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ta.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{Mn(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async s=>{if(n.value==="aborted")return Aa;const c=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return c.status==="aborted"?Aa:c.status==="dirty"||n.value==="dirty"?NC(c.value):c});{if(n.value==="aborted")return Aa;const s=this._def.schema._parseSync({data:o,path:r.path,parent:r});return s.status==="aborted"?Aa:s.status==="dirty"||n.value==="dirty"?NC(s.value):s}}if(a.type==="refinement"){const o=s=>{const c=a.refinement(s,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Aa:(s.status==="dirty"&&n.dirty(),o(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?Aa:(s.status==="dirty"&&n.dirty(),o(s.value).then(()=>({status:n.value,value:s.value}))))}if(a.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!e7(o))return o;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>e7(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:n.value,value:s})):o);Oi.assertNever(a)}}$p.create=(e,t,n)=>new $p({schema:e,typeName:ta.ZodEffects,effect:t,...Ha(n)}),$p.createWithPreprocess=(e,t,n)=>new $p({schema:t,effect:{type:"preprocess",transform:e},typeName:ta.ZodEffects,...Ha(n)});let R0=class extends Ka{_parse(t){return this._getType(t)===Nn.undefined?Of(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};R0.create=(e,t)=>new R0({innerType:e,typeName:ta.ZodOptional,...Ha(t)});let lm=class extends Ka{_parse(t){return this._getType(t)===Nn.null?Of(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};lm.create=(e,t)=>new lm({innerType:e,typeName:ta.ZodNullable,...Ha(t)});let h7=class extends Ka{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Nn.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};h7.create=(e,t)=>new h7({innerType:e,typeName:ta.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ha(t)});let m7=class extends Ka{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return t7(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Rp(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Rp(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};m7.create=(e,t)=>new m7({innerType:e,typeName:ta.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ha(t)});class zC extends Ka{_parse(t){if(this._getType(t)!==Nn.nan){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.nan,received:n.parsedType}),Aa}return{status:"valid",value:t.data}}}zC.create=e=>new zC({typeName:ta.ZodNaN,...Ha(e)});const _ue=Symbol("zod_brand");let zS=class extends Ka{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},US=class Oee extends Ka{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Aa:a.status==="dirty"?(n.dirty(),NC(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Aa:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new Oee({in:t,out:n,typeName:ta.ZodPipeline})}},v7=class extends Ka{_parse(t){const n=this._def.innerType._parse(t),r=a=>(e7(a)&&(a.value=Object.freeze(a.value)),a);return t7(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}};v7.create=(e,t)=>new v7({innerType:e,typeName:ta.ZodReadonly,...Ha(t)});function uN(e,t={},n){return e?Jy.create().superRefine((r,a)=>{var i,o;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(o=(i=s.fatal)!==null&&i!==void 0?i:n)!==null&&o!==void 0?o:!0,f=typeof s=="string"?{message:s}:s;a.addIssue({code:"custom",...f,fatal:c})}}):Jy.create()}const Pue={object:VA.lazycreate};var ta;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ta||(ta={}));const Mue=(e,t={message:`Input not instance of ${e.name}`})=>uN(n=>n instanceof e,t),cN=Np.create,fN=a7.create,Due=zC.create,Hue=am.create,dN=i7.create,Iue=o7.create,Lue=FC.create,Rue=l7.create,Nue=s7.create,$ue=Jy.create,Fue=zv.create,Vue=Fh.create,Oue=VC.create,Que=Uv.create,zue=VA.create,Uue=VA.strictCreate,jue=u7.create,Gue=oN.create,Yue=c7.create,Wue=om.create,Xue=lN.create,Kue=OC.create,Zue=QC.create,Jue=e3.create,que=f7.create,ece=d7.create,tce=A7.create,nce=p7.create,rce=t3.create,AN=$p.create,ace=R0.create,ice=lm.create,oce=$p.createWithPreprocess,lce=US.create;var Di=Object.freeze({__proto__:null,defaultErrorMap:Zy,setErrorMap:due,getErrorMap:LC,makeIssue:RC,EMPTY_PATH:Aue,addIssueToContext:Mn,ParseStatus:ff,INVALID:Aa,DIRTY:NC,OK:Of,isAborted:FS,isDirty:VS,isValid:e7,isAsync:t7,get util(){return Oi},get objectUtil(){return $S},ZodParsedType:Nn,getParsedType:rm,ZodType:Ka,datetimeRegex:iN,ZodString:Np,ZodNumber:a7,ZodBigInt:am,ZodBoolean:i7,ZodDate:o7,ZodSymbol:FC,ZodUndefined:l7,ZodNull:s7,ZodAny:Jy,ZodUnknown:zv,ZodNever:Fh,ZodVoid:VC,ZodArray:Uv,ZodObject:VA,ZodUnion:u7,ZodDiscriminatedUnion:oN,ZodIntersection:c7,ZodTuple:om,ZodRecord:lN,ZodMap:OC,ZodSet:QC,ZodFunction:e3,ZodLazy:f7,ZodLiteral:d7,ZodEnum:A7,ZodNativeEnum:p7,ZodPromise:t3,ZodEffects:$p,ZodTransformer:$p,ZodOptional:R0,ZodNullable:lm,ZodDefault:h7,ZodCatch:m7,ZodNaN:zC,BRAND:_ue,ZodBranded:zS,ZodPipeline:US,ZodReadonly:v7,custom:uN,Schema:Ka,ZodSchema:Ka,late:Pue,get ZodFirstPartyTypeKind(){return ta},coerce:{string:e=>Np.create({...e,coerce:!0}),number:e=>a7.create({...e,coerce:!0}),boolean:e=>i7.create({...e,coerce:!0}),bigint:e=>am.create({...e,coerce:!0}),date:e=>o7.create({...e,coerce:!0})},any:$ue,array:Que,bigint:Hue,boolean:dN,date:Iue,discriminatedUnion:Gue,effect:AN,enum:tce,function:Jue,instanceof:Mue,intersection:Yue,lazy:que,literal:ece,map:Kue,nan:Due,nativeEnum:nce,never:Vue,null:Nue,nullable:ice,number:fN,object:zue,oboolean:()=>dN().optional(),onumber:()=>fN().optional(),optional:ace,ostring:()=>cN().optional(),pipeline:lce,preprocess:oce,promise:rce,record:Xue,set:Zue,strictObject:Uue,string:cN,symbol:Lue,transformer:AN,tuple:Wue,undefined:Rue,union:jue,unknown:Fue,void:Oue,NEVER:Aa,ZodIssueCode:an,quotelessJson:fue,ZodError:Rp});Di.object({__isRef:Di.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Di.string().describe("Upstream block id"),name:Di.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:Di.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly(),Di.string().length(24).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");var pN={exports:{}};(function(e,t){t=e.exports=n,t.getSerialize=r;function n(a,i,o,s){return JSON.stringify(a,r(i,s),o)}function r(a,i){var o=[],s=[];return i==null&&(i=function(c,f){return o[0]===f?"[Circular ~]":"[Circular ~."+s.slice(0,o.indexOf(f)).join(".")+"]"}),function(c,f){if(o.length>0){var A=o.indexOf(this);~A?o.splice(A+1):o.push(this),~A?s.splice(A,1/0,c):s.push(c),~o.indexOf(f)&&(f=i.call(this,c,f))}else o.push(f);return a==null?f:a.call(this,c,f)}}})(pN,pN.exports);const sce=Di.object({type:Di.literal("PlError"),name:Di.string(),message:Di.string(),fullMessage:Di.string().optional(),stack:Di.string().optional()}),uce=sce.extend({cause:Di.lazy(()=>UC).optional(),errors:Di.lazy(()=>UC.array()).optional()}),cce=Di.object({type:Di.literal("StandardError"),name:Di.string(),message:Di.string(),stack:Di.string().optional()}),fce=cce.extend({cause:Di.lazy(()=>UC).optional(),errors:Di.lazy(()=>UC.array()).optional()}),UC=Di.union([fce,uce]),dce=Di.object({name:Di.string(),message:Di.string(),fullMessage:Di.string().optional(),stack:Di.string().optional()}),hN=dce.extend({cause:Di.lazy(()=>hN).optional(),errors:Di.lazy(()=>hN.array()).optional()}),Ace=Di.object({type:Di.string(),importance:Di.number().optional(),id:Di.string().optional(),label:Di.string()});Di.array(Ace);function mN(e,t,n){const r=d.ref(0),a=d.reactive({loading:d.computed(()=>r.value>0),loadingRef:r,value:void 0,error:void 0}),i=nse(t);return d.watch(e,async o=>{a.error=void 0,r.value++,i(o).then(s=>{s.ok&&(a.value=s.value)}).catch(s=>{a.value=void 0,a.error=s}).finally(()=>{r.value--})},Object.assign({immediate:!0,deep:!0},{})),a}const pce=["tabindex"],hce={class:"pl-autocomplete__container"},mce={class:"pl-autocomplete__field"},vce=["disabled","placeholder"],gce={key:0,class:"input-value"},yce={class:"pl-autocomplete__controls"},wce={key:2,class:"arrow-icon arrow-icon-default"},Cce={key:0},bce={key:0,class:"required-icon"},Ece={key:0,class:"nothing-found"},xce={key:0,class:"pl-autocomplete__error"},Sce={key:1,class:"pl-autocomplete__helper"},Bce={key:2,class:"pl-autocomplete__helper"},kce={name:"PlAutocomplete"},jC=d.defineComponent({...kce,props:d.mergeModels({optionsSearch:{},modelSearch:{type:Function,default:void 0},label:{default:""},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"},formatValue:{type:Function,default:e=>String(e)}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=d.useModel(e,"modelValue"),n=e,r=d.useSlots(),a=d.ref(),i=d.ref(),o=d.useTemplateRef("overlay"),s=d.ref(null),c=d.reactive({activeIndex:-1,open:!1}),f=()=>XR(g.value.findIndex(me=>Ky(me.value,t.value)),me=>me<0?0:me),A=()=>c.activeIndex=f(),h=d.ref([]),m=d.ref(),g=d.computed(()=>GR(h.value).map((me,ae)=>({...me,index:ae,isSelected:ae===k.value,isActive:ae===c.activeIndex}))),b=d.ref(!0),C=d.ref(!1),x=d.computed(()=>n.disabled),k=d.computed(()=>h.value.findIndex(me=>Ky(me.value,t.value))),_=d.computed(()=>{if(!b.value){if(n.error)return n.error;if(C.value)return"Data loading error"}}),D=d.computed(()=>{const me=d.unref(m),ae=d.unref(g),ye=me??ae.find(Ce=>Ky(Ce.value,t.value))??ae.find(Ce=>Ky(Ce.value,t.value));return(ye==null?void 0:ye.label)||(t.value?n.formatValue(t.value):"")}),O=d.computed(()=>!c.open&&t.value?"":t.value?String(D.value):n.placeholder),I=d.computed(()=>t.value!==void 0&&t.value!==null),$=d.computed(()=>x.value?void 0:"0"),Q=me=>{var ae;t.value=me==null?void 0:me.value,m.value=me,s.value=null,c.open=!1,(ae=a==null?void 0:a.value)==null||ae.focus()},ee=()=>{t.value=void 0,m.value=void 0},K=()=>{var me;return(me=i.value)==null?void 0:me.focus()},re=()=>{c.open=!c.open};d.watch(()=>c.open,me=>{s.value=me?"":null});const U=()=>{c.open=!0},G=me=>{var ae,ye,Ce;const ce=me.relatedTarget;!((ae=a.value)!=null&&ae.contains(ce))&&!((Ce=(ye=o.value)==null?void 0:ye.listRef)!=null&&Ce.contains(ce))&&(s.value=null,c.open=!1)},Z=me=>{var ae;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(me.code))me.preventDefault();else return;const{open:ye,activeIndex:Ce}=c;if(!ye){me.code==="Enter"&&(c.open=!0,s.value="");return}me.code==="Escape"&&(c.open=!1,s.value=null,(ae=a.value)==null||ae.focus());const ce=d.unref(g),{length:ge}=ce;if(!ge)return;me.code==="Enter"&&Q(ce.find(Oe=>Oe.index===Ce));const ze=ce.findIndex(Oe=>Oe.index===Ce)??-1,Ne=me.code==="ArrowDown"?1:me.code==="ArrowUp"?-1:0,Ge=Math.abs(ze+Ne+ge)%ge;c.activeIndex=g.value[Ge].index??-1};Zse(a),d.watch(()=>t.value,A,{immediate:!0}),d.watch(()=>c.open,me=>{var ae;return me?(ae=i.value)==null?void 0:ae.focus():""}),d.watchPostEffect(()=>{var me;s.value,c.activeIndex>=0&&c.open&&((me=o.value)==null||me.scrollIntoActive())});const Y=cue(s,300,{maxWait:1e3}),X=mN(()=>Y.value,async me=>me!==null?n.optionsSearch(me):[]),oe=mN(()=>t.value,async me=>{var ae,ye;return me&&!Ky((ae=m.value)==null?void 0:ae.value,me)?n.modelSearch?n.modelSearch(me):(ye=await n.optionsSearch(String(me)))==null?void 0:ye[0]:m.value});return d.watch(()=>X.value,me=>{me&&(h.value=me,s.value!==null&&(C.value=!1))}),d.watch(()=>oe.value,me=>{me&&(m.value=GR([me])[0])}),d.watch(()=>X.error,me=>{me&&(C.value=!!me)}),d.watch(()=>X.loading||oe.loading,me=>{b.value=me}),(me,ae)=>(d.openBlock(),d.createElementBlock("div",{class:"pl-autocomplete__envelope",onClick:d.withModifiers(K,["stop"])},[d.createElementVNode("div",{ref_key:"rootRef",ref:a,tabindex:$.value,class:d.normalizeClass(["pl-autocomplete",{open:c.open,error:!!_.value,disabled:x.value}]),onKeydown:Z,onFocusout:G},[d.createElementVNode("div",hce,[d.createElementVNode("div",mce,[d.withDirectives(d.createElementVNode("input",{ref_key:"input",ref:i,"onUpdate:modelValue":ae[0]||(ae[0]=ye=>s.value=ye),type:"text",tabindex:"-1",disabled:x.value,placeholder:O.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:U},null,40,vce),[[d.vModelText,s.value]]),ae[4]||(ae[4]=d.createTextVNode()),c.open?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",gce,[d.createVNode(nue,null,{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(D.value),1)]),_:1})])),ae[5]||(ae[5]=d.createTextVNode()),d.createElementVNode("div",yce,[b.value?(d.openBlock(),d.createBlock(d.unref(Hse),{key:0,name:"loading"})):d.createCommentVNode("",!0),ae[1]||(ae[1]=d.createTextVNode()),me.clearable&&I.value?(d.openBlock(),d.createBlock(d.unref(q5),{key:1,name:"delete-clear",onClick:d.withModifiers(ee,["stop"])})):d.createCommentVNode("",!0),ae[2]||(ae[2]=d.createTextVNode()),d.renderSlot(me.$slots,"append"),ae[3]||(ae[3]=d.createTextVNode()),d.createElementVNode("div",{class:"pl-autocomplete__arrow-wrapper",onClick:d.withModifiers(re,["stop"])},[me.arrowIconLarge?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["arrow-icon",[`icon-24 ${me.arrowIconLarge}`]])},null,2)):me.arrowIcon?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["arrow-icon",[`icon-16 ${me.arrowIcon}`]])},null,2)):(d.openBlock(),d.createElementBlock("div",wce))])])]),ae[9]||(ae[9]=d.createTextVNode()),me.label?(d.openBlock(),d.createElementBlock("label",Cce,[me.required?(d.openBlock(),d.createElementBlock("i",bce)):d.createCommentVNode("",!0),ae[6]||(ae[6]=d.createTextVNode()),d.createElementVNode("span",null,d.toDisplayString(me.label),1),ae[7]||(ae[7]=d.createTextVNode()),d.unref(r).tooltip?(d.openBlock(),d.createBlock(d.unref(Qse),{key:1,class:"info",position:"top"},{tooltip:d.withCtx(()=>[d.renderSlot(me.$slots,"tooltip")]),_:3})):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),ae[10]||(ae[10]=d.createTextVNode()),c.open?(d.openBlock(),d.createBlock(d.unref(oue),{key:1,ref:"overlay",root:a.value,class:"pl-autocomplete__options",tabindex:"-1",gap:3},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(g.value,(ye,Ce)=>(d.openBlock(),d.createBlock(vse,{key:Ce,option:ye,"is-selected":ye.isSelected,"is-hovered":ye.isActive,size:me.optionSize,onClick:d.withModifiers(ce=>Q(ye),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),ae[8]||(ae[8]=d.createTextVNode()),g.value.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Ece,"Nothing found"))]),_:1},8,["root"])):d.createCommentVNode("",!0),ae[11]||(ae[11]=d.createTextVNode()),d.createVNode(Gse,{class:"pl-autocomplete__contour"})])],42,pce),ae[12]||(ae[12]=d.createTextVNode()),_.value?(d.openBlock(),d.createElementBlock("div",xce,d.toDisplayString(_.value),1)):b.value&&me.loadingOptionsHelper?(d.openBlock(),d.createElementBlock("div",Sce,d.toDisplayString(me.loadingOptionsHelper),1)):me.helper?(d.openBlock(),d.createElementBlock("div",Bce,d.toDisplayString(me.helper),1)):d.createCommentVNode("",!0)]))}});function GC(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Tce(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function vN(e){let t,n,r;e.length!==2?(t=GC,n=(s,c)=>GC(e(s),c),r=(s,c)=>e(s)-c):(t=e===GC||e===Tce?e:_ce,n=e,r=e);function a(s,c,f=0,A=s.length){if(f<A){if(t(c,c)!==0)return A;do{const h=f+A>>>1;n(s[h],c)<0?f=h+1:A=h}while(f<A)}return f}function i(s,c,f=0,A=s.length){if(f<A){if(t(c,c)!==0)return A;do{const h=f+A>>>1;n(s[h],c)<=0?f=h+1:A=h}while(f<A)}return f}function o(s,c,f=0,A=s.length){const h=a(s,c,f,A-1);return h>f&&r(s[h-1],c)>-r(s[h],c)?h-1:h}return{left:a,center:o,right:i}}function _ce(){return 0}function Pce(e){return e===null?NaN:+e}vN(GC),vN(Pce).center;var Mce={value:()=>{}};function gN(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new YC(n)}function YC(e){this._=e}function Dce(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}YC.prototype=gN.prototype={constructor:YC,on:function(e,t){var n=this._,r=Dce(e+"",n),a,i=-1,o=r.length;if(arguments.length<2){for(;++i<o;)if((a=(e=r[i]).type)&&(a=Hce(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(a=(e=r[i]).type)n[a]=yN(n[a],e.name,t);else if(t==null)for(a in n)n[a]=yN(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new YC(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,i;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,a=i.length;r<a;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,i=r.length;a<i;++a)r[a].value.apply(t,n)}};function Hce(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function yN(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=Mce,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var jS="http://www.w3.org/1999/xhtml";const wN={svg:"http://www.w3.org/2000/svg",xhtml:jS,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function WC(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),wN.hasOwnProperty(t)?{space:wN[t],local:e}:e}function Ice(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===jS&&t.documentElement.namespaceURI===jS?t.createElement(e):t.createElementNS(n,e)}}function Lce(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function CN(e){var t=WC(e);return(t.local?Lce:Ice)(t)}function Rce(){}function GS(e){return e==null?Rce:function(){return this.querySelector(e)}}function Nce(e){typeof e!="function"&&(e=GS(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,s=r[a]=new Array(o),c,f,A=0;A<o;++A)(c=i[A])&&(f=e.call(c,c.__data__,A,i))&&("__data__"in c&&(f.__data__=c.__data__),s[A]=f);return new Fp(r,this._parents)}function $ce(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Fce(){return[]}function bN(e){return e==null?Fce:function(){return this.querySelectorAll(e)}}function Vce(e){return function(){return $ce(e.apply(this,arguments))}}function Oce(e){typeof e=="function"?e=Vce(e):e=bN(e);for(var t=this._groups,n=t.length,r=[],a=[],i=0;i<n;++i)for(var o=t[i],s=o.length,c,f=0;f<s;++f)(c=o[f])&&(r.push(e.call(c,c.__data__,f,o)),a.push(c));return new Fp(r,a)}function EN(e){return function(){return this.matches(e)}}function xN(e){return function(t){return t.matches(e)}}var Qce=Array.prototype.find;function zce(e){return function(){return Qce.call(this.children,e)}}function Uce(){return this.firstElementChild}function jce(e){return this.select(e==null?Uce:zce(typeof e=="function"?e:xN(e)))}var Gce=Array.prototype.filter;function Yce(){return Array.from(this.children)}function Wce(e){return function(){return Gce.call(this.children,e)}}function Xce(e){return this.selectAll(e==null?Yce:Wce(typeof e=="function"?e:xN(e)))}function Kce(e){typeof e!="function"&&(e=EN(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,s=r[a]=[],c,f=0;f<o;++f)(c=i[f])&&e.call(c,c.__data__,f,i)&&s.push(c);return new Fp(r,this._parents)}function SN(e){return new Array(e.length)}function Zce(){return new Fp(this._enter||this._groups.map(SN),this._parents)}function XC(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}XC.prototype={constructor:XC,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Jce(e){return function(){return e}}function qce(e,t,n,r,a,i){for(var o=0,s,c=t.length,f=i.length;o<f;++o)(s=t[o])?(s.__data__=i[o],r[o]=s):n[o]=new XC(e,i[o]);for(;o<c;++o)(s=t[o])&&(a[o]=s)}function efe(e,t,n,r,a,i,o){var s,c,f=new Map,A=t.length,h=i.length,m=new Array(A),g;for(s=0;s<A;++s)(c=t[s])&&(m[s]=g=o.call(c,c.__data__,s,t)+"",f.has(g)?a[s]=c:f.set(g,c));for(s=0;s<h;++s)g=o.call(e,i[s],s,i)+"",(c=f.get(g))?(r[s]=c,c.__data__=i[s],f.delete(g)):n[s]=new XC(e,i[s]);for(s=0;s<A;++s)(c=t[s])&&f.get(m[s])===c&&(a[s]=c)}function tfe(e){return e.__data__}function nfe(e,t){if(!arguments.length)return Array.from(this,tfe);var n=t?efe:qce,r=this._parents,a=this._groups;typeof e!="function"&&(e=Jce(e));for(var i=a.length,o=new Array(i),s=new Array(i),c=new Array(i),f=0;f<i;++f){var A=r[f],h=a[f],m=h.length,g=rfe(e.call(A,A&&A.__data__,f,r)),b=g.length,C=s[f]=new Array(b),x=o[f]=new Array(b),k=c[f]=new Array(m);n(A,h,C,x,k,g,t);for(var _=0,D=0,O,I;_<b;++_)if(O=C[_]){for(_>=D&&(D=_+1);!(I=x[D])&&++D<b;);O._next=I||null}}return o=new Fp(o,r),o._enter=s,o._exit=c,o}function rfe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function afe(){return new Fp(this._exit||this._groups.map(SN),this._parents)}function ife(e,t,n){var r=this.enter(),a=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?i.remove():n(i),r&&a?r.merge(a).order():a}function ofe(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,i=r.length,o=Math.min(a,i),s=new Array(a),c=0;c<o;++c)for(var f=n[c],A=r[c],h=f.length,m=s[c]=new Array(h),g,b=0;b<h;++b)(g=f[b]||A[b])&&(m[b]=g);for(;c<a;++c)s[c]=n[c];return new Fp(s,this._parents)}function lfe(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,i=r[a],o;--a>=0;)(o=r[a])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function sfe(e){e||(e=ufe);function t(h,m){return h&&m?e(h.__data__,m.__data__):!h-!m}for(var n=this._groups,r=n.length,a=new Array(r),i=0;i<r;++i){for(var o=n[i],s=o.length,c=a[i]=new Array(s),f,A=0;A<s;++A)(f=o[A])&&(c[A]=f);c.sort(t)}return new Fp(a,this._parents).order()}function ufe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function cfe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ffe(){return Array.from(this)}function dfe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length;a<i;++a){var o=r[a];if(o)return o}return null}function Afe(){let e=0;for(const t of this)++e;return e}function pfe(){return!this.node()}function hfe(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],i=0,o=a.length,s;i<o;++i)(s=a[i])&&e.call(s,s.__data__,i,a);return this}function mfe(e){return function(){this.removeAttribute(e)}}function vfe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function gfe(e,t){return function(){this.setAttribute(e,t)}}function yfe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function wfe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Cfe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function bfe(e,t){var n=WC(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?vfe:mfe:typeof t=="function"?n.local?Cfe:wfe:n.local?yfe:gfe)(n,t))}function BN(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Efe(e){return function(){this.style.removeProperty(e)}}function xfe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Sfe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Bfe(e,t,n){return arguments.length>1?this.each((t==null?Efe:typeof t=="function"?Sfe:xfe)(e,t,n??"")):n3(this.node(),e)}function n3(e,t){return e.style.getPropertyValue(t)||BN(e).getComputedStyle(e,null).getPropertyValue(t)}function kfe(e){return function(){delete this[e]}}function Tfe(e,t){return function(){this[e]=t}}function _fe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Pfe(e,t){return arguments.length>1?this.each((t==null?kfe:typeof t=="function"?_fe:Tfe)(e,t)):this.node()[e]}function kN(e){return e.trim().split(/^|\s+/)}function YS(e){return e.classList||new TN(e)}function TN(e){this._node=e,this._names=kN(e.getAttribute("class")||"")}TN.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function _N(e,t){for(var n=YS(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function PN(e,t){for(var n=YS(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function Mfe(e){return function(){_N(this,e)}}function Dfe(e){return function(){PN(this,e)}}function Hfe(e,t){return function(){(t.apply(this,arguments)?_N:PN)(this,e)}}function Ife(e,t){var n=kN(e+"");if(arguments.length<2){for(var r=YS(this.node()),a=-1,i=n.length;++a<i;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?Hfe:t?Mfe:Dfe)(n,t))}function Lfe(){this.textContent=""}function Rfe(e){return function(){this.textContent=e}}function Nfe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function $fe(e){return arguments.length?this.each(e==null?Lfe:(typeof e=="function"?Nfe:Rfe)(e)):this.node().textContent}function Ffe(){this.innerHTML=""}function Vfe(e){return function(){this.innerHTML=e}}function Ofe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Qfe(e){return arguments.length?this.each(e==null?Ffe:(typeof e=="function"?Ofe:Vfe)(e)):this.node().innerHTML}function zfe(){this.nextSibling&&this.parentNode.appendChild(this)}function Ufe(){return this.each(zfe)}function jfe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Gfe(){return this.each(jfe)}function Yfe(e){var t=typeof e=="function"?e:CN(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Wfe(){return null}function Xfe(e,t){var n=typeof e=="function"?e:CN(e),r=t==null?Wfe:typeof t=="function"?t:GS(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Kfe(){var e=this.parentNode;e&&e.removeChild(this)}function Zfe(){return this.each(Kfe)}function Jfe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qfe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ede(e){return this.select(e?qfe:Jfe)}function tde(e){return arguments.length?this.property("__data__",e):this.node().__data__}function nde(e){return function(t){e.call(this,t,this.__data__)}}function rde(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ade(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,i;n<a;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function ide(e,t,n){return function(){var r=this.__on,a,i=nde(t);if(r){for(var o=0,s=r.length;o<s;++o)if((a=r[o]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=n),a.value=t;return}}this.addEventListener(e.type,i,n),a={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(a):this.__on=[a]}}function ode(e,t,n){var r=rde(e+""),a,i=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,f=s.length,A;c<f;++c)for(a=0,A=s[c];a<i;++a)if((o=r[a]).type===A.type&&o.name===A.name)return A.value}return}for(s=t?ide:ade,a=0;a<i;++a)this.each(s(r[a],t,n));return this}function MN(e,t,n){var r=BN(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function lde(e,t){return function(){return MN(this,e,t)}}function sde(e,t){return function(){return MN(this,e,t.apply(this,arguments))}}function ude(e,t){return this.each((typeof t=="function"?sde:lde)(e,t))}function*cde(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length,o;a<i;++a)(o=r[a])&&(yield o)}var fde=[null];function Fp(e,t){this._groups=e,this._parents=t}function g7(){return new Fp([[document.documentElement]],fde)}function dde(){return this}Fp.prototype=g7.prototype={constructor:Fp,select:Nce,selectAll:Oce,selectChild:jce,selectChildren:Xce,filter:Kce,data:nfe,enter:Zce,exit:afe,join:ife,merge:ofe,selection:dde,order:lfe,sort:sfe,call:cfe,nodes:ffe,node:dfe,size:Afe,empty:pfe,each:hfe,attr:bfe,style:Bfe,property:Pfe,classed:Ife,text:$fe,html:Qfe,raise:Ufe,lower:Gfe,append:Yfe,insert:Xfe,remove:Zfe,clone:ede,datum:tde,on:ode,dispatch:ude,[Symbol.iterator]:cde};function WS(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function DN(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function y7(){}var w7=.7,KC=1/w7,r3="\\s*([+-]?\\d+)\\s*",C7="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",N0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ade=/^#([0-9a-f]{3,8})$/,pde=new RegExp(`^rgb\\(${r3},${r3},${r3}\\)$`),hde=new RegExp(`^rgb\\(${N0},${N0},${N0}\\)$`),mde=new RegExp(`^rgba\\(${r3},${r3},${r3},${C7}\\)$`),vde=new RegExp(`^rgba\\(${N0},${N0},${N0},${C7}\\)$`),gde=new RegExp(`^hsl\\(${C7},${N0},${N0}\\)$`),yde=new RegExp(`^hsla\\(${C7},${N0},${N0},${C7}\\)$`),HN={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};WS(y7,b7,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:IN,formatHex:IN,formatHex8:wde,formatHsl:Cde,formatRgb:LN,toString:LN});function IN(){return this.rgb().formatHex()}function wde(){return this.rgb().formatHex8()}function Cde(){return VN(this).formatHsl()}function LN(){return this.rgb().formatRgb()}function b7(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ade.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?RN(t):n===3?new Dd(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ZC(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ZC(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=pde.exec(e))?new Dd(t[1],t[2],t[3],1):(t=hde.exec(e))?new Dd(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mde.exec(e))?ZC(t[1],t[2],t[3],t[4]):(t=vde.exec(e))?ZC(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=gde.exec(e))?FN(t[1],t[2]/100,t[3]/100,1):(t=yde.exec(e))?FN(t[1],t[2]/100,t[3]/100,t[4]):HN.hasOwnProperty(e)?RN(HN[e]):e==="transparent"?new Dd(NaN,NaN,NaN,0):null}function RN(e){return new Dd(e>>16&255,e>>8&255,e&255,1)}function ZC(e,t,n,r){return r<=0&&(e=t=n=NaN),new Dd(e,t,n,r)}function bde(e){return e instanceof y7||(e=b7(e)),e?(e=e.rgb(),new Dd(e.r,e.g,e.b,e.opacity)):new Dd}function XS(e,t,n,r){return arguments.length===1?bde(e):new Dd(e,t,n,r??1)}function Dd(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}WS(Dd,XS,DN(y7,{brighter(e){return e=e==null?KC:Math.pow(KC,e),new Dd(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?w7:Math.pow(w7,e),new Dd(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Dd(jv(this.r),jv(this.g),jv(this.b),JC(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:NN,formatHex:NN,formatHex8:Ede,formatRgb:$N,toString:$N}));function NN(){return`#${Gv(this.r)}${Gv(this.g)}${Gv(this.b)}`}function Ede(){return`#${Gv(this.r)}${Gv(this.g)}${Gv(this.b)}${Gv((isNaN(this.opacity)?1:this.opacity)*255)}`}function $N(){const e=JC(this.opacity);return`${e===1?"rgb(":"rgba("}${jv(this.r)}, ${jv(this.g)}, ${jv(this.b)}${e===1?")":`, ${e})`}`}function JC(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function jv(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gv(e){return e=jv(e),(e<16?"0":"")+e.toString(16)}function FN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vp(e,t,n,r)}function VN(e){if(e instanceof Vp)return new Vp(e.h,e.s,e.l,e.opacity);if(e instanceof y7||(e=b7(e)),!e)return new Vp;if(e instanceof Vp)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,s=i-a,c=(i+a)/2;return s?(t===i?o=(n-r)/s+(n<r)*6:n===i?o=(r-t)/s+2:o=(t-n)/s+4,s/=c<.5?i+a:2-i-a,o*=60):s=c>0&&c<1?0:o,new Vp(o,s,c,e.opacity)}function xde(e,t,n,r){return arguments.length===1?VN(e):new Vp(e,t,n,r??1)}function Vp(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}WS(Vp,xde,DN(y7,{brighter(e){return e=e==null?KC:Math.pow(KC,e),new Vp(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?w7:Math.pow(w7,e),new Vp(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new Dd(KS(e>=240?e-240:e+120,a,r),KS(e,a,r),KS(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Vp(ON(this.h),qC(this.s),qC(this.l),JC(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=JC(this.opacity);return`${e===1?"hsl(":"hsla("}${ON(this.h)}, ${qC(this.s)*100}%, ${qC(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ON(e){return e=(e||0)%360,e<0?e+360:e}function qC(e){return Math.max(0,Math.min(1,e||0))}function KS(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const QN=e=>()=>e;function Sde(e,t){return function(n){return e+n*t}}function Bde(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function kde(e){return(e=+e)==1?zN:function(t,n){return n-t?Bde(t,n,e):QN(isNaN(t)?n:t)}}function zN(e,t){var n=t-e;return n?Sde(e,n):QN(isNaN(e)?t:e)}const UN=function e(t){var n=kde(t);function r(a,i){var o=n((a=XS(a)).r,(i=XS(i)).r),s=n(a.g,i.g),c=n(a.b,i.b),f=zN(a.opacity,i.opacity);return function(A){return a.r=o(A),a.g=s(A),a.b=c(A),a.opacity=f(A),a+""}}return r.gamma=e,r}(1);function sm(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var ZS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,JS=new RegExp(ZS.source,"g");function Tde(e){return function(){return e}}function _de(e){return function(t){return e(t)+""}}function Pde(e,t){var n=ZS.lastIndex=JS.lastIndex=0,r,a,i,o=-1,s=[],c=[];for(e=e+"",t=t+"";(r=ZS.exec(e))&&(a=JS.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(a=a[0])?s[o]?s[o]+=a:s[++o]=a:(s[++o]=null,c.push({i:o,x:sm(r,a)})),n=JS.lastIndex;return n<t.length&&(i=t.slice(n),s[o]?s[o]+=i:s[++o]=i),s.length<2?c[0]?_de(c[0].x):Tde(t):(t=c.length,function(f){for(var A=0,h;A<t;++A)s[(h=c[A]).i]=h.x(f);return s.join("")})}var jN=180/Math.PI,GN={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function YN(e,t,n,r,a,i){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*jN,skewX:Math.atan(c)*jN,scaleX:o,scaleY:s}}var eb;function Mde(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?GN:YN(t.a,t.b,t.c,t.d,t.e,t.f)}function Dde(e){return e==null||(eb||(eb=document.createElementNS("http://www.w3.org/2000/svg","g")),eb.setAttribute("transform",e),!(e=eb.transform.baseVal.consolidate()))?GN:(e=e.matrix,YN(e.a,e.b,e.c,e.d,e.e,e.f))}function WN(e,t,n,r){function a(f){return f.length?f.pop()+" ":""}function i(f,A,h,m,g,b){if(f!==h||A!==m){var C=g.push("translate(",null,t,null,n);b.push({i:C-4,x:sm(f,h)},{i:C-2,x:sm(A,m)})}else(h||m)&&g.push("translate("+h+t+m+n)}function o(f,A,h,m){f!==A?(f-A>180?A+=360:A-f>180&&(f+=360),m.push({i:h.push(a(h)+"rotate(",null,r)-2,x:sm(f,A)})):A&&h.push(a(h)+"rotate("+A+r)}function s(f,A,h,m){f!==A?m.push({i:h.push(a(h)+"skewX(",null,r)-2,x:sm(f,A)}):A&&h.push(a(h)+"skewX("+A+r)}function c(f,A,h,m,g,b){if(f!==h||A!==m){var C=g.push(a(g)+"scale(",null,",",null,")");b.push({i:C-4,x:sm(f,h)},{i:C-2,x:sm(A,m)})}else(h!==1||m!==1)&&g.push(a(g)+"scale("+h+","+m+")")}return function(f,A){var h=[],m=[];return f=e(f),A=e(A),i(f.translateX,f.translateY,A.translateX,A.translateY,h,m),o(f.rotate,A.rotate,h,m),s(f.skewX,A.skewX,h,m),c(f.scaleX,f.scaleY,A.scaleX,A.scaleY,h,m),f=A=null,function(g){for(var b=-1,C=m.length,x;++b<C;)h[(x=m[b]).i]=x.x(g);return h.join("")}}}var Hde=WN(Mde,"px, ","px)","deg)"),Ide=WN(Dde,", ",")",")"),a3=0,E7=0,x7=0,XN=1e3,tb,S7,nb=0,Yv=0,rb=0,B7=typeof performance=="object"&&performance.now?performance:Date,KN=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function qS(){return Yv||(KN(Lde),Yv=B7.now()+rb)}function Lde(){Yv=0}function ab(){this._call=this._time=this._next=null}ab.prototype=ZN.prototype={constructor:ab,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?qS():+n)+(t==null?0:+t),!this._next&&S7!==this&&(S7?S7._next=this:tb=this,S7=this),this._call=e,this._time=n,eB()},stop:function(){this._call&&(this._call=null,this._time=1/0,eB())}};function ZN(e,t,n){var r=new ab;return r.restart(e,t,n),r}function Rde(){qS(),++a3;for(var e=tb,t;e;)(t=Yv-e._time)>=0&&e._call.call(void 0,t),e=e._next;--a3}function JN(){Yv=(nb=B7.now())+rb,a3=E7=0;try{Rde()}finally{a3=0,$de(),Yv=0}}function Nde(){var e=B7.now(),t=e-nb;t>XN&&(rb-=t,nb=e)}function $de(){for(var e,t=tb,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:tb=n);S7=e,eB(r)}function eB(e){if(!a3){E7&&(E7=clearTimeout(E7));var t=e-Yv;t>24?(e<1/0&&(E7=setTimeout(JN,e-B7.now()-rb)),x7&&(x7=clearInterval(x7))):(x7||(nb=B7.now(),x7=setInterval(Nde,XN)),a3=1,KN(JN))}}function qN(e,t,n){var r=new ab;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var Fde=gN("start","end","cancel","interrupt"),Vde=[],e$=0,t$=1,tB=2,ib=3,n$=4,nB=5,ob=6;function lb(e,t,n,r,a,i){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Ode(e,n,{name:t,index:r,group:a,on:Fde,tween:Vde,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:e$})}function rB(e,t){var n=Op(e,t);if(n.state>e$)throw new Error("too late; already scheduled");return n}function $0(e,t){var n=Op(e,t);if(n.state>ib)throw new Error("too late; already running");return n}function Op(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Ode(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=ZN(i,0,n.time);function i(f){n.state=t$,n.timer.restart(o,n.delay,n.time),n.delay<=f&&o(f-n.delay)}function o(f){var A,h,m,g;if(n.state!==t$)return c();for(A in r)if(g=r[A],g.name===n.name){if(g.state===ib)return qN(o);g.state===n$?(g.state=ob,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[A]):+A<t&&(g.state=ob,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[A])}if(qN(function(){n.state===ib&&(n.state=n$,n.timer.restart(s,n.delay,n.time),s(f))}),n.state=tB,n.on.call("start",e,e.__data__,n.index,n.group),n.state===tB){for(n.state=ib,a=new Array(m=n.tween.length),A=0,h=-1;A<m;++A)(g=n.tween[A].value.call(e,e.__data__,n.index,n.group))&&(a[++h]=g);a.length=h+1}}function s(f){for(var A=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=nB,1),h=-1,m=a.length;++h<m;)a[h].call(e,A);n.state===nB&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=ob,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Qde(e,t){var n=e.__transition,r,a,i=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){i=!1;continue}a=r.state>tB&&r.state<nB,r.state=ob,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}i&&delete e.__transition}}function zde(e){return this.each(function(){Qde(this,e)})}function Ude(e,t){var n,r;return function(){var a=$0(this,e),i=a.tween;if(i!==n){r=n=i;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}a.tween=r}}function jde(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var i=$0(this,e),o=i.tween;if(o!==r){a=(r=o).slice();for(var s={name:t,value:n},c=0,f=a.length;c<f;++c)if(a[c].name===t){a[c]=s;break}c===f&&a.push(s)}i.tween=a}}function Gde(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Op(this.node(),n).tween,a=0,i=r.length,o;a<i;++a)if((o=r[a]).name===e)return o.value;return null}return this.each((t==null?Ude:jde)(n,e,t))}function aB(e,t,n){var r=e._id;return e.each(function(){var a=$0(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return Op(a,r).value[t]}}function r$(e,t){var n;return(typeof t=="number"?sm:t instanceof b7?UN:(n=b7(t))?(t=n,UN):Pde)(e,t)}function Yde(e){return function(){this.removeAttribute(e)}}function Wde(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xde(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttribute(e);return o===a?null:o===r?i:i=t(r=o,n)}}function Kde(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===a?null:o===r?i:i=t(r=o,n)}}function Zde(e,t,n){var r,a,i;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+"",o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,s)))}}function Jde(e,t,n){var r,a,i;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+"",o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,s)))}}function qde(e,t){var n=WC(e),r=n==="transform"?Ide:r$;return this.attrTween(e,typeof t=="function"?(n.local?Jde:Zde)(n,r,aB(this,"attr."+e,t)):t==null?(n.local?Wde:Yde)(n):(n.local?Kde:Xde)(n,r,t))}function eAe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function tAe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function nAe(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&tAe(e,i)),n}return a._value=t,a}function rAe(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&eAe(e,i)),n}return a._value=t,a}function aAe(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=WC(e);return this.tween(n,(r.local?nAe:rAe)(r,t))}function iAe(e,t){return function(){rB(this,e).delay=+t.apply(this,arguments)}}function oAe(e,t){return t=+t,function(){rB(this,e).delay=t}}function lAe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?iAe:oAe)(t,e)):Op(this.node(),t).delay}function sAe(e,t){return function(){$0(this,e).duration=+t.apply(this,arguments)}}function uAe(e,t){return t=+t,function(){$0(this,e).duration=t}}function cAe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?sAe:uAe)(t,e)):Op(this.node(),t).duration}function fAe(e,t){if(typeof t!="function")throw new Error;return function(){$0(this,e).ease=t}}function dAe(e){var t=this._id;return arguments.length?this.each(fAe(t,e)):Op(this.node(),t).ease}function AAe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;$0(this,e).ease=n}}function pAe(e){if(typeof e!="function")throw new Error;return this.each(AAe(this._id,e))}function hAe(e){typeof e!="function"&&(e=EN(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,s=r[a]=[],c,f=0;f<o;++f)(c=i[f])&&e.call(c,c.__data__,f,i)&&s.push(c);return new Vh(r,this._parents,this._name,this._id)}function mAe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,i=Math.min(r,a),o=new Array(r),s=0;s<i;++s)for(var c=t[s],f=n[s],A=c.length,h=o[s]=new Array(A),m,g=0;g<A;++g)(m=c[g]||f[g])&&(h[g]=m);for(;s<r;++s)o[s]=t[s];return new Vh(o,this._parents,this._name,this._id)}function vAe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function gAe(e,t,n){var r,a,i=vAe(t)?rB:$0;return function(){var o=i(this,e),s=o.on;s!==r&&(a=(r=s).copy()).on(t,n),o.on=a}}function yAe(e,t){var n=this._id;return arguments.length<2?Op(this.node(),n).on.on(e):this.each(gAe(n,e,t))}function wAe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function CAe(){return this.on("end.remove",wAe(this._id))}function bAe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=GS(e));for(var r=this._groups,a=r.length,i=new Array(a),o=0;o<a;++o)for(var s=r[o],c=s.length,f=i[o]=new Array(c),A,h,m=0;m<c;++m)(A=s[m])&&(h=e.call(A,A.__data__,m,s))&&("__data__"in A&&(h.__data__=A.__data__),f[m]=h,lb(f[m],t,n,m,f,Op(A,n)));return new Vh(i,this._parents,t,n)}function EAe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bN(e));for(var r=this._groups,a=r.length,i=[],o=[],s=0;s<a;++s)for(var c=r[s],f=c.length,A,h=0;h<f;++h)if(A=c[h]){for(var m=e.call(A,A.__data__,h,c),g,b=Op(A,n),C=0,x=m.length;C<x;++C)(g=m[C])&&lb(g,t,n,C,m,b);i.push(m),o.push(A)}return new Vh(i,o,t,n)}var xAe=g7.prototype.constructor;function SAe(){return new xAe(this._groups,this._parents)}function BAe(e,t){var n,r,a;return function(){var i=n3(this,e),o=(this.style.removeProperty(e),n3(this,e));return i===o?null:i===n&&o===r?a:a=t(n=i,r=o)}}function a$(e){return function(){this.style.removeProperty(e)}}function kAe(e,t,n){var r,a=n+"",i;return function(){var o=n3(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}function TAe(e,t,n){var r,a,i;return function(){var o=n3(this,e),s=n(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),n3(this,e))),o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,s))}}function _Ae(e,t){var n,r,a,i="style."+t,o="end."+i,s;return function(){var c=$0(this,e),f=c.on,A=c.value[i]==null?s||(s=a$(t)):void 0;(f!==n||a!==A)&&(r=(n=f).copy()).on(o,a=A),c.on=r}}function PAe(e,t,n){var r=(e+="")=="transform"?Hde:r$;return t==null?this.styleTween(e,BAe(e,r)).on("end.style."+e,a$(e)):typeof t=="function"?this.styleTween(e,TAe(e,r,aB(this,"style."+e,t))).each(_Ae(this._id,e)):this.styleTween(e,kAe(e,r,t),n).on("end.style."+e,null)}function MAe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function DAe(e,t,n){var r,a;function i(){var o=t.apply(this,arguments);return o!==a&&(r=(a=o)&&MAe(e,o,n)),r}return i._value=t,i}function HAe(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,DAe(e,t,n??""))}function IAe(e){return function(){this.textContent=e}}function LAe(e){return function(){var t=e(this);this.textContent=t??""}}function RAe(e){return this.tween("text",typeof e=="function"?LAe(aB(this,"text",e)):IAe(e==null?"":e+""))}function NAe(e){return function(t){this.textContent=e.call(this,t)}}function $Ae(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&NAe(a)),t}return r._value=e,r}function FAe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,$Ae(e))}function VAe(){for(var e=this._name,t=this._id,n=i$(),r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],s=o.length,c,f=0;f<s;++f)if(c=o[f]){var A=Op(c,t);lb(c,e,n,f,o,{time:A.time+A.delay+A.duration,delay:0,duration:A.duration,ease:A.ease})}return new Vh(r,this._parents,e,n)}function OAe(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(i,o){var s={value:o},c={value:function(){--a===0&&i()}};n.each(function(){var f=$0(this,r),A=f.on;A!==e&&(t=(e=A).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),f.on=t}),a===0&&i()})}var QAe=0;function Vh(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function i$(){return++QAe}var Oh=g7.prototype;Vh.prototype={constructor:Vh,select:bAe,selectAll:EAe,selectChild:Oh.selectChild,selectChildren:Oh.selectChildren,filter:hAe,merge:mAe,selection:SAe,transition:VAe,call:Oh.call,nodes:Oh.nodes,node:Oh.node,size:Oh.size,empty:Oh.empty,each:Oh.each,on:yAe,attr:qde,attrTween:aAe,style:PAe,styleTween:HAe,text:RAe,textTween:FAe,remove:CAe,tween:Gde,delay:lAe,duration:cAe,ease:dAe,easeVarying:pAe,end:OAe,[Symbol.iterator]:Oh[Symbol.iterator]};function zAe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var UAe={time:null,delay:0,duration:250,ease:zAe};function jAe(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function GAe(e){var t,n;e instanceof Vh?(t=e._id,e=e._name):(t=i$(),(n=UAe).time=qS(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],s=o.length,c,f=0;f<s;++f)(c=o[f])&&lb(c,e,t,f,o,n||jAe(c,t));return new Vh(r,this._parents,e,t)}g7.prototype.interrupt=zde,g7.prototype.transition=GAe;function YAe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function sb(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function WAe(e){return e=sb(Math.abs(e)),e?e[1]:NaN}function XAe(e,t){return function(n,r){for(var a=n.length,i=[],o=0,s=e[0],c=0;a>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),i.push(n.substring(a-=s,a+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return i.reverse().join(t)}}function KAe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var ZAe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function iB(e){if(!(t=ZAe.exec(e)))throw new Error("invalid format: "+e);var t;return new oB({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}iB.prototype=oB.prototype;function oB(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}oB.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function JAe(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var o$;function qAe(e,t){var n=sb(e,t);if(!n)return e+"";var r=n[0],a=n[1],i=a-(o$=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+sb(e,Math.max(0,t+i-1))[0]}function l$(e,t){var n=sb(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const s$={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:YAe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>l$(e*100,t),r:l$,s:qAe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function u$(e){return e}var c$=Array.prototype.map,f$=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function epe(e){var t=e.grouping===void 0||e.thousands===void 0?u$:XAe(c$.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?u$:KAe(c$.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function f(h){h=iB(h);var m=h.fill,g=h.align,b=h.sign,C=h.symbol,x=h.zero,k=h.width,_=h.comma,D=h.precision,O=h.trim,I=h.type;I==="n"?(_=!0,I="g"):s$[I]||(D===void 0&&(D=12),O=!0,I="g"),(x||m==="0"&&g==="=")&&(x=!0,m="0",g="=");var $=C==="$"?n:C==="#"&&/[boxX]/.test(I)?"0"+I.toLowerCase():"",Q=C==="$"?r:/[%p]/.test(I)?o:"",ee=s$[I],K=/[defgprs%]/.test(I);D=D===void 0?6:/[gprs]/.test(I)?Math.max(1,Math.min(21,D)):Math.max(0,Math.min(20,D));function re(U){var G=$,Z=Q,Y,X,oe;if(I==="c")Z=ee(U)+Z,U="";else{U=+U;var me=U<0||1/U<0;if(U=isNaN(U)?c:ee(Math.abs(U),D),O&&(U=JAe(U)),me&&+U==0&&b!=="+"&&(me=!1),G=(me?b==="("?b:s:b==="-"||b==="("?"":b)+G,Z=(I==="s"?f$[8+o$/3]:"")+Z+(me&&b==="("?")":""),K){for(Y=-1,X=U.length;++Y<X;)if(oe=U.charCodeAt(Y),48>oe||oe>57){Z=(oe===46?a+U.slice(Y+1):U.slice(Y))+Z,U=U.slice(0,Y);break}}}_&&!x&&(U=t(U,1/0));var ae=G.length+U.length+Z.length,ye=ae<k?new Array(k-ae+1).join(m):"";switch(_&&x&&(U=t(ye+U,ye.length?k-Z.length:1/0),ye=""),g){case"<":U=G+U+Z+ye;break;case"=":U=G+ye+U+Z;break;case"^":U=ye.slice(0,ae=ye.length>>1)+G+U+Z+ye.slice(ae);break;default:U=ye+G+U+Z;break}return i(U)}return re.toString=function(){return h+""},re}function A(h,m){var g=f((h=iB(h),h.type="f",h)),b=Math.max(-8,Math.min(8,Math.floor(WAe(m)/3)))*3,C=Math.pow(10,-b),x=f$[8+b/3];return function(k){return g(C*k)+x}}return{format:f,formatPrefix:A}}var ub;tpe({thousands:",",grouping:[3],currency:["$",""]});function tpe(e){return ub=epe(e),ub.format,ub.formatPrefix,ub}function k7(e,t,n){this.k=e,this.x=t,this.y=n}k7.prototype={constructor:k7,scale:function(e){return e===1?this:new k7(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new k7(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},k7.prototype;const npe={ref:"chipRoot",class:"dnd-double-chip__group"},rpe={class:"dnd-double-chip__top"},ape={key:0,class:"dnd-basket-chip__handler"},ipe=["title"],ope={class:"dnd-double-chip__title"},lpe=["innerHTML"],spe={class:"dnd-double-chip__bottom"},upe={key:0,class:"dnd-basket-chip__fixed-axes-block"},cpe=d.defineComponent({__name:"DndDoubleChip",props:d.mergeModels({info:{},error:{type:Boolean},searchOptions:{type:Function},sortable:{type:Boolean}},{filter:{required:!0},filterModifiers:{},fixedAxes:{default:{}},fixedAxesModifiers:{}}),emits:d.mergeModels(["close-chip","update:filter","update:fixedAxes"],["update:filter","update:fixedAxes"]),setup(e,{emit:t}){var c;const n=e,r=t,a=da(),i=d.useModel(e,"filter"),o=d.useModel(e,"fixedAxes"),s=d.ref((c=a.value.uniqueValuesData.value[n.info.id])==null?void 0:c.options);return d.watch(()=>a.value.uniqueValuesData.value,f=>{var h;const A=(h=f[n.info.id])==null?void 0:h.options;A&&(s.value=A),n.info.axesToBeFixed.forEach(m=>{o.value[m].axisValue===void 0&&f[m]&&(o.value[m].axisValue=f[m].list[0],r("update:fixedAxes",o.value))})},{immediate:!0}),d.watch(()=>s.value,async f=>{!f||!f.length||i.value===void 0&&(i.value=f[0].value)},{immediate:!0}),(f,A)=>(d.openBlock(),d.createElementBlock("div",npe,[d.createElementVNode("div",{class:d.normalizeClass([{error:f.error,sortable:f.sortable},"dnd-double-chip"])},[d.createElementVNode("div",rpe,[d.createElementVNode("div",{class:d.normalizeClass(["dnd-double-chip__icon",{error:f.error}])},[f.error?(d.openBlock(),d.createBlock(d.unref(pt.PlMaskIcon16),{key:0,name:"warning"})):(d.openBlock(),d.createBlock(d.unref(q5),{key:1,name:f.info.isSubsetFilter?"cell-type-subset":f.info.type==="String"?"cell-type-txt":"cell-type-num"},null,8,["name"]))],2),f.sortable?(d.openBlock(),d.createElementBlock("div",ape)):d.createCommentVNode("",!0),d.createVNode(d.unref(pt.PlMaskIcon16),{name:"drag-dots"}),d.createElementVNode("div",{class:"dnd-double-chip__title-wrapper",title:f.info.title},[d.createElementVNode("div",ope,d.toDisplayString(f.info.title),1)],8,ipe),d.createElementVNode("div",{innerHTML:d.unref(HS),class:"dnd-double-chip__icon-close",onClick:A[0]||(A[0]=h=>f.$emit("close-chip",n.info.id))},null,8,lpe)]),d.createElementVNode("div",spe,[s.value===void 0||s.value.length<1e3?(d.openBlock(),d.createBlock(d.unref(pt.PlDropdown),{key:0,modelValue:i.value,"onUpdate:modelValue":A[1]||(A[1]=h=>i.value=h),options:s.value},null,8,["modelValue","options"])):(d.openBlock(),d.createBlock(d.unref(jC),{key:1,modelValue:i.value,"onUpdate:modelValue":A[2]||(A[2]=h=>i.value=h),"options-search":h=>f.searchOptions(n.info.id,h)},null,8,["modelValue","options-search"]))])],2),f.info.axesToBeFixed.length>0?(d.openBlock(),d.createElementBlock("div",upe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.info.axesToBeFixed,h=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:h},[o.value[h]?(d.openBlock(),d.createBlock(d.unref(jC),{key:0,modelValue:o.value[h].axisValue,"onUpdate:modelValue":[m=>o.value[h].axisValue=m,A[3]||(A[3]=m=>f.$emit("update:fixedAxes",o.value))],"options-search":m=>f.searchOptions(h,m),label:f.info.axesToBeFixedInfo[h].title},null,8,["modelValue","onUpdate:modelValue","options-search","label"])):d.createCommentVNode("",!0)],64))),128))])):d.createCommentVNode("",!0)],512))}}),fpe={key:0,class:"dnd-basket-chip__handler"},dpe={class:"dnd-basket-chip__title-wrapper"},Ape=["title"],ppe=["title"],hpe=["innerHTML"],mpe={key:0,class:"dnd-basket-chip__fixed-axes-block"},vpe=d.defineComponent({__name:"DnDBasketChip",props:d.mergeModels({error:{type:Boolean},info:{},sortable:{type:Boolean},searchOptions:{type:Function}},{modelValue:{default:{}},modelModifiers:{}}),emits:d.mergeModels(["close-chip","update:modelValue"],["update:modelValue"]),setup(e,{emit:t}){const n=e,r=da(),a=d.useModel(e,"modelValue"),i=t,o=d.ref(),s=d.computed(()=>n.info.uniqueValues.join("/"));function c(){i("close-chip",n.info.id)}return d.watch(()=>r.value.uniqueValuesData.value,f=>{n.info.axesToBeFixed.forEach(A=>{a.value[A].axisValue===void 0&&(a.value[A].axisValue=f[A].list[0])})},{immediate:!0}),(f,A)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"chipRoot",ref:o,class:"dnd-basket-chip__group"},[d.createElementVNode("div",{class:d.normalizeClass([{error:f.error,sortable:f.sortable},"dnd-basket-chip"])},[d.createElementVNode("div",{class:d.normalizeClass(["dnd-basket-chip__icon",{error:f.error}])},[f.error?(d.openBlock(),d.createBlock(d.unref(WR),{key:0,name:"warning"})):(d.openBlock(),d.createBlock(d.unref(q5),{key:1,name:f.info.isSubsetFilter?"cell-type-subset":f.info.type==="String"?"cell-type-txt":"cell-type-num"},null,8,["name"]))],2),f.sortable?(d.openBlock(),d.createElementBlock("div",fpe)):d.createCommentVNode("",!0),d.createVNode(d.unref(WR),{name:"drag-dots"}),d.createElementVNode("div",dpe,[d.createElementVNode("div",{class:"dnd-basket-chip__title",title:f.info.title},d.toDisplayString(f.info.title),9,Ape),f.info.nonHomogenous?(d.openBlock(),d.createElementBlock("div",{key:0,class:"dnd-basket-chip__sub-title",title:s.value},d.toDisplayString(s.value),9,ppe)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{innerHTML:d.unref(HS),class:"dnd-basket-chip__icon-close",onClick:c},null,8,hpe)],2),f.info.axesToBeFixed.length>0?(d.openBlock(),d.createElementBlock("div",mpe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.info.axesToBeFixed,h=>(d.openBlock(),d.createBlock(d.unref(jC),{key:h,modelValue:a.value[h].axisValue,"onUpdate:modelValue":[m=>a.value[h].axisValue=m,A[0]||(A[0]=m=>f.$emit("update:modelValue",a.value))],"options-search":m=>f.searchOptions(h,m),label:f.info.axesToBeFixedInfo[h].title},null,8,["modelValue","onUpdate:modelValue","options-search","label"]))),128))])):d.createCommentVNode("",!0)],512))}}),gpe={ref:"chipRoot",class:"dnd-double-chip__group"},ype={class:"dnd-double-chip__top"},wpe={class:"dnd-double-chip__icon"},Cpe=["title"],bpe={class:"dnd-double-chip__title"},Epe=["innerHTML"],xpe={class:"dnd-double-chip__bottom-range"},Spe={class:"dnd-double-chip__bottom-range-row"},Bpe={class:"dnd-double-chip__bottom-range-row"},kpe={key:0,class:"dnd-basket-chip__fixed-axes-block"},Tpe=d.defineComponent({__name:"DnDRangeChip",props:d.mergeModels({info:{},error:{type:Boolean},searchOptions:{type:Function}},{filter:{required:!0},filterModifiers:{},fixedAxes:{required:!0},fixedAxesModifiers:{}}),emits:d.mergeModels(["close-chip","update:fixedAxes"],["update:filter","update:fixedAxes"]),setup(e,{emit:t}){var c,f;const n=e,r=da(),a=t,i=d.useModel(e,"filter"),o=d.useModel(e,"fixedAxes"),s=d.reactive({min:(c=i.value)==null?void 0:c[0],max:(f=i.value)==null?void 0:f[1]});return d.watch(()=>s,A=>{i.value=A},{deep:!0}),d.watch(()=>r.value.uniqueValuesData.value,A=>{n.info.axesToBeFixed.forEach(h=>{o.value[h].axisValue===void 0&&A[h]&&(o.value[h].axisValue=A[h].list[0],a("update:fixedAxes",o.value))})},{immediate:!0}),(A,h)=>(d.openBlock(),d.createElementBlock("div",gpe,[d.createElementVNode("div",{class:d.normalizeClass([{error:A.error},"dnd-double-chip"])},[d.createElementVNode("div",ype,[d.createElementVNode("div",wpe,[d.createVNode(d.unref(q5),{name:"cell-type-num"})]),d.createElementVNode("div",{class:"dnd-double-chip__title-wrapper",title:A.info.title},[d.createElementVNode("div",bpe,d.toDisplayString(A.info.title),1)],8,Cpe),d.createElementVNode("div",{innerHTML:d.unref(HS),class:"dnd-double-chip__icon-close",onClick:h[0]||(h[0]=m=>A.$emit("close-chip",n.info.id))},null,8,Epe)]),d.createElementVNode("div",xpe,[d.createElementVNode("div",Spe,[d.createVNode(d.unref(pt.PlNumberField),{label:"Min",modelValue:s.min,"onUpdate:modelValue":h[1]||(h[1]=m=>s.min=m),updateOnEnterOrClickOutside:!0,useIncrementButtons:!1},null,8,["modelValue"])]),d.createElementVNode("div",Bpe,[d.createVNode(d.unref(pt.PlNumberField),{label:"Max",modelValue:s.max,"onUpdate:modelValue":h[2]||(h[2]=m=>s.max=m),updateOnEnterOrClickOutside:!0,useIncrementButtons:!1},null,8,["modelValue"])])])],2),A.info.axesToBeFixed.length>0?(d.openBlock(),d.createElementBlock("div",kpe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(A.info.axesToBeFixed,m=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:m},[o.value[m]?(d.openBlock(),d.createBlock(d.unref(jC),{key:0,modelValue:o.value[m].axisValue,"onUpdate:modelValue":[g=>o.value[m].axisValue=g,h[3]||(h[3]=g=>A.$emit("update:fixedAxes",o.value))],"options-search":g=>A.searchOptions(m,g),label:A.info.axesToBeFixedInfo[m].title},null,8,["modelValue","onUpdate:modelValue","options-search","label"])):d.createCommentVNode("",!0)],64))),128))])):d.createCommentVNode("",!0)],512))}}),_pe={class:"dnd-basket__title"},Ppe={key:0,class:"dnd-basket__required"},Mpe={class:"dnd-basket__drop-container"},Dpe={key:0,class:"dnd-basket__placeholder"},Hpe=100,Wv=d.defineComponent({__name:"DndBasket",props:{id:{},title:{},multiple:{type:Boolean},isFilter:{type:Boolean},required:{type:Boolean},disabled:{type:Boolean},readonly:{type:Boolean},consistency:{},labelsInfo:{},droppedIds:{},availableIds:{},selectedFilters:{},selectedRanges:{},fixedAxes:{},info:{},draggedId:{},sortable:{type:Boolean}},emits:["drop-item","remove-item","select-filter-value","select-filter-range","select-fixed-axis-value","reorder"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.ref(),o=d.ref(0);let s=d.reactive(n.selectedFilters??{}),c=d.reactive(n.selectedRanges??{}),f=d.reactive(n.fixedAxes??{});const A=d.computed(()=>!(n.disabled||!n.multiple&&n.droppedIds.length>0)),h=d.computed(()=>n.disabled?"1 true":!A.value&&n.draggedId?"2 true":!1);d.watch(()=>n.selectedFilters,()=>{s=d.reactive(n.selectedFilters??{})}),d.watch(()=>n.fixedAxes,()=>{f=d.reactive(n.fixedAxes??{})}),d.watch(()=>n.droppedIds,()=>{o.value++},{deep:!0}),n.sortable&&pt.useSortable(i,{handle:".dnd-basket-chip__handler",onChange(_){r("reorder",_.map(D=>n.droppedIds[D]))}});function m(){a.value&&!n.disabled&&A.value&&a.value.classList.add("active")}function g(){a.value&&a.value.classList.remove("active")}function b(_){_.stopPropagation(),A.value&&(n.draggedId&&r("drop-item",{draggedId:n.draggedId,id:n.id}),g())}function C(_){_.preventDefault()}function x(_){_.preventDefault(),m()}const k=async(_,D)=>{var $;const O=(($=n.labelsInfo[_])==null?void 0:$.options)??[],I=D.toLowerCase();return O.filter(Q=>Q.value.toLowerCase().includes(I)||Q.label.toLowerCase().includes(I)).slice(0,Hpe)};return(_,D)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"basketRoot",ref:a,class:d.normalizeClass([{disabled:h.value,empty:_.droppedIds.length===0,readonly:_.readonly},"dnd-basket"]),dropzone:"true",onDrop:b,onDragenter:C,onDragover:x,onDragleave:g},[d.createElementVNode("div",_pe,[_.required?(d.openBlock(),d.createElementBlock("span",Ppe,D[0]||(D[0]=[d.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"16",viewBox:"0 0 6 16",fill:"none"},[d.createElementVNode("path",{d:"M2.01685 6.8L3 5.34159L3.97612 6.8L4.89607 6.12743L3.81461 4.7469L5.5 4.25133L5.14888 3.16106L3.50562 3.77699L3.56882 2H2.43118L2.49438 3.77699L0.851124 3.16106L0.5 4.25133L2.18539 4.7469L1.09691 6.12743L2.01685 6.8Z",fill:"#F1222F"})],-1)]))):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(_.title),1)]),d.createElementVNode("div",Mpe,[_.droppedIds.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Dpe," Drop dimensions here ")),(d.openBlock(),d.createElementBlock("div",{ref_key:"listRef",ref:i,key:o.value,class:"dnd-basket__chip-wrapper"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(_.droppedIds,(O,I)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:O},[!_.isFilter||_.info[O].isSubsetFilter?(d.openBlock(),d.createBlock(vpe,{key:0,modelValue:d.unref(f)[O],"onUpdate:modelValue":[$=>d.unref(f)[O]=$,$=>_.$emit("select-fixed-axis-value",{v:$,idx:I})],sortable:_.sortable,error:_.consistency[O]===!1,info:_.info[O],"search-options":k,onCloseChip:$=>_.$emit("remove-item",{chipId:O,basketId:_.id})},null,8,["modelValue","onUpdate:modelValue","sortable","error","info","onCloseChip"])):_.info[O].isDiscreteFilter?(d.openBlock(),d.createBlock(cpe,{key:1,filter:d.unref(s)[O],"onUpdate:filter":[$=>d.unref(s)[O]=$,$=>_.$emit("select-filter-value",{v:$,idx:I})],"fixed-axes":d.unref(f)[O],"onUpdate:fixedAxes":[$=>d.unref(f)[O]=$,$=>_.$emit("select-fixed-axis-value",{v:$,idx:I})],info:_.info[O],error:_.consistency[O]===!1,sortable:_.sortable,"search-options":k,onCloseChip:$=>_.$emit("remove-item",{chipId:O,basketId:_.id})},null,8,["filter","onUpdate:filter","fixed-axes","onUpdate:fixedAxes","info","error","sortable","onCloseChip"])):(d.openBlock(),d.createBlock(Tpe,{key:2,filter:d.unref(c)[O],"onUpdate:filter":[$=>d.unref(c)[O]=$,$=>_.$emit("select-filter-range",{v:$,idx:I})],"fixed-axes":d.unref(f)[O],"onUpdate:fixedAxes":[$=>d.unref(f)[O]=$,$=>_.$emit("select-fixed-axis-value",{v:$,idx:I})],info:_.info[O],error:_.consistency[O]===!1,"search-options":k,onCloseChip:$=>_.$emit("remove-item",{chipId:O,basketId:_.id})},null,8,["filter","onUpdate:filter","fixed-axes","onUpdate:fixedAxes","info","error","onCloseChip"]))],64))),128))]))])],34))}}),Ipe={class:"inputs-block"},Lpe={class:"separator"},Rpe={class:"arrow-circle"},Npe={class:"inputs-block"},Xv=d.defineComponent({__name:"FormLayout",setup(e){return(t,n)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",{class:"left-block",onClick:n[0]||(n[0]=r=>r.stopPropagation())},[n[2]||(n[2]=d.createElementVNode("h3",null," Data Mapping ",-1)),d.createElementVNode("div",Ipe,[d.renderSlot(t.$slots,"dataInputs"),d.renderSlot(t.$slots,"mandatoryOptions"),d.renderSlot(t.$slots,"metadataOptions")])]),d.createElementVNode("div",Lpe,[d.createElementVNode("div",Rpe,[d.createVNode(d.unref(pt.PlIcon16),{name:"arrow-right"})])]),d.createElementVNode("div",{class:"right-block",onClick:n[1]||(n[1]=r=>r.stopPropagation())},[n[3]||(n[3]=d.createElementVNode("h3",null," Chart variables ",-1)),d.createElementVNode("div",Npe,[d.renderSlot(t.$slots,"chartVar")])])],64))}}),$pe={class:"dnd-chip__icon"},Fpe={class:"dnd-chip__title-wrapper"},Vpe=["title"],Ope=["title"],cb=d.defineComponent({__name:"DndChip",props:{info:{}},emits:["dragstart","dragend"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.computed(()=>n.info.uniqueValues.join("/"));function o(c){var f,A;(f=c.dataTransfer)==null||f.clearData(),(A=c.dataTransfer)==null||A.setData("text/plain",n.info.id),r("dragstart",n.info.id),c.target.style.opacity="0.4",a.value&&a.value.classList.toggle("drag-active")}function s(c){r("dragend",n.info.id),c.target.style.opacity="1",a.value&&a.value.classList.toggle("drag-active")}return(c,f)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"chipRoot",ref:a,draggable:"true",class:"dnd-chip",onDragstart:o,onDragend:s},[d.createElementVNode("div",$pe,[d.createVNode(d.unref(q5),{name:c.info.isSubsetFilter?"cell-type-subset":c.info.type==="String"?"cell-type-txt":"cell-type-num"},null,8,["name"])]),d.createElementVNode("div",Fpe,[d.createElementVNode("div",{class:"dnd-chip__title",title:c.info.title},d.toDisplayString(c.info.title),9,Vpe),c.info.nonHomogenous?(d.openBlock(),d.createElementBlock("div",{key:0,class:"dnd-chip__sub-title",title:i.value},d.toDisplayString(i.value),9,Ope)):d.createCommentVNode("",!0)])],544))}}),Qpe={key:0,class:"metadata-block"},zpe={class:"title"},Upe={class:"metadata-block__search"},jpe={class:"metadata-block__items"},T7=d.defineComponent({__name:"OptionsList",props:{options:{},chipInfo:{},title:{default:"Metadata"}},emits:["dragged-id-update"],setup(e,{emit:t}){const n=e,r=d.computed(()=>n.options.length===0),a=d.ref(),i=d.computed(()=>{var s;const o=((s=a.value)==null?void 0:s.toLowerCase())??"";return n.options.filter(c=>{const f=n.chipInfo[c.id].title??"";return f==null?void 0:f.toLowerCase().includes(o)})});return(o,s)=>r.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Qpe,[d.createElementVNode("div",zpe,d.toDisplayString(o.title),1),d.createElementVNode("div",Upe,[d.createVNode(d.unref(pt.PlSearchField),{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=c=>a.value=c),placeholder:"Find...",clearable:""},null,8,["modelValue"])]),d.createElementVNode("div",jpe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,({id:c})=>(d.openBlock(),d.createBlock(cb,{key:c,info:o.chipInfo[c],onDragstart:s[1]||(s[1]=f=>o.$emit("dragged-id-update",f)),onDragend:s[2]||(s[2]=f=>o.$emit("dragged-id-update",null))},null,8,["info"]))),128))])]))}}),Gpe={key:0,class:"metadata-block",style:{flexShrink:0}},Ype={class:"title"},Wpe={class:"metadata-block__items"},_7=d.defineComponent({__name:"MandatoryOptions",props:{options:{},chipInfo:{},title:{default:"Drag to build the chart"}},emits:["dragged-id-update"],setup(e,{emit:t}){const n=e,r=d.computed(()=>n.options.length===0);return(a,i)=>r.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Gpe,[d.createElementVNode("div",Ype,d.toDisplayString(a.title),1),d.createElementVNode("div",Wpe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.options,({id:o})=>(d.openBlock(),d.createBlock(cb,{key:o,info:a.chipInfo[o],onDragstart:i[0]||(i[0]=s=>a.$emit("dragged-id-update",s)),onDragend:i[1]||(i[1]=s=>a.$emit("dragged-id-update",null))},null,8,["info"]))),128))])]))}});function i3(e,t,n,r,a,i){const o=e.value.reactive.optionsState,s=d.toRef(e.value.reactive,"optionsState"),c=d.computed(()=>e.value.inputGuide.value),f=d.computed(()=>e.value.uniqueValuesData.value);function A(X){return OR(s,X,e.value.controller,e.value.columnsDataStore)}function h(X){return VR(s,X,e.value.controller,e.value.columnsDataStore,c)}function m(X){return FR(s,X,e.value.controller,e.value.columnsDataStore,c)}const g=d.ref({...t.reduce((X,oe)=>(X[oe]=A(oe),X),{})}),b=d.ref({...n.reduce((X,oe)=>(X[oe]=m(oe),X),{}),...r.reduce((X,oe)=>(X[oe]=h(oe),X),{})}),C=d.computed(()=>QR(o,c)),x=d.computed(()=>Zle(c,a)),k=d.computed(()=>Jle(c,a)),_=d.ref(null),D=d.computed(()=>{const X=new Set;return a.forEach(oe=>{C.value[oe].forEach(me=>{X.add(me.value)}),o.components[oe].selectorStates.forEach(me=>{X.add(me.selectedSource)})}),UR(c.value,e.value.uniqueValuesData.value,[...X])});function O(X){return o.components[X].selectorStates.reduce((oe,me)=>(me.type!=="range"&&(oe[me.selectedSource]=me.selectedFilterValue),oe),{})}function I(X){return o.components[X].selectorStates.reduce((oe,me)=>(oe[me.selectedSource]=me.selectedFilterRange?[me.selectedFilterRange.min,me.selectedFilterRange.max]:me.selectedFilterValue?[Number(me.selectedFilterValue),Number(me.selectedFilterValue)]:[0,0],oe),{})}function $(X){return o.components[X].selectorStates.reduce((oe,me)=>{const ae=c.value.getSourceInfo(me.selectedSource);return ae.kind==="axis"||(oe[me.selectedSource]=ae.axesToBeFixed.reduce((ye,Ce)=>{var ce;return ye[Ce]=((ce=me.fixedAxes)==null?void 0:ce.find(ge=>ge.axisSource===Ce))??{axisSource:Ce,axisValue:void 0,axisIdx:ae.axesToBeFixedIndexes[Ce]},ye},{})??{}),oe},{})}function Q(X){b.value[X.id]=[...b.value[X.id],X.draggedId],_.value=null}function ee(X){b.value[X.basketId]=b.value[X.basketId].filter(oe=>oe!==X.chipId)}function K(X,oe){b.value[oe]=X}function re(X){return new Set(c.value.components[X].options.map(oe=>oe.value))}function U(X){return c.value.components[X].stateConsistency}function G(X){return!c.value.readyData||C.value[X].length===0||_.value!==null&&!D.value[_.value].availableBasketIds.has(X)}const Z=d.computed(()=>a.map(X=>{var ye;const oe=c.value.components[X],me=X==="filters",ae={id:X,title:i[X],isFilter:me,sortable:X==="tooltipContent",multiple:oe.multipleSelectors,required:oe.required,disabled:G(X),readonly:((ye=e.value.readonlyInputs)==null?void 0:ye.includes(X))??!1,consistency:U(X),draggedId:_.value,availableIds:re(X),droppedIds:b.value[X],info:D.value,fixedAxes:$(X),labelsInfo:f.value,listeners:{"drop-item":Q,"remove-item":ee,reorder:Ce=>K(Ce,X),"select-fixed-axis-value":Ce=>{const ce=o.components[X].selectorStates[Ce.idx];ce.fixedAxes=Object.values(Ce.v);for(const ge of Object.values(o.components))for(const ze of ge.selectorStates)ce.fixedAxes.forEach(Ne=>{ze.fixedAxes&&(ze.fixedAxes=ze.fixedAxes.map(Ge=>({...Ge,axisValue:Ne.axisSource===Ge.axisSource?Ne.axisValue:Ge.axisValue})))})}}};return me&&(ae.selectedFilters=O(X),ae.selectedRanges=I(X),ae.listeners["select-filter-value"]=Ce=>{const ce=o.components[X].selectorStates[Ce.idx];ce.type="equals",ce.selectedFilterValue=Ce.v},ae.listeners["select-filter-range"]=Ce=>{const ce=o.components[X].selectorStates[Ce.idx];ce.type="range",ce.selectedFilterRange=Ce.v}),ae}));function Y(){_.value=null}return{draggedId:_,cleanDraggedId:Y,basketsData:Z,freeMetaOptions:x,freeMandatoryOptions:k,chipInfo:D,dataStateValues:g,dataOptions:C}}const Xpe={class:"data-form-input-item"},Kpe=d.defineComponent({__name:"DiscreteForm",setup(e){const t=da();d.watch(()=>t.value.commonHelpersData.primaryGroups.value,PS(t));const n=["filters","primaryGrouping","secondaryGrouping","tabBy","facetBy"],r={filters:"Filter",primaryGrouping:"Primary grouping",secondaryGrouping:"Secondary grouping",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=i3(t,["y"],["filters","tabBy"],["primaryGrouping","secondaryGrouping","facetBy"],n,r);console.log("updatedForm! discrete");const h=d.computed(()=>{var m;return((m=t.value.readonlyInputs)==null?void 0:m.includes("y"))??!1});return(m,g)=>(d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",Xpe,[d.createVNode(d.unref(pt.PlDropdown),{modelValue:d.unref(f).y,"onUpdate:modelValue":g[0]||(g[0]=b=>d.unref(f).y=b),options:d.unref(A).y,disabled:h.value,error:d.unref(Xy)("y",d.unref(t).inputGuide.value),label:"Y:",clearable:!h.value},null,8,["modelValue","options","disabled","error","clearable"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(_7,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:g[1]||(g[1]=b=>a.value=b)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(T7,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:g[2]||(g[2]=b=>a.value=b)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),b=>(d.openBlock(),d.createElementBlock("div",{key:b.id,class:"data-form-input-item"},[d.createVNode(Wv,d.mergeProps({ref_for:!0},b,d.toHandlers(b.listeners)),null,16)]))),128))]),_:1}))}}),Zpe={class:"data-form-input-item"},Jpe={class:"data-form-input-item",style:{"margin-top":"10px"}},qpe=d.defineComponent({__name:"ScatterplotForm",setup(e){const t=da(),n=["filters","grouping","size","shape","tooltipContent","label","tabBy","facetBy"],r={filters:"Filter",grouping:"Grouping / Color",size:"Size",shape:"Shape",tooltipContent:"Tooltip",label:"Label",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=i3(t,["x","y"],["filters","tabBy"],["grouping","size","shape","tooltipContent","label","facetBy"],n,r),h=d.computed(()=>{var g;return((g=t.value.readonlyInputs)==null?void 0:g.includes("x"))??!1}),m=d.computed(()=>{var g;return((g=t.value.readonlyInputs)==null?void 0:g.includes("y"))??!1});return(g,b)=>(d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",Zpe,[d.createVNode(d.unref(pt.PlDropdown),{label:"X:",clearable:"",modelValue:d.unref(f).x,"onUpdate:modelValue":b[0]||(b[0]=C=>d.unref(f).x=C),options:d.unref(A).x,disabled:h.value},null,8,["modelValue","options","disabled"])]),d.createElementVNode("div",Jpe,[d.createVNode(d.unref(pt.PlDropdown),{label:"Y:",clearable:"",modelValue:d.unref(f).y,"onUpdate:modelValue":b[1]||(b[1]=C=>d.unref(f).y=C),options:d.unref(A).y,disabled:m.value},null,8,["modelValue","options","disabled"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(_7,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:b[2]||(b[2]=C=>a.value=C)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(T7,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:b[3]||(b[3]=C=>a.value=C)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),C=>(d.openBlock(),d.createElementBlock("div",{key:C.id,class:"data-form-input-item"},[d.createVNode(Wv,d.mergeProps({ref_for:!0},C,d.toHandlers(C.listeners)),null,16)]))),128))]),_:1}))}}),e0e={class:"data-form-input-item"},t0e={class:"data-form-input-item",style:{"margin-top":"10px"}},n0e=d.defineComponent({__name:"ScatterplotUmapForm",setup(e){const t=da(),n=["filters","grouping","tabBy","tooltipContent","label"],r={filters:"Filter",grouping:"Grouping / Color",tabBy:"Tab by",tooltipContent:"Tooltip",label:"Label"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=i3(t,["x","y"],["filters","tabBy"],["grouping","tooltipContent","label"],n,r),h=d.computed(()=>{var g;return((g=t.value.readonlyInputs)==null?void 0:g.includes("x"))??!1}),m=d.computed(()=>{var g;return((g=t.value.readonlyInputs)==null?void 0:g.includes("y"))??!1});return(g,b)=>(d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",e0e,[d.createVNode(d.unref(pt.PlDropdown),{label:"X:",clearable:"",modelValue:d.unref(f).x,"onUpdate:modelValue":b[0]||(b[0]=C=>d.unref(f).x=C),options:d.unref(A).x,disabled:h.value},null,8,["modelValue","options","disabled"])]),d.createElementVNode("div",t0e,[d.createVNode(d.unref(pt.PlDropdown),{label:"Y:",clearable:"",modelValue:d.unref(f).y,"onUpdate:modelValue":b[1]||(b[1]=C=>d.unref(f).y=C),options:d.unref(A).y,disabled:m.value},null,8,["modelValue","options","disabled"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(_7,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:b[2]||(b[2]=C=>a.value=C)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(T7,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:b[3]||(b[3]=C=>a.value=C)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),C=>(d.openBlock(),d.createElementBlock("div",{key:C.id,class:"data-form-input-item"},[d.createVNode(Wv,d.mergeProps({ref_for:!0},C,d.toHandlers(C.listeners)),null,16)]))),128))]),_:1}))}}),r0e={class:"data-form-input-item"},a0e=d.defineComponent({__name:"HeatmapForm",setup(e){const t=da(),n=["filters","x","y","xGroupBy","yGroupBy","tooltipContent","tabBy","facetBy","annotationsX","annotationsY"],r={filters:"Filter",x:"X",y:"Y",xGroupBy:"X group",yGroupBy:"Y group",tooltipContent:"Tooltip",tabBy:"Tab by",facetBy:"Facet by",annotationsX:"Annotations X",annotationsY:"Annotations Y"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=i3(t,["value"],["filters","tabBy"],["x","y","xGroupBy","yGroupBy","tooltipContent","facetBy","annotationsX","annotationsY"],n,r);console.log("heatmap updates");const h=d.computed(()=>{var m;return((m=t.value.readonlyInputs)==null?void 0:m.includes("value"))??!1});return(m,g)=>(d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",r0e,[d.createVNode(d.unref(pt.PlDropdown),{label:"Data source:",clearable:"",modelValue:d.unref(f).value,"onUpdate:modelValue":g[0]||(g[0]=b=>d.unref(f).value=b),options:d.unref(A).value,disabled:h.value,error:d.unref(Xy)("value",d.unref(t).inputGuide.value)},null,8,["modelValue","options","disabled","error"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(_7,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:g[1]||(g[1]=b=>a.value=b)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(T7,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:g[2]||(g[2]=b=>a.value=b)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),b=>(d.openBlock(),d.createElementBlock("div",{key:b.id,class:"data-form-input-item"},[d.createVNode(Wv,d.mergeProps({ref_for:!0},b,d.toHandlers(b.listeners)),null,16)]))),128))]),_:1}))}}),i0e={class:"data-form-input-item"},o0e={key:0,class:"metadata-block"},l0e={class:"metadata-block__items"},s0e={key:1,class:"metadata-block"},u0e={class:"metadata-block__items"},c0e={key:0,class:"data-form-input-item"},f0e=d.defineComponent({__name:"DendroForm",setup(e){const t=da(),n=t.value.reactive.optionsState,r=d.toRef(t.value.reactive,"optionsState"),a=d.computed(()=>t.value.inputGuide.value),i=d.computed(()=>t.value.uniqueValuesData.value);function o(Z){return OR(r,Z,t.value.controller,t.value.columnsDataStore)}function s(Z){return VR(r,Z,t.value.controller,t.value.columnsDataStore,a)}function c(Z){return FR(r,Z,t.value.controller,t.value.columnsDataStore,a)}const f=d.ref({value:o("value"),tableContent:s("tableContent"),heatmapAnnotation:s("heatmapAnnotation"),heatmapForSequence:s("heatmapForSequence"),filters:c("filters"),tabBy:c("tabBy"),height:s("height"),labels:s("labels"),nodeShape:s("nodeShape"),nodeColor:s("nodeColor"),nodeSize:s("nodeSize"),lineColor:s("lineColor"),heatmapAxis:s("heatmapAxis"),heatmapGroup:s("heatmapGroup")});d.watch(()=>f.value.nodeShape,Z=>{t.value.reactive.layersSettings.dendro.dotShape=Z.length?{type:"nodeShape",value:Z[0]}:K5}),d.watch(()=>f.value.nodeColor,Z=>{t.value.reactive.layersSettings.dendro.dotFill=Z.length?{type:"nodeColor",value:Z[0]}:yo}),d.watch(()=>f.value.lineColor,Z=>{t.value.reactive.layersSettings.dendro.lineColor=Z.length?{type:"lineColor",value:Z[0]}:yo});const A=d.computed(()=>QR(n,a)),h=d.computed(()=>DS(a,g)),m=d.computed(()=>h.value.filter(Z=>Z.info.kind==="axis")),g=["height","tableContent","labels","heatmapAnnotation","heatmapAxis","heatmapGroup","heatmapForSequence","nodeShape","nodeColor","nodeSize","lineColor"],b={height:"Connections length",tableContent:"Table/tooltip content",labels:"Labels",heatmapAnnotation:"Heatmap annotation",heatmapAxis:"Heatmap axis",heatmapGroup:"Heatmap group",heatmapForSequence:"Alignment data",nodeShape:"Node shape",nodeColor:"Node color",nodeSize:"Node size",lineColor:"Line color"},C=d.ref(null),x=d.computed(()=>{const Z=new Set;return g.forEach(Y=>{A.value[Y].forEach(X=>{Z.add(X.value)}),n.components[Y].selectorStates.forEach(X=>{Z.add(X.selectedSource)})}),UR(a.value,i.value,[...Z])});function k(Z){return n.components[Z].selectorStates.reduce((Y,X)=>{const oe=a.value.getSourceInfo(X.selectedSource);return oe.kind==="axis"||(Y[X.selectedSource]=oe.axesToBeFixed.reduce((me,ae)=>{var ye;return me[ae]=((ye=X.fixedAxes)==null?void 0:ye.find(Ce=>Ce.axisSource===ae))??{axisSource:ae,axisValue:void 0,axisIdx:oe.axesToBeFixedIndexes[ae]},me},{})??{}),Y},{})}function _(Z){f.value[Z.id]=[...f.value[Z.id],Z.draggedId],C.value=null}function D(Z,Y){f.value[Y]=Z}function O(Z){f.value[Z.basketId]=f.value[Z.basketId].filter(Y=>Y!==Z.chipId)}function I(Z){return new Set(a.value.components[Z].options.map(Y=>Y.value))}function $(Z){return a.value.components[Z].stateConsistency}function Q(Z){return!a.value.readyData||A.value[Z].length===0||C.value!==null&&!x.value[C.value].availableBasketIds.has(Z)}const ee=d.computed(()=>g.map(Z=>{var oe;const Y=a.value.components[Z];return{id:Z,title:b[Z],isFilter:!1,sortable:Z==="tableContent",multiple:Y.multipleSelectors,required:Y.required,disabled:Q(Z),readonly:((oe=t.value.readonlyInputs)==null?void 0:oe.includes(Z))??!1,consistency:$(Z),draggedId:C.value,availableIds:I(Z),droppedIds:f.value[Z],info:x.value,labelsInfo:i.value,listeners:{"drop-item":_,"remove-item":O,reorder:me=>D(me,Z),"select-fixed-axis-value":me=>{const ae=n.components[Z].selectorStates[me.idx];ae.fixedAxes=Object.values(me.v);for(const ye of Object.values(n.components))for(const Ce of ye.selectorStates)ae.fixedAxes.forEach(ce=>{Ce.fixedAxes&&(Ce.fixedAxes=Ce.fixedAxes.map(ge=>({...ge,axisValue:ce.axisSource===ge.axisSource?ce.axisValue:ge.axisValue})))})}},fixedAxes:k(Z)}}));function K(Z){return Z==="heatmapAxis"||Z==="heatmapGroup"?f.value.heatmapAnnotation!==null:!0}function re(){C.value=null}["value"].forEach(Z=>{d.watch([()=>f.value[Z],()=>A.value],([Y,X])=>{(typeof Y>"u"||zR("value",a.value))&&X[Z]&&X[Z].length&&t.value.controller.changeSelected(Z,t.value.columnsDataStore,t.value.reactive.optionsState,[{selectedSource:X[Z][0].value}])},{immediate:!0})});const G=d.computed(()=>{var Z;return((Z=t.value.readonlyInputs)==null?void 0:Z.includes("value"))??!1});return(Z,Y)=>(d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",i0e,[d.createVNode(d.unref(pt.PlDropdown),{label:"Data source:",modelValue:f.value.value,"onUpdate:modelValue":Y[0]||(Y[0]=X=>f.value.value=X),options:A.value.value,disabled:G.value,error:d.unref(Xy)("value",a.value)},null,8,["modelValue","options","disabled","error"])]),m.value.length>0?(d.openBlock(),d.createElementBlock("div",o0e,[Y[3]||(Y[3]=d.createElementVNode("div",{class:"title"},"Drag to build the chart",-1)),d.createElementVNode("div",l0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,({id:X})=>(d.openBlock(),d.createBlock(cb,{key:X,info:x.value[X],onDragstart:Y[1]||(Y[1]=oe=>C.value=oe),onDragend:re},null,8,["info"]))),128))])])):d.createCommentVNode("",!0),h.value.length>0?(d.openBlock(),d.createElementBlock("div",s0e,[Y[4]||(Y[4]=d.createElementVNode("div",{class:"title"},"Metadata",-1)),d.createElementVNode("div",u0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(h.value,({id:X})=>(d.openBlock(),d.createBlock(cb,{key:X,info:x.value[X],onDragstart:Y[2]||(Y[2]=oe=>C.value=oe),onDragend:re},null,8,["info"]))),128))])])):d.createCommentVNode("",!0)]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(ee.value,X=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:X.id},[K(X.id)?(d.openBlock(),d.createElementBlock("div",c0e,[d.createVNode(Wv,d.mergeProps({ref_for:!0},X,d.toHandlers(X.listeners)),null,16)])):d.createCommentVNode("",!0)],64))),128))]),_:1}))}}),d0e={class:"data-form-input-item"},A0e=d.defineComponent({__name:"HistogramForm",setup(e){const t=da(),n=["filters","tabBy","facetBy"],r={filters:"Filter",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=i3(t,["value"],["filters","tabBy"],["facetBy"],n,r),h=d.computed(()=>{var m;return((m=t.value.readonlyInputs)==null?void 0:m.includes("value"))??!1});return(m,g)=>{const b=d.resolveComponent("MandatoryOptionsList"),C=d.resolveComponent("OptionsList");return d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",d0e,[d.createVNode(d.unref(pt.PlDropdown),{modelValue:d.unref(f).value,"onUpdate:modelValue":g[0]||(g[0]=x=>d.unref(f).value=x),options:d.unref(A).value,disabled:h.value,error:d.unref(Xy)("value",d.unref(t).inputGuide.value),label:"Data value:",clearable:!h.value},null,8,["modelValue","options","disabled","error","clearable"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(b,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:g[1]||(g[1]=x=>a.value=x)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(C,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:g[2]||(g[2]=x=>a.value=x)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),x=>(d.openBlock(),d.createElementBlock("div",{key:x.id,class:"data-form-input-item"},[d.createVNode(Wv,d.mergeProps({ref_for:!0},x,d.toHandlers(x.listeners)),null,16)]))),128))]),_:1})}}}),p0e={class:"data-form-input-item"},h0e={class:"data-form-input-item",style:{"margin-top":"10px"}},m0e=d.defineComponent({__name:"BubbleForm",setup(e){const t=da(),n=["filters","x","y","tooltipContent","tabBy","facetBy"],r={filters:"Filter",x:"X",y:"Y",tooltipContent:"Tooltip",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=i3(t,["valueColor","valueSize"],["filters","tabBy"],["x","y","tooltipContent","facetBy"],n,r),h=d.computed(()=>{var g;return((g=t.value.readonlyInputs)==null?void 0:g.includes("valueColor"))??!1}),m=d.computed(()=>{var g;return((g=t.value.readonlyInputs)==null?void 0:g.includes("valueSize"))??!1});return(g,b)=>(d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",p0e,[d.createVNode(d.unref(pt.PlDropdown),{label:"Data source for color:",clearable:"",modelValue:d.unref(f).valueColor,"onUpdate:modelValue":b[0]||(b[0]=C=>d.unref(f).valueColor=C),disabled:h.value,options:d.unref(A).valueColor,error:d.unref(Xy)("valueColor",d.unref(t).inputGuide.value)},null,8,["modelValue","disabled","options","error"])]),d.createElementVNode("div",h0e,[d.createVNode(d.unref(pt.PlDropdown),{label:"Data source for size:",clearable:"",modelValue:d.unref(f).valueSize,"onUpdate:modelValue":b[1]||(b[1]=C=>d.unref(f).valueSize=C),disabled:m.value,options:d.unref(A).valueSize,error:d.unref(Xy)("valueSize",d.unref(t).inputGuide.value)},null,8,["modelValue","disabled","options","error"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(_7,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:b[2]||(b[2]=C=>a.value=C)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(T7,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:b[3]||(b[3]=C=>a.value=C)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),C=>(d.openBlock(),d.createElementBlock("div",{key:C.id,class:"data-form-input-item"},[d.createVNode(Wv,d.mergeProps({ref_for:!0},C,d.toHandlers(C.listeners)),null,16)]))),128))]),_:1}))}}),v0e={class:"data-form"},g0e=d.defineComponent({__name:"index",setup(e){const t=da();return(n,r)=>(d.openBlock(),d.createElementBlock("div",v0e,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createBlock(Kpe,{key:0})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(),d.createBlock(qpe,{key:1})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(),d.createBlock(n0e,{key:2})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createBlock(a0e,{key:3})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="dendro"?(d.openBlock(),d.createBlock(f0e,{key:4})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createBlock(A0e,{key:5})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createBlock(m0e,{key:6})):d.createCommentVNode("",!0)]))}}),y0e={class:"collapsable-block-content"},ts=d.defineComponent({__name:"CollapsableBlock",props:{iconOpen:{},icon:{},title:{},settings:{}},setup(e){var i,o,s,c,f;const t=e,n=d.ref(((i=t.settings)==null?void 0:i.defaultState)!=="open"),r={},a={};return(o=t.settings)!=null&&o.height&&(a["--title-height"]=`${(s=t.settings)==null?void 0:s.height}px`),(c=t.settings)!=null&&c.horizontalPadding&&(r.padding=`0 ${(f=t.settings)==null?void 0:f.horizontalPadding}px`),(A,h)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["collapsable-block-container",{minimized:n.value,maximized:!n.value}]),style:a},[d.createElementVNode("div",{class:"collapsable-block-title",onClick:h[0]||(h[0]=m=>n.value=!n.value),style:r},[t.icon?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(!n.value&&t.iconOpen?t.iconOpen:t.icon),{key:0})):d.createCommentVNode("",!0),d.createElementVNode("span",null,d.toDisplayString(t.title),1)]),d.createElementVNode("div",y0e,[d.renderSlot(A.$slots,"default")])],2))}}),w0e={},C0e={class:"inline-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function b0e(e,t){return d.openBlock(),d.createElementBlock("svg",C0e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M6 11.3773C6 11.8102 6.51272 12.0386 6.83448 11.749L10.5871 8.37165C10.8077 8.17303 10.8077 7.82697 10.5871 7.62835L6.83448 4.25103C6.51272 3.96145 6 4.1898 6 4.62268V11.3773Z",fill:"#CFD1DB"},null,-1)]))}const Qf=Wr(w0e,[["render",b0e]]),E0e={},x0e={class:"inline-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function S0e(e,t){return d.openBlock(),d.createElementBlock("svg",x0e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4.70711 6.00018C4.26165 6.00018 4.03857 6.53875 4.35355 6.85374L7.64645 10.1466C7.84171 10.3419 8.15829 10.3419 8.35355 10.1466L11.6464 6.85374C11.9614 6.53875 11.7383 6.00018 11.2929 6.00018H4.70711Z",fill:"#CFD1DB"},null,-1)]))}const zf=Wr(E0e,[["render",S0e]]),B0e=["tabindex","onKeydown","onClick"],Uf=d.defineComponent({__name:"BtnIconGroup",props:{modelValue:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){d.useSlots();const n=t,r=a=>n("update:modelValue",a);return(a,i)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["btn-icon-group",{disabled:a.disabled}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.options,(o,s)=>(d.openBlock(),d.createElementBlock("div",{key:o.value+":"+s,class:d.normalizeClass(["btn-icon-group__option",{active:a.modelValue===o.value}]),tabindex:a.modelValue===o.value||a.disabled?void 0:0,onKeydown:d.withKeys(c=>r(o.value),["enter"]),onClick:c=>r(o.value)},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(o.icon)))],42,B0e))),128))],2))}}),k0e={},T0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function _0e(e,t){return d.openBlock(),d.createElementBlock("svg",T0e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 4.5L21 4.5V6L3 6V4.5ZM3 9L11 9V10.5L3 10.5V9ZM3 15V13.5L19 13.5V15L3 15ZM3 18H13V19.5H3V18Z",fill:"currentColor"},null,-1)]))}const P7=Wr(k0e,[["render",_0e]]),P0e={},M0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function D0e(e,t){return d.openBlock(),d.createElementBlock("svg",M0e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 4.5L21 4.5V6L3 6V4.5ZM8 9L16 9V10.5L8 10.5V9ZM4 13.5L20 13.5V15L4 15L4 13.5ZM7 18H17V19.5H7V18Z",fill:"currentColor"},null,-1)]))}const M7=Wr(P0e,[["render",D0e]]),H0e={},I0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function L0e(e,t){return d.openBlock(),d.createElementBlock("svg",I0e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 4.5L21 4.5V6L3 6V4.5ZM13 9L21 9V10.5L13 10.5V9ZM5 15V13.5L21 13.5V15L5 15ZM11 18H21V19.5H11V18Z",fill:"currentColor"},null,-1)]))}const D7=Wr(H0e,[["render",L0e]]),R0e={},N0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function $0e(e,t){return d.openBlock(),d.createElementBlock("svg",N0e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4 19L4 5C4 4.44772 4.44772 4 5 4L19 4C19.5523 4 20 4.44772 20 5L20 19C20 19.5523 19.5523 20 19 20L5 20C4.44772 20 4 19.5523 4 19Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"square"},null,-1)]))}const H7=Wr(R0e,[["render",$0e]]),F0e={},V0e={width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function O0e(e,t){return d.openBlock(),d.createElementBlock("svg",V0e,t[0]||(t[0]=[d.createStaticVNode('<path d="M4.25 1H5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M8.25 1H9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M12.25 1H13.75" stroke="currentColor" stroke-width="1.5"></path><path d="M16.25 1H17.75" stroke="currentColor" stroke-width="1.5"></path><path d="M0.25 17H1.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4.25 17H5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M8.25 17H9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M12.25 17H13.75" stroke="currentColor" stroke-width="1.5"></path><path d="M16.25 17H17.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 0.25L17 1.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 4.25L17 5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 8.25L17 9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 12.25L17 13.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 0.25L1 1.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 4.25L1 5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 8.25L1 9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 12.25L1 13.75" stroke="currentColor" stroke-width="1.5"></path>',17)]))}const I7=Wr(F0e,[["render",O0e]]),Q0e={},z0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function U0e(e,t){return d.openBlock(),d.createElementBlock("svg",z0e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M8.8148 18.2251C6.6173 18.2251 5.0498 16.6576 5.0498 14.4601V10.7401C5.0498 8.5426 6.6173 6.9751 8.8148 6.9751C11.0123 6.9751 12.5798 8.5426 12.5798 10.7401V14.4601C12.5798 16.6576 11.0123 18.2251 8.8148 18.2251ZM6.6473 14.5576C6.6473 15.7651 7.60731 16.7251 8.8148 16.7251C10.0223 16.7251 10.9823 15.7651 10.9823 14.5576V10.6276C10.9823 9.4276 10.0223 8.4676 8.8148 8.4676C7.60731 8.4676 6.6473 9.4276 6.6473 10.6276V14.5576Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M15.8738 12.3751C14.3888 12.3751 13.1738 11.1751 13.1738 9.6751C13.1738 8.2051 14.4338 6.9751 15.8738 6.9751C17.3588 6.9751 18.5738 8.1751 18.5738 9.6751C18.5738 11.1751 17.3588 12.3751 15.8738 12.3751ZM14.5313 9.6751C14.5313 10.4026 15.1463 11.0176 15.8738 11.0176C16.6013 11.0176 17.2163 10.4026 17.2163 9.6751C17.2163 8.9476 16.6013 8.3326 15.8738 8.3326C15.1463 8.3326 14.5313 8.9476 14.5313 9.6751Z",fill:"currentColor"},null,-1)]))}const lB=Wr(Q0e,[["render",U0e]]),j0e={},G0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Y0e(e,t){return d.openBlock(),d.createElementBlock("svg",G0e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M5.75684 18.0001V16.1176H0.881836V14.6326L4.39184 7.2001H6.18434L2.67434 14.6326H5.75684V11.7076H7.34684V14.6326H8.41934V16.1176H7.34684V18.0001H5.75684Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M12.5224 18.2251C10.8574 18.2251 9.46242 17.1226 9.01992 15.5476L10.5274 15.1426C10.7749 16.1026 11.6674 16.7101 12.5674 16.7101C13.7524 16.7101 14.6899 15.7576 14.6899 14.6026C14.6899 13.4176 13.7224 12.4876 12.5674 12.4876C11.6824 12.4876 11.0749 12.9076 10.7374 13.3576L9.37242 12.8776L9.70242 7.2001H15.5299V8.6776H11.1049L10.9249 11.6476C11.4574 11.2651 12.1324 11.0626 12.7699 11.0626C14.7874 11.0626 16.2724 12.5776 16.2724 14.6026C16.2724 16.6126 14.5399 18.2251 12.5224 18.2251Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M19.265 12.3751C17.78 12.3751 16.565 11.1751 16.565 9.6751C16.565 8.2051 17.825 6.9751 19.265 6.9751C20.75 6.9751 21.965 8.1751 21.965 9.6751C21.965 11.1751 20.75 12.3751 19.265 12.3751ZM17.9225 9.6751C17.9225 10.4026 18.5375 11.0176 19.265 11.0176C19.9925 11.0176 20.6075 10.4026 20.6075 9.6751C20.6075 8.9476 19.9925 8.3326 19.265 8.3326C18.5375 8.3326 17.9225 8.9476 17.9225 9.6751Z",fill:"currentColor"},null,-1)]))}const sB=Wr(j0e,[["render",Y0e]]),W0e={},X0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function K0e(e,t){return d.openBlock(),d.createElementBlock("svg",X0e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4.6132 6.9826C6.7057 6.9826 8.3257 8.6026 8.3257 10.8301V14.2726C8.3257 16.6351 6.7432 18.2251 4.4557 18.2251C3.3157 18.2251 2.2882 17.7901 1.5532 16.9426L2.7007 15.8701C3.1132 16.4026 3.7582 16.7401 4.4557 16.7401C5.7982 16.7401 6.7282 15.6601 6.7282 14.4751V13.1851C6.1207 13.7926 5.2957 14.1526 4.4032 14.1526C2.3857 14.1526 0.908203 12.6226 0.908203 10.6051C0.908203 8.5801 2.5957 6.9826 4.6132 6.9826ZM2.4982 10.6051C2.4982 11.7751 3.4357 12.7201 4.6057 12.7201C5.7757 12.7201 6.7282 11.7751 6.7282 10.6051C6.7282 9.4501 5.7832 8.4901 4.6132 8.4901C3.4432 8.4901 2.4982 9.4351 2.4982 10.6051Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M13.2846 18.2251C11.0871 18.2251 9.51961 16.6576 9.51961 14.4601V10.7401C9.51961 8.5426 11.0871 6.9751 13.2846 6.9751C15.4821 6.9751 17.0496 8.5426 17.0496 10.7401V14.4601C17.0496 16.6576 15.4821 18.2251 13.2846 18.2251ZM11.1171 14.5576C11.1171 15.7651 12.0771 16.7251 13.2846 16.7251C14.4921 16.7251 15.4521 15.7651 15.4521 14.5576V10.6276C15.4521 9.4276 14.4921 8.4676 13.2846 8.4676C12.0771 8.4676 11.1171 9.4276 11.1171 10.6276V14.5576Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M20.3436 12.3751C18.8586 12.3751 17.6436 11.1751 17.6436 9.6751C17.6436 8.2051 18.9036 6.9751 20.3436 6.9751C21.8286 6.9751 23.0436 8.1751 23.0436 9.6751C23.0436 11.1751 21.8286 12.3751 20.3436 12.3751ZM19.0011 9.6751C19.0011 10.4026 19.6161 11.0176 20.3436 11.0176C21.0711 11.0176 21.6861 10.4026 21.6861 9.6751C21.6861 8.9476 21.0711 8.3326 20.3436 8.3326C19.6161 8.3326 19.0011 8.9476 19.0011 9.6751Z",fill:"currentColor"},null,-1)]))}const uB=Wr(W0e,[["render",K0e]]),Z0e={},J0e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function q0e(e,t){return d.openBlock(),d.createElementBlock("svg",J0e,t[0]||(t[0]=[d.createStaticVNode('<path d="M4 4L4 20" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M7.25 4H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 4H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 4H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 4H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M7.25 20H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 20H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 20H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 20H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 3.25L20 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 7.25L20 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 11.25L20 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 15.25L20 16.75" stroke="currentColor" stroke-width="1.5"></path>',13)]))}const cB=Wr(Z0e,[["render",q0e]]),ehe={},the={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function nhe(e,t){return d.openBlock(),d.createElementBlock("svg",the,t[0]||(t[0]=[d.createStaticVNode('<path d="M20 20L4 20" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M7.25 4H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 4H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 4H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 4H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 3.25L20 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 7.25L20 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 11.25L20 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 15.25L20 16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 3.25L4 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 7.25L4 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 11.25L4 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 15.25L4 16.75" stroke="currentColor" stroke-width="1.5"></path>',13)]))}const fB=Wr(ehe,[["render",nhe]]),rhe={},ahe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ihe(e,t){return d.openBlock(),d.createElementBlock("svg",ahe,t[0]||(t[0]=[d.createStaticVNode('<path d="M4 4L4 19C4 19.5523 4.44772 20 5 20L20 20" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M7.25 4H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 4H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 4H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 4H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 3.25L20 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 7.25L20 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 11.25L20 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 15.25L20 16.75" stroke="currentColor" stroke-width="1.5"></path>',9)]))}const dB=Wr(rhe,[["render",ihe]]),ohe={inheritAttrs:!1},lhe={class:"double-contour-temp"};function she(e,t,n,r,a,i){return d.openBlock(),d.createElementBlock("div",lhe,[d.createElementVNode("div",d.normalizeProps(d.guardReactiveProps(e.$attrs)),[d.renderSlot(e.$slots,"default")],16)])}const AB=Wr(ohe,[["render",she]]),uhe={},che={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function fhe(e,t){return d.openBlock(),d.createElementBlock("svg",che,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.5951 8.76689C9.7962 8.43389 8.91957 8.25 8 8.25C4.27208 8.25 1.25 11.2721 1.25 15C1.25 18.7279 4.27208 21.75 8 21.75C11.7279 21.75 14.75 18.7279 14.75 15C14.75 12.7693 13.6679 10.7913 12 9.56231C11.5866 9.86693 11.2092 10.2176 10.8753 10.6067C12.3055 11.5446 13.25 13.162 13.25 15C13.25 17.8995 10.8995 20.25 8 20.25C5.10051 20.25 2.75 17.8995 2.75 15C2.75 12.1005 5.10051 9.75 8 9.75C8.51 9.75 9.00302 9.82272 9.46924 9.95836C9.80438 9.52487 10.1817 9.12566 10.5951 8.76689Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2.75C9.10051 2.75 6.75 5.10051 6.75 8C6.75 10.8995 9.10051 13.25 12 13.25C14.8995 13.25 17.25 10.8995 17.25 8C17.25 5.10051 14.8995 2.75 12 2.75ZM5.25 8C5.25 4.27208 8.27208 1.25 12 1.25C15.7279 1.25 18.75 4.27208 18.75 8C18.75 11.7279 15.7279 14.75 12 14.75C8.27208 14.75 5.25 11.7279 5.25 8Z",fill:"#07AD3E"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M21.25 15C21.25 12.9441 20.0683 11.1643 18.3471 10.3026C18.5192 9.82834 18.6396 9.32933 18.7016 8.81237C21.0847 9.85434 22.75 12.2327 22.75 15C22.75 18.7279 19.7279 21.75 16 21.75C13.9499 21.75 12.1132 20.836 10.8753 19.3933C11.2961 19.1174 11.6749 18.7825 12 18.4005C12.963 19.5322 14.3977 20.25 16 20.25C18.8995 20.25 21.25 17.8995 21.25 15ZM11.1556 17.0269C10.8943 16.4032 10.75 15.7185 10.75 15C10.75 12.1005 13.1005 9.75 16 9.75C16.3146 9.75 16.6227 9.77767 16.922 9.83069C17.0939 9.36877 17.2026 8.87611 17.2376 8.36321C16.8364 8.28886 16.4227 8.25 16 8.25C12.2721 8.25 9.25 11.2721 9.25 15C9.25 16.139 9.53213 17.2122 10.0303 18.1534C10.481 17.8626 10.8653 17.4779 11.1556 17.0269Z",fill:"#110529"},null,-1)]))}const dhe=Wr(uhe,[["render",fhe]]),Ahe={key:4,class:"size"},L7=d.defineComponent({__name:"AesButton",props:{data:{}},emits:["ref"],setup(e,{emit:t}){const n=e,r=n.data.type==="fill"||n.data.type==="stroke",a=d.computed(()=>({icon__white:r&&n.data.value.toLowerCase()==="#ffffff",icon__empty:r&&n.data.value.toLowerCase()==="transparent"})),i=d.computed(()=>n.data.type==="fill"?{"background-color":n.data.value}:n.data.type==="stroke"&&!a.value.icon__empty&&!a.value.icon__white?{"border-color":n.data.value}:{});return(o,s)=>(d.openBlock(),d.createElementBlock("div",{class:"ui-aes-button",ref:c=>o.$emit("ref",c)},[d.createVNode(AB,{class:"ui-multiselect-button__contour"}),o.data.type==="fill"?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["icon icon__fill",a.value]),style:d.normalizeStyle(i.value)},null,6)):o.data.type==="stroke"?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["icon icon__stroke",a.value]),style:d.normalizeStyle(i.value)},null,6)):o.data.type==="dotShape"?(d.openBlock(),d.createElementBlock("div",{key:2,class:d.normalizeClass(["icon dot",{[`dot__${o.data.value}`]:!0}])},null,2)):o.data.type==="lineType"?(d.openBlock(),d.createElementBlock("div",{key:3,class:d.normalizeClass(["icon icon__line",{[`line__${o.data.value}`]:!0}])},null,2)):o.data.type==="size"?(d.openBlock(),d.createElementBlock("span",Ahe,d.toDisplayString(o.data.value),1)):o.data.type==="data"?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(dhe),{key:5,class:"icon"})):d.createCommentVNode("",!0)],512))}}),phe={},hhe={class:"inline-icon",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function mhe(e,t){return d.openBlock(),d.createElementBlock("svg",hhe,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 8L7.53033 13.5303L8.59099 12.4697L4.87132 8.75L14.0607 8.75L14.0607 7.25L4.87132 7.25L8.59099 3.53033L7.53033 2.46967L2 8Z",fill:"#110529"},null,-1)]))}const vhe=Wr(phe,[["render",mhe]]),ghe={ref:"root",class:"aes-settings-form"},yhe={class:"aes-settings-form__header"},Qh=d.defineComponent({__name:"FormWrapper",props:{title:{},backTitle:{}},emits:["form:close"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"#graph-settings-modal"},[d.createElementVNode("div",ghe,[d.createElementVNode("div",yhe,[d.createElementVNode("div",{onClick:r[0]||(r[0]=d.withModifiers(a=>n.$emit("form:close"),["stop"])),class:"back-link"},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(vhe))),d.createTextVNode(" "+d.toDisplayString(`Back to ${n.backTitle}`),1)]),d.createElementVNode("h3",null,d.toDisplayString(n.title),1)]),d.renderSlot(n.$slots,"default")],512)]))}}),whe={class:"ui-multiselect-button__content"},Che={key:0,class:"title"},bhe={key:1,class:"gradient"},Ehe=6,o3=d.defineComponent({__name:"MultiselectButton",props:{label:{},title:{},palette:{}},emits:["button-click"],setup(e,{emit:t}){const n=d.ref(void 0);pt.useLabelNotch(n);function r(a){const i=100/(a.length-1);return`background: linear-gradient(to right, ${a.map((o,s)=>`${o} ${s*i}%`).join(", ")})`}return(a,i)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"root",ref:n,class:"ui-multiselect-button",onClick:i[0]||(i[0]=d.withModifiers(o=>a.$emit("button-click"),["stop"]))},[a.label?(d.openBlock(),d.createElementBlock("label",{key:0,ref:"label"},d.toDisplayString(a.label),513)):d.createCommentVNode("",!0),d.createVNode(AB,{class:"ui-multiselect-button__contour"}),d.createElementVNode("div",whe,[a.title?(d.openBlock(),d.createElementBlock("div",Che,d.toDisplayString(a.title),1)):d.createCommentVNode("",!0),a.palette&&d.unref(tS)(a.palette)?(d.openBlock(),d.createElementBlock("div",bhe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(Do)[a.palette].colors.slice(0,Ehe),o=>(d.openBlock(),d.createElementBlock("div",{class:"gradient__item",style:d.normalizeStyle({background:o})},null,4))),256))])):a.palette?(d.openBlock(),d.createElementBlock("div",{key:2,class:"gradient",style:d.normalizeStyle(r(d.unref(Do)[a.palette].colors))},null,4)):(d.openBlock(),d.createBlock(d.unref(pt.PlIcon16),{key:3,class:"icon",name:"chevron-right"}))])],512))}}),xhe={class:"palettes-groups"},She={class:"palettes-list"},Bhe=["onClick"],khe={class:"palette-gradient"},The={class:"palettes-list"},_he=["onClick"],Phe={class:"palettes-list"},Mhe=["onClick"],Dhe=9,l3=d.defineComponent({__name:"PalettesForm",props:{selected:{},categorical:{type:Boolean,default:!0},sequential:{type:Boolean,default:!0},diverging:{type:Boolean,default:!0}},emits:["select"],setup(e,{emit:t}){const n=t;function r(i){n("select",i)}function a(i){const o=100/(i.length-1);return`background: linear-gradient(to right, ${i.map((s,c)=>`${s} ${c*o}%`).join(", ")})`}return(i,o)=>(d.openBlock(),d.createElementBlock("div",xhe,[i.categorical?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[o[0]||(o[0]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"CATEGORICAL")],-1)),o[1]||(o[1]=d.createElementVNode("div",{class:"section-description"}," Best to representing categorical data ",-1)),d.createElementVNode("div",She,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(oL),s=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["palettes-list__palette",{selected:i.selected===s}]),onClick:d.withModifiers(c=>r(s),["stop"])},[d.createElementVNode("div",null,d.toDisplayString(d.unref(Do)[s].title),1),d.createElementVNode("div",khe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(Do)[s].colors.slice(0,Dhe),c=>(d.openBlock(),d.createElementBlock("div",{class:"palette-gradient__item",style:d.normalizeStyle({background:c})},null,4))),256))])],10,Bhe))),256))])],64)):d.createCommentVNode("",!0),i.sequential?(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[o[2]||(o[2]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"SEQUENTIAL")],-1)),o[3]||(o[3]=d.createElementVNode("div",{class:"section-description"}," Best to representing sequential data ",-1)),d.createElementVNode("div",The,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(pae),s=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["palettes-list__palette",{selected:i.selected===s}]),onClick:d.withModifiers(c=>r(s),["stop"])},[d.createElementVNode("div",null,d.toDisplayString(d.unref(Do)[s].title),1),d.createElementVNode("div",{class:"palette-gradient",style:d.normalizeStyle(a(d.unref(Do)[s].colors))},null,4)],10,_he))),256))])],64)):d.createCommentVNode("",!0),i.diverging?(d.openBlock(),d.createElementBlock(d.Fragment,{key:2},[o[4]||(o[4]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"DIVERGING")],-1)),o[5]||(o[5]=d.createElementVNode("div",{class:"section-description"}," Best to representing diverging data ",-1)),d.createElementVNode("div",Phe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(hae),s=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["palettes-list__palette",{selected:i.selected===s}]),onClick:d.withModifiers(c=>r(s),["stop"])},[d.createElementVNode("div",null,d.toDisplayString(d.unref(Do)[s].title),1),d.createElementVNode("div",{class:"palette-gradient",style:d.normalizeStyle(a(d.unref(Do)[s].colors))},null,4)],10,Mhe))),256))])],64)):d.createCommentVNode("",!0)]))}}),Hhe=["onClick"],d$=d.defineComponent({__name:"FixedColorsList",props:{modelValue:{},colorUsing:{default:"fill"},colorsList:{default:()=>_y}},emits:["update:modelValue"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.colorsList,a=>(d.openBlock(),d.createElementBlock("div",{key:a.color,class:d.normalizeClass(["color-item",{border:n.colorUsing==="stroke",white:a.name==="White",empty:a.name==="None",selected:a.color===n.modelValue}]),style:d.normalizeStyle(a.name!=="White"&&a.name!=="None"?`${n.colorUsing==="fill"?"background":"border-color"}: ${a.color};`:""),onClick:i=>n.$emit("update:modelValue",a.color)},r[0]||(r[0]=[d.createElementVNode("div",{class:"checkmark"},null,-1)]),14,Hhe))),128))}}),Ihe=["onClick"],Lhe={class:"row-item__title"},fb=d.defineComponent({__name:"FixedLineTypeList",props:{modelValue:{},list:{default:()=>My}},emits:["update:modelValue"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.list,a=>(d.openBlock(),d.createElementBlock("div",{key:a,class:d.normalizeClass(["row-item",{"row-item__selected":a===n.modelValue,[`line__${a}`]:!0}]),onClick:i=>n.$emit("update:modelValue",a)},[d.createElementVNode("div",Lhe,d.toDisplayString(d.unref(vae)[a].title),1),(d.openBlock(),d.createElementBlock("svg",{class:d.normalizeClass(["row-item__line line",{[`line__${a}`]:!0}])},r[0]||(r[0]=[d.createElementVNode("line",{x1:"0",x2:"100%",y1:"50%",y2:"50%"},null,-1)]),2))],10,Ihe))),128))}}),Rhe=["onClick"],A$=d.defineComponent({__name:"FixedDotShapeList",props:{modelValue:{},list:{default:()=>N5}},emits:["update:modelValue"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.list,a=>(d.openBlock(),d.createElementBlock("div",{key:a,class:d.normalizeClass(["color-item dot",{selected:a===n.modelValue,[`dot__${a}`]:!0}]),onClick:i=>n.$emit("update:modelValue",a)},null,10,Rhe))),128))}}),db=d.defineComponent({__name:"Popup",props:{gap:{default:8},targetRef:{},width:{default:258},height:{}},emits:["popup:close"],setup(e,{emit:t}){const n=t,r=e;function a(){n("popup:close")}const i=d.ref(),o=d.ref(r.targetRef),s=d.ref("bottom"),c=d.ref(""),f=d.ref("");function A(h,m=8){pt.usePosition(h,g=>{if(r.height&&g.offsetY+g.height+3*m+r.height>g.clientHeight){const C=g.right-g.width-m;if(g.clientHeight-g.offsetY>r.height+m){const x=g.offsetY;c.value=`left: ${C}px; top: ${x}px;`,f.value="top: 16px;",s.value="left-bottom"}else{const x=g.clientHeight-r.height-2*m;c.value=`left: ${C}px; top: ${x}px;`;const k=g.offsetY+2*Math.floor(g.height/2),_=g.clientHeight-k;f.value=`bottom: ${_}px;`,s.value="left-bottom"}}else c.value=`left: ${g.right}px; top: ${g.offsetY+g.height+m}px;`,f.value="",s.value="bottom"})}return A(o,r.gap),pt.useClickOutside([o,i],()=>a()),(h,m)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createElementVNode("div",{class:"popup",style:d.normalizeStyle(c.value),onClick:m[0]||(m[0]=g=>g.stopPropagation())},[d.createElementVNode("div",{ref_key:"popup",ref:i,class:d.normalizeClass(["popup__content",s.value]),style:d.normalizeStyle({width:`${h.width}px`})},[d.createElementVNode("div",null,[d.renderSlot(h.$slots,"default")]),(d.openBlock(),d.createElementBlock("svg",{style:d.normalizeStyle(f.value),class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m[1]||(m[1]=[d.createElementVNode("path",{d:"M4 8L0 4L4 0L4 8 Z"},null,-1),d.createElementVNode("polyline",{points:"4,8 0,4 4,0"},null,-1)]),4))],6)],4)]))}}),Nhe={},$he={xmlns:"http://www.w3.org/2000/svg",width:"8",height:"12",viewBox:"0 0 8 12",fill:"none"};function Fhe(e,t){return d.openBlock(),d.createElementBlock("svg",$he,t[0]||(t[0]=[d.createStaticVNode('<path d="M2.5 0H0.5V2H2.5V0Z" fill="#CFD1DB"></path><path d="M2.5 5H0.5V7H2.5V5Z" fill="#CFD1DB"></path><path d="M0.5 10H2.5V12H0.5V10Z" fill="#CFD1DB"></path><path d="M7.5 0H5.5V2H7.5V0Z" fill="#CFD1DB"></path><path d="M5.5 5H7.5V7H5.5V5Z" fill="#CFD1DB"></path><path d="M7.5 10H5.5V12H7.5V10Z" fill="#CFD1DB"></path>',6)]))}const Vhe=Wr(Nhe,[["render",Fhe]]);var Ohe=Object.defineProperty,Qhe=(e,t,n)=>t in e?Ohe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pB=(e,t,n)=>Qhe(e,typeof t!="symbol"?t+"":t,n);function zhe(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value");return e}function Uhe(e,t){if(e===void 0)throw Error(t??"Undefined value");return e}function jhe(e=void 0){return e}function Ghe(e){return e}function Yhe(e){return[...new Set(e)]}function Whe(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value")}function Xhe(e,t){if(e===void 0)throw Error(t??"Undefined value")}function Khe(e,t,n){const r=Math.min(t,n),a=Math.max(t,n);return e>=r&&e<=a}function Zhe(e){return e.map(t=>({text:String(t),value:t}))}function Jhe(e){return function(...t){const n=e(...t);async function r(a){return a.done?Promise.resolve(a.value):Promise.resolve(a.value).then(i=>r(n.next(i))).catch(i=>r(n.throw(i)))}try{return r(n.next())}catch(a){return Promise.reject(a instanceof Error?a:Error(String(a)))}}}class qhe{constructor(){pB(this,"promise"),pB(this,"resolve",()=>{}),pB(this,"reject",()=>{}),this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}}function hB(e){return new Promise(t=>setTimeout(t,e))}function e1e(){return new Promise(e=>queueMicrotask(e))}function t1e(){const e=new Date().getTime();return function(){return new Date().getTime()-e}}function n1e(){const e=performance.now();return function(){return performance.now()-e}}function r1e(e){return e()}function a1e(e,t,n){return t>e?t:e>n?n:e}function i1e(e,t){return t(e)}function o1e(e,t){if(e!=null)return t(e)}function l1e(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}function*p$(e,t,n=1){for(let r=e;r<t;r+=n)yield r}function h$(e){const t=[];for(const n of e)t.push(n);return t}function s1e(e,t){return h$(p$(0,e)).map(t)}let u1e=class{constructor(t){this._delay=t}async*generate(){let t=0;for(;;)await hB(this._delay),yield t++}async*[Symbol.asyncIterator](){let t=0;for(;;)await hB(this._delay),yield t++}};function c1e(e,t){return Array.from({length:e},(n,r)=>t(r))}function f1e(e,t){throw Error(t)}function d1e(e){return t=>e[t]()}function A1e(e){if(e&&e.ok)return e.value}function p1e(e){if(e&&!e.ok)return e.error}function h1e(e){if(e.ok)return e.value;throw Error(e.error)}function m1e(e){return Array.isArray(e)?e:[e]}async function v1e(e){return Object.fromEntries(await Promise.all(Object.entries(e).map(async([t,n])=>[t,await n])))}function g1e(e,t){return Object.keys(t).every(n=>e[n]===t[n])}const y1e=e=>e;function w1e(e){return e}function C1e(e){return Object.entries(e).map(([t,n])=>({key:t,value:n}))}const R7=Object.freeze(Object.defineProperty({__proto__:null,Deferred:qhe,Interval:u1e,alike:g1e,arrayFrom:c1e,asConst:w1e,async:Jhe,between:Khe,bool:Ghe,call:r1e,checkIfDefined:Xhe,checkIfNotEmpty:Whe,clamp:a1e,delay:hB,errorOptional:p1e,exhaustive:f1e,flatValue:m1e,identity:y1e,listToOptions:Zhe,match:d1e,notEmpty:zhe,notUndef:Uhe,okOptional:A1e,performanceTimer:n1e,randomInt:l1e,range:p$,resolveAwaited:v1e,tap:i1e,tapIf:o1e,tear:e1e,timer:t1e,times:s1e,toList:h$,undef:jhe,unionize:C1e,uniqueValues:Yhe,unwrap:h1e},Symbol.toStringTag,{value:"Module"})),N7=Array.isArray;function Ab(e){return e!==null&&typeof e=="object"}function s3(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null}function b1e(e,t){return Object.keys(e).map(n=>t(e[n],n))}function m$(e){return Object.values(e).reduce((t,n)=>n!==void 0?t+1:t,0)}function pb(e,t){if(!(Ab(e)&&Ab(t)))return e===t;if(N7(e)&&N7(t))return e.length!==t.length?!1:[...e.keys()].every(n=>pb(e[n],t[n]));if(s3(e)&&s3(t))return m$(e)!==m$(t)?!1:Object.keys(e).every(n=>pb(e[n],t[n]));throw Error(`Cannot compare a ${String(e)} and b ${String(t)}`)}const E1e=pb;function mB(e){if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=mB(e[n]);return t}else if(s3(e)){const t={};return Object.keys(e).forEach(n=>{t[n]=mB(e[n])}),t}else return e}function x1e(e){return Array.isArray(e)?Object.assign([],e):Ab(e)?Object.assign({},e):e}function S1e(e,t){const n={};for(const r in t)t[r]!==e[r]&&(n[r]=e[r]);return n}function B1e(e){return Object.entries(e).forEach(([t,n])=>{n instanceof Function&&(e[t]=n.bind(e))}),e}function k1e(e,t,n){return e[t]=n,e}function T1e(e,t){return e[t]}function _1e(e,t){e={...e};const n=e[t];return delete e[t],[n,e]}function P1e(e,...t){return Object.assign({},...t.map(n=>({[n]:e[n]})))}function M1e(e,...t){return t.map(n=>e[n])}function D1e(e,...t){const n=Object.assign({},e);return t.forEach(r=>delete n[r]),n}function v$(e,t){return new Set([...Object.keys(e),...Object.keys(t)]).forEach(n=>{const r=e[n],a=t[n];s3(r)&&s3(a)||N7(r)&&N7(a)&&r.length===a.length?v$(r,a):e[n]=a}),e}const H1e=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:B1e,deepClone:mB,deepEqual:E1e,deepPatch:v$,getProp:T1e,isArray:N7,isJsonEqual:pb,isNonPrimitive:Ab,isPlainObject:s3,map:b1e,omit:D1e,pick:P1e,pickValues:M1e,setProp:k1e,shallowClone:x1e,shallowDiff:S1e,shiftProp:_1e},Symbol.toStringTag,{value:"Module"})),hb=1,I1e=d.defineComponent({__name:"PlColorSliderThumb",props:{barRef:{},modelValue:{},min:{default:0},max:{default:100},getColorForPercent:{},padding:{default:16},isActive:{type:Boolean}},emits:["update:modelValue","active"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.ref(),o=d.ref(!1),s=n.min,c=n.max;let f=d.ref(0);const A=c-s,h=n.padding/n.barRef.getBoundingClientRect().width*100/2,m=d.computed(()=>R7.clamp((n.modelValue??0)+f.value,Math.ceil(s+h),Math.ceil(c-h))),g=d.computed(()=>({right:`calc(${Math.ceil((1-b.value)*100)}%) `})),b=d.computed(()=>(m.value-s)/A);function C(O){const I=R7.clamp(O,s,c);return Math.round((I+Number.EPSILON)*(1/hb))/(1/hb)}function x(){o.value=!1}function k(O){O?(document.addEventListener("mouseup",x),document.addEventListener("focusout",x)):(document.removeEventListener("mouseup",x),document.removeEventListener("focusout",x)),o.value=O,r("active",O)}pt.useMouseCapture(a,O=>{var I;R7.tapIf((I=d.unref(n.barRef))==null?void 0:I.getBoundingClientRect(),$=>{const{dx:Q}=O;f.value=Q/$.width*A,O.stop&&(r("update:modelValue",C(m.value)),f.value=0)})});function _(O){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(O.code)&&O.preventDefault(),O.code==="ArrowLeft"&&r("update:modelValue",R7.clamp(n.modelValue-hb,s,c)),O.code==="ArrowRight"&&r("update:modelValue",R7.clamp(n.modelValue+hb,s,c))}function D(O){var I,$;O?(I=i.value)==null||I.classList.add("pl-color-slider__top-index"):($=i.value)==null||$.classList.remove("pl-color-slider__top-index")}return(O,I)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"wrapper",ref:i,style:d.normalizeStyle(g.value),class:d.normalizeClass([{"active-thumb":o.value||O.isActive},"pl-color-slider__thumb"]),tabindex:"0",onMousedown:I[2]||(I[2]=$=>k(!0)),onMouseup:I[3]||(I[3]=$=>k(!1)),onKeydown:_,onFocus:I[4]||(I[4]=$=>k(!0))},[d.createElementVNode("div",{ref_key:"thumb",ref:a,class:d.normalizeClass([{active:o.value},"pl-color-slider__thumb-roof"]),onMouseover:I[0]||(I[0]=$=>D(!0)),onMouseout:I[1]||(I[1]=$=>D(!1))},[d.createElementVNode("div",{class:"pl-color-slider__thumb-color-indicator",style:d.normalizeStyle({backgroundColor:O.getColorForPercent(m.value)})},null,4)],34)],38))}}),L1e={class:"pl-color-slider"},R1e={class:"pl-color-slider__wrapper"},N1e={class:"pl-color-slider__thumbs-contaier"},$1e=d.defineComponent({__name:"PlColorSlider",props:{colors:{},modelValue:{},getColorForPercent:{type:Function},active:{}},emits:["update:modelValue","active"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.reactive({}),o=d.ref(-1);d.watch(()=>n.modelValue,()=>{n.modelValue.forEach((A,h)=>i[h]=A)},{immediate:!0});const s=d.computed(()=>Math.floor(o.value!==-1?0-o.value:0)),c=d.computed(()=>Math.floor(o.value!==-1?100+o.value:100));d.watch(()=>i,A=>{r("update:modelValue",Object.values(A))},{deep:!0});const f=d.computed(()=>{const A=100/(n.colors.length-1);return`linear-gradient(to right, ${n.colors.map((m,g)=>`${m} ${A*g}%`).join(", ")})`});return d.onMounted(()=>{let A=16,h=a.value.getBoundingClientRect().width-A*2;o.value=A/h*100}),(A,h)=>(d.openBlock(),d.createElementBlock("div",L1e,[d.createElementVNode("div",R1e,[d.createElementVNode("div",{ref_key:"barRef",ref:a,class:"pl-color-slider__color-contaier"},[d.createElementVNode("div",{style:d.normalizeStyle({background:f.value}),class:"pl-color-slider__gradient"},null,4)],512),d.createElementVNode("div",N1e,[a.value?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(A.modelValue,(m,g)=>(d.openBlock(),d.createBlock(I1e,{modelValue:i[g],"onUpdate:modelValue":b=>i[g]=b,"is-active":A.active===g,key:g,min:s.value,max:c.value,"bar-ref":a.value,"get-color-for-percent":A.getColorForPercent,class:"pl-color-slider__thumb",tabindex:"0",onActive:b=>A.$emit("active",{index:g,status:b})},null,8,["modelValue","onUpdate:modelValue","is-active","min","max","bar-ref","get-color-for-percent","onActive"]))),128)):d.createCommentVNode("",!0)])])]))}});function g$(e,t){if(t==="lineType")return e*32+16*2;if(t==="dotShape"||t==="color")return Math.ceil(e/6)*36+20*2}const F1e={class:"aes-mapping-block"},V1e={style:{margin:"0 24px"}},O1e={class:"section-title"},Q1e={style:{margin:"24px 0"}},z1e={key:0,style:{margin:"24px 0"}},U1e={key:0,class:"aes-settings-hint"},j1e={key:0,class:"column-value__reorder-icon"},G1e={class:"column-value__title"},Y1e={class:"column-value__aes-group"},W1e=["onClick"],X1e=["onClick"],K1e=["onClick"],vB=d.defineComponent({__name:"AesDataMappingDiscrete",props:{dataColumnLabel:{},columnValueLabels:{},usedAesInMapping:{},modelValue:{},allowReordering:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(!1),i=d.ref(n.modelValue.palette),o=d.computed(()=>tS(i.value)),s=d.ref(null),c=d.computed(()=>s.value===null?null:n.modelValue.order.indexOf(s.value)),f=d.ref(null),A=d.computed(()=>n.modelValue.order.map(re=>{var G;const U=(G=n.modelValue.mapping[re])==null?void 0:G.aes;return{text:n.columnValueLabels[re],value:re,dotShape:U==null?void 0:U.dotShape,color:U==null?void 0:U.color,lineType:U==null?void 0:U.lineShape}}));function h(re){i.value=re,a.value=!1,r("update:modelValue",gR(re,n.modelValue.order))}function m(re,U,G){r("update:modelValue",{...n.modelValue,mapping:{...n.modelValue.mapping,[re]:{...n.modelValue.mapping[re],aes:{...n.modelValue.mapping[re].aes,[U]:G}}}})}const g=d.reactive({color:{},dotShape:{},lineType:{}});function b(re,U,G){G&&!g[re][U.value]&&(g[re][U.value]=G)}function C(re,U){const G=s.value===re.value&&f.value===U;s.value=G?null:re.value,f.value=G?null:U}function x(){s.value=null,f.value=null}const k=d.computed(()=>Do[i.value].colors.map(re=>({color:re,name:re}))),_=d.computed(()=>f.value?g$(f.value==="lineType"?My.length:f.value==="dotShape"?N5.length:k.value.length,f.value):0),D=d.ref();n.allowReordering&&pt.useSortable(D,{handle:".column-value__reorder-icon",onChange(re){r("update:modelValue",{...n.modelValue,order:re.map(U=>n.modelValue.order[U])})}});function O(re,U,G=0,Z=1){const Y=1/(re.length-1),X=Da().domain(re.map((oe,me)=>G+me*Y*(Z-G))).range(re);return oe=>oe>Z||oe<G?U:X(oe)}const I=d.computed(()=>O(Do[i.value].colors,dC)),$=d.computed(()=>O(Do[i.value].colors,dC,0,100)),Q=d.ref(n.modelValue.order.map(re=>n.modelValue.mapping[re].colorIdx*100));d.watch(()=>n.modelValue,re=>{Q.value=re.order.map(U=>re.mapping[U].colorIdx*100)});function ee(re){re.forEach((U,G)=>{const Z=n.modelValue.order[G],Y=U/100;n.modelValue.mapping[Z].colorIdx!==Y&&r("update:modelValue",{...n.modelValue,mapping:{...n.modelValue.mapping,[Z]:{colorIdx:Y,aes:{...n.modelValue.mapping[Z].aes,color:I.value(Y)}}}})})}function K(re){f.value="color",s.value=re.status?n.modelValue.order[re.index]:null}return(re,U)=>(d.openBlock(),d.createElementBlock("div",F1e,[d.createElementVNode("div",V1e,[d.createElementVNode("div",O1e,[d.createElementVNode("span",null,d.toDisplayString(re.dataColumnLabel),1)]),d.createElementVNode("div",Q1e,[d.createVNode(o3,{label:"Color Palette ",icon:"chevron-right",title:d.unref(Do)[i.value].title,palette:i.value,onButtonClick:U[0]||(U[0]=G=>{a.value=!0,x()})},null,8,["title","palette"])]),o.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",z1e,[d.createVNode($1e,{modelValue:Q.value,"onUpdate:modelValue":[U[1]||(U[1]=G=>Q.value=G),ee],colors:d.unref(Do)[i.value].colors,"get-color-for-percent":$.value,active:c.value,onActive:K},null,8,["modelValue","colors","get-color-for-percent","active"])])),a.value?(d.openBlock(),d.createBlock(Qh,{key:1,title:"Color Palette","back-title":"Color mapping","onForm:close":U[2]||(U[2]=G=>a.value=!1)},{default:d.withCtx(()=>[d.createVNode(l3,{selected:i.value,onSelect:h},null,8,["selected"])]),_:1})):d.createCommentVNode("",!0)]),re.allowReordering?(d.openBlock(),d.createElementBlock("div",U1e," Drag the rows to reorder ")):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"column-values-list",ref_key:"optionsListRef",ref:D},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(A.value,G=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["column-value",{"column-value__with-reorder":re.allowReordering}])},[re.allowReordering?(d.openBlock(),d.createElementBlock("div",j1e,[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(Vhe)))])):d.createCommentVNode("",!0),d.createElementVNode("div",G1e,d.toDisplayString(G.text),1),d.createElementVNode("div",Y1e,[re.usedAesInMapping.lineType?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["column-value__aes",{aes__selected:s.value===G.value&&f.value==="lineType"}]),ref_for:!0,ref:Z=>b("lineType",G,Z),onClick:d.withModifiers(Z=>C(G,"lineType"),["stop"])},[d.createElementVNode("div",{class:d.normalizeClass(["icon__line line",{[`line__${G.lineType}`]:!0}])},null,2)],10,W1e)):d.createCommentVNode("",!0),re.usedAesInMapping.dotShape?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["column-value__aes",{aes__selected:s.value===G.value&&f.value==="dotShape"}]),ref_for:!0,ref:Z=>b("dotShape",G,Z),onClick:d.withModifiers(Z=>C(G,"dotShape"),["stop"])},[d.createElementVNode("div",{class:d.normalizeClass(["dot",{[`dot__${G.dotShape}`]:!0}])},null,2)],10,X1e)):d.createCommentVNode("",!0),re.usedAesInMapping.fill||re.usedAesInMapping.stroke?(d.openBlock(),d.createElementBlock("div",{key:2,class:d.normalizeClass(["column-value__aes",{aes__selected:s.value===G.value&&f.value==="color"}]),ref_for:!0,ref:Z=>b("color",G,Z),onClick:d.withModifiers(Z=>C(G,"color"),["stop"])},[d.createElementVNode("div",{class:"column-value__color",style:d.normalizeStyle({background:G.color})},null,4)],10,K1e)):d.createCommentVNode("",!0),(f.value!=="color"||o.value)&&f.value!==null&&s.value===G.value?(d.openBlock(),d.createBlock(db,{key:`${f.value}_${s.value}`,targetRef:g[f.value][s.value],"onPopup:close":x,height:_.value},{default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["fixed-aes-list",{"fixed-aes-list__rows":!1}])},[f.value==="lineType"?(d.openBlock(),d.createBlock(fb,{key:0,"onUpdate:modelValue":[Z=>m(G.value,"lineShape",Z),Z=>G.lineType=Z],modelValue:G.lineType},null,8,["onUpdate:modelValue","modelValue"])):d.createCommentVNode("",!0),f.value==="dotShape"?(d.openBlock(),d.createBlock(A$,{key:1,"onUpdate:modelValue":[Z=>m(G.value,"dotShape",Z),Z=>G.dotShape=Z],modelValue:G.dotShape},null,8,["onUpdate:modelValue","modelValue"])):d.createCommentVNode("",!0),f.value==="color"?(d.openBlock(),d.createBlock(d$,{key:2,"colors-list":k.value,"onUpdate:modelValue":[Z=>m(G.value,"color",Z),Z=>G.color=Z],modelValue:G.color},null,8,["colors-list","onUpdate:modelValue","modelValue"])):d.createCommentVNode("",!0)])]),_:2},1032,["targetRef","height"])):d.createCommentVNode("",!0)])],2))),256))],512)]))}}),Z1e={class:"axes-settings-list"},J1e={class:"axes-settings-options-row block"},q1e={key:0,class:"axes-settings-input"},eme={class:"axes-settings-options-row"},tme={key:0,class:"axes-settings-options-row"},nme={key:1,class:"axes-settings-options-row"},rme={key:2,class:"axes-settings-options-row"},ame={class:"axes-settings-options-row block"},ime={key:3},ome={class:"axes-settings-options-row table"},lme={class:"axes-settings-options-row table"},sme={class:"axes-settings-options-row table"},ume={class:"axes-settings-options-row block"},cme={key:0},fme={class:"axes-settings-options-row block"},dme={class:"axes-settings-options-row table"},Ame={class:"axes-settings-options-row table"},pme={class:"other"},hme={class:"axes-settings-options-row"},mme={class:"axes-settings-options-row"},vme={class:"axes-settings-options-row"},gme={class:"axes-settings-options-row block"},yme=d.defineComponent({__name:"DiscreteAxesSettingsForm",setup(e){const t=da(),n=t.value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:P7},{value:"center",icon:M7},{value:"right",icon:D7}],i=[{value:"center",icon:lB},{value:"45deg",icon:sB},{value:"90deg",icon:uB}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"linear",text:"Linear"},{value:"log",text:"Log"}],c=[{value:"empty",icon:I7},{value:"left",icon:cB},{value:"bottom",icon:fB},{value:"left-bottom",icon:dB},{value:"full",icon:H7}],f=d.computed(()=>t.value.inputGuide.value),A=d.computed(()=>t.value.uniqueValuesData.value),h=d.ref(!1),m=d.ref(!1),g=d.computed(()=>{var re,U;return(U=(re=t.value.reactive.optionsState.components.primaryGrouping)==null?void 0:re.selectorStates[0])==null?void 0:U.selectedSource}),b=d.computed(()=>{var re,U;return(U=(re=t.value.reactive.optionsState.components.secondaryGrouping)==null?void 0:re.selectorStates[0])==null?void 0:U.selectedSource}),C=d.computed(()=>t.value.commonHelpersData.primaryGroups.value),x=d.computed(()=>t.value.commonHelpersData.secondaryGroups.value),k=d.computed(()=>t.value.commonHelpersData.usedAesInMapping.value),_=d.ref(t.value.reactive.dataBindAes[g.value]??Uy(C.value)),D=d.ref(t.value.reactive.dataBindAes[b.value]??Uy(x.value)),O=d.computed(()=>{var re;if(g.value){const U=f.value.getSourceInfo(g.value)??null,G=((re=A.value[g.value])==null?void 0:re.labels)??null;return{selectedSourceInfo:U,labels:C.value.reduce((Z,Y)=>(Z[Y]=(G==null?void 0:G[Y])??String(Y),Z),{})}}}),I=d.computed(()=>{var re;if(b.value){const U=f.value.getSourceInfo(b.value)??null,G=((re=A.value[b.value])==null?void 0:re.labels)??null;return{selectedSourceInfo:U,labels:x.value.reduce((Z,Y)=>(Z[Y]=(G==null?void 0:G[Y])??String(Y),Z),{})}}});function $(re,U){t.value.reactive.dataBindAes[U]=re}const Q=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}],ee=d.computed(()=>A.value[g.value]),K=d.computed({get(){var re;return DR(n.axisX.labelsRotation,(re=ee.value)==null?void 0:re.options)},set(re){n.axisX.labelsRotation=re}});return(re,U)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:U[26]||(U[26]=G=>G.stopPropagation())},[U[38]||(U[38]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",Z1e,[d.createVNode(ts,{title:"Title",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",J1e,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":U[0]||(U[0]=G=>d.unref(n).title.mode=G)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",q1e,[d.createVNode(d.unref(pt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":U[1]||(U[1]=G=>d.unref(n).title.value=G)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",eme,[U[27]||(U[27]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Uf,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":U[2]||(U[2]=G=>d.unref(n).title.position=G)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"X-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[C.value.length>1?(d.openBlock(),d.createElementBlock("div",tme,[U[28]||(U[28]=d.createElementVNode("span",null,"Primary groups order: ",-1)),d.createVNode(L7,{data:{type:"data",value:null},onClick:U[3]||(U[3]=G=>{h.value=!0})}),h.value&&O.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Reorder primary groups","back-title":"Axes Settings","onForm:close":U[6]||(U[6]=G=>h.value=!1)},{default:d.withCtx(()=>{var G;return[d.createVNode(vB,{"column-value-labels":O.value.labels,"data-column-label":((G=O.value.selectedSourceInfo)==null?void 0:G.label)??"","used-aes-in-mapping":k.value[g.value],"allow-reordering":"",modelValue:_.value,"onUpdate:modelValue":[U[4]||(U[4]=Z=>_.value=Z),U[5]||(U[5]=Z=>$(Z,g.value))]},null,8,["column-value-labels","data-column-label","used-aes-in-mapping","modelValue"])]}),_:1})):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),x.value.length>1?(d.openBlock(),d.createElementBlock("div",nme,[U[29]||(U[29]=d.createElementVNode("span",null,"Secondary groups order: ",-1)),d.createVNode(L7,{data:{type:"data",value:null},onClick:U[7]||(U[7]=G=>{m.value=!0})}),m.value&&I.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Reorder secondary groups","back-title":"Axes Settings","onForm:close":U[10]||(U[10]=G=>m.value=!1)},{default:d.withCtx(()=>{var G;return[d.createVNode(vB,{"column-value-labels":I.value.labels,"data-column-label":((G=I.value.selectedSourceInfo)==null?void 0:G.label)??"","used-aes-in-mapping":k.value[b.value],"allow-reordering":"",modelValue:D.value,"onUpdate:modelValue":[U[8]||(U[8]=Z=>D.value=Z),U[9]||(U[9]=Z=>$(Z,b.value))]},null,8,["column-value-labels","data-column-label","used-aes-in-mapping","modelValue"])]}),_:1})):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createElementBlock("div",rme,[U[30]||(U[30]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Uf,{options:i,modelValue:K.value,"onUpdate:modelValue":U[11]||(U[11]=G=>K.value=G)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",ame,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":U[12]||(U[12]=G=>d.unref(n).axisX.titleMode=G)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",ime,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":U[13]||(U[13]=G=>d.unref(n).axisX.customTitle=G)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",ome,[U[31]||(U[31]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.gridlines,"onUpdate:modelValue":U[14]||(U[14]=G=>d.unref(n).axisX.gridlines=G)},null,8,["modelValue"])]),d.createElementVNode("div",lme,[U[32]||(U[32]=d.createElementVNode("span",null,"Lines between categories",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.linesBetweenCategories,"onUpdate:modelValue":U[15]||(U[15]=G=>d.unref(n).axisX.linesBetweenCategories=G)},null,8,["modelValue"])]),d.createElementVNode("div",sme,[U[33]||(U[33]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.ticks,"onUpdate:modelValue":U[16]||(U[16]=G=>d.unref(n).axisX.ticks=G)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"Y-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",ume,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":U[17]||(U[17]=G=>d.unref(n).axisY.titleMode=G)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",cme,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":U[18]||(U[18]=G=>d.unref(n).axisY.customTitle=G)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",fme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Scale",options:s,modelValue:d.unref(n).axisY.scale,"onUpdate:modelValue":U[19]||(U[19]=G=>d.unref(n).axisY.scale=G)},null,8,["modelValue"])]),d.createElementVNode("div",dme,[U[34]||(U[34]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisY.gridlines,"onUpdate:modelValue":U[20]||(U[20]=G=>d.unref(n).axisY.gridlines=G)},null,8,["modelValue"])]),d.createElementVNode("div",Ame,[U[35]||(U[35]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisY.ticks,"onUpdate:modelValue":U[21]||(U[21]=G=>d.unref(n).axisY.ticks=G)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",pme,[d.createElementVNode("div",hme,[U[36]||(U[36]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Uf,{options:c,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":U[22]||(U[22]=G=>d.unref(n).other.frame=G)},null,8,["modelValue"])]),d.createElementVNode("div",mme,[U[37]||(U[37]=d.createElementVNode("span",null,"Reverse axes",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).other.reverse,"onUpdate:modelValue":U[23]||(U[23]=G=>d.unref(n).other.reverse=G)},null,8,["modelValue"])]),d.createElementVNode("div",vme,[d.createVNode(d.unref(pt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":U[24]||(U[24]=G=>d.unref(n).other.facetColumns=G)},null,8,["modelValue"])]),d.createElementVNode("div",gme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Facet shared by",options:Q,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":U[25]||(U[25]=G=>d.unref(n).other.facetSharedBy=G)},null,8,["modelValue"])])])])]))}}),wme={class:"axes-settings-list"},Cme={class:"axes-settings-options-row block"},bme={key:0,class:"axes-settings-input"},Eme={class:"axes-settings-options-row"},xme={class:"axes-settings-options-row block"},Sme={key:0},Bme={class:"axes-settings-options-row block"},kme={class:"axes-settings-options-row table"},Tme={class:"axes-settings-options-row table"},_me={class:"axes-settings-options-row"},Pme={class:"fixed-aes-list fixed-aes-list__rows"},Mme={class:"axes-settings-options-row block"},Dme={key:0},Hme={class:"axes-settings-options-row block"},Ime={class:"axes-settings-options-row table"},Lme={class:"axes-settings-options-row table"},Rme={class:"axes-settings-options-row"},Nme={class:"fixed-aes-list fixed-aes-list__rows"},$me={key:0,class:"other"},Fme={class:"axes-settings-options-row"},Vme={class:"axes-settings-options-row"},Ome={class:"axes-settings-options-row block"},Qme=d.defineComponent({__name:"ScatterplotAxesSettingsForm",setup(e){const t=da(),n=t.value.reactive.axesSettings,r=d.computed(()=>t.value.reactive.chartType),a={height:40,horizontalPadding:12,defaultState:"open"},i=[{value:"left",icon:P7},{value:"center",icon:M7},{value:"right",icon:D7}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"linear",text:"Linear"},{value:"log",text:"Log"}],c=[{value:"empty",icon:I7},{value:"left",icon:cB},{value:"bottom",icon:fB},{value:"left-bottom",icon:dB},{value:"full",icon:H7}],f=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}],A=d.ref(n.axisX.significantLinesStyle),h=d.ref(n.axisY.significantLinesStyle),m=d.computed(()=>g$(My.length,"lineType")),g=d.ref(),b=d.ref(),C=d.ref(!1),x=d.ref(!1);return(k,_)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:_[26]||(_[26]=D=>D.stopPropagation())},[_[35]||(_[35]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",wme,[d.createVNode(ts,{title:"Title",settings:a,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Cme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":_[0]||(_[0]=D=>d.unref(n).title.mode=D)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",bme,[d.createVNode(d.unref(pt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":_[1]||(_[1]=D=>d.unref(n).title.value=D)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Eme,[_[27]||(_[27]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Uf,{options:i,modelValue:d.unref(n).title.position,"onUpdate:modelValue":_[2]||(_[2]=D=>d.unref(n).title.position=D)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"X-axis",settings:a,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",xme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":_[3]||(_[3]=D=>d.unref(n).axisX.titleMode=D)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Sme,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":_[4]||(_[4]=D=>d.unref(n).axisX.customTitle=D)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Bme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Scale",options:s,modelValue:d.unref(n).axisX.scale,"onUpdate:modelValue":_[5]||(_[5]=D=>d.unref(n).axisX.scale=D)},null,8,["modelValue"])]),d.createElementVNode("div",kme,[_[28]||(_[28]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.gridlines,"onUpdate:modelValue":_[6]||(_[6]=D=>d.unref(n).axisX.gridlines=D)},null,8,["modelValue"])]),d.createElementVNode("div",Tme,[_[29]||(_[29]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.ticks,"onUpdate:modelValue":_[7]||(_[7]=D=>d.unref(n).axisX.ticks=D)},null,8,["modelValue"])]),d.createElementVNode("div",_me,[_[30]||(_[30]=d.createElementVNode("span",null,"Significant lines style",-1)),d.createVNode(L7,{data:{type:"lineType",value:A.value},onClick:_[8]||(_[8]=D=>C.value=!C.value),onRef:_[9]||(_[9]=D=>g.value=D)},null,8,["data"]),C.value?(d.openBlock(),d.createBlock(db,{key:0,height:m.value,targetRef:g.value,"onPopup:close":_[12]||(_[12]=D=>C.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",Pme,[d.createVNode(fb,{modelValue:A.value,"onUpdate:modelValue":[_[10]||(_[10]=D=>A.value=D),_[11]||(_[11]=D=>d.unref(n).axisX.significantLinesStyle=D)]},null,8,["modelValue"])])]),_:1},8,["height","targetRef"])):d.createCommentVNode("",!0)])]),_:1}),d.createVNode(ts,{title:"Y-axis",settings:a,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Mme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":_[13]||(_[13]=D=>d.unref(n).axisY.titleMode=D)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Dme,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":_[14]||(_[14]=D=>d.unref(n).axisY.customTitle=D)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Hme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Scale",options:s,modelValue:d.unref(n).axisY.scale,"onUpdate:modelValue":_[15]||(_[15]=D=>d.unref(n).axisY.scale=D)},null,8,["modelValue"])]),d.createElementVNode("div",Ime,[_[31]||(_[31]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisY.gridlines,"onUpdate:modelValue":_[16]||(_[16]=D=>d.unref(n).axisY.gridlines=D)},null,8,["modelValue"])]),d.createElementVNode("div",Lme,[_[32]||(_[32]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisY.ticks,"onUpdate:modelValue":_[17]||(_[17]=D=>d.unref(n).axisY.ticks=D)},null,8,["modelValue"])]),d.createElementVNode("div",Rme,[_[33]||(_[33]=d.createElementVNode("span",null,"Significant lines style",-1)),d.createVNode(L7,{data:{type:"lineType",value:h.value},onClick:_[18]||(_[18]=D=>x.value=!x.value),onRef:_[19]||(_[19]=D=>b.value=D)},null,8,["data"]),x.value?(d.openBlock(),d.createBlock(db,{key:0,height:m.value,targetRef:b.value,"onPopup:close":_[22]||(_[22]=D=>x.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",Nme,[d.createVNode(fb,{modelValue:h.value,"onUpdate:modelValue":[_[20]||(_[20]=D=>h.value=D),_[21]||(_[21]=D=>d.unref(n).axisY.significantLinesStyle=D)]},null,8,["modelValue"])])]),_:1},8,["height","targetRef"])):d.createCommentVNode("",!0)])]),_:1}),r.value==="scatterplot"?(d.openBlock(),d.createElementBlock("div",$me,[d.createElementVNode("div",Fme,[_[34]||(_[34]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Uf,{options:c,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":_[23]||(_[23]=D=>d.unref(n).other.frame=D)},null,8,["modelValue"])]),d.createElementVNode("div",Vme,[d.createVNode(d.unref(pt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":_[24]||(_[24]=D=>d.unref(n).other.facetColumns=D)},null,8,["modelValue"])]),d.createElementVNode("div",Ome,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Facet shared by",options:f,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":_[25]||(_[25]=D=>d.unref(n).other.facetSharedBy=D)},null,8,["modelValue"])])])):d.createCommentVNode("",!0)])]))}}),zme={class:"axes-settings-list"},Ume={class:"axes-settings-options-row block"},jme={key:0,class:"axes-settings-input"},Gme={class:"axes-settings-options-row"},Yme={class:"axes-settings-options-row"},Wme={class:"axes-settings-options-row block"},Xme={key:0},Kme={class:"axes-settings-options-row block"},Zme={class:"axes-settings-options-row"},Jme={class:"axes-settings-options-row block"},qme={key:0},eve={class:"axes-settings-options-row block"},tve={class:"other"},nve={class:"axes-settings-options-row"},rve={class:"axes-settings-options-row"},ave={class:"axes-settings-options-row block"},ive=d.defineComponent({__name:"HeatmapAxesSettingsForm",setup(e){const t=da(),n=t.value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:P7},{value:"center",icon:M7},{value:"right",icon:D7}],i=[{value:0,icon:lB},{value:45,icon:sB},{value:90,icon:uB}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"none",icon:I7},{value:"full",icon:H7}],c=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}],f=[{text:"ascending",value:"asc"},{text:"descending",value:"desc"}],A=d.computed(()=>t.value.reactive.layersSettings.heatmapClustered),h=d.computed(()=>c.filter(m=>t.value.reactive.template!=="heatmapClustered"?!0:A.value.dendrogramX&&A.value.dendrogramY?m.value!=="x"&&m.value!=="xy"&&m.value!=="y":A.value.dendrogramX?m.value!=="x"&&m.value!=="xy":A.value.dendrogramY?m.value!=="y"&&m.value!=="xy":!0));return(m,g)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:g[14]||(g[14]=b=>b.stopPropagation())},[g[19]||(g[19]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",zme,[d.createVNode(ts,{title:"Title",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Ume,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":g[0]||(g[0]=b=>d.unref(n).title.mode=b)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",jme,[d.createVNode(d.unref(pt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":g[1]||(g[1]=b=>d.unref(n).title.value=b)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Gme,[g[15]||(g[15]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Uf,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":g[2]||(g[2]=b=>d.unref(n).title.position=b)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"X-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Yme,[g[16]||(g[16]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Uf,{options:i,modelValue:d.unref(n).axisX.axisLabelsAngle,"onUpdate:modelValue":g[3]||(g[3]=b=>d.unref(n).axisX.axisLabelsAngle=b)},null,8,["modelValue"])]),d.createElementVNode("div",Wme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":g[4]||(g[4]=b=>d.unref(n).axisX.titleMode=b)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Xme,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":g[5]||(g[5]=b=>d.unref(n).axisX.customTitle=b)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Kme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Sorting",options:f,modelValue:d.unref(n).axisX.sorting,"onUpdate:modelValue":g[6]||(g[6]=b=>d.unref(n).axisX.sorting=b)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"Y-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Zme,[g[17]||(g[17]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Uf,{options:i,modelValue:d.unref(n).axisY.axisLabelsAngle,"onUpdate:modelValue":g[7]||(g[7]=b=>d.unref(n).axisY.axisLabelsAngle=b)},null,8,["modelValue"])]),d.createElementVNode("div",Jme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":g[8]||(g[8]=b=>d.unref(n).axisY.titleMode=b)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",qme,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":g[9]||(g[9]=b=>d.unref(n).axisY.customTitle=b)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",eve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Sorting",options:f,modelValue:d.unref(n).axisY.sorting,"onUpdate:modelValue":g[10]||(g[10]=b=>d.unref(n).axisY.sorting=b)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",tve,[d.createElementVNode("div",nve,[g[18]||(g[18]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Uf,{options:s,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":g[11]||(g[11]=b=>d.unref(n).other.frame=b)},null,8,["modelValue"])]),d.createElementVNode("div",rve,[d.createVNode(d.unref(pt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":g[12]||(g[12]=b=>d.unref(n).other.facetColumns=b)},null,8,["modelValue"])]),d.createElementVNode("div",ave,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Facet shared by",options:h.value,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":g[13]||(g[13]=b=>d.unref(n).other.facetSharedBy=b)},null,8,["options","modelValue"])])])])]))}}),ove={class:"axes-settings-list"},lve={style:{padding:"0 24px 8px"}},sve={class:"axes-settings-options-row block"},uve={key:0,class:"axes-settings-input"},cve={class:"axes-settings-options-row"},fve={class:"axes-settings-options-row block"},dve={key:0},Ave={class:"axes-settings-options-row block"},pve={class:"axes-settings-options-row table"},hve={class:"axes-settings-options-row table"},mve={class:"axes-settings-options-row block"},vve={class:"axes-settings-options-row table"},gve={class:"axes-settings-options-row table"},yve={class:"other"},wve={class:"axes-settings-options-row"},Cve={class:"axes-settings-options-row"},bve={class:"axes-settings-options-row block"},Eve=d.defineComponent({__name:"HistogramAxesSettingsForm",setup(e){const n=da().value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:P7},{value:"center",icon:M7},{value:"right",icon:D7}],i=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],o=[{value:"linear",text:"Linear"},{value:"log",text:"Log"}],s=[{value:"empty",icon:I7},{value:"left",icon:cB},{value:"bottom",icon:fB},{value:"left-bottom",icon:dB},{value:"full",icon:H7}],c=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}];return(f,A)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:A[15]||(A[15]=h=>h.stopPropagation())},[A[22]||(A[22]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",ove,[d.createElementVNode("div",lve,[d.createVNode(d.unref(pt.Slider),{style:{width:"100%"},label:"Bins count",min:3,max:100,step:1,breakpoints:!1,mode:"input",modelValue:d.unref(n).other.binsCount,"onUpdate:modelValue":A[0]||(A[0]=h=>d.unref(n).other.binsCount=h)},null,8,["modelValue"])]),d.createVNode(ts,{title:"Title",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",sve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:i,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":A[1]||(A[1]=h=>d.unref(n).title.mode=h)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",uve,[d.createVNode(d.unref(pt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":A[2]||(A[2]=h=>d.unref(n).title.value=h)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",cve,[A[16]||(A[16]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Uf,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":A[3]||(A[3]=h=>d.unref(n).title.position=h)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"X-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",fve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:i,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":A[4]||(A[4]=h=>d.unref(n).axisX.titleMode=h)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",dve,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":A[5]||(A[5]=h=>d.unref(n).axisX.customTitle=h)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Ave,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Scale",options:o,modelValue:d.unref(n).axisX.scale,"onUpdate:modelValue":A[6]||(A[6]=h=>d.unref(n).axisX.scale=h)},null,8,["modelValue"])]),d.createElementVNode("div",pve,[A[17]||(A[17]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.gridlines,"onUpdate:modelValue":A[7]||(A[7]=h=>d.unref(n).axisX.gridlines=h)},null,8,["modelValue"])]),d.createElementVNode("div",hve,[A[18]||(A[18]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.ticks,"onUpdate:modelValue":A[8]||(A[8]=h=>d.unref(n).axisX.ticks=h)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"Y-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",mve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Scale",options:o,modelValue:d.unref(n).axisY.scale,"onUpdate:modelValue":A[9]||(A[9]=h=>d.unref(n).axisY.scale=h)},null,8,["modelValue"])]),d.createElementVNode("div",vve,[A[19]||(A[19]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisY.gridlines,"onUpdate:modelValue":A[10]||(A[10]=h=>d.unref(n).axisY.gridlines=h)},null,8,["modelValue"])]),d.createElementVNode("div",gve,[A[20]||(A[20]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisY.ticks,"onUpdate:modelValue":A[11]||(A[11]=h=>d.unref(n).axisY.ticks=h)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",yve,[d.createElementVNode("div",wve,[A[21]||(A[21]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Uf,{options:s,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":A[12]||(A[12]=h=>d.unref(n).other.frame=h)},null,8,["modelValue"])]),d.createElementVNode("div",Cve,[d.createVNode(d.unref(pt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":A[13]||(A[13]=h=>d.unref(n).other.facetColumns=h)},null,8,["modelValue"])]),d.createElementVNode("div",bve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Facet shared by",options:c,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":A[14]||(A[14]=h=>d.unref(n).other.facetSharedBy=h)},null,8,["modelValue"])])])])]))}}),xve={class:"axes-settings-list"},Sve={class:"axes-settings-options-row block"},Bve={key:0,class:"axes-settings-input"},kve={class:"axes-settings-options-row"},Tve={class:"axes-settings-options-row"},_ve={class:"axes-settings-options-row block"},Pve={key:0},Mve={class:"axes-settings-options-row block"},Dve={class:"axes-settings-options-row"},Hve={class:"axes-settings-options-row block"},Ive={key:0},Lve={class:"axes-settings-options-row block"},Rve={class:"other"},Nve={class:"axes-settings-options-row"},$ve={class:"axes-settings-options-row"},Fve=d.defineComponent({__name:"BubbleAxesSettingsForm",setup(e){const n=da().value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:P7},{value:"center",icon:M7},{value:"right",icon:D7}],i=[{value:0,icon:lB},{value:45,icon:sB},{value:90,icon:uB}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"none",icon:I7},{value:"full",icon:H7}],c=[{text:"ascending",value:"asc"},{text:"descending",value:"desc"}];return(f,A)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:A[13]||(A[13]=h=>h.stopPropagation())},[A[18]||(A[18]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",xve,[d.createVNode(ts,{title:"Title",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Sve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":A[0]||(A[0]=h=>d.unref(n).title.mode=h)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",Bve,[d.createVNode(d.unref(pt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":A[1]||(A[1]=h=>d.unref(n).title.value=h)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",kve,[A[14]||(A[14]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Uf,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":A[2]||(A[2]=h=>d.unref(n).title.position=h)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"X-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Tve,[A[15]||(A[15]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Uf,{options:i,modelValue:d.unref(n).axisX.axisLabelsAngle,"onUpdate:modelValue":A[3]||(A[3]=h=>d.unref(n).axisX.axisLabelsAngle=h)},null,8,["modelValue"])]),d.createElementVNode("div",_ve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":A[4]||(A[4]=h=>d.unref(n).axisX.titleMode=h)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Pve,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":A[5]||(A[5]=h=>d.unref(n).axisX.customTitle=h)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Mve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Sorting",options:c,modelValue:d.unref(n).axisX.sorting,"onUpdate:modelValue":A[6]||(A[6]=h=>d.unref(n).axisX.sorting=h)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"Y-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Dve,[A[16]||(A[16]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Uf,{options:i,modelValue:d.unref(n).axisY.axisLabelsAngle,"onUpdate:modelValue":A[7]||(A[7]=h=>d.unref(n).axisY.axisLabelsAngle=h)},null,8,["modelValue"])]),d.createElementVNode("div",Hve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":A[8]||(A[8]=h=>d.unref(n).axisY.titleMode=h)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Ive,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":A[9]||(A[9]=h=>d.unref(n).axisY.customTitle=h)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Lve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Sorting",options:c,modelValue:d.unref(n).axisY.sorting,"onUpdate:modelValue":A[10]||(A[10]=h=>d.unref(n).axisY.sorting=h)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",Rve,[d.createElementVNode("div",Nve,[A[17]||(A[17]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Uf,{options:s,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":A[11]||(A[11]=h=>d.unref(n).other.frame=h)},null,8,["modelValue"])]),d.createElementVNode("div",$ve,[d.createVNode(d.unref(pt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":A[12]||(A[12]=h=>d.unref(n).other.facetColumns=h)},null,8,["modelValue"])])])])]))}}),Vve={class:"data-form"},Ove=d.defineComponent({__name:"index",setup(e){const t=da();return(n,r)=>(d.openBlock(),d.createElementBlock("div",Vve,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createBlock(yme,{key:0})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"||d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(),d.createBlock(Qme,{key:1})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createBlock(ive,{key:2})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createBlock(Eve,{key:3})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createBlock(Fve,{key:4})):d.createCommentVNode("",!0)]))}});function df(e,t,n,r=!1){const a=t.components.primaryGrouping.selectorStates.length>0,i=t.components.secondaryGrouping.selectorStates.length>0;return e===null?i?{type:"secondaryGrouping"}:a&&!r?{type:"primaryGrouping"}:n:e}const Qve={class:"aes-mapping-block"},zve={style:{margin:"0 24px"}},Uve={class:"section-title"},jve={style:{margin:"24px 0"}},Gve={style:{margin:"24px 0"}},Yve={style:{margin:"24px 0"}},Wve={style:{display:"flex",marginTop:"16px",gap:"8px"}},Xve=d.defineComponent({__name:"AesDataMappingContinuous",props:{dataColumnLabel:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){var b,C;const n=e,r=t,a=d.ref(!1),i=d.ref(n.modelValue.palette);function o(x){i.value=x,a.value=!1,r("update:modelValue",Vv(x))}const s=[{value:"auto",label:"Auto"},{value:"custom",label:"Custom"}],c=d.ref(n.modelValue.range?"custom":"auto"),f=[{value:"linear",label:"Linear"},{value:"log",label:"Log"}],A=d.ref(n.modelValue.log?"log":"linear"),h=d.ref(((b=n.modelValue.range)==null?void 0:b.minValue)??void 0),m=d.ref(((C=n.modelValue.range)==null?void 0:C.maxValue)??void 0),g=d.ref(n.modelValue.midPoint??void 0);return d.watch(()=>c.value,x=>{x==="custom"&&r("update:modelValue",{...n.modelValue,range:{minValue:h.value??null,maxValue:m.value??null}}),x==="auto"&&r("update:modelValue",{...n.modelValue,range:null})}),d.watch(()=>h.value,x=>{r("update:modelValue",{...n.modelValue,range:{...n.modelValue.range,minValue:x}})}),d.watch(()=>m.value,x=>{r("update:modelValue",{...n.modelValue,range:{...n.modelValue.range,maxValue:x}})}),d.watch(()=>g.value,x=>{r("update:modelValue",{...n.modelValue,midPoint:x??null})}),d.watch(()=>A.value,x=>{r("update:modelValue",{...n.modelValue,log:x==="log"})}),(x,k)=>(d.openBlock(),d.createElementBlock("div",Qve,[d.createElementVNode("div",zve,[d.createElementVNode("div",Uve,[d.createElementVNode("span",null,d.toDisplayString(x.dataColumnLabel),1)]),d.createElementVNode("div",jve,[d.createVNode(o3,{label:"Color Palette ",title:d.unref(Do)[i.value].title,palette:i.value,onButtonClick:k[0]||(k[0]=_=>{a.value=!0})},null,8,["title","palette"])]),d.createElementVNode("div",Gve,[d.createVNode(d.unref(pt.PlBtnGroup),{options:f,modelValue:A.value,"onUpdate:modelValue":k[1]||(k[1]=_=>A.value=_)},null,8,["modelValue"])]),d.createElementVNode("div",Yve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Gradient range",options:s,modelValue:c.value,"onUpdate:modelValue":k[2]||(k[2]=_=>c.value=_)},null,8,["modelValue"])]),d.createElementVNode("div",Wve,[c.value==="custom"?(d.openBlock(),d.createBlock(d.unref(pt.PlNumberField),{key:0,label:"From",updateOnEnterOrClickOutside:!0,useIncrementButtons:!1,modelValue:h.value,"onUpdate:modelValue":k[3]||(k[3]=_=>h.value=_)},null,8,["modelValue"])):d.createCommentVNode("",!0),d.createVNode(d.unref(pt.PlNumberField),{label:"Mid point",updateOnEnterOrClickOutside:!0,useIncrementButtons:!1,style:{flexGrow:1},modelValue:g.value,"onUpdate:modelValue":k[4]||(k[4]=_=>g.value=_)},null,8,["modelValue"]),c.value==="custom"?(d.openBlock(),d.createBlock(d.unref(pt.PlNumberField),{key:1,label:"To",updateOnEnterOrClickOutside:!0,useIncrementButtons:!1,modelValue:m.value,"onUpdate:modelValue":k[5]||(k[5]=_=>m.value=_)},null,8,["modelValue"])):d.createCommentVNode("",!0)]),a.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":k[6]||(k[6]=_=>a.value=!1)},{default:d.withCtx(()=>[d.createVNode(l3,{selected:i.value,categorical:!1,onSelect:o},null,8,["selected"])]),_:1})):d.createCommentVNode("",!0)])]))}}),Kve={class:"aes-input-row"},Hi=d.defineComponent({__name:"AesSelector",props:{label:{},type:{},selected:{},formTitle:{},formBackTitle:{},possibleAesSourceInputs:{},withoutFixed:{type:Boolean},disabled:{type:Boolean}},emits:["aes-update","aes-selector-close"],setup(e,{emit:t}){var K,re;const n=e,r=da(),a=d.computed(()=>r.value.reactive.chartType),i=t,o={discrete:["primaryGrouping","secondaryGrouping"],scatterplot:["grouping"],"scatterplot-umap":["grouping"],dendro:[],heatmap:[],histogram:[],bubble:[]},s=n.possibleAesSourceInputs??o[a.value],c=d.computed(()=>r.value.commonHelpersData.usedAesInMapping.value);function f(U){return typeof U=="string"?U:a.value==="scatterplot"?`grouping_${U.value}`:a.value==="dendro"?`${U.type}_${U.value}`:U.type}const A=d.ref(Yy(n.selected)?f(n.selected):"fix"),h={fill:_y[0].color,stroke:_y[0].color,dotShape:P0,lineType:AC,size:""},m=d.computed(()=>r.value.inputGuide.value),g=d.computed(()=>r.value.uniqueValuesData.value),b=new Set(["scatterplot","scatterplot-umap","heatmap"]),C=d.computed(()=>{const U={},G=r.value.reactive.optionsState.components;function Z(Y,X){const oe=m.value.getSourceInfo(X),me=g.value[X],ae=(me==null?void 0:me.list)??[],ye=(me==null?void 0:me.labels)??{},Ce=f({type:Y,value:X});if(b.has(a.value)&&oe.type==="String"||!b.has(a.value)){const ce=r.value.reactive.dataBindAes[X]??Uy(ae);U[Ce]={type:"dataCategorical",value:Ce,initialData:ce,inputName:Y,selectedSource:X,selectedSourceInfo:oe,selectedSourceValues:ae,labels:ce.order.reduce((ge,ze)=>(ge[ze]=ye[ze]??String(ze),ge),{})}}else{const ce=r.value.reactive.dataBindAes[X]??Vv(Z1);U[Ce]={type:"dataContinuous",value:Ce,initialData:ce,inputName:Y,selectedSource:X,selectedSourceInfo:oe,selectedSourceValues:ae}}}return s.forEach(Y=>{var X;(X=G==null?void 0:G[Y])!=null&&X.selectorStates.length&&G[Y].selectorStates.forEach(({selectedSource:oe})=>{Z(Y,oe)})}),n.withoutFixed||(U.fix={type:"fix",value:"fix",initialData:Yy(n.selected)?h[n.type]:n.selected}),U}),x=d.computed(()=>C.value[A.value]??null);function k(U,G){var Z,Y,X,oe;return U.type==="fix"?"Fixed":G===U.value?`${(Z=U.selectedSourceInfo)==null?void 0:Z.label}`:a.value==="discrete"?`${U.value==="primaryGrouping"?"Primary":"Secondary"} grouping: ${(Y=U.selectedSourceInfo)==null?void 0:Y.label}`:a.value==="scatterplot"||a.value==="dendro"?`Grouping: ${(X=U.selectedSourceInfo)==null?void 0:X.label}`:((oe=U.selectedSourceInfo)==null?void 0:oe.label)??""}const _=d.computed(()=>{const U=[],G=r.value.reactive.optionsState.components;function Z(Y,X){const oe=f({type:Y==="shape"?"grouping":Y,value:X});C.value[oe]&&U.push({text:k(C.value[oe],A.value),value:oe})}if(s.forEach(Y=>{var X;(X=G==null?void 0:G[Y])!=null&&X.selectorStates.length&&G[Y].selectorStates.forEach(({selectedSource:oe})=>{Z(Y,oe)})}),!C.value[A.value]){let Y="Not consistent (grouping)";a.value==="discrete"&&(Y=`${A.value==="primaryGrouping"?"Primary":"Secondary"} grouping (not selected)`),U.push({text:Y,value:A.value})}return n.withoutFixed||U.push({text:"Fixed",value:"fix"}),U}),D=d.ref(!1),O=d.ref(C.value.fix?C.value.fix.initialData:null),I=d.ref(((K=x.value)==null?void 0:K.type)==="dataCategorical"?x.value.initialData:null),$=d.ref(((re=x.value)==null?void 0:re.type)==="dataContinuous"?x.value.initialData:null);d.watch(()=>A.value,U=>{const G=C.value[U];G.type==="fix"?i("aes-update",O.value,G):G.type==="dataCategorical"?(I.value=G.initialData,i("aes-update",G.initialData,G)):G.type==="dataContinuous"&&($.value=G.initialData,i("aes-update",G.initialData,G))});const Q=d.ref(),ee=d.computed(()=>{if(n.type==="lineType")return My.length*32+16*2;if(n.type==="dotShape")return Math.ceil(N5.length/6)*36+20*2;if(n.type==="fill"||n.type==="stroke")return Math.ceil(_y.length/6)*36+20*2});return(U,G)=>{var Z,Y;return d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",Kve,[d.createElementVNode("div",{class:"aes-input-select",onClick:G[1]||(G[1]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(pt.PlDropdown),{disabled:U.disabled||_.value.length<2,label:U.label,options:_.value,modelValue:A.value,"onUpdate:modelValue":G[0]||(G[0]=X=>A.value=X)},null,8,["disabled","label","options","modelValue"])]),d.createVNode(L7,{data:{type:A.value==="fix"?U.type:"data",value:A.value==="fix"?U.type==="size"?Number(U.selected):U.selected:null},onClick:G[2]||(G[2]=X=>D.value=!D.value),onRef:G[3]||(G[3]=X=>Q.value=X)},null,8,["data"]),A.value==="fix"&&D.value&&O.value?(d.openBlock(),d.createBlock(db,{key:0,height:ee.value,targetRef:Q.value,"onPopup:close":G[10]||(G[10]=X=>D.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["fixed-aes-list",{"fixed-aes-list__rows":U.type==="lineType"}])},[U.type==="fill"||U.type==="stroke"?(d.openBlock(),d.createBlock(d$,{key:0,"color-using":U.type,modelValue:O.value,"onUpdate:modelValue":[G[4]||(G[4]=X=>O.value=X),G[5]||(G[5]=X=>U.$emit("aes-update",X,C.value.fix))]},null,8,["color-using","modelValue"])):d.createCommentVNode("",!0),U.type==="dotShape"?(d.openBlock(),d.createBlock(A$,{key:1,modelValue:O.value,"onUpdate:modelValue":[G[6]||(G[6]=X=>O.value=X),G[7]||(G[7]=X=>U.$emit("aes-update",X,C.value.fix))]},null,8,["modelValue"])):d.createCommentVNode("",!0),U.type==="lineType"?(d.openBlock(),d.createBlock(fb,{key:2,modelValue:O.value,"onUpdate:modelValue":[G[8]||(G[8]=X=>O.value=X),G[9]||(G[9]=X=>U.$emit("aes-update",X,C.value.fix))]},null,8,["modelValue"])):d.createCommentVNode("",!0)],2)]),_:1},8,["height","targetRef"])):d.createCommentVNode("",!0)]),(((Z=x.value)==null?void 0:Z.type)==="dataCategorical"&&I.value||((Y=x.value)==null?void 0:Y.type)==="dataContinuous"&&$.value)&&D.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:U.formTitle,"back-title":U.formBackTitle,"onForm:close":G[15]||(G[15]=X=>D.value=!1)},{default:d.withCtx(()=>{var X,oe,me,ae;return[((X=x.value)==null?void 0:X.type)==="dataCategorical"&&I.value?(d.openBlock(),d.createBlock(vB,{key:0,"column-value-labels":x.value.labels,"data-column-label":((oe=x.value.selectedSourceInfo)==null?void 0:oe.label)??"","used-aes-in-mapping":c.value[x.value.selectedSource],"allow-reordering":a.value==="discrete",modelValue:I.value,"onUpdate:modelValue":[G[11]||(G[11]=ye=>I.value=ye),G[12]||(G[12]=ye=>U.$emit("aes-update",ye,x.value))]},null,8,["column-value-labels","data-column-label","used-aes-in-mapping","allow-reordering","modelValue"])):d.createCommentVNode("",!0),((me=x.value)==null?void 0:me.type)==="dataContinuous"&&$.value?(d.openBlock(),d.createBlock(Xve,{key:1,"data-column-label":((ae=x.value.selectedSourceInfo)==null?void 0:ae.label)??"",modelValue:$.value,"onUpdate:modelValue":[G[13]||(G[13]=ye=>$.value=ye),G[14]||(G[14]=ye=>U.$emit("aes-update",ye,x.value))]},null,8,["data-column-label","modelValue"])):d.createCommentVNode("",!0)]}),_:1},8,["title","back-title"])):d.createCommentVNode("",!0)],64)}}}),Zve={class:"checkbox-item"},Kv="box",Jve=d.defineComponent({__name:"Boxplot",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[Kv]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.fillColor,r.value,Py)),i=d.computed(()=>df(n.value.lineColor,r.value,yo)),o=d.computed(()=>n.value.dotShape),s=d.computed(()=>n.value.lineType);function c(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[Kv][b]={type:g.inputName}:t.value.reactive.layersSettings[Kv][b]=m,g.type==="dataCategorical"&&typeof m!="string"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}function f(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[Kv][b]={type:g.inputName}:t.value.reactive.layersSettings[Kv][b]=m,g.type==="dataCategorical"&&typeof m=="object"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}function A(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[Kv][b]={type:g.inputName}:t.value.reactive.layersSettings[Kv][b]=m,g.type==="dataCategorical"&&typeof m=="object"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}const h=d.computed({get:()=>n.value.opacity*100,set:m=>{n.value.opacity=m/100}});return(m,g)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:g[0]||(g[0]=(b,C)=>c(b,C,"fillColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:g[1]||(g[1]=(b,C)=>c(b,C,"lineColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:s.value,onAesUpdate:g[2]||(g[2]=(b,C)=>A(b,C,"lineType"))},null,8,["selected"]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:h.value,"onUpdate:modelValue":g[3]||(g[3]=b=>h.value=b)},null,8,["modelValue"]),d.createElementVNode("div",Zve,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.showOutliers,"onUpdate:modelValue":g[4]||(g[4]=b=>n.value.showOutliers=b)},null,8,["modelValue"]),g[6]||(g[6]=d.createElementVNode("span",null,"Show outliers",-1))]),n.value.showOutliers?(d.openBlock(),d.createBlock(Hi,{key:0,label:"Outlier shape","form-title":"Outlier Shape Settings","form-back-title":"Layers",type:"dotShape","possible-aes-source-inputs":[],selected:o.value,onAesUpdate:g[5]||(g[5]=(b,C)=>f(b,C,"dotShape"))},null,8,["selected"])):d.createCommentVNode("",!0)],64))}}),qve={class:"checkbox-item"},gB="binnedDots",ege=d.defineComponent({__name:"BinnedDots",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[gB]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.fillColor,r.value,Py)),i=d.computed(()=>df(n.value.lineColor,r.value,yo));function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[gB][A]={type:f.inputName}:t.value.reactive.layersSettings[gB][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,h)=>o(A,h,"fillColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:f[1]||(f[1]=(A,h)=>o(A,h,"lineColor"))},null,8,["selected"]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"]),d.createElementVNode("div",qve,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.showOutliers,"onUpdate:modelValue":f[3]||(f[3]=A=>n.value.showOutliers=A)},null,8,["modelValue"]),f[4]||(f[4]=d.createElementVNode("span",null,"Show outliers",-1))])],64))}}),tge={class:"checkbox-item"},$7="jitteredDots",nge=d.defineComponent({__name:"JitteredDots",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[$7]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.dotFill,r.value,yo));function i(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[$7][A]={type:f.inputName}:t.value.reactive.layersSettings[$7][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[$7][A]={type:f.inputName}:t.value.reactive.layersSettings[$7][A]=c,f.type==="dataCategorical"&&typeof c=="object"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,h)=>i(A,h,"dotFill"))},null,8,["selected"]),d.createVNode(Hi,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,onAesUpdate:f[1]||(f[1]=(A,h)=>o(A,h,"dotShape"))},null,8,["selected"]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"]),d.createElementVNode("div",tge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.showOutliers,"onUpdate:modelValue":f[3]||(f[3]=A=>n.value.showOutliers=A)},null,8,["modelValue"]),f[4]||(f[4]=d.createElementVNode("span",null,"Show outliers",-1))])],64))}}),rge={class:"checkbox-item"},age={class:"checkbox-item"},ige={key:0},u3="violin",oge=d.defineComponent({__name:"Violin",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[u3]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.fillColor,r.value,Py)),i=d.computed(()=>df(n.value.lineColor,r.value,yo)),o=d.computed(()=>n.value.lineType),s=d.computed(()=>n.value.medianLineStyle),c=d.computed(()=>n.value.quartilesLineStyle);function f(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[u3][b]={type:g.inputName}:t.value.reactive.layersSettings[u3][b]=m,g.type==="dataCategorical"&&typeof m!="string"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}function A(m,g,b){t.value.reactive.layersSettings[u3][b]=typeof m=="object"?{type:g.value}:m,g.type==="dataCategorical"&&typeof m=="object"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}const h=d.computed({get:()=>n.value.opacity*100,set:m=>{n.value.opacity=m/100}});return(m,g)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:g[0]||(g[0]=(b,C)=>f(b,C,"fillColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:g[1]||(g[1]=(b,C)=>f(b,C,"lineColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:o.value,onAesUpdate:g[2]||(g[2]=(b,C)=>A(b,C,"lineType"))},null,8,["selected"]),d.createElementVNode("div",rge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.trim,"onUpdate:modelValue":g[3]||(g[3]=b=>n.value.trim=b)},null,8,["modelValue"]),g[8]||(g[8]=d.createElementVNode("span",null,"Trim",-1))]),d.createElementVNode("div",age,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.showQuartiles,"onUpdate:modelValue":g[4]||(g[4]=b=>n.value.showQuartiles=b)},null,8,["modelValue"]),g[9]||(g[9]=d.createElementVNode("span",null,"Show median and quartiles",-1))]),n.value.showQuartiles?(d.openBlock(),d.createElementBlock("div",ige,[d.createVNode(Hi,{label:"Madian Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:s.value,onAesUpdate:g[5]||(g[5]=b=>d.unref(t).reactive.layersSettings[u3].medianLineStyle=b)},null,8,["selected"]),d.createVNode(Hi,{label:"Quartiles Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:c.value,onAesUpdate:g[6]||(g[6]=b=>d.unref(t).reactive.layersSettings[u3].quartilesLineStyle=b)},null,8,["selected"])])):d.createCommentVNode("",!0),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:h.value,"onUpdate:modelValue":g[7]||(g[7]=b=>h.value=b)},null,8,["modelValue"])],64))}}),yB="bar",lge=d.defineComponent({__name:"Bar",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[yB]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.fillColor,r.value,Py)),i=d.computed(()=>df(n.value.lineColor,r.value,yo));function o(f,A,h){A.type==="dataCategorical"?t.value.reactive.layersSettings[yB][h]={type:A.inputName}:t.value.reactive.layersSettings[yB][h]=f,A.type==="dataCategorical"&&typeof f!="string"&&(t.value.reactive.dataBindAes[A.selectedSource]=f)}const s=[{text:"Min",value:"min"},{text:"Max",value:"max"},{text:"Mean",value:"mean"},{text:"Median",value:"median"}],c=d.computed({get:()=>n.value.opacity*100,set:f=>{n.value.opacity=f/100}});return(f,A)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:A[0]||(A[0]=(h,m)=>o(h,m,"fillColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:A[1]||(A[1]=(h,m)=>o(h,m,"lineColor"))},null,8,["selected"]),d.createElementVNode("div",{class:"input-item",onClick:A[3]||(A[3]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(pt.PlDropdown),{label:"Height",options:s,modelValue:n.value.height,"onUpdate:modelValue":A[2]||(A[2]=h=>n.value.height=h)},null,8,["modelValue"])]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:c.value,"onUpdate:modelValue":A[4]||(A[4]=h=>c.value=h)},null,8,["modelValue"])],64))}}),sge={class:"checkbox-item"},wB="stackedBar",uge=d.defineComponent({__name:"StackedBar",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[wB]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.fillColor,r.value,Py)),i=d.computed(()=>df(n.value.lineColor,r.value,yo));function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[wB][A]={type:f.inputName}:t.value.reactive.layersSettings[wB][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,h)=>o(A,h,"fillColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:f[1]||(f[1]=(A,h)=>o(A,h,"lineColor"))},null,8,["selected"]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"]),d.createElementVNode("div",sge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.normalize,"onUpdate:modelValue":f[3]||(f[3]=A=>n.value.normalize=A)},null,8,["modelValue"]),f[4]||(f[4]=d.createElementVNode("span",null,"Normalize",-1))])],64))}}),Zv="line",cge=d.defineComponent({__name:"Line",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[Zv]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.lineColor,r.value,yo,!0)),i=d.computed(()=>df(n.value.dotFill,r.value,yo,!0)),o=d.computed(()=>n.value.lineType);function s(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[Zv][b]={type:g.inputName}:t.value.reactive.layersSettings[Zv][b]=m,g.type==="dataCategorical"&&typeof m!="string"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}function c(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[Zv][b]={type:g.inputName}:t.value.reactive.layersSettings[Zv][b]=m,g.type==="dataCategorical"&&typeof m=="object"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}function f(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[Zv][b]={type:g.inputName}:t.value.reactive.layersSettings[Zv][b]=m,g.type==="dataCategorical"&&typeof m=="object"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}const A=[{text:"Mean",value:"mean"},{text:"Median",value:"median"}],h=d.computed({get:()=>n.value.opacity*100,set:m=>{n.value.opacity=m/100}});return(m,g)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:a.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:g[0]||(g[0]=(b,C)=>s(b,C,"lineColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":["secondaryGrouping"],selected:o.value,onAesUpdate:g[1]||(g[1]=(b,C)=>f(b,C,"lineType"))},null,8,["selected"]),d.createVNode(Hi,{label:"Dot fill","form-title":"Dot Fill Settings","form-back-title":"Layers",type:"fill",selected:i.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:g[2]||(g[2]=(b,C)=>s(b,C,"dotFill"))},null,8,["selected"]),d.createVNode(Hi,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:g[3]||(g[3]=(b,C)=>c(b,C,"dotShape"))},null,8,["selected"]),d.createElementVNode("div",{class:"input-item",onClick:g[5]||(g[5]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(pt.PlDropdown),{label:"Point value",options:A,modelValue:n.value.pointsValues,"onUpdate:modelValue":g[4]||(g[4]=b=>n.value.pointsValues=b)},null,8,["modelValue"])]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:h.value,"onUpdate:modelValue":g[6]||(g[6]=b=>h.value=b)},null,8,["modelValue"])],64))}}),F7="errorbar",fge=d.defineComponent({__name:"Errorbar",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[F7]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.lineColor,r.value,yo,!0)),i=d.computed(()=>df(n.value.dotFill,r.value,yo,!0));function o(h,m,g){m.type==="dataCategorical"?t.value.reactive.layersSettings[F7][g]={type:m.inputName}:t.value.reactive.layersSettings[F7][g]=h,m.type==="dataCategorical"&&typeof h!="string"&&(t.value.reactive.dataBindAes[m.selectedSource]=h)}function s(h,m,g){m.type==="dataCategorical"?t.value.reactive.layersSettings[F7][g]={type:m.inputName}:t.value.reactive.layersSettings[F7][g]=h,m.type==="dataCategorical"&&typeof h=="object"&&(t.value.reactive.dataBindAes[m.selectedSource]=h)}const c=[{text:"Standard deviation",value:"sd"},{text:"Standard error",value:"se"},{text:"Confident interval",value:"ci"}],f=[{text:"Mean",value:"mean"},{text:"Median",value:"median"}],A=d.computed({get:()=>n.value.opacity*100,set:h=>{n.value.opacity=h/100}});return(h,m)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:a.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:m[0]||(m[0]=(g,b)=>o(g,b,"lineColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Dot fill","form-title":"Dot Fill Settings","form-back-title":"Layers",type:"fill",selected:i.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:m[1]||(m[1]=(g,b)=>o(g,b,"dotFill"))},null,8,["selected"]),d.createVNode(Hi,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:m[2]||(m[2]=(g,b)=>s(g,b,"dotShape"))},null,8,["selected"]),d.createElementVNode("div",{class:"input-item",onClick:m[4]||(m[4]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(pt.PlDropdown),{label:"Point value",options:f,modelValue:n.value.pointsValues,"onUpdate:modelValue":m[3]||(m[3]=g=>n.value.pointsValues=g)},null,8,["modelValue"])]),d.createElementVNode("div",{class:"input-item",onClick:m[6]||(m[6]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(pt.PlDropdown),{label:"Interval",options:c,modelValue:n.value.interval,"onUpdate:modelValue":m[5]||(m[5]=g=>n.value.interval=g)},null,8,["modelValue"])]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:A.value,"onUpdate:modelValue":m[7]||(m[7]=g=>A.value=g)},null,8,["modelValue"])],64))}}),V7="sina",dge=d.defineComponent({__name:"Sina",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[V7]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.dotFill,r.value,yo));function i(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[V7][A]={type:f.inputName}:t.value.reactive.layersSettings[V7][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[V7][A]={type:f.inputName}:t.value.reactive.layersSettings[V7][A]=c,f.type==="dataCategorical"&&typeof c=="object"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,h)=>i(A,h,"dotFill"))},null,8,["selected"]),d.createVNode(Hi,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,onAesUpdate:f[1]||(f[1]=(A,h)=>o(A,h,"dotShape"))},null,8,["selected"]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"])],64))}}),Age={class:"checkbox-item"},pge="logo",hge=d.defineComponent({__name:"Logo",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[pge]),r=d.computed({get:()=>n.value.opacity*100,set:a=>{n.value.opacity=a/100}});return(a,i)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=o=>r.value=o)},null,8,["modelValue"]),d.createElementVNode("div",Age,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.normalize,"onUpdate:modelValue":i[1]||(i[1]=o=>n.value.normalize=o)},null,8,["modelValue"]),i[2]||(i[2]=d.createElementVNode("span",null,"Normalize",-1))])],64))}}),mge={class:"button-group-item"},vge={class:"button-group-item"},gge={class:"button-group-item",style:{display:"flex",alignItems:"end"}},yge=d.defineComponent({__name:"Heatmap",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings.heatmap),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>t.value.inputGuide.value),i=d.computed(()=>{var C;return(C=r.value.components.value.selectorStates[0])==null?void 0:C.selectedSource}),o=d.computed(()=>{var C;return i.value?(C=t.value.reactive.dataBindAes[i.value])==null?void 0:C.palette:void 0}),s=d.ref(!1),c=d.ref(o.value??Z1);function f(C){c.value=C,s.value=!1,i.value&&(t.value.reactive.dataBindAes[i.value]=Vv(C))}const A=[{label:"None",value:null},{label:"Columns",value:"column"},{label:"Rows",value:"row"}],h=[{label:"z-score",value:"standardScaling"},{label:"Min-max",value:"meanNormalization"}],m=[{label:"empty",value:null},{label:"Special value",value:"custom"}],g=d.ref(n.value.NAValueAs===null?null:"custom"),b=d.ref(n.value.NAValueAs??0);return(C,x)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(o3,{label:"Color Palette ",title:d.unref(Do)[c.value].title,palette:c.value,onButtonClick:x[0]||(x[0]=k=>{s.value=!0})},null,8,["title","palette"]),s.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":x[1]||(x[1]=k=>s.value=!1)},{default:d.withCtx(()=>[d.createVNode(l3,{selected:c.value,categorical:i.value?a.value.getSourceInfo(i.value).type==="String":!1,onSelect:f},null,8,["selected","categorical"])]),_:1})):d.createCommentVNode("",!0),d.createElementVNode("div",mge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Normalize by",options:A,compact:!0,modelValue:n.value.normalizationDirection,"onUpdate:modelValue":x[2]||(x[2]=k=>n.value.normalizationDirection=k)},null,8,["modelValue"])]),d.createElementVNode("div",vge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Normalization method",options:h,compact:!0,modelValue:n.value.normalizationMethod,"onUpdate:modelValue":x[3]||(x[3]=k=>n.value.normalizationMethod=k)},null,8,["modelValue"])]),d.createElementVNode("div",gge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Treat NA value as:",options:m,compact:!0,modelValue:g.value,"onUpdate:modelValue":[x[4]||(x[4]=k=>g.value=k),x[5]||(x[5]=k=>{k==="custom"?n.value.NAValueAs=b.value:n.value.NAValueAs=k})]},null,8,["modelValue"]),d.createVNode(d.unref(pt.PlNumberField),{style:{height:"33px",marginLeft:"16px",width:"75px"},disabled:g.value!=="custom",label:"NA value",useIncrementButtons:!1,modelValue:b.value,"onUpdate:modelValue":[x[6]||(x[6]=k=>b.value=k),x[7]||(x[7]=k=>{k!==void 0&&(n.value.NAValueAs=k)})]},null,8,["disabled","modelValue"])])],64))}}),wge={class:"checkbox-item"},Cge={class:"checkbox-item"},O7="dendro",bge=d.defineComponent({__name:"Dendro",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[O7]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>n.value.dotFill),i=d.computed(()=>n.value.dotShape),o=d.computed(()=>n.value.lineColor);function s(g,b,C){typeof g=="string"?t.value.reactive.layersSettings[O7][C]=g:b.type==="dataCategorical"&&(t.value.reactive.layersSettings[O7][C]={type:b.inputName,value:b.selectedSource}),b.type==="dataCategorical"&&typeof g!="string"&&(t.value.reactive.dataBindAes[b.selectedSource]=g)}function c(g,b,C){typeof g=="string"?t.value.reactive.layersSettings[O7][C]=g:b.type==="dataCategorical"&&(t.value.reactive.layersSettings[O7][C]={type:b.inputName,value:b.selectedSource}),b.type==="dataCategorical"&&typeof g!="string"&&(t.value.reactive.dataBindAes[b.selectedSource]=g)}const f=d.ref(n.value.leavesMode==="alignLeavesToLine"),A=d.computed({get(){return n.value.showLegend??!0},set(g){n.value.showLegend=g}}),h=d.computed({get(){return TS(n.value.dotSize)?[n.value.dotSize.min,n.value.dotSize.max]:[3,10]},set([g,b]){n.value.dotSize={min:g,max:b}}}),m=d.computed({get(){return TS(n.value.dotSize)?3:n.value.dotSize},set(g){n.value.dotSize=g}});return(g,b)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Node color","form-title":"Node Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,"possible-aes-source-inputs":["nodeColor"],"without-fixed":r.value.components.nodeColor.selectorStates.length>0,onAesUpdate:b[0]||(b[0]=(C,x)=>s(C,x,"dotFill"))},null,8,["selected","without-fixed"]),d.createVNode(Hi,{label:"Node shape","form-title":"Node Shape Settings","form-back-title":"Layers",type:"dotShape",selected:i.value,"possible-aes-source-inputs":["nodeShape"],"without-fixed":r.value.components.nodeShape.selectorStates.length>0,onAesUpdate:b[1]||(b[1]=(C,x)=>c(C,x,"dotShape"))},null,8,["selected","without-fixed"]),d.createVNode(Hi,{label:"Line color","form-title":"Line Color Settings","form-back-title":"Layers",type:"fill",selected:o.value,"possible-aes-source-inputs":["lineColor"],"without-fixed":r.value.components.lineColor.selectorStates.length>0,onAesUpdate:b[2]||(b[2]=(C,x)=>s(C,x,"lineColor"))},null,8,["selected","without-fixed"]),d.createElementVNode("div",null,[r.value.components.nodeSize.selectorStates.length>0?(d.openBlock(),d.createBlock(d.unref(pt.SliderRange),{key:0,min:3,max:10,breakpoints:!0,label:"Node size range",modelValue:h.value,"onUpdate:modelValue":b[3]||(b[3]=C=>h.value=C)},null,8,["modelValue"])):(d.openBlock(),d.createBlock(d.unref(pt.Slider),{key:1,min:3,max:10,step:1,breakpoints:!0,label:"Node size",modelValue:m.value,"onUpdate:modelValue":b[4]||(b[4]=C=>m.value=C)},null,8,["modelValue"]))]),d.createElementVNode("div",wge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:f.value,"onUpdate:modelValue":[b[5]||(b[5]=C=>f.value=C),b[6]||(b[6]=C=>{n.value.leavesMode=C?"alignLeavesToLine":"normal"})]},null,8,["modelValue"]),b[8]||(b[8]=d.createElementVNode("span",null,"Move leaves to the right",-1))]),d.createElementVNode("div",Cge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:A.value,"onUpdate:modelValue":b[7]||(b[7]=C=>A.value=C)},null,8,["modelValue"]),b[9]||(b[9]=d.createElementVNode("span",null,"Show legend",-1))])],64))}}),Ege={class:"dot-size-selector"},xge={class:"dot-size-selector__row"},Sge={class:"dot-size-selector-row"},Bge=d.defineComponent({__name:"DotSizeSelector",props:{selected:{},possibleAesSourceInputs:{}},emits:["aes-update","aes-selector-close"],setup(e,{emit:t}){const n=e,r=da(),a=d.computed(()=>r.value.reactive.chartType),i=t,o={discrete:["primaryGrouping","secondaryGrouping"],scatterplot:["size"],"scatterplot-umap":["size"],dendro:[],heatmap:[],histogram:[],bubble:[]},s=n.possibleAesSourceInputs??o[a.value],c=d.ref(Qv(n.selected)?n.selected.column:"fix"),f=d.computed(()=>r.value.inputGuide.value);function A(b){const C=f.value.getSourceInfo(b);return a.value==="scatterplot"||a.value==="dendro"?`Grouping: ${C==null?void 0:C.label}`:C?(C==null?void 0:C.label)??"":"Not consistent (grouping)"}const h=d.computed(()=>{const b=[],C=r.value.reactive.optionsState.components;return s.forEach(x=>{var k;(k=C==null?void 0:C[x])!=null&&k.selectorStates.length&&C[x].selectorStates.forEach(({selectedSource:_})=>{f.value.getSourceInfo(_).type!=="String"&&b.push({text:A(_),value:_})})}),b.length?b:[{text:"Fixed",value:"fix"}]}),m=d.ref(Qv(n.selected)?Lp:n.selected??Lp),g=d.ref(Qv(n.selected)?[n.selected.range.min,n.selected.range.max]:[zy.min,zy.max]);return d.watch(()=>c.value,b=>{if(b==="fix")i("aes-update",m.value);else{const C={column:b,range:{min:g.value[0],max:g.value[1]}};i("aes-update",C)}}),d.watch(()=>m.value,b=>{c.value==="fix"&&i("aes-update",b)}),d.watch(()=>g.value,b=>{if(c.value!=="fix"){const C={column:c.value,range:{min:b[0],max:b[1]}};i("aes-update",C)}}),(b,C)=>(d.openBlock(),d.createElementBlock("div",Ege,[d.createElementVNode("div",xge,[d.createElementVNode("div",{class:"aes-input-select",onClick:C[1]||(C[1]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(pt.PlDropdown),{disabled:h.value.length<2&&h.value[0].value===c.value,label:"Dot size source",options:h.value,modelValue:c.value,"onUpdate:modelValue":C[0]||(C[0]=x=>c.value=x)},null,8,["disabled","options","modelValue"])])]),d.createElementVNode("div",Sge,[c.value!=="fix"?(d.openBlock(),d.createBlock(d.unref(pt.SliderRange),{key:0,min:3,max:10,breakpoints:!0,label:"Dot size range",modelValue:g.value,"onUpdate:modelValue":C[2]||(C[2]=x=>g.value=x)},null,8,["modelValue"])):(d.openBlock(),d.createBlock(d.unref(pt.Slider),{key:1,min:3,max:10,step:1,breakpoints:!0,label:"Dot size",modelValue:m.value,"onUpdate:modelValue":C[3]||(C[3]=x=>m.value=x)},null,8,["modelValue"]))])]))}}),c3="dots",kge=d.defineComponent({__name:"Scatter",setup(e){const t=da(),n=t.value.reactive.optionsState,r=d.computed(()=>t.value.inputGuide.value),a=d.computed(()=>t.value.reactive.layersSettings[c3]);function i(g){return g!==null&&typeof g=="object"&&"type"in g}const o=d.computed(()=>{const g=a.value.dotFill,b=n.components.grouping.selectorStates.map(C=>C.selectedSource);return i(g)&&b.length?b.includes(g.value)?g:{type:"grouping",value:b[0]}:b.length?{type:"grouping",value:b[0]}:i(g)?yo:g??yo}),s=d.computed(()=>{const g=a.value.dotShape,b=n.components.shape.selectorStates.map(C=>C.selectedSource);return i(g)&&b.length?g.value===b[0]?g:{type:"shape",value:b[0]}:b.length?{type:"shape",value:b[0]}:i(g)?P0:g??P0}),c=d.computed(()=>{const g=a.value.dotSize,b=n.components.size.selectorStates.map(C=>C.selectedSource);return b.length?Qv(g)?g:{column:b[0],range:zy}:Qv(g)?Lp:g??Lp});function f(g,b,C){typeof g=="string"?t.value.reactive.layersSettings[c3][C]=g:(b.type==="dataCategorical"||b.type==="dataContinuous")&&(t.value.reactive.layersSettings[c3][C]={type:"grouping",value:b.selectedSource}),mR(g)&&b.type!=="fix"&&(t.value.reactive.dataBindAes[b.selectedSource]=g)}function A(g,b,C){typeof g=="string"?t.value.reactive.layersSettings[c3][C]=g:b.type==="dataCategorical"&&(t.value.reactive.layersSettings[c3][C]={type:"grouping",value:b.selectedSource}),b.type==="dataCategorical"&&typeof g!="string"&&(t.value.reactive.dataBindAes[b.selectedSource]=g)}function h(g){t.value.reactive.layersSettings[c3].dotSize=g}const m=d.computed(()=>{if(n.components.grouping.selectorStates.length){const g=n.components.grouping.selectorStates[0].selectedSource,b=r.value.getSourceInfo(g).annotations;if(b!=null&&b[jy])return!0}return!1});return(g,b)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Dot color","form-title":"Dot color Settings","form-back-title":"Layers",type:"fill",selected:o.value,"possible-aes-source-inputs":["grouping"],disabled:m.value,withoutFixed:typeof o.value=="object",onAesUpdate:b[0]||(b[0]=(C,x)=>f(C,x,"dotFill"))},null,8,["selected","disabled","withoutFixed"]),d.createVNode(Hi,{label:"Dot shape","form-title":"Dot shape Settings","form-back-title":"Layers",type:"dotShape","possible-aes-source-inputs":["shape"],selected:s.value,withoutFixed:typeof s.value=="object",onAesUpdate:b[1]||(b[1]=(C,x)=>A(C,x,"dotShape"))},null,8,["selected","withoutFixed"]),d.createVNode(Bge,{selected:c.value,onAesUpdate:h},null,8,["selected"])],64))}}),CB="dots",Tge=d.defineComponent({__name:"Scatter",setup(e){const t=da(),n=t.value.reactive.optionsState,r=d.computed(()=>t.value.inputGuide.value),a=d.computed(()=>t.value.reactive.layersSettings[CB]);function i(f){return f!==null&&typeof f=="object"&&"type"in f}const o=d.computed(()=>{const f=a.value.dotFill,A=n.components.grouping.selectorStates.map(h=>h.selectedSource);return i(f)&&A.length?A.includes(f.value)?f:{type:"grouping",value:A[0]}:A.length?{type:"grouping",value:A[0]}:i(f)?yo:f??yo});function s(f,A,h){typeof f=="string"?t.value.reactive.layersSettings[CB][h]=f:(A.type==="dataCategorical"||A.type==="dataContinuous")&&(t.value.reactive.layersSettings[CB][h]={type:"grouping",value:A.selectedSource}),mR(f)&&A.type!=="fix"&&(t.value.reactive.dataBindAes[A.selectedSource]=f)}const c=d.computed(()=>{if(n.components.grouping.selectorStates.length){const f=n.components.grouping.selectorStates[0].selectedSource,A=r.value.getSourceInfo(f).annotations;if(A!=null&&A[jy])return!0}return!1});return(f,A)=>(d.openBlock(),d.createBlock(Hi,{label:"Dot color","form-title":"Dot color Settings1","form-back-title":"Layers",type:"fill",selected:o.value,"possible-aes-source-inputs":["grouping"],disabled:c.value,withoutFixed:typeof o.value=="object",onAesUpdate:A[0]||(A[0]=(h,m)=>s(h,m,"dotFill"))},null,8,["selected","disabled","withoutFixed"]))}}),_ge={class:"input-item",style:{display:"flex","justify-content":"space-between","align-items":"center"}},bB="curve",y$=d.defineComponent({__name:"Curve",setup(e){const t=da(),n=t.value.reactive.optionsState,r=d.computed(()=>t.value.reactive.layersSettings[bB]);function a(s){return s!==null&&typeof s=="object"&&"type"in s}const i=d.computed(()=>{const s=r.value.lineColor,c=n.components.grouping.selectorStates.map(f=>f.selectedSource);return a(s)&&c.length?c.includes(s.value)?s:{type:"grouping",value:c[0]}:c.length?{type:"grouping",value:c[0]}:a(s)?yo:s??yo});function o(s,c,f){typeof s=="string"?t.value.reactive.layersSettings[bB][f]=s:c.type==="dataCategorical"&&(t.value.reactive.layersSettings[bB][f]={type:c.inputName,value:c.selectedSource}),c.type==="dataCategorical"&&typeof s!="string"&&(t.value.reactive.dataBindAes[c.selectedSource]=s)}return(s,c)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Color","form-title":"Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,withoutFixed:typeof i.value=="object","possible-aes-source-inputs":["grouping"],onAesUpdate:c[0]||(c[0]=(f,A)=>o(f,A,"lineColor"))},null,8,["selected","withoutFixed"]),d.createElementVNode("div",_ge,[c[2]||(c[2]=d.createElementVNode("span",null,"Smoothing",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(t).reactive.layersSettings.curve.smoothing,"onUpdate:modelValue":c[1]||(c[1]=f=>d.unref(t).reactive.layersSettings.curve.smoothing=f)},null,8,["modelValue"])])],64))}}),Pge={class:"checkbox-item"},Mge={key:1,class:"checkbox-item"},Dge={class:"checkbox-item"},Hge={key:2,class:"checkbox-item"},Ige={class:"button-group-item"},Lge={class:"button-group-item"},Rge={class:"button-group-item",style:{display:"flex",alignItems:"end"}},Nge=d.defineComponent({__name:"HeatmapClustered",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings.heatmapClustered),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>t.value.inputGuide.value),i=d.computed(()=>{var C;return(C=r.value.components.value.selectorStates[0])==null?void 0:C.selectedSource}),o=d.computed(()=>{var C;return i.value?(C=t.value.reactive.dataBindAes[i.value])==null?void 0:C.palette:void 0}),s=d.ref(!1),c=d.ref(o.value??Z1);function f(C){c.value=C,s.value=!1,i.value&&(t.value.reactive.dataBindAes[i.value]=Vv(C))}const A=[{label:"None",value:null},{label:"Columns",value:"column"},{label:"Rows",value:"row"}],h=[{label:"z-score",value:"standardScaling"},{label:"Min-max",value:"meanNormalization"}],m=[{label:"empty",value:null},{label:"Special value",value:"custom"}],g=d.ref(n.value.NAValueAs!==null?"custom":n.value.NAValueAs),b=d.ref(n.value.NAValueAs??0);return(C,x)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(o3,{label:"Color Palette ",title:d.unref(Do)[c.value].title,palette:c.value,onButtonClick:x[0]||(x[0]=k=>{s.value=!0})},null,8,["title","palette"]),s.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":x[1]||(x[1]=k=>s.value=!1)},{default:d.withCtx(()=>[d.createVNode(l3,{selected:c.value,categorical:i.value?a.value.getSourceInfo(i.value).type==="String":!1,onSelect:f},null,8,["selected","categorical"])]),_:1})):d.createCommentVNode("",!0),d.createElementVNode("div",Pge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.disableClusteringX,"onUpdate:modelValue":x[2]||(x[2]=k=>n.value.disableClusteringX=k)},null,8,["modelValue"]),x[12]||(x[12]=d.createElementVNode("span",null,"Disable clustering for X axis",-1))]),n.value.disableClusteringX?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Mge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.dendrogramX,"onUpdate:modelValue":x[3]||(x[3]=k=>n.value.dendrogramX=k)},null,8,["modelValue"]),x[13]||(x[13]=d.createElementVNode("span",null,"Show dendrogram for X axis",-1))])),d.createElementVNode("div",Dge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.disableClusteringY,"onUpdate:modelValue":x[4]||(x[4]=k=>n.value.disableClusteringY=k)},null,8,["modelValue"]),x[14]||(x[14]=d.createElementVNode("span",null,"Disable clustering for Y axis",-1))]),n.value.disableClusteringY?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Hge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.dendrogramY,"onUpdate:modelValue":x[5]||(x[5]=k=>n.value.dendrogramY=k)},null,8,["modelValue"]),x[15]||(x[15]=d.createElementVNode("span",null,"Show dendrogram for Y axis",-1))])),d.createElementVNode("div",Ige,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Normalize by",options:A,compact:!0,modelValue:n.value.normalizationDirection,"onUpdate:modelValue":x[6]||(x[6]=k=>n.value.normalizationDirection=k)},null,8,["modelValue"])]),d.createElementVNode("div",Lge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Normalization method",options:h,compact:!0,modelValue:n.value.normalizationMethod,"onUpdate:modelValue":x[7]||(x[7]=k=>n.value.normalizationMethod=k)},null,8,["modelValue"])]),d.createElementVNode("div",Rge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Treat NA value as:",options:m,compact:!0,modelValue:g.value,"onUpdate:modelValue":[x[8]||(x[8]=k=>g.value=k),x[9]||(x[9]=k=>{k==="custom"?n.value.NAValueAs=b.value:n.value.NAValueAs=k})]},null,8,["modelValue"]),d.createVNode(d.unref(pt.PlNumberField),{style:{height:"33px",marginLeft:"16px",width:"75px"},disabled:g.value!=="custom",label:"NA value",useIncrementButtons:!1,modelValue:b.value,"onUpdate:modelValue":[x[10]||(x[10]=k=>b.value=k),x[11]||(x[11]=k=>{k!==void 0&&(n.value.NAValueAs=k)})]},null,8,["disabled","modelValue"])])],64))}}),$ge={class:"section-title"},Fge=d.defineComponent({__name:"HeatmapAnnotations",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.optionsState),r=d.computed(()=>t.value.inputGuide.value),a=d.computed(()=>{const A=n.value.components.annotationsX.selectorStates.map(m=>m.selectedSource),h=n.value.components.annotationsY.selectorStates.map(m=>m.selectedSource);return[...A,...h]}),i=d.computed(()=>a.value.reduce((A,h)=>(A[h]=r.value.getSourceInfo(h),A),{})),o=d.reactive(a.value.reduce((A,h)=>{var b,C;const g=((b=i.value[h])==null?void 0:b.type)==="String"?lL:Z1;return A[h]=((C=t.value.reactive.dataBindAes[h])==null?void 0:C.palette)??g,A},{})),s=d.ref(null),c=d.ref(null);function f(A){const h=c.value;h&&(o[h]=A,t.value.reactive.dataBindAes[h]=Vv(A)),s.value=h}return(A,h)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,m=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",$ge,[d.createElementVNode("span",null,d.toDisplayString(i.value[m].label),1)]),d.createVNode(o3,{label:"Color Palette ",title:d.unref(Do)[o[m]].title,palette:o[m],style:{marginBottom:"24px"},onButtonClick:g=>{s.value=m,c.value=m}},null,8,["title","palette","onButtonClick"]),s.value===m?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":h[0]||(h[0]=g=>s.value=null)},{default:d.withCtx(()=>[d.createVNode(l3,{selected:o[m],categorical:i.value[m].type==="String",onSelect:f},null,8,["selected","categorical"])]),_:2},1024)):d.createCommentVNode("",!0)],64))),256))}}),Vge={},Oge={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Qge(e,t){return d.openBlock(),d.createElementBlock("svg",Oge,t[0]||(t[0]=[d.createStaticVNode('<path fill-rule="evenodd" clip-rule="evenodd" d="M9.25 13.5C9.25 14.1904 9.80964 14.75 10.5 14.75L13.5 14.75C14.1904 14.75 14.75 14.1904 14.75 13.5V10.5C14.75 9.80964 14.1904 9.25 13.5 9.25H10.5C9.80964 9.25 9.25 9.80964 9.25 10.5V13.5ZM10.75 13.25V10.75H13.25V13.25H10.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M9.25 20.5C9.25 21.1904 9.80964 21.75 10.5 21.75H13.5C14.1904 21.75 14.75 21.1904 14.75 20.5V17.5C14.75 16.8096 14.1904 16.25 13.5 16.25H10.5C9.80964 16.25 9.25 16.8096 9.25 17.5L9.25 20.5ZM10.75 20.25V17.75H13.25V20.25H10.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 13.5C2.25 14.1904 2.80964 14.75 3.5 14.75H6.5C7.19036 14.75 7.75 14.1904 7.75 13.5L7.75 10.5C7.75 9.80964 7.19036 9.25 6.5 9.25H3.5C2.80964 9.25 2.25 9.80964 2.25 10.5L2.25 13.5ZM3.75 13.25L3.75 10.75H6.25V13.25H3.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 20.5C2.25 21.1904 2.80964 21.75 3.5 21.75H6.5C7.19036 21.75 7.75 21.1904 7.75 20.5L7.75 17.5C7.75 16.8096 7.19036 16.25 6.5 16.25H3.5C2.80964 16.25 2.25 16.8096 2.25 17.5L2.25 20.5ZM3.75 20.25L3.75 17.75H6.25V20.25H3.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M16.25 20.5C16.25 21.1904 16.8096 21.75 17.5 21.75H20.5C21.1904 21.75 21.75 21.1904 21.75 20.5L21.75 10.5C21.75 9.80964 21.1904 9.25 20.5 9.25H17.5C16.8096 9.25 16.25 9.80964 16.25 10.5L16.25 20.5ZM17.75 20.25L17.75 10.75L20.25 10.75L20.25 20.25H17.75Z" fill="#07AD3E"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 6.5C2.25 7.19036 2.80964 7.75 3.5 7.75L13.5 7.75C14.1904 7.75 14.75 7.19036 14.75 6.5V3.5C14.75 2.80964 14.1904 2.25 13.5 2.25L3.5 2.25C2.80964 2.25 2.25 2.80964 2.25 3.5L2.25 6.5ZM3.75 6.25L3.75 3.75L13.25 3.75V6.25L3.75 6.25Z" fill="#07AD3E"></path>',6)]))}const zge=Wr(Vge,[["render",Qge]]),EB="bins",Uge=d.defineComponent({__name:"Bins",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[EB]),r=d.computed(()=>n.value.fillColor??Py);function a(o,s,c){s.type==="dataCategorical"?t.value.reactive.layersSettings[EB][c]={type:s.inputName}:t.value.reactive.layersSettings[EB][c]=o,s.type==="dataCategorical"&&typeof o!="string"&&(t.value.reactive.dataBindAes[s.selectedSource]=o)}const i=d.computed({get:()=>n.value.opacity*100,set:o=>{n.value.opacity=o/100}});return(o,s)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:r.value,onAesUpdate:s[0]||(s[0]=(c,f)=>a(c,f,"fillColor"))},null,8,["selected"]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:i.value,"onUpdate:modelValue":s[1]||(s[1]=c=>i.value=c)},null,8,["modelValue"])],64))}}),jge={class:"input-item"},Gge={class:"button-group-item"},Yge={class:"button-group-item"},Wge={class:"button-group-item",style:{display:"flex",alignItems:"end"}},Xge=d.defineComponent({__name:"Bubble",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings.bubble),r=d.computed(()=>t.value.reactive.optionsState);d.computed(()=>t.value.inputGuide.value);const a=d.computed(()=>{var C;return(C=r.value.components.valueColor.selectorStates[0])==null?void 0:C.selectedSource}),i=d.computed(()=>{var C;return a.value?(C=t.value.reactive.dataBindAes[a.value])==null?void 0:C.palette:void 0}),o=d.ref(!1),s=d.ref(i.value??Z1);function c(C){s.value=C,o.value=!1,a.value&&(t.value.reactive.dataBindAes[a.value]=Vv(C))}const f=[{label:"None",value:null},{label:"Columns",value:"column"},{label:"Rows",value:"row"}],A=[{label:"z-score",value:"standardScaling"},{label:"Min-max",value:"meanNormalization"}],h=d.computed({get:()=>n.value.strokeColor??yo,set:C=>{n.value.strokeColor=C}}),m=[{label:"empty",value:null},{label:"Special value",value:"custom"}],g=d.ref(n.value.NAValueAs!==null?"custom":n.value.NAValueAs),b=d.ref(n.value.NAValueAs??0);return(C,x)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(o3,{label:"Color Palette ",title:d.unref(Do)[s.value].title,palette:s.value,onButtonClick:x[0]||(x[0]=k=>{o.value=!0})},null,8,["title","palette"]),o.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":x[1]||(x[1]=k=>o.value=!1)},{default:d.withCtx(()=>[d.createVNode(l3,{selected:s.value,categorical:!1,onSelect:c},null,8,["selected"])]),_:1})):d.createCommentVNode("",!0),d.createElementVNode("div",jge,[d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke","possible-aes-source-inputs":[],selected:h.value,onAesUpdate:x[2]||(x[2]=k=>h.value=k)},null,8,["selected"])]),d.createElementVNode("div",Gge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Normalize by",options:f,compact:!0,modelValue:n.value.normalizationDirection,"onUpdate:modelValue":x[3]||(x[3]=k=>n.value.normalizationDirection=k)},null,8,["modelValue"])]),d.createElementVNode("div",Yge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Normalization method",options:A,compact:!0,modelValue:n.value.normalizationMethod,"onUpdate:modelValue":x[4]||(x[4]=k=>n.value.normalizationMethod=k)},null,8,["modelValue"])]),d.createElementVNode("div",Wge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Treat NA value as:",options:m,compact:!0,modelValue:g.value,"onUpdate:modelValue":[x[5]||(x[5]=k=>g.value=k),x[6]||(x[6]=k=>{k==="custom"?n.value.NAValueAs=b.value:n.value.NAValueAs=k})]},null,8,["modelValue"]),d.createVNode(d.unref(pt.PlNumberField),{style:{height:"33px",marginLeft:"16px",width:"75px"},disabled:g.value!=="custom",label:"NA value",useIncrementButtons:!1,modelValue:b.value,"onUpdate:modelValue":[x[7]||(x[7]=k=>b.value=k),x[8]||(x[8]=k=>{k!==void 0&&(n.value.NAValueAs=k)})]},null,8,["disabled","modelValue"])])],64))}}),Kge={class:"layers-form",id:"layers-form"},Zge={class:"layers-list"},Jge=d.defineComponent({__name:"index",setup(e){const t=da(),n={box:Jve,binnedDots:ege,jitteredDots:nge,violin:oge,bar:lge,stackedBar:uge,line:cge,errorbar:fge,sina:dge,logo:hge},r={dots:kge,curve:y$},a={dots:Tge,curve:y$},i={heatmap:yge,heatmapClustered:Nge};return(o,s)=>(d.openBlock(),d.createElementBlock("div",Kge,[s[0]||(s[0]=d.createElementVNode("div",{class:"layers-title"},[d.createElementVNode("h3",null," Layers ")],-1)),d.createElementVNode("div",Zge,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(Gy)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(ts,{icon:d.unref(Vf)[c],title:d.unref(H0)[c],settings:{defaultState:d.unref(Gy)[d.unref(t).reactive.template].length>1?"close":"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(n[c])))]),_:2},1032,["icon","title","settings"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:1},d.renderList(d.unref(Ov)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(ts,{icon:d.unref(Vf)[c],title:d.unref(H0)[c],settings:{defaultState:d.unref(Ov)[d.unref(t).reactive.template].length>1?"close":"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(r[c])))]),_:2},1032,["icon","title","settings"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:2},d.renderList(d.unref(bR)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(ts,{icon:d.unref(Vf)[c],title:d.unref(H0)[c],settings:{defaultState:d.unref(Ov)[d.unref(t).reactive.template].length>1?"close":"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(a[c])))]),_:2},1032,["icon","title","settings"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:3},d.renderList(d.unref(cle)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(ts,{icon:d.unref(Vf)[c],title:d.unref(H0)[c],settings:{defaultState:"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(i[c])))]),_:2},1032,["icon","title"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createBlock(ts,{key:4,icon:zge,title:"Annotations",settings:{defaultState:"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(Fge)))]),_:1})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="dendro"?(d.openBlock(),d.createBlock(ts,{key:5,icon:d.unref(Vf).dendro,title:d.unref(H0).dendro,settings:{defaultState:"open"}},{default:d.withCtx(()=>[d.createVNode(bge)]),_:1},8,["icon","title"])):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createBlock(ts,{key:6,icon:d.unref(Vf).bins,title:d.unref(H0).bins,settings:{defaultState:"open"}},{default:d.withCtx(()=>[d.createVNode(Uge)]),_:1},8,["icon","title"])):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createBlock(ts,{key:7,icon:d.unref(Vf).bubble,title:d.unref(H0).bubble,settings:{defaultState:"open"}},{default:d.withCtx(()=>[d.createVNode(Xge)]),_:1},8,["icon","title"])):d.createCommentVNode("",!0)])]))}});function qge(e,{slots:t}){return d.h("div",Object.assign({},e,{class:"non-found-component"}),t.default&&t.default())}function eye(e,t){return d.computed(()=>{const n=d.unref(t);return n&&e[n]?e[n]:qge})}const tye={},nye={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function rye(e,t){return d.openBlock(),d.createElementBlock("svg",nye,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.5 7.5V4.5H19.5V7.5H14.5ZM13 4C13 3.44772 13.4477 3 14 3H20C20.5523 3 21 3.44772 21 4V8C21 8.55228 20.5523 9 20 9H14C13.4477 9 13 8.55228 13 8V4ZM4.5 19.5V16.5H9.5V19.5H4.5ZM3 16C3 15.4477 3.44772 15 4 15H10C10.5523 15 11 15.4477 11 16V20C11 20.5523 10.5523 21 10 21H4C3.44772 21 3 20.5523 3 20V16Z",fill:"#07AD3E"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.5 11.5V4.5H9.5V11.5H4.5ZM3 4C3 3.44772 3.44772 3 4 3H10C10.5523 3 11 3.44772 11 4V12C11 12.5523 10.5523 13 10 13H4C3.44772 13 3 12.5523 3 12V4ZM14.5 19.5V12.5H19.5V19.5H14.5ZM13 12C13 11.4477 13.4477 11 14 11H20C20.5523 11 21 11.4477 21 12V20C21 20.5523 20.5523 21 20 21H14C13.4477 21 13 20.5523 13 20V12Z",fill:"#110529"},null,-1)]))}const aye=Wr(tye,[["render",rye]]),iye={},oye={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function lye(e,t){return d.openBlock(),d.createElementBlock("svg",oye,t[0]||(t[0]=[d.createStaticVNode('<g clip-path="url(#clip0_8849_14901)"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.2214 15.2215L13.5701 12.8728C15.2298 11.2131 15.2298 8.5221 13.5701 6.86237C11.9104 5.20264 9.21943 5.20264 7.5597 6.86237L3.31706 11.105C1.65733 12.7647 1.65733 15.4557 3.31706 17.1154C4.38616 18.1845 5.88312 18.565 7.25674 18.2568L8.45258 19.4526C6.38303 20.2767 3.93151 19.8512 2.2564 18.1761C0.0108876 15.9306 0.0108879 12.2899 2.2564 10.0444L6.49904 5.80171C8.74456 3.5562 12.3853 3.5562 14.6308 5.80171C16.8763 8.04723 16.8763 11.6879 14.6308 13.9334L12.2821 16.2821L11.2214 15.2215Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M17.4594 18.1761C15.2139 20.4216 11.5732 20.4216 9.32769 18.1761C7.08218 15.9306 7.08218 12.2899 9.32769 10.0444L11.686 7.68604L12.7467 8.7467L10.3884 11.105C8.72862 12.7647 8.72862 15.4557 10.3884 17.1154C12.0481 18.7751 14.739 18.7751 16.3988 17.1154L20.6414 12.8728C22.3011 11.2131 22.3011 8.5221 20.6414 6.86237C19.5764 5.79737 18.0868 5.41575 16.7175 5.71752L15.5197 4.51971C17.5863 3.70299 20.0307 4.13032 21.7021 5.80171C23.9476 8.04723 23.9476 11.6879 21.7021 13.9334L17.4594 18.1761Z" fill="#07AD3E"></path></g><defs><clipPath id="clip0_8849_14901"><rect width="24" height="24" fill="white"></rect></clipPath></defs>',2)]))}const sye=Wr(iye,[["render",lye]]),uye={},cye={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function fye(e,t){return d.openBlock(),d.createElementBlock("svg",cye,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23.25 17.75V14H24.75V17.75H26V19.25H24.75V23.25H28.75V22H30.25V23.25H34V24.75H30.25V26H28.75V24.75H24.75V28.75H26V30.25H24.75V34H23.25V30.25H22V28.75H23.25V24.75H19.25V26H17.75V24.75H14V23.25H17.75V22H19.25V23.25H23.25V19.25H22V17.75H23.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.4697 15.5303L17.7501 17.8107V20H19.2501V17.8107L21.5304 15.5303L20.4697 14.4697L18.5001 16.4393L16.5304 14.4697L15.4697 15.5303ZM27.4697 28.5303L29.4394 30.5L27.4697 32.4697L28.5304 33.5303L30.5001 31.5607L32.4697 33.5303L33.5304 32.4697L31.5607 30.5L33.5304 28.5303L32.4697 27.4697L30.5001 29.4393L28.5304 27.4697L27.4697 28.5303Z",fill:"#07AD3E"},null,-1)]))}const dye=Wr(uye,[["render",fye]]),Aye={},pye={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function hye(e,t){return d.openBlock(),d.createElementBlock("svg",pye,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.5 12C20.5 10.3189 20.0015 8.67547 19.0675 7.27766C18.1335 5.87984 16.806 4.79037 15.2528 4.14703C13.6996 3.50368 11.9906 3.33536 10.3417 3.66333C8.6929 3.9913 7.17834 4.80085 5.9896 5.9896C4.80085 7.17834 3.9913 8.6929 3.66333 10.3417C3.33536 11.9906 3.50368 13.6996 4.14703 15.2528C4.79037 16.806 5.87984 18.1335 7.27766 19.0675C8.18407 19.6731 9.19374 20.0957 10.25 20.3179V12.75H7V11.25H10.25V8C10.25 6.48122 11.4812 5.25 13 5.25C14.5188 5.25 15.75 6.48122 15.75 8V8.5H14.25V8C14.25 7.30964 13.6904 6.75 13 6.75C12.3096 6.75 11.75 7.30964 11.75 8V11.25H15V12.75H11.75V20.4963V21.5V21.9969C9.85961 21.9496 8.01943 21.3672 6.4443 20.3147C4.79981 19.2159 3.51809 17.6541 2.76121 15.8268C2.00433 13.9996 1.8063 11.9889 2.19215 10.0491C2.578 8.10929 3.53041 6.32746 4.92894 4.92894C6.32746 3.53041 8.10929 2.578 10.0491 2.19215C11.9889 1.8063 13.9996 2.00433 15.8268 2.76121C17.6541 3.51809 19.2159 4.79981 20.3147 6.4443C21.4135 8.08879 22 10.0222 22 12H20.5Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19.0607 18L21.5304 15.5303L20.4697 14.4697L18.0001 16.9393L15.5304 14.4697L14.4697 15.5303L16.9394 18L14.4697 20.4697L15.5304 21.5303L18.0001 19.0607L20.4697 21.5303L21.5304 20.4697L19.0607 18Z",fill:"#07AD3E"},null,-1)]))}const mye=Wr(Aye,[["render",hye]]),vye={},gye={class:"layers-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function yye(e,t){return d.openBlock(),d.createElementBlock("svg",gye,t[0]||(t[0]=[d.createElementVNode("g",{id:"24: layers"},[d.createElementVNode("path",{id:"Subtract","fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.37549 15.1251L12.0003 21.25L21.6255 15.1249L21.6749 15.1563C22.2924 15.5493 22.2924 16.4507 21.6749 16.8436L12.5375 22.6583C12.21 22.8668 11.7913 22.8668 11.4638 22.6583L2.32641 16.8436C1.70891 16.4507 1.70891 15.5493 2.32641 15.1563L2.37549 15.1251Z",fill:"#07AD3E"}),d.createElementVNode("path",{id:"Union","fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.32641 7.15633C1.70891 7.54929 1.70891 8.4507 2.32641 8.84366L11.4638 14.6583C11.7913 14.8668 12.21 14.8668 12.5375 14.6583L21.6749 8.84365C22.2924 8.4507 22.2924 7.54929 21.6749 7.15633L12.5375 1.34164C12.21 1.13319 11.7913 1.13319 11.4638 1.34164L2.32641 7.15633ZM3.75 7.99997L12 13.25L20.25 7.99997L12 2.74997L3.75 7.99997ZM12.0003 17.25L2.37549 11.1251L2.32641 11.1563C1.70891 11.5493 1.70891 12.4507 2.32641 12.8436L11.4638 18.6583C11.7913 18.8668 12.21 18.8668 12.5375 18.6583L21.6749 12.8436C22.2924 12.4507 22.2924 11.5493 21.6749 11.1563L21.6255 11.1249L12.0003 17.25Z",fill:"#110529"})],-1)]))}const wye=Wr(vye,[["render",yye]]),Cye=d.defineComponent({__name:"SettingsIcon",setup(e){return(t,n)=>(d.openBlock(),d.createBlock(d.unref(pt.PlIcon24),{name:"settings"}))}}),bye={},Eye={class:"export-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function xye(e,t){return d.openBlock(),d.createElementBlock("svg",Eye,t[0]||(t[0]=[d.createElementVNode("g",{id:"Icon"},[d.createElementVNode("path",{id:"Rectangle 4179",d:"M3 17V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V17",stroke:"#07AD3E","stroke-width":"1.5"}),d.createElementVNode("path",{id:"Vector 1335",d:"M18 10L12 16M12 16L6 10M12 16L12 2",stroke:"black","stroke-width":"1.5"})],-1)]))}const Sye=Wr(bye,[["render",xye]]),Bye={class:"input-item"},kye={class:"input-item"},Tye={class:"input-item"},_ye={class:"input-item"},Pye={class:"input-item",style:{"z-index":"0"}},Mye={class:"checkbox-item"},Dye={class:"input-item"},Hye={class:"input-item"},Iye={class:"input-item",style:{"z-index":"0"}},Lye={class:"checkbox-item"},Rye=d.defineComponent({__name:"DiscreteStatisticsForm",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.statisticsSettings),r=d.computed(()=>t.value.commonHelpersData.primaryGroups.value),a=d.computed(()=>RR(r.value)),i=d.computed(()=>NR(r.value)),o=(g,b)=>d.computed({get(){return g[b]??void 0},set(C){g[b]=C??null}}),s=o(n.value.overall.data,"testMethod"),c=o(n.value.referenceGroup.data,"testMethod"),f=o(n.value.referenceGroup.data,"referenceGroup"),A=o(n.value.referenceGroup.data,"correctionMethod"),h=o(n.value.pairwise.data,"testMethod"),m=o(n.value.pairwise.data,"correctionMethod");return PS(t)(),d.watch([()=>n.value.overall.data.testMethod,()=>n.value.referenceGroup.data.referenceGroup],PS(t)),(g,b)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[b[12]||(b[12]=d.createElementVNode("h3",null," Statistics ",-1)),b[13]||(b[13]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"overall p-value")],-1)),d.createElementVNode("div",Bye,[d.createVNode(d.unref(pt.PlDropdown),{label:"Method",clearable:"",placeholder:"Choose",modelValue:d.unref(s),"onUpdate:modelValue":b[0]||(b[0]=C=>d.isRef(s)?s.value=C:null),options:i.value,error:n.value.overall.validity.testMethod?"":" "},null,8,["modelValue","options","error"])]),b[14]||(b[14]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"reference group")],-1)),d.createElementVNode("div",kye,[d.createVNode(d.unref(pt.PlDropdown),{label:"Reference from...",clearable:"",placeholder:"Choose",modelValue:d.unref(f),"onUpdate:modelValue":b[1]||(b[1]=C=>d.isRef(f)?f.value=C:null),options:a.value,error:n.value.referenceGroup.validity.referenceGroup?"":" "},null,8,["modelValue","options","error"])]),d.createElementVNode("div",Tye,[d.createVNode(d.unref(pt.PlDropdown),{label:"Method",clearable:"",placeholder:"Choose",modelValue:d.unref(c),"onUpdate:modelValue":b[2]||(b[2]=C=>d.isRef(c)?c.value=C:null),options:d.unref(HC)},null,8,["modelValue","options"])]),d.createElementVNode("div",_ye,[d.createVNode(d.unref(pt.PlDropdown),{label:"Correction method",placeholder:"Choose",modelValue:d.unref(A),"onUpdate:modelValue":b[3]||(b[3]=C=>d.isRef(A)?A.value=C:null),options:d.unref(xR)},null,8,["modelValue","options"])]),d.createElementVNode("div",Pye,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Show",modelValue:n.value.referenceGroup.data.format,"onUpdate:modelValue":b[4]||(b[4]=C=>n.value.referenceGroup.data.format=C),options:d.unref(SR)},null,8,["modelValue","options"])]),d.createElementVNode("div",Mye,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.referenceGroup.data.ns,"onUpdate:modelValue":b[5]||(b[5]=C=>n.value.referenceGroup.data.ns=C)},null,8,["modelValue"]),b[10]||(b[10]=d.createElementVNode("span",null,"Non-significant",-1))]),b[15]||(b[15]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"pairwise p-value")],-1)),d.createElementVNode("div",Dye,[d.createVNode(d.unref(pt.PlDropdown),{label:"Method",clearable:"",placeholder:"Choose",modelValue:d.unref(h),"onUpdate:modelValue":b[6]||(b[6]=C=>d.isRef(h)?h.value=C:null),options:d.unref(HC)},null,8,["modelValue","options"])]),d.createElementVNode("div",Hye,[d.createVNode(d.unref(pt.PlDropdown),{label:"Correction method",placeholder:"Choose",modelValue:d.unref(m),"onUpdate:modelValue":b[7]||(b[7]=C=>d.isRef(m)?m.value=C:null),options:d.unref(xR)},null,8,["modelValue","options"])]),d.createElementVNode("div",Iye,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Show",modelValue:n.value.pairwise.data.format,"onUpdate:modelValue":b[8]||(b[8]=C=>n.value.pairwise.data.format=C),options:d.unref(SR)},null,8,["modelValue","options"])]),d.createElementVNode("div",Lye,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.pairwise.data.ns,"onUpdate:modelValue":b[9]||(b[9]=C=>n.value.pairwise.data.ns=C)},null,8,["modelValue"]),b[11]||(b[11]=d.createElementVNode("span",null,"Non-significant",-1))])],64))}}),Nye={class:"checkbox-item"},$ye=d.defineComponent({__name:"ScatterplotStatisticsForm",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.statisticsSettings);return(r,a)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[a[1]||(a[1]=d.createElementVNode("h3",null,"Statistics",-1)),a[2]||(a[2]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"trends")],-1)),d.createElementVNode("div",Nye,[d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:n.value.trend.on,"onUpdate:modelValue":a[0]||(a[0]=i=>n.value.trend.on=i),label:"Build trend",disabled:d.unref(t).reactive.template==="curve"},null,8,["modelValue","disabled"])])],64))}}),Fye=d.defineComponent({__name:"index",setup(e){const t=da();return(n,r)=>(d.openBlock(),d.createElementBlock("div",{class:"stat-form",onClick:r[0]||(r[0]=a=>a.stopPropagation())},[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createBlock(Rye,{key:0})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(),d.createBlock($ye,{key:1})):d.createCommentVNode("",!0)]))}}),Vye={},Oye={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Qye(e,t){return d.openBlock(),d.createElementBlock("svg",Oye,t[0]||(t[0]=[d.createStaticVNode('<path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 3.75002C7.5 3.05967 8.05964 2.50002 8.75 2.50002L15.25 2.5C15.9404 2.5 16.5 3.05964 16.5 3.75V5.50004L20.5 5.50006V7.00006L19 7.00006H17.5L6.5 7.00004H5L3.5 7V5.5L7.5 5.50006V3.75002ZM9 5.50006L15 5.50004V4L9 4.00002V5.50006Z" fill="#110529"></path><path d="M17.5 7.00006V12.5H19V7.00006H17.5Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M6.5 17.75C6.5 18.9926 7.50736 20 8.75 20H12V21.5H8.75C6.67893 21.5 5 19.8211 5 17.75V8.50006H6.5V17.75Z" fill="#110529"></path><path d="M6.5 7.00004H5V8.50006H6.5V7.00004Z" fill="#110529"></path><path d="M14.75 14.5L18.25 18M21.75 21.5L18.25 18M18.25 18L21.75 14.5M18.25 18L14.75 21.5" stroke="#07AD3E" stroke-width="1.5"></path>',5)]))}const zye=Wr(Vye,[["render",Qye]]),Uye={},jye={class:"settings-list"};function Gye(e,t){return d.openBlock(),d.createElementBlock("div",{class:"settings-form",onClick:t[0]||(t[0]=n=>n.stopPropagation())},[t[1]||(t[1]=d.createElementVNode("div",{class:"settings-title"},[d.createElementVNode("h3",null," Settings ")],-1)),d.createElementVNode("div",jye,[d.renderSlot(e.$slots,"default"),d.renderSlot(e.$slots,"settingsSlot")])])}const mb={settings:{icon:Cye,component:Wr(Uye,[["render",Gye]]),title:"Settings"},template:{icon:aye,component:Xle,title:"Template"},dataMapping:{icon:sye,component:g0e,title:"Data mapping"},axes:{icon:dye,component:Ove,title:"Axes settings"},statistics:{icon:mye,component:Fye,title:"Statistics"},layers:{icon:wye,component:Jge,title:"Layers"},delete:{icon:zye,component:null,title:"Delete graph"},export:{icon:Sye,component:null,title:"Export"}};function Yye(){return Object.keys(mb)}function Wye(e){return mb[e].icon??""}function Xye(e){return mb[e].title??""}function Kye(e){const t=Object.entries(mb).reduce((n,[r,a])=>H1e.setProp(n,r,a.component),{});return eye(t,e)}const Zye={class:"settings-tabs"},Jye={style:{"font-family":"var(--font-family-base)"}},qye=d.defineComponent({__name:"index",props:{chartType:{},graphStatus:{},allowDeleting:{type:Boolean},hasSettingsSlot:{type:Boolean},modelValue:{}},emits:["update:modelValue","export","delete"],setup(e,{emit:t}){const n=t,r=e,a=d.computed(()=>Yye().filter(o=>!(o==="settings"&&!r.hasSettingsSlot)&&!(o==="statistics"&&r.chartType!=="discrete"&&r.chartType!=="scatterplot")&&!(o==="delete"&&r.allowDeleting)));function i(o){n("update:modelValue",o===r.modelValue?null:o)}return(o,s)=>(d.openBlock(),d.createElementBlock("div",Zye,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,c=>(d.openBlock(),d.createBlock(d.unref(pt.PlTooltip),{key:c,"open-delay":100,"close-delay":100,class:d.normalizeClass(["has-inline-icon",{active:o.modelValue===c,"temp-inactive":c==="export"&&(o.graphStatus!=="ready"||o.chartType==="scatterplot-umap"),[c]:!0}]),position:"left",hide:o.modelValue===c,onClick:f=>{f.stopPropagation(),c==="export"?o.$emit("export"):c==="delete"?o.$emit("delete"):i(c)}},{tooltip:d.withCtx(()=>[d.createElementVNode("span",Jye,d.toDisplayString(d.unref(Xye)(c)),1)]),default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(d.unref(Wye)(c))))]),_:2},1032,["class","hide","onClick"]))),128))]))}}),e3e=d.defineComponent({__name:"TransitionSlidePanel",setup(e){function t(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(r,a)=>(d.openBlock(),d.createBlock(d.Transition,{name:"slide-panel",onAfterEnter:t,onAfterLeave:n},{default:d.withCtx(()=>[d.renderSlot(r.$slots,"default")]),_:3}))}}),t3e=d.defineComponent({__name:"PanelModal",emits:["close"],setup(e,{emit:t}){const n=t,r=d.ref();return pt.useClickOutside([r],()=>n("close")),(a,i)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"rootRef",ref:r,class:"panel-modal"},[d.createVNode(d.unref(pt.PlCloseModalBtn),{class:"close-panel-modal",onClick:i[0]||(i[0]=o=>n("close"))}),d.renderSlot(a.$slots,"default",{ref:"contentRef"})],512))}}),n3e={},r3e={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function a3e(e,t){return d.openBlock(),d.createElementBlock("svg",r3e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.75 2.25V7.25H13.75V8.75H8.75V13.75H7.25V8.75H2.25V7.25H7.25V2.25H8.75Z",fill:"#110529"},null,-1)]))}const i3e=Wr(n3e,[["render",a3e]]),o3e={},l3e={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function s3e(e,t){return d.openBlock(),d.createElementBlock("svg",l3e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.25 7.25H13.75V8.75H2.25V7.25Z",fill:"#110529"},null,-1)]))}const u3e=Wr(o3e,[["render",s3e]]),c3e={class:"zoom-text-field"},f3e=d.defineComponent({__name:"ZoomInput",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,r=e,a=d.ref(),i=d.ref(!1),o=d.ref(String(r.modelValue)),s=d.computed({get(){const c=o.value??"100";return i.value?c:c+"%"},set(c){return o.value=c,c}});return d.watch(()=>i.value,c=>{if(!c){let f=Number(o.value);isNaN(f)?o.value=String(r.modelValue):n("update:modelValue",f)}}),d.watch(()=>r.modelValue,c=>{o.value=String(c)}),(c,f)=>(d.openBlock(),d.createElementBlock("div",{class:"zoom-text-field__envelope zoom-input",onFocusin:f[1]||(f[1]=A=>i.value=!0),onFocusout:f[2]||(f[2]=A=>i.value=!1),onKeyup:f[3]||(f[3]=d.withKeys(A=>{var h;return(h=a.value)==null?void 0:h.blur()},["enter"]))},[d.createElementVNode("div",c3e,[d.withDirectives(d.createElementVNode("input",{ref_key:"input",ref:a,"onUpdate:modelValue":f[0]||(f[0]=A=>s.value=A),type:"text"},null,512),[[d.vModelText,s.value]]),d.createVNode(AB,{style:{"z-index":"1"},class:"zoom-text-field__contour"})])],32))}}),d3e={class:"zoom-container"},A3e=20,p3e=400,w$=10,h3e=d.defineComponent({__name:"index",setup(e){const t=da();function n(i){return Math.max(A3e,Math.min(p3e,i))}function r(){t.value.reactive.chartScale=n(t.value.reactive.chartScale-w$)}function a(){t.value.reactive.chartScale=n(t.value.reactive.chartScale+w$)}return(i,o)=>(d.openBlock(),d.createElementBlock("div",d3e,[o[1]||(o[1]=d.createElementVNode("div",{class:"zoom-border"},null,-1)),d.createVNode(d.unref(pt.PlBtnGhost),{onClick:r},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(u3e)))]),_:1}),d.createVNode(f3e,{modelValue:d.unref(t).reactive.chartScale,"onUpdate:modelValue":o[0]||(o[0]=s=>d.unref(t).reactive.chartScale=n(s))},null,8,["modelValue"]),d.createVNode(d.unref(pt.PlBtnGhost),{onClick:a},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(i3e)))]),_:1})]))}}),m3e=d.defineComponent({__name:"DendroTable",props:{chartData:{}},emits:["row-select"],setup(e,{emit:t}){const n=da(),r=e,a=d.ref(100),i=d.shallowRef(),o=d.computed(()=>["id",...n.value.reactive.optionsState.components.tableContent.selectorStates.map(g=>g.selectedSource)]),s=d.ref([]);d.watch(()=>{var g;return(g=r.chartData)==null?void 0:g.hierarchy},g=>{if(g){const b=g.leaves().map(C=>C.data.rawData.id);(b.length!==s.value.length||b.some((C,x)=>C!==s.value[x]))&&(s.value=b)}else s.value=[]},{immediate:!0});const c=d.ref([]),f=d.ref([]);d.watch([()=>s.value,()=>o.value,()=>n.value.commonHelpersData.dendroTableData.value],([g,b,C])=>{if(C===null){f.value=[],c.value=[];return}if(b.some(k=>!C[k]))return;const x=C.id.data.reduce((k,_,D)=>{const O=_;return k[O]&&console.warn(`More than 1 value for node id ${O} in dendro table`),k[O]=b.reduce((I,$)=>{const Q=C[$];return Q&&(I[$]=Q.data[D]),I},{}),k},{});f.value=b.map(k=>({headerName:C[k].label,field:k,sortable:!1,resizable:!1})),c.value=g.map(k=>x[k]??null),m()},{immediate:!0});const A=d.computed(()=>{var b,C;const g=(C=(b=r.chartData)==null?void 0:b.chartSizes)==null?void 0:C.treeHeight;return s.value.length?g/s.value.length:0}),h=g=>{i.value=g.api,m()};function m(){if(i.value&&!i.value.isDestroyed()){i.value.autoSizeAllColumns();const g=i.value.getColumns();g&&(a.value=g.reduce((b,C)=>b+C.getActualWidth(),2))}}return d.watch(()=>n.value.reactive.dendroSelectedNodeId,g=>{i.value&&(g===null?i.value.deselectAll():i.value.forEachNode(b=>{b.data.id===g&&b.setSelected(!0,!0)}))}),(g,b)=>(d.openBlock(),d.createElementBlock("div",{class:"dendro-table",style:d.normalizeStyle({width:a.value+"px"})},[d.createVNode(d.unref(Qee.AgGridVue),{theme:d.unref(pt.AgGridTheme),gridApi:i.value,onGridReady:h,defaultColDef:{suppressHeaderMenuButton:!0},rowData:c.value,columnDefs:f.value,rowHeight:A.value,autoSizeStrategy:{type:"fitCellContents"},onGridColumnsChanged:b[0]||(b[0]=()=>{m()}),domLayout:"autoHeight"},null,8,["theme","gridApi","rowData","columnDefs","rowHeight"])],4))}}),v3e={},g3e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function y3e(e,t){return d.openBlock(),d.createElementBlock("svg",g3e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19.091 3.53035C18.2123 2.65166 16.7877 2.65167 15.909 3.53037L3.90901 15.5304C3.48705 15.9524 3.25 16.5246 3.25 17.1214V20.0001C3.25 20.4143 3.58579 20.7501 4 20.7501H6.87868C7.47542 20.7501 8.04771 20.513 8.46967 20.0911L20.4697 8.09099C21.3484 7.21231 21.3484 5.7877 20.4697 4.90903L19.091 3.53035ZM16.9697 4.59101C17.2626 4.29811 17.7374 4.29811 18.0303 4.59101L19.409 5.96969C19.7019 6.26258 19.7019 6.73745 19.409 7.03034L18.5 7.9394L16.0607 5.50006L16.9697 4.59101ZM15 6.56073L17.4393 9.00007L7.40901 19.0304C7.26836 19.171 7.07759 19.2501 6.87868 19.2501H4.75V17.1214C4.75 16.9225 4.82902 16.7317 4.96967 16.5911L15 6.56073Z",fill:"#CFD1DB"},null,-1),d.createElementVNode("path",{d:"M12 20.7501L20 20.7501L20 19.2501L12 19.2501L12 20.7501Z",fill:"#CFD1DB"},null,-1)]))}const w3e=Wr(v3e,[["render",y3e]]),C$=d.defineComponent({__name:"Loading",props:{top:{default:0},left:{default:0},right:{default:0},bottom:{default:0}},setup(e){return(t,n)=>(d.openBlock(),d.createElementBlock("div",{class:"graph-maker__loading",style:d.normalizeStyle({top:`${t.top}px`,bottom:`${t.bottom}px`,right:`${t.right}px`,left:`${t.left}px`})},n[0]||(n[0]=[d.createStaticVNode('<div class="loading-picture"><svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M36.0197 2.29384C37.0053 1.76506 37.7157 1.45481 38.4537 1.29931C39.4734 1.08447 40.5266 1.08447 41.5463 1.29931C42.2843 1.45481 42.9947 1.76506 43.9803 2.29384C44.7026 2.66301 45.5542 3.14998 46.6565 3.78023L68.4201 16.2247C69.3757 16.7711 70.1409 17.2086 70.7708 17.5978C71.8362 18.2367 72.5158 18.7183 73.0579 19.3166C73.7667 20.0989 74.3023 21.0219 74.6298 22.0253C75 23.1595 75 24.4276 75 26.9639V53.0362C75 55.5725 75 56.8407 74.6298 57.9748C74.3023 58.9782 73.7667 59.9012 73.0579 60.6835C72.5154 61.2822 71.8353 61.764 70.7688 62.4035C70.1393 62.7924 69.3748 63.2295 68.4203 63.7753L46.6565 76.2198C45.555 76.8497 44.7037 77.3364 43.9817 77.7055C42.9954 78.2347 42.2847 78.5452 41.5463 78.7008C40.5266 78.9156 39.4734 78.9156 38.4537 78.7008C37.7153 78.5452 37.0045 78.2347 36.0182 77.7054C35.2962 77.3364 34.445 76.8497 33.3436 76.2199L11.5799 63.7754C10.6253 63.2295 9.86069 62.7924 9.23115 62.4035C8.16466 61.764 7.48457 61.2822 6.94208 60.6835C6.23334 59.9012 5.6977 58.9782 5.37018 57.9748C5 56.8407 5 55.5725 5 53.0362V26.9639C5 24.4276 5 23.1595 5.37018 22.0253C5.6977 21.0219 6.23334 20.0989 6.94208 19.3166C7.48422 18.7183 8.16379 18.2367 9.22911 17.5978C9.85904 17.2086 10.6242 16.7711 11.5799 16.2247L33.3435 3.78023C34.4457 3.14998 35.2974 2.663 36.0197 2.29384ZM10 34.9971V24.9907H37.4546V34.9971H10ZM10 45.0036V40.0003H37.4546V45.0036H10ZM37.4546 72.9139L10 57.1541V50.0069H37.4546V72.9139ZM65.0189 60.0134L42.5455 72.9138V60.0134H65.0189ZM70 24.9907V55.0101H42.5455V24.9907H70ZM14.98 19.9874L40 5.62505L65.0201 19.9874H14.98Z" fill="#E1E3EB"></path></svg><div class="loading-progress-bar"><div class="moving-dash"></div></div></div>',1)]),4))}}),C3e={class:"graph-info-tooltip-title"},b3e=["title"],E3e={key:1,class:"graph-info-tooltip-sequence-row"},x3e=["title"],S3e={key:0,class:"graph-info-tooltip-icon"},B3e={key:0,"data-theme":"dark",class:"graph-info-tooltip-button"},k3e=48,T3e=62.5,_3e=26,P3e=16,b$=24,M3e=20,D3e=d.defineComponent({__name:"DendroTooltip",props:{info:{},tooltipBtn:{},containerRef:{}},emits:["close","tooltip-btn-click"],setup(e,{emit:t}){const n=e,r=da(),a=t,i=d.ref();pt.useClickOutside([i],()=>a("close"));const o=d.computed(()=>{const b=k=>r.value.reactive.optionsState.components[k].selectorStates.map(_=>_.selectedSource),C=["tableContent","labels","nodeColor","nodeSize","nodeShape","lineColor"],x=["id"];return C.forEach(k=>{b(k).forEach(D=>{x.includes(D)||x.push(D)})}),x}),s=d.computed(()=>n.info.info[0]),c=d.computed(()=>{var b;return(b=s.value)==null?void 0:b.id}),f=d.computed(()=>{const b=r.value.commonHelpersData.dendroTableData.value;if(!b)return[];const C=b.id.data.findIndex(x=>String(x)===String(c.value));return C!==-1?o.value.map(x=>{var k,_;return{label:b[x].label,value:b[x].data[C],isSequence:((_=(k=b[x].spec)==null?void 0:k.annotations)==null?void 0:_["pl7.app/type"])==="sequence"}}):[]}),A=d.computed(()=>f.value.reduce((b,C)=>b+(C.isSequence?T3e:_3e),0)+P3e*2+(n.tooltipBtn?k3e:0)),h=d.computed(()=>({left:n.info.x+M3e+"px",top:n.info.y+b$+"px"})),m=d.computed(()=>{const b=n.containerRef.scrollHeight,C=A.value/2,x=n.info.y+b$;return x<C?-x:b-C<x?-(A.value-(b-x)):-C});function g(b){var C;(C=window==null?void 0:window.navigator)==null||C.clipboard.writeText(b)}return(b,C)=>(d.openBlock(),d.createElementBlock("div",{class:"graph-info-tooltip__container",ref:"",style:d.normalizeStyle(h.value)},[C[3]||(C[3]=d.createElementVNode("div",{class:"graph-info-tooltip__tail"},null,-1)),d.createElementVNode("div",{class:"graph-info-tooltip",ref_key:"rootRef",ref:i,style:d.normalizeStyle({transform:`translate(0,${m.value}px)`}),onClick:C[2]||(C[2]=x=>x.stopPropagation())},[d.createVNode(d.unref(pt.PlMaskIcon24),{class:"graph-info-tooltip-close",name:"close",onClick:C[0]||(C[0]=x=>a("close"))}),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.value,x=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["graph-info-tooltip-row",{"graph-info-tooltip-row__sequence":x.isSequence}])},[d.createElementVNode("div",C3e,d.toDisplayString(x.label+":"),1),x.isSequence?(d.openBlock(),d.createElementBlock("div",E3e,[d.createElementVNode("div",{class:"graph-info-tooltip-value",title:String(x.value)},d.toDisplayString(x.value),9,x3e),x.isSequence?(d.openBlock(),d.createElementBlock("div",S3e,[d.createVNode(d.unref(pt.PlMaskIcon16),{class:"graph-info-tooltip-clipboard",name:"clipboard",onClick:()=>g(String(x.value))},null,8,["onClick"])])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createElementBlock("div",{key:0,class:"graph-info-tooltip-value",title:String(x.value)},d.toDisplayString(x.value),9,b3e))],2))),256)),b.tooltipBtn?(d.openBlock(),d.createElementBlock("div",B3e,[d.createVNode(d.unref(pt.PlBtnSecondary),{icon:"arrow-right",size:"small",onClick:C[1]||(C[1]=()=>a("tooltip-btn-click",c.value))},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(b.tooltipBtn),1)]),_:1})])):d.createCommentVNode("",!0)],4)],4))}}),H3e={class:"chart_container"},I3e={class:"chart_header"},L3e=["value"],R3e={class:"chart_titleLineSlot"},N3e={key:0,class:"chart_tabBy"},$3e={key:2,style:{position:"absolute",left:"10px",bottom:"10px"}},F3e=d.defineComponent({__name:"Chart",props:{graphStatus:{},graphTitle:{},dendroTooltipButton:{},chartData:{}},emits:["graph-title-update","dendro-node-select","dendro-tooltip-btn-click"],setup(e,{emit:t}){const n=t,r=da(),a=e,i=d.ref(a.graphTitle);d.watch(()=>a.graphTitle,x=>{i.value=x});const o=d.computed(()=>{var x;return(x=r.value.reactive.optionsState.components.tabBy)==null?void 0:x.selectorStates[0]}),s=d.computed(()=>{var x;return(x=o.value)==null?void 0:x.selectedSource}),c=d.computed(()=>{var x;return(x=o.value)==null?void 0:x.selectedFilterValue}),f=d.ref(c.value);d.watch(()=>s.value,(x,k)=>{x!==k&&(f.value=c.value)},{immediate:!0});const A=d.computed(()=>r.value.uniqueValuesData.value),h=d.computed(()=>{var x;if(s.value){const k=(x=A.value[s.value])==null?void 0:x.options;return k&&k.sort((_,D)=>_.label>D.label?1:-1),k}else return});d.watch(()=>h.value,x=>{if(x&&x.length&&f.value===void 0){const k=x[0].value;f.value=k,m(k)}},{immediate:!0});function m(x){const k=r.value.reactive.optionsState.components.tabBy.selectorStates;k.length&&(r.value.reactive.optionsState.components.tabBy.selectorStates=[{...k[0],type:"equals",selectedFilterValue:x}])}function g(x){const k=x.currentTarget;i.value=k.value,n("graph-title-update",k.value)}function b(x){n("dendro-node-select",x)}const C=d.ref();return(x,k)=>(d.openBlock(),d.createElementBlock("div",H3e,[d.createElementVNode("div",I3e,[d.createElementVNode("input",{class:"chart_title",value:i.value,onChange:g,onKeyup:k[0]||(k[0]=d.withKeys(_=>{var D;(D=_.target)==null||D.blur()},["enter"]))},null,40,L3e),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(w3e),{class:"chart_titleEdit"})),d.createElementVNode("div",R3e,[d.renderSlot(x.$slots,"default")])]),s.value?(d.openBlock(),d.createElementBlock("div",N3e,[d.createVNode(d.unref(pt.PlDropdown),{label:"Show for",modelValue:f.value,"onUpdate:modelValue":[k[1]||(k[1]=_=>f.value=_),k[2]||(k[2]=_=>m(_))],options:h.value},null,8,["modelValue","options"])])):d.createCommentVNode("",!0),d.createElementVNode("div",{class:d.normalizeClass(["chart_main-content",{"chart_main-content__dendro":d.unref(r).reactive.chartType==="dendro"}]),ref_key:"chartContainerRef",ref:C},[d.createElementVNode("div",{id:"chartSvgContainer",class:d.normalizeClass({chart_loading:d.unref(r).loading.initialCharts&&x.graphStatus==="ready",chart_noDataMapping:x.graphStatus==="notReady",chart_emptyData:x.graphStatus==="empty",chart_inconsistent:x.graphStatus==="inconsistent"})},[d.unref(r).loading.initialCharts&&x.graphStatus==="ready"?(d.openBlock(),d.createBlock(C$,{key:0})):d.createCommentVNode("",!0)],2),d.unref(r).reactive.chartType==="dendro"&&x.chartData&&d.unref(r).reactive.layersSettings.dendro.showTable?(d.openBlock(),d.createBlock(m3e,{key:0,chartData:x.chartData,onRowSelect:b},null,8,["chartData"])):d.createCommentVNode("",!0),d.unref(r).reactive.dendroInfoByClick?(d.openBlock(),d.createBlock(D3e,{key:1,info:d.unref(r).reactive.dendroInfoByClick,containerRef:C.value,tooltipBtn:x.dendroTooltipButton,onTooltipBtnClick:k[3]||(k[3]=_=>x.$emit("dendro-tooltip-btn-click",_)),onClose:k[4]||(k[4]=_=>{d.unref(r).reactive.dendroInfoByClick=null,x.$emit("dendro-node-select",null)})},null,8,["info","containerRef","tooltipBtn"])):d.createCommentVNode("",!0)],2),x.graphStatus!=="empty"&&d.unref(r).reactive.chartType!=="scatterplot-umap"?(d.openBlock(),d.createBlock(h3e,{key:1})):d.createCommentVNode("",!0),x.graphStatus!=="empty"&&d.unref(r).reactive.chartType==="scatterplot-umap"?(d.openBlock(),d.createElementBlock("div",$3e,[d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(r).reactive.lassoMode,"onUpdate:modelValue":k[5]||(k[5]=_=>d.unref(r).reactive.lassoMode=_),label:"Lasso mode"},null,8,["modelValue"])])):d.createCommentVNode("",!0)]))}});function V3e(e,t){return e.parent===t.parent?1:2}function O3e(e){return e.reduce(Q3e,0)/e.length}function Q3e(e,t){return e+t.x}function z3e(e){return 1+e.reduce(U3e,0)}function U3e(e,t){return Math.max(e,t.y)}function j3e(e){for(var t;t=e.children;)e=t[0];return e}function G3e(e){for(var t;t=e.children;)e=t[t.length-1];return e}function xB(){var e=V3e,t=1,n=1,r=!1;function a(i){var o,s=0;i.eachAfter(function(m){var g=m.children;g?(m.x=O3e(g),m.y=z3e(g)):(m.x=o?s+=e(m,o):0,m.y=0,o=m)});var c=j3e(i),f=G3e(i),A=c.x-e(c,f)/2,h=f.x+e(f,c)/2;return i.eachAfter(r?function(m){m.x=(m.x-i.x)*t,m.y=(i.y-m.y)*n}:function(m){m.x=(m.x-A)/(h-A)*t,m.y=(1-(i.y?m.y/i.y:1))*n})}return a.separation=function(i){return arguments.length?(e=i,a):e},a.size=function(i){return arguments.length?(r=!1,t=+i[0],n=+i[1],a):r?null:[t,n]},a.nodeSize=function(i){return arguments.length?(r=!0,t=+i[0],n=+i[1],a):r?[t,n]:null},a}function Y3e(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function W3e(){return this.eachAfter(Y3e)}function X3e(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function K3e(e,t){for(var n=this,r=[n],a,i,o=-1;n=r.pop();)if(e.call(t,n,++o,this),a=n.children)for(i=a.length-1;i>=0;--i)r.push(a[i]);return this}function Z3e(e,t){for(var n=this,r=[n],a=[],i,o,s,c=-1;n=r.pop();)if(a.push(n),i=n.children)for(o=0,s=i.length;o<s;++o)r.push(i[o]);for(;n=a.pop();)e.call(t,n,++c,this);return this}function J3e(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function q3e(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,a=r&&r.length;--a>=0;)n+=r[a].value;t.value=n})}function e2e(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function t2e(e){for(var t=this,n=n2e(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var a=r.length;e!==n;)r.splice(a,0,e),e=e.parent;return r}function n2e(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),a=null;for(e=n.pop(),t=r.pop();e===t;)a=e,e=n.pop(),t=r.pop();return a}function r2e(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function a2e(){return Array.from(this)}function i2e(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function o2e(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*l2e(){var e=this,t,n=[e],r,a,i;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(a=0,i=r.length;a<i;++a)n.push(r[a]);while(n.length)}function vb(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=c2e)):t===void 0&&(t=u2e);for(var n=new Q7(e),r,a=[n],i,o,s,c;r=a.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)a.push(i=o[s]=new Q7(o[s])),i.parent=r,i.depth=r.depth+1;return n.eachBefore(E$)}function s2e(){return vb(this).eachBefore(f2e)}function u2e(e){return e.children}function c2e(e){return Array.isArray(e)?e[1]:null}function f2e(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function E$(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Q7(e){this.data=e,this.depth=this.height=0,this.parent=null}Q7.prototype=vb.prototype={constructor:Q7,count:W3e,each:X3e,eachAfter:Z3e,eachBefore:K3e,find:J3e,sum:q3e,sort:e2e,path:t2e,ancestors:r2e,descendants:a2e,leaves:i2e,links:o2e,copy:s2e,[Symbol.iterator]:l2e};function SB(e){return e==null?null:d2e(e)}function d2e(e){if(typeof e!="function")throw new Error;return e}var A2e={depth:-1},x$={},BB={};function p2e(e){return e.id}function h2e(e){return e.parentId}function S$(){var e=p2e,t=h2e,n;function r(a){var i=Array.from(a),o=e,s=t,c,f,A,h,m,g,b,C,x=new Map;if(n!=null){const k=i.map((O,I)=>m2e(n(O,I,a))),_=k.map(B$),D=new Set(k).add("");for(const O of _)D.has(O)||(D.add(O),k.push(O),_.push(B$(O)),i.push(BB));o=(O,I)=>k[I],s=(O,I)=>_[I]}for(A=0,c=i.length;A<c;++A)f=i[A],g=i[A]=new Q7(f),(b=o(f,A,a))!=null&&(b+="")&&(C=g.id=b,x.set(C,x.has(C)?x$:g)),(b=s(f,A,a))!=null&&(b+="")&&(g.parent=b);for(A=0;A<c;++A)if(g=i[A],b=g.parent){if(m=x.get(b),!m)throw new Error("missing: "+b);if(m===x$)throw new Error("ambiguous: "+b);m.children?m.children.push(g):m.children=[g],g.parent=m}else{if(h)throw new Error("multiple roots");h=g}if(!h)throw new Error("no root");if(n!=null){for(;h.data===BB&&h.children.length===1;)h=h.children[0],--c;for(let k=i.length-1;k>=0&&(g=i[k],g.data===BB);--k)g.data=null}if(h.parent=A2e,h.eachBefore(function(k){k.depth=k.parent.depth+1,--c}).eachBefore(E$),h.parent=null,c>0)throw new Error("cycle");return h}return r.id=function(a){return arguments.length?(e=SB(a),r):e},r.parentId=function(a){return arguments.length?(t=SB(a),r):t},r.path=function(a){return arguments.length?(n=SB(a),r):n},r}function m2e(e){e=`${e}`;let t=e.length;return kB(e,t-1)&&!kB(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function B$(e){let t=e.length;if(t<2)return"";for(;--t>1&&!kB(e,t););return e.slice(0,t)}function kB(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}var Jv={},TB={exports:{}},fi={};/**
|
|
36
|
+
`,dse=["innerHTML"],Ase={class:"dropdown-list-item__title-container"},pse={class:"dropdown-list-item__title text-s"},hse={key:0,class:"dropdown-list-item__description text-description"},mse={key:1,class:"dropdown-list-item__icon flex-self-start"},vse=d.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(e){const t=e,n=d.computed(()=>{const i=[];return t.size==="small"&&i.push("dropdown-list-item__small"),t.isSelected&&i.push("dropdown-list-item__selected"),t.isHovered&&i.push("hovered-item"),i.join(" ")}),r=d.computed(()=>{const i=["dropdown-list-item__checkbox","flex-self-start"];return t.isSelected&&i.push("checked"),i.join(" ")}),a=d.computed(()=>t.isSelected?fse:cse);return(i,o)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass([n.value,"dropdown-list-item"])},[t.useCheckbox?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(r.value),innerHTML:a.value},null,10,dse)):d.createCommentVNode("",!0),o[1]||(o[1]=d.createTextVNode()),d.createElementVNode("div",Ase,[d.createElementVNode("div",pse,d.toDisplayString(i.option.label),1),o[0]||(o[0]=d.createTextVNode()),i.option.description?(d.openBlock(),d.createElementBlock("div",hse,d.toDisplayString(i.option.description),1)):d.createCommentVNode("",!0)]),o[2]||(o[2]=d.createTextVNode()),!t.useCheckbox&&t.isSelected?(d.openBlock(),d.createElementBlock("div",mse)):d.createCommentVNode("",!0)],2))}});function gse(e){return e()}function yse(e){let t=!1;return function(...n){t||(requestAnimationFrame(()=>{e(...n),t=!1}),t=!0)}}function wse(e){return new Promise(t=>setTimeout(t,e))}function Cse(e,t){const n=setTimeout(e,t);return()=>{clearTimeout(n)}}function bse(e){return function(t){return 1-e(1-t)}}function Ese(e){const{duration:t,draw:n,timing:r}=e,a=performance.now();let i=!1;return requestAnimationFrame(function o(s){let c=(s-a)/t;(c>1||i)&&(c=1);const f=r(c);n(f),c<1&&requestAnimationFrame(o)}),function(){i=!0}}function xse(e,t,n=!0){let r=0,a;return function(...i){a=()=>{e.apply(this,i),r=new Date().getTime()+t,a=null,n&&setTimeout(()=>{a==null||a()},t)},new Date().getTime()>r&&a()}}function GR(e){if(!Array.isArray(e))throw Error("Invalid component options: "+String(e));return e.map(t=>({label:"label"in t?t.label:t.text,value:t.value,description:t.description}))}function YR(e,t){const n=yse(()=>{if(e.value){const{scrollTop:r,scrollLeft:a,scrollHeight:i,scrollWidth:o,clientHeight:s,clientWidth:c}=document.documentElement,f=e.value.getBoundingClientRect();t({scrollTop:r,scrollLeft:a,scrollHeight:i,scrollWidth:o,clientHeight:s,clientWidth:c,offsetY:r+f.y,offsetX:a+f.x,top:f.top,right:f.right,bottom:f.bottom,left:f.left,width:f.width,height:f.height,x:f.x,y:f.y})}});d.onMounted(n),IC(window,"scroll",n,{capture:!0,passive:!0}),IC(window,"resize",n,{passive:!0}),IC(window,"adjust",n,!0)}const Sse=d.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(e){const t=e,n=d.computed(()=>t.size==="large"?"--mask-size: 24px":""),r=d.computed(()=>`mask-16 mask-${t.name}`);return(a,i)=>(d.openBlock(),d.createElementBlock("i",{style:d.normalizeStyle(n.value),class:d.normalizeClass([r.value,a.$style.icon])},null,6))}}),Bse="_icon_1ugxm_2",kse={icon:Bse},Tse={$style:kse},WR=J5(Sse,[["__cssModules",Tse]]),_se=d.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(e){const t=e,n=d.computed(()=>`mask-24 mask-${t.name}`);return(r,a)=>(d.openBlock(),d.createElementBlock("i",{class:d.normalizeClass([n.value,r.$style.icon])},null,2))}}),Pse="_icon_1ugxm_2",Mse={icon:Pse},Dse={$style:Mse},Hse=J5(_se,[["__cssModules",Dse]]);function Ise(e,t){const n=d.ref();return YR(e,r=>{n.value=r}),d.computed(()=>{const r=d.unref(n),a=d.unref(t),i=a.position??"top",o=a.gap??8;if(!r)return"";const s=r.offsetY+Math.floor(r.height/2),c=r.offsetX+Math.floor(r.width/2);return i==="top-left"?`left: ${r.offsetX}px; top: ${r.offsetY-o}px;`:i==="top"?`left: ${c}px; top: ${r.offsetY-o}px;`:i==="right"?`left: ${r.offsetX+r.width+o}px; top: ${s}px;`:i==="left"?`right: ${r.scrollWidth-r.x+o}px; top: ${s}px;`:i==="southwest"?`left: ${r.offsetX+r.width}px; top: ${r.offsetY+r.height+o}px;`:""})}function XR(e,t){return t(e)}function KR(e,t){if(e!=null)return t(e)}function Lse(e){return Array.isArray(e)?e:[e]}function Rse(e,t){IC(document,"click",n=>{document.contains(n.target)&&(Lse(e).map(r=>r.value).filter(r=>!!r).some(r=>r==null?void 0:r.contains(n.target))||t())})}const Nse={},$se={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Fse(e,t){return d.openBlock(),d.createElementBlock("svg",$se,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const Vse=J5(Nse,[["render",Fse]]),LS=new Map,Ose={name:"PlTooltip"},Qse=d.defineComponent({...Ose,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"},maxWidth:{default:"300px"}},emits:["tooltip:close"],setup(e,{emit:t}){const n=t,r=Symbol(),a=e,i=d.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});LS.set(r,()=>f()),d.watch(()=>i.open,x=>{requestAnimationFrame(()=>{i.tooltipOpen=x})});let o=()=>{};const s=xse(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),c=()=>{i.open=!0;for(const[x,k]of LS.entries())x!==r&&k()},f=()=>{i.open=!1,n("tooltip:close")},A=async()=>{a.hide||(s(),i.over=!0,o(),await wse(100),i.over&&c())},h=()=>{i.over=!1,o=Cse(()=>{i.over||f()},a.closeDelay)};d.watch(()=>a.hide,x=>{x&&f()});const m=d.ref(),g=d.ref(),b=Ise(m,d.toRef(a));Rse([m,g],()=>f());const C=d.computed(()=>({"--pl-tooltip-max-width":a.maxWidth}));return d.onUnmounted(()=>{LS.delete(r)}),(x,k)=>(d.openBlock(),d.createBlock(d.resolveDynamicComponent(x.element),d.mergeProps(x.$attrs,{ref_key:"rootRef",ref:m,onClick:A,onMouseover:A,onMouseleave:h}),{default:d.withCtx(()=>[d.renderSlot(x.$slots,"default"),k[1]||(k[1]=d.createTextVNode()),x.$slots.tooltip&&i.open?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:"body"},[d.createVNode(d.Transition,{name:"tooltip-transition"},{default:d.withCtx(()=>[i.tooltipOpen?(d.openBlock(),d.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:d.normalizeStyle(d.unref(b))},[d.createElementVNode("div",{ref_key:"tooltip",ref:g,class:d.normalizeClass(["pl-tooltip",x.position]),style:d.normalizeStyle(C.value),onMouseover:A,onMouseleave:h},[d.createElementVNode("div",null,[d.renderSlot(x.$slots,"tooltip")]),k[0]||(k[0]=d.createTextVNode()),d.createVNode(Vse)],38)],4)):d.createCommentVNode("",!0)]),_:3})])):d.createCommentVNode("",!0)]),_:3},16))}}),zse={inheritAttrs:!1},Use={class:"double-contour"};function jse(e,t,n,r,a,i){return d.openBlock(),d.createElementBlock("div",Use,[d.createElementVNode("div",d.normalizeProps(d.guardReactiveProps(e.$attrs)),[d.renderSlot(e.$slots,"default")],16)])}const Gse=J5(zse,[["render",jse]]);function Yse(e){d.onMounted(e),d.onUpdated(e)}const RS=new WeakMap,NS=new ResizeObserver(e=>{for(const t of e)KR(RS.get(t.target),n=>n(t))});function Wse(e,t){RS.set(e,t),NS.unobserve(e),NS.observe(e)}function Xse(e){NS.unobserve(e),RS.delete(e)}const Kse=8,ZR=4;function Zse(e,t="label"){const n=new Set;Yse(()=>{KR(e==null?void 0:e.value,r=>{const a=r.querySelector(t);a&&(n.add(a),Wse(a,()=>{const i=gse(()=>a.getBoundingClientRect().width+XR(Kse,o=>Number.isNaN(o)?ZR:o+ZR));r.style.getPropertyValue("--label-offset-right-x")!==`${i}px`&&r.style.setProperty("--label-offset-right-x",`${i}px`)}))})}),d.onBeforeUnmount(()=>{Array.from(n.values()).map(r=>Xse(r))})}const Jse=d.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(e){const t=e,n=d.computed(()=>t.size==="large"?"--icon-size: 24px":""),r=d.computed(()=>`icon-16 icon-${t.name}`);return(a,i)=>(d.openBlock(),d.createElementBlock("i",{style:d.normalizeStyle(n.value),class:d.normalizeClass([r.value,a.$style.icon])},null,6))}}),qse="_icon_1ugxm_2",eue={icon:qse},tue={$style:eue},q5=J5(Jse,[["__cssModules",tue]]);function JR(e){return e!==null&&typeof e=="object"}function Ky(e,t){return JR(e)&&JR(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(n=>Ky(e[n],t[n])):e===t}const nue=d.defineComponent({__name:"LongText",setup(e){d.useCssVars(A=>({"5deba9de":o.value}));const t=d.ref(!1),n=d.ref(),r=d.ref(!1),a=d.computed(()=>r.value&&t.value?"ui-lt-animate":""),i=tse(A=>r.value=A,500),o=d.computed(()=>{var A;return n.value?`${((A=n.value)==null?void 0:A.innerHTML.length)*.4}s`:"5s"});function s(){const A=jR(n.value,"span cannot be empty");t.value=A.clientWidth<A.scrollWidth}function c(){s(),i(!0)}function f(){i(!1)}return(A,h)=>(d.openBlock(),d.createElementBlock("div",d.mergeProps(A.$attrs,{class:"ui-lt-container"}),[d.createElementVNode("span",{onMouseover:c,onMouseleave:f},[d.createElementVNode("span",{ref_key:"span",ref:n,class:d.normalizeClass(a.value)},[d.renderSlot(A.$slots,"default")],2)],32)],16))}});function rue(e,t){const n=e.scrollTop,r=e.getBoundingClientRect().height,a=t.offsetTop,i=t.getBoundingClientRect().height;return a+i<r+n&&a>n}function aue(e,t){const n=e.scrollTop,r=e.getBoundingClientRect().height,a=t.offsetTop,i=t.getBoundingClientRect().height;return a+i<r+n?"ceil":a>n?"floor":"visible"}function iue(e,t,n={}){const r=e.scrollTop,a=e.getBoundingClientRect().height,i=t.getBoundingClientRect().height,o=t.offsetTop,s=aue(e,t);if(s==="visible")return;const c=f=>{const A=s==="floor"?o-(a-i):o;e.scrollTop=r+f*(A-r)};rue(e,t)||Ese({duration:n.duration||100,timing:bse(f=>f),draw:c})}const oue=d.defineComponent({__name:"DropdownOverlay",props:{root:{},gap:{}},setup(e,{expose:t}){const n=e,r=d.reactive({optionsHeight:0}),a=d.reactive({top:"0px",left:"0px",width:"0px"}),i=d.toRef(n,"root"),o=d.ref();return t({scrollIntoActive:()=>{const s=o.value;s&&ese(s.querySelector(".hovered-item"),c=>{iue(s,c)})},listRef:o}),d.watch(o,s=>{s&&requestAnimationFrame(()=>{const c=s.getBoundingClientRect();r.optionsHeight=c.height,window.dispatchEvent(new CustomEvent("adjust"))})}),YR(i,s=>{const c=document.body.getBoundingClientRect(),f=s.top-c.top,A=s.left-c.left,h=n.gap??0,m=f+s.height+h;m+r.optionsHeight>s.clientHeight?a.top=f-r.optionsHeight-h+"px":a.top=m+"px",a.left=A+"px",a.width=s.width+"px"}),(s,c)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createElementVNode("div",d.mergeProps({ref_key:"listRef",ref:o},s.$attrs,{style:a,tabindex:"-1"}),[d.renderSlot(s.$slots,"default",{ref:"list"})],16)]))}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const qR=()=>{};function lue(e,t){function n(...r){return new Promise((a,i)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(a).catch(i)})}return n}function sue(e,t={}){let n,r,a=qR;const i=o=>{clearTimeout(o),a(),a=qR};return o=>{const s=d.toValue(e),c=d.toValue(t.maxWait);return n&&i(n),s<=0||c!==void 0&&c<=0?(r&&(i(r),r=null),Promise.resolve(o())):new Promise((f,A)=>{a=t.rejectOnCancel?A:f,c&&!r&&(r=setTimeout(()=>{n&&i(n),r=null,f(o())},c)),n=setTimeout(()=>{r&&i(r),r=null,f(o())},s)})}}function uue(e,t=200,n={}){return lue(sue(t,n),e)}function cue(e,t=200,n={}){const r=d.ref(e.value),a=uue(()=>{r.value=e.value},t,n);return d.watch(e,()=>a()),r}var Oi;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Oi||(Oi={}));var $S;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})($S||($S={}));const Nn=Oi.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rm=e=>{switch(typeof e){case"undefined":return Nn.undefined;case"string":return Nn.string;case"number":return isNaN(e)?Nn.nan:Nn.number;case"boolean":return Nn.boolean;case"function":return Nn.function;case"bigint":return Nn.bigint;case"symbol":return Nn.symbol;case"object":return Array.isArray(e)?Nn.array:e===null?Nn.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Nn.promise:typeof Map<"u"&&e instanceof Map?Nn.map:typeof Set<"u"&&e instanceof Set?Nn.set:typeof Date<"u"&&e instanceof Date?Nn.date:Nn.object;default:return Nn.unknown}},an=Oi.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),fue=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");let Rp=class Nee extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(i){return i.message},r={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let s=r,c=0;for(;c<o.path.length;){const f=o.path[c];c===o.path.length-1?(s[f]=s[f]||{_errors:[]},s[f]._errors.push(n(o))):s[f]=s[f]||{_errors:[]},s=s[f],c++}}};return a(this),r}static assert(t){if(!(t instanceof Nee))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oi.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Rp.create=e=>new Rp(e);const Zy=(e,t)=>{let n;switch(e.code){case an.invalid_type:e.received===Nn.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case an.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Oi.jsonStringifyReplacer)}`;break;case an.unrecognized_keys:n=`Unrecognized key(s) in object: ${Oi.joinValues(e.keys,", ")}`;break;case an.invalid_union:n="Invalid input";break;case an.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Oi.joinValues(e.options)}`;break;case an.invalid_enum_value:n=`Invalid enum value. Expected ${Oi.joinValues(e.options)}, received '${e.received}'`;break;case an.invalid_arguments:n="Invalid function arguments";break;case an.invalid_return_type:n="Invalid function return type";break;case an.invalid_date:n="Invalid date";break;case an.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Oi.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case an.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case an.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case an.custom:n="Invalid input";break;case an.invalid_intersection_types:n="Intersection results could not be merged";break;case an.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case an.not_finite:n="Number must be finite";break;default:n=t.defaultError,Oi.assertNever(e)}return{message:n}};let eN=Zy;function due(e){eN=e}function LC(){return eN}const RC=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const c=r.filter(f=>!!f).slice().reverse();for(const f of c)s=f(o,{data:t,defaultError:s}).message;return{...a,path:i,message:s}},Aue=[];function Mn(e,t){const n=LC(),r=RC({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Zy?void 0:Zy].filter(a=>!!a)});e.common.issues.push(r)}class ff{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return Aa;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const i=await a.key,o=await a.value;r.push({key:i,value:o})}return ff.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return Aa;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(r[i.value]=o.value)}return{status:t.value,value:r}}}const Aa=Object.freeze({status:"aborted"}),NC=e=>({status:"dirty",value:e}),Of=e=>({status:"valid",value:e}),FS=e=>e.status==="aborted",VS=e=>e.status==="dirty",e7=e=>e.status==="valid",t7=e=>typeof Promise<"u"&&e instanceof Promise;function $C(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function tN(e,t,n,r,a){if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var vr;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(vr||(vr={}));var n7,r7;let L0=class{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const nN=(e,t)=>{if(e7(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Rp(e.common.issues);return this._error=n,this._error}}};function Ha(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(i,o)=>{var s,c;const{message:f}=e;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:(s=f??r)!==null&&s!==void 0?s:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(c=f??n)!==null&&c!==void 0?c:o.defaultError}},description:a}}let Ka=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return rm(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:rm(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ff,ctx:{common:t.parent.common,data:t.data,parsedType:rm(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(t7(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const a={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:rm(t)},i=this._parseSync({data:t,path:a.path,parent:a});return nN(a,i)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:rm(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(t7(a)?a:Promise.resolve(a));return nN(r,i)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const o=t(a),s=()=>i.addIssue({code:an.custom,...r(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new $p({schema:this,typeName:ta.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return R0.create(this,this._def)}nullable(){return lm.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Uv.create(this,this._def)}promise(){return t3.create(this,this._def)}or(t){return u7.create([this,t],this._def)}and(t){return c7.create(this,t,this._def)}transform(t){return new $p({...Ha(this._def),schema:this,typeName:ta.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new h7({...Ha(this._def),innerType:this,defaultValue:n,typeName:ta.ZodDefault})}brand(){return new zS({typeName:ta.ZodBranded,type:this,...Ha(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new m7({...Ha(this._def),innerType:this,catchValue:n,typeName:ta.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return US.create(this,t)}readonly(){return v7.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const pue=/^c[^\s-]{8,}$/i,hue=/^[0-9a-z]+$/,mue=/^[0-9A-HJKMNP-TV-Z]{26}$/,vue=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,gue=/^[a-z0-9_-]{21}$/i,yue=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,wue=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cue="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let OS;const bue=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Eue=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,xue=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,rN="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Sue=new RegExp(`^${rN}$`);function aN(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Bue(e){return new RegExp(`^${aN(e)}$`)}function iN(e){let t=`${rN}T${aN(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function kue(e,t){return!!((t==="v4"||!t)&&bue.test(e)||(t==="v6"||!t)&&Eue.test(e))}class Np extends Ka{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Nn.string){const a=this._getOrReturnCtx(t);return Mn(a,{code:an.invalid_type,expected:Nn.string,received:a.parsedType}),Aa}const n=new ff;let r;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=t.data.length>a.value,o=t.data.length<a.value;(i||o)&&(r=this._getOrReturnCtx(t,r),i?Mn(r,{code:an.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&Mn(r,{code:an.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")wue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"email",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")OS||(OS=new RegExp(Cue,"u")),OS.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"emoji",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")vue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"uuid",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")gue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"nanoid",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")pue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"cuid",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")hue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"cuid2",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")mue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"ulid",code:an.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),Mn(r,{validation:"url",code:an.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"regex",code:an.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?iN(a).test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Sue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?Bue(a).test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?yue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"duration",code:an.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?kue(t.data,a.version)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"ip",code:an.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?xue.test(t.data)||(r=this._getOrReturnCtx(t,r),Mn(r,{validation:"base64",code:an.invalid_string,message:a.message}),n.dirty()):Oi.assertNever(a);return{status:n.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:an.invalid_string,...vr.errToObj(r)})}_addCheck(t){return new Np({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...vr.errToObj(t)})}url(t){return this._addCheck({kind:"url",...vr.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...vr.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...vr.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...vr.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...vr.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...vr.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...vr.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...vr.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...vr.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...vr.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...vr.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...vr.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...vr.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...vr.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...vr.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...vr.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...vr.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...vr.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...vr.errToObj(n)})}nonempty(t){return this.min(1,vr.errToObj(t))}trim(){return new Np({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Np({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Np({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Np.create=e=>{var t;return new Np({checks:[],typeName:ta.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ha(e)})};function Tue(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,i=parseInt(e.toFixed(a).replace(".","")),o=parseInt(t.toFixed(a).replace(".",""));return i%o/Math.pow(10,a)}let a7=class TI extends Ka{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Nn.number){const a=this._getOrReturnCtx(t);return Mn(a,{code:an.invalid_type,expected:Nn.number,received:a.parsedType}),Aa}let n;const r=new ff;for(const a of this._def.checks)a.kind==="int"?Oi.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="multipleOf"?Tue(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.not_finite,message:a.message}),r.dirty()):Oi.assertNever(a);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,vr.toString(n))}gt(t,n){return this.setLimit("min",t,!1,vr.toString(n))}lte(t,n){return this.setLimit("max",t,!0,vr.toString(n))}lt(t,n){return this.setLimit("max",t,!1,vr.toString(n))}setLimit(t,n,r,a){return new TI({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:vr.toString(a)}]})}_addCheck(t){return new TI({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:vr.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:vr.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:vr.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:vr.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:vr.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:vr.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:vr.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:vr.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:vr.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Oi.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};a7.create=e=>new a7({checks:[],typeName:ta.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ha(e)});class am extends Ka{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Nn.bigint){const a=this._getOrReturnCtx(t);return Mn(a,{code:an.invalid_type,expected:Nn.bigint,received:a.parsedType}),Aa}let n;const r=new ff;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),Mn(n,{code:an.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):Oi.assertNever(a);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,vr.toString(n))}gt(t,n){return this.setLimit("min",t,!1,vr.toString(n))}lte(t,n){return this.setLimit("max",t,!0,vr.toString(n))}lt(t,n){return this.setLimit("max",t,!1,vr.toString(n))}setLimit(t,n,r,a){return new am({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:vr.toString(a)}]})}_addCheck(t){return new am({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:vr.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:vr.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:vr.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:vr.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:vr.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}am.create=e=>{var t;return new am({checks:[],typeName:ta.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ha(e)})};let i7=class extends Ka{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Nn.boolean){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.boolean,received:n.parsedType}),Aa}return Of(t.data)}};i7.create=e=>new i7({typeName:ta.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ha(e)});let o7=class $ee extends Ka{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Nn.date){const a=this._getOrReturnCtx(t);return Mn(a,{code:an.invalid_type,expected:Nn.date,received:a.parsedType}),Aa}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return Mn(a,{code:an.invalid_date}),Aa}const n=new ff;let r;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(r=this._getOrReturnCtx(t,r),Mn(r,{code:an.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Oi.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new $ee({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:vr.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:vr.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};o7.create=e=>new o7({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ta.ZodDate,...Ha(e)});let FC=class extends Ka{_parse(t){if(this._getType(t)!==Nn.symbol){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.symbol,received:n.parsedType}),Aa}return Of(t.data)}};FC.create=e=>new FC({typeName:ta.ZodSymbol,...Ha(e)});class l7 extends Ka{_parse(t){if(this._getType(t)!==Nn.undefined){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.undefined,received:n.parsedType}),Aa}return Of(t.data)}}l7.create=e=>new l7({typeName:ta.ZodUndefined,...Ha(e)});class s7 extends Ka{_parse(t){if(this._getType(t)!==Nn.null){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.null,received:n.parsedType}),Aa}return Of(t.data)}}s7.create=e=>new s7({typeName:ta.ZodNull,...Ha(e)});let Jy=class extends Ka{constructor(){super(...arguments),this._any=!0}_parse(t){return Of(t.data)}};Jy.create=e=>new Jy({typeName:ta.ZodAny,...Ha(e)});class zv extends Ka{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Of(t.data)}}zv.create=e=>new zv({typeName:ta.ZodUnknown,...Ha(e)});class Fh extends Ka{_parse(t){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.never,received:n.parsedType}),Aa}}Fh.create=e=>new Fh({typeName:ta.ZodNever,...Ha(e)});let VC=class extends Ka{_parse(t){if(this._getType(t)!==Nn.undefined){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.void,received:n.parsedType}),Aa}return Of(t.data)}};VC.create=e=>new VC({typeName:ta.ZodVoid,...Ha(e)});let Uv=class zx extends Ka{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Nn.array)return Mn(n,{code:an.invalid_type,expected:Nn.array,received:n.parsedType}),Aa;if(a.exactLength!==null){const o=n.data.length>a.exactLength.value,s=n.data.length<a.exactLength.value;(o||s)&&(Mn(n,{code:o?an.too_big:an.too_small,minimum:s?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(Mn(n,{code:an.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(Mn(n,{code:an.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,s)=>a.type._parseAsync(new L0(n,o,n.path,s)))).then(o=>ff.mergeArray(r,o));const i=[...n.data].map((o,s)=>a.type._parseSync(new L0(n,o,n.path,s)));return ff.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new zx({...this._def,minLength:{value:t,message:vr.toString(n)}})}max(t,n){return new zx({...this._def,maxLength:{value:t,message:vr.toString(n)}})}length(t,n){return new zx({...this._def,exactLength:{value:t,message:vr.toString(n)}})}nonempty(t){return this.min(1,t)}};Uv.create=(e,t)=>new Uv({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ta.ZodArray,...Ha(t)});function qy(e){if(e instanceof VA){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=R0.create(qy(r))}return new VA({...e._def,shape:()=>t})}else return e instanceof Uv?new Uv({...e._def,type:qy(e.element)}):e instanceof R0?R0.create(qy(e.unwrap())):e instanceof lm?lm.create(qy(e.unwrap())):e instanceof om?om.create(e.items.map(t=>qy(t))):e}let VA=class B0 extends Ka{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Oi.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Nn.object){const c=this._getOrReturnCtx(t);return Mn(c,{code:an.invalid_type,expected:Nn.object,received:c.parsedType}),Aa}const{status:n,ctx:r}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Fh&&this._def.unknownKeys==="strip"))for(const c in r.data)i.includes(c)||o.push(c);const s=[];for(const c of i){const f=a[c],A=r.data[c];s.push({key:{status:"valid",value:c},value:f._parse(new L0(r,A,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Fh){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of o)s.push({key:{status:"valid",value:f},value:{status:"valid",value:r.data[f]}});else if(c==="strict")o.length>0&&(Mn(r,{code:an.unrecognized_keys,keys:o}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of o){const A=r.data[f];s.push({key:{status:"valid",value:f},value:c._parse(new L0(r,A,r.path,f)),alwaysSet:f in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of s){const A=await f.key,h=await f.value;c.push({key:A,value:h,alwaysSet:f.alwaysSet})}return c}).then(c=>ff.mergeObjectSync(n,c)):ff.mergeObjectSync(n,s)}get shape(){return this._def.shape()}strict(t){return vr.errToObj,new B0({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var a,i,o,s;const c=(o=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=vr.errToObj(t).message)!==null&&s!==void 0?s:c}:{message:c}}}:{}})}strip(){return new B0({...this._def,unknownKeys:"strip"})}passthrough(){return new B0({...this._def,unknownKeys:"passthrough"})}extend(t){return new B0({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new B0({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ta.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new B0({...this._def,catchall:t})}pick(t){const n={};return Oi.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new B0({...this._def,shape:()=>n})}omit(t){const n={};return Oi.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new B0({...this._def,shape:()=>n})}deepPartial(){return qy(this)}partial(t){const n={};return Oi.objectKeys(this.shape).forEach(r=>{const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}),new B0({...this._def,shape:()=>n})}required(t){const n={};return Oi.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof R0;)a=a._def.innerType;n[r]=a}}),new B0({...this._def,shape:()=>n})}keyof(){return sN(Oi.objectKeys(this.shape))}};VA.create=(e,t)=>new VA({shape:()=>e,unknownKeys:"strip",catchall:Fh.create(),typeName:ta.ZodObject,...Ha(t)}),VA.strictCreate=(e,t)=>new VA({shape:()=>e,unknownKeys:"strict",catchall:Fh.create(),typeName:ta.ZodObject,...Ha(t)}),VA.lazycreate=(e,t)=>new VA({shape:e,unknownKeys:"strip",catchall:Fh.create(),typeName:ta.ZodObject,...Ha(t)});class u7 extends Ka{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new Rp(s.ctx.common.issues));return Mn(n,{code:an.invalid_union,unionErrors:o}),Aa}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of r){const f={...n,common:{...n.common,issues:[]},parent:null},A=c._parseSync({data:n.data,path:n.path,parent:f});if(A.status==="valid")return A;A.status==="dirty"&&!i&&(i={result:A,ctx:f}),f.common.issues.length&&o.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(c=>new Rp(c));return Mn(n,{code:an.invalid_union,unionErrors:s}),Aa}}get options(){return this._def.options}}u7.create=(e,t)=>new u7({options:e,typeName:ta.ZodUnion,...Ha(t)});const im=e=>e instanceof f7?im(e.schema):e instanceof $p?im(e.innerType()):e instanceof d7?[e.value]:e instanceof A7?e.options:e instanceof p7?Oi.objectValues(e.enum):e instanceof h7?im(e._def.innerType):e instanceof l7?[void 0]:e instanceof s7?[null]:e instanceof R0?[void 0,...im(e.unwrap())]:e instanceof lm?[null,...im(e.unwrap())]:e instanceof zS||e instanceof v7?im(e.unwrap()):e instanceof m7?im(e._def.innerType):[];let oN=class Fee extends Ka{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Nn.object)return Mn(n,{code:an.invalid_type,expected:Nn.object,received:n.parsedType}),Aa;const r=this.discriminator,a=n.data[r],i=this.optionsMap.get(a);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Mn(n,{code:an.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Aa)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const a=new Map;for(const i of n){const o=im(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of o){if(a.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);a.set(s,i)}}return new Fee({typeName:ta.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:a,...Ha(r)})}};function QS(e,t){const n=rm(e),r=rm(t);if(e===t)return{valid:!0,data:e};if(n===Nn.object&&r===Nn.object){const a=Oi.objectKeys(t),i=Oi.objectKeys(e).filter(s=>a.indexOf(s)!==-1),o={...e,...t};for(const s of i){const c=QS(e[s],t[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(n===Nn.array&&r===Nn.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const o=e[i],s=t[i],c=QS(o,s);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return n===Nn.date&&r===Nn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class c7 extends Ka{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(i,o)=>{if(FS(i)||FS(o))return Aa;const s=QS(i.value,o.value);return s.valid?((VS(i)||VS(o))&&n.dirty(),{status:n.value,value:s.data}):(Mn(r,{code:an.invalid_intersection_types}),Aa)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}c7.create=(e,t,n)=>new c7({left:e,right:t,typeName:ta.ZodIntersection,...Ha(n)});let om=class Vee extends Ka{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Nn.array)return Mn(r,{code:an.invalid_type,expected:Nn.array,received:r.parsedType}),Aa;if(r.data.length<this._def.items.length)return Mn(r,{code:an.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Aa;!this._def.rest&&r.data.length>this._def.items.length&&(Mn(r,{code:an.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((i,o)=>{const s=this._def.items[o]||this._def.rest;return s?s._parse(new L0(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>ff.mergeArray(n,i)):ff.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new Vee({...this._def,rest:t})}};om.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new om({items:e,typeName:ta.ZodTuple,rest:null,...Ha(t)})};let lN=class _I extends Ka{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Nn.object)return Mn(r,{code:an.invalid_type,expected:Nn.object,received:r.parsedType}),Aa;const a=[],i=this._def.keyType,o=this._def.valueType;for(const s in r.data)a.push({key:i._parse(new L0(r,s,r.path,s)),value:o._parse(new L0(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?ff.mergeObjectAsync(n,a):ff.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ka?new _I({keyType:t,valueType:n,typeName:ta.ZodRecord,...Ha(r)}):new _I({keyType:Np.create(),valueType:t,typeName:ta.ZodRecord,...Ha(n)})}},OC=class extends Ka{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Nn.map)return Mn(r,{code:an.invalid_type,expected:Nn.map,received:r.parsedType}),Aa;const a=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([s,c],f)=>({key:a._parse(new L0(r,s,r.path,[f,"key"])),value:i._parse(new L0(r,c,r.path,[f,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const c of o){const f=await c.key,A=await c.value;if(f.status==="aborted"||A.status==="aborted")return Aa;(f.status==="dirty"||A.status==="dirty")&&n.dirty(),s.set(f.value,A.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const c of o){const f=c.key,A=c.value;if(f.status==="aborted"||A.status==="aborted")return Aa;(f.status==="dirty"||A.status==="dirty")&&n.dirty(),s.set(f.value,A.value)}return{status:n.value,value:s}}}};OC.create=(e,t,n)=>new OC({valueType:t,keyType:e,typeName:ta.ZodMap,...Ha(n)});let QC=class PI extends Ka{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Nn.set)return Mn(r,{code:an.invalid_type,expected:Nn.set,received:r.parsedType}),Aa;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(Mn(r,{code:an.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(Mn(r,{code:an.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const f=new Set;for(const A of c){if(A.status==="aborted")return Aa;A.status==="dirty"&&n.dirty(),f.add(A.value)}return{status:n.value,value:f}}const s=[...r.data.values()].map((c,f)=>i._parse(new L0(r,c,r.path,f)));return r.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(t,n){return new PI({...this._def,minSize:{value:t,message:vr.toString(n)}})}max(t,n){return new PI({...this._def,maxSize:{value:t,message:vr.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};QC.create=(e,t)=>new QC({valueType:e,minSize:null,maxSize:null,typeName:ta.ZodSet,...Ha(t)});class e3 extends Ka{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Nn.function)return Mn(n,{code:an.invalid_type,expected:Nn.function,received:n.parsedType}),Aa;function r(s,c){return RC({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,LC(),Zy].filter(f=>!!f),issueData:{code:an.invalid_arguments,argumentsError:c}})}function a(s,c){return RC({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,LC(),Zy].filter(f=>!!f),issueData:{code:an.invalid_return_type,returnTypeError:c}})}const i={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof t3){const s=this;return Of(async function(...c){const f=new Rp([]),A=await s._def.args.parseAsync(c,i).catch(m=>{throw f.addIssue(r(c,m)),f}),h=await Reflect.apply(o,this,A);return await s._def.returns._def.type.parseAsync(h,i).catch(m=>{throw f.addIssue(a(h,m)),f})})}else{const s=this;return Of(function(...c){const f=s._def.args.safeParse(c,i);if(!f.success)throw new Rp([r(c,f.error)]);const A=Reflect.apply(o,this,f.data),h=s._def.returns.safeParse(A,i);if(!h.success)throw new Rp([a(A,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e3({...this._def,args:om.create(t).rest(zv.create())})}returns(t){return new e3({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new e3({args:t||om.create([]).rest(zv.create()),returns:n||zv.create(),typeName:ta.ZodFunction,...Ha(r)})}}class f7 extends Ka{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}f7.create=(e,t)=>new f7({getter:e,typeName:ta.ZodLazy,...Ha(t)});class d7 extends Ka{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Mn(n,{received:n.data,code:an.invalid_literal,expected:this._def.value}),Aa}return{status:"valid",value:t.data}}get value(){return this._def.value}}d7.create=(e,t)=>new d7({value:e,typeName:ta.ZodLiteral,...Ha(t)});function sN(e,t){return new A7({values:e,typeName:ta.ZodEnum,...Ha(t)})}let A7=class MI extends Ka{constructor(){super(...arguments),n7.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Mn(n,{expected:Oi.joinValues(r),received:n.parsedType,code:an.invalid_type}),Aa}if($C(this,n7)||tN(this,n7,new Set(this._def.values)),!$C(this,n7).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Mn(n,{received:n.data,code:an.invalid_enum_value,options:r}),Aa}return Of(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return MI.create(t,{...this._def,...n})}exclude(t,n=this._def){return MI.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}};n7=new WeakMap,A7.create=sN;let p7=class extends Ka{constructor(){super(...arguments),r7.set(this,void 0)}_parse(t){const n=Oi.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Nn.string&&r.parsedType!==Nn.number){const a=Oi.objectValues(n);return Mn(r,{expected:Oi.joinValues(a),received:r.parsedType,code:an.invalid_type}),Aa}if($C(this,r7)||tN(this,r7,new Set(Oi.getValidEnumValues(this._def.values))),!$C(this,r7).has(t.data)){const a=Oi.objectValues(n);return Mn(r,{received:r.data,code:an.invalid_enum_value,options:a}),Aa}return Of(t.data)}get enum(){return this._def.values}};r7=new WeakMap,p7.create=(e,t)=>new p7({values:e,typeName:ta.ZodNativeEnum,...Ha(t)});class t3 extends Ka{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Nn.promise&&n.common.async===!1)return Mn(n,{code:an.invalid_type,expected:Nn.promise,received:n.parsedType}),Aa;const r=n.parsedType===Nn.promise?n.data:Promise.resolve(n.data);return Of(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}t3.create=(e,t)=>new t3({type:e,typeName:ta.ZodPromise,...Ha(t)});class $p extends Ka{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ta.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{Mn(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async s=>{if(n.value==="aborted")return Aa;const c=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return c.status==="aborted"?Aa:c.status==="dirty"||n.value==="dirty"?NC(c.value):c});{if(n.value==="aborted")return Aa;const s=this._def.schema._parseSync({data:o,path:r.path,parent:r});return s.status==="aborted"?Aa:s.status==="dirty"||n.value==="dirty"?NC(s.value):s}}if(a.type==="refinement"){const o=s=>{const c=a.refinement(s,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Aa:(s.status==="dirty"&&n.dirty(),o(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?Aa:(s.status==="dirty"&&n.dirty(),o(s.value).then(()=>({status:n.value,value:s.value}))))}if(a.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!e7(o))return o;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>e7(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:n.value,value:s})):o);Oi.assertNever(a)}}$p.create=(e,t,n)=>new $p({schema:e,typeName:ta.ZodEffects,effect:t,...Ha(n)}),$p.createWithPreprocess=(e,t,n)=>new $p({schema:t,effect:{type:"preprocess",transform:e},typeName:ta.ZodEffects,...Ha(n)});let R0=class extends Ka{_parse(t){return this._getType(t)===Nn.undefined?Of(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};R0.create=(e,t)=>new R0({innerType:e,typeName:ta.ZodOptional,...Ha(t)});let lm=class extends Ka{_parse(t){return this._getType(t)===Nn.null?Of(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};lm.create=(e,t)=>new lm({innerType:e,typeName:ta.ZodNullable,...Ha(t)});let h7=class extends Ka{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Nn.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};h7.create=(e,t)=>new h7({innerType:e,typeName:ta.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ha(t)});let m7=class extends Ka{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return t7(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Rp(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Rp(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};m7.create=(e,t)=>new m7({innerType:e,typeName:ta.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ha(t)});class zC extends Ka{_parse(t){if(this._getType(t)!==Nn.nan){const n=this._getOrReturnCtx(t);return Mn(n,{code:an.invalid_type,expected:Nn.nan,received:n.parsedType}),Aa}return{status:"valid",value:t.data}}}zC.create=e=>new zC({typeName:ta.ZodNaN,...Ha(e)});const _ue=Symbol("zod_brand");let zS=class extends Ka{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},US=class Oee extends Ka{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Aa:a.status==="dirty"?(n.dirty(),NC(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Aa:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new Oee({in:t,out:n,typeName:ta.ZodPipeline})}},v7=class extends Ka{_parse(t){const n=this._def.innerType._parse(t),r=a=>(e7(a)&&(a.value=Object.freeze(a.value)),a);return t7(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}};v7.create=(e,t)=>new v7({innerType:e,typeName:ta.ZodReadonly,...Ha(t)});function uN(e,t={},n){return e?Jy.create().superRefine((r,a)=>{var i,o;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(o=(i=s.fatal)!==null&&i!==void 0?i:n)!==null&&o!==void 0?o:!0,f=typeof s=="string"?{message:s}:s;a.addIssue({code:"custom",...f,fatal:c})}}):Jy.create()}const Pue={object:VA.lazycreate};var ta;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ta||(ta={}));const Mue=(e,t={message:`Input not instance of ${e.name}`})=>uN(n=>n instanceof e,t),cN=Np.create,fN=a7.create,Due=zC.create,Hue=am.create,dN=i7.create,Iue=o7.create,Lue=FC.create,Rue=l7.create,Nue=s7.create,$ue=Jy.create,Fue=zv.create,Vue=Fh.create,Oue=VC.create,Que=Uv.create,zue=VA.create,Uue=VA.strictCreate,jue=u7.create,Gue=oN.create,Yue=c7.create,Wue=om.create,Xue=lN.create,Kue=OC.create,Zue=QC.create,Jue=e3.create,que=f7.create,ece=d7.create,tce=A7.create,nce=p7.create,rce=t3.create,AN=$p.create,ace=R0.create,ice=lm.create,oce=$p.createWithPreprocess,lce=US.create;var Di=Object.freeze({__proto__:null,defaultErrorMap:Zy,setErrorMap:due,getErrorMap:LC,makeIssue:RC,EMPTY_PATH:Aue,addIssueToContext:Mn,ParseStatus:ff,INVALID:Aa,DIRTY:NC,OK:Of,isAborted:FS,isDirty:VS,isValid:e7,isAsync:t7,get util(){return Oi},get objectUtil(){return $S},ZodParsedType:Nn,getParsedType:rm,ZodType:Ka,datetimeRegex:iN,ZodString:Np,ZodNumber:a7,ZodBigInt:am,ZodBoolean:i7,ZodDate:o7,ZodSymbol:FC,ZodUndefined:l7,ZodNull:s7,ZodAny:Jy,ZodUnknown:zv,ZodNever:Fh,ZodVoid:VC,ZodArray:Uv,ZodObject:VA,ZodUnion:u7,ZodDiscriminatedUnion:oN,ZodIntersection:c7,ZodTuple:om,ZodRecord:lN,ZodMap:OC,ZodSet:QC,ZodFunction:e3,ZodLazy:f7,ZodLiteral:d7,ZodEnum:A7,ZodNativeEnum:p7,ZodPromise:t3,ZodEffects:$p,ZodTransformer:$p,ZodOptional:R0,ZodNullable:lm,ZodDefault:h7,ZodCatch:m7,ZodNaN:zC,BRAND:_ue,ZodBranded:zS,ZodPipeline:US,ZodReadonly:v7,custom:uN,Schema:Ka,ZodSchema:Ka,late:Pue,get ZodFirstPartyTypeKind(){return ta},coerce:{string:e=>Np.create({...e,coerce:!0}),number:e=>a7.create({...e,coerce:!0}),boolean:e=>i7.create({...e,coerce:!0}),bigint:e=>am.create({...e,coerce:!0}),date:e=>o7.create({...e,coerce:!0})},any:$ue,array:Que,bigint:Hue,boolean:dN,date:Iue,discriminatedUnion:Gue,effect:AN,enum:tce,function:Jue,instanceof:Mue,intersection:Yue,lazy:que,literal:ece,map:Kue,nan:Due,nativeEnum:nce,never:Vue,null:Nue,nullable:ice,number:fN,object:zue,oboolean:()=>dN().optional(),onumber:()=>fN().optional(),optional:ace,ostring:()=>cN().optional(),pipeline:lce,preprocess:oce,promise:rce,record:Xue,set:Zue,strictObject:Uue,string:cN,symbol:Lue,transformer:AN,tuple:Wue,undefined:Rue,union:jue,unknown:Fue,void:Oue,NEVER:Aa,ZodIssueCode:an,quotelessJson:fue,ZodError:Rp});Di.object({__isRef:Di.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Di.string().describe("Upstream block id"),name:Di.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:Di.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly(),Di.string().length(24).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");var pN={exports:{}};(function(e,t){t=e.exports=n,t.getSerialize=r;function n(a,i,o,s){return JSON.stringify(a,r(i,s),o)}function r(a,i){var o=[],s=[];return i==null&&(i=function(c,f){return o[0]===f?"[Circular ~]":"[Circular ~."+s.slice(0,o.indexOf(f)).join(".")+"]"}),function(c,f){if(o.length>0){var A=o.indexOf(this);~A?o.splice(A+1):o.push(this),~A?s.splice(A,1/0,c):s.push(c),~o.indexOf(f)&&(f=i.call(this,c,f))}else o.push(f);return a==null?f:a.call(this,c,f)}}})(pN,pN.exports);const sce=Di.object({type:Di.literal("PlError"),name:Di.string(),message:Di.string(),fullMessage:Di.string().optional(),stack:Di.string().optional()}),uce=sce.extend({cause:Di.lazy(()=>UC).optional(),errors:Di.lazy(()=>UC.array()).optional()}),cce=Di.object({type:Di.literal("StandardError"),name:Di.string(),message:Di.string(),stack:Di.string().optional()}),fce=cce.extend({cause:Di.lazy(()=>UC).optional(),errors:Di.lazy(()=>UC.array()).optional()}),UC=Di.union([fce,uce]),dce=Di.object({name:Di.string(),message:Di.string(),fullMessage:Di.string().optional(),stack:Di.string().optional()}),hN=dce.extend({cause:Di.lazy(()=>hN).optional(),errors:Di.lazy(()=>hN.array()).optional()}),Ace=Di.object({type:Di.string(),importance:Di.number().optional(),id:Di.string().optional(),label:Di.string()});Di.array(Ace);function mN(e,t,n){const r=d.ref(0),a=d.reactive({loading:d.computed(()=>r.value>0),loadingRef:r,value:void 0,error:void 0}),i=nse(t);return d.watch(e,async o=>{a.error=void 0,r.value++,i(o).then(s=>{s.ok&&(a.value=s.value)}).catch(s=>{a.value=void 0,a.error=s}).finally(()=>{r.value--})},Object.assign({immediate:!0,deep:!0},{})),a}const pce=["tabindex"],hce={class:"pl-autocomplete__container"},mce={class:"pl-autocomplete__field"},vce=["disabled","placeholder"],gce={key:0,class:"input-value"},yce={class:"pl-autocomplete__controls"},wce={key:2,class:"arrow-icon arrow-icon-default"},Cce={key:0},bce={key:0,class:"required-icon"},Ece={key:0,class:"nothing-found"},xce={key:0,class:"pl-autocomplete__error"},Sce={key:1,class:"pl-autocomplete__helper"},Bce={key:2,class:"pl-autocomplete__helper"},kce={name:"PlAutocomplete"},jC=d.defineComponent({...kce,props:d.mergeModels({optionsSearch:{},modelSearch:{type:Function,default:void 0},label:{default:""},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"},formatValue:{type:Function,default:e=>String(e)}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=d.useModel(e,"modelValue"),n=e,r=d.useSlots(),a=d.ref(),i=d.ref(),o=d.useTemplateRef("overlay"),s=d.ref(null),c=d.reactive({activeIndex:-1,open:!1}),f=()=>XR(g.value.findIndex(me=>Ky(me.value,t.value)),me=>me<0?0:me),A=()=>c.activeIndex=f(),h=d.ref([]),m=d.ref(),g=d.computed(()=>GR(h.value).map((me,ae)=>({...me,index:ae,isSelected:ae===k.value,isActive:ae===c.activeIndex}))),b=d.ref(!0),C=d.ref(!1),x=d.computed(()=>n.disabled),k=d.computed(()=>h.value.findIndex(me=>Ky(me.value,t.value))),_=d.computed(()=>{if(!b.value){if(n.error)return n.error;if(C.value)return"Data loading error"}}),D=d.computed(()=>{const me=d.unref(m),ae=d.unref(g),ye=me??ae.find(Ce=>Ky(Ce.value,t.value))??ae.find(Ce=>Ky(Ce.value,t.value));return(ye==null?void 0:ye.label)||(t.value?n.formatValue(t.value):"")}),O=d.computed(()=>!c.open&&t.value?"":t.value?String(D.value):n.placeholder),I=d.computed(()=>t.value!==void 0&&t.value!==null),$=d.computed(()=>x.value?void 0:"0"),Q=me=>{var ae;t.value=me==null?void 0:me.value,m.value=me,s.value=null,c.open=!1,(ae=a==null?void 0:a.value)==null||ae.focus()},ee=()=>{t.value=void 0,m.value=void 0},K=()=>{var me;return(me=i.value)==null?void 0:me.focus()},re=()=>{c.open=!c.open};d.watch(()=>c.open,me=>{s.value=me?"":null});const U=()=>{c.open=!0},G=me=>{var ae,ye,Ce;const ce=me.relatedTarget;!((ae=a.value)!=null&&ae.contains(ce))&&!((Ce=(ye=o.value)==null?void 0:ye.listRef)!=null&&Ce.contains(ce))&&(s.value=null,c.open=!1)},Z=me=>{var ae;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(me.code))me.preventDefault();else return;const{open:ye,activeIndex:Ce}=c;if(!ye){me.code==="Enter"&&(c.open=!0,s.value="");return}me.code==="Escape"&&(c.open=!1,s.value=null,(ae=a.value)==null||ae.focus());const ce=d.unref(g),{length:ge}=ce;if(!ge)return;me.code==="Enter"&&Q(ce.find(Oe=>Oe.index===Ce));const ze=ce.findIndex(Oe=>Oe.index===Ce)??-1,Ne=me.code==="ArrowDown"?1:me.code==="ArrowUp"?-1:0,Ge=Math.abs(ze+Ne+ge)%ge;c.activeIndex=g.value[Ge].index??-1};Zse(a),d.watch(()=>t.value,A,{immediate:!0}),d.watch(()=>c.open,me=>{var ae;return me?(ae=i.value)==null?void 0:ae.focus():""}),d.watchPostEffect(()=>{var me;s.value,c.activeIndex>=0&&c.open&&((me=o.value)==null||me.scrollIntoActive())});const Y=cue(s,300,{maxWait:1e3}),X=mN(()=>Y.value,async me=>me!==null?n.optionsSearch(me):[]),oe=mN(()=>t.value,async me=>{var ae,ye;return me&&!Ky((ae=m.value)==null?void 0:ae.value,me)?n.modelSearch?n.modelSearch(me):(ye=await n.optionsSearch(String(me)))==null?void 0:ye[0]:m.value});return d.watch(()=>X.value,me=>{me&&(h.value=me,s.value!==null&&(C.value=!1))}),d.watch(()=>oe.value,me=>{me&&(m.value=GR([me])[0])}),d.watch(()=>X.error,me=>{me&&(C.value=!!me)}),d.watch(()=>X.loading||oe.loading,me=>{b.value=me}),(me,ae)=>(d.openBlock(),d.createElementBlock("div",{class:"pl-autocomplete__envelope",onClick:d.withModifiers(K,["stop"])},[d.createElementVNode("div",{ref_key:"rootRef",ref:a,tabindex:$.value,class:d.normalizeClass(["pl-autocomplete",{open:c.open,error:!!_.value,disabled:x.value}]),onKeydown:Z,onFocusout:G},[d.createElementVNode("div",hce,[d.createElementVNode("div",mce,[d.withDirectives(d.createElementVNode("input",{ref_key:"input",ref:i,"onUpdate:modelValue":ae[0]||(ae[0]=ye=>s.value=ye),type:"text",tabindex:"-1",disabled:x.value,placeholder:O.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:U},null,40,vce),[[d.vModelText,s.value]]),ae[4]||(ae[4]=d.createTextVNode()),c.open?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",gce,[d.createVNode(nue,null,{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(D.value),1)]),_:1})])),ae[5]||(ae[5]=d.createTextVNode()),d.createElementVNode("div",yce,[b.value?(d.openBlock(),d.createBlock(d.unref(Hse),{key:0,name:"loading"})):d.createCommentVNode("",!0),ae[1]||(ae[1]=d.createTextVNode()),me.clearable&&I.value?(d.openBlock(),d.createBlock(d.unref(q5),{key:1,name:"delete-clear",onClick:d.withModifiers(ee,["stop"])})):d.createCommentVNode("",!0),ae[2]||(ae[2]=d.createTextVNode()),d.renderSlot(me.$slots,"append"),ae[3]||(ae[3]=d.createTextVNode()),d.createElementVNode("div",{class:"pl-autocomplete__arrow-wrapper",onClick:d.withModifiers(re,["stop"])},[me.arrowIconLarge?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["arrow-icon",[`icon-24 ${me.arrowIconLarge}`]])},null,2)):me.arrowIcon?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["arrow-icon",[`icon-16 ${me.arrowIcon}`]])},null,2)):(d.openBlock(),d.createElementBlock("div",wce))])])]),ae[9]||(ae[9]=d.createTextVNode()),me.label?(d.openBlock(),d.createElementBlock("label",Cce,[me.required?(d.openBlock(),d.createElementBlock("i",bce)):d.createCommentVNode("",!0),ae[6]||(ae[6]=d.createTextVNode()),d.createElementVNode("span",null,d.toDisplayString(me.label),1),ae[7]||(ae[7]=d.createTextVNode()),d.unref(r).tooltip?(d.openBlock(),d.createBlock(d.unref(Qse),{key:1,class:"info",position:"top"},{tooltip:d.withCtx(()=>[d.renderSlot(me.$slots,"tooltip")]),_:3})):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),ae[10]||(ae[10]=d.createTextVNode()),c.open?(d.openBlock(),d.createBlock(d.unref(oue),{key:1,ref:"overlay",root:a.value,class:"pl-autocomplete__options",tabindex:"-1",gap:3},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(g.value,(ye,Ce)=>(d.openBlock(),d.createBlock(vse,{key:Ce,option:ye,"is-selected":ye.isSelected,"is-hovered":ye.isActive,size:me.optionSize,onClick:d.withModifiers(ce=>Q(ye),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),ae[8]||(ae[8]=d.createTextVNode()),g.value.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Ece,"Nothing found"))]),_:1},8,["root"])):d.createCommentVNode("",!0),ae[11]||(ae[11]=d.createTextVNode()),d.createVNode(Gse,{class:"pl-autocomplete__contour"})])],42,pce),ae[12]||(ae[12]=d.createTextVNode()),_.value?(d.openBlock(),d.createElementBlock("div",xce,d.toDisplayString(_.value),1)):b.value&&me.loadingOptionsHelper?(d.openBlock(),d.createElementBlock("div",Sce,d.toDisplayString(me.loadingOptionsHelper),1)):me.helper?(d.openBlock(),d.createElementBlock("div",Bce,d.toDisplayString(me.helper),1)):d.createCommentVNode("",!0)]))}});function GC(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Tce(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function vN(e){let t,n,r;e.length!==2?(t=GC,n=(s,c)=>GC(e(s),c),r=(s,c)=>e(s)-c):(t=e===GC||e===Tce?e:_ce,n=e,r=e);function a(s,c,f=0,A=s.length){if(f<A){if(t(c,c)!==0)return A;do{const h=f+A>>>1;n(s[h],c)<0?f=h+1:A=h}while(f<A)}return f}function i(s,c,f=0,A=s.length){if(f<A){if(t(c,c)!==0)return A;do{const h=f+A>>>1;n(s[h],c)<=0?f=h+1:A=h}while(f<A)}return f}function o(s,c,f=0,A=s.length){const h=a(s,c,f,A-1);return h>f&&r(s[h-1],c)>-r(s[h],c)?h-1:h}return{left:a,center:o,right:i}}function _ce(){return 0}function Pce(e){return e===null?NaN:+e}vN(GC),vN(Pce).center;var Mce={value:()=>{}};function gN(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new YC(n)}function YC(e){this._=e}function Dce(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}YC.prototype=gN.prototype={constructor:YC,on:function(e,t){var n=this._,r=Dce(e+"",n),a,i=-1,o=r.length;if(arguments.length<2){for(;++i<o;)if((a=(e=r[i]).type)&&(a=Hce(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(a=(e=r[i]).type)n[a]=yN(n[a],e.name,t);else if(t==null)for(a in n)n[a]=yN(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new YC(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,i;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,a=i.length;r<a;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,i=r.length;a<i;++a)r[a].value.apply(t,n)}};function Hce(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function yN(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=Mce,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var jS="http://www.w3.org/1999/xhtml";const wN={svg:"http://www.w3.org/2000/svg",xhtml:jS,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function WC(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),wN.hasOwnProperty(t)?{space:wN[t],local:e}:e}function Ice(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===jS&&t.documentElement.namespaceURI===jS?t.createElement(e):t.createElementNS(n,e)}}function Lce(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function CN(e){var t=WC(e);return(t.local?Lce:Ice)(t)}function Rce(){}function GS(e){return e==null?Rce:function(){return this.querySelector(e)}}function Nce(e){typeof e!="function"&&(e=GS(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,s=r[a]=new Array(o),c,f,A=0;A<o;++A)(c=i[A])&&(f=e.call(c,c.__data__,A,i))&&("__data__"in c&&(f.__data__=c.__data__),s[A]=f);return new Fp(r,this._parents)}function $ce(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Fce(){return[]}function bN(e){return e==null?Fce:function(){return this.querySelectorAll(e)}}function Vce(e){return function(){return $ce(e.apply(this,arguments))}}function Oce(e){typeof e=="function"?e=Vce(e):e=bN(e);for(var t=this._groups,n=t.length,r=[],a=[],i=0;i<n;++i)for(var o=t[i],s=o.length,c,f=0;f<s;++f)(c=o[f])&&(r.push(e.call(c,c.__data__,f,o)),a.push(c));return new Fp(r,a)}function EN(e){return function(){return this.matches(e)}}function xN(e){return function(t){return t.matches(e)}}var Qce=Array.prototype.find;function zce(e){return function(){return Qce.call(this.children,e)}}function Uce(){return this.firstElementChild}function jce(e){return this.select(e==null?Uce:zce(typeof e=="function"?e:xN(e)))}var Gce=Array.prototype.filter;function Yce(){return Array.from(this.children)}function Wce(e){return function(){return Gce.call(this.children,e)}}function Xce(e){return this.selectAll(e==null?Yce:Wce(typeof e=="function"?e:xN(e)))}function Kce(e){typeof e!="function"&&(e=EN(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,s=r[a]=[],c,f=0;f<o;++f)(c=i[f])&&e.call(c,c.__data__,f,i)&&s.push(c);return new Fp(r,this._parents)}function SN(e){return new Array(e.length)}function Zce(){return new Fp(this._enter||this._groups.map(SN),this._parents)}function XC(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}XC.prototype={constructor:XC,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Jce(e){return function(){return e}}function qce(e,t,n,r,a,i){for(var o=0,s,c=t.length,f=i.length;o<f;++o)(s=t[o])?(s.__data__=i[o],r[o]=s):n[o]=new XC(e,i[o]);for(;o<c;++o)(s=t[o])&&(a[o]=s)}function efe(e,t,n,r,a,i,o){var s,c,f=new Map,A=t.length,h=i.length,m=new Array(A),g;for(s=0;s<A;++s)(c=t[s])&&(m[s]=g=o.call(c,c.__data__,s,t)+"",f.has(g)?a[s]=c:f.set(g,c));for(s=0;s<h;++s)g=o.call(e,i[s],s,i)+"",(c=f.get(g))?(r[s]=c,c.__data__=i[s],f.delete(g)):n[s]=new XC(e,i[s]);for(s=0;s<A;++s)(c=t[s])&&f.get(m[s])===c&&(a[s]=c)}function tfe(e){return e.__data__}function nfe(e,t){if(!arguments.length)return Array.from(this,tfe);var n=t?efe:qce,r=this._parents,a=this._groups;typeof e!="function"&&(e=Jce(e));for(var i=a.length,o=new Array(i),s=new Array(i),c=new Array(i),f=0;f<i;++f){var A=r[f],h=a[f],m=h.length,g=rfe(e.call(A,A&&A.__data__,f,r)),b=g.length,C=s[f]=new Array(b),x=o[f]=new Array(b),k=c[f]=new Array(m);n(A,h,C,x,k,g,t);for(var _=0,D=0,O,I;_<b;++_)if(O=C[_]){for(_>=D&&(D=_+1);!(I=x[D])&&++D<b;);O._next=I||null}}return o=new Fp(o,r),o._enter=s,o._exit=c,o}function rfe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function afe(){return new Fp(this._exit||this._groups.map(SN),this._parents)}function ife(e,t,n){var r=this.enter(),a=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?i.remove():n(i),r&&a?r.merge(a).order():a}function ofe(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,i=r.length,o=Math.min(a,i),s=new Array(a),c=0;c<o;++c)for(var f=n[c],A=r[c],h=f.length,m=s[c]=new Array(h),g,b=0;b<h;++b)(g=f[b]||A[b])&&(m[b]=g);for(;c<a;++c)s[c]=n[c];return new Fp(s,this._parents)}function lfe(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,i=r[a],o;--a>=0;)(o=r[a])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function sfe(e){e||(e=ufe);function t(h,m){return h&&m?e(h.__data__,m.__data__):!h-!m}for(var n=this._groups,r=n.length,a=new Array(r),i=0;i<r;++i){for(var o=n[i],s=o.length,c=a[i]=new Array(s),f,A=0;A<s;++A)(f=o[A])&&(c[A]=f);c.sort(t)}return new Fp(a,this._parents).order()}function ufe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function cfe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ffe(){return Array.from(this)}function dfe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length;a<i;++a){var o=r[a];if(o)return o}return null}function Afe(){let e=0;for(const t of this)++e;return e}function pfe(){return!this.node()}function hfe(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],i=0,o=a.length,s;i<o;++i)(s=a[i])&&e.call(s,s.__data__,i,a);return this}function mfe(e){return function(){this.removeAttribute(e)}}function vfe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function gfe(e,t){return function(){this.setAttribute(e,t)}}function yfe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function wfe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Cfe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function bfe(e,t){var n=WC(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?vfe:mfe:typeof t=="function"?n.local?Cfe:wfe:n.local?yfe:gfe)(n,t))}function BN(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Efe(e){return function(){this.style.removeProperty(e)}}function xfe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Sfe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Bfe(e,t,n){return arguments.length>1?this.each((t==null?Efe:typeof t=="function"?Sfe:xfe)(e,t,n??"")):n3(this.node(),e)}function n3(e,t){return e.style.getPropertyValue(t)||BN(e).getComputedStyle(e,null).getPropertyValue(t)}function kfe(e){return function(){delete this[e]}}function Tfe(e,t){return function(){this[e]=t}}function _fe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Pfe(e,t){return arguments.length>1?this.each((t==null?kfe:typeof t=="function"?_fe:Tfe)(e,t)):this.node()[e]}function kN(e){return e.trim().split(/^|\s+/)}function YS(e){return e.classList||new TN(e)}function TN(e){this._node=e,this._names=kN(e.getAttribute("class")||"")}TN.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function _N(e,t){for(var n=YS(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function PN(e,t){for(var n=YS(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function Mfe(e){return function(){_N(this,e)}}function Dfe(e){return function(){PN(this,e)}}function Hfe(e,t){return function(){(t.apply(this,arguments)?_N:PN)(this,e)}}function Ife(e,t){var n=kN(e+"");if(arguments.length<2){for(var r=YS(this.node()),a=-1,i=n.length;++a<i;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?Hfe:t?Mfe:Dfe)(n,t))}function Lfe(){this.textContent=""}function Rfe(e){return function(){this.textContent=e}}function Nfe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function $fe(e){return arguments.length?this.each(e==null?Lfe:(typeof e=="function"?Nfe:Rfe)(e)):this.node().textContent}function Ffe(){this.innerHTML=""}function Vfe(e){return function(){this.innerHTML=e}}function Ofe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Qfe(e){return arguments.length?this.each(e==null?Ffe:(typeof e=="function"?Ofe:Vfe)(e)):this.node().innerHTML}function zfe(){this.nextSibling&&this.parentNode.appendChild(this)}function Ufe(){return this.each(zfe)}function jfe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Gfe(){return this.each(jfe)}function Yfe(e){var t=typeof e=="function"?e:CN(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Wfe(){return null}function Xfe(e,t){var n=typeof e=="function"?e:CN(e),r=t==null?Wfe:typeof t=="function"?t:GS(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Kfe(){var e=this.parentNode;e&&e.removeChild(this)}function Zfe(){return this.each(Kfe)}function Jfe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qfe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ede(e){return this.select(e?qfe:Jfe)}function tde(e){return arguments.length?this.property("__data__",e):this.node().__data__}function nde(e){return function(t){e.call(this,t,this.__data__)}}function rde(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ade(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,i;n<a;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function ide(e,t,n){return function(){var r=this.__on,a,i=nde(t);if(r){for(var o=0,s=r.length;o<s;++o)if((a=r[o]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=n),a.value=t;return}}this.addEventListener(e.type,i,n),a={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(a):this.__on=[a]}}function ode(e,t,n){var r=rde(e+""),a,i=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,f=s.length,A;c<f;++c)for(a=0,A=s[c];a<i;++a)if((o=r[a]).type===A.type&&o.name===A.name)return A.value}return}for(s=t?ide:ade,a=0;a<i;++a)this.each(s(r[a],t,n));return this}function MN(e,t,n){var r=BN(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function lde(e,t){return function(){return MN(this,e,t)}}function sde(e,t){return function(){return MN(this,e,t.apply(this,arguments))}}function ude(e,t){return this.each((typeof t=="function"?sde:lde)(e,t))}function*cde(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length,o;a<i;++a)(o=r[a])&&(yield o)}var fde=[null];function Fp(e,t){this._groups=e,this._parents=t}function g7(){return new Fp([[document.documentElement]],fde)}function dde(){return this}Fp.prototype=g7.prototype={constructor:Fp,select:Nce,selectAll:Oce,selectChild:jce,selectChildren:Xce,filter:Kce,data:nfe,enter:Zce,exit:afe,join:ife,merge:ofe,selection:dde,order:lfe,sort:sfe,call:cfe,nodes:ffe,node:dfe,size:Afe,empty:pfe,each:hfe,attr:bfe,style:Bfe,property:Pfe,classed:Ife,text:$fe,html:Qfe,raise:Ufe,lower:Gfe,append:Yfe,insert:Xfe,remove:Zfe,clone:ede,datum:tde,on:ode,dispatch:ude,[Symbol.iterator]:cde};function WS(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function DN(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function y7(){}var w7=.7,KC=1/w7,r3="\\s*([+-]?\\d+)\\s*",C7="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",N0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ade=/^#([0-9a-f]{3,8})$/,pde=new RegExp(`^rgb\\(${r3},${r3},${r3}\\)$`),hde=new RegExp(`^rgb\\(${N0},${N0},${N0}\\)$`),mde=new RegExp(`^rgba\\(${r3},${r3},${r3},${C7}\\)$`),vde=new RegExp(`^rgba\\(${N0},${N0},${N0},${C7}\\)$`),gde=new RegExp(`^hsl\\(${C7},${N0},${N0}\\)$`),yde=new RegExp(`^hsla\\(${C7},${N0},${N0},${C7}\\)$`),HN={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};WS(y7,b7,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:IN,formatHex:IN,formatHex8:wde,formatHsl:Cde,formatRgb:LN,toString:LN});function IN(){return this.rgb().formatHex()}function wde(){return this.rgb().formatHex8()}function Cde(){return VN(this).formatHsl()}function LN(){return this.rgb().formatRgb()}function b7(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ade.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?RN(t):n===3?new Dd(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ZC(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ZC(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=pde.exec(e))?new Dd(t[1],t[2],t[3],1):(t=hde.exec(e))?new Dd(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mde.exec(e))?ZC(t[1],t[2],t[3],t[4]):(t=vde.exec(e))?ZC(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=gde.exec(e))?FN(t[1],t[2]/100,t[3]/100,1):(t=yde.exec(e))?FN(t[1],t[2]/100,t[3]/100,t[4]):HN.hasOwnProperty(e)?RN(HN[e]):e==="transparent"?new Dd(NaN,NaN,NaN,0):null}function RN(e){return new Dd(e>>16&255,e>>8&255,e&255,1)}function ZC(e,t,n,r){return r<=0&&(e=t=n=NaN),new Dd(e,t,n,r)}function bde(e){return e instanceof y7||(e=b7(e)),e?(e=e.rgb(),new Dd(e.r,e.g,e.b,e.opacity)):new Dd}function XS(e,t,n,r){return arguments.length===1?bde(e):new Dd(e,t,n,r??1)}function Dd(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}WS(Dd,XS,DN(y7,{brighter(e){return e=e==null?KC:Math.pow(KC,e),new Dd(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?w7:Math.pow(w7,e),new Dd(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Dd(jv(this.r),jv(this.g),jv(this.b),JC(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:NN,formatHex:NN,formatHex8:Ede,formatRgb:$N,toString:$N}));function NN(){return`#${Gv(this.r)}${Gv(this.g)}${Gv(this.b)}`}function Ede(){return`#${Gv(this.r)}${Gv(this.g)}${Gv(this.b)}${Gv((isNaN(this.opacity)?1:this.opacity)*255)}`}function $N(){const e=JC(this.opacity);return`${e===1?"rgb(":"rgba("}${jv(this.r)}, ${jv(this.g)}, ${jv(this.b)}${e===1?")":`, ${e})`}`}function JC(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function jv(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gv(e){return e=jv(e),(e<16?"0":"")+e.toString(16)}function FN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vp(e,t,n,r)}function VN(e){if(e instanceof Vp)return new Vp(e.h,e.s,e.l,e.opacity);if(e instanceof y7||(e=b7(e)),!e)return new Vp;if(e instanceof Vp)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,s=i-a,c=(i+a)/2;return s?(t===i?o=(n-r)/s+(n<r)*6:n===i?o=(r-t)/s+2:o=(t-n)/s+4,s/=c<.5?i+a:2-i-a,o*=60):s=c>0&&c<1?0:o,new Vp(o,s,c,e.opacity)}function xde(e,t,n,r){return arguments.length===1?VN(e):new Vp(e,t,n,r??1)}function Vp(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}WS(Vp,xde,DN(y7,{brighter(e){return e=e==null?KC:Math.pow(KC,e),new Vp(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?w7:Math.pow(w7,e),new Vp(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new Dd(KS(e>=240?e-240:e+120,a,r),KS(e,a,r),KS(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Vp(ON(this.h),qC(this.s),qC(this.l),JC(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=JC(this.opacity);return`${e===1?"hsl(":"hsla("}${ON(this.h)}, ${qC(this.s)*100}%, ${qC(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ON(e){return e=(e||0)%360,e<0?e+360:e}function qC(e){return Math.max(0,Math.min(1,e||0))}function KS(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const QN=e=>()=>e;function Sde(e,t){return function(n){return e+n*t}}function Bde(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function kde(e){return(e=+e)==1?zN:function(t,n){return n-t?Bde(t,n,e):QN(isNaN(t)?n:t)}}function zN(e,t){var n=t-e;return n?Sde(e,n):QN(isNaN(e)?t:e)}const UN=function e(t){var n=kde(t);function r(a,i){var o=n((a=XS(a)).r,(i=XS(i)).r),s=n(a.g,i.g),c=n(a.b,i.b),f=zN(a.opacity,i.opacity);return function(A){return a.r=o(A),a.g=s(A),a.b=c(A),a.opacity=f(A),a+""}}return r.gamma=e,r}(1);function sm(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var ZS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,JS=new RegExp(ZS.source,"g");function Tde(e){return function(){return e}}function _de(e){return function(t){return e(t)+""}}function Pde(e,t){var n=ZS.lastIndex=JS.lastIndex=0,r,a,i,o=-1,s=[],c=[];for(e=e+"",t=t+"";(r=ZS.exec(e))&&(a=JS.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(a=a[0])?s[o]?s[o]+=a:s[++o]=a:(s[++o]=null,c.push({i:o,x:sm(r,a)})),n=JS.lastIndex;return n<t.length&&(i=t.slice(n),s[o]?s[o]+=i:s[++o]=i),s.length<2?c[0]?_de(c[0].x):Tde(t):(t=c.length,function(f){for(var A=0,h;A<t;++A)s[(h=c[A]).i]=h.x(f);return s.join("")})}var jN=180/Math.PI,GN={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function YN(e,t,n,r,a,i){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*jN,skewX:Math.atan(c)*jN,scaleX:o,scaleY:s}}var eb;function Mde(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?GN:YN(t.a,t.b,t.c,t.d,t.e,t.f)}function Dde(e){return e==null||(eb||(eb=document.createElementNS("http://www.w3.org/2000/svg","g")),eb.setAttribute("transform",e),!(e=eb.transform.baseVal.consolidate()))?GN:(e=e.matrix,YN(e.a,e.b,e.c,e.d,e.e,e.f))}function WN(e,t,n,r){function a(f){return f.length?f.pop()+" ":""}function i(f,A,h,m,g,b){if(f!==h||A!==m){var C=g.push("translate(",null,t,null,n);b.push({i:C-4,x:sm(f,h)},{i:C-2,x:sm(A,m)})}else(h||m)&&g.push("translate("+h+t+m+n)}function o(f,A,h,m){f!==A?(f-A>180?A+=360:A-f>180&&(f+=360),m.push({i:h.push(a(h)+"rotate(",null,r)-2,x:sm(f,A)})):A&&h.push(a(h)+"rotate("+A+r)}function s(f,A,h,m){f!==A?m.push({i:h.push(a(h)+"skewX(",null,r)-2,x:sm(f,A)}):A&&h.push(a(h)+"skewX("+A+r)}function c(f,A,h,m,g,b){if(f!==h||A!==m){var C=g.push(a(g)+"scale(",null,",",null,")");b.push({i:C-4,x:sm(f,h)},{i:C-2,x:sm(A,m)})}else(h!==1||m!==1)&&g.push(a(g)+"scale("+h+","+m+")")}return function(f,A){var h=[],m=[];return f=e(f),A=e(A),i(f.translateX,f.translateY,A.translateX,A.translateY,h,m),o(f.rotate,A.rotate,h,m),s(f.skewX,A.skewX,h,m),c(f.scaleX,f.scaleY,A.scaleX,A.scaleY,h,m),f=A=null,function(g){for(var b=-1,C=m.length,x;++b<C;)h[(x=m[b]).i]=x.x(g);return h.join("")}}}var Hde=WN(Mde,"px, ","px)","deg)"),Ide=WN(Dde,", ",")",")"),a3=0,E7=0,x7=0,XN=1e3,tb,S7,nb=0,Yv=0,rb=0,B7=typeof performance=="object"&&performance.now?performance:Date,KN=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function qS(){return Yv||(KN(Lde),Yv=B7.now()+rb)}function Lde(){Yv=0}function ab(){this._call=this._time=this._next=null}ab.prototype=ZN.prototype={constructor:ab,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?qS():+n)+(t==null?0:+t),!this._next&&S7!==this&&(S7?S7._next=this:tb=this,S7=this),this._call=e,this._time=n,eB()},stop:function(){this._call&&(this._call=null,this._time=1/0,eB())}};function ZN(e,t,n){var r=new ab;return r.restart(e,t,n),r}function Rde(){qS(),++a3;for(var e=tb,t;e;)(t=Yv-e._time)>=0&&e._call.call(void 0,t),e=e._next;--a3}function JN(){Yv=(nb=B7.now())+rb,a3=E7=0;try{Rde()}finally{a3=0,$de(),Yv=0}}function Nde(){var e=B7.now(),t=e-nb;t>XN&&(rb-=t,nb=e)}function $de(){for(var e,t=tb,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:tb=n);S7=e,eB(r)}function eB(e){if(!a3){E7&&(E7=clearTimeout(E7));var t=e-Yv;t>24?(e<1/0&&(E7=setTimeout(JN,e-B7.now()-rb)),x7&&(x7=clearInterval(x7))):(x7||(nb=B7.now(),x7=setInterval(Nde,XN)),a3=1,KN(JN))}}function qN(e,t,n){var r=new ab;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var Fde=gN("start","end","cancel","interrupt"),Vde=[],e$=0,t$=1,tB=2,ib=3,n$=4,nB=5,ob=6;function lb(e,t,n,r,a,i){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Ode(e,n,{name:t,index:r,group:a,on:Fde,tween:Vde,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:e$})}function rB(e,t){var n=Op(e,t);if(n.state>e$)throw new Error("too late; already scheduled");return n}function $0(e,t){var n=Op(e,t);if(n.state>ib)throw new Error("too late; already running");return n}function Op(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Ode(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=ZN(i,0,n.time);function i(f){n.state=t$,n.timer.restart(o,n.delay,n.time),n.delay<=f&&o(f-n.delay)}function o(f){var A,h,m,g;if(n.state!==t$)return c();for(A in r)if(g=r[A],g.name===n.name){if(g.state===ib)return qN(o);g.state===n$?(g.state=ob,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[A]):+A<t&&(g.state=ob,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[A])}if(qN(function(){n.state===ib&&(n.state=n$,n.timer.restart(s,n.delay,n.time),s(f))}),n.state=tB,n.on.call("start",e,e.__data__,n.index,n.group),n.state===tB){for(n.state=ib,a=new Array(m=n.tween.length),A=0,h=-1;A<m;++A)(g=n.tween[A].value.call(e,e.__data__,n.index,n.group))&&(a[++h]=g);a.length=h+1}}function s(f){for(var A=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=nB,1),h=-1,m=a.length;++h<m;)a[h].call(e,A);n.state===nB&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=ob,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Qde(e,t){var n=e.__transition,r,a,i=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){i=!1;continue}a=r.state>tB&&r.state<nB,r.state=ob,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}i&&delete e.__transition}}function zde(e){return this.each(function(){Qde(this,e)})}function Ude(e,t){var n,r;return function(){var a=$0(this,e),i=a.tween;if(i!==n){r=n=i;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}a.tween=r}}function jde(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var i=$0(this,e),o=i.tween;if(o!==r){a=(r=o).slice();for(var s={name:t,value:n},c=0,f=a.length;c<f;++c)if(a[c].name===t){a[c]=s;break}c===f&&a.push(s)}i.tween=a}}function Gde(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Op(this.node(),n).tween,a=0,i=r.length,o;a<i;++a)if((o=r[a]).name===e)return o.value;return null}return this.each((t==null?Ude:jde)(n,e,t))}function aB(e,t,n){var r=e._id;return e.each(function(){var a=$0(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return Op(a,r).value[t]}}function r$(e,t){var n;return(typeof t=="number"?sm:t instanceof b7?UN:(n=b7(t))?(t=n,UN):Pde)(e,t)}function Yde(e){return function(){this.removeAttribute(e)}}function Wde(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xde(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttribute(e);return o===a?null:o===r?i:i=t(r=o,n)}}function Kde(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===a?null:o===r?i:i=t(r=o,n)}}function Zde(e,t,n){var r,a,i;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+"",o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,s)))}}function Jde(e,t,n){var r,a,i;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+"",o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,s)))}}function qde(e,t){var n=WC(e),r=n==="transform"?Ide:r$;return this.attrTween(e,typeof t=="function"?(n.local?Jde:Zde)(n,r,aB(this,"attr."+e,t)):t==null?(n.local?Wde:Yde)(n):(n.local?Kde:Xde)(n,r,t))}function eAe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function tAe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function nAe(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&tAe(e,i)),n}return a._value=t,a}function rAe(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&eAe(e,i)),n}return a._value=t,a}function aAe(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=WC(e);return this.tween(n,(r.local?nAe:rAe)(r,t))}function iAe(e,t){return function(){rB(this,e).delay=+t.apply(this,arguments)}}function oAe(e,t){return t=+t,function(){rB(this,e).delay=t}}function lAe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?iAe:oAe)(t,e)):Op(this.node(),t).delay}function sAe(e,t){return function(){$0(this,e).duration=+t.apply(this,arguments)}}function uAe(e,t){return t=+t,function(){$0(this,e).duration=t}}function cAe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?sAe:uAe)(t,e)):Op(this.node(),t).duration}function fAe(e,t){if(typeof t!="function")throw new Error;return function(){$0(this,e).ease=t}}function dAe(e){var t=this._id;return arguments.length?this.each(fAe(t,e)):Op(this.node(),t).ease}function AAe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;$0(this,e).ease=n}}function pAe(e){if(typeof e!="function")throw new Error;return this.each(AAe(this._id,e))}function hAe(e){typeof e!="function"&&(e=EN(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,s=r[a]=[],c,f=0;f<o;++f)(c=i[f])&&e.call(c,c.__data__,f,i)&&s.push(c);return new Vh(r,this._parents,this._name,this._id)}function mAe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,i=Math.min(r,a),o=new Array(r),s=0;s<i;++s)for(var c=t[s],f=n[s],A=c.length,h=o[s]=new Array(A),m,g=0;g<A;++g)(m=c[g]||f[g])&&(h[g]=m);for(;s<r;++s)o[s]=t[s];return new Vh(o,this._parents,this._name,this._id)}function vAe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function gAe(e,t,n){var r,a,i=vAe(t)?rB:$0;return function(){var o=i(this,e),s=o.on;s!==r&&(a=(r=s).copy()).on(t,n),o.on=a}}function yAe(e,t){var n=this._id;return arguments.length<2?Op(this.node(),n).on.on(e):this.each(gAe(n,e,t))}function wAe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function CAe(){return this.on("end.remove",wAe(this._id))}function bAe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=GS(e));for(var r=this._groups,a=r.length,i=new Array(a),o=0;o<a;++o)for(var s=r[o],c=s.length,f=i[o]=new Array(c),A,h,m=0;m<c;++m)(A=s[m])&&(h=e.call(A,A.__data__,m,s))&&("__data__"in A&&(h.__data__=A.__data__),f[m]=h,lb(f[m],t,n,m,f,Op(A,n)));return new Vh(i,this._parents,t,n)}function EAe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bN(e));for(var r=this._groups,a=r.length,i=[],o=[],s=0;s<a;++s)for(var c=r[s],f=c.length,A,h=0;h<f;++h)if(A=c[h]){for(var m=e.call(A,A.__data__,h,c),g,b=Op(A,n),C=0,x=m.length;C<x;++C)(g=m[C])&&lb(g,t,n,C,m,b);i.push(m),o.push(A)}return new Vh(i,o,t,n)}var xAe=g7.prototype.constructor;function SAe(){return new xAe(this._groups,this._parents)}function BAe(e,t){var n,r,a;return function(){var i=n3(this,e),o=(this.style.removeProperty(e),n3(this,e));return i===o?null:i===n&&o===r?a:a=t(n=i,r=o)}}function a$(e){return function(){this.style.removeProperty(e)}}function kAe(e,t,n){var r,a=n+"",i;return function(){var o=n3(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}function TAe(e,t,n){var r,a,i;return function(){var o=n3(this,e),s=n(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),n3(this,e))),o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,s))}}function _Ae(e,t){var n,r,a,i="style."+t,o="end."+i,s;return function(){var c=$0(this,e),f=c.on,A=c.value[i]==null?s||(s=a$(t)):void 0;(f!==n||a!==A)&&(r=(n=f).copy()).on(o,a=A),c.on=r}}function PAe(e,t,n){var r=(e+="")=="transform"?Hde:r$;return t==null?this.styleTween(e,BAe(e,r)).on("end.style."+e,a$(e)):typeof t=="function"?this.styleTween(e,TAe(e,r,aB(this,"style."+e,t))).each(_Ae(this._id,e)):this.styleTween(e,kAe(e,r,t),n).on("end.style."+e,null)}function MAe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function DAe(e,t,n){var r,a;function i(){var o=t.apply(this,arguments);return o!==a&&(r=(a=o)&&MAe(e,o,n)),r}return i._value=t,i}function HAe(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,DAe(e,t,n??""))}function IAe(e){return function(){this.textContent=e}}function LAe(e){return function(){var t=e(this);this.textContent=t??""}}function RAe(e){return this.tween("text",typeof e=="function"?LAe(aB(this,"text",e)):IAe(e==null?"":e+""))}function NAe(e){return function(t){this.textContent=e.call(this,t)}}function $Ae(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&NAe(a)),t}return r._value=e,r}function FAe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,$Ae(e))}function VAe(){for(var e=this._name,t=this._id,n=i$(),r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],s=o.length,c,f=0;f<s;++f)if(c=o[f]){var A=Op(c,t);lb(c,e,n,f,o,{time:A.time+A.delay+A.duration,delay:0,duration:A.duration,ease:A.ease})}return new Vh(r,this._parents,e,n)}function OAe(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(i,o){var s={value:o},c={value:function(){--a===0&&i()}};n.each(function(){var f=$0(this,r),A=f.on;A!==e&&(t=(e=A).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),f.on=t}),a===0&&i()})}var QAe=0;function Vh(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function i$(){return++QAe}var Oh=g7.prototype;Vh.prototype={constructor:Vh,select:bAe,selectAll:EAe,selectChild:Oh.selectChild,selectChildren:Oh.selectChildren,filter:hAe,merge:mAe,selection:SAe,transition:VAe,call:Oh.call,nodes:Oh.nodes,node:Oh.node,size:Oh.size,empty:Oh.empty,each:Oh.each,on:yAe,attr:qde,attrTween:aAe,style:PAe,styleTween:HAe,text:RAe,textTween:FAe,remove:CAe,tween:Gde,delay:lAe,duration:cAe,ease:dAe,easeVarying:pAe,end:OAe,[Symbol.iterator]:Oh[Symbol.iterator]};function zAe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var UAe={time:null,delay:0,duration:250,ease:zAe};function jAe(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function GAe(e){var t,n;e instanceof Vh?(t=e._id,e=e._name):(t=i$(),(n=UAe).time=qS(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],s=o.length,c,f=0;f<s;++f)(c=o[f])&&lb(c,e,t,f,o,n||jAe(c,t));return new Vh(r,this._parents,e,t)}g7.prototype.interrupt=zde,g7.prototype.transition=GAe;function YAe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function sb(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function WAe(e){return e=sb(Math.abs(e)),e?e[1]:NaN}function XAe(e,t){return function(n,r){for(var a=n.length,i=[],o=0,s=e[0],c=0;a>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),i.push(n.substring(a-=s,a+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return i.reverse().join(t)}}function KAe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var ZAe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function iB(e){if(!(t=ZAe.exec(e)))throw new Error("invalid format: "+e);var t;return new oB({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}iB.prototype=oB.prototype;function oB(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}oB.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function JAe(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var o$;function qAe(e,t){var n=sb(e,t);if(!n)return e+"";var r=n[0],a=n[1],i=a-(o$=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+sb(e,Math.max(0,t+i-1))[0]}function l$(e,t){var n=sb(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const s$={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:YAe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>l$(e*100,t),r:l$,s:qAe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function u$(e){return e}var c$=Array.prototype.map,f$=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function epe(e){var t=e.grouping===void 0||e.thousands===void 0?u$:XAe(c$.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?u$:KAe(c$.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function f(h){h=iB(h);var m=h.fill,g=h.align,b=h.sign,C=h.symbol,x=h.zero,k=h.width,_=h.comma,D=h.precision,O=h.trim,I=h.type;I==="n"?(_=!0,I="g"):s$[I]||(D===void 0&&(D=12),O=!0,I="g"),(x||m==="0"&&g==="=")&&(x=!0,m="0",g="=");var $=C==="$"?n:C==="#"&&/[boxX]/.test(I)?"0"+I.toLowerCase():"",Q=C==="$"?r:/[%p]/.test(I)?o:"",ee=s$[I],K=/[defgprs%]/.test(I);D=D===void 0?6:/[gprs]/.test(I)?Math.max(1,Math.min(21,D)):Math.max(0,Math.min(20,D));function re(U){var G=$,Z=Q,Y,X,oe;if(I==="c")Z=ee(U)+Z,U="";else{U=+U;var me=U<0||1/U<0;if(U=isNaN(U)?c:ee(Math.abs(U),D),O&&(U=JAe(U)),me&&+U==0&&b!=="+"&&(me=!1),G=(me?b==="("?b:s:b==="-"||b==="("?"":b)+G,Z=(I==="s"?f$[8+o$/3]:"")+Z+(me&&b==="("?")":""),K){for(Y=-1,X=U.length;++Y<X;)if(oe=U.charCodeAt(Y),48>oe||oe>57){Z=(oe===46?a+U.slice(Y+1):U.slice(Y))+Z,U=U.slice(0,Y);break}}}_&&!x&&(U=t(U,1/0));var ae=G.length+U.length+Z.length,ye=ae<k?new Array(k-ae+1).join(m):"";switch(_&&x&&(U=t(ye+U,ye.length?k-Z.length:1/0),ye=""),g){case"<":U=G+U+Z+ye;break;case"=":U=G+ye+U+Z;break;case"^":U=ye.slice(0,ae=ye.length>>1)+G+U+Z+ye.slice(ae);break;default:U=ye+G+U+Z;break}return i(U)}return re.toString=function(){return h+""},re}function A(h,m){var g=f((h=iB(h),h.type="f",h)),b=Math.max(-8,Math.min(8,Math.floor(WAe(m)/3)))*3,C=Math.pow(10,-b),x=f$[8+b/3];return function(k){return g(C*k)+x}}return{format:f,formatPrefix:A}}var ub;tpe({thousands:",",grouping:[3],currency:["$",""]});function tpe(e){return ub=epe(e),ub.format,ub.formatPrefix,ub}function k7(e,t,n){this.k=e,this.x=t,this.y=n}k7.prototype={constructor:k7,scale:function(e){return e===1?this:new k7(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new k7(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},k7.prototype;const npe={ref:"chipRoot",class:"dnd-double-chip__group"},rpe={class:"dnd-double-chip__top"},ape={key:0,class:"dnd-basket-chip__handler"},ipe=["title"],ope={class:"dnd-double-chip__title"},lpe=["innerHTML"],spe={class:"dnd-double-chip__bottom"},upe={key:0,class:"dnd-basket-chip__fixed-axes-block"},cpe=d.defineComponent({__name:"DndDoubleChip",props:d.mergeModels({info:{},error:{type:Boolean},searchOptions:{type:Function},sortable:{type:Boolean}},{filter:{required:!0},filterModifiers:{},fixedAxes:{default:{}},fixedAxesModifiers:{}}),emits:d.mergeModels(["close-chip","update:filter","update:fixedAxes"],["update:filter","update:fixedAxes"]),setup(e,{emit:t}){var c;const n=e,r=t,a=da(),i=d.useModel(e,"filter"),o=d.useModel(e,"fixedAxes"),s=d.ref((c=a.value.uniqueValuesData.value[n.info.id])==null?void 0:c.options);return d.watch(()=>a.value.uniqueValuesData.value,f=>{var h;const A=(h=f[n.info.id])==null?void 0:h.options;A&&(s.value=A),n.info.axesToBeFixed.forEach(m=>{o.value[m].axisValue===void 0&&f[m]&&(o.value[m].axisValue=f[m].list[0],r("update:fixedAxes",o.value))})},{immediate:!0}),d.watch(()=>s.value,async f=>{!f||!f.length||i.value===void 0&&(i.value=f[0].value)},{immediate:!0}),(f,A)=>(d.openBlock(),d.createElementBlock("div",npe,[d.createElementVNode("div",{class:d.normalizeClass([{error:f.error,sortable:f.sortable},"dnd-double-chip"])},[d.createElementVNode("div",rpe,[d.createElementVNode("div",{class:d.normalizeClass(["dnd-double-chip__icon",{error:f.error}])},[f.error?(d.openBlock(),d.createBlock(d.unref(pt.PlMaskIcon16),{key:0,name:"warning"})):(d.openBlock(),d.createBlock(d.unref(q5),{key:1,name:f.info.isSubsetFilter?"cell-type-subset":f.info.type==="String"?"cell-type-txt":"cell-type-num"},null,8,["name"]))],2),f.sortable?(d.openBlock(),d.createElementBlock("div",ape)):d.createCommentVNode("",!0),d.createVNode(d.unref(pt.PlMaskIcon16),{name:"drag-dots"}),d.createElementVNode("div",{class:"dnd-double-chip__title-wrapper",title:f.info.title},[d.createElementVNode("div",ope,d.toDisplayString(f.info.title),1)],8,ipe),d.createElementVNode("div",{innerHTML:d.unref(HS),class:"dnd-double-chip__icon-close",onClick:A[0]||(A[0]=h=>f.$emit("close-chip",n.info.id))},null,8,lpe)]),d.createElementVNode("div",spe,[s.value===void 0||s.value.length<1e3?(d.openBlock(),d.createBlock(d.unref(pt.PlDropdown),{key:0,modelValue:i.value,"onUpdate:modelValue":A[1]||(A[1]=h=>i.value=h),options:s.value},null,8,["modelValue","options"])):(d.openBlock(),d.createBlock(d.unref(jC),{key:1,modelValue:i.value,"onUpdate:modelValue":A[2]||(A[2]=h=>i.value=h),"options-search":h=>f.searchOptions(n.info.id,h)},null,8,["modelValue","options-search"]))])],2),f.info.axesToBeFixed.length>0?(d.openBlock(),d.createElementBlock("div",upe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.info.axesToBeFixed,h=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:h},[o.value[h]?(d.openBlock(),d.createBlock(d.unref(jC),{key:0,modelValue:o.value[h].axisValue,"onUpdate:modelValue":[m=>o.value[h].axisValue=m,A[3]||(A[3]=m=>f.$emit("update:fixedAxes",o.value))],"options-search":m=>f.searchOptions(h,m),label:f.info.axesToBeFixedInfo[h].title},null,8,["modelValue","onUpdate:modelValue","options-search","label"])):d.createCommentVNode("",!0)],64))),128))])):d.createCommentVNode("",!0)],512))}}),fpe={key:0,class:"dnd-basket-chip__handler"},dpe={class:"dnd-basket-chip__title-wrapper"},Ape=["title"],ppe=["title"],hpe=["innerHTML"],mpe={key:0,class:"dnd-basket-chip__fixed-axes-block"},vpe=d.defineComponent({__name:"DnDBasketChip",props:d.mergeModels({error:{type:Boolean},info:{},sortable:{type:Boolean},searchOptions:{type:Function}},{modelValue:{default:{}},modelModifiers:{}}),emits:d.mergeModels(["close-chip","update:modelValue"],["update:modelValue"]),setup(e,{emit:t}){const n=e,r=da(),a=d.useModel(e,"modelValue"),i=t,o=d.ref(),s=d.computed(()=>n.info.uniqueValues.join("/"));function c(){i("close-chip",n.info.id)}return d.watch(()=>r.value.uniqueValuesData.value,f=>{n.info.axesToBeFixed.forEach(A=>{a.value[A].axisValue===void 0&&f[A]&&(a.value[A].axisValue=f[A].list[0],i("update:modelValue",a.value))})},{immediate:!0}),(f,A)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"chipRoot",ref:o,class:"dnd-basket-chip__group"},[d.createElementVNode("div",{class:d.normalizeClass([{error:f.error,sortable:f.sortable},"dnd-basket-chip"])},[d.createElementVNode("div",{class:d.normalizeClass(["dnd-basket-chip__icon",{error:f.error}])},[f.error?(d.openBlock(),d.createBlock(d.unref(WR),{key:0,name:"warning"})):(d.openBlock(),d.createBlock(d.unref(q5),{key:1,name:f.info.isSubsetFilter?"cell-type-subset":f.info.type==="String"?"cell-type-txt":"cell-type-num"},null,8,["name"]))],2),f.sortable?(d.openBlock(),d.createElementBlock("div",fpe)):d.createCommentVNode("",!0),d.createVNode(d.unref(WR),{name:"drag-dots"}),d.createElementVNode("div",dpe,[d.createElementVNode("div",{class:"dnd-basket-chip__title",title:f.info.title},d.toDisplayString(f.info.title),9,Ape),f.info.nonHomogenous?(d.openBlock(),d.createElementBlock("div",{key:0,class:"dnd-basket-chip__sub-title",title:s.value},d.toDisplayString(s.value),9,ppe)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{innerHTML:d.unref(HS),class:"dnd-basket-chip__icon-close",onClick:c},null,8,hpe)],2),f.info.axesToBeFixed.length>0?(d.openBlock(),d.createElementBlock("div",mpe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.info.axesToBeFixed,h=>(d.openBlock(),d.createBlock(d.unref(jC),{key:h,modelValue:a.value[h].axisValue,"onUpdate:modelValue":[m=>a.value[h].axisValue=m,A[0]||(A[0]=m=>f.$emit("update:modelValue",a.value))],"options-search":m=>f.searchOptions(h,m),label:f.info.axesToBeFixedInfo[h].title},null,8,["modelValue","onUpdate:modelValue","options-search","label"]))),128))])):d.createCommentVNode("",!0)],512))}}),gpe={ref:"chipRoot",class:"dnd-double-chip__group"},ype={class:"dnd-double-chip__top"},wpe={class:"dnd-double-chip__icon"},Cpe=["title"],bpe={class:"dnd-double-chip__title"},Epe=["innerHTML"],xpe={class:"dnd-double-chip__bottom-range"},Spe={class:"dnd-double-chip__bottom-range-row"},Bpe={class:"dnd-double-chip__bottom-range-row"},kpe={key:0,class:"dnd-basket-chip__fixed-axes-block"},Tpe=d.defineComponent({__name:"DnDRangeChip",props:d.mergeModels({info:{},error:{type:Boolean},searchOptions:{type:Function}},{filter:{required:!0},filterModifiers:{},fixedAxes:{required:!0},fixedAxesModifiers:{}}),emits:d.mergeModels(["close-chip","update:fixedAxes"],["update:filter","update:fixedAxes"]),setup(e,{emit:t}){var c,f;const n=e,r=da(),a=t,i=d.useModel(e,"filter"),o=d.useModel(e,"fixedAxes"),s=d.reactive({min:(c=i.value)==null?void 0:c[0],max:(f=i.value)==null?void 0:f[1]});return d.watch(()=>s,A=>{i.value=A},{deep:!0}),d.watch(()=>r.value.uniqueValuesData.value,A=>{n.info.axesToBeFixed.forEach(h=>{o.value[h].axisValue===void 0&&A[h]&&(o.value[h].axisValue=A[h].list[0],a("update:fixedAxes",o.value))})},{immediate:!0}),(A,h)=>(d.openBlock(),d.createElementBlock("div",gpe,[d.createElementVNode("div",{class:d.normalizeClass([{error:A.error},"dnd-double-chip"])},[d.createElementVNode("div",ype,[d.createElementVNode("div",wpe,[d.createVNode(d.unref(q5),{name:"cell-type-num"})]),d.createElementVNode("div",{class:"dnd-double-chip__title-wrapper",title:A.info.title},[d.createElementVNode("div",bpe,d.toDisplayString(A.info.title),1)],8,Cpe),d.createElementVNode("div",{innerHTML:d.unref(HS),class:"dnd-double-chip__icon-close",onClick:h[0]||(h[0]=m=>A.$emit("close-chip",n.info.id))},null,8,Epe)]),d.createElementVNode("div",xpe,[d.createElementVNode("div",Spe,[d.createVNode(d.unref(pt.PlNumberField),{label:"Min",modelValue:s.min,"onUpdate:modelValue":h[1]||(h[1]=m=>s.min=m),updateOnEnterOrClickOutside:!0,useIncrementButtons:!1},null,8,["modelValue"])]),d.createElementVNode("div",Bpe,[d.createVNode(d.unref(pt.PlNumberField),{label:"Max",modelValue:s.max,"onUpdate:modelValue":h[2]||(h[2]=m=>s.max=m),updateOnEnterOrClickOutside:!0,useIncrementButtons:!1},null,8,["modelValue"])])])],2),A.info.axesToBeFixed.length>0?(d.openBlock(),d.createElementBlock("div",kpe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(A.info.axesToBeFixed,m=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:m},[o.value[m]?(d.openBlock(),d.createBlock(d.unref(jC),{key:0,modelValue:o.value[m].axisValue,"onUpdate:modelValue":[g=>o.value[m].axisValue=g,h[3]||(h[3]=g=>A.$emit("update:fixedAxes",o.value))],"options-search":g=>A.searchOptions(m,g),label:A.info.axesToBeFixedInfo[m].title},null,8,["modelValue","onUpdate:modelValue","options-search","label"])):d.createCommentVNode("",!0)],64))),128))])):d.createCommentVNode("",!0)],512))}}),_pe={class:"dnd-basket__title"},Ppe={key:0,class:"dnd-basket__required"},Mpe={class:"dnd-basket__drop-container"},Dpe={key:0,class:"dnd-basket__placeholder"},Hpe=100,Wv=d.defineComponent({__name:"DndBasket",props:{id:{},title:{},multiple:{type:Boolean},isFilter:{type:Boolean},required:{type:Boolean},disabled:{type:Boolean},readonly:{type:Boolean},consistency:{},labelsInfo:{},droppedIds:{},availableIds:{},selectedFilters:{},selectedRanges:{},fixedAxes:{},info:{},draggedId:{},sortable:{type:Boolean}},emits:["drop-item","remove-item","select-filter-value","select-filter-range","select-fixed-axis-value","reorder"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.ref(),o=d.ref(0);let s=d.reactive(n.selectedFilters??{}),c=d.reactive(n.selectedRanges??{}),f=d.reactive(n.fixedAxes??{});const A=d.computed(()=>!(n.disabled||!n.multiple&&n.droppedIds.length>0)),h=d.computed(()=>n.disabled?"1 true":!A.value&&n.draggedId?"2 true":!1);d.watch(()=>n.selectedFilters,()=>{s=d.reactive(n.selectedFilters??{})}),d.watch(()=>n.fixedAxes,()=>{f=d.reactive(n.fixedAxes??{})}),d.watch(()=>n.droppedIds,()=>{o.value++},{deep:!0}),n.sortable&&pt.useSortable(i,{handle:".dnd-basket-chip__handler",onChange(_){r("reorder",_.map(D=>n.droppedIds[D]))}});function m(){a.value&&!n.disabled&&A.value&&a.value.classList.add("active")}function g(){a.value&&a.value.classList.remove("active")}function b(_){_.stopPropagation(),A.value&&(n.draggedId&&r("drop-item",{draggedId:n.draggedId,id:n.id}),g())}function C(_){_.preventDefault()}function x(_){_.preventDefault(),m()}const k=async(_,D)=>{var $;const O=(($=n.labelsInfo[_])==null?void 0:$.options)??[],I=D.toLowerCase();return O.filter(Q=>Q.value.toLowerCase().includes(I)||Q.label.toLowerCase().includes(I)).slice(0,Hpe)};return(_,D)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"basketRoot",ref:a,class:d.normalizeClass([{disabled:h.value,empty:_.droppedIds.length===0,readonly:_.readonly},"dnd-basket"]),dropzone:"true",onDrop:b,onDragenter:C,onDragover:x,onDragleave:g},[d.createElementVNode("div",_pe,[_.required?(d.openBlock(),d.createElementBlock("span",Ppe,D[0]||(D[0]=[d.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"16",viewBox:"0 0 6 16",fill:"none"},[d.createElementVNode("path",{d:"M2.01685 6.8L3 5.34159L3.97612 6.8L4.89607 6.12743L3.81461 4.7469L5.5 4.25133L5.14888 3.16106L3.50562 3.77699L3.56882 2H2.43118L2.49438 3.77699L0.851124 3.16106L0.5 4.25133L2.18539 4.7469L1.09691 6.12743L2.01685 6.8Z",fill:"#F1222F"})],-1)]))):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(_.title),1)]),d.createElementVNode("div",Mpe,[_.droppedIds.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Dpe," Drop dimensions here ")),(d.openBlock(),d.createElementBlock("div",{ref_key:"listRef",ref:i,key:o.value,class:"dnd-basket__chip-wrapper"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(_.droppedIds,(O,I)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:O},[!_.isFilter||_.info[O].isSubsetFilter?(d.openBlock(),d.createBlock(vpe,{key:0,modelValue:d.unref(f)[O],"onUpdate:modelValue":[$=>d.unref(f)[O]=$,$=>_.$emit("select-fixed-axis-value",{v:$,idx:I})],sortable:_.sortable,error:_.consistency[O]===!1,info:_.info[O],"search-options":k,onCloseChip:$=>_.$emit("remove-item",{chipId:O,basketId:_.id})},null,8,["modelValue","onUpdate:modelValue","sortable","error","info","onCloseChip"])):_.info[O].isDiscreteFilter?(d.openBlock(),d.createBlock(cpe,{key:1,filter:d.unref(s)[O],"onUpdate:filter":[$=>d.unref(s)[O]=$,$=>_.$emit("select-filter-value",{v:$,idx:I})],"fixed-axes":d.unref(f)[O],"onUpdate:fixedAxes":[$=>d.unref(f)[O]=$,$=>_.$emit("select-fixed-axis-value",{v:$,idx:I})],info:_.info[O],error:_.consistency[O]===!1,sortable:_.sortable,"search-options":k,onCloseChip:$=>_.$emit("remove-item",{chipId:O,basketId:_.id})},null,8,["filter","onUpdate:filter","fixed-axes","onUpdate:fixedAxes","info","error","sortable","onCloseChip"])):(d.openBlock(),d.createBlock(Tpe,{key:2,filter:d.unref(c)[O],"onUpdate:filter":[$=>d.unref(c)[O]=$,$=>_.$emit("select-filter-range",{v:$,idx:I})],"fixed-axes":d.unref(f)[O],"onUpdate:fixedAxes":[$=>d.unref(f)[O]=$,$=>_.$emit("select-fixed-axis-value",{v:$,idx:I})],info:_.info[O],error:_.consistency[O]===!1,"search-options":k,onCloseChip:$=>_.$emit("remove-item",{chipId:O,basketId:_.id})},null,8,["filter","onUpdate:filter","fixed-axes","onUpdate:fixedAxes","info","error","onCloseChip"]))],64))),128))]))])],34))}}),Ipe={class:"inputs-block"},Lpe={class:"separator"},Rpe={class:"arrow-circle"},Npe={class:"inputs-block"},Xv=d.defineComponent({__name:"FormLayout",setup(e){return(t,n)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",{class:"left-block",onClick:n[0]||(n[0]=r=>r.stopPropagation())},[n[2]||(n[2]=d.createElementVNode("h3",null," Data Mapping ",-1)),d.createElementVNode("div",Ipe,[d.renderSlot(t.$slots,"dataInputs"),d.renderSlot(t.$slots,"mandatoryOptions"),d.renderSlot(t.$slots,"metadataOptions")])]),d.createElementVNode("div",Lpe,[d.createElementVNode("div",Rpe,[d.createVNode(d.unref(pt.PlIcon16),{name:"arrow-right"})])]),d.createElementVNode("div",{class:"right-block",onClick:n[1]||(n[1]=r=>r.stopPropagation())},[n[3]||(n[3]=d.createElementVNode("h3",null," Chart variables ",-1)),d.createElementVNode("div",Npe,[d.renderSlot(t.$slots,"chartVar")])])],64))}}),$pe={class:"dnd-chip__icon"},Fpe={class:"dnd-chip__title-wrapper"},Vpe=["title"],Ope=["title"],cb=d.defineComponent({__name:"DndChip",props:{info:{}},emits:["dragstart","dragend"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.computed(()=>n.info.uniqueValues.join("/"));function o(c){var f,A;(f=c.dataTransfer)==null||f.clearData(),(A=c.dataTransfer)==null||A.setData("text/plain",n.info.id),r("dragstart",n.info.id),c.target.style.opacity="0.4",a.value&&a.value.classList.toggle("drag-active")}function s(c){r("dragend",n.info.id),c.target.style.opacity="1",a.value&&a.value.classList.toggle("drag-active")}return(c,f)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"chipRoot",ref:a,draggable:"true",class:"dnd-chip",onDragstart:o,onDragend:s},[d.createElementVNode("div",$pe,[d.createVNode(d.unref(q5),{name:c.info.isSubsetFilter?"cell-type-subset":c.info.type==="String"?"cell-type-txt":"cell-type-num"},null,8,["name"])]),d.createElementVNode("div",Fpe,[d.createElementVNode("div",{class:"dnd-chip__title",title:c.info.title},d.toDisplayString(c.info.title),9,Vpe),c.info.nonHomogenous?(d.openBlock(),d.createElementBlock("div",{key:0,class:"dnd-chip__sub-title",title:i.value},d.toDisplayString(i.value),9,Ope)):d.createCommentVNode("",!0)])],544))}}),Qpe={key:0,class:"metadata-block"},zpe={class:"title"},Upe={class:"metadata-block__search"},jpe={class:"metadata-block__items"},T7=d.defineComponent({__name:"OptionsList",props:{options:{},chipInfo:{},title:{default:"Metadata"}},emits:["dragged-id-update"],setup(e,{emit:t}){const n=e,r=d.computed(()=>n.options.length===0),a=d.ref(),i=d.computed(()=>{var s;const o=((s=a.value)==null?void 0:s.toLowerCase())??"";return n.options.filter(c=>{const f=n.chipInfo[c.id].title??"";return f==null?void 0:f.toLowerCase().includes(o)})});return(o,s)=>r.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Qpe,[d.createElementVNode("div",zpe,d.toDisplayString(o.title),1),d.createElementVNode("div",Upe,[d.createVNode(d.unref(pt.PlSearchField),{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=c=>a.value=c),placeholder:"Find...",clearable:""},null,8,["modelValue"])]),d.createElementVNode("div",jpe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,({id:c})=>(d.openBlock(),d.createBlock(cb,{key:c,info:o.chipInfo[c],onDragstart:s[1]||(s[1]=f=>o.$emit("dragged-id-update",f)),onDragend:s[2]||(s[2]=f=>o.$emit("dragged-id-update",null))},null,8,["info"]))),128))])]))}}),Gpe={key:0,class:"metadata-block",style:{flexShrink:0}},Ype={class:"title"},Wpe={class:"metadata-block__items"},_7=d.defineComponent({__name:"MandatoryOptions",props:{options:{},chipInfo:{},title:{default:"Drag to build the chart"}},emits:["dragged-id-update"],setup(e,{emit:t}){const n=e,r=d.computed(()=>n.options.length===0);return(a,i)=>r.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Gpe,[d.createElementVNode("div",Ype,d.toDisplayString(a.title),1),d.createElementVNode("div",Wpe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.options,({id:o})=>(d.openBlock(),d.createBlock(cb,{key:o,info:a.chipInfo[o],onDragstart:i[0]||(i[0]=s=>a.$emit("dragged-id-update",s)),onDragend:i[1]||(i[1]=s=>a.$emit("dragged-id-update",null))},null,8,["info"]))),128))])]))}});function i3(e,t,n,r,a,i){const o=e.value.reactive.optionsState,s=d.toRef(e.value.reactive,"optionsState"),c=d.computed(()=>e.value.inputGuide.value),f=d.computed(()=>e.value.uniqueValuesData.value);function A(X){return OR(s,X,e.value.controller,e.value.columnsDataStore)}function h(X){return VR(s,X,e.value.controller,e.value.columnsDataStore,c)}function m(X){return FR(s,X,e.value.controller,e.value.columnsDataStore,c)}const g=d.ref({...t.reduce((X,oe)=>(X[oe]=A(oe),X),{})}),b=d.ref({...n.reduce((X,oe)=>(X[oe]=m(oe),X),{}),...r.reduce((X,oe)=>(X[oe]=h(oe),X),{})}),C=d.computed(()=>QR(o,c)),x=d.computed(()=>Zle(c,a)),k=d.computed(()=>Jle(c,a)),_=d.ref(null),D=d.computed(()=>{const X=new Set;return a.forEach(oe=>{C.value[oe].forEach(me=>{X.add(me.value)}),o.components[oe].selectorStates.forEach(me=>{X.add(me.selectedSource)})}),UR(c.value,e.value.uniqueValuesData.value,[...X])});function O(X){return o.components[X].selectorStates.reduce((oe,me)=>(me.type!=="range"&&(oe[me.selectedSource]=me.selectedFilterValue),oe),{})}function I(X){return o.components[X].selectorStates.reduce((oe,me)=>(oe[me.selectedSource]=me.selectedFilterRange?[me.selectedFilterRange.min,me.selectedFilterRange.max]:me.selectedFilterValue?[Number(me.selectedFilterValue),Number(me.selectedFilterValue)]:[0,0],oe),{})}function $(X){return o.components[X].selectorStates.reduce((oe,me)=>{const ae=c.value.getSourceInfo(me.selectedSource);return ae.kind==="axis"||(oe[me.selectedSource]=ae.axesToBeFixed.reduce((ye,Ce)=>{var ce;return ye[Ce]=((ce=me.fixedAxes)==null?void 0:ce.find(ge=>ge.axisSource===Ce))??{axisSource:Ce,axisValue:void 0,axisIdx:ae.axesToBeFixedIndexes[Ce]},ye},{})??{}),oe},{})}function Q(X){b.value[X.id]=[...b.value[X.id],X.draggedId],_.value=null}function ee(X){b.value[X.basketId]=b.value[X.basketId].filter(oe=>oe!==X.chipId)}function K(X,oe){b.value[oe]=X}function re(X){return new Set(c.value.components[X].options.map(oe=>oe.value))}function U(X){return c.value.components[X].stateConsistency}function G(X){return!c.value.readyData||C.value[X].length===0||_.value!==null&&!D.value[_.value].availableBasketIds.has(X)}const Z=d.computed(()=>a.map(X=>{var ye;const oe=c.value.components[X],me=X==="filters",ae={id:X,title:i[X],isFilter:me,sortable:X==="tooltipContent",multiple:oe.multipleSelectors,required:oe.required,disabled:G(X),readonly:((ye=e.value.readonlyInputs)==null?void 0:ye.includes(X))??!1,consistency:U(X),draggedId:_.value,availableIds:re(X),droppedIds:b.value[X],info:D.value,fixedAxes:$(X),labelsInfo:f.value,listeners:{"drop-item":Q,"remove-item":ee,reorder:Ce=>K(Ce,X),"select-fixed-axis-value":Ce=>{const ce=o.components[X].selectorStates[Ce.idx];ce.fixedAxes=Object.values(Ce.v);for(const ge of Object.values(o.components))for(const ze of ge.selectorStates)ce.fixedAxes.forEach(Ne=>{ze.fixedAxes&&(ze.fixedAxes=ze.fixedAxes.map(Ge=>({...Ge,axisValue:Ne.axisSource===Ge.axisSource?Ne.axisValue:Ge.axisValue})))})}}};return me&&(ae.selectedFilters=O(X),ae.selectedRanges=I(X),ae.listeners["select-filter-value"]=Ce=>{const ce=o.components[X].selectorStates[Ce.idx];ce.type="equals",ce.selectedFilterValue=Ce.v},ae.listeners["select-filter-range"]=Ce=>{const ce=o.components[X].selectorStates[Ce.idx];ce.type="range",ce.selectedFilterRange=Ce.v}),ae}));function Y(){_.value=null}return{draggedId:_,cleanDraggedId:Y,basketsData:Z,freeMetaOptions:x,freeMandatoryOptions:k,chipInfo:D,dataStateValues:g,dataOptions:C}}const Xpe={class:"data-form-input-item"},Kpe=d.defineComponent({__name:"DiscreteForm",setup(e){const t=da();d.watch(()=>t.value.commonHelpersData.primaryGroups.value,PS(t));const n=["filters","primaryGrouping","secondaryGrouping","tabBy","facetBy"],r={filters:"Filter",primaryGrouping:"Primary grouping",secondaryGrouping:"Secondary grouping",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=i3(t,["y"],["filters","tabBy"],["primaryGrouping","secondaryGrouping","facetBy"],n,r);console.log("updatedForm! discrete");const h=d.computed(()=>{var m;return((m=t.value.readonlyInputs)==null?void 0:m.includes("y"))??!1});return(m,g)=>(d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",Xpe,[d.createVNode(d.unref(pt.PlDropdown),{modelValue:d.unref(f).y,"onUpdate:modelValue":g[0]||(g[0]=b=>d.unref(f).y=b),options:d.unref(A).y,disabled:h.value,error:d.unref(Xy)("y",d.unref(t).inputGuide.value),label:"Y:",clearable:!h.value},null,8,["modelValue","options","disabled","error","clearable"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(_7,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:g[1]||(g[1]=b=>a.value=b)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(T7,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:g[2]||(g[2]=b=>a.value=b)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),b=>(d.openBlock(),d.createElementBlock("div",{key:b.id,class:"data-form-input-item"},[d.createVNode(Wv,d.mergeProps({ref_for:!0},b,d.toHandlers(b.listeners)),null,16)]))),128))]),_:1}))}}),Zpe={class:"data-form-input-item"},Jpe={class:"data-form-input-item",style:{"margin-top":"10px"}},qpe=d.defineComponent({__name:"ScatterplotForm",setup(e){const t=da(),n=["filters","grouping","size","shape","tooltipContent","label","tabBy","facetBy"],r={filters:"Filter",grouping:"Grouping / Color",size:"Size",shape:"Shape",tooltipContent:"Tooltip",label:"Label",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=i3(t,["x","y"],["filters","tabBy"],["grouping","size","shape","tooltipContent","label","facetBy"],n,r),h=d.computed(()=>{var g;return((g=t.value.readonlyInputs)==null?void 0:g.includes("x"))??!1}),m=d.computed(()=>{var g;return((g=t.value.readonlyInputs)==null?void 0:g.includes("y"))??!1});return(g,b)=>(d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",Zpe,[d.createVNode(d.unref(pt.PlDropdown),{label:"X:",clearable:"",modelValue:d.unref(f).x,"onUpdate:modelValue":b[0]||(b[0]=C=>d.unref(f).x=C),options:d.unref(A).x,disabled:h.value},null,8,["modelValue","options","disabled"])]),d.createElementVNode("div",Jpe,[d.createVNode(d.unref(pt.PlDropdown),{label:"Y:",clearable:"",modelValue:d.unref(f).y,"onUpdate:modelValue":b[1]||(b[1]=C=>d.unref(f).y=C),options:d.unref(A).y,disabled:m.value},null,8,["modelValue","options","disabled"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(_7,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:b[2]||(b[2]=C=>a.value=C)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(T7,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:b[3]||(b[3]=C=>a.value=C)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),C=>(d.openBlock(),d.createElementBlock("div",{key:C.id,class:"data-form-input-item"},[d.createVNode(Wv,d.mergeProps({ref_for:!0},C,d.toHandlers(C.listeners)),null,16)]))),128))]),_:1}))}}),e0e={class:"data-form-input-item"},t0e={class:"data-form-input-item",style:{"margin-top":"10px"}},n0e=d.defineComponent({__name:"ScatterplotUmapForm",setup(e){const t=da(),n=["filters","grouping","tabBy","tooltipContent","label"],r={filters:"Filter",grouping:"Grouping / Color",tabBy:"Tab by",tooltipContent:"Tooltip",label:"Label"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=i3(t,["x","y"],["filters","tabBy"],["grouping","tooltipContent","label"],n,r),h=d.computed(()=>{var g;return((g=t.value.readonlyInputs)==null?void 0:g.includes("x"))??!1}),m=d.computed(()=>{var g;return((g=t.value.readonlyInputs)==null?void 0:g.includes("y"))??!1});return(g,b)=>(d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",e0e,[d.createVNode(d.unref(pt.PlDropdown),{label:"X:",clearable:"",modelValue:d.unref(f).x,"onUpdate:modelValue":b[0]||(b[0]=C=>d.unref(f).x=C),options:d.unref(A).x,disabled:h.value},null,8,["modelValue","options","disabled"])]),d.createElementVNode("div",t0e,[d.createVNode(d.unref(pt.PlDropdown),{label:"Y:",clearable:"",modelValue:d.unref(f).y,"onUpdate:modelValue":b[1]||(b[1]=C=>d.unref(f).y=C),options:d.unref(A).y,disabled:m.value},null,8,["modelValue","options","disabled"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(_7,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:b[2]||(b[2]=C=>a.value=C)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(T7,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:b[3]||(b[3]=C=>a.value=C)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),C=>(d.openBlock(),d.createElementBlock("div",{key:C.id,class:"data-form-input-item"},[d.createVNode(Wv,d.mergeProps({ref_for:!0},C,d.toHandlers(C.listeners)),null,16)]))),128))]),_:1}))}}),r0e={class:"data-form-input-item"},a0e=d.defineComponent({__name:"HeatmapForm",setup(e){const t=da(),n=["filters","x","y","xGroupBy","yGroupBy","tooltipContent","tabBy","facetBy","annotationsX","annotationsY"],r={filters:"Filter",x:"X",y:"Y",xGroupBy:"X group",yGroupBy:"Y group",tooltipContent:"Tooltip",tabBy:"Tab by",facetBy:"Facet by",annotationsX:"Annotations X",annotationsY:"Annotations Y"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=i3(t,["value"],["filters","tabBy"],["x","y","xGroupBy","yGroupBy","tooltipContent","facetBy","annotationsX","annotationsY"],n,r);console.log("heatmap updates");const h=d.computed(()=>{var m;return((m=t.value.readonlyInputs)==null?void 0:m.includes("value"))??!1});return(m,g)=>(d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",r0e,[d.createVNode(d.unref(pt.PlDropdown),{label:"Data source:",clearable:"",modelValue:d.unref(f).value,"onUpdate:modelValue":g[0]||(g[0]=b=>d.unref(f).value=b),options:d.unref(A).value,disabled:h.value,error:d.unref(Xy)("value",d.unref(t).inputGuide.value)},null,8,["modelValue","options","disabled","error"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(_7,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:g[1]||(g[1]=b=>a.value=b)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(T7,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:g[2]||(g[2]=b=>a.value=b)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),b=>(d.openBlock(),d.createElementBlock("div",{key:b.id,class:"data-form-input-item"},[d.createVNode(Wv,d.mergeProps({ref_for:!0},b,d.toHandlers(b.listeners)),null,16)]))),128))]),_:1}))}}),i0e={class:"data-form-input-item"},o0e={key:0,class:"metadata-block"},l0e={class:"metadata-block__items"},s0e={key:1,class:"metadata-block"},u0e={class:"metadata-block__items"},c0e={key:0,class:"data-form-input-item"},f0e=d.defineComponent({__name:"DendroForm",setup(e){const t=da(),n=t.value.reactive.optionsState,r=d.toRef(t.value.reactive,"optionsState"),a=d.computed(()=>t.value.inputGuide.value),i=d.computed(()=>t.value.uniqueValuesData.value);function o(Z){return OR(r,Z,t.value.controller,t.value.columnsDataStore)}function s(Z){return VR(r,Z,t.value.controller,t.value.columnsDataStore,a)}function c(Z){return FR(r,Z,t.value.controller,t.value.columnsDataStore,a)}const f=d.ref({value:o("value"),tableContent:s("tableContent"),heatmapAnnotation:s("heatmapAnnotation"),heatmapForSequence:s("heatmapForSequence"),filters:c("filters"),tabBy:c("tabBy"),height:s("height"),labels:s("labels"),nodeShape:s("nodeShape"),nodeColor:s("nodeColor"),nodeSize:s("nodeSize"),lineColor:s("lineColor"),heatmapAxis:s("heatmapAxis"),heatmapGroup:s("heatmapGroup")});d.watch(()=>f.value.nodeShape,Z=>{t.value.reactive.layersSettings.dendro.dotShape=Z.length?{type:"nodeShape",value:Z[0]}:K5}),d.watch(()=>f.value.nodeColor,Z=>{t.value.reactive.layersSettings.dendro.dotFill=Z.length?{type:"nodeColor",value:Z[0]}:yo}),d.watch(()=>f.value.lineColor,Z=>{t.value.reactive.layersSettings.dendro.lineColor=Z.length?{type:"lineColor",value:Z[0]}:yo});const A=d.computed(()=>QR(n,a)),h=d.computed(()=>DS(a,g)),m=d.computed(()=>h.value.filter(Z=>Z.info.kind==="axis")),g=["height","tableContent","labels","heatmapAnnotation","heatmapAxis","heatmapGroup","heatmapForSequence","nodeShape","nodeColor","nodeSize","lineColor"],b={height:"Connections length",tableContent:"Table/tooltip content",labels:"Labels",heatmapAnnotation:"Heatmap annotation",heatmapAxis:"Heatmap axis",heatmapGroup:"Heatmap group",heatmapForSequence:"Alignment data",nodeShape:"Node shape",nodeColor:"Node color",nodeSize:"Node size",lineColor:"Line color"},C=d.ref(null),x=d.computed(()=>{const Z=new Set;return g.forEach(Y=>{A.value[Y].forEach(X=>{Z.add(X.value)}),n.components[Y].selectorStates.forEach(X=>{Z.add(X.selectedSource)})}),UR(a.value,i.value,[...Z])});function k(Z){return n.components[Z].selectorStates.reduce((Y,X)=>{const oe=a.value.getSourceInfo(X.selectedSource);return oe.kind==="axis"||(Y[X.selectedSource]=oe.axesToBeFixed.reduce((me,ae)=>{var ye;return me[ae]=((ye=X.fixedAxes)==null?void 0:ye.find(Ce=>Ce.axisSource===ae))??{axisSource:ae,axisValue:void 0,axisIdx:oe.axesToBeFixedIndexes[ae]},me},{})??{}),Y},{})}function _(Z){f.value[Z.id]=[...f.value[Z.id],Z.draggedId],C.value=null}function D(Z,Y){f.value[Y]=Z}function O(Z){f.value[Z.basketId]=f.value[Z.basketId].filter(Y=>Y!==Z.chipId)}function I(Z){return new Set(a.value.components[Z].options.map(Y=>Y.value))}function $(Z){return a.value.components[Z].stateConsistency}function Q(Z){return!a.value.readyData||A.value[Z].length===0||C.value!==null&&!x.value[C.value].availableBasketIds.has(Z)}const ee=d.computed(()=>g.map(Z=>{var oe;const Y=a.value.components[Z];return{id:Z,title:b[Z],isFilter:!1,sortable:Z==="tableContent",multiple:Y.multipleSelectors,required:Y.required,disabled:Q(Z),readonly:((oe=t.value.readonlyInputs)==null?void 0:oe.includes(Z))??!1,consistency:$(Z),draggedId:C.value,availableIds:I(Z),droppedIds:f.value[Z],info:x.value,labelsInfo:i.value,listeners:{"drop-item":_,"remove-item":O,reorder:me=>D(me,Z),"select-fixed-axis-value":me=>{const ae=n.components[Z].selectorStates[me.idx];ae.fixedAxes=Object.values(me.v);for(const ye of Object.values(n.components))for(const Ce of ye.selectorStates)ae.fixedAxes.forEach(ce=>{Ce.fixedAxes&&(Ce.fixedAxes=Ce.fixedAxes.map(ge=>({...ge,axisValue:ce.axisSource===ge.axisSource?ce.axisValue:ge.axisValue})))})}},fixedAxes:k(Z)}}));function K(Z){return Z==="heatmapAxis"||Z==="heatmapGroup"?f.value.heatmapAnnotation!==null:!0}function re(){C.value=null}["value"].forEach(Z=>{d.watch([()=>f.value[Z],()=>A.value],([Y,X])=>{(typeof Y>"u"||zR("value",a.value))&&X[Z]&&X[Z].length&&t.value.controller.changeSelected(Z,t.value.columnsDataStore,t.value.reactive.optionsState,[{selectedSource:X[Z][0].value}])},{immediate:!0})});const G=d.computed(()=>{var Z;return((Z=t.value.readonlyInputs)==null?void 0:Z.includes("value"))??!1});return(Z,Y)=>(d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",i0e,[d.createVNode(d.unref(pt.PlDropdown),{label:"Data source:",modelValue:f.value.value,"onUpdate:modelValue":Y[0]||(Y[0]=X=>f.value.value=X),options:A.value.value,disabled:G.value,error:d.unref(Xy)("value",a.value)},null,8,["modelValue","options","disabled","error"])]),m.value.length>0?(d.openBlock(),d.createElementBlock("div",o0e,[Y[3]||(Y[3]=d.createElementVNode("div",{class:"title"},"Drag to build the chart",-1)),d.createElementVNode("div",l0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,({id:X})=>(d.openBlock(),d.createBlock(cb,{key:X,info:x.value[X],onDragstart:Y[1]||(Y[1]=oe=>C.value=oe),onDragend:re},null,8,["info"]))),128))])])):d.createCommentVNode("",!0),h.value.length>0?(d.openBlock(),d.createElementBlock("div",s0e,[Y[4]||(Y[4]=d.createElementVNode("div",{class:"title"},"Metadata",-1)),d.createElementVNode("div",u0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(h.value,({id:X})=>(d.openBlock(),d.createBlock(cb,{key:X,info:x.value[X],onDragstart:Y[2]||(Y[2]=oe=>C.value=oe),onDragend:re},null,8,["info"]))),128))])])):d.createCommentVNode("",!0)]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(ee.value,X=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:X.id},[K(X.id)?(d.openBlock(),d.createElementBlock("div",c0e,[d.createVNode(Wv,d.mergeProps({ref_for:!0},X,d.toHandlers(X.listeners)),null,16)])):d.createCommentVNode("",!0)],64))),128))]),_:1}))}}),d0e={class:"data-form-input-item"},A0e=d.defineComponent({__name:"HistogramForm",setup(e){const t=da(),n=["filters","tabBy","facetBy"],r={filters:"Filter",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=i3(t,["value"],["filters","tabBy"],["facetBy"],n,r),h=d.computed(()=>{var m;return((m=t.value.readonlyInputs)==null?void 0:m.includes("value"))??!1});return(m,g)=>{const b=d.resolveComponent("MandatoryOptionsList"),C=d.resolveComponent("OptionsList");return d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",d0e,[d.createVNode(d.unref(pt.PlDropdown),{modelValue:d.unref(f).value,"onUpdate:modelValue":g[0]||(g[0]=x=>d.unref(f).value=x),options:d.unref(A).value,disabled:h.value,error:d.unref(Xy)("value",d.unref(t).inputGuide.value),label:"Data value:",clearable:!h.value},null,8,["modelValue","options","disabled","error","clearable"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(b,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:g[1]||(g[1]=x=>a.value=x)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(C,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:g[2]||(g[2]=x=>a.value=x)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),x=>(d.openBlock(),d.createElementBlock("div",{key:x.id,class:"data-form-input-item"},[d.createVNode(Wv,d.mergeProps({ref_for:!0},x,d.toHandlers(x.listeners)),null,16)]))),128))]),_:1})}}}),p0e={class:"data-form-input-item"},h0e={class:"data-form-input-item",style:{"margin-top":"10px"}},m0e=d.defineComponent({__name:"BubbleForm",setup(e){const t=da(),n=["filters","x","y","tooltipContent","tabBy","facetBy"],r={filters:"Filter",x:"X",y:"Y",tooltipContent:"Tooltip",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=i3(t,["valueColor","valueSize"],["filters","tabBy"],["x","y","tooltipContent","facetBy"],n,r),h=d.computed(()=>{var g;return((g=t.value.readonlyInputs)==null?void 0:g.includes("valueColor"))??!1}),m=d.computed(()=>{var g;return((g=t.value.readonlyInputs)==null?void 0:g.includes("valueSize"))??!1});return(g,b)=>(d.openBlock(),d.createBlock(Xv,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",p0e,[d.createVNode(d.unref(pt.PlDropdown),{label:"Data source for color:",clearable:"",modelValue:d.unref(f).valueColor,"onUpdate:modelValue":b[0]||(b[0]=C=>d.unref(f).valueColor=C),disabled:h.value,options:d.unref(A).valueColor,error:d.unref(Xy)("valueColor",d.unref(t).inputGuide.value)},null,8,["modelValue","disabled","options","error"])]),d.createElementVNode("div",h0e,[d.createVNode(d.unref(pt.PlDropdown),{label:"Data source for size:",clearable:"",modelValue:d.unref(f).valueSize,"onUpdate:modelValue":b[1]||(b[1]=C=>d.unref(f).valueSize=C),disabled:m.value,options:d.unref(A).valueSize,error:d.unref(Xy)("valueSize",d.unref(t).inputGuide.value)},null,8,["modelValue","disabled","options","error"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(_7,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:b[2]||(b[2]=C=>a.value=C)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(T7,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:b[3]||(b[3]=C=>a.value=C)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),C=>(d.openBlock(),d.createElementBlock("div",{key:C.id,class:"data-form-input-item"},[d.createVNode(Wv,d.mergeProps({ref_for:!0},C,d.toHandlers(C.listeners)),null,16)]))),128))]),_:1}))}}),v0e={class:"data-form"},g0e=d.defineComponent({__name:"index",setup(e){const t=da();return(n,r)=>(d.openBlock(),d.createElementBlock("div",v0e,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createBlock(Kpe,{key:0})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(),d.createBlock(qpe,{key:1})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(),d.createBlock(n0e,{key:2})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createBlock(a0e,{key:3})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="dendro"?(d.openBlock(),d.createBlock(f0e,{key:4})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createBlock(A0e,{key:5})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createBlock(m0e,{key:6})):d.createCommentVNode("",!0)]))}}),y0e={class:"collapsable-block-content"},ts=d.defineComponent({__name:"CollapsableBlock",props:{iconOpen:{},icon:{},title:{},settings:{}},setup(e){var i,o,s,c,f;const t=e,n=d.ref(((i=t.settings)==null?void 0:i.defaultState)!=="open"),r={},a={};return(o=t.settings)!=null&&o.height&&(a["--title-height"]=`${(s=t.settings)==null?void 0:s.height}px`),(c=t.settings)!=null&&c.horizontalPadding&&(r.padding=`0 ${(f=t.settings)==null?void 0:f.horizontalPadding}px`),(A,h)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["collapsable-block-container",{minimized:n.value,maximized:!n.value}]),style:a},[d.createElementVNode("div",{class:"collapsable-block-title",onClick:h[0]||(h[0]=m=>n.value=!n.value),style:r},[t.icon?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(!n.value&&t.iconOpen?t.iconOpen:t.icon),{key:0})):d.createCommentVNode("",!0),d.createElementVNode("span",null,d.toDisplayString(t.title),1)]),d.createElementVNode("div",y0e,[d.renderSlot(A.$slots,"default")])],2))}}),w0e={},C0e={class:"inline-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function b0e(e,t){return d.openBlock(),d.createElementBlock("svg",C0e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M6 11.3773C6 11.8102 6.51272 12.0386 6.83448 11.749L10.5871 8.37165C10.8077 8.17303 10.8077 7.82697 10.5871 7.62835L6.83448 4.25103C6.51272 3.96145 6 4.1898 6 4.62268V11.3773Z",fill:"#CFD1DB"},null,-1)]))}const Qf=Wr(w0e,[["render",b0e]]),E0e={},x0e={class:"inline-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function S0e(e,t){return d.openBlock(),d.createElementBlock("svg",x0e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4.70711 6.00018C4.26165 6.00018 4.03857 6.53875 4.35355 6.85374L7.64645 10.1466C7.84171 10.3419 8.15829 10.3419 8.35355 10.1466L11.6464 6.85374C11.9614 6.53875 11.7383 6.00018 11.2929 6.00018H4.70711Z",fill:"#CFD1DB"},null,-1)]))}const zf=Wr(E0e,[["render",S0e]]),B0e=["tabindex","onKeydown","onClick"],Uf=d.defineComponent({__name:"BtnIconGroup",props:{modelValue:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){d.useSlots();const n=t,r=a=>n("update:modelValue",a);return(a,i)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["btn-icon-group",{disabled:a.disabled}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.options,(o,s)=>(d.openBlock(),d.createElementBlock("div",{key:o.value+":"+s,class:d.normalizeClass(["btn-icon-group__option",{active:a.modelValue===o.value}]),tabindex:a.modelValue===o.value||a.disabled?void 0:0,onKeydown:d.withKeys(c=>r(o.value),["enter"]),onClick:c=>r(o.value)},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(o.icon)))],42,B0e))),128))],2))}}),k0e={},T0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function _0e(e,t){return d.openBlock(),d.createElementBlock("svg",T0e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 4.5L21 4.5V6L3 6V4.5ZM3 9L11 9V10.5L3 10.5V9ZM3 15V13.5L19 13.5V15L3 15ZM3 18H13V19.5H3V18Z",fill:"currentColor"},null,-1)]))}const P7=Wr(k0e,[["render",_0e]]),P0e={},M0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function D0e(e,t){return d.openBlock(),d.createElementBlock("svg",M0e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 4.5L21 4.5V6L3 6V4.5ZM8 9L16 9V10.5L8 10.5V9ZM4 13.5L20 13.5V15L4 15L4 13.5ZM7 18H17V19.5H7V18Z",fill:"currentColor"},null,-1)]))}const M7=Wr(P0e,[["render",D0e]]),H0e={},I0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function L0e(e,t){return d.openBlock(),d.createElementBlock("svg",I0e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 4.5L21 4.5V6L3 6V4.5ZM13 9L21 9V10.5L13 10.5V9ZM5 15V13.5L21 13.5V15L5 15ZM11 18H21V19.5H11V18Z",fill:"currentColor"},null,-1)]))}const D7=Wr(H0e,[["render",L0e]]),R0e={},N0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function $0e(e,t){return d.openBlock(),d.createElementBlock("svg",N0e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4 19L4 5C4 4.44772 4.44772 4 5 4L19 4C19.5523 4 20 4.44772 20 5L20 19C20 19.5523 19.5523 20 19 20L5 20C4.44772 20 4 19.5523 4 19Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"square"},null,-1)]))}const H7=Wr(R0e,[["render",$0e]]),F0e={},V0e={width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function O0e(e,t){return d.openBlock(),d.createElementBlock("svg",V0e,t[0]||(t[0]=[d.createStaticVNode('<path d="M4.25 1H5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M8.25 1H9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M12.25 1H13.75" stroke="currentColor" stroke-width="1.5"></path><path d="M16.25 1H17.75" stroke="currentColor" stroke-width="1.5"></path><path d="M0.25 17H1.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4.25 17H5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M8.25 17H9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M12.25 17H13.75" stroke="currentColor" stroke-width="1.5"></path><path d="M16.25 17H17.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 0.25L17 1.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 4.25L17 5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 8.25L17 9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 12.25L17 13.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 0.25L1 1.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 4.25L1 5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 8.25L1 9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 12.25L1 13.75" stroke="currentColor" stroke-width="1.5"></path>',17)]))}const I7=Wr(F0e,[["render",O0e]]),Q0e={},z0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function U0e(e,t){return d.openBlock(),d.createElementBlock("svg",z0e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M8.8148 18.2251C6.6173 18.2251 5.0498 16.6576 5.0498 14.4601V10.7401C5.0498 8.5426 6.6173 6.9751 8.8148 6.9751C11.0123 6.9751 12.5798 8.5426 12.5798 10.7401V14.4601C12.5798 16.6576 11.0123 18.2251 8.8148 18.2251ZM6.6473 14.5576C6.6473 15.7651 7.60731 16.7251 8.8148 16.7251C10.0223 16.7251 10.9823 15.7651 10.9823 14.5576V10.6276C10.9823 9.4276 10.0223 8.4676 8.8148 8.4676C7.60731 8.4676 6.6473 9.4276 6.6473 10.6276V14.5576Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M15.8738 12.3751C14.3888 12.3751 13.1738 11.1751 13.1738 9.6751C13.1738 8.2051 14.4338 6.9751 15.8738 6.9751C17.3588 6.9751 18.5738 8.1751 18.5738 9.6751C18.5738 11.1751 17.3588 12.3751 15.8738 12.3751ZM14.5313 9.6751C14.5313 10.4026 15.1463 11.0176 15.8738 11.0176C16.6013 11.0176 17.2163 10.4026 17.2163 9.6751C17.2163 8.9476 16.6013 8.3326 15.8738 8.3326C15.1463 8.3326 14.5313 8.9476 14.5313 9.6751Z",fill:"currentColor"},null,-1)]))}const lB=Wr(Q0e,[["render",U0e]]),j0e={},G0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Y0e(e,t){return d.openBlock(),d.createElementBlock("svg",G0e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M5.75684 18.0001V16.1176H0.881836V14.6326L4.39184 7.2001H6.18434L2.67434 14.6326H5.75684V11.7076H7.34684V14.6326H8.41934V16.1176H7.34684V18.0001H5.75684Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M12.5224 18.2251C10.8574 18.2251 9.46242 17.1226 9.01992 15.5476L10.5274 15.1426C10.7749 16.1026 11.6674 16.7101 12.5674 16.7101C13.7524 16.7101 14.6899 15.7576 14.6899 14.6026C14.6899 13.4176 13.7224 12.4876 12.5674 12.4876C11.6824 12.4876 11.0749 12.9076 10.7374 13.3576L9.37242 12.8776L9.70242 7.2001H15.5299V8.6776H11.1049L10.9249 11.6476C11.4574 11.2651 12.1324 11.0626 12.7699 11.0626C14.7874 11.0626 16.2724 12.5776 16.2724 14.6026C16.2724 16.6126 14.5399 18.2251 12.5224 18.2251Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M19.265 12.3751C17.78 12.3751 16.565 11.1751 16.565 9.6751C16.565 8.2051 17.825 6.9751 19.265 6.9751C20.75 6.9751 21.965 8.1751 21.965 9.6751C21.965 11.1751 20.75 12.3751 19.265 12.3751ZM17.9225 9.6751C17.9225 10.4026 18.5375 11.0176 19.265 11.0176C19.9925 11.0176 20.6075 10.4026 20.6075 9.6751C20.6075 8.9476 19.9925 8.3326 19.265 8.3326C18.5375 8.3326 17.9225 8.9476 17.9225 9.6751Z",fill:"currentColor"},null,-1)]))}const sB=Wr(j0e,[["render",Y0e]]),W0e={},X0e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function K0e(e,t){return d.openBlock(),d.createElementBlock("svg",X0e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4.6132 6.9826C6.7057 6.9826 8.3257 8.6026 8.3257 10.8301V14.2726C8.3257 16.6351 6.7432 18.2251 4.4557 18.2251C3.3157 18.2251 2.2882 17.7901 1.5532 16.9426L2.7007 15.8701C3.1132 16.4026 3.7582 16.7401 4.4557 16.7401C5.7982 16.7401 6.7282 15.6601 6.7282 14.4751V13.1851C6.1207 13.7926 5.2957 14.1526 4.4032 14.1526C2.3857 14.1526 0.908203 12.6226 0.908203 10.6051C0.908203 8.5801 2.5957 6.9826 4.6132 6.9826ZM2.4982 10.6051C2.4982 11.7751 3.4357 12.7201 4.6057 12.7201C5.7757 12.7201 6.7282 11.7751 6.7282 10.6051C6.7282 9.4501 5.7832 8.4901 4.6132 8.4901C3.4432 8.4901 2.4982 9.4351 2.4982 10.6051Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M13.2846 18.2251C11.0871 18.2251 9.51961 16.6576 9.51961 14.4601V10.7401C9.51961 8.5426 11.0871 6.9751 13.2846 6.9751C15.4821 6.9751 17.0496 8.5426 17.0496 10.7401V14.4601C17.0496 16.6576 15.4821 18.2251 13.2846 18.2251ZM11.1171 14.5576C11.1171 15.7651 12.0771 16.7251 13.2846 16.7251C14.4921 16.7251 15.4521 15.7651 15.4521 14.5576V10.6276C15.4521 9.4276 14.4921 8.4676 13.2846 8.4676C12.0771 8.4676 11.1171 9.4276 11.1171 10.6276V14.5576Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M20.3436 12.3751C18.8586 12.3751 17.6436 11.1751 17.6436 9.6751C17.6436 8.2051 18.9036 6.9751 20.3436 6.9751C21.8286 6.9751 23.0436 8.1751 23.0436 9.6751C23.0436 11.1751 21.8286 12.3751 20.3436 12.3751ZM19.0011 9.6751C19.0011 10.4026 19.6161 11.0176 20.3436 11.0176C21.0711 11.0176 21.6861 10.4026 21.6861 9.6751C21.6861 8.9476 21.0711 8.3326 20.3436 8.3326C19.6161 8.3326 19.0011 8.9476 19.0011 9.6751Z",fill:"currentColor"},null,-1)]))}const uB=Wr(W0e,[["render",K0e]]),Z0e={},J0e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function q0e(e,t){return d.openBlock(),d.createElementBlock("svg",J0e,t[0]||(t[0]=[d.createStaticVNode('<path d="M4 4L4 20" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M7.25 4H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 4H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 4H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 4H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M7.25 20H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 20H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 20H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 20H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 3.25L20 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 7.25L20 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 11.25L20 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 15.25L20 16.75" stroke="currentColor" stroke-width="1.5"></path>',13)]))}const cB=Wr(Z0e,[["render",q0e]]),ehe={},the={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function nhe(e,t){return d.openBlock(),d.createElementBlock("svg",the,t[0]||(t[0]=[d.createStaticVNode('<path d="M20 20L4 20" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M7.25 4H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 4H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 4H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 4H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 3.25L20 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 7.25L20 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 11.25L20 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 15.25L20 16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 3.25L4 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 7.25L4 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 11.25L4 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 15.25L4 16.75" stroke="currentColor" stroke-width="1.5"></path>',13)]))}const fB=Wr(ehe,[["render",nhe]]),rhe={},ahe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ihe(e,t){return d.openBlock(),d.createElementBlock("svg",ahe,t[0]||(t[0]=[d.createStaticVNode('<path d="M4 4L4 19C4 19.5523 4.44772 20 5 20L20 20" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M7.25 4H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 4H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 4H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 4H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 3.25L20 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 7.25L20 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 11.25L20 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 15.25L20 16.75" stroke="currentColor" stroke-width="1.5"></path>',9)]))}const dB=Wr(rhe,[["render",ihe]]),ohe={inheritAttrs:!1},lhe={class:"double-contour-temp"};function she(e,t,n,r,a,i){return d.openBlock(),d.createElementBlock("div",lhe,[d.createElementVNode("div",d.normalizeProps(d.guardReactiveProps(e.$attrs)),[d.renderSlot(e.$slots,"default")],16)])}const AB=Wr(ohe,[["render",she]]),uhe={},che={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function fhe(e,t){return d.openBlock(),d.createElementBlock("svg",che,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.5951 8.76689C9.7962 8.43389 8.91957 8.25 8 8.25C4.27208 8.25 1.25 11.2721 1.25 15C1.25 18.7279 4.27208 21.75 8 21.75C11.7279 21.75 14.75 18.7279 14.75 15C14.75 12.7693 13.6679 10.7913 12 9.56231C11.5866 9.86693 11.2092 10.2176 10.8753 10.6067C12.3055 11.5446 13.25 13.162 13.25 15C13.25 17.8995 10.8995 20.25 8 20.25C5.10051 20.25 2.75 17.8995 2.75 15C2.75 12.1005 5.10051 9.75 8 9.75C8.51 9.75 9.00302 9.82272 9.46924 9.95836C9.80438 9.52487 10.1817 9.12566 10.5951 8.76689Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2.75C9.10051 2.75 6.75 5.10051 6.75 8C6.75 10.8995 9.10051 13.25 12 13.25C14.8995 13.25 17.25 10.8995 17.25 8C17.25 5.10051 14.8995 2.75 12 2.75ZM5.25 8C5.25 4.27208 8.27208 1.25 12 1.25C15.7279 1.25 18.75 4.27208 18.75 8C18.75 11.7279 15.7279 14.75 12 14.75C8.27208 14.75 5.25 11.7279 5.25 8Z",fill:"#07AD3E"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M21.25 15C21.25 12.9441 20.0683 11.1643 18.3471 10.3026C18.5192 9.82834 18.6396 9.32933 18.7016 8.81237C21.0847 9.85434 22.75 12.2327 22.75 15C22.75 18.7279 19.7279 21.75 16 21.75C13.9499 21.75 12.1132 20.836 10.8753 19.3933C11.2961 19.1174 11.6749 18.7825 12 18.4005C12.963 19.5322 14.3977 20.25 16 20.25C18.8995 20.25 21.25 17.8995 21.25 15ZM11.1556 17.0269C10.8943 16.4032 10.75 15.7185 10.75 15C10.75 12.1005 13.1005 9.75 16 9.75C16.3146 9.75 16.6227 9.77767 16.922 9.83069C17.0939 9.36877 17.2026 8.87611 17.2376 8.36321C16.8364 8.28886 16.4227 8.25 16 8.25C12.2721 8.25 9.25 11.2721 9.25 15C9.25 16.139 9.53213 17.2122 10.0303 18.1534C10.481 17.8626 10.8653 17.4779 11.1556 17.0269Z",fill:"#110529"},null,-1)]))}const dhe=Wr(uhe,[["render",fhe]]),Ahe={key:4,class:"size"},L7=d.defineComponent({__name:"AesButton",props:{data:{}},emits:["ref"],setup(e,{emit:t}){const n=e,r=n.data.type==="fill"||n.data.type==="stroke",a=d.computed(()=>({icon__white:r&&n.data.value.toLowerCase()==="#ffffff",icon__empty:r&&n.data.value.toLowerCase()==="transparent"})),i=d.computed(()=>n.data.type==="fill"?{"background-color":n.data.value}:n.data.type==="stroke"&&!a.value.icon__empty&&!a.value.icon__white?{"border-color":n.data.value}:{});return(o,s)=>(d.openBlock(),d.createElementBlock("div",{class:"ui-aes-button",ref:c=>o.$emit("ref",c)},[d.createVNode(AB,{class:"ui-multiselect-button__contour"}),o.data.type==="fill"?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["icon icon__fill",a.value]),style:d.normalizeStyle(i.value)},null,6)):o.data.type==="stroke"?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["icon icon__stroke",a.value]),style:d.normalizeStyle(i.value)},null,6)):o.data.type==="dotShape"?(d.openBlock(),d.createElementBlock("div",{key:2,class:d.normalizeClass(["icon dot",{[`dot__${o.data.value}`]:!0}])},null,2)):o.data.type==="lineType"?(d.openBlock(),d.createElementBlock("div",{key:3,class:d.normalizeClass(["icon icon__line",{[`line__${o.data.value}`]:!0}])},null,2)):o.data.type==="size"?(d.openBlock(),d.createElementBlock("span",Ahe,d.toDisplayString(o.data.value),1)):o.data.type==="data"?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(dhe),{key:5,class:"icon"})):d.createCommentVNode("",!0)],512))}}),phe={},hhe={class:"inline-icon",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function mhe(e,t){return d.openBlock(),d.createElementBlock("svg",hhe,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 8L7.53033 13.5303L8.59099 12.4697L4.87132 8.75L14.0607 8.75L14.0607 7.25L4.87132 7.25L8.59099 3.53033L7.53033 2.46967L2 8Z",fill:"#110529"},null,-1)]))}const vhe=Wr(phe,[["render",mhe]]),ghe={ref:"root",class:"aes-settings-form"},yhe={class:"aes-settings-form__header"},Qh=d.defineComponent({__name:"FormWrapper",props:{title:{},backTitle:{}},emits:["form:close"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"#graph-settings-modal"},[d.createElementVNode("div",ghe,[d.createElementVNode("div",yhe,[d.createElementVNode("div",{onClick:r[0]||(r[0]=d.withModifiers(a=>n.$emit("form:close"),["stop"])),class:"back-link"},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(vhe))),d.createTextVNode(" "+d.toDisplayString(`Back to ${n.backTitle}`),1)]),d.createElementVNode("h3",null,d.toDisplayString(n.title),1)]),d.renderSlot(n.$slots,"default")],512)]))}}),whe={class:"ui-multiselect-button__content"},Che={key:0,class:"title"},bhe={key:1,class:"gradient"},Ehe=6,o3=d.defineComponent({__name:"MultiselectButton",props:{label:{},title:{},palette:{}},emits:["button-click"],setup(e,{emit:t}){const n=d.ref(void 0);pt.useLabelNotch(n);function r(a){const i=100/(a.length-1);return`background: linear-gradient(to right, ${a.map((o,s)=>`${o} ${s*i}%`).join(", ")})`}return(a,i)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"root",ref:n,class:"ui-multiselect-button",onClick:i[0]||(i[0]=d.withModifiers(o=>a.$emit("button-click"),["stop"]))},[a.label?(d.openBlock(),d.createElementBlock("label",{key:0,ref:"label"},d.toDisplayString(a.label),513)):d.createCommentVNode("",!0),d.createVNode(AB,{class:"ui-multiselect-button__contour"}),d.createElementVNode("div",whe,[a.title?(d.openBlock(),d.createElementBlock("div",Che,d.toDisplayString(a.title),1)):d.createCommentVNode("",!0),a.palette&&d.unref(tS)(a.palette)?(d.openBlock(),d.createElementBlock("div",bhe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(Do)[a.palette].colors.slice(0,Ehe),o=>(d.openBlock(),d.createElementBlock("div",{class:"gradient__item",style:d.normalizeStyle({background:o})},null,4))),256))])):a.palette?(d.openBlock(),d.createElementBlock("div",{key:2,class:"gradient",style:d.normalizeStyle(r(d.unref(Do)[a.palette].colors))},null,4)):(d.openBlock(),d.createBlock(d.unref(pt.PlIcon16),{key:3,class:"icon",name:"chevron-right"}))])],512))}}),xhe={class:"palettes-groups"},She={class:"palettes-list"},Bhe=["onClick"],khe={class:"palette-gradient"},The={class:"palettes-list"},_he=["onClick"],Phe={class:"palettes-list"},Mhe=["onClick"],Dhe=9,l3=d.defineComponent({__name:"PalettesForm",props:{selected:{},categorical:{type:Boolean,default:!0},sequential:{type:Boolean,default:!0},diverging:{type:Boolean,default:!0}},emits:["select"],setup(e,{emit:t}){const n=t;function r(i){n("select",i)}function a(i){const o=100/(i.length-1);return`background: linear-gradient(to right, ${i.map((s,c)=>`${s} ${c*o}%`).join(", ")})`}return(i,o)=>(d.openBlock(),d.createElementBlock("div",xhe,[i.categorical?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[o[0]||(o[0]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"CATEGORICAL")],-1)),o[1]||(o[1]=d.createElementVNode("div",{class:"section-description"}," Best to representing categorical data ",-1)),d.createElementVNode("div",She,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(oL),s=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["palettes-list__palette",{selected:i.selected===s}]),onClick:d.withModifiers(c=>r(s),["stop"])},[d.createElementVNode("div",null,d.toDisplayString(d.unref(Do)[s].title),1),d.createElementVNode("div",khe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(Do)[s].colors.slice(0,Dhe),c=>(d.openBlock(),d.createElementBlock("div",{class:"palette-gradient__item",style:d.normalizeStyle({background:c})},null,4))),256))])],10,Bhe))),256))])],64)):d.createCommentVNode("",!0),i.sequential?(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[o[2]||(o[2]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"SEQUENTIAL")],-1)),o[3]||(o[3]=d.createElementVNode("div",{class:"section-description"}," Best to representing sequential data ",-1)),d.createElementVNode("div",The,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(pae),s=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["palettes-list__palette",{selected:i.selected===s}]),onClick:d.withModifiers(c=>r(s),["stop"])},[d.createElementVNode("div",null,d.toDisplayString(d.unref(Do)[s].title),1),d.createElementVNode("div",{class:"palette-gradient",style:d.normalizeStyle(a(d.unref(Do)[s].colors))},null,4)],10,_he))),256))])],64)):d.createCommentVNode("",!0),i.diverging?(d.openBlock(),d.createElementBlock(d.Fragment,{key:2},[o[4]||(o[4]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"DIVERGING")],-1)),o[5]||(o[5]=d.createElementVNode("div",{class:"section-description"}," Best to representing diverging data ",-1)),d.createElementVNode("div",Phe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(hae),s=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["palettes-list__palette",{selected:i.selected===s}]),onClick:d.withModifiers(c=>r(s),["stop"])},[d.createElementVNode("div",null,d.toDisplayString(d.unref(Do)[s].title),1),d.createElementVNode("div",{class:"palette-gradient",style:d.normalizeStyle(a(d.unref(Do)[s].colors))},null,4)],10,Mhe))),256))])],64)):d.createCommentVNode("",!0)]))}}),Hhe=["onClick"],d$=d.defineComponent({__name:"FixedColorsList",props:{modelValue:{},colorUsing:{default:"fill"},colorsList:{default:()=>_y}},emits:["update:modelValue"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.colorsList,a=>(d.openBlock(),d.createElementBlock("div",{key:a.color,class:d.normalizeClass(["color-item",{border:n.colorUsing==="stroke",white:a.name==="White",empty:a.name==="None",selected:a.color===n.modelValue}]),style:d.normalizeStyle(a.name!=="White"&&a.name!=="None"?`${n.colorUsing==="fill"?"background":"border-color"}: ${a.color};`:""),onClick:i=>n.$emit("update:modelValue",a.color)},r[0]||(r[0]=[d.createElementVNode("div",{class:"checkmark"},null,-1)]),14,Hhe))),128))}}),Ihe=["onClick"],Lhe={class:"row-item__title"},fb=d.defineComponent({__name:"FixedLineTypeList",props:{modelValue:{},list:{default:()=>My}},emits:["update:modelValue"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.list,a=>(d.openBlock(),d.createElementBlock("div",{key:a,class:d.normalizeClass(["row-item",{"row-item__selected":a===n.modelValue,[`line__${a}`]:!0}]),onClick:i=>n.$emit("update:modelValue",a)},[d.createElementVNode("div",Lhe,d.toDisplayString(d.unref(vae)[a].title),1),(d.openBlock(),d.createElementBlock("svg",{class:d.normalizeClass(["row-item__line line",{[`line__${a}`]:!0}])},r[0]||(r[0]=[d.createElementVNode("line",{x1:"0",x2:"100%",y1:"50%",y2:"50%"},null,-1)]),2))],10,Ihe))),128))}}),Rhe=["onClick"],A$=d.defineComponent({__name:"FixedDotShapeList",props:{modelValue:{},list:{default:()=>N5}},emits:["update:modelValue"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.list,a=>(d.openBlock(),d.createElementBlock("div",{key:a,class:d.normalizeClass(["color-item dot",{selected:a===n.modelValue,[`dot__${a}`]:!0}]),onClick:i=>n.$emit("update:modelValue",a)},null,10,Rhe))),128))}}),db=d.defineComponent({__name:"Popup",props:{gap:{default:8},targetRef:{},width:{default:258},height:{}},emits:["popup:close"],setup(e,{emit:t}){const n=t,r=e;function a(){n("popup:close")}const i=d.ref(),o=d.ref(r.targetRef),s=d.ref("bottom"),c=d.ref(""),f=d.ref("");function A(h,m=8){pt.usePosition(h,g=>{if(r.height&&g.offsetY+g.height+3*m+r.height>g.clientHeight){const C=g.right-g.width-m;if(g.clientHeight-g.offsetY>r.height+m){const x=g.offsetY;c.value=`left: ${C}px; top: ${x}px;`,f.value="top: 16px;",s.value="left-bottom"}else{const x=g.clientHeight-r.height-2*m;c.value=`left: ${C}px; top: ${x}px;`;const k=g.offsetY+2*Math.floor(g.height/2),_=g.clientHeight-k;f.value=`bottom: ${_}px;`,s.value="left-bottom"}}else c.value=`left: ${g.right}px; top: ${g.offsetY+g.height+m}px;`,f.value="",s.value="bottom"})}return A(o,r.gap),pt.useClickOutside([o,i],()=>a()),(h,m)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createElementVNode("div",{class:"popup",style:d.normalizeStyle(c.value),onClick:m[0]||(m[0]=g=>g.stopPropagation())},[d.createElementVNode("div",{ref_key:"popup",ref:i,class:d.normalizeClass(["popup__content",s.value]),style:d.normalizeStyle({width:`${h.width}px`})},[d.createElementVNode("div",null,[d.renderSlot(h.$slots,"default")]),(d.openBlock(),d.createElementBlock("svg",{style:d.normalizeStyle(f.value),class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m[1]||(m[1]=[d.createElementVNode("path",{d:"M4 8L0 4L4 0L4 8 Z"},null,-1),d.createElementVNode("polyline",{points:"4,8 0,4 4,0"},null,-1)]),4))],6)],4)]))}}),Nhe={},$he={xmlns:"http://www.w3.org/2000/svg",width:"8",height:"12",viewBox:"0 0 8 12",fill:"none"};function Fhe(e,t){return d.openBlock(),d.createElementBlock("svg",$he,t[0]||(t[0]=[d.createStaticVNode('<path d="M2.5 0H0.5V2H2.5V0Z" fill="#CFD1DB"></path><path d="M2.5 5H0.5V7H2.5V5Z" fill="#CFD1DB"></path><path d="M0.5 10H2.5V12H0.5V10Z" fill="#CFD1DB"></path><path d="M7.5 0H5.5V2H7.5V0Z" fill="#CFD1DB"></path><path d="M5.5 5H7.5V7H5.5V5Z" fill="#CFD1DB"></path><path d="M7.5 10H5.5V12H7.5V10Z" fill="#CFD1DB"></path>',6)]))}const Vhe=Wr(Nhe,[["render",Fhe]]);var Ohe=Object.defineProperty,Qhe=(e,t,n)=>t in e?Ohe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pB=(e,t,n)=>Qhe(e,typeof t!="symbol"?t+"":t,n);function zhe(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value");return e}function Uhe(e,t){if(e===void 0)throw Error(t??"Undefined value");return e}function jhe(e=void 0){return e}function Ghe(e){return e}function Yhe(e){return[...new Set(e)]}function Whe(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value")}function Xhe(e,t){if(e===void 0)throw Error(t??"Undefined value")}function Khe(e,t,n){const r=Math.min(t,n),a=Math.max(t,n);return e>=r&&e<=a}function Zhe(e){return e.map(t=>({text:String(t),value:t}))}function Jhe(e){return function(...t){const n=e(...t);async function r(a){return a.done?Promise.resolve(a.value):Promise.resolve(a.value).then(i=>r(n.next(i))).catch(i=>r(n.throw(i)))}try{return r(n.next())}catch(a){return Promise.reject(a instanceof Error?a:Error(String(a)))}}}class qhe{constructor(){pB(this,"promise"),pB(this,"resolve",()=>{}),pB(this,"reject",()=>{}),this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}}function hB(e){return new Promise(t=>setTimeout(t,e))}function e1e(){return new Promise(e=>queueMicrotask(e))}function t1e(){const e=new Date().getTime();return function(){return new Date().getTime()-e}}function n1e(){const e=performance.now();return function(){return performance.now()-e}}function r1e(e){return e()}function a1e(e,t,n){return t>e?t:e>n?n:e}function i1e(e,t){return t(e)}function o1e(e,t){if(e!=null)return t(e)}function l1e(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}function*p$(e,t,n=1){for(let r=e;r<t;r+=n)yield r}function h$(e){const t=[];for(const n of e)t.push(n);return t}function s1e(e,t){return h$(p$(0,e)).map(t)}let u1e=class{constructor(t){this._delay=t}async*generate(){let t=0;for(;;)await hB(this._delay),yield t++}async*[Symbol.asyncIterator](){let t=0;for(;;)await hB(this._delay),yield t++}};function c1e(e,t){return Array.from({length:e},(n,r)=>t(r))}function f1e(e,t){throw Error(t)}function d1e(e){return t=>e[t]()}function A1e(e){if(e&&e.ok)return e.value}function p1e(e){if(e&&!e.ok)return e.error}function h1e(e){if(e.ok)return e.value;throw Error(e.error)}function m1e(e){return Array.isArray(e)?e:[e]}async function v1e(e){return Object.fromEntries(await Promise.all(Object.entries(e).map(async([t,n])=>[t,await n])))}function g1e(e,t){return Object.keys(t).every(n=>e[n]===t[n])}const y1e=e=>e;function w1e(e){return e}function C1e(e){return Object.entries(e).map(([t,n])=>({key:t,value:n}))}const R7=Object.freeze(Object.defineProperty({__proto__:null,Deferred:qhe,Interval:u1e,alike:g1e,arrayFrom:c1e,asConst:w1e,async:Jhe,between:Khe,bool:Ghe,call:r1e,checkIfDefined:Xhe,checkIfNotEmpty:Whe,clamp:a1e,delay:hB,errorOptional:p1e,exhaustive:f1e,flatValue:m1e,identity:y1e,listToOptions:Zhe,match:d1e,notEmpty:zhe,notUndef:Uhe,okOptional:A1e,performanceTimer:n1e,randomInt:l1e,range:p$,resolveAwaited:v1e,tap:i1e,tapIf:o1e,tear:e1e,timer:t1e,times:s1e,toList:h$,undef:jhe,unionize:C1e,uniqueValues:Yhe,unwrap:h1e},Symbol.toStringTag,{value:"Module"})),N7=Array.isArray;function Ab(e){return e!==null&&typeof e=="object"}function s3(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null}function b1e(e,t){return Object.keys(e).map(n=>t(e[n],n))}function m$(e){return Object.values(e).reduce((t,n)=>n!==void 0?t+1:t,0)}function pb(e,t){if(!(Ab(e)&&Ab(t)))return e===t;if(N7(e)&&N7(t))return e.length!==t.length?!1:[...e.keys()].every(n=>pb(e[n],t[n]));if(s3(e)&&s3(t))return m$(e)!==m$(t)?!1:Object.keys(e).every(n=>pb(e[n],t[n]));throw Error(`Cannot compare a ${String(e)} and b ${String(t)}`)}const E1e=pb;function mB(e){if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=mB(e[n]);return t}else if(s3(e)){const t={};return Object.keys(e).forEach(n=>{t[n]=mB(e[n])}),t}else return e}function x1e(e){return Array.isArray(e)?Object.assign([],e):Ab(e)?Object.assign({},e):e}function S1e(e,t){const n={};for(const r in t)t[r]!==e[r]&&(n[r]=e[r]);return n}function B1e(e){return Object.entries(e).forEach(([t,n])=>{n instanceof Function&&(e[t]=n.bind(e))}),e}function k1e(e,t,n){return e[t]=n,e}function T1e(e,t){return e[t]}function _1e(e,t){e={...e};const n=e[t];return delete e[t],[n,e]}function P1e(e,...t){return Object.assign({},...t.map(n=>({[n]:e[n]})))}function M1e(e,...t){return t.map(n=>e[n])}function D1e(e,...t){const n=Object.assign({},e);return t.forEach(r=>delete n[r]),n}function v$(e,t){return new Set([...Object.keys(e),...Object.keys(t)]).forEach(n=>{const r=e[n],a=t[n];s3(r)&&s3(a)||N7(r)&&N7(a)&&r.length===a.length?v$(r,a):e[n]=a}),e}const H1e=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:B1e,deepClone:mB,deepEqual:E1e,deepPatch:v$,getProp:T1e,isArray:N7,isJsonEqual:pb,isNonPrimitive:Ab,isPlainObject:s3,map:b1e,omit:D1e,pick:P1e,pickValues:M1e,setProp:k1e,shallowClone:x1e,shallowDiff:S1e,shiftProp:_1e},Symbol.toStringTag,{value:"Module"})),hb=1,I1e=d.defineComponent({__name:"PlColorSliderThumb",props:{barRef:{},modelValue:{},min:{default:0},max:{default:100},getColorForPercent:{},padding:{default:16},isActive:{type:Boolean}},emits:["update:modelValue","active"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.ref(),o=d.ref(!1),s=n.min,c=n.max;let f=d.ref(0);const A=c-s,h=n.padding/n.barRef.getBoundingClientRect().width*100/2,m=d.computed(()=>R7.clamp((n.modelValue??0)+f.value,Math.ceil(s+h),Math.ceil(c-h))),g=d.computed(()=>({right:`calc(${Math.ceil((1-b.value)*100)}%) `})),b=d.computed(()=>(m.value-s)/A);function C(O){const I=R7.clamp(O,s,c);return Math.round((I+Number.EPSILON)*(1/hb))/(1/hb)}function x(){o.value=!1}function k(O){O?(document.addEventListener("mouseup",x),document.addEventListener("focusout",x)):(document.removeEventListener("mouseup",x),document.removeEventListener("focusout",x)),o.value=O,r("active",O)}pt.useMouseCapture(a,O=>{var I;R7.tapIf((I=d.unref(n.barRef))==null?void 0:I.getBoundingClientRect(),$=>{const{dx:Q}=O;f.value=Q/$.width*A,O.stop&&(r("update:modelValue",C(m.value)),f.value=0)})});function _(O){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(O.code)&&O.preventDefault(),O.code==="ArrowLeft"&&r("update:modelValue",R7.clamp(n.modelValue-hb,s,c)),O.code==="ArrowRight"&&r("update:modelValue",R7.clamp(n.modelValue+hb,s,c))}function D(O){var I,$;O?(I=i.value)==null||I.classList.add("pl-color-slider__top-index"):($=i.value)==null||$.classList.remove("pl-color-slider__top-index")}return(O,I)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"wrapper",ref:i,style:d.normalizeStyle(g.value),class:d.normalizeClass([{"active-thumb":o.value||O.isActive},"pl-color-slider__thumb"]),tabindex:"0",onMousedown:I[2]||(I[2]=$=>k(!0)),onMouseup:I[3]||(I[3]=$=>k(!1)),onKeydown:_,onFocus:I[4]||(I[4]=$=>k(!0))},[d.createElementVNode("div",{ref_key:"thumb",ref:a,class:d.normalizeClass([{active:o.value},"pl-color-slider__thumb-roof"]),onMouseover:I[0]||(I[0]=$=>D(!0)),onMouseout:I[1]||(I[1]=$=>D(!1))},[d.createElementVNode("div",{class:"pl-color-slider__thumb-color-indicator",style:d.normalizeStyle({backgroundColor:O.getColorForPercent(m.value)})},null,4)],34)],38))}}),L1e={class:"pl-color-slider"},R1e={class:"pl-color-slider__wrapper"},N1e={class:"pl-color-slider__thumbs-contaier"},$1e=d.defineComponent({__name:"PlColorSlider",props:{colors:{},modelValue:{},getColorForPercent:{type:Function},active:{}},emits:["update:modelValue","active"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.reactive({}),o=d.ref(-1);d.watch(()=>n.modelValue,()=>{n.modelValue.forEach((A,h)=>i[h]=A)},{immediate:!0});const s=d.computed(()=>Math.floor(o.value!==-1?0-o.value:0)),c=d.computed(()=>Math.floor(o.value!==-1?100+o.value:100));d.watch(()=>i,A=>{r("update:modelValue",Object.values(A))},{deep:!0});const f=d.computed(()=>{const A=100/(n.colors.length-1);return`linear-gradient(to right, ${n.colors.map((m,g)=>`${m} ${A*g}%`).join(", ")})`});return d.onMounted(()=>{let A=16,h=a.value.getBoundingClientRect().width-A*2;o.value=A/h*100}),(A,h)=>(d.openBlock(),d.createElementBlock("div",L1e,[d.createElementVNode("div",R1e,[d.createElementVNode("div",{ref_key:"barRef",ref:a,class:"pl-color-slider__color-contaier"},[d.createElementVNode("div",{style:d.normalizeStyle({background:f.value}),class:"pl-color-slider__gradient"},null,4)],512),d.createElementVNode("div",N1e,[a.value?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(A.modelValue,(m,g)=>(d.openBlock(),d.createBlock(I1e,{modelValue:i[g],"onUpdate:modelValue":b=>i[g]=b,"is-active":A.active===g,key:g,min:s.value,max:c.value,"bar-ref":a.value,"get-color-for-percent":A.getColorForPercent,class:"pl-color-slider__thumb",tabindex:"0",onActive:b=>A.$emit("active",{index:g,status:b})},null,8,["modelValue","onUpdate:modelValue","is-active","min","max","bar-ref","get-color-for-percent","onActive"]))),128)):d.createCommentVNode("",!0)])])]))}});function g$(e,t){if(t==="lineType")return e*32+16*2;if(t==="dotShape"||t==="color")return Math.ceil(e/6)*36+20*2}const F1e={class:"aes-mapping-block"},V1e={style:{margin:"0 24px"}},O1e={class:"section-title"},Q1e={style:{margin:"24px 0"}},z1e={key:0,style:{margin:"24px 0"}},U1e={key:0,class:"aes-settings-hint"},j1e={key:0,class:"column-value__reorder-icon"},G1e={class:"column-value__title"},Y1e={class:"column-value__aes-group"},W1e=["onClick"],X1e=["onClick"],K1e=["onClick"],vB=d.defineComponent({__name:"AesDataMappingDiscrete",props:{dataColumnLabel:{},columnValueLabels:{},usedAesInMapping:{},modelValue:{},allowReordering:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(!1),i=d.ref(n.modelValue.palette),o=d.computed(()=>tS(i.value)),s=d.ref(null),c=d.computed(()=>s.value===null?null:n.modelValue.order.indexOf(s.value)),f=d.ref(null),A=d.computed(()=>n.modelValue.order.map(re=>{var G;const U=(G=n.modelValue.mapping[re])==null?void 0:G.aes;return{text:n.columnValueLabels[re],value:re,dotShape:U==null?void 0:U.dotShape,color:U==null?void 0:U.color,lineType:U==null?void 0:U.lineShape}}));function h(re){i.value=re,a.value=!1,r("update:modelValue",gR(re,n.modelValue.order))}function m(re,U,G){r("update:modelValue",{...n.modelValue,mapping:{...n.modelValue.mapping,[re]:{...n.modelValue.mapping[re],aes:{...n.modelValue.mapping[re].aes,[U]:G}}}})}const g=d.reactive({color:{},dotShape:{},lineType:{}});function b(re,U,G){G&&!g[re][U.value]&&(g[re][U.value]=G)}function C(re,U){const G=s.value===re.value&&f.value===U;s.value=G?null:re.value,f.value=G?null:U}function x(){s.value=null,f.value=null}const k=d.computed(()=>Do[i.value].colors.map(re=>({color:re,name:re}))),_=d.computed(()=>f.value?g$(f.value==="lineType"?My.length:f.value==="dotShape"?N5.length:k.value.length,f.value):0),D=d.ref();n.allowReordering&&pt.useSortable(D,{handle:".column-value__reorder-icon",onChange(re){r("update:modelValue",{...n.modelValue,order:re.map(U=>n.modelValue.order[U])})}});function O(re,U,G=0,Z=1){const Y=1/(re.length-1),X=Da().domain(re.map((oe,me)=>G+me*Y*(Z-G))).range(re);return oe=>oe>Z||oe<G?U:X(oe)}const I=d.computed(()=>O(Do[i.value].colors,dC)),$=d.computed(()=>O(Do[i.value].colors,dC,0,100)),Q=d.ref(n.modelValue.order.map(re=>n.modelValue.mapping[re].colorIdx*100));d.watch(()=>n.modelValue,re=>{Q.value=re.order.map(U=>re.mapping[U].colorIdx*100)});function ee(re){re.forEach((U,G)=>{const Z=n.modelValue.order[G],Y=U/100;n.modelValue.mapping[Z].colorIdx!==Y&&r("update:modelValue",{...n.modelValue,mapping:{...n.modelValue.mapping,[Z]:{colorIdx:Y,aes:{...n.modelValue.mapping[Z].aes,color:I.value(Y)}}}})})}function K(re){f.value="color",s.value=re.status?n.modelValue.order[re.index]:null}return(re,U)=>(d.openBlock(),d.createElementBlock("div",F1e,[d.createElementVNode("div",V1e,[d.createElementVNode("div",O1e,[d.createElementVNode("span",null,d.toDisplayString(re.dataColumnLabel),1)]),d.createElementVNode("div",Q1e,[d.createVNode(o3,{label:"Color Palette ",icon:"chevron-right",title:d.unref(Do)[i.value].title,palette:i.value,onButtonClick:U[0]||(U[0]=G=>{a.value=!0,x()})},null,8,["title","palette"])]),o.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",z1e,[d.createVNode($1e,{modelValue:Q.value,"onUpdate:modelValue":[U[1]||(U[1]=G=>Q.value=G),ee],colors:d.unref(Do)[i.value].colors,"get-color-for-percent":$.value,active:c.value,onActive:K},null,8,["modelValue","colors","get-color-for-percent","active"])])),a.value?(d.openBlock(),d.createBlock(Qh,{key:1,title:"Color Palette","back-title":"Color mapping","onForm:close":U[2]||(U[2]=G=>a.value=!1)},{default:d.withCtx(()=>[d.createVNode(l3,{selected:i.value,onSelect:h},null,8,["selected"])]),_:1})):d.createCommentVNode("",!0)]),re.allowReordering?(d.openBlock(),d.createElementBlock("div",U1e," Drag the rows to reorder ")):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"column-values-list",ref_key:"optionsListRef",ref:D},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(A.value,G=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["column-value",{"column-value__with-reorder":re.allowReordering}])},[re.allowReordering?(d.openBlock(),d.createElementBlock("div",j1e,[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(Vhe)))])):d.createCommentVNode("",!0),d.createElementVNode("div",G1e,d.toDisplayString(G.text),1),d.createElementVNode("div",Y1e,[re.usedAesInMapping.lineType?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["column-value__aes",{aes__selected:s.value===G.value&&f.value==="lineType"}]),ref_for:!0,ref:Z=>b("lineType",G,Z),onClick:d.withModifiers(Z=>C(G,"lineType"),["stop"])},[d.createElementVNode("div",{class:d.normalizeClass(["icon__line line",{[`line__${G.lineType}`]:!0}])},null,2)],10,W1e)):d.createCommentVNode("",!0),re.usedAesInMapping.dotShape?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["column-value__aes",{aes__selected:s.value===G.value&&f.value==="dotShape"}]),ref_for:!0,ref:Z=>b("dotShape",G,Z),onClick:d.withModifiers(Z=>C(G,"dotShape"),["stop"])},[d.createElementVNode("div",{class:d.normalizeClass(["dot",{[`dot__${G.dotShape}`]:!0}])},null,2)],10,X1e)):d.createCommentVNode("",!0),re.usedAesInMapping.fill||re.usedAesInMapping.stroke?(d.openBlock(),d.createElementBlock("div",{key:2,class:d.normalizeClass(["column-value__aes",{aes__selected:s.value===G.value&&f.value==="color"}]),ref_for:!0,ref:Z=>b("color",G,Z),onClick:d.withModifiers(Z=>C(G,"color"),["stop"])},[d.createElementVNode("div",{class:"column-value__color",style:d.normalizeStyle({background:G.color})},null,4)],10,K1e)):d.createCommentVNode("",!0),(f.value!=="color"||o.value)&&f.value!==null&&s.value===G.value?(d.openBlock(),d.createBlock(db,{key:`${f.value}_${s.value}`,targetRef:g[f.value][s.value],"onPopup:close":x,height:_.value},{default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["fixed-aes-list",{"fixed-aes-list__rows":!1}])},[f.value==="lineType"?(d.openBlock(),d.createBlock(fb,{key:0,"onUpdate:modelValue":[Z=>m(G.value,"lineShape",Z),Z=>G.lineType=Z],modelValue:G.lineType},null,8,["onUpdate:modelValue","modelValue"])):d.createCommentVNode("",!0),f.value==="dotShape"?(d.openBlock(),d.createBlock(A$,{key:1,"onUpdate:modelValue":[Z=>m(G.value,"dotShape",Z),Z=>G.dotShape=Z],modelValue:G.dotShape},null,8,["onUpdate:modelValue","modelValue"])):d.createCommentVNode("",!0),f.value==="color"?(d.openBlock(),d.createBlock(d$,{key:2,"colors-list":k.value,"onUpdate:modelValue":[Z=>m(G.value,"color",Z),Z=>G.color=Z],modelValue:G.color},null,8,["colors-list","onUpdate:modelValue","modelValue"])):d.createCommentVNode("",!0)])]),_:2},1032,["targetRef","height"])):d.createCommentVNode("",!0)])],2))),256))],512)]))}}),Z1e={class:"axes-settings-list"},J1e={class:"axes-settings-options-row block"},q1e={key:0,class:"axes-settings-input"},eme={class:"axes-settings-options-row"},tme={key:0,class:"axes-settings-options-row"},nme={key:1,class:"axes-settings-options-row"},rme={key:2,class:"axes-settings-options-row"},ame={class:"axes-settings-options-row block"},ime={key:3},ome={class:"axes-settings-options-row table"},lme={class:"axes-settings-options-row table"},sme={class:"axes-settings-options-row table"},ume={class:"axes-settings-options-row block"},cme={key:0},fme={class:"axes-settings-options-row block"},dme={class:"axes-settings-options-row table"},Ame={class:"axes-settings-options-row table"},pme={class:"other"},hme={class:"axes-settings-options-row"},mme={class:"axes-settings-options-row"},vme={class:"axes-settings-options-row"},gme={class:"axes-settings-options-row block"},yme=d.defineComponent({__name:"DiscreteAxesSettingsForm",setup(e){const t=da(),n=t.value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:P7},{value:"center",icon:M7},{value:"right",icon:D7}],i=[{value:"center",icon:lB},{value:"45deg",icon:sB},{value:"90deg",icon:uB}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"linear",text:"Linear"},{value:"log",text:"Log"}],c=[{value:"empty",icon:I7},{value:"left",icon:cB},{value:"bottom",icon:fB},{value:"left-bottom",icon:dB},{value:"full",icon:H7}],f=d.computed(()=>t.value.inputGuide.value),A=d.computed(()=>t.value.uniqueValuesData.value),h=d.ref(!1),m=d.ref(!1),g=d.computed(()=>{var re,U;return(U=(re=t.value.reactive.optionsState.components.primaryGrouping)==null?void 0:re.selectorStates[0])==null?void 0:U.selectedSource}),b=d.computed(()=>{var re,U;return(U=(re=t.value.reactive.optionsState.components.secondaryGrouping)==null?void 0:re.selectorStates[0])==null?void 0:U.selectedSource}),C=d.computed(()=>t.value.commonHelpersData.primaryGroups.value),x=d.computed(()=>t.value.commonHelpersData.secondaryGroups.value),k=d.computed(()=>t.value.commonHelpersData.usedAesInMapping.value),_=d.ref(t.value.reactive.dataBindAes[g.value]??Uy(C.value)),D=d.ref(t.value.reactive.dataBindAes[b.value]??Uy(x.value)),O=d.computed(()=>{var re;if(g.value){const U=f.value.getSourceInfo(g.value)??null,G=((re=A.value[g.value])==null?void 0:re.labels)??null;return{selectedSourceInfo:U,labels:C.value.reduce((Z,Y)=>(Z[Y]=(G==null?void 0:G[Y])??String(Y),Z),{})}}}),I=d.computed(()=>{var re;if(b.value){const U=f.value.getSourceInfo(b.value)??null,G=((re=A.value[b.value])==null?void 0:re.labels)??null;return{selectedSourceInfo:U,labels:x.value.reduce((Z,Y)=>(Z[Y]=(G==null?void 0:G[Y])??String(Y),Z),{})}}});function $(re,U){t.value.reactive.dataBindAes[U]=re}const Q=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}],ee=d.computed(()=>A.value[g.value]),K=d.computed({get(){var re;return DR(n.axisX.labelsRotation,(re=ee.value)==null?void 0:re.options)},set(re){n.axisX.labelsRotation=re}});return(re,U)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:U[26]||(U[26]=G=>G.stopPropagation())},[U[38]||(U[38]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",Z1e,[d.createVNode(ts,{title:"Title",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",J1e,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":U[0]||(U[0]=G=>d.unref(n).title.mode=G)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",q1e,[d.createVNode(d.unref(pt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":U[1]||(U[1]=G=>d.unref(n).title.value=G)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",eme,[U[27]||(U[27]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Uf,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":U[2]||(U[2]=G=>d.unref(n).title.position=G)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"X-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[C.value.length>1?(d.openBlock(),d.createElementBlock("div",tme,[U[28]||(U[28]=d.createElementVNode("span",null,"Primary groups order: ",-1)),d.createVNode(L7,{data:{type:"data",value:null},onClick:U[3]||(U[3]=G=>{h.value=!0})}),h.value&&O.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Reorder primary groups","back-title":"Axes Settings","onForm:close":U[6]||(U[6]=G=>h.value=!1)},{default:d.withCtx(()=>{var G;return[d.createVNode(vB,{"column-value-labels":O.value.labels,"data-column-label":((G=O.value.selectedSourceInfo)==null?void 0:G.label)??"","used-aes-in-mapping":k.value[g.value],"allow-reordering":"",modelValue:_.value,"onUpdate:modelValue":[U[4]||(U[4]=Z=>_.value=Z),U[5]||(U[5]=Z=>$(Z,g.value))]},null,8,["column-value-labels","data-column-label","used-aes-in-mapping","modelValue"])]}),_:1})):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),x.value.length>1?(d.openBlock(),d.createElementBlock("div",nme,[U[29]||(U[29]=d.createElementVNode("span",null,"Secondary groups order: ",-1)),d.createVNode(L7,{data:{type:"data",value:null},onClick:U[7]||(U[7]=G=>{m.value=!0})}),m.value&&I.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Reorder secondary groups","back-title":"Axes Settings","onForm:close":U[10]||(U[10]=G=>m.value=!1)},{default:d.withCtx(()=>{var G;return[d.createVNode(vB,{"column-value-labels":I.value.labels,"data-column-label":((G=I.value.selectedSourceInfo)==null?void 0:G.label)??"","used-aes-in-mapping":k.value[b.value],"allow-reordering":"",modelValue:D.value,"onUpdate:modelValue":[U[8]||(U[8]=Z=>D.value=Z),U[9]||(U[9]=Z=>$(Z,b.value))]},null,8,["column-value-labels","data-column-label","used-aes-in-mapping","modelValue"])]}),_:1})):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createElementBlock("div",rme,[U[30]||(U[30]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Uf,{options:i,modelValue:K.value,"onUpdate:modelValue":U[11]||(U[11]=G=>K.value=G)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",ame,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":U[12]||(U[12]=G=>d.unref(n).axisX.titleMode=G)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",ime,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":U[13]||(U[13]=G=>d.unref(n).axisX.customTitle=G)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",ome,[U[31]||(U[31]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.gridlines,"onUpdate:modelValue":U[14]||(U[14]=G=>d.unref(n).axisX.gridlines=G)},null,8,["modelValue"])]),d.createElementVNode("div",lme,[U[32]||(U[32]=d.createElementVNode("span",null,"Lines between categories",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.linesBetweenCategories,"onUpdate:modelValue":U[15]||(U[15]=G=>d.unref(n).axisX.linesBetweenCategories=G)},null,8,["modelValue"])]),d.createElementVNode("div",sme,[U[33]||(U[33]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.ticks,"onUpdate:modelValue":U[16]||(U[16]=G=>d.unref(n).axisX.ticks=G)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"Y-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",ume,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":U[17]||(U[17]=G=>d.unref(n).axisY.titleMode=G)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",cme,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":U[18]||(U[18]=G=>d.unref(n).axisY.customTitle=G)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",fme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Scale",options:s,modelValue:d.unref(n).axisY.scale,"onUpdate:modelValue":U[19]||(U[19]=G=>d.unref(n).axisY.scale=G)},null,8,["modelValue"])]),d.createElementVNode("div",dme,[U[34]||(U[34]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisY.gridlines,"onUpdate:modelValue":U[20]||(U[20]=G=>d.unref(n).axisY.gridlines=G)},null,8,["modelValue"])]),d.createElementVNode("div",Ame,[U[35]||(U[35]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisY.ticks,"onUpdate:modelValue":U[21]||(U[21]=G=>d.unref(n).axisY.ticks=G)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",pme,[d.createElementVNode("div",hme,[U[36]||(U[36]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Uf,{options:c,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":U[22]||(U[22]=G=>d.unref(n).other.frame=G)},null,8,["modelValue"])]),d.createElementVNode("div",mme,[U[37]||(U[37]=d.createElementVNode("span",null,"Reverse axes",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).other.reverse,"onUpdate:modelValue":U[23]||(U[23]=G=>d.unref(n).other.reverse=G)},null,8,["modelValue"])]),d.createElementVNode("div",vme,[d.createVNode(d.unref(pt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":U[24]||(U[24]=G=>d.unref(n).other.facetColumns=G)},null,8,["modelValue"])]),d.createElementVNode("div",gme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Facet shared by",options:Q,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":U[25]||(U[25]=G=>d.unref(n).other.facetSharedBy=G)},null,8,["modelValue"])])])])]))}}),wme={class:"axes-settings-list"},Cme={class:"axes-settings-options-row block"},bme={key:0,class:"axes-settings-input"},Eme={class:"axes-settings-options-row"},xme={class:"axes-settings-options-row block"},Sme={key:0},Bme={class:"axes-settings-options-row block"},kme={class:"axes-settings-options-row table"},Tme={class:"axes-settings-options-row table"},_me={class:"axes-settings-options-row"},Pme={class:"fixed-aes-list fixed-aes-list__rows"},Mme={class:"axes-settings-options-row block"},Dme={key:0},Hme={class:"axes-settings-options-row block"},Ime={class:"axes-settings-options-row table"},Lme={class:"axes-settings-options-row table"},Rme={class:"axes-settings-options-row"},Nme={class:"fixed-aes-list fixed-aes-list__rows"},$me={key:0,class:"other"},Fme={class:"axes-settings-options-row"},Vme={class:"axes-settings-options-row"},Ome={class:"axes-settings-options-row block"},Qme=d.defineComponent({__name:"ScatterplotAxesSettingsForm",setup(e){const t=da(),n=t.value.reactive.axesSettings,r=d.computed(()=>t.value.reactive.chartType),a={height:40,horizontalPadding:12,defaultState:"open"},i=[{value:"left",icon:P7},{value:"center",icon:M7},{value:"right",icon:D7}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"linear",text:"Linear"},{value:"log",text:"Log"}],c=[{value:"empty",icon:I7},{value:"left",icon:cB},{value:"bottom",icon:fB},{value:"left-bottom",icon:dB},{value:"full",icon:H7}],f=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}],A=d.ref(n.axisX.significantLinesStyle),h=d.ref(n.axisY.significantLinesStyle),m=d.computed(()=>g$(My.length,"lineType")),g=d.ref(),b=d.ref(),C=d.ref(!1),x=d.ref(!1);return(k,_)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:_[26]||(_[26]=D=>D.stopPropagation())},[_[35]||(_[35]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",wme,[d.createVNode(ts,{title:"Title",settings:a,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Cme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":_[0]||(_[0]=D=>d.unref(n).title.mode=D)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",bme,[d.createVNode(d.unref(pt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":_[1]||(_[1]=D=>d.unref(n).title.value=D)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Eme,[_[27]||(_[27]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Uf,{options:i,modelValue:d.unref(n).title.position,"onUpdate:modelValue":_[2]||(_[2]=D=>d.unref(n).title.position=D)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"X-axis",settings:a,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",xme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":_[3]||(_[3]=D=>d.unref(n).axisX.titleMode=D)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Sme,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":_[4]||(_[4]=D=>d.unref(n).axisX.customTitle=D)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Bme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Scale",options:s,modelValue:d.unref(n).axisX.scale,"onUpdate:modelValue":_[5]||(_[5]=D=>d.unref(n).axisX.scale=D)},null,8,["modelValue"])]),d.createElementVNode("div",kme,[_[28]||(_[28]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.gridlines,"onUpdate:modelValue":_[6]||(_[6]=D=>d.unref(n).axisX.gridlines=D)},null,8,["modelValue"])]),d.createElementVNode("div",Tme,[_[29]||(_[29]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.ticks,"onUpdate:modelValue":_[7]||(_[7]=D=>d.unref(n).axisX.ticks=D)},null,8,["modelValue"])]),d.createElementVNode("div",_me,[_[30]||(_[30]=d.createElementVNode("span",null,"Significant lines style",-1)),d.createVNode(L7,{data:{type:"lineType",value:A.value},onClick:_[8]||(_[8]=D=>C.value=!C.value),onRef:_[9]||(_[9]=D=>g.value=D)},null,8,["data"]),C.value?(d.openBlock(),d.createBlock(db,{key:0,height:m.value,targetRef:g.value,"onPopup:close":_[12]||(_[12]=D=>C.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",Pme,[d.createVNode(fb,{modelValue:A.value,"onUpdate:modelValue":[_[10]||(_[10]=D=>A.value=D),_[11]||(_[11]=D=>d.unref(n).axisX.significantLinesStyle=D)]},null,8,["modelValue"])])]),_:1},8,["height","targetRef"])):d.createCommentVNode("",!0)])]),_:1}),d.createVNode(ts,{title:"Y-axis",settings:a,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Mme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":_[13]||(_[13]=D=>d.unref(n).axisY.titleMode=D)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Dme,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":_[14]||(_[14]=D=>d.unref(n).axisY.customTitle=D)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Hme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Scale",options:s,modelValue:d.unref(n).axisY.scale,"onUpdate:modelValue":_[15]||(_[15]=D=>d.unref(n).axisY.scale=D)},null,8,["modelValue"])]),d.createElementVNode("div",Ime,[_[31]||(_[31]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisY.gridlines,"onUpdate:modelValue":_[16]||(_[16]=D=>d.unref(n).axisY.gridlines=D)},null,8,["modelValue"])]),d.createElementVNode("div",Lme,[_[32]||(_[32]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisY.ticks,"onUpdate:modelValue":_[17]||(_[17]=D=>d.unref(n).axisY.ticks=D)},null,8,["modelValue"])]),d.createElementVNode("div",Rme,[_[33]||(_[33]=d.createElementVNode("span",null,"Significant lines style",-1)),d.createVNode(L7,{data:{type:"lineType",value:h.value},onClick:_[18]||(_[18]=D=>x.value=!x.value),onRef:_[19]||(_[19]=D=>b.value=D)},null,8,["data"]),x.value?(d.openBlock(),d.createBlock(db,{key:0,height:m.value,targetRef:b.value,"onPopup:close":_[22]||(_[22]=D=>x.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",Nme,[d.createVNode(fb,{modelValue:h.value,"onUpdate:modelValue":[_[20]||(_[20]=D=>h.value=D),_[21]||(_[21]=D=>d.unref(n).axisY.significantLinesStyle=D)]},null,8,["modelValue"])])]),_:1},8,["height","targetRef"])):d.createCommentVNode("",!0)])]),_:1}),r.value==="scatterplot"?(d.openBlock(),d.createElementBlock("div",$me,[d.createElementVNode("div",Fme,[_[34]||(_[34]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Uf,{options:c,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":_[23]||(_[23]=D=>d.unref(n).other.frame=D)},null,8,["modelValue"])]),d.createElementVNode("div",Vme,[d.createVNode(d.unref(pt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":_[24]||(_[24]=D=>d.unref(n).other.facetColumns=D)},null,8,["modelValue"])]),d.createElementVNode("div",Ome,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Facet shared by",options:f,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":_[25]||(_[25]=D=>d.unref(n).other.facetSharedBy=D)},null,8,["modelValue"])])])):d.createCommentVNode("",!0)])]))}}),zme={class:"axes-settings-list"},Ume={class:"axes-settings-options-row block"},jme={key:0,class:"axes-settings-input"},Gme={class:"axes-settings-options-row"},Yme={class:"axes-settings-options-row"},Wme={class:"axes-settings-options-row block"},Xme={key:0},Kme={class:"axes-settings-options-row block"},Zme={class:"axes-settings-options-row"},Jme={class:"axes-settings-options-row block"},qme={key:0},eve={class:"axes-settings-options-row block"},tve={class:"other"},nve={class:"axes-settings-options-row"},rve={class:"axes-settings-options-row"},ave={class:"axes-settings-options-row block"},ive=d.defineComponent({__name:"HeatmapAxesSettingsForm",setup(e){const t=da(),n=t.value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:P7},{value:"center",icon:M7},{value:"right",icon:D7}],i=[{value:0,icon:lB},{value:45,icon:sB},{value:90,icon:uB}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"none",icon:I7},{value:"full",icon:H7}],c=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}],f=[{text:"ascending",value:"asc"},{text:"descending",value:"desc"}],A=d.computed(()=>t.value.reactive.layersSettings.heatmapClustered),h=d.computed(()=>c.filter(m=>t.value.reactive.template!=="heatmapClustered"?!0:A.value.dendrogramX&&A.value.dendrogramY?m.value!=="x"&&m.value!=="xy"&&m.value!=="y":A.value.dendrogramX?m.value!=="x"&&m.value!=="xy":A.value.dendrogramY?m.value!=="y"&&m.value!=="xy":!0));return(m,g)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:g[14]||(g[14]=b=>b.stopPropagation())},[g[19]||(g[19]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",zme,[d.createVNode(ts,{title:"Title",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Ume,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":g[0]||(g[0]=b=>d.unref(n).title.mode=b)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",jme,[d.createVNode(d.unref(pt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":g[1]||(g[1]=b=>d.unref(n).title.value=b)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Gme,[g[15]||(g[15]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Uf,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":g[2]||(g[2]=b=>d.unref(n).title.position=b)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"X-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Yme,[g[16]||(g[16]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Uf,{options:i,modelValue:d.unref(n).axisX.axisLabelsAngle,"onUpdate:modelValue":g[3]||(g[3]=b=>d.unref(n).axisX.axisLabelsAngle=b)},null,8,["modelValue"])]),d.createElementVNode("div",Wme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":g[4]||(g[4]=b=>d.unref(n).axisX.titleMode=b)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Xme,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":g[5]||(g[5]=b=>d.unref(n).axisX.customTitle=b)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Kme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Sorting",options:f,modelValue:d.unref(n).axisX.sorting,"onUpdate:modelValue":g[6]||(g[6]=b=>d.unref(n).axisX.sorting=b)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"Y-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Zme,[g[17]||(g[17]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Uf,{options:i,modelValue:d.unref(n).axisY.axisLabelsAngle,"onUpdate:modelValue":g[7]||(g[7]=b=>d.unref(n).axisY.axisLabelsAngle=b)},null,8,["modelValue"])]),d.createElementVNode("div",Jme,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":g[8]||(g[8]=b=>d.unref(n).axisY.titleMode=b)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",qme,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":g[9]||(g[9]=b=>d.unref(n).axisY.customTitle=b)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",eve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Sorting",options:f,modelValue:d.unref(n).axisY.sorting,"onUpdate:modelValue":g[10]||(g[10]=b=>d.unref(n).axisY.sorting=b)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",tve,[d.createElementVNode("div",nve,[g[18]||(g[18]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Uf,{options:s,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":g[11]||(g[11]=b=>d.unref(n).other.frame=b)},null,8,["modelValue"])]),d.createElementVNode("div",rve,[d.createVNode(d.unref(pt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":g[12]||(g[12]=b=>d.unref(n).other.facetColumns=b)},null,8,["modelValue"])]),d.createElementVNode("div",ave,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Facet shared by",options:h.value,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":g[13]||(g[13]=b=>d.unref(n).other.facetSharedBy=b)},null,8,["options","modelValue"])])])])]))}}),ove={class:"axes-settings-list"},lve={style:{padding:"0 24px 8px"}},sve={class:"axes-settings-options-row block"},uve={key:0,class:"axes-settings-input"},cve={class:"axes-settings-options-row"},fve={class:"axes-settings-options-row block"},dve={key:0},Ave={class:"axes-settings-options-row block"},pve={class:"axes-settings-options-row table"},hve={class:"axes-settings-options-row table"},mve={class:"axes-settings-options-row block"},vve={class:"axes-settings-options-row table"},gve={class:"axes-settings-options-row table"},yve={class:"other"},wve={class:"axes-settings-options-row"},Cve={class:"axes-settings-options-row"},bve={class:"axes-settings-options-row block"},Eve=d.defineComponent({__name:"HistogramAxesSettingsForm",setup(e){const n=da().value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:P7},{value:"center",icon:M7},{value:"right",icon:D7}],i=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],o=[{value:"linear",text:"Linear"},{value:"log",text:"Log"}],s=[{value:"empty",icon:I7},{value:"left",icon:cB},{value:"bottom",icon:fB},{value:"left-bottom",icon:dB},{value:"full",icon:H7}],c=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}];return(f,A)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:A[15]||(A[15]=h=>h.stopPropagation())},[A[22]||(A[22]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",ove,[d.createElementVNode("div",lve,[d.createVNode(d.unref(pt.Slider),{style:{width:"100%"},label:"Bins count",min:3,max:100,step:1,breakpoints:!1,mode:"input",modelValue:d.unref(n).other.binsCount,"onUpdate:modelValue":A[0]||(A[0]=h=>d.unref(n).other.binsCount=h)},null,8,["modelValue"])]),d.createVNode(ts,{title:"Title",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",sve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:i,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":A[1]||(A[1]=h=>d.unref(n).title.mode=h)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",uve,[d.createVNode(d.unref(pt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":A[2]||(A[2]=h=>d.unref(n).title.value=h)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",cve,[A[16]||(A[16]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Uf,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":A[3]||(A[3]=h=>d.unref(n).title.position=h)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"X-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",fve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:i,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":A[4]||(A[4]=h=>d.unref(n).axisX.titleMode=h)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",dve,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":A[5]||(A[5]=h=>d.unref(n).axisX.customTitle=h)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Ave,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Scale",options:o,modelValue:d.unref(n).axisX.scale,"onUpdate:modelValue":A[6]||(A[6]=h=>d.unref(n).axisX.scale=h)},null,8,["modelValue"])]),d.createElementVNode("div",pve,[A[17]||(A[17]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.gridlines,"onUpdate:modelValue":A[7]||(A[7]=h=>d.unref(n).axisX.gridlines=h)},null,8,["modelValue"])]),d.createElementVNode("div",hve,[A[18]||(A[18]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisX.ticks,"onUpdate:modelValue":A[8]||(A[8]=h=>d.unref(n).axisX.ticks=h)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"Y-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",mve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Scale",options:o,modelValue:d.unref(n).axisY.scale,"onUpdate:modelValue":A[9]||(A[9]=h=>d.unref(n).axisY.scale=h)},null,8,["modelValue"])]),d.createElementVNode("div",vve,[A[19]||(A[19]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisY.gridlines,"onUpdate:modelValue":A[10]||(A[10]=h=>d.unref(n).axisY.gridlines=h)},null,8,["modelValue"])]),d.createElementVNode("div",gve,[A[20]||(A[20]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(n).axisY.ticks,"onUpdate:modelValue":A[11]||(A[11]=h=>d.unref(n).axisY.ticks=h)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",yve,[d.createElementVNode("div",wve,[A[21]||(A[21]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Uf,{options:s,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":A[12]||(A[12]=h=>d.unref(n).other.frame=h)},null,8,["modelValue"])]),d.createElementVNode("div",Cve,[d.createVNode(d.unref(pt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":A[13]||(A[13]=h=>d.unref(n).other.facetColumns=h)},null,8,["modelValue"])]),d.createElementVNode("div",bve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Facet shared by",options:c,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":A[14]||(A[14]=h=>d.unref(n).other.facetSharedBy=h)},null,8,["modelValue"])])])])]))}}),xve={class:"axes-settings-list"},Sve={class:"axes-settings-options-row block"},Bve={key:0,class:"axes-settings-input"},kve={class:"axes-settings-options-row"},Tve={class:"axes-settings-options-row"},_ve={class:"axes-settings-options-row block"},Pve={key:0},Mve={class:"axes-settings-options-row block"},Dve={class:"axes-settings-options-row"},Hve={class:"axes-settings-options-row block"},Ive={key:0},Lve={class:"axes-settings-options-row block"},Rve={class:"other"},Nve={class:"axes-settings-options-row"},$ve={class:"axes-settings-options-row"},Fve=d.defineComponent({__name:"BubbleAxesSettingsForm",setup(e){const n=da().value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:P7},{value:"center",icon:M7},{value:"right",icon:D7}],i=[{value:0,icon:lB},{value:45,icon:sB},{value:90,icon:uB}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"none",icon:I7},{value:"full",icon:H7}],c=[{text:"ascending",value:"asc"},{text:"descending",value:"desc"}];return(f,A)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:A[13]||(A[13]=h=>h.stopPropagation())},[A[18]||(A[18]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",xve,[d.createVNode(ts,{title:"Title",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Sve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":A[0]||(A[0]=h=>d.unref(n).title.mode=h)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",Bve,[d.createVNode(d.unref(pt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":A[1]||(A[1]=h=>d.unref(n).title.value=h)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",kve,[A[14]||(A[14]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Uf,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":A[2]||(A[2]=h=>d.unref(n).title.position=h)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"X-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Tve,[A[15]||(A[15]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Uf,{options:i,modelValue:d.unref(n).axisX.axisLabelsAngle,"onUpdate:modelValue":A[3]||(A[3]=h=>d.unref(n).axisX.axisLabelsAngle=h)},null,8,["modelValue"])]),d.createElementVNode("div",_ve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":A[4]||(A[4]=h=>d.unref(n).axisX.titleMode=h)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Pve,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":A[5]||(A[5]=h=>d.unref(n).axisX.customTitle=h)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Mve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Sorting",options:c,modelValue:d.unref(n).axisX.sorting,"onUpdate:modelValue":A[6]||(A[6]=h=>d.unref(n).axisX.sorting=h)},null,8,["modelValue"])])]),_:1}),d.createVNode(ts,{title:"Y-axis",settings:r,icon:Qf,"icon-open":zf},{default:d.withCtx(()=>[d.createElementVNode("div",Dve,[A[16]||(A[16]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Uf,{options:i,modelValue:d.unref(n).axisY.axisLabelsAngle,"onUpdate:modelValue":A[7]||(A[7]=h=>d.unref(n).axisY.axisLabelsAngle=h)},null,8,["modelValue"])]),d.createElementVNode("div",Hve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":A[8]||(A[8]=h=>d.unref(n).axisY.titleMode=h)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Ive,[d.createVNode(d.unref(pt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":A[9]||(A[9]=h=>d.unref(n).axisY.customTitle=h)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Lve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Sorting",options:c,modelValue:d.unref(n).axisY.sorting,"onUpdate:modelValue":A[10]||(A[10]=h=>d.unref(n).axisY.sorting=h)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",Rve,[d.createElementVNode("div",Nve,[A[17]||(A[17]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Uf,{options:s,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":A[11]||(A[11]=h=>d.unref(n).other.frame=h)},null,8,["modelValue"])]),d.createElementVNode("div",$ve,[d.createVNode(d.unref(pt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":A[12]||(A[12]=h=>d.unref(n).other.facetColumns=h)},null,8,["modelValue"])])])])]))}}),Vve={class:"data-form"},Ove=d.defineComponent({__name:"index",setup(e){const t=da();return(n,r)=>(d.openBlock(),d.createElementBlock("div",Vve,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createBlock(yme,{key:0})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"||d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(),d.createBlock(Qme,{key:1})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createBlock(ive,{key:2})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createBlock(Eve,{key:3})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createBlock(Fve,{key:4})):d.createCommentVNode("",!0)]))}});function df(e,t,n,r=!1){const a=t.components.primaryGrouping.selectorStates.length>0,i=t.components.secondaryGrouping.selectorStates.length>0;return e===null?i?{type:"secondaryGrouping"}:a&&!r?{type:"primaryGrouping"}:n:e}const Qve={class:"aes-mapping-block"},zve={style:{margin:"0 24px"}},Uve={class:"section-title"},jve={style:{margin:"24px 0"}},Gve={style:{margin:"24px 0"}},Yve={style:{margin:"24px 0"}},Wve={style:{display:"flex",marginTop:"16px",gap:"8px"}},Xve=d.defineComponent({__name:"AesDataMappingContinuous",props:{dataColumnLabel:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){var b,C;const n=e,r=t,a=d.ref(!1),i=d.ref(n.modelValue.palette);function o(x){i.value=x,a.value=!1,r("update:modelValue",Vv(x))}const s=[{value:"auto",label:"Auto"},{value:"custom",label:"Custom"}],c=d.ref(n.modelValue.range?"custom":"auto"),f=[{value:"linear",label:"Linear"},{value:"log",label:"Log"}],A=d.ref(n.modelValue.log?"log":"linear"),h=d.ref(((b=n.modelValue.range)==null?void 0:b.minValue)??void 0),m=d.ref(((C=n.modelValue.range)==null?void 0:C.maxValue)??void 0),g=d.ref(n.modelValue.midPoint??void 0);return d.watch(()=>c.value,x=>{x==="custom"&&r("update:modelValue",{...n.modelValue,range:{minValue:h.value??null,maxValue:m.value??null}}),x==="auto"&&r("update:modelValue",{...n.modelValue,range:null})}),d.watch(()=>h.value,x=>{r("update:modelValue",{...n.modelValue,range:{...n.modelValue.range,minValue:x}})}),d.watch(()=>m.value,x=>{r("update:modelValue",{...n.modelValue,range:{...n.modelValue.range,maxValue:x}})}),d.watch(()=>g.value,x=>{r("update:modelValue",{...n.modelValue,midPoint:x??null})}),d.watch(()=>A.value,x=>{r("update:modelValue",{...n.modelValue,log:x==="log"})}),(x,k)=>(d.openBlock(),d.createElementBlock("div",Qve,[d.createElementVNode("div",zve,[d.createElementVNode("div",Uve,[d.createElementVNode("span",null,d.toDisplayString(x.dataColumnLabel),1)]),d.createElementVNode("div",jve,[d.createVNode(o3,{label:"Color Palette ",title:d.unref(Do)[i.value].title,palette:i.value,onButtonClick:k[0]||(k[0]=_=>{a.value=!0})},null,8,["title","palette"])]),d.createElementVNode("div",Gve,[d.createVNode(d.unref(pt.PlBtnGroup),{options:f,modelValue:A.value,"onUpdate:modelValue":k[1]||(k[1]=_=>A.value=_)},null,8,["modelValue"])]),d.createElementVNode("div",Yve,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Gradient range",options:s,modelValue:c.value,"onUpdate:modelValue":k[2]||(k[2]=_=>c.value=_)},null,8,["modelValue"])]),d.createElementVNode("div",Wve,[c.value==="custom"?(d.openBlock(),d.createBlock(d.unref(pt.PlNumberField),{key:0,label:"From",updateOnEnterOrClickOutside:!0,useIncrementButtons:!1,modelValue:h.value,"onUpdate:modelValue":k[3]||(k[3]=_=>h.value=_)},null,8,["modelValue"])):d.createCommentVNode("",!0),d.createVNode(d.unref(pt.PlNumberField),{label:"Mid point",updateOnEnterOrClickOutside:!0,useIncrementButtons:!1,style:{flexGrow:1},modelValue:g.value,"onUpdate:modelValue":k[4]||(k[4]=_=>g.value=_)},null,8,["modelValue"]),c.value==="custom"?(d.openBlock(),d.createBlock(d.unref(pt.PlNumberField),{key:1,label:"To",updateOnEnterOrClickOutside:!0,useIncrementButtons:!1,modelValue:m.value,"onUpdate:modelValue":k[5]||(k[5]=_=>m.value=_)},null,8,["modelValue"])):d.createCommentVNode("",!0)]),a.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":k[6]||(k[6]=_=>a.value=!1)},{default:d.withCtx(()=>[d.createVNode(l3,{selected:i.value,categorical:!1,onSelect:o},null,8,["selected"])]),_:1})):d.createCommentVNode("",!0)])]))}}),Kve={class:"aes-input-row"},Hi=d.defineComponent({__name:"AesSelector",props:{label:{},type:{},selected:{},formTitle:{},formBackTitle:{},possibleAesSourceInputs:{},withoutFixed:{type:Boolean},disabled:{type:Boolean}},emits:["aes-update","aes-selector-close"],setup(e,{emit:t}){var K,re;const n=e,r=da(),a=d.computed(()=>r.value.reactive.chartType),i=t,o={discrete:["primaryGrouping","secondaryGrouping"],scatterplot:["grouping"],"scatterplot-umap":["grouping"],dendro:[],heatmap:[],histogram:[],bubble:[]},s=n.possibleAesSourceInputs??o[a.value],c=d.computed(()=>r.value.commonHelpersData.usedAesInMapping.value);function f(U){return typeof U=="string"?U:a.value==="scatterplot"?`grouping_${U.value}`:a.value==="dendro"?`${U.type}_${U.value}`:U.type}const A=d.ref(Yy(n.selected)?f(n.selected):"fix"),h={fill:_y[0].color,stroke:_y[0].color,dotShape:P0,lineType:AC,size:""},m=d.computed(()=>r.value.inputGuide.value),g=d.computed(()=>r.value.uniqueValuesData.value),b=new Set(["scatterplot","scatterplot-umap","heatmap"]),C=d.computed(()=>{const U={},G=r.value.reactive.optionsState.components;function Z(Y,X){const oe=m.value.getSourceInfo(X),me=g.value[X],ae=(me==null?void 0:me.list)??[],ye=(me==null?void 0:me.labels)??{},Ce=f({type:Y,value:X});if(b.has(a.value)&&oe.type==="String"||!b.has(a.value)){const ce=r.value.reactive.dataBindAes[X]??Uy(ae);U[Ce]={type:"dataCategorical",value:Ce,initialData:ce,inputName:Y,selectedSource:X,selectedSourceInfo:oe,selectedSourceValues:ae,labels:ce.order.reduce((ge,ze)=>(ge[ze]=ye[ze]??String(ze),ge),{})}}else{const ce=r.value.reactive.dataBindAes[X]??Vv(Z1);U[Ce]={type:"dataContinuous",value:Ce,initialData:ce,inputName:Y,selectedSource:X,selectedSourceInfo:oe,selectedSourceValues:ae}}}return s.forEach(Y=>{var X;(X=G==null?void 0:G[Y])!=null&&X.selectorStates.length&&G[Y].selectorStates.forEach(({selectedSource:oe})=>{Z(Y,oe)})}),n.withoutFixed||(U.fix={type:"fix",value:"fix",initialData:Yy(n.selected)?h[n.type]:n.selected}),U}),x=d.computed(()=>C.value[A.value]??null);function k(U,G){var Z,Y,X,oe;return U.type==="fix"?"Fixed":G===U.value?`${(Z=U.selectedSourceInfo)==null?void 0:Z.label}`:a.value==="discrete"?`${U.value==="primaryGrouping"?"Primary":"Secondary"} grouping: ${(Y=U.selectedSourceInfo)==null?void 0:Y.label}`:a.value==="scatterplot"||a.value==="dendro"?`Grouping: ${(X=U.selectedSourceInfo)==null?void 0:X.label}`:((oe=U.selectedSourceInfo)==null?void 0:oe.label)??""}const _=d.computed(()=>{const U=[],G=r.value.reactive.optionsState.components;function Z(Y,X){const oe=f({type:Y==="shape"?"grouping":Y,value:X});C.value[oe]&&U.push({text:k(C.value[oe],A.value),value:oe})}if(s.forEach(Y=>{var X;(X=G==null?void 0:G[Y])!=null&&X.selectorStates.length&&G[Y].selectorStates.forEach(({selectedSource:oe})=>{Z(Y,oe)})}),!C.value[A.value]){let Y="Not consistent (grouping)";a.value==="discrete"&&(Y=`${A.value==="primaryGrouping"?"Primary":"Secondary"} grouping (not selected)`),U.push({text:Y,value:A.value})}return n.withoutFixed||U.push({text:"Fixed",value:"fix"}),U}),D=d.ref(!1),O=d.ref(C.value.fix?C.value.fix.initialData:null),I=d.ref(((K=x.value)==null?void 0:K.type)==="dataCategorical"?x.value.initialData:null),$=d.ref(((re=x.value)==null?void 0:re.type)==="dataContinuous"?x.value.initialData:null);d.watch(()=>A.value,U=>{const G=C.value[U];G.type==="fix"?i("aes-update",O.value,G):G.type==="dataCategorical"?(I.value=G.initialData,i("aes-update",G.initialData,G)):G.type==="dataContinuous"&&($.value=G.initialData,i("aes-update",G.initialData,G))});const Q=d.ref(),ee=d.computed(()=>{if(n.type==="lineType")return My.length*32+16*2;if(n.type==="dotShape")return Math.ceil(N5.length/6)*36+20*2;if(n.type==="fill"||n.type==="stroke")return Math.ceil(_y.length/6)*36+20*2});return(U,G)=>{var Z,Y;return d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",Kve,[d.createElementVNode("div",{class:"aes-input-select",onClick:G[1]||(G[1]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(pt.PlDropdown),{disabled:U.disabled||_.value.length<2,label:U.label,options:_.value,modelValue:A.value,"onUpdate:modelValue":G[0]||(G[0]=X=>A.value=X)},null,8,["disabled","label","options","modelValue"])]),d.createVNode(L7,{data:{type:A.value==="fix"?U.type:"data",value:A.value==="fix"?U.type==="size"?Number(U.selected):U.selected:null},onClick:G[2]||(G[2]=X=>D.value=!D.value),onRef:G[3]||(G[3]=X=>Q.value=X)},null,8,["data"]),A.value==="fix"&&D.value&&O.value?(d.openBlock(),d.createBlock(db,{key:0,height:ee.value,targetRef:Q.value,"onPopup:close":G[10]||(G[10]=X=>D.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["fixed-aes-list",{"fixed-aes-list__rows":U.type==="lineType"}])},[U.type==="fill"||U.type==="stroke"?(d.openBlock(),d.createBlock(d$,{key:0,"color-using":U.type,modelValue:O.value,"onUpdate:modelValue":[G[4]||(G[4]=X=>O.value=X),G[5]||(G[5]=X=>U.$emit("aes-update",X,C.value.fix))]},null,8,["color-using","modelValue"])):d.createCommentVNode("",!0),U.type==="dotShape"?(d.openBlock(),d.createBlock(A$,{key:1,modelValue:O.value,"onUpdate:modelValue":[G[6]||(G[6]=X=>O.value=X),G[7]||(G[7]=X=>U.$emit("aes-update",X,C.value.fix))]},null,8,["modelValue"])):d.createCommentVNode("",!0),U.type==="lineType"?(d.openBlock(),d.createBlock(fb,{key:2,modelValue:O.value,"onUpdate:modelValue":[G[8]||(G[8]=X=>O.value=X),G[9]||(G[9]=X=>U.$emit("aes-update",X,C.value.fix))]},null,8,["modelValue"])):d.createCommentVNode("",!0)],2)]),_:1},8,["height","targetRef"])):d.createCommentVNode("",!0)]),(((Z=x.value)==null?void 0:Z.type)==="dataCategorical"&&I.value||((Y=x.value)==null?void 0:Y.type)==="dataContinuous"&&$.value)&&D.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:U.formTitle,"back-title":U.formBackTitle,"onForm:close":G[15]||(G[15]=X=>D.value=!1)},{default:d.withCtx(()=>{var X,oe,me,ae;return[((X=x.value)==null?void 0:X.type)==="dataCategorical"&&I.value?(d.openBlock(),d.createBlock(vB,{key:0,"column-value-labels":x.value.labels,"data-column-label":((oe=x.value.selectedSourceInfo)==null?void 0:oe.label)??"","used-aes-in-mapping":c.value[x.value.selectedSource],"allow-reordering":a.value==="discrete",modelValue:I.value,"onUpdate:modelValue":[G[11]||(G[11]=ye=>I.value=ye),G[12]||(G[12]=ye=>U.$emit("aes-update",ye,x.value))]},null,8,["column-value-labels","data-column-label","used-aes-in-mapping","allow-reordering","modelValue"])):d.createCommentVNode("",!0),((me=x.value)==null?void 0:me.type)==="dataContinuous"&&$.value?(d.openBlock(),d.createBlock(Xve,{key:1,"data-column-label":((ae=x.value.selectedSourceInfo)==null?void 0:ae.label)??"",modelValue:$.value,"onUpdate:modelValue":[G[13]||(G[13]=ye=>$.value=ye),G[14]||(G[14]=ye=>U.$emit("aes-update",ye,x.value))]},null,8,["data-column-label","modelValue"])):d.createCommentVNode("",!0)]}),_:1},8,["title","back-title"])):d.createCommentVNode("",!0)],64)}}}),Zve={class:"checkbox-item"},Kv="box",Jve=d.defineComponent({__name:"Boxplot",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[Kv]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.fillColor,r.value,Py)),i=d.computed(()=>df(n.value.lineColor,r.value,yo)),o=d.computed(()=>n.value.dotShape),s=d.computed(()=>n.value.lineType);function c(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[Kv][b]={type:g.inputName}:t.value.reactive.layersSettings[Kv][b]=m,g.type==="dataCategorical"&&typeof m!="string"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}function f(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[Kv][b]={type:g.inputName}:t.value.reactive.layersSettings[Kv][b]=m,g.type==="dataCategorical"&&typeof m=="object"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}function A(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[Kv][b]={type:g.inputName}:t.value.reactive.layersSettings[Kv][b]=m,g.type==="dataCategorical"&&typeof m=="object"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}const h=d.computed({get:()=>n.value.opacity*100,set:m=>{n.value.opacity=m/100}});return(m,g)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:g[0]||(g[0]=(b,C)=>c(b,C,"fillColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:g[1]||(g[1]=(b,C)=>c(b,C,"lineColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:s.value,onAesUpdate:g[2]||(g[2]=(b,C)=>A(b,C,"lineType"))},null,8,["selected"]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:h.value,"onUpdate:modelValue":g[3]||(g[3]=b=>h.value=b)},null,8,["modelValue"]),d.createElementVNode("div",Zve,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.showOutliers,"onUpdate:modelValue":g[4]||(g[4]=b=>n.value.showOutliers=b)},null,8,["modelValue"]),g[6]||(g[6]=d.createElementVNode("span",null,"Show outliers",-1))]),n.value.showOutliers?(d.openBlock(),d.createBlock(Hi,{key:0,label:"Outlier shape","form-title":"Outlier Shape Settings","form-back-title":"Layers",type:"dotShape","possible-aes-source-inputs":[],selected:o.value,onAesUpdate:g[5]||(g[5]=(b,C)=>f(b,C,"dotShape"))},null,8,["selected"])):d.createCommentVNode("",!0)],64))}}),qve={class:"checkbox-item"},gB="binnedDots",ege=d.defineComponent({__name:"BinnedDots",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[gB]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.fillColor,r.value,Py)),i=d.computed(()=>df(n.value.lineColor,r.value,yo));function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[gB][A]={type:f.inputName}:t.value.reactive.layersSettings[gB][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,h)=>o(A,h,"fillColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:f[1]||(f[1]=(A,h)=>o(A,h,"lineColor"))},null,8,["selected"]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"]),d.createElementVNode("div",qve,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.showOutliers,"onUpdate:modelValue":f[3]||(f[3]=A=>n.value.showOutliers=A)},null,8,["modelValue"]),f[4]||(f[4]=d.createElementVNode("span",null,"Show outliers",-1))])],64))}}),tge={class:"checkbox-item"},$7="jitteredDots",nge=d.defineComponent({__name:"JitteredDots",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[$7]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.dotFill,r.value,yo));function i(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[$7][A]={type:f.inputName}:t.value.reactive.layersSettings[$7][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[$7][A]={type:f.inputName}:t.value.reactive.layersSettings[$7][A]=c,f.type==="dataCategorical"&&typeof c=="object"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,h)=>i(A,h,"dotFill"))},null,8,["selected"]),d.createVNode(Hi,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,onAesUpdate:f[1]||(f[1]=(A,h)=>o(A,h,"dotShape"))},null,8,["selected"]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"]),d.createElementVNode("div",tge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.showOutliers,"onUpdate:modelValue":f[3]||(f[3]=A=>n.value.showOutliers=A)},null,8,["modelValue"]),f[4]||(f[4]=d.createElementVNode("span",null,"Show outliers",-1))])],64))}}),rge={class:"checkbox-item"},age={class:"checkbox-item"},ige={key:0},u3="violin",oge=d.defineComponent({__name:"Violin",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[u3]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.fillColor,r.value,Py)),i=d.computed(()=>df(n.value.lineColor,r.value,yo)),o=d.computed(()=>n.value.lineType),s=d.computed(()=>n.value.medianLineStyle),c=d.computed(()=>n.value.quartilesLineStyle);function f(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[u3][b]={type:g.inputName}:t.value.reactive.layersSettings[u3][b]=m,g.type==="dataCategorical"&&typeof m!="string"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}function A(m,g,b){t.value.reactive.layersSettings[u3][b]=typeof m=="object"?{type:g.value}:m,g.type==="dataCategorical"&&typeof m=="object"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}const h=d.computed({get:()=>n.value.opacity*100,set:m=>{n.value.opacity=m/100}});return(m,g)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:g[0]||(g[0]=(b,C)=>f(b,C,"fillColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:g[1]||(g[1]=(b,C)=>f(b,C,"lineColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:o.value,onAesUpdate:g[2]||(g[2]=(b,C)=>A(b,C,"lineType"))},null,8,["selected"]),d.createElementVNode("div",rge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.trim,"onUpdate:modelValue":g[3]||(g[3]=b=>n.value.trim=b)},null,8,["modelValue"]),g[8]||(g[8]=d.createElementVNode("span",null,"Trim",-1))]),d.createElementVNode("div",age,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.showQuartiles,"onUpdate:modelValue":g[4]||(g[4]=b=>n.value.showQuartiles=b)},null,8,["modelValue"]),g[9]||(g[9]=d.createElementVNode("span",null,"Show median and quartiles",-1))]),n.value.showQuartiles?(d.openBlock(),d.createElementBlock("div",ige,[d.createVNode(Hi,{label:"Madian Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:s.value,onAesUpdate:g[5]||(g[5]=b=>d.unref(t).reactive.layersSettings[u3].medianLineStyle=b)},null,8,["selected"]),d.createVNode(Hi,{label:"Quartiles Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:c.value,onAesUpdate:g[6]||(g[6]=b=>d.unref(t).reactive.layersSettings[u3].quartilesLineStyle=b)},null,8,["selected"])])):d.createCommentVNode("",!0),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:h.value,"onUpdate:modelValue":g[7]||(g[7]=b=>h.value=b)},null,8,["modelValue"])],64))}}),yB="bar",lge=d.defineComponent({__name:"Bar",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[yB]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.fillColor,r.value,Py)),i=d.computed(()=>df(n.value.lineColor,r.value,yo));function o(f,A,h){A.type==="dataCategorical"?t.value.reactive.layersSettings[yB][h]={type:A.inputName}:t.value.reactive.layersSettings[yB][h]=f,A.type==="dataCategorical"&&typeof f!="string"&&(t.value.reactive.dataBindAes[A.selectedSource]=f)}const s=[{text:"Min",value:"min"},{text:"Max",value:"max"},{text:"Mean",value:"mean"},{text:"Median",value:"median"}],c=d.computed({get:()=>n.value.opacity*100,set:f=>{n.value.opacity=f/100}});return(f,A)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:A[0]||(A[0]=(h,m)=>o(h,m,"fillColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:A[1]||(A[1]=(h,m)=>o(h,m,"lineColor"))},null,8,["selected"]),d.createElementVNode("div",{class:"input-item",onClick:A[3]||(A[3]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(pt.PlDropdown),{label:"Height",options:s,modelValue:n.value.height,"onUpdate:modelValue":A[2]||(A[2]=h=>n.value.height=h)},null,8,["modelValue"])]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:c.value,"onUpdate:modelValue":A[4]||(A[4]=h=>c.value=h)},null,8,["modelValue"])],64))}}),sge={class:"checkbox-item"},wB="stackedBar",uge=d.defineComponent({__name:"StackedBar",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[wB]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.fillColor,r.value,Py)),i=d.computed(()=>df(n.value.lineColor,r.value,yo));function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[wB][A]={type:f.inputName}:t.value.reactive.layersSettings[wB][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,h)=>o(A,h,"fillColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:f[1]||(f[1]=(A,h)=>o(A,h,"lineColor"))},null,8,["selected"]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"]),d.createElementVNode("div",sge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.normalize,"onUpdate:modelValue":f[3]||(f[3]=A=>n.value.normalize=A)},null,8,["modelValue"]),f[4]||(f[4]=d.createElementVNode("span",null,"Normalize",-1))])],64))}}),Zv="line",cge=d.defineComponent({__name:"Line",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[Zv]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.lineColor,r.value,yo,!0)),i=d.computed(()=>df(n.value.dotFill,r.value,yo,!0)),o=d.computed(()=>n.value.lineType);function s(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[Zv][b]={type:g.inputName}:t.value.reactive.layersSettings[Zv][b]=m,g.type==="dataCategorical"&&typeof m!="string"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}function c(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[Zv][b]={type:g.inputName}:t.value.reactive.layersSettings[Zv][b]=m,g.type==="dataCategorical"&&typeof m=="object"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}function f(m,g,b){g.type==="dataCategorical"?t.value.reactive.layersSettings[Zv][b]={type:g.inputName}:t.value.reactive.layersSettings[Zv][b]=m,g.type==="dataCategorical"&&typeof m=="object"&&(t.value.reactive.dataBindAes[g.selectedSource]=m)}const A=[{text:"Mean",value:"mean"},{text:"Median",value:"median"}],h=d.computed({get:()=>n.value.opacity*100,set:m=>{n.value.opacity=m/100}});return(m,g)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:a.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:g[0]||(g[0]=(b,C)=>s(b,C,"lineColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":["secondaryGrouping"],selected:o.value,onAesUpdate:g[1]||(g[1]=(b,C)=>f(b,C,"lineType"))},null,8,["selected"]),d.createVNode(Hi,{label:"Dot fill","form-title":"Dot Fill Settings","form-back-title":"Layers",type:"fill",selected:i.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:g[2]||(g[2]=(b,C)=>s(b,C,"dotFill"))},null,8,["selected"]),d.createVNode(Hi,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:g[3]||(g[3]=(b,C)=>c(b,C,"dotShape"))},null,8,["selected"]),d.createElementVNode("div",{class:"input-item",onClick:g[5]||(g[5]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(pt.PlDropdown),{label:"Point value",options:A,modelValue:n.value.pointsValues,"onUpdate:modelValue":g[4]||(g[4]=b=>n.value.pointsValues=b)},null,8,["modelValue"])]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:h.value,"onUpdate:modelValue":g[6]||(g[6]=b=>h.value=b)},null,8,["modelValue"])],64))}}),F7="errorbar",fge=d.defineComponent({__name:"Errorbar",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[F7]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.lineColor,r.value,yo,!0)),i=d.computed(()=>df(n.value.dotFill,r.value,yo,!0));function o(h,m,g){m.type==="dataCategorical"?t.value.reactive.layersSettings[F7][g]={type:m.inputName}:t.value.reactive.layersSettings[F7][g]=h,m.type==="dataCategorical"&&typeof h!="string"&&(t.value.reactive.dataBindAes[m.selectedSource]=h)}function s(h,m,g){m.type==="dataCategorical"?t.value.reactive.layersSettings[F7][g]={type:m.inputName}:t.value.reactive.layersSettings[F7][g]=h,m.type==="dataCategorical"&&typeof h=="object"&&(t.value.reactive.dataBindAes[m.selectedSource]=h)}const c=[{text:"Standard deviation",value:"sd"},{text:"Standard error",value:"se"},{text:"Confident interval",value:"ci"}],f=[{text:"Mean",value:"mean"},{text:"Median",value:"median"}],A=d.computed({get:()=>n.value.opacity*100,set:h=>{n.value.opacity=h/100}});return(h,m)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:a.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:m[0]||(m[0]=(g,b)=>o(g,b,"lineColor"))},null,8,["selected"]),d.createVNode(Hi,{label:"Dot fill","form-title":"Dot Fill Settings","form-back-title":"Layers",type:"fill",selected:i.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:m[1]||(m[1]=(g,b)=>o(g,b,"dotFill"))},null,8,["selected"]),d.createVNode(Hi,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:m[2]||(m[2]=(g,b)=>s(g,b,"dotShape"))},null,8,["selected"]),d.createElementVNode("div",{class:"input-item",onClick:m[4]||(m[4]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(pt.PlDropdown),{label:"Point value",options:f,modelValue:n.value.pointsValues,"onUpdate:modelValue":m[3]||(m[3]=g=>n.value.pointsValues=g)},null,8,["modelValue"])]),d.createElementVNode("div",{class:"input-item",onClick:m[6]||(m[6]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(pt.PlDropdown),{label:"Interval",options:c,modelValue:n.value.interval,"onUpdate:modelValue":m[5]||(m[5]=g=>n.value.interval=g)},null,8,["modelValue"])]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:A.value,"onUpdate:modelValue":m[7]||(m[7]=g=>A.value=g)},null,8,["modelValue"])],64))}}),V7="sina",dge=d.defineComponent({__name:"Sina",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[V7]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>df(n.value.dotFill,r.value,yo));function i(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[V7][A]={type:f.inputName}:t.value.reactive.layersSettings[V7][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[V7][A]={type:f.inputName}:t.value.reactive.layersSettings[V7][A]=c,f.type==="dataCategorical"&&typeof c=="object"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,h)=>i(A,h,"dotFill"))},null,8,["selected"]),d.createVNode(Hi,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,onAesUpdate:f[1]||(f[1]=(A,h)=>o(A,h,"dotShape"))},null,8,["selected"]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"])],64))}}),Age={class:"checkbox-item"},pge="logo",hge=d.defineComponent({__name:"Logo",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[pge]),r=d.computed({get:()=>n.value.opacity*100,set:a=>{n.value.opacity=a/100}});return(a,i)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=o=>r.value=o)},null,8,["modelValue"]),d.createElementVNode("div",Age,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.normalize,"onUpdate:modelValue":i[1]||(i[1]=o=>n.value.normalize=o)},null,8,["modelValue"]),i[2]||(i[2]=d.createElementVNode("span",null,"Normalize",-1))])],64))}}),mge={class:"button-group-item"},vge={class:"button-group-item"},gge={class:"button-group-item",style:{display:"flex",alignItems:"end"}},yge=d.defineComponent({__name:"Heatmap",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings.heatmap),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>t.value.inputGuide.value),i=d.computed(()=>{var C;return(C=r.value.components.value.selectorStates[0])==null?void 0:C.selectedSource}),o=d.computed(()=>{var C;return i.value?(C=t.value.reactive.dataBindAes[i.value])==null?void 0:C.palette:void 0}),s=d.ref(!1),c=d.ref(o.value??Z1);function f(C){c.value=C,s.value=!1,i.value&&(t.value.reactive.dataBindAes[i.value]=Vv(C))}const A=[{label:"None",value:null},{label:"Columns",value:"column"},{label:"Rows",value:"row"}],h=[{label:"z-score",value:"standardScaling"},{label:"Min-max",value:"meanNormalization"}],m=[{label:"empty",value:null},{label:"Special value",value:"custom"}],g=d.ref(n.value.NAValueAs===null?null:"custom"),b=d.ref(n.value.NAValueAs??0);return(C,x)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(o3,{label:"Color Palette ",title:d.unref(Do)[c.value].title,palette:c.value,onButtonClick:x[0]||(x[0]=k=>{s.value=!0})},null,8,["title","palette"]),s.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":x[1]||(x[1]=k=>s.value=!1)},{default:d.withCtx(()=>[d.createVNode(l3,{selected:c.value,categorical:i.value?a.value.getSourceInfo(i.value).type==="String":!1,onSelect:f},null,8,["selected","categorical"])]),_:1})):d.createCommentVNode("",!0),d.createElementVNode("div",mge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Normalize by",options:A,compact:!0,modelValue:n.value.normalizationDirection,"onUpdate:modelValue":x[2]||(x[2]=k=>n.value.normalizationDirection=k)},null,8,["modelValue"])]),d.createElementVNode("div",vge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Normalization method",options:h,compact:!0,modelValue:n.value.normalizationMethod,"onUpdate:modelValue":x[3]||(x[3]=k=>n.value.normalizationMethod=k)},null,8,["modelValue"])]),d.createElementVNode("div",gge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Treat NA value as:",options:m,compact:!0,modelValue:g.value,"onUpdate:modelValue":[x[4]||(x[4]=k=>g.value=k),x[5]||(x[5]=k=>{k==="custom"?n.value.NAValueAs=b.value:n.value.NAValueAs=k})]},null,8,["modelValue"]),d.createVNode(d.unref(pt.PlNumberField),{style:{height:"33px",marginLeft:"16px",width:"75px"},disabled:g.value!=="custom",label:"NA value",useIncrementButtons:!1,modelValue:b.value,"onUpdate:modelValue":[x[6]||(x[6]=k=>b.value=k),x[7]||(x[7]=k=>{k!==void 0&&(n.value.NAValueAs=k)})]},null,8,["disabled","modelValue"])])],64))}}),wge={class:"checkbox-item"},Cge={class:"checkbox-item"},O7="dendro",bge=d.defineComponent({__name:"Dendro",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[O7]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>n.value.dotFill),i=d.computed(()=>n.value.dotShape),o=d.computed(()=>n.value.lineColor);function s(g,b,C){typeof g=="string"?t.value.reactive.layersSettings[O7][C]=g:b.type==="dataCategorical"&&(t.value.reactive.layersSettings[O7][C]={type:b.inputName,value:b.selectedSource}),b.type==="dataCategorical"&&typeof g!="string"&&(t.value.reactive.dataBindAes[b.selectedSource]=g)}function c(g,b,C){typeof g=="string"?t.value.reactive.layersSettings[O7][C]=g:b.type==="dataCategorical"&&(t.value.reactive.layersSettings[O7][C]={type:b.inputName,value:b.selectedSource}),b.type==="dataCategorical"&&typeof g!="string"&&(t.value.reactive.dataBindAes[b.selectedSource]=g)}const f=d.ref(n.value.leavesMode==="alignLeavesToLine"),A=d.computed({get(){return n.value.showLegend??!0},set(g){n.value.showLegend=g}}),h=d.computed({get(){return TS(n.value.dotSize)?[n.value.dotSize.min,n.value.dotSize.max]:[3,10]},set([g,b]){n.value.dotSize={min:g,max:b}}}),m=d.computed({get(){return TS(n.value.dotSize)?3:n.value.dotSize},set(g){n.value.dotSize=g}});return(g,b)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Node color","form-title":"Node Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,"possible-aes-source-inputs":["nodeColor"],"without-fixed":r.value.components.nodeColor.selectorStates.length>0,onAesUpdate:b[0]||(b[0]=(C,x)=>s(C,x,"dotFill"))},null,8,["selected","without-fixed"]),d.createVNode(Hi,{label:"Node shape","form-title":"Node Shape Settings","form-back-title":"Layers",type:"dotShape",selected:i.value,"possible-aes-source-inputs":["nodeShape"],"without-fixed":r.value.components.nodeShape.selectorStates.length>0,onAesUpdate:b[1]||(b[1]=(C,x)=>c(C,x,"dotShape"))},null,8,["selected","without-fixed"]),d.createVNode(Hi,{label:"Line color","form-title":"Line Color Settings","form-back-title":"Layers",type:"fill",selected:o.value,"possible-aes-source-inputs":["lineColor"],"without-fixed":r.value.components.lineColor.selectorStates.length>0,onAesUpdate:b[2]||(b[2]=(C,x)=>s(C,x,"lineColor"))},null,8,["selected","without-fixed"]),d.createElementVNode("div",null,[r.value.components.nodeSize.selectorStates.length>0?(d.openBlock(),d.createBlock(d.unref(pt.SliderRange),{key:0,min:3,max:10,breakpoints:!0,label:"Node size range",modelValue:h.value,"onUpdate:modelValue":b[3]||(b[3]=C=>h.value=C)},null,8,["modelValue"])):(d.openBlock(),d.createBlock(d.unref(pt.Slider),{key:1,min:3,max:10,step:1,breakpoints:!0,label:"Node size",modelValue:m.value,"onUpdate:modelValue":b[4]||(b[4]=C=>m.value=C)},null,8,["modelValue"]))]),d.createElementVNode("div",wge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:f.value,"onUpdate:modelValue":[b[5]||(b[5]=C=>f.value=C),b[6]||(b[6]=C=>{n.value.leavesMode=C?"alignLeavesToLine":"normal"})]},null,8,["modelValue"]),b[8]||(b[8]=d.createElementVNode("span",null,"Move leaves to the right",-1))]),d.createElementVNode("div",Cge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:A.value,"onUpdate:modelValue":b[7]||(b[7]=C=>A.value=C)},null,8,["modelValue"]),b[9]||(b[9]=d.createElementVNode("span",null,"Show legend",-1))])],64))}}),Ege={class:"dot-size-selector"},xge={class:"dot-size-selector__row"},Sge={class:"dot-size-selector-row"},Bge=d.defineComponent({__name:"DotSizeSelector",props:{selected:{},possibleAesSourceInputs:{}},emits:["aes-update","aes-selector-close"],setup(e,{emit:t}){const n=e,r=da(),a=d.computed(()=>r.value.reactive.chartType),i=t,o={discrete:["primaryGrouping","secondaryGrouping"],scatterplot:["size"],"scatterplot-umap":["size"],dendro:[],heatmap:[],histogram:[],bubble:[]},s=n.possibleAesSourceInputs??o[a.value],c=d.ref(Qv(n.selected)?n.selected.column:"fix"),f=d.computed(()=>r.value.inputGuide.value);function A(b){const C=f.value.getSourceInfo(b);return a.value==="scatterplot"||a.value==="dendro"?`Grouping: ${C==null?void 0:C.label}`:C?(C==null?void 0:C.label)??"":"Not consistent (grouping)"}const h=d.computed(()=>{const b=[],C=r.value.reactive.optionsState.components;return s.forEach(x=>{var k;(k=C==null?void 0:C[x])!=null&&k.selectorStates.length&&C[x].selectorStates.forEach(({selectedSource:_})=>{f.value.getSourceInfo(_).type!=="String"&&b.push({text:A(_),value:_})})}),b.length?b:[{text:"Fixed",value:"fix"}]}),m=d.ref(Qv(n.selected)?Lp:n.selected??Lp),g=d.ref(Qv(n.selected)?[n.selected.range.min,n.selected.range.max]:[zy.min,zy.max]);return d.watch(()=>c.value,b=>{if(b==="fix")i("aes-update",m.value);else{const C={column:b,range:{min:g.value[0],max:g.value[1]}};i("aes-update",C)}}),d.watch(()=>m.value,b=>{c.value==="fix"&&i("aes-update",b)}),d.watch(()=>g.value,b=>{if(c.value!=="fix"){const C={column:c.value,range:{min:b[0],max:b[1]}};i("aes-update",C)}}),(b,C)=>(d.openBlock(),d.createElementBlock("div",Ege,[d.createElementVNode("div",xge,[d.createElementVNode("div",{class:"aes-input-select",onClick:C[1]||(C[1]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(pt.PlDropdown),{disabled:h.value.length<2&&h.value[0].value===c.value,label:"Dot size source",options:h.value,modelValue:c.value,"onUpdate:modelValue":C[0]||(C[0]=x=>c.value=x)},null,8,["disabled","options","modelValue"])])]),d.createElementVNode("div",Sge,[c.value!=="fix"?(d.openBlock(),d.createBlock(d.unref(pt.SliderRange),{key:0,min:3,max:10,breakpoints:!0,label:"Dot size range",modelValue:g.value,"onUpdate:modelValue":C[2]||(C[2]=x=>g.value=x)},null,8,["modelValue"])):(d.openBlock(),d.createBlock(d.unref(pt.Slider),{key:1,min:3,max:10,step:1,breakpoints:!0,label:"Dot size",modelValue:m.value,"onUpdate:modelValue":C[3]||(C[3]=x=>m.value=x)},null,8,["modelValue"]))])]))}}),c3="dots",kge=d.defineComponent({__name:"Scatter",setup(e){const t=da(),n=t.value.reactive.optionsState,r=d.computed(()=>t.value.inputGuide.value),a=d.computed(()=>t.value.reactive.layersSettings[c3]);function i(g){return g!==null&&typeof g=="object"&&"type"in g}const o=d.computed(()=>{const g=a.value.dotFill,b=n.components.grouping.selectorStates.map(C=>C.selectedSource);return i(g)&&b.length?b.includes(g.value)?g:{type:"grouping",value:b[0]}:b.length?{type:"grouping",value:b[0]}:i(g)?yo:g??yo}),s=d.computed(()=>{const g=a.value.dotShape,b=n.components.shape.selectorStates.map(C=>C.selectedSource);return i(g)&&b.length?g.value===b[0]?g:{type:"shape",value:b[0]}:b.length?{type:"shape",value:b[0]}:i(g)?P0:g??P0}),c=d.computed(()=>{const g=a.value.dotSize,b=n.components.size.selectorStates.map(C=>C.selectedSource);return b.length?Qv(g)?g:{column:b[0],range:zy}:Qv(g)?Lp:g??Lp});function f(g,b,C){typeof g=="string"?t.value.reactive.layersSettings[c3][C]=g:(b.type==="dataCategorical"||b.type==="dataContinuous")&&(t.value.reactive.layersSettings[c3][C]={type:"grouping",value:b.selectedSource}),mR(g)&&b.type!=="fix"&&(t.value.reactive.dataBindAes[b.selectedSource]=g)}function A(g,b,C){typeof g=="string"?t.value.reactive.layersSettings[c3][C]=g:b.type==="dataCategorical"&&(t.value.reactive.layersSettings[c3][C]={type:"grouping",value:b.selectedSource}),b.type==="dataCategorical"&&typeof g!="string"&&(t.value.reactive.dataBindAes[b.selectedSource]=g)}function h(g){t.value.reactive.layersSettings[c3].dotSize=g}const m=d.computed(()=>{if(n.components.grouping.selectorStates.length){const g=n.components.grouping.selectorStates[0].selectedSource,b=r.value.getSourceInfo(g).annotations;if(b!=null&&b[jy])return!0}return!1});return(g,b)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Dot color","form-title":"Dot color Settings","form-back-title":"Layers",type:"fill",selected:o.value,"possible-aes-source-inputs":["grouping"],disabled:m.value,withoutFixed:typeof o.value=="object",onAesUpdate:b[0]||(b[0]=(C,x)=>f(C,x,"dotFill"))},null,8,["selected","disabled","withoutFixed"]),d.createVNode(Hi,{label:"Dot shape","form-title":"Dot shape Settings","form-back-title":"Layers",type:"dotShape","possible-aes-source-inputs":["shape"],selected:s.value,withoutFixed:typeof s.value=="object",onAesUpdate:b[1]||(b[1]=(C,x)=>A(C,x,"dotShape"))},null,8,["selected","withoutFixed"]),d.createVNode(Bge,{selected:c.value,onAesUpdate:h},null,8,["selected"])],64))}}),CB="dots",Tge=d.defineComponent({__name:"Scatter",setup(e){const t=da(),n=t.value.reactive.optionsState,r=d.computed(()=>t.value.inputGuide.value),a=d.computed(()=>t.value.reactive.layersSettings[CB]);function i(f){return f!==null&&typeof f=="object"&&"type"in f}const o=d.computed(()=>{const f=a.value.dotFill,A=n.components.grouping.selectorStates.map(h=>h.selectedSource);return i(f)&&A.length?A.includes(f.value)?f:{type:"grouping",value:A[0]}:A.length?{type:"grouping",value:A[0]}:i(f)?yo:f??yo});function s(f,A,h){typeof f=="string"?t.value.reactive.layersSettings[CB][h]=f:(A.type==="dataCategorical"||A.type==="dataContinuous")&&(t.value.reactive.layersSettings[CB][h]={type:"grouping",value:A.selectedSource}),mR(f)&&A.type!=="fix"&&(t.value.reactive.dataBindAes[A.selectedSource]=f)}const c=d.computed(()=>{if(n.components.grouping.selectorStates.length){const f=n.components.grouping.selectorStates[0].selectedSource,A=r.value.getSourceInfo(f).annotations;if(A!=null&&A[jy])return!0}return!1});return(f,A)=>(d.openBlock(),d.createBlock(Hi,{label:"Dot color","form-title":"Dot color Settings1","form-back-title":"Layers",type:"fill",selected:o.value,"possible-aes-source-inputs":["grouping"],disabled:c.value,withoutFixed:typeof o.value=="object",onAesUpdate:A[0]||(A[0]=(h,m)=>s(h,m,"dotFill"))},null,8,["selected","disabled","withoutFixed"]))}}),_ge={class:"input-item",style:{display:"flex","justify-content":"space-between","align-items":"center"}},bB="curve",y$=d.defineComponent({__name:"Curve",setup(e){const t=da(),n=t.value.reactive.optionsState,r=d.computed(()=>t.value.reactive.layersSettings[bB]);function a(s){return s!==null&&typeof s=="object"&&"type"in s}const i=d.computed(()=>{const s=r.value.lineColor,c=n.components.grouping.selectorStates.map(f=>f.selectedSource);return a(s)&&c.length?c.includes(s.value)?s:{type:"grouping",value:c[0]}:c.length?{type:"grouping",value:c[0]}:a(s)?yo:s??yo});function o(s,c,f){typeof s=="string"?t.value.reactive.layersSettings[bB][f]=s:c.type==="dataCategorical"&&(t.value.reactive.layersSettings[bB][f]={type:c.inputName,value:c.selectedSource}),c.type==="dataCategorical"&&typeof s!="string"&&(t.value.reactive.dataBindAes[c.selectedSource]=s)}return(s,c)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Color","form-title":"Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,withoutFixed:typeof i.value=="object","possible-aes-source-inputs":["grouping"],onAesUpdate:c[0]||(c[0]=(f,A)=>o(f,A,"lineColor"))},null,8,["selected","withoutFixed"]),d.createElementVNode("div",_ge,[c[2]||(c[2]=d.createElementVNode("span",null,"Smoothing",-1)),d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(t).reactive.layersSettings.curve.smoothing,"onUpdate:modelValue":c[1]||(c[1]=f=>d.unref(t).reactive.layersSettings.curve.smoothing=f)},null,8,["modelValue"])])],64))}}),Pge={class:"checkbox-item"},Mge={key:1,class:"checkbox-item"},Dge={class:"checkbox-item"},Hge={key:2,class:"checkbox-item"},Ige={class:"button-group-item"},Lge={class:"button-group-item"},Rge={class:"button-group-item",style:{display:"flex",alignItems:"end"}},Nge=d.defineComponent({__name:"HeatmapClustered",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings.heatmapClustered),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>t.value.inputGuide.value),i=d.computed(()=>{var C;return(C=r.value.components.value.selectorStates[0])==null?void 0:C.selectedSource}),o=d.computed(()=>{var C;return i.value?(C=t.value.reactive.dataBindAes[i.value])==null?void 0:C.palette:void 0}),s=d.ref(!1),c=d.ref(o.value??Z1);function f(C){c.value=C,s.value=!1,i.value&&(t.value.reactive.dataBindAes[i.value]=Vv(C))}const A=[{label:"None",value:null},{label:"Columns",value:"column"},{label:"Rows",value:"row"}],h=[{label:"z-score",value:"standardScaling"},{label:"Min-max",value:"meanNormalization"}],m=[{label:"empty",value:null},{label:"Special value",value:"custom"}],g=d.ref(n.value.NAValueAs!==null?"custom":n.value.NAValueAs),b=d.ref(n.value.NAValueAs??0);return(C,x)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(o3,{label:"Color Palette ",title:d.unref(Do)[c.value].title,palette:c.value,onButtonClick:x[0]||(x[0]=k=>{s.value=!0})},null,8,["title","palette"]),s.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":x[1]||(x[1]=k=>s.value=!1)},{default:d.withCtx(()=>[d.createVNode(l3,{selected:c.value,categorical:i.value?a.value.getSourceInfo(i.value).type==="String":!1,onSelect:f},null,8,["selected","categorical"])]),_:1})):d.createCommentVNode("",!0),d.createElementVNode("div",Pge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.disableClusteringX,"onUpdate:modelValue":x[2]||(x[2]=k=>n.value.disableClusteringX=k)},null,8,["modelValue"]),x[12]||(x[12]=d.createElementVNode("span",null,"Disable clustering for X axis",-1))]),n.value.disableClusteringX?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Mge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.dendrogramX,"onUpdate:modelValue":x[3]||(x[3]=k=>n.value.dendrogramX=k)},null,8,["modelValue"]),x[13]||(x[13]=d.createElementVNode("span",null,"Show dendrogram for X axis",-1))])),d.createElementVNode("div",Dge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.disableClusteringY,"onUpdate:modelValue":x[4]||(x[4]=k=>n.value.disableClusteringY=k)},null,8,["modelValue"]),x[14]||(x[14]=d.createElementVNode("span",null,"Disable clustering for Y axis",-1))]),n.value.disableClusteringY?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Hge,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.dendrogramY,"onUpdate:modelValue":x[5]||(x[5]=k=>n.value.dendrogramY=k)},null,8,["modelValue"]),x[15]||(x[15]=d.createElementVNode("span",null,"Show dendrogram for Y axis",-1))])),d.createElementVNode("div",Ige,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Normalize by",options:A,compact:!0,modelValue:n.value.normalizationDirection,"onUpdate:modelValue":x[6]||(x[6]=k=>n.value.normalizationDirection=k)},null,8,["modelValue"])]),d.createElementVNode("div",Lge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Normalization method",options:h,compact:!0,modelValue:n.value.normalizationMethod,"onUpdate:modelValue":x[7]||(x[7]=k=>n.value.normalizationMethod=k)},null,8,["modelValue"])]),d.createElementVNode("div",Rge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Treat NA value as:",options:m,compact:!0,modelValue:g.value,"onUpdate:modelValue":[x[8]||(x[8]=k=>g.value=k),x[9]||(x[9]=k=>{k==="custom"?n.value.NAValueAs=b.value:n.value.NAValueAs=k})]},null,8,["modelValue"]),d.createVNode(d.unref(pt.PlNumberField),{style:{height:"33px",marginLeft:"16px",width:"75px"},disabled:g.value!=="custom",label:"NA value",useIncrementButtons:!1,modelValue:b.value,"onUpdate:modelValue":[x[10]||(x[10]=k=>b.value=k),x[11]||(x[11]=k=>{k!==void 0&&(n.value.NAValueAs=k)})]},null,8,["disabled","modelValue"])])],64))}}),$ge={class:"section-title"},Fge=d.defineComponent({__name:"HeatmapAnnotations",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.optionsState),r=d.computed(()=>t.value.inputGuide.value),a=d.computed(()=>{const A=n.value.components.annotationsX.selectorStates.map(m=>m.selectedSource),h=n.value.components.annotationsY.selectorStates.map(m=>m.selectedSource);return[...A,...h]}),i=d.computed(()=>a.value.reduce((A,h)=>(A[h]=r.value.getSourceInfo(h),A),{})),o=d.reactive(a.value.reduce((A,h)=>{var b,C;const g=((b=i.value[h])==null?void 0:b.type)==="String"?lL:Z1;return A[h]=((C=t.value.reactive.dataBindAes[h])==null?void 0:C.palette)??g,A},{})),s=d.ref(null),c=d.ref(null);function f(A){const h=c.value;h&&(o[h]=A,t.value.reactive.dataBindAes[h]=Vv(A)),s.value=h}return(A,h)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,m=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",$ge,[d.createElementVNode("span",null,d.toDisplayString(i.value[m].label),1)]),d.createVNode(o3,{label:"Color Palette ",title:d.unref(Do)[o[m]].title,palette:o[m],style:{marginBottom:"24px"},onButtonClick:g=>{s.value=m,c.value=m}},null,8,["title","palette","onButtonClick"]),s.value===m?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":h[0]||(h[0]=g=>s.value=null)},{default:d.withCtx(()=>[d.createVNode(l3,{selected:o[m],categorical:i.value[m].type==="String",onSelect:f},null,8,["selected","categorical"])]),_:2},1024)):d.createCommentVNode("",!0)],64))),256))}}),Vge={},Oge={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Qge(e,t){return d.openBlock(),d.createElementBlock("svg",Oge,t[0]||(t[0]=[d.createStaticVNode('<path fill-rule="evenodd" clip-rule="evenodd" d="M9.25 13.5C9.25 14.1904 9.80964 14.75 10.5 14.75L13.5 14.75C14.1904 14.75 14.75 14.1904 14.75 13.5V10.5C14.75 9.80964 14.1904 9.25 13.5 9.25H10.5C9.80964 9.25 9.25 9.80964 9.25 10.5V13.5ZM10.75 13.25V10.75H13.25V13.25H10.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M9.25 20.5C9.25 21.1904 9.80964 21.75 10.5 21.75H13.5C14.1904 21.75 14.75 21.1904 14.75 20.5V17.5C14.75 16.8096 14.1904 16.25 13.5 16.25H10.5C9.80964 16.25 9.25 16.8096 9.25 17.5L9.25 20.5ZM10.75 20.25V17.75H13.25V20.25H10.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 13.5C2.25 14.1904 2.80964 14.75 3.5 14.75H6.5C7.19036 14.75 7.75 14.1904 7.75 13.5L7.75 10.5C7.75 9.80964 7.19036 9.25 6.5 9.25H3.5C2.80964 9.25 2.25 9.80964 2.25 10.5L2.25 13.5ZM3.75 13.25L3.75 10.75H6.25V13.25H3.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 20.5C2.25 21.1904 2.80964 21.75 3.5 21.75H6.5C7.19036 21.75 7.75 21.1904 7.75 20.5L7.75 17.5C7.75 16.8096 7.19036 16.25 6.5 16.25H3.5C2.80964 16.25 2.25 16.8096 2.25 17.5L2.25 20.5ZM3.75 20.25L3.75 17.75H6.25V20.25H3.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M16.25 20.5C16.25 21.1904 16.8096 21.75 17.5 21.75H20.5C21.1904 21.75 21.75 21.1904 21.75 20.5L21.75 10.5C21.75 9.80964 21.1904 9.25 20.5 9.25H17.5C16.8096 9.25 16.25 9.80964 16.25 10.5L16.25 20.5ZM17.75 20.25L17.75 10.75L20.25 10.75L20.25 20.25H17.75Z" fill="#07AD3E"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 6.5C2.25 7.19036 2.80964 7.75 3.5 7.75L13.5 7.75C14.1904 7.75 14.75 7.19036 14.75 6.5V3.5C14.75 2.80964 14.1904 2.25 13.5 2.25L3.5 2.25C2.80964 2.25 2.25 2.80964 2.25 3.5L2.25 6.5ZM3.75 6.25L3.75 3.75L13.25 3.75V6.25L3.75 6.25Z" fill="#07AD3E"></path>',6)]))}const zge=Wr(Vge,[["render",Qge]]),EB="bins",Uge=d.defineComponent({__name:"Bins",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings[EB]),r=d.computed(()=>n.value.fillColor??Py);function a(o,s,c){s.type==="dataCategorical"?t.value.reactive.layersSettings[EB][c]={type:s.inputName}:t.value.reactive.layersSettings[EB][c]=o,s.type==="dataCategorical"&&typeof o!="string"&&(t.value.reactive.dataBindAes[s.selectedSource]=o)}const i=d.computed({get:()=>n.value.opacity*100,set:o=>{n.value.opacity=o/100}});return(o,s)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Hi,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:r.value,onAesUpdate:s[0]||(s[0]=(c,f)=>a(c,f,"fillColor"))},null,8,["selected"]),d.createVNode(d.unref(pt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:i.value,"onUpdate:modelValue":s[1]||(s[1]=c=>i.value=c)},null,8,["modelValue"])],64))}}),jge={class:"input-item"},Gge={class:"button-group-item"},Yge={class:"button-group-item"},Wge={class:"button-group-item",style:{display:"flex",alignItems:"end"}},Xge=d.defineComponent({__name:"Bubble",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.layersSettings.bubble),r=d.computed(()=>t.value.reactive.optionsState);d.computed(()=>t.value.inputGuide.value);const a=d.computed(()=>{var C;return(C=r.value.components.valueColor.selectorStates[0])==null?void 0:C.selectedSource}),i=d.computed(()=>{var C;return a.value?(C=t.value.reactive.dataBindAes[a.value])==null?void 0:C.palette:void 0}),o=d.ref(!1),s=d.ref(i.value??Z1);function c(C){s.value=C,o.value=!1,a.value&&(t.value.reactive.dataBindAes[a.value]=Vv(C))}const f=[{label:"None",value:null},{label:"Columns",value:"column"},{label:"Rows",value:"row"}],A=[{label:"z-score",value:"standardScaling"},{label:"Min-max",value:"meanNormalization"}],h=d.computed({get:()=>n.value.strokeColor??yo,set:C=>{n.value.strokeColor=C}}),m=[{label:"empty",value:null},{label:"Special value",value:"custom"}],g=d.ref(n.value.NAValueAs!==null?"custom":n.value.NAValueAs),b=d.ref(n.value.NAValueAs??0);return(C,x)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(o3,{label:"Color Palette ",title:d.unref(Do)[s.value].title,palette:s.value,onButtonClick:x[0]||(x[0]=k=>{o.value=!0})},null,8,["title","palette"]),o.value?(d.openBlock(),d.createBlock(Qh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":x[1]||(x[1]=k=>o.value=!1)},{default:d.withCtx(()=>[d.createVNode(l3,{selected:s.value,categorical:!1,onSelect:c},null,8,["selected"])]),_:1})):d.createCommentVNode("",!0),d.createElementVNode("div",jge,[d.createVNode(Hi,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke","possible-aes-source-inputs":[],selected:h.value,onAesUpdate:x[2]||(x[2]=k=>h.value=k)},null,8,["selected"])]),d.createElementVNode("div",Gge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Normalize by",options:f,compact:!0,modelValue:n.value.normalizationDirection,"onUpdate:modelValue":x[3]||(x[3]=k=>n.value.normalizationDirection=k)},null,8,["modelValue"])]),d.createElementVNode("div",Yge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Normalization method",options:A,compact:!0,modelValue:n.value.normalizationMethod,"onUpdate:modelValue":x[4]||(x[4]=k=>n.value.normalizationMethod=k)},null,8,["modelValue"])]),d.createElementVNode("div",Wge,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Treat NA value as:",options:m,compact:!0,modelValue:g.value,"onUpdate:modelValue":[x[5]||(x[5]=k=>g.value=k),x[6]||(x[6]=k=>{k==="custom"?n.value.NAValueAs=b.value:n.value.NAValueAs=k})]},null,8,["modelValue"]),d.createVNode(d.unref(pt.PlNumberField),{style:{height:"33px",marginLeft:"16px",width:"75px"},disabled:g.value!=="custom",label:"NA value",useIncrementButtons:!1,modelValue:b.value,"onUpdate:modelValue":[x[7]||(x[7]=k=>b.value=k),x[8]||(x[8]=k=>{k!==void 0&&(n.value.NAValueAs=k)})]},null,8,["disabled","modelValue"])])],64))}}),Kge={class:"layers-form",id:"layers-form"},Zge={class:"layers-list"},Jge=d.defineComponent({__name:"index",setup(e){const t=da(),n={box:Jve,binnedDots:ege,jitteredDots:nge,violin:oge,bar:lge,stackedBar:uge,line:cge,errorbar:fge,sina:dge,logo:hge},r={dots:kge,curve:y$},a={dots:Tge,curve:y$},i={heatmap:yge,heatmapClustered:Nge};return(o,s)=>(d.openBlock(),d.createElementBlock("div",Kge,[s[0]||(s[0]=d.createElementVNode("div",{class:"layers-title"},[d.createElementVNode("h3",null," Layers ")],-1)),d.createElementVNode("div",Zge,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(Gy)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(ts,{icon:d.unref(Vf)[c],title:d.unref(H0)[c],settings:{defaultState:d.unref(Gy)[d.unref(t).reactive.template].length>1?"close":"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(n[c])))]),_:2},1032,["icon","title","settings"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:1},d.renderList(d.unref(Ov)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(ts,{icon:d.unref(Vf)[c],title:d.unref(H0)[c],settings:{defaultState:d.unref(Ov)[d.unref(t).reactive.template].length>1?"close":"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(r[c])))]),_:2},1032,["icon","title","settings"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:2},d.renderList(d.unref(bR)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(ts,{icon:d.unref(Vf)[c],title:d.unref(H0)[c],settings:{defaultState:d.unref(Ov)[d.unref(t).reactive.template].length>1?"close":"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(a[c])))]),_:2},1032,["icon","title","settings"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:3},d.renderList(d.unref(cle)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(ts,{icon:d.unref(Vf)[c],title:d.unref(H0)[c],settings:{defaultState:"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(i[c])))]),_:2},1032,["icon","title"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createBlock(ts,{key:4,icon:zge,title:"Annotations",settings:{defaultState:"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(Fge)))]),_:1})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="dendro"?(d.openBlock(),d.createBlock(ts,{key:5,icon:d.unref(Vf).dendro,title:d.unref(H0).dendro,settings:{defaultState:"open"}},{default:d.withCtx(()=>[d.createVNode(bge)]),_:1},8,["icon","title"])):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createBlock(ts,{key:6,icon:d.unref(Vf).bins,title:d.unref(H0).bins,settings:{defaultState:"open"}},{default:d.withCtx(()=>[d.createVNode(Uge)]),_:1},8,["icon","title"])):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createBlock(ts,{key:7,icon:d.unref(Vf).bubble,title:d.unref(H0).bubble,settings:{defaultState:"open"}},{default:d.withCtx(()=>[d.createVNode(Xge)]),_:1},8,["icon","title"])):d.createCommentVNode("",!0)])]))}});function qge(e,{slots:t}){return d.h("div",Object.assign({},e,{class:"non-found-component"}),t.default&&t.default())}function eye(e,t){return d.computed(()=>{const n=d.unref(t);return n&&e[n]?e[n]:qge})}const tye={},nye={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function rye(e,t){return d.openBlock(),d.createElementBlock("svg",nye,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.5 7.5V4.5H19.5V7.5H14.5ZM13 4C13 3.44772 13.4477 3 14 3H20C20.5523 3 21 3.44772 21 4V8C21 8.55228 20.5523 9 20 9H14C13.4477 9 13 8.55228 13 8V4ZM4.5 19.5V16.5H9.5V19.5H4.5ZM3 16C3 15.4477 3.44772 15 4 15H10C10.5523 15 11 15.4477 11 16V20C11 20.5523 10.5523 21 10 21H4C3.44772 21 3 20.5523 3 20V16Z",fill:"#07AD3E"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.5 11.5V4.5H9.5V11.5H4.5ZM3 4C3 3.44772 3.44772 3 4 3H10C10.5523 3 11 3.44772 11 4V12C11 12.5523 10.5523 13 10 13H4C3.44772 13 3 12.5523 3 12V4ZM14.5 19.5V12.5H19.5V19.5H14.5ZM13 12C13 11.4477 13.4477 11 14 11H20C20.5523 11 21 11.4477 21 12V20C21 20.5523 20.5523 21 20 21H14C13.4477 21 13 20.5523 13 20V12Z",fill:"#110529"},null,-1)]))}const aye=Wr(tye,[["render",rye]]),iye={},oye={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function lye(e,t){return d.openBlock(),d.createElementBlock("svg",oye,t[0]||(t[0]=[d.createStaticVNode('<g clip-path="url(#clip0_8849_14901)"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.2214 15.2215L13.5701 12.8728C15.2298 11.2131 15.2298 8.5221 13.5701 6.86237C11.9104 5.20264 9.21943 5.20264 7.5597 6.86237L3.31706 11.105C1.65733 12.7647 1.65733 15.4557 3.31706 17.1154C4.38616 18.1845 5.88312 18.565 7.25674 18.2568L8.45258 19.4526C6.38303 20.2767 3.93151 19.8512 2.2564 18.1761C0.0108876 15.9306 0.0108879 12.2899 2.2564 10.0444L6.49904 5.80171C8.74456 3.5562 12.3853 3.5562 14.6308 5.80171C16.8763 8.04723 16.8763 11.6879 14.6308 13.9334L12.2821 16.2821L11.2214 15.2215Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M17.4594 18.1761C15.2139 20.4216 11.5732 20.4216 9.32769 18.1761C7.08218 15.9306 7.08218 12.2899 9.32769 10.0444L11.686 7.68604L12.7467 8.7467L10.3884 11.105C8.72862 12.7647 8.72862 15.4557 10.3884 17.1154C12.0481 18.7751 14.739 18.7751 16.3988 17.1154L20.6414 12.8728C22.3011 11.2131 22.3011 8.5221 20.6414 6.86237C19.5764 5.79737 18.0868 5.41575 16.7175 5.71752L15.5197 4.51971C17.5863 3.70299 20.0307 4.13032 21.7021 5.80171C23.9476 8.04723 23.9476 11.6879 21.7021 13.9334L17.4594 18.1761Z" fill="#07AD3E"></path></g><defs><clipPath id="clip0_8849_14901"><rect width="24" height="24" fill="white"></rect></clipPath></defs>',2)]))}const sye=Wr(iye,[["render",lye]]),uye={},cye={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function fye(e,t){return d.openBlock(),d.createElementBlock("svg",cye,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23.25 17.75V14H24.75V17.75H26V19.25H24.75V23.25H28.75V22H30.25V23.25H34V24.75H30.25V26H28.75V24.75H24.75V28.75H26V30.25H24.75V34H23.25V30.25H22V28.75H23.25V24.75H19.25V26H17.75V24.75H14V23.25H17.75V22H19.25V23.25H23.25V19.25H22V17.75H23.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.4697 15.5303L17.7501 17.8107V20H19.2501V17.8107L21.5304 15.5303L20.4697 14.4697L18.5001 16.4393L16.5304 14.4697L15.4697 15.5303ZM27.4697 28.5303L29.4394 30.5L27.4697 32.4697L28.5304 33.5303L30.5001 31.5607L32.4697 33.5303L33.5304 32.4697L31.5607 30.5L33.5304 28.5303L32.4697 27.4697L30.5001 29.4393L28.5304 27.4697L27.4697 28.5303Z",fill:"#07AD3E"},null,-1)]))}const dye=Wr(uye,[["render",fye]]),Aye={},pye={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function hye(e,t){return d.openBlock(),d.createElementBlock("svg",pye,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.5 12C20.5 10.3189 20.0015 8.67547 19.0675 7.27766C18.1335 5.87984 16.806 4.79037 15.2528 4.14703C13.6996 3.50368 11.9906 3.33536 10.3417 3.66333C8.6929 3.9913 7.17834 4.80085 5.9896 5.9896C4.80085 7.17834 3.9913 8.6929 3.66333 10.3417C3.33536 11.9906 3.50368 13.6996 4.14703 15.2528C4.79037 16.806 5.87984 18.1335 7.27766 19.0675C8.18407 19.6731 9.19374 20.0957 10.25 20.3179V12.75H7V11.25H10.25V8C10.25 6.48122 11.4812 5.25 13 5.25C14.5188 5.25 15.75 6.48122 15.75 8V8.5H14.25V8C14.25 7.30964 13.6904 6.75 13 6.75C12.3096 6.75 11.75 7.30964 11.75 8V11.25H15V12.75H11.75V20.4963V21.5V21.9969C9.85961 21.9496 8.01943 21.3672 6.4443 20.3147C4.79981 19.2159 3.51809 17.6541 2.76121 15.8268C2.00433 13.9996 1.8063 11.9889 2.19215 10.0491C2.578 8.10929 3.53041 6.32746 4.92894 4.92894C6.32746 3.53041 8.10929 2.578 10.0491 2.19215C11.9889 1.8063 13.9996 2.00433 15.8268 2.76121C17.6541 3.51809 19.2159 4.79981 20.3147 6.4443C21.4135 8.08879 22 10.0222 22 12H20.5Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19.0607 18L21.5304 15.5303L20.4697 14.4697L18.0001 16.9393L15.5304 14.4697L14.4697 15.5303L16.9394 18L14.4697 20.4697L15.5304 21.5303L18.0001 19.0607L20.4697 21.5303L21.5304 20.4697L19.0607 18Z",fill:"#07AD3E"},null,-1)]))}const mye=Wr(Aye,[["render",hye]]),vye={},gye={class:"layers-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function yye(e,t){return d.openBlock(),d.createElementBlock("svg",gye,t[0]||(t[0]=[d.createElementVNode("g",{id:"24: layers"},[d.createElementVNode("path",{id:"Subtract","fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.37549 15.1251L12.0003 21.25L21.6255 15.1249L21.6749 15.1563C22.2924 15.5493 22.2924 16.4507 21.6749 16.8436L12.5375 22.6583C12.21 22.8668 11.7913 22.8668 11.4638 22.6583L2.32641 16.8436C1.70891 16.4507 1.70891 15.5493 2.32641 15.1563L2.37549 15.1251Z",fill:"#07AD3E"}),d.createElementVNode("path",{id:"Union","fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.32641 7.15633C1.70891 7.54929 1.70891 8.4507 2.32641 8.84366L11.4638 14.6583C11.7913 14.8668 12.21 14.8668 12.5375 14.6583L21.6749 8.84365C22.2924 8.4507 22.2924 7.54929 21.6749 7.15633L12.5375 1.34164C12.21 1.13319 11.7913 1.13319 11.4638 1.34164L2.32641 7.15633ZM3.75 7.99997L12 13.25L20.25 7.99997L12 2.74997L3.75 7.99997ZM12.0003 17.25L2.37549 11.1251L2.32641 11.1563C1.70891 11.5493 1.70891 12.4507 2.32641 12.8436L11.4638 18.6583C11.7913 18.8668 12.21 18.8668 12.5375 18.6583L21.6749 12.8436C22.2924 12.4507 22.2924 11.5493 21.6749 11.1563L21.6255 11.1249L12.0003 17.25Z",fill:"#110529"})],-1)]))}const wye=Wr(vye,[["render",yye]]),Cye=d.defineComponent({__name:"SettingsIcon",setup(e){return(t,n)=>(d.openBlock(),d.createBlock(d.unref(pt.PlIcon24),{name:"settings"}))}}),bye={},Eye={class:"export-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function xye(e,t){return d.openBlock(),d.createElementBlock("svg",Eye,t[0]||(t[0]=[d.createElementVNode("g",{id:"Icon"},[d.createElementVNode("path",{id:"Rectangle 4179",d:"M3 17V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V17",stroke:"#07AD3E","stroke-width":"1.5"}),d.createElementVNode("path",{id:"Vector 1335",d:"M18 10L12 16M12 16L6 10M12 16L12 2",stroke:"black","stroke-width":"1.5"})],-1)]))}const Sye=Wr(bye,[["render",xye]]),Bye={class:"input-item"},kye={class:"input-item"},Tye={class:"input-item"},_ye={class:"input-item"},Pye={class:"input-item",style:{"z-index":"0"}},Mye={class:"checkbox-item"},Dye={class:"input-item"},Hye={class:"input-item"},Iye={class:"input-item",style:{"z-index":"0"}},Lye={class:"checkbox-item"},Rye=d.defineComponent({__name:"DiscreteStatisticsForm",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.statisticsSettings),r=d.computed(()=>t.value.commonHelpersData.primaryGroups.value),a=d.computed(()=>RR(r.value)),i=d.computed(()=>NR(r.value)),o=(g,b)=>d.computed({get(){return g[b]??void 0},set(C){g[b]=C??null}}),s=o(n.value.overall.data,"testMethod"),c=o(n.value.referenceGroup.data,"testMethod"),f=o(n.value.referenceGroup.data,"referenceGroup"),A=o(n.value.referenceGroup.data,"correctionMethod"),h=o(n.value.pairwise.data,"testMethod"),m=o(n.value.pairwise.data,"correctionMethod");return PS(t)(),d.watch([()=>n.value.overall.data.testMethod,()=>n.value.referenceGroup.data.referenceGroup],PS(t)),(g,b)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[b[12]||(b[12]=d.createElementVNode("h3",null," Statistics ",-1)),b[13]||(b[13]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"overall p-value")],-1)),d.createElementVNode("div",Bye,[d.createVNode(d.unref(pt.PlDropdown),{label:"Method",clearable:"",placeholder:"Choose",modelValue:d.unref(s),"onUpdate:modelValue":b[0]||(b[0]=C=>d.isRef(s)?s.value=C:null),options:i.value,error:n.value.overall.validity.testMethod?"":" "},null,8,["modelValue","options","error"])]),b[14]||(b[14]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"reference group")],-1)),d.createElementVNode("div",kye,[d.createVNode(d.unref(pt.PlDropdown),{label:"Reference from...",clearable:"",placeholder:"Choose",modelValue:d.unref(f),"onUpdate:modelValue":b[1]||(b[1]=C=>d.isRef(f)?f.value=C:null),options:a.value,error:n.value.referenceGroup.validity.referenceGroup?"":" "},null,8,["modelValue","options","error"])]),d.createElementVNode("div",Tye,[d.createVNode(d.unref(pt.PlDropdown),{label:"Method",clearable:"",placeholder:"Choose",modelValue:d.unref(c),"onUpdate:modelValue":b[2]||(b[2]=C=>d.isRef(c)?c.value=C:null),options:d.unref(HC)},null,8,["modelValue","options"])]),d.createElementVNode("div",_ye,[d.createVNode(d.unref(pt.PlDropdown),{label:"Correction method",placeholder:"Choose",modelValue:d.unref(A),"onUpdate:modelValue":b[3]||(b[3]=C=>d.isRef(A)?A.value=C:null),options:d.unref(xR)},null,8,["modelValue","options"])]),d.createElementVNode("div",Pye,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Show",modelValue:n.value.referenceGroup.data.format,"onUpdate:modelValue":b[4]||(b[4]=C=>n.value.referenceGroup.data.format=C),options:d.unref(SR)},null,8,["modelValue","options"])]),d.createElementVNode("div",Mye,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.referenceGroup.data.ns,"onUpdate:modelValue":b[5]||(b[5]=C=>n.value.referenceGroup.data.ns=C)},null,8,["modelValue"]),b[10]||(b[10]=d.createElementVNode("span",null,"Non-significant",-1))]),b[15]||(b[15]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"pairwise p-value")],-1)),d.createElementVNode("div",Dye,[d.createVNode(d.unref(pt.PlDropdown),{label:"Method",clearable:"",placeholder:"Choose",modelValue:d.unref(h),"onUpdate:modelValue":b[6]||(b[6]=C=>d.isRef(h)?h.value=C:null),options:d.unref(HC)},null,8,["modelValue","options"])]),d.createElementVNode("div",Hye,[d.createVNode(d.unref(pt.PlDropdown),{label:"Correction method",placeholder:"Choose",modelValue:d.unref(m),"onUpdate:modelValue":b[7]||(b[7]=C=>d.isRef(m)?m.value=C:null),options:d.unref(xR)},null,8,["modelValue","options"])]),d.createElementVNode("div",Iye,[d.createVNode(d.unref(pt.PlBtnGroup),{label:"Show",modelValue:n.value.pairwise.data.format,"onUpdate:modelValue":b[8]||(b[8]=C=>n.value.pairwise.data.format=C),options:d.unref(SR)},null,8,["modelValue","options"])]),d.createElementVNode("div",Lye,[d.createVNode(d.unref(pt.PlCheckbox),{modelValue:n.value.pairwise.data.ns,"onUpdate:modelValue":b[9]||(b[9]=C=>n.value.pairwise.data.ns=C)},null,8,["modelValue"]),b[11]||(b[11]=d.createElementVNode("span",null,"Non-significant",-1))])],64))}}),Nye={class:"checkbox-item"},$ye=d.defineComponent({__name:"ScatterplotStatisticsForm",setup(e){const t=da(),n=d.computed(()=>t.value.reactive.statisticsSettings);return(r,a)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[a[1]||(a[1]=d.createElementVNode("h3",null,"Statistics",-1)),a[2]||(a[2]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"trends")],-1)),d.createElementVNode("div",Nye,[d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:n.value.trend.on,"onUpdate:modelValue":a[0]||(a[0]=i=>n.value.trend.on=i),label:"Build trend",disabled:d.unref(t).reactive.template==="curve"},null,8,["modelValue","disabled"])])],64))}}),Fye=d.defineComponent({__name:"index",setup(e){const t=da();return(n,r)=>(d.openBlock(),d.createElementBlock("div",{class:"stat-form",onClick:r[0]||(r[0]=a=>a.stopPropagation())},[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createBlock(Rye,{key:0})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(),d.createBlock($ye,{key:1})):d.createCommentVNode("",!0)]))}}),Vye={},Oye={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Qye(e,t){return d.openBlock(),d.createElementBlock("svg",Oye,t[0]||(t[0]=[d.createStaticVNode('<path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 3.75002C7.5 3.05967 8.05964 2.50002 8.75 2.50002L15.25 2.5C15.9404 2.5 16.5 3.05964 16.5 3.75V5.50004L20.5 5.50006V7.00006L19 7.00006H17.5L6.5 7.00004H5L3.5 7V5.5L7.5 5.50006V3.75002ZM9 5.50006L15 5.50004V4L9 4.00002V5.50006Z" fill="#110529"></path><path d="M17.5 7.00006V12.5H19V7.00006H17.5Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M6.5 17.75C6.5 18.9926 7.50736 20 8.75 20H12V21.5H8.75C6.67893 21.5 5 19.8211 5 17.75V8.50006H6.5V17.75Z" fill="#110529"></path><path d="M6.5 7.00004H5V8.50006H6.5V7.00004Z" fill="#110529"></path><path d="M14.75 14.5L18.25 18M21.75 21.5L18.25 18M18.25 18L21.75 14.5M18.25 18L14.75 21.5" stroke="#07AD3E" stroke-width="1.5"></path>',5)]))}const zye=Wr(Vye,[["render",Qye]]),Uye={},jye={class:"settings-list"};function Gye(e,t){return d.openBlock(),d.createElementBlock("div",{class:"settings-form",onClick:t[0]||(t[0]=n=>n.stopPropagation())},[t[1]||(t[1]=d.createElementVNode("div",{class:"settings-title"},[d.createElementVNode("h3",null," Settings ")],-1)),d.createElementVNode("div",jye,[d.renderSlot(e.$slots,"default"),d.renderSlot(e.$slots,"settingsSlot")])])}const mb={settings:{icon:Cye,component:Wr(Uye,[["render",Gye]]),title:"Settings"},template:{icon:aye,component:Xle,title:"Template"},dataMapping:{icon:sye,component:g0e,title:"Data mapping"},axes:{icon:dye,component:Ove,title:"Axes settings"},statistics:{icon:mye,component:Fye,title:"Statistics"},layers:{icon:wye,component:Jge,title:"Layers"},delete:{icon:zye,component:null,title:"Delete graph"},export:{icon:Sye,component:null,title:"Export"}};function Yye(){return Object.keys(mb)}function Wye(e){return mb[e].icon??""}function Xye(e){return mb[e].title??""}function Kye(e){const t=Object.entries(mb).reduce((n,[r,a])=>H1e.setProp(n,r,a.component),{});return eye(t,e)}const Zye={class:"settings-tabs"},Jye={style:{"font-family":"var(--font-family-base)"}},qye=d.defineComponent({__name:"index",props:{chartType:{},graphStatus:{},allowDeleting:{type:Boolean},hasSettingsSlot:{type:Boolean},modelValue:{}},emits:["update:modelValue","export","delete"],setup(e,{emit:t}){const n=t,r=e,a=d.computed(()=>Yye().filter(o=>!(o==="settings"&&!r.hasSettingsSlot)&&!(o==="statistics"&&r.chartType!=="discrete"&&r.chartType!=="scatterplot")&&!(o==="delete"&&r.allowDeleting)));function i(o){n("update:modelValue",o===r.modelValue?null:o)}return(o,s)=>(d.openBlock(),d.createElementBlock("div",Zye,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,c=>(d.openBlock(),d.createBlock(d.unref(pt.PlTooltip),{key:c,"open-delay":100,"close-delay":100,class:d.normalizeClass(["has-inline-icon",{active:o.modelValue===c,"temp-inactive":c==="export"&&(o.graphStatus!=="ready"||o.chartType==="scatterplot-umap"),[c]:!0}]),position:"left",hide:o.modelValue===c,onClick:f=>{f.stopPropagation(),c==="export"?o.$emit("export"):c==="delete"?o.$emit("delete"):i(c)}},{tooltip:d.withCtx(()=>[d.createElementVNode("span",Jye,d.toDisplayString(d.unref(Xye)(c)),1)]),default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(d.unref(Wye)(c))))]),_:2},1032,["class","hide","onClick"]))),128))]))}}),e3e=d.defineComponent({__name:"TransitionSlidePanel",setup(e){function t(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(r,a)=>(d.openBlock(),d.createBlock(d.Transition,{name:"slide-panel",onAfterEnter:t,onAfterLeave:n},{default:d.withCtx(()=>[d.renderSlot(r.$slots,"default")]),_:3}))}}),t3e=d.defineComponent({__name:"PanelModal",emits:["close"],setup(e,{emit:t}){const n=t,r=d.ref();return pt.useClickOutside([r],()=>n("close")),(a,i)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"rootRef",ref:r,class:"panel-modal"},[d.createVNode(d.unref(pt.PlCloseModalBtn),{class:"close-panel-modal",onClick:i[0]||(i[0]=o=>n("close"))}),d.renderSlot(a.$slots,"default",{ref:"contentRef"})],512))}}),n3e={},r3e={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function a3e(e,t){return d.openBlock(),d.createElementBlock("svg",r3e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.75 2.25V7.25H13.75V8.75H8.75V13.75H7.25V8.75H2.25V7.25H7.25V2.25H8.75Z",fill:"#110529"},null,-1)]))}const i3e=Wr(n3e,[["render",a3e]]),o3e={},l3e={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function s3e(e,t){return d.openBlock(),d.createElementBlock("svg",l3e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.25 7.25H13.75V8.75H2.25V7.25Z",fill:"#110529"},null,-1)]))}const u3e=Wr(o3e,[["render",s3e]]),c3e={class:"zoom-text-field"},f3e=d.defineComponent({__name:"ZoomInput",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,r=e,a=d.ref(),i=d.ref(!1),o=d.ref(String(r.modelValue)),s=d.computed({get(){const c=o.value??"100";return i.value?c:c+"%"},set(c){return o.value=c,c}});return d.watch(()=>i.value,c=>{if(!c){let f=Number(o.value);isNaN(f)?o.value=String(r.modelValue):n("update:modelValue",f)}}),d.watch(()=>r.modelValue,c=>{o.value=String(c)}),(c,f)=>(d.openBlock(),d.createElementBlock("div",{class:"zoom-text-field__envelope zoom-input",onFocusin:f[1]||(f[1]=A=>i.value=!0),onFocusout:f[2]||(f[2]=A=>i.value=!1),onKeyup:f[3]||(f[3]=d.withKeys(A=>{var h;return(h=a.value)==null?void 0:h.blur()},["enter"]))},[d.createElementVNode("div",c3e,[d.withDirectives(d.createElementVNode("input",{ref_key:"input",ref:a,"onUpdate:modelValue":f[0]||(f[0]=A=>s.value=A),type:"text"},null,512),[[d.vModelText,s.value]]),d.createVNode(AB,{style:{"z-index":"1"},class:"zoom-text-field__contour"})])],32))}}),d3e={class:"zoom-container"},A3e=20,p3e=400,w$=10,h3e=d.defineComponent({__name:"index",setup(e){const t=da();function n(i){return Math.max(A3e,Math.min(p3e,i))}function r(){t.value.reactive.chartScale=n(t.value.reactive.chartScale-w$)}function a(){t.value.reactive.chartScale=n(t.value.reactive.chartScale+w$)}return(i,o)=>(d.openBlock(),d.createElementBlock("div",d3e,[o[1]||(o[1]=d.createElementVNode("div",{class:"zoom-border"},null,-1)),d.createVNode(d.unref(pt.PlBtnGhost),{onClick:r},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(u3e)))]),_:1}),d.createVNode(f3e,{modelValue:d.unref(t).reactive.chartScale,"onUpdate:modelValue":o[0]||(o[0]=s=>d.unref(t).reactive.chartScale=n(s))},null,8,["modelValue"]),d.createVNode(d.unref(pt.PlBtnGhost),{onClick:a},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(i3e)))]),_:1})]))}}),m3e=d.defineComponent({__name:"DendroTable",props:{chartData:{}},emits:["row-select"],setup(e,{emit:t}){const n=da(),r=e,a=d.ref(100),i=d.shallowRef(),o=d.computed(()=>["id",...n.value.reactive.optionsState.components.tableContent.selectorStates.map(g=>g.selectedSource)]),s=d.ref([]);d.watch(()=>{var g;return(g=r.chartData)==null?void 0:g.hierarchy},g=>{if(g){const b=g.leaves().map(C=>C.data.rawData.id);(b.length!==s.value.length||b.some((C,x)=>C!==s.value[x]))&&(s.value=b)}else s.value=[]},{immediate:!0});const c=d.ref([]),f=d.ref([]);d.watch([()=>s.value,()=>o.value,()=>n.value.commonHelpersData.dendroTableData.value],([g,b,C])=>{if(C===null){f.value=[],c.value=[];return}if(b.some(k=>!C[k]))return;const x=C.id.data.reduce((k,_,D)=>{const O=_;return k[O]&&console.warn(`More than 1 value for node id ${O} in dendro table`),k[O]=b.reduce((I,$)=>{const Q=C[$];return Q&&(I[$]=Q.data[D]),I},{}),k},{});f.value=b.map(k=>({headerName:C[k].label,field:k,sortable:!1,resizable:!1})),c.value=g.map(k=>x[k]??null),m()},{immediate:!0});const A=d.computed(()=>{var b,C;const g=(C=(b=r.chartData)==null?void 0:b.chartSizes)==null?void 0:C.treeHeight;return s.value.length?g/s.value.length:0}),h=g=>{i.value=g.api,m()};function m(){if(i.value&&!i.value.isDestroyed()){i.value.autoSizeAllColumns();const g=i.value.getColumns();g&&(a.value=g.reduce((b,C)=>b+C.getActualWidth(),2))}}return d.watch(()=>n.value.reactive.dendroSelectedNodeId,g=>{i.value&&(g===null?i.value.deselectAll():i.value.forEachNode(b=>{b.data.id===g&&b.setSelected(!0,!0)}))}),(g,b)=>(d.openBlock(),d.createElementBlock("div",{class:"dendro-table",style:d.normalizeStyle({width:a.value+"px"})},[d.createVNode(d.unref(Qee.AgGridVue),{theme:d.unref(pt.AgGridTheme),gridApi:i.value,onGridReady:h,defaultColDef:{suppressHeaderMenuButton:!0},rowData:c.value,columnDefs:f.value,rowHeight:A.value,autoSizeStrategy:{type:"fitCellContents"},onGridColumnsChanged:b[0]||(b[0]=()=>{m()}),domLayout:"autoHeight"},null,8,["theme","gridApi","rowData","columnDefs","rowHeight"])],4))}}),v3e={},g3e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function y3e(e,t){return d.openBlock(),d.createElementBlock("svg",g3e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19.091 3.53035C18.2123 2.65166 16.7877 2.65167 15.909 3.53037L3.90901 15.5304C3.48705 15.9524 3.25 16.5246 3.25 17.1214V20.0001C3.25 20.4143 3.58579 20.7501 4 20.7501H6.87868C7.47542 20.7501 8.04771 20.513 8.46967 20.0911L20.4697 8.09099C21.3484 7.21231 21.3484 5.7877 20.4697 4.90903L19.091 3.53035ZM16.9697 4.59101C17.2626 4.29811 17.7374 4.29811 18.0303 4.59101L19.409 5.96969C19.7019 6.26258 19.7019 6.73745 19.409 7.03034L18.5 7.9394L16.0607 5.50006L16.9697 4.59101ZM15 6.56073L17.4393 9.00007L7.40901 19.0304C7.26836 19.171 7.07759 19.2501 6.87868 19.2501H4.75V17.1214C4.75 16.9225 4.82902 16.7317 4.96967 16.5911L15 6.56073Z",fill:"#CFD1DB"},null,-1),d.createElementVNode("path",{d:"M12 20.7501L20 20.7501L20 19.2501L12 19.2501L12 20.7501Z",fill:"#CFD1DB"},null,-1)]))}const w3e=Wr(v3e,[["render",y3e]]),C$=d.defineComponent({__name:"Loading",props:{top:{default:0},left:{default:0},right:{default:0},bottom:{default:0}},setup(e){return(t,n)=>(d.openBlock(),d.createElementBlock("div",{class:"graph-maker__loading",style:d.normalizeStyle({top:`${t.top}px`,bottom:`${t.bottom}px`,right:`${t.right}px`,left:`${t.left}px`})},n[0]||(n[0]=[d.createStaticVNode('<div class="loading-picture"><svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M36.0197 2.29384C37.0053 1.76506 37.7157 1.45481 38.4537 1.29931C39.4734 1.08447 40.5266 1.08447 41.5463 1.29931C42.2843 1.45481 42.9947 1.76506 43.9803 2.29384C44.7026 2.66301 45.5542 3.14998 46.6565 3.78023L68.4201 16.2247C69.3757 16.7711 70.1409 17.2086 70.7708 17.5978C71.8362 18.2367 72.5158 18.7183 73.0579 19.3166C73.7667 20.0989 74.3023 21.0219 74.6298 22.0253C75 23.1595 75 24.4276 75 26.9639V53.0362C75 55.5725 75 56.8407 74.6298 57.9748C74.3023 58.9782 73.7667 59.9012 73.0579 60.6835C72.5154 61.2822 71.8353 61.764 70.7688 62.4035C70.1393 62.7924 69.3748 63.2295 68.4203 63.7753L46.6565 76.2198C45.555 76.8497 44.7037 77.3364 43.9817 77.7055C42.9954 78.2347 42.2847 78.5452 41.5463 78.7008C40.5266 78.9156 39.4734 78.9156 38.4537 78.7008C37.7153 78.5452 37.0045 78.2347 36.0182 77.7054C35.2962 77.3364 34.445 76.8497 33.3436 76.2199L11.5799 63.7754C10.6253 63.2295 9.86069 62.7924 9.23115 62.4035C8.16466 61.764 7.48457 61.2822 6.94208 60.6835C6.23334 59.9012 5.6977 58.9782 5.37018 57.9748C5 56.8407 5 55.5725 5 53.0362V26.9639C5 24.4276 5 23.1595 5.37018 22.0253C5.6977 21.0219 6.23334 20.0989 6.94208 19.3166C7.48422 18.7183 8.16379 18.2367 9.22911 17.5978C9.85904 17.2086 10.6242 16.7711 11.5799 16.2247L33.3435 3.78023C34.4457 3.14998 35.2974 2.663 36.0197 2.29384ZM10 34.9971V24.9907H37.4546V34.9971H10ZM10 45.0036V40.0003H37.4546V45.0036H10ZM37.4546 72.9139L10 57.1541V50.0069H37.4546V72.9139ZM65.0189 60.0134L42.5455 72.9138V60.0134H65.0189ZM70 24.9907V55.0101H42.5455V24.9907H70ZM14.98 19.9874L40 5.62505L65.0201 19.9874H14.98Z" fill="#E1E3EB"></path></svg><div class="loading-progress-bar"><div class="moving-dash"></div></div></div>',1)]),4))}}),C3e={class:"graph-info-tooltip-title"},b3e=["title"],E3e={key:1,class:"graph-info-tooltip-sequence-row"},x3e=["title"],S3e={key:0,class:"graph-info-tooltip-icon"},B3e={key:0,"data-theme":"dark",class:"graph-info-tooltip-button"},k3e=48,T3e=62.5,_3e=26,P3e=16,b$=24,M3e=20,D3e=d.defineComponent({__name:"DendroTooltip",props:{info:{},tooltipBtn:{},containerRef:{}},emits:["close","tooltip-btn-click"],setup(e,{emit:t}){const n=e,r=da(),a=t,i=d.ref();pt.useClickOutside([i],()=>a("close"));const o=d.computed(()=>{const b=k=>r.value.reactive.optionsState.components[k].selectorStates.map(_=>_.selectedSource),C=["tableContent","labels","nodeColor","nodeSize","nodeShape","lineColor"],x=["id"];return C.forEach(k=>{b(k).forEach(D=>{x.includes(D)||x.push(D)})}),x}),s=d.computed(()=>n.info.info[0]),c=d.computed(()=>{var b;return(b=s.value)==null?void 0:b.id}),f=d.computed(()=>{const b=r.value.commonHelpersData.dendroTableData.value;if(!b)return[];const C=b.id.data.findIndex(x=>String(x)===String(c.value));return C!==-1?o.value.map(x=>{var k,_;return{label:b[x].label,value:b[x].data[C],isSequence:((_=(k=b[x].spec)==null?void 0:k.annotations)==null?void 0:_["pl7.app/type"])==="sequence"}}):[]}),A=d.computed(()=>f.value.reduce((b,C)=>b+(C.isSequence?T3e:_3e),0)+P3e*2+(n.tooltipBtn?k3e:0)),h=d.computed(()=>({left:n.info.x+M3e+"px",top:n.info.y+b$+"px"})),m=d.computed(()=>{const b=n.containerRef.scrollHeight,C=A.value/2,x=n.info.y+b$;return x<C?-x:b-C<x?-(A.value-(b-x)):-C});function g(b){var C;(C=window==null?void 0:window.navigator)==null||C.clipboard.writeText(b)}return(b,C)=>(d.openBlock(),d.createElementBlock("div",{class:"graph-info-tooltip__container",ref:"",style:d.normalizeStyle(h.value)},[C[3]||(C[3]=d.createElementVNode("div",{class:"graph-info-tooltip__tail"},null,-1)),d.createElementVNode("div",{class:"graph-info-tooltip",ref_key:"rootRef",ref:i,style:d.normalizeStyle({transform:`translate(0,${m.value}px)`}),onClick:C[2]||(C[2]=x=>x.stopPropagation())},[d.createVNode(d.unref(pt.PlMaskIcon24),{class:"graph-info-tooltip-close",name:"close",onClick:C[0]||(C[0]=x=>a("close"))}),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.value,x=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["graph-info-tooltip-row",{"graph-info-tooltip-row__sequence":x.isSequence}])},[d.createElementVNode("div",C3e,d.toDisplayString(x.label+":"),1),x.isSequence?(d.openBlock(),d.createElementBlock("div",E3e,[d.createElementVNode("div",{class:"graph-info-tooltip-value",title:String(x.value)},d.toDisplayString(x.value),9,x3e),x.isSequence?(d.openBlock(),d.createElementBlock("div",S3e,[d.createVNode(d.unref(pt.PlMaskIcon16),{class:"graph-info-tooltip-clipboard",name:"clipboard",onClick:()=>g(String(x.value))},null,8,["onClick"])])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createElementBlock("div",{key:0,class:"graph-info-tooltip-value",title:String(x.value)},d.toDisplayString(x.value),9,b3e))],2))),256)),b.tooltipBtn?(d.openBlock(),d.createElementBlock("div",B3e,[d.createVNode(d.unref(pt.PlBtnSecondary),{icon:"arrow-right",size:"small",onClick:C[1]||(C[1]=()=>a("tooltip-btn-click",c.value))},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(b.tooltipBtn),1)]),_:1})])):d.createCommentVNode("",!0)],4)],4))}}),H3e={class:"chart_container"},I3e={class:"chart_header"},L3e=["value"],R3e={class:"chart_titleLineSlot"},N3e={key:0,class:"chart_tabBy"},$3e={key:2,style:{position:"absolute",left:"10px",bottom:"10px"}},F3e=d.defineComponent({__name:"Chart",props:{graphStatus:{},graphTitle:{},dendroTooltipButton:{},chartData:{}},emits:["graph-title-update","dendro-node-select","dendro-tooltip-btn-click"],setup(e,{emit:t}){const n=t,r=da(),a=e,i=d.ref(a.graphTitle);d.watch(()=>a.graphTitle,x=>{i.value=x});const o=d.computed(()=>{var x;return(x=r.value.reactive.optionsState.components.tabBy)==null?void 0:x.selectorStates[0]}),s=d.computed(()=>{var x;return(x=o.value)==null?void 0:x.selectedSource}),c=d.computed(()=>{var x;return(x=o.value)==null?void 0:x.selectedFilterValue}),f=d.ref(c.value);d.watch(()=>s.value,(x,k)=>{x!==k&&(f.value=c.value)},{immediate:!0});const A=d.computed(()=>r.value.uniqueValuesData.value),h=d.computed(()=>{var x;if(s.value){const k=(x=A.value[s.value])==null?void 0:x.options;return k&&k.sort((_,D)=>_.label>D.label?1:-1),k}else return});d.watch(()=>h.value,x=>{if(x&&x.length&&f.value===void 0){const k=x[0].value;f.value=k,m(k)}},{immediate:!0});function m(x){const k=r.value.reactive.optionsState.components.tabBy.selectorStates;k.length&&(r.value.reactive.optionsState.components.tabBy.selectorStates=[{...k[0],type:"equals",selectedFilterValue:x}])}function g(x){const k=x.currentTarget;i.value=k.value,n("graph-title-update",k.value)}function b(x){n("dendro-node-select",x)}const C=d.ref();return(x,k)=>(d.openBlock(),d.createElementBlock("div",H3e,[d.createElementVNode("div",I3e,[d.createElementVNode("input",{class:"chart_title",value:i.value,onChange:g,onKeyup:k[0]||(k[0]=d.withKeys(_=>{var D;(D=_.target)==null||D.blur()},["enter"]))},null,40,L3e),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(w3e),{class:"chart_titleEdit"})),d.createElementVNode("div",R3e,[d.renderSlot(x.$slots,"default")])]),s.value?(d.openBlock(),d.createElementBlock("div",N3e,[d.createVNode(d.unref(pt.PlDropdown),{label:"Show for",modelValue:f.value,"onUpdate:modelValue":[k[1]||(k[1]=_=>f.value=_),k[2]||(k[2]=_=>m(_))],options:h.value},null,8,["modelValue","options"])])):d.createCommentVNode("",!0),d.createElementVNode("div",{class:d.normalizeClass(["chart_main-content",{"chart_main-content__dendro":d.unref(r).reactive.chartType==="dendro"}]),ref_key:"chartContainerRef",ref:C},[d.createElementVNode("div",{id:"chartSvgContainer",class:d.normalizeClass({chart_loading:d.unref(r).loading.initialCharts&&x.graphStatus==="ready",chart_noDataMapping:x.graphStatus==="notReady",chart_emptyData:x.graphStatus==="empty",chart_inconsistent:x.graphStatus==="inconsistent"})},[d.unref(r).loading.initialCharts&&x.graphStatus==="ready"?(d.openBlock(),d.createBlock(C$,{key:0})):d.createCommentVNode("",!0)],2),d.unref(r).reactive.chartType==="dendro"&&x.chartData&&d.unref(r).reactive.layersSettings.dendro.showTable?(d.openBlock(),d.createBlock(m3e,{key:0,chartData:x.chartData,onRowSelect:b},null,8,["chartData"])):d.createCommentVNode("",!0),d.unref(r).reactive.dendroInfoByClick?(d.openBlock(),d.createBlock(D3e,{key:1,info:d.unref(r).reactive.dendroInfoByClick,containerRef:C.value,tooltipBtn:x.dendroTooltipButton,onTooltipBtnClick:k[3]||(k[3]=_=>x.$emit("dendro-tooltip-btn-click",_)),onClose:k[4]||(k[4]=_=>{d.unref(r).reactive.dendroInfoByClick=null,x.$emit("dendro-node-select",null)})},null,8,["info","containerRef","tooltipBtn"])):d.createCommentVNode("",!0)],2),x.graphStatus!=="empty"&&d.unref(r).reactive.chartType!=="scatterplot-umap"?(d.openBlock(),d.createBlock(h3e,{key:1})):d.createCommentVNode("",!0),x.graphStatus!=="empty"&&d.unref(r).reactive.chartType==="scatterplot-umap"?(d.openBlock(),d.createElementBlock("div",$3e,[d.createVNode(d.unref(pt.PlToggleSwitch),{modelValue:d.unref(r).reactive.lassoMode,"onUpdate:modelValue":k[5]||(k[5]=_=>d.unref(r).reactive.lassoMode=_),label:"Lasso mode"},null,8,["modelValue"])])):d.createCommentVNode("",!0)]))}});function V3e(e,t){return e.parent===t.parent?1:2}function O3e(e){return e.reduce(Q3e,0)/e.length}function Q3e(e,t){return e+t.x}function z3e(e){return 1+e.reduce(U3e,0)}function U3e(e,t){return Math.max(e,t.y)}function j3e(e){for(var t;t=e.children;)e=t[0];return e}function G3e(e){for(var t;t=e.children;)e=t[t.length-1];return e}function xB(){var e=V3e,t=1,n=1,r=!1;function a(i){var o,s=0;i.eachAfter(function(m){var g=m.children;g?(m.x=O3e(g),m.y=z3e(g)):(m.x=o?s+=e(m,o):0,m.y=0,o=m)});var c=j3e(i),f=G3e(i),A=c.x-e(c,f)/2,h=f.x+e(f,c)/2;return i.eachAfter(r?function(m){m.x=(m.x-i.x)*t,m.y=(i.y-m.y)*n}:function(m){m.x=(m.x-A)/(h-A)*t,m.y=(1-(i.y?m.y/i.y:1))*n})}return a.separation=function(i){return arguments.length?(e=i,a):e},a.size=function(i){return arguments.length?(r=!1,t=+i[0],n=+i[1],a):r?null:[t,n]},a.nodeSize=function(i){return arguments.length?(r=!0,t=+i[0],n=+i[1],a):r?[t,n]:null},a}function Y3e(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function W3e(){return this.eachAfter(Y3e)}function X3e(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function K3e(e,t){for(var n=this,r=[n],a,i,o=-1;n=r.pop();)if(e.call(t,n,++o,this),a=n.children)for(i=a.length-1;i>=0;--i)r.push(a[i]);return this}function Z3e(e,t){for(var n=this,r=[n],a=[],i,o,s,c=-1;n=r.pop();)if(a.push(n),i=n.children)for(o=0,s=i.length;o<s;++o)r.push(i[o]);for(;n=a.pop();)e.call(t,n,++c,this);return this}function J3e(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function q3e(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,a=r&&r.length;--a>=0;)n+=r[a].value;t.value=n})}function e2e(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function t2e(e){for(var t=this,n=n2e(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var a=r.length;e!==n;)r.splice(a,0,e),e=e.parent;return r}function n2e(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),a=null;for(e=n.pop(),t=r.pop();e===t;)a=e,e=n.pop(),t=r.pop();return a}function r2e(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function a2e(){return Array.from(this)}function i2e(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function o2e(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*l2e(){var e=this,t,n=[e],r,a,i;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(a=0,i=r.length;a<i;++a)n.push(r[a]);while(n.length)}function vb(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=c2e)):t===void 0&&(t=u2e);for(var n=new Q7(e),r,a=[n],i,o,s,c;r=a.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)a.push(i=o[s]=new Q7(o[s])),i.parent=r,i.depth=r.depth+1;return n.eachBefore(E$)}function s2e(){return vb(this).eachBefore(f2e)}function u2e(e){return e.children}function c2e(e){return Array.isArray(e)?e[1]:null}function f2e(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function E$(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Q7(e){this.data=e,this.depth=this.height=0,this.parent=null}Q7.prototype=vb.prototype={constructor:Q7,count:W3e,each:X3e,eachAfter:Z3e,eachBefore:K3e,find:J3e,sum:q3e,sort:e2e,path:t2e,ancestors:r2e,descendants:a2e,leaves:i2e,links:o2e,copy:s2e,[Symbol.iterator]:l2e};function SB(e){return e==null?null:d2e(e)}function d2e(e){if(typeof e!="function")throw new Error;return e}var A2e={depth:-1},x$={},BB={};function p2e(e){return e.id}function h2e(e){return e.parentId}function S$(){var e=p2e,t=h2e,n;function r(a){var i=Array.from(a),o=e,s=t,c,f,A,h,m,g,b,C,x=new Map;if(n!=null){const k=i.map((O,I)=>m2e(n(O,I,a))),_=k.map(B$),D=new Set(k).add("");for(const O of _)D.has(O)||(D.add(O),k.push(O),_.push(B$(O)),i.push(BB));o=(O,I)=>k[I],s=(O,I)=>_[I]}for(A=0,c=i.length;A<c;++A)f=i[A],g=i[A]=new Q7(f),(b=o(f,A,a))!=null&&(b+="")&&(C=g.id=b,x.set(C,x.has(C)?x$:g)),(b=s(f,A,a))!=null&&(b+="")&&(g.parent=b);for(A=0;A<c;++A)if(g=i[A],b=g.parent){if(m=x.get(b),!m)throw new Error("missing: "+b);if(m===x$)throw new Error("ambiguous: "+b);m.children?m.children.push(g):m.children=[g],g.parent=m}else{if(h)throw new Error("multiple roots");h=g}if(!h)throw new Error("no root");if(n!=null){for(;h.data===BB&&h.children.length===1;)h=h.children[0],--c;for(let k=i.length-1;k>=0&&(g=i[k],g.data===BB);--k)g.data=null}if(h.parent=A2e,h.eachBefore(function(k){k.depth=k.parent.depth+1,--c}).eachBefore(E$),h.parent=null,c>0)throw new Error("cycle");return h}return r.id=function(a){return arguments.length?(e=SB(a),r):e},r.parentId=function(a){return arguments.length?(t=SB(a),r):t},r.path=function(a){return arguments.length?(n=SB(a),r):n},r}function m2e(e){e=`${e}`;let t=e.length;return kB(e,t-1)&&!kB(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function B$(e){let t=e.length;if(t<2)return"";for(;--t>1&&!kB(e,t););return e.slice(0,t)}function kB(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}var Jv={},TB={exports:{}},fi={};/**
|
|
37
37
|
* @license React
|
|
38
38
|
* react.production.min.js
|
|
39
39
|
*
|
|
@@ -15183,11 +15183,11 @@ void main() {
|
|
|
15183
15183
|
Q ${a},${o} ${a-ao},${o}
|
|
15184
15184
|
H ${Ss}
|
|
15185
15185
|
L 0,0 z`}function w2t(e,t,n,r,a){switch(n){case"left":return m2t(e,t,a);case"right":return v2t(e,t,a);case"top":return g2t(e,t,r);case"bottom":return y2t(e,t,r);default:vA(n,"Unknown tooltip direction")}}function C2t(e,t,n,r,a,i,o){return o?i.right-n-a-Ss>e?"right":"left":i.top+r-a-Ss>t?"top":"bottom"}function b2t(e,t,n,r,a,i){return e==="left"||e==="right"?`translate(${e==="left"?-(r+Ss+t):r+Ss},${-n/2+i})`:`translate(${-t/2+a},${e==="top"?-(n+r+Ss):r+Ss})`}function E2t(e,t){return e==="left"||e==="right"?`translate(${e==="left"?-t:t},0)`:`translate(0,${e==="top"?-t:t})`}function x2t(e,t,n,r){if(e==="left"||e==="right")return 0;let a=t.right-n,i=t.left+n;return a<r/2?a-r/2:i<r/2?r/2-i:0}function S2t(e,t,n,r){if(e==="top"||e==="bottom")return 0;let a=t.top+n,i=t.bottom-n;return a<r/2?r/2-a:i<r/2?i-r/2:0}function oc({content:e,x:t,y:n,active:r,container:a,sideDistances:i,offset:o=A2t,horizontal:s=!0}){if(!r||!a&&a!==null)return null;let c=h2t(e),f=p2t(e),A=C2t(c,f,t,n,o,i,s),h=x2t(A,i,t,c),m=S2t(A,i,n,f),g=le.jsxs("g",{transform:`translate(${i.left+t},${i.top+n})`,opacity:r?1:0,stroke:"none",fill:"none",style:{pointerEvents:"none"},children:[le.jsx("path",{transform:E2t(A,o),d:w2t(c,f,A,h,m),fill:Zt}),le.jsx("g",{fontSize:"14px",fontFamily:"Manrope",fill:"white",transform:b2t(A,c,f,o,h,m),children:e.map((b,C)=>le.jsx("text",{x:GX,y:jX+wP*C+wP/2,dominantBaseline:"central",children:b},C))})]});return a===null?g:HB.createPortal(g,a)}function B2t(e){if(e===null)return"null";if(typeof e=="number"){let t=Math.floor(e),n=e-t;return t+Number(n.toPrecision(2))}return e}function k2t(e,t){return[`X: ${t[e.x]}`,`Node: ${e.y}`,`Value: ${B2t(e.value)}`]}function T2t({heatmapData:e,scales:t,step:n,colorScale:r,tooltipsContainer:a,chartSizes:i,selectedNode:o,labels:s}){let{xKeys:c,yKeys:f,cells:A,meta:h}=e,[m,g]=Vn.useState(null),b={left:i.treeWidth+30+ic.LEFT,right:i.heatmapWidth+ic.RIGHT,top:ic.TOP,bottom:i.heatmapHeight+ic.BOTTOM};return le.jsxs("g",{onMouseLeave:()=>g(null),children:[s.length&&le.jsx("g",{transform:"translate(0,-8)",children:c.map((C,x)=>le.jsxs("text",{x:t.x(C)+2,fontWeight:"500",children:[le.jsx("title",{children:h.xLabels[C]}),s[x]]},C))}),c.map(C=>f.map(x=>{var _;let k=(_=A==null?void 0:A[C])==null?void 0:_[x];return le.jsx("rect",{x:t.x(C),y:t.y(x),width:n.x,height:n.y,stroke:"white",strokeWidth:"1px",fill:k?r(k==null?void 0:k.value):o3t,onMouseOver:()=>{(k==null?void 0:k.value)!==null&&typeof(k==null?void 0:k.value)<"u"?g(k):g(null)},opacity:o&&o.data.rawData[0].id!==(k==null?void 0:k.data.id)?AP:1},k?k.id:`${C}_${x}`)})),s.length&&le.jsx("line",{x1:"0",x2:i.heatmapWidth,y1:"0",y2:"0",stroke:Zt,strokeWidth:"1px"}),m&&a&&le.jsx(oc,{content:k2t(m,e.meta.xLabels),x:t.x(m.x)+n.x/2,y:t.y(m.y)+n.y/2,offset:c.length>1?n.x/2:0,active:!0,sideDistances:b,container:a})]})}function _2t(e,t,n){let{source:r,target:a}=e,i=n==="top";return t==="rectangle"?i?`M ${r.x},${r.y} L ${a.x},${r.y} L${a.x},${a.y}`:`M ${r.y},${r.x} L ${r.y},${a.x} L${a.y},${a.x}`:t==="curve"?N2e(i?I2e:H2e).x(o=>i?o.x:o.y).y(o=>i?o.y:o.x).source(o=>o.target).target(o=>o.source)(e)??"":i?`M ${r.x},${r.y} L${a.x},${a.y}`:`M ${r.y},${r.x} L${a.y},${a.x}`}function YX({links:e,connectionType:t,rootPosition:n,edgeInheritance:r,aesGetters:a,selected:i}){return le.jsx(le.Fragment,{children:e.map(o=>{let{source:s,target:c}=o,f=(r==="up"?s:c).data.rawData[0];return le.jsx("path",{d:_2t(o,t,n),stroke:i?l3t:a.lineColor(f),strokeWidth:i?2:1,fill:"none"},`${o.source.id},${o.target.id}`)})})}function d9(e){return Da().domain([0,1]).range([e,Zt])(.25)}var F8=1.4;function Af(e,t=6,n=Zt,r=null){switch(e){case null:return"";case"0":return le.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:"none",stroke:n});case"1":return le.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:"none",stroke:n});case"2":return le.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:"none",stroke:n});case"3":return le.jsx("path",{d:`M0,-${t}L 0,${t} M -${t},0 L ${t},0`,fill:"none",stroke:n});case"4":return le.jsx("path",{d:`M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:n});case"5":{let a=t*F8;return le.jsx("path",{d:`M0,-${a}L ${a},0 L 0,${a} L -${a},0z`,fill:"none",stroke:n})}case"6":return le.jsx("path",{d:`M${-2*t*Math.tan(Math.PI/6)},-${t}L ${2*t*Math.tan(Math.PI/6)},-${t}L0,${t}z`,fill:"none",stroke:n});case"7":return le.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:n});case"8":{let a=t*2*Math.cos(Math.PI/4);return le.jsx("path",{d:`M0,-${a}L 0,${a} M -${a},0 L ${a},0 M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:n})}case"9":{let a=t*F8;return le.jsx("path",{d:`M0,-${a}L ${a},0 L 0,${a} L -${a},0z M0,-${a}L 0,${a} M -${a},0 L ${a},0`,fill:"none",stroke:n})}case"10":return le.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z M0,-${t}L 0,${t} M -${t},0 L ${t},0`,fill:"none",stroke:n});case"11":{let a=2*t*Math.tan(Math.PI/6);return le.jsx("path",{d:`M-${a},-${t}L${a},-${t}L0,${-t+2*a}z
|
|
15186
|
-
M-${a},${t}L0,${t-2*a}L${a},${t}z`,fill:"none",stroke:n})}case"12":return le.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M0,-${t}L 0,${t} M -${t},0 L ${t},0`,fill:"none",stroke:n});case"13":return le.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:n});case"14":return le.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M-${t},${t}L0,${-t}L${t},${t}`,fill:"none",stroke:n});case"15":return le.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:n,stroke:n});case"16":return le.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:n,stroke:n});case"17":return le.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:n,stroke:n});case"18":{let a=t*F8;return le.jsx("path",{d:`M0,-${a}L ${a},0 L 0,${a} L -${a},0z`,fill:n,stroke:n})}case"20":{let a=t*2/3;return le.jsx("path",{d:`M -${a},0 a ${a},${a} 0 1,0 ${a*2},0 a ${a},${a} 0 1,0 -${a*2},0z`,fill:n,stroke:n})}case"22":return le.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:n,stroke:r??d9(n)});case"21":return le.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:n,stroke:r??d9(n)});case"24":return le.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:n,stroke:r??d9(n)});case"23":{let a=t*F8;return le.jsx("path",{d:`M0,-${a}L ${a},0 L 0,${a} L -${a},0z`,fill:n,stroke:r??d9(n)})}case"25":return le.jsx("path",{d:`M${-2*t*Math.tan(Math.PI/6)},-${t}L ${2*t*Math.tan(Math.PI/6)},-${t}L0,${t}z`,fill:n,stroke:r??d9(n)});default:vA(e,`Unknown point shape ${e}`)}}var P2t=12;function WX({nodes:e,rootPosition:t,showLeavesLabels:n,showNodesLabels:r,aesGetters:a,selectedNodeId:i,onClick:o,onSelectedUpdate:s}){let c=t==="top",[f,A]=Vn.useState(null);return Vn.useEffect(()=>{A(null)},[i]),le.jsxs(le.Fragment,{children:[le.jsx("g",{children:e.map(h=>{let m=h.data.rawData[0],g=a.nodeSize(m),b=a.nodeColor(m),C=c?h.x:h.y,x=c?h.y:h.x;return le.jsx("g",{transform:`translate(${C},${x})`,style:{cursor:"pointer"},onClick:k=>{k.stopPropagation(),o({x:C+ic.LEFT,y:x+ic.TOP,info:h.data.rawData}),s(h)},children:le.jsx("g",{children:le.jsx("circle",{cx:0,cy:0,r:g+P2t,fill:i===h.id?IX:f===h.id?b:"transparent",opacity:AP,onMouseOver:()=>A(h.id??null),onMouseLeave:()=>A(null)})})},h.id)})}),le.jsx("g",{children:e.map(h=>{let m=h.data.rawData[0],g=a.nodeShape(m),b=a.nodeSize(m),C=a.nodeColor(m),x=c?h.x:h.y,k=c?h.y:h.x;return le.jsx("g",{transform:`translate(${x},${k})`,style:{cursor:"pointer"},onClick:_=>{_.stopPropagation(),o({x:x+ic.LEFT,y:k+ic.TOP,info:h.data.rawData}),s(h)},children:le.jsx("g",{onMouseOver:()=>A(h.id??null),onMouseLeave:()=>A(null),children:Af(g,b,i===h.id?IX:C)})},h.id)})}),le.jsx("g",{children:e.map(h=>{let m=h.data.rawData[0],g=a.nodeSize(m),b=c?h.x:h.y,C=c?h.y:h.x;return le.jsx("g",{transform:`translate(${b},${C})`,style:{pointerEvents:"none"},children:(r&&h.children||n&&!h.children)&&le.jsx("text",{x:g+4,y:"4",paintOrder:"stroke",stroke:"white",strokeWidth:"3",children:h.data.label})},h.id)})})]})}var XX=14,V8=12,A9=12,O8=-12;function M2t({aes:e,label:t}){let n=Af(e.shape,e.size,e.color);return le.jsxs("g",{children:[le.jsx("g",{transform:`translate(${A9/2},${A9/2})`,children:n}),le.jsx("text",{x:A9+8,y:A9/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function D2t({legendData:e}){let t=e.items.filter(n=>n.type==="continuous");return le.jsxs("g",{children:[le.jsx("defs",{children:t.map(n=>le.jsx("linearGradient",{id:n.id,gradientTransform:"rotate(90)",children:n.scale.domain().map(r=>{let a=n.scale.domain(),i=a[a.length-1]-a[0],o=i>0?(r-a[0])/i*100:0;return le.jsx("stop",{offset:`${o}%`,stopColor:n.scale(r)},r)})},n.id))}),e.items.map(n=>{if(n.type==="continuous"){let r=Math.min(...n.values),a=Math.max(...n.values);return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[le.jsx("text",{fontWeight:500,fontSize:"14px",y:O8,children:n.title}),le.jsx("rect",{x:"0",y:"0",width:XX,height:n.height,stroke:Zt,fill:`url(#${n.id})`}),le.jsx("g",{transform:`translate(${XX},0)`,children:n.values.map(i=>{let o=a-r,s=o>0?n.height*(i-r)/o:0;return le.jsxs("g",{transform:`translate(0,${s})`,children:[le.jsx("line",{x1:"0",x2:-4,stroke:Zt}),le.jsx("text",{x:8,y:4,children:i})]},i)})}),!1]},n.id)}if(n.type==="discrete")return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[le.jsx("text",{fontWeight:500,fontSize:"14px",y:O8,children:n.title}),n.values.map((r,a)=>le.jsxs("g",{transform:`translate(0, ${a*(V8+4)})`,children:[le.jsx("rect",{x:"0",y:"0",width:V8,height:V8,fill:n.scale(r),rx:"1",ry:"1"}),le.jsx("text",{x:V8+8,y:10,children:r})]},r)),!1]},n.id);if(n.type==="nodes")return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[le.jsx("text",{fontWeight:500,y:O8,children:n.title}),n.values.map((r,a)=>le.jsx("g",{transform:`translate(0, ${a*(A9+4)})`,children:le.jsx(M2t,{aes:n.scale(r),label:n.labels[r]})},r)),!1]},n.id);if(n.type==="size"){let r=n.height/n.values.length;return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[le.jsx("text",{fontWeight:500,y:O8,children:n.title}),n.values.map((a,i)=>{let o=n.scale(a);return le.jsxs("g",{transform:`translate(0, ${i*r})`,children:[le.jsx("circle",{r:o,cx:r/2,cy:r/2,fill:Zt}),le.jsx("text",{x:r+4,y:r/2,alignmentBaseline:"central",children:n.labels[a]})]},a)}),!1]},n.id)}})]})}function KX(e){if(!e)return null;let t=new Set,n=e;for(;n;)t.add(n.id),n=n.parent;return t}function H2t({chartSettings:e,chartSizes:t,nodes:n,links:r,connectionType:a,rootPosition:i,edgeInheritance:o,showNodes:s,showEdges:c,showLeavesLabels:f,showNodesLabels:A,aesGetters:h,labels:m,heatmapData:g,heatmapScales:b,heatmapStep:C,heatmapColor:x,heatmapLabels:k,legendData:_,onClick:D}){let O=Vn.useRef(null),[I,$]=Vn.useState(null),Q=Vn.useRef(null);Vn.useEffect(()=>{Q.current&&$(Q.current);function X(){K(null),U(null)}function oe(me){Object.entries(me.detail).forEach(([ae,ye])=>{if(ae==="selectedNode"){let Ce=n.find(ce=>ce.data.rawData[0].id===ye)??null;K(KX(Ce)),U(Ce)}})}return document.addEventListener("click",X),document.addEventListener(pP,oe),()=>{document.removeEventListener("click",X),document.removeEventListener(pP,oe)}},[]);let[ee,K]=gb.useState(null),[re,U]=gb.useState(null),G=ee!==null,Z={connectionType:a,rootPosition:i,edgeInheritance:o,aesGetters:h},Y={rootPosition:i,showLeavesLabels:f,showNodesLabels:A,aesGetters:h,labels:m,onClick:D,selectedNodeId:re==null?void 0:re.id,onSelectedUpdate:X=>{K(KX(X)),U(X)}};return le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${t.totalWidth} ${t.totalHeight}`,ref:O,width:t.totalWidth,height:t.totalHeight,children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${ic.LEFT},${ic.TOP})`,fontFamily:"Manrope",children:[le.jsx("text",{x:"0",y:"-12",fontSize:"20",children:e.title.name}),le.jsxs("g",{opacity:G?AP:1,children:[c&&le.jsx(YX,{links:r.filter(X=>{let{source:oe,target:me}=X;return!ee||!(ee.has(oe.id??"")&&ee.has(me.id??""))}),selected:!1,...Z}),s&&le.jsx(WX,{nodes:n.filter(X=>!X.data.isFake&&!(ee!=null&&ee.has(X.id??""))),...Y})]}),G&&le.jsxs("g",{children:[c&&le.jsx(YX,{links:r.filter(X=>{let{source:oe,target:me}=X;return ee.has(oe.id??"")&&ee.has(me.id??"")}),selected:!0,...Z}),s&&le.jsx(WX,{nodes:n.filter(X=>!X.data.isFake&&(ee==null?void 0:ee.has(X.id??""))),...Y})]}),g!==null&&le.jsx("g",{transform:`translate(${t.treeWidth+30},0)`,children:le.jsx(T2t,{heatmapData:g,scales:b,step:C,colorScale:x,chartSizes:t,labels:k,selectedNode:re,tooltipsContainer:I})}),e.legend.show&&le.jsx("g",{transform:`translate(${t.treeWidth+30+t.heatmapWidth+30},0)`,children:le.jsx(D2t,{legendData:_})})]}),le.jsx("g",{ref:Q})]})}function Fm({message:e}){return le.jsx("div",{style:{width:"500px",height:"400px",color:"#ee1616",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"25px",fontFamily:"Arial",border:"1px solid"},children:e})}function p9(e){if(RX(e))return t=>e.valuesMap[String(t[e.columnName.value])];if($m(e)){let{domain:t,range:n}=e,r=Ny().domain(t).range(n);return a=>{let i=r(Number(a[e.columnName.value]));return Math.max(1,i)}}return t=>e}function I2t(e){return{nodeShape:p9(e.nodeShape),nodeColor:p9(e.nodeColor),nodeSize:p9(e.nodeSize),lineShape:p9(e.lineShape),lineColor:p9(e.lineColor)}}var L2t=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r){let o=e%2===0?[]:[n];for(let s=1;s<e/2+1;s++)o.push(n+s),o.unshift(n-s);return o}if(e<2)return[n,r];let a=(r-n)/(e-1),i=[];for(let o=0;o<e-1;o++)i.push(n+a*o);return i.push(r),i};function R2t(e,t=1,n,r){let a=(e<16?40:e<49?32:24)*t;return Math.max(Math.min(a,r??1/0),n??-1/0)}var N2t=class{constructor(){Me(this,"component",le.jsx(le.Fragment,{}));Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"chartSizes",{treeWidth:600,treeHeight:350,heatmapWidth:0,heatmapHeight:0,totalWidth:1200+ic.LEFT+ic.RIGHT,totalHeight:350+ic.TOP+ic.BOTTOM,labelsOffset:0});Me(this,"legend",{width:0,height:0,items:[]});Me(this,"heatmapScales",{x:Hl().domain(["null"]).range([1]),y:Hl().domain(["null"]).range([1])});Me(this,"heatmapStep",{x:0,y:0});Me(this,"heatmapColorScale",{scale:Hl([]),getter:()=>"white"});Me(this,"heatmapLabels",[])}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=zh(this.rootNode))}updateHeatmapScales(e,t,n){if(e===null){this.chartSizes.heatmapWidth=0;return}let{xKeysByGroups:r,xGroupKeys:a,xKeys:i,yKeys:o}=e,s=5,c=a.map(x=>r[x].length),f=c.reduce((x,k)=>x+k,0),A=this.chartSizes.treeHeight/o.length,h=Math.min(Math.max((400-(c.filter(x=>x>0).length-1)*s)/f,n.minCellWidth),n.maxCellWidth),m=[],g=0;a.forEach(x=>{let k=r[x];k.forEach(()=>{m.push(g),g+=h}),k.length>0&&(g+=s)}),this.heatmapScales.x=Hl().domain(i).range(m),this.heatmapScales.y=Hl().domain(o).range(o.map((x,k)=>k*A)),this.heatmapStep.x=h,this.heatmapStep.y=A;let{colorsList:b,colorsMap:C}=t.aes;if(t.valueType==="continuous"&&b){let x=Da().domain(L2t(b.length,e.meta.valueExtent)).range(b);this.heatmapColorScale={scale:x,getter:k=>x(k)}}if(t.valueType==="discrete"&&C){let x=Object.keys(C).filter(k=>e.meta.uniqueValues.has(k));this.heatmapColorScale={scale:Hl(x,x.map(k=>C[k])).unknown(s9),getter:k=>k?C[k]??s9:s9}}if(t.valueType==="stringSource"&&b){let x=[...e.meta.uniqueValues],k=Hl(x,x.map((_,D)=>b[D%b.length])).unknown(s9);this.heatmapColorScale={scale:k,getter:_=>_?k(_):s9}}this.chartSizes.heatmapWidth=this.heatmapScales.x(e.xKeys[e.xKeys.length-1])+this.heatmapStep.x}updateLegendSize(e,t,n,r,a,i){if(!e.show){this.legend={width:0,height:0,items:[]};return}let o=new Dc("600 14px Arial"),s=16,c=48,f=20,A=24;function h(O,I){return Math.max(...O.map($=>o.getTextWidth(String($))+f),o.getTextWidth(I))}let m=[];[n.nodeColor,n.nodeShape,n.lineColor].filter(RX).map(O=>O.columnName).forEach(O=>{let I=t[O.value];if(I.usedAes.length===0||!I.aesMap)return;let $=O.label??O.value,Q=I.values,ee={};Q.forEach(K=>{ee[K]||(ee[K]={...mP}),I.usedAes.forEach(re=>{var U,G,Z;(re==="dotFill"||re==="lineColor")&&(ee[K].color=((U=I.aesMap[K])==null?void 0:U[re])??Zt),re==="dotShape"&&(ee[K].shape=((G=I.aesMap[K])==null?void 0:G[re])??"21"),re==="dotSize"&&(ee[K].size=((Z=I.aesMap[K])==null?void 0:Z[re])??3)})}),m.push({columnKey:$,data:ee,values:I.values,labels:I.labels})});let g=[],b=0,C=0,x=0,k=Math.min(this.chartSizes.treeHeight,400);if(r&&a){let O=i.valueType,I=r.label??r.value;if(O==="continuous"){let $=this.heatmapColorScale.scale,Q=a2($,a.meta.valueExtent,4),ee={id:"heatmapValue",type:"continuous",width:UX(Q,I),height:k,left:0,top:0,title:I,scale:$,values:Q,labels:{}};g.push(ee),C=ee.height+c,b=ee.width}else{let $=this.heatmapColorScale.scale,Q=d2t($,I),ee=$.domain(),K=ee.length*s,re={id:"heatmapValue",type:"discrete",width:Q,height:K,left:0,top:0,title:I,scale:$,values:ee,labels:{}};g.push(re),C=re.height+c,b=re.width}}if(m.map(({columnKey:O,labels:I,values:$,data:Q})=>{C>k&&(C=0,x+=b+A);let ee=O,K=h($.map(Y=>I[Y]),ee),re=$.length*s;re>k&&(k=re);let U=Hl().domain($).range($.map(Y=>Q[Y])),G=x,Z=C;g.push({id:O,type:"nodes",width:K,height:re,left:G,top:Z,title:ee,scale:U,values:$,labels:I}),b=K,C+=re+c}),$m(n.nodeSize)){C>k&&(C=0,x+=b+A);let{columnName:O,domain:I,range:$}=n.nodeSize,Q=O.label??O.value,ee=Ny(I,$),K=ee.ticks(3),re=ee.tickFormat(3),U=K.reduce((oe,me)=>(oe[String(me)]=re(me),oe),{}),G=h(K.map(oe=>U[oe]),Q),Z=(ee(Math.max(...K))*2+4)*K.length;Z>k&&(k=Z);let Y=x,X=C;g.push({id:O.value,type:"size",width:G,height:Z,left:Y,top:X,title:Q,scale:ee,values:K,labels:U}),b=G,C+=Z+c}let _=x+b+2*yP,D=k;this.legend={width:_,height:D,items:g}}updateChartSizes(e,t,n){let r=n.leaves().length;this.chartSizes.treeWidth=t?e.width/2:e.width;let a=R2t(r,e.scale,e.minCellHeight,e.maxCellHeight)*r;this.chartSizes.treeHeight=a,this.chartSizes.heatmapHeight=a}updateTotalSizes(e){this.chartSizes.totalWidth=this.chartSizes.treeWidth+this.chartSizes.heatmapWidth+this.legend.width+ic.LEFT+ic.RIGHT,e&&(this.chartSizes.totalWidth+=30),this.legend.width>0&&(this.chartSizes.totalWidth+=30),this.chartSizes.totalHeight=Math.max(this.chartSizes.treeHeight,this.legend.height)+ic.TOP+ic.BOTTOM}prepareTableLabels(e){let t=new Dc("bold 14px Arial"),n="…";if(this.heatmapStep.x<12||!e){this.heatmapLabels=[];return}let r=this.heatmapStep.x-4;this.heatmapLabels=e.xKeys.map(a=>{let i=e.meta.xLabels[a],o=t.getTextWidth(i);if(o<r)return i;let s=i,c=s==null?void 0:s.length;for(;o>r&&c>0;)c--,s=(i==null?void 0:i.substring(0,c))+n,o=t.getTextWidth(s);return c>0?s:""})}addLabelsWidthToTreeArea(e,t){if(!t)return;let n=e.leaves(),r=new Dc("bold 14px Manrope"),a=0;n.forEach(i=>{if(!i.data.label)return;let o=r.getTextWidth(i.data.label),s=i.y+o-this.chartSizes.treeWidth+8;s>a&&(a=s)}),this.chartSizes.treeWidth+=a}render(e,t,n,r,a,i,o,s,c,f,A,h,m,g,b,C,x){var I;this.updateChartSizes(e.size,m,t),this.updateHeatmapScales(m,g,e.size),this.updateLegendSize(e.legend,b,f,h,m,g),this.prepareTableLabels(m);let k=r==="top"?[this.chartSizes.treeWidth,this.chartSizes.treeHeight]:[this.chartSizes.treeHeight,this.chartSizes.treeWidth];xB().size(k).separation(()=>1)(t);let _=t;d3t(_,r==="top"?this.chartSizes.treeHeight:this.chartSizes.treeWidth,C==="alignLeavesToLine"),A3t(_),this.addLabelsWidthToTreeArea(_,s),this.updateTotalSizes(m);let D=I2t(f),O=le.jsx(H2t,{chartSizes:this.chartSizes,chartSettings:e,nodes:_.descendants(),links:_.links(),connectionType:n,rootPosition:r,edgeInheritance:a,showNodes:i,showEdges:o,showLeavesLabels:s,showNodesLabels:c,aesGetters:D,labels:A,heatmapData:m,heatmapScales:this.heatmapScales,heatmapStep:this.heatmapStep,heatmapColor:this.heatmapColorScale.getter,heatmapLabels:this.heatmapLabels,legendData:this.legend,onClick:x});this.component=O,(I=this.reactRoot)==null||I.render(O)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},$2t=N2t,ZX=class{constructor(e){Me(this,"type","dendro");Me(this,"chartSettings");Me(this,"mode");Me(this,"leavesMode");Me(this,"id");Me(this,"parentId");Me(this,"height",null);Me(this,"labels");Me(this,"heatmapAnnotation");Me(this,"heatmapAxis");Me(this,"heatmapGroup");Me(this,"heatmapSettings");Me(this,"connectionType","rectangle");Me(this,"edgeInheritance","up");Me(this,"rootPosition","top");Me(this,"showNodes",!0);Me(this,"showEdges",!0);Me(this,"showLeavesLabels",!0);Me(this,"showNodesLabels",!0);Me(this,"aes",{nodeShape:"21",nodeColor:Zt,nodeSize:3,lineShape:"solid",lineColor:Zt});var t,n,r,a,i,o,s,c,f,A;r2t.parse(e),this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(e.facetSettings?400:560),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(e.facetSettings?250:350),scale:((r=e==null?void 0:e.size)==null?void 0:r.scale)??1,minCellWidth:((a=e==null?void 0:e.size)==null?void 0:a.minCellWidth)??a3t,maxCellWidth:((i=e==null?void 0:e.size)==null?void 0:i.maxCellWidth)??i3t,minCellHeight:(o=e==null?void 0:e.size)==null?void 0:o.minCellHeight,maxCellHeight:(s=e==null?void 0:e.size)==null?void 0:s.maxCellHeight},title:{position:"center",show:!0,...e.title,name:((c=e.title)==null?void 0:c.name)??"Dendrogram"},legend:{show:!0,position:"right",...e.legend}},this.mode=e.mode??"normal",this.leavesMode=e.leavesMode??"normal",this.id=e.id,this.parentId=e.parentId,this.height=e.height??null,this.labels=e.labels??this.id,this.heatmapAnnotation=e.heatmapAnnotation??null,this.heatmapAxis=e.heatmapAxis??null,this.heatmapGroup=e.heatmapGroup??[],this.heatmapSettings={valueType:((f=e.heatmapSettings)==null?void 0:f.valueType)??"continuous",aes:{colorsList:["#FFF680","#53D788","#36739D","#4A005C"],...(A=e.heatmapSettings)==null?void 0:A.aes}},this.connectionType=e.connectionType??this.connectionType,this.edgeInheritance=e.edgeInheritance??this.edgeInheritance,this.showNodes=e.showNodes??this.showNodes,this.showEdges=e.showEdges??this.showEdges,this.showLeavesLabels=e.showLeavesLabels??this.showLeavesLabels,this.showNodesLabels=e.showNodesLabels??this.showNodesLabels,this.rootPosition=e.rootPosition??this.rootPosition,this.aes={...this.aes,...e.aes}}};function Q8(e){return typeof e!="object"?!1:"valuesMap"in e}function JX(e,t){let{nodeColor:n,nodeShape:r,lineColor:a}=t,i=[n,r,a].filter(Q8);return Ir.uniqBy(i,o=>o.columnName.value).reduce((o,s)=>{let{columnName:c}=s,f=Ir.uniqBy(e.rows,b=>b[c.value]),A=b=>String(b[c.value]),h=b=>c.valueLabels?String(b[c.valueLabels]):A(b),m=new Set,g=f.reduce((b,C)=>{let x=A(C);return b[x]||(b[x]={}),b},{});return Q8(n)&&c.value===n.columnName.value&&(m.add("dotFill"),f.forEach(b=>{let C=A(b);g[C].dotFill=n.valuesMap[C]})),Q8(r)&&c.value===r.columnName.value&&(m.add("dotShape"),f.forEach(b=>{let C=A(b);g[C].dotShape=r.valuesMap[C]})),Q8(a)&&c.value===a.columnName.value&&(m.add("lineColor"),f.forEach(b=>{let C=A(b);g[C].lineColor=a.valuesMap[C]})),o[c.value]={values:f.map(A).sort(),usedAes:[...m],aesMap:g,labels:f.reduce((b,C)=>(b[A(C)]=h(C),b),{})},o},{})}var F2t=class extends Sg{constructor(t,n,r){super(t,n);Me(this,"settings");Me(this,"onClick",()=>Kx);Me(this,"chartRenderer",new $2t);Me(this,"calculatedData",null);this.settings=new ZX(n),r&&(this.onClick=r[0])}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new ZX(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){if(document){let r=new CustomEvent(pP,{detail:{[t]:n}});document.dispatchEvent(r)}}export(){return this._updateChart(),f3(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var A,h;let{mode:r,id:a,parentId:i,heatmapAnnotation:o,heatmapAxis:s,heatmapGroup:c}=n;function f(m,g){return m.length!==g.length||m.some((b,C)=>b.value!==g[C].value)}return t.mode!==r||t.id.value!==a.value||t.parentId.value!==i.value||((A=t.heatmapAnnotation)==null?void 0:A.value)!==(o==null?void 0:o.value)||((h=t.heatmapAxis)==null?void 0:h.value)!==(s==null?void 0:s.value)||f(t.heatmapGroup,c)}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{mode:t,id:n,parentId:r,aes:a,heatmapAnnotation:i,heatmapAxis:o,heatmapGroup:s,heatmapSettings:c,height:f,labels:A}=this.settings,h=f3t(n.value,r.value,(f==null?void 0:f.value)??null,A.valueLabels??A.value??null,this.data.rows,t==="useAllNodesAsLeaves"),m=s3t(this.data,c.valueType,i,o,s,n,h),g=JX(this.data,a);this.calculatedData={chartSizes:this.chartRenderer.chartSizes,hierarchy:h,heatmapData:m,legendLabels:g}}_updateAesInData(){this.calculatedData&&(this.calculatedData.legendLabels=JX(this.data,this.settings.aes))}_updateChart(){if(!this.calculatedData)return;let{heatmapAnnotation:t,chartSettings:n,connectionType:r,edgeInheritance:a,rootPosition:i,showNodes:o,showEdges:s,showLeavesLabels:c,showNodesLabels:f,aes:A,labels:h,heatmapSettings:m,leavesMode:g}=this.settings;this.chartRenderer.render(n,this.calculatedData.hierarchy,r,i,a,o,s,c,f,A,h,t,this.calculatedData.heatmapData,m,this.calculatedData.legendLabels,g,this.onClick)}};function V2t(e,t,n,r,a,i){let o=-1/0;return{type:"logo",geoms:t.reduce((s,c)=>{let f=c.join("_");return s[f]=[],n.forEach(A=>{let h=0,m={};r.forEach(b=>{let C=a.getRowsByGrouping([...c,A,b]);if(!C.length)return;let x=Sc(C,k=>Number(k[i.value]));m[b]={height:x,key:b},h+=x});let g=h;e.normalize&&r.forEach(b=>{m[b]&&(m[b].height=m[b].height/g*100)}),o=Math.max(o,h),s[f].push({key:`logo_${A}`,valuesMap:m,primaryGrouping:A,boundsY:{min:0,max:e.normalize?g:100}})}),s},{}),meta:{minY:0,maxY:e.normalize?100:o,normalize:e.normalize},aes:e.aes}}var h9={TOP:30,BOTTOM:30},l1=30,O2t=6,m9=20,CP=15,z8=24,i2=25,Q2t=12,qX={fillColor:"white",lineColor:Zt,lineWidth:1,lineShape:"solid",dotSize:3,dotFill:Zt,dotShape:"21"},bP=20,eK=4,ed=4,tK=25,z2t=15,_g=8,Vm=30,U2t=48,j2t=24,o2=16,l2=4,U8=4,j8=20,G2t=16,Qd=16,s2=8,s1={left:["annotations","axis","groups","axisTitle","dendro"],right:["annotations","axis","groups","axisTitle","dendro"],top:["annotations","axis","groups","axisTitle","dendro","facetTitle"],bottom:["annotations","axis","groups","axisTitle","dendro"]},nK={fillColor:"white",lineColor:Zt,lineWidth:1,lineShape:"solid",dotSize:3,dotFill:Zt,dotShape:"21"};function Y2t(e){return`translate(${e},0)`}function W2t(e){return`translate(0,${e})`}var v9=21;function X2t(e,t){if(e==="45deg"){let n=t==="left"?-v9/2:0,r=t==="bottom"?v9/2:-v9/2;return`translate(${n},${r}) rotate(-45)`}return e==="90deg"&&t==="bottom"?`translate(${-v9/2},${ed+v9/2}) rotate(-90)`:t==="bottom"?`translate(0,${ed})`:`translate(${-ed},0)`}function K2t(e,t){return t==="left"||t==="bottom"&&e==="90deg"?"central":e==="center"?"hanging":"auto"}function Z2t(e,t){return t==="left"||t==="bottom"&&e!=="center"?"end":"middle"}var rK=({scale:e,tickSize:t=6,tickPadding:n=ed,orient:r="bottom",labelsPosition:a="center",labels:i={},offset:o=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function s(x,k){return x.bandwidth&&(k=Math.max(0,x.bandwidth()-k*2)/2),x!=null&&x.round()&&(k=Math.round(k)),_=>{let D=x(_);return D===void 0?0:D+k}}let c=e.domain(),f=x=>i[x]??[x],A=Math.max(t,0)+n,h=s(e.copy(),o),m=r==="bottom"?Y2t:W2t,g=r==="left"?-1:1,b={[(r==="left"?"x":"y")+"2"]:g*t},C={[r==="left"?"x":"y"]:g*A};return le.jsx("g",{children:c.map((x,k)=>le.jsxs("g",{className:"tick",transform:m(h(x)+o),children:[le.jsx("line",{stroke:Zt,...b}),le.jsx("g",{transform:X2t(a,r),children:f(x).map((_,D)=>le.jsx("text",{fill:Zt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:K2t(a,r),textAnchor:Z2t(a,r),dy:20*D,...C,children:_},`${_}_${D}`))})]},k))})};function aK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function J2t({scales:e,orientation:t,bar:n,aes:r}){let a=t==="vertical",i=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,o=e.xSecondary.bandwidth(),s=r.width==="auto"?o*.8:Math.min(o,r.width),c=Math.abs(e.y(n.value)-e.y(0)),f=aK(e,"lineColor",r.lineColor,n),A=aK(e,"fillColor",r.fillColor,n);return le.jsx("g",{transform:a?`translate(${i},0)`:`translate(0, ${i})`,opacity:r.opacity,stroke:f,strokeWidth:r.lineWidth,children:le.jsx("rect",{width:a?s:c,height:a?c:s,x:a?-s/2:e.y(n.boundsY.min),y:a?e.y(n.boundsY.max):-s/2,fill:A})})}function Ki(e){return isNaN(e)?"?":e===0?"0":Math.abs(e)<.01?j5(".1e")(e):j5(".2f")(e)}function iK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function q2t({scales:e,orientation:t,geom:n,aes:r,min:a,max:i,binsCount:o,hasKeyFromColumn:s,sideDistances:c,showTooltips:f,tooltipsContainer:A}){let[h,m]=Vn.useState(null),g=t==="vertical",b=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,C=iK(e,"lineColor",r.lineColor,n),x=iK(e,"fillColor",r.fillColor,n),k=n.bins,_=r.dotSize?r.dotSize:Math.abs(e.y(i)-e.y(a))/o/2;return le.jsx("g",{transform:g?`translate(${b},0)`:`translate(0, ${b})`,stroke:C,fill:x,strokeWidth:r.lineWidth,children:k.map(({x:D,count:O,dots:I})=>le.jsx("g",{transform:g?`translate(0,${e.y(D)})`:`translate(${e.y(D)},0)`,children:I.map(($,Q)=>{let ee=(Q-O/2)*2*_+_,K=g?ee:0,re=g?0:ee;return le.jsxs("g",{children:[le.jsx("circle",{opacity:r.opacity,cx:K,cy:re,r:_,onMouseOver:()=>m($.key),onMouseLeave:()=>m(null)}),f&&le.jsx(oc,{content:s?[$.key,Ki($.value)]:[Ki($.value)],x:(g?b:e.y(D))+K,y:(g?e.y(D):b)+re,sideDistances:c,horizontal:g,offset:_,active:h===$.key,container:A})]},$.key)})},D))})}function td(e=null){switch(e){case null:return"";case"solid":return"";case"dashed":return"6 6";case"dotted":return"1.5 4";case"dotdash":return"1.4 4 8 4";case"longdash":return"10 4";case"twodash":return"3 3 9 3";default:vA(e,`Unknown line shape ${e}`)}}function G8(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function e5t(e,t){return t?[e.id,`${Ki(e.y)}`]:[`${Ki(e.y)}`]}function t5t({scales:e,orientation:t,box:n,aes:r,hasKeyFromColumn:a,sideDistances:i,showTooltips:o,elementsAmount:s,tooltipsContainer:c}){let[f,A]=Vn.useState(!1),[h,m]=Vn.useState(null),g=t==="vertical",b=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,C=e.xSecondary.bandwidth(),x=r.boxWidth==="auto"?C*.8:Math.min(C,r.boxWidth),k=Math.abs(e.y(n.lower)-e.y(n.upper)),_=G8(e,"lineColor",r.lineColor,n),D=G8(e,"fillColor",r.fillColor,n),O=G8(e,"dotShape",r.dotShape,n),I=G8(e,"dotSize",r.dotSize,n),$=Af(O,I,_),Q=Math.abs(e.y.range()[0]-e.y.range()[1]);return le.jsxs("g",{transform:g?`translate(${b},0)`:`translate(0, ${b})`,opacity:r.opacity,stroke:_,strokeWidth:r.lineWidth,strokeDasharray:td(r.lineShape),children:[le.jsx("line",{x1:g?0:e.y(n.min),x2:g?0:e.y(n.lower),y1:g?e.y(n.min):0,y2:g?e.y(n.lower):0}),le.jsx("line",{x1:g?0:e.y(n.upper),x2:g?0:e.y(n.max),y1:g?e.y(n.upper):0,y2:g?e.y(n.max):0}),le.jsx("rect",{width:g?x:k,height:g?k:x,x:g?-x/2:e.y(n.lower),y:g?e.y(n.upper):-x/2,fill:D}),le.jsx("line",{x1:g?-x/2:e.y(n.middle),x2:g?x/2:e.y(n.middle),y1:g?e.y(n.middle):-x/2,y2:g?e.y(n.middle):x/2}),o&&c&&le.jsx("rect",{onMouseOver:()=>A(!0),onMouseLeave:()=>A(!1),width:g?C:Q,x:g?-C/2:0,y:g?0:-C/2,height:g?Q:C,fill:"transparent",stroke:"none"}),r.showOutliers&&n.outliers.map(ee=>le.jsxs("g",{transform:g?`translate(0,${e.y(ee.y)})`:`translate(${e.y(ee.y)},0)`,strokeDasharray:"0",children:[$,o&&c&&le.jsx("circle",{onMouseOver:()=>m(ee.id),onMouseLeave:()=>m(null),r:"15",fill:"transparent",stroke:"none"}),o&&le.jsx(oc,{content:e5t(ee,a),x:g?b:e.y(ee.y),y:g?e.y(ee.y):b,sideDistances:i,horizontal:!0,active:h===ee.id,container:c})]},ee.id)),o&&le.jsx(oc,{content:[`Max = ${Ki(n.max)}`,`Upper = ${Ki(n.upper)}`,`Median = ${Ki(n.middle)}`,`Lower = ${Ki(n.lower)}`,`Min = ${Ki(n.min)}`],x:g?b:e.y(n.middle),y:g?e.y(n.middle):b,sideDistances:i,horizontal:g,active:f,offset:s>1?C/2:C/4,container:c})]})}function EP(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function n5t(e,t,n){return n?[t,`${Ki(e)}`]:[`${Ki(e)}`]}function r5t({scales:e,orientation:t,geom:n,aes:r,hasKeyFromColumn:a,sideDistances:i,showTooltips:o,tooltipsContainer:s}){let[c,f]=Vn.useState(null),A=t==="vertical",h=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,m=e.xSecondary.bandwidth()*r.jitter,g=_=>(1-_*2)*(m/2),b=EP(e,"lineColor",r.lineColor,n),C=EP(e,"dotFill",r.dotFill,n),x=EP(e,"dotShape",r.dotShape,n),k=Af(x,r.dotSize,C);return le.jsx("g",{transform:A?`translate(${h},0)`:`translate(0, ${h})`,stroke:b,children:n.values.map(({y:_,jitter:D,id:O})=>le.jsxs("g",{opacity:r.opacity,transform:A?`translate(${g(D)},${e.y(_)})`:`translate(${e.y(_)},${g(D)})`,children:[k,o&&s&&le.jsx("circle",{onMouseOver:()=>f(O),onMouseLeave:()=>f(null),r:"4",fill:"transparent",stroke:"none"}),o&&le.jsx(oc,{content:n5t(_,O,a),x:h+g(D),y:e.y(_),active:c===O,sideDistances:i,container:s})]},O))})}function xP(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function a5t({scales:e,orientation:t,errorBar:n,aes:r,sideDistances:a,showTooltips:i,tooltipsContainer:o}){let[s,c]=Vn.useState(!1),f=t==="vertical",A=xP(e,"lineColor",r.lineColor,n),h=xP(e,"fillColor",r.fillColor,n),m=xP(e,"dotShape",r.dotShape,n),g=(e.xPrimary(n.primaryGrouping)??0)+e.xPrimary.bandwidth()/2,b=r.width==="auto"?e.xPrimary.bandwidth()*.2:r.width,C=e.y(n.min),x=e.y(n.max),k=e.y(n.value),_=Af(m,r.dotSize,h);return le.jsxs("g",{opacity:r.opacity,stroke:A,fill:"none",transform:f?`translate(${g},0)`:`translate(0,${g})`,strokeWidth:r.lineWidth,children:[le.jsx("line",{x1:f?0:C,x2:f?0:x,y1:f?C:0,y2:f?x:0}),le.jsx("line",{x1:f?-b/2:C,x2:f?b/2:C,y1:f?C:-b/2,y2:f?C:b/2}),le.jsx("line",{x1:f?-b/2:x,x2:f?b/2:x,y1:f?x:-b/2,y2:f?x:b/2}),r.showDots&&le.jsxs("g",{transform:f?`translate(0,${k})`:`translate(${k},0)`,children:[_,i&&o&&le.jsx("circle",{onMouseOver:()=>c(!0),onMouseLeave:()=>c(!1),r:"15",fill:"transparent",stroke:"none"}),i&&le.jsx(oc,{content:[Ki(n.value)],x:f?g:k,y:f?k:g,sideDistances:a,horizontal:!0,active:s,container:o})]})]})}function Y8(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")throw new Error("Line cannot have aesthetics by primary grouping");if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.key)[t]}return n}function i5t(e,t,n){let r=n.xPrimary.bandwidth()/2;return t.map(a=>[(n.xPrimary(a)??0)+r,n.y(e[a]),a,e[a]])}function o5t({scales:e,orientation:t,line:n,aes:r,sideDistances:a,showTooltips:i,secondaryGrouping:o,tooltipsContainer:s}){let[c,f]=Vn.useState(null),A=t==="vertical",h=Y8(e,"lineColor",r.lineColor,n),m=Y8(e,"dotFill",r.fillColor,n),g=Y8(e,"lineShape",r.lineShape,n),b=Y8(e,"dotShape",r.dotShape,n),C=i5t(n.dots,e.xPrimary.domain(),e),x=Af(b,r.dotSize,m);return le.jsxs("g",{opacity:r.opacity,stroke:h,strokeDasharray:td(g),strokeWidth:r.lineWidth,children:[le.jsx("polyline",{points:C.map(([k,_])=>A?[k,_]:[_,k]).join(" "),stroke:h,fill:"none"},n.key),r.dotShape!==null&&le.jsx("g",{children:C.map(([k,_,D,O])=>le.jsxs("g",{transform:A?`translate(${k},${_})`:`translate(${_},${k})`,strokeDasharray:"none",stroke:"none",children:[x,i&&s&&le.jsx("circle",{onMouseOver:()=>f(D),onMouseLeave:()=>f(null),r:"15",fill:"transparent",stroke:"none"}),i&&le.jsx(oc,{content:[o.valueLabels[n.key],Ki(O)],x:A?k:_,y:A?_:k,sideDistances:a,horizontal:!0,active:c===D,container:s})]},D))})]})}var l5t={A:rr.A,B:rr.B,C:rr.C,D:rr.D,E:rr.E,F:rr.F,G:rr.G,H:rr.H,I:rr.I,J:rr.J,K:rr.K,L:rr.L,M:rr.M,N:rr.N,O:rr.O,P:rr.P,Q:rr.Q,R:rr.R,S:rr.S,T:rr.T,U:rr.U,V:rr.V,W:rr.W,X:rr.X,Y:rr.Y,Z:rr.Z,a:rr.LC_a,b:rr.LC_b,c:rr.LC_c,d:rr.LC_d,e:rr.LC_e,f:rr.LC_f,g:rr.LC_g,h:rr.LC_h,i:rr.LC_i,j:rr.LC_j,k:rr.LC_k,l:rr.LC_l,m:rr.LC_m,n:rr.LC_n,o:rr.LC_o,p:rr.LC_p,q:rr.LC_q,r:rr.LC_r,s:rr.LC_s,t:rr.LC_t,u:rr.LC_u,v:rr.LC_v,w:rr.LC_w,x:rr.LC_x,y:rr.LC_y,z:rr.LC_z,N0:rr.N0,N1:rr.N1,N2:rr.N2,N3:rr.N3,N4:rr.N4,N5:rr.N5,N6:rr.N6,N7:rr.N7,N8:rr.N8,N9:rr.N9};function s5t({scales:e,orientation:t,geom:n,aes:r,sideDistances:a,showTooltips:i,elementsAmount:o,tooltipsContainer:s,normalize:c}){let[f,A]=Vn.useState(null),h=t==="vertical",m=e.xPrimary.bandwidth(),g=(e.xPrimary(n.primaryGrouping)??0)+m/2,b=r.width==="auto"?m*.9:Math.min(m,r.width),C=[...e.xSecondary.domain()].filter(_=>n.valuesMap[_]).sort((_,D)=>{let O=n.valuesMap[_],I=n.valuesMap[D];return O.height-I.height}),x={},k=0;return C.forEach(_=>{if(!n.valuesMap[_])return;let D=n.valuesMap[_].height;x[_]={y1:k,y2:k+D},k+=D}),le.jsx("g",{transform:h?`translate(${g},0)`:`translate(0, ${g})`,opacity:r.opacity,children:C.map(_=>{if(!n.valuesMap[_])return null;let{y1:D,y2:O}=x[_],I=e.y(D),$=e.y(O),Q=Math.abs(I-$),ee=typeof r.fillColor=="string"?r.fillColor:r.fillColor[_],K=h?-b/2:Math.min(I,$),re=h?Math.min(I,$):-b/2,U=l5t[_];if(U)return le.jsxs("g",{children:[le.jsx("g",{transform:`translate(${K},${re})`,children:le.jsx("g",{transform:h?`scale(${b/100},${Q/100})`:`scale(${Q/100},${b/100})`,fill:ee,onMouseOver:()=>A(_),onMouseLeave:()=>A(null),children:le.jsx(U,{})})}),i&&le.jsx(oc,{content:[_,Ki(n.valuesMap[_].height)+(c?"%":"")],x:h?g:(I+$)/2,y:h?(I+$)/2:g,sideDistances:a,horizontal:h,offset:o>1?m/2:m/4,active:f===_,container:s})]},_)})})}function u2(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r)[t]}return n}function u5t({scales:e,orientation:t,geom:n,aes:r,sideDistances:a,showTooltips:i,tooltipsContainer:o}){let[s,c]=Vn.useState(null),f=t==="vertical",A=u2(e,"lineColor",r.lineColor,n.id),h=u2(e,"lineShape",r.lineShape,n.id),m=u2(e,"fillColor",r.dotFill,n.key1),g=u2(e,"dotShape",r.dotShape,n.key1),b=u2(e,"fillColor",r.dotFill,n.key2),C=u2(e,"dotShape",r.dotShape,n.key2),x=Af(g,r.dotSize,m),k=Af(C,r.dotSize,b);function _(D){return n.grouping==="primary"?(e.xPrimary(D)??0)+e.xPrimary.bandwidth()/2:(e.xPrimary(n.id)??0)+(e.xSecondary(D)??0)+e.xSecondary.bandwidth()/2}return le.jsx("g",{opacity:r.opacity,children:n.pairs.map(D=>{let O=f?_(n.key1):e.y(D.key1.value),I=f?_(n.key2):e.y(D.key2.value),$=f?e.y(D.key1.value):_(n.key1),Q=f?e.y(D.key2.value):_(n.key2);return le.jsxs("g",{children:[le.jsx("line",{x1:O,y1:$,x2:I,y2:Q,stroke:A,strokeDasharray:td(h),strokeWidth:r.lineWidth,fill:"none"}),le.jsxs("g",{transform:`translate(${O},${$})`,children:[x,i&&o&&le.jsx("circle",{onMouseOver:()=>c(D.key1.id),onMouseLeave:()=>c(null),r:"15",fill:"transparent",stroke:"none"}),i&&le.jsx(oc,{content:[D.id,Ki(D.key1.value)],x:O,y:$,sideDistances:a,horizontal:!0,active:s===D.key1.id,container:o})]}),le.jsxs("g",{transform:`translate(${I},${Q})`,children:[k,i&&o&&le.jsx("circle",{onMouseOver:()=>c(D.key2.id),onMouseLeave:()=>c(null),r:"15",fill:"transparent",stroke:"none"}),i&&le.jsx(oc,{content:[D.id,Ki(D.key2.value)],x:I,y:Q,sideDistances:a,horizontal:!0,active:s===D.key2.id,container:o})]})]},D.id)})})}function oK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function c5t(e,t,n){return n?[t,`${Ki(e)}`]:[`${Ki(e)}`]}function f5t({scales:e,orientation:t,geom:n,aes:r,hasKeyFromColumn:a,sideDistances:i,showTooltips:o,tooltipsContainer:s}){let[c,f]=Vn.useState(null),A=t==="vertical",h=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,m=e.xSecondary.bandwidth(),g=r.width==="auto"?m*.8:Math.min(m,r.width),b=_=>(1-_*2)*(g/2),C=oK(e,"dotFill",r.dotFill,n),x=oK(e,"dotShape",r.dotShape,n),k=Af(x,r.dotSize,C);return le.jsx("g",{transform:A?`translate(${h},0)`:`translate(0, ${h})`,children:n.points.map(({x:_,y:D,jitter:O,id:I})=>{let $=A?D*b(O):e.y(_),Q=A?e.y(_):D*b(O);return le.jsxs("g",{opacity:r.opacity,transform:`translate(${$},${Q})`,children:[k,o&&s&&le.jsx("circle",{onMouseOver:()=>f(I),onMouseLeave:()=>f(null),r:"4",fill:"transparent",stroke:"none"}),o&&le.jsx(oc,{content:c5t(D,I,a),x:h+$,y:Q,active:c===I,sideDistances:i,container:s})]},I)})})}function lK(e,t,n,r,a){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(a)[t]}return n}function d5t({scales:e,orientation:t,geom:n,aes:r,sideDistances:a,showTooltips:i,elementsAmount:o,tooltipsContainer:s,normalize:c,secondaryGrouping:f}){let[A,h]=Vn.useState(null),m=t==="vertical",g=e.xPrimary.bandwidth(),b=(e.xPrimary(n.primaryGrouping)??0)+g/2,C=r.width==="auto"?g*.8:Math.min(g,r.width),x=e.xSecondary.domain().reverse(),k={},_=0;return x.forEach(D=>{if(!n.valuesMap[D])return;let O=n.valuesMap[D].height;k[D]={y1:_,y2:_+O},_+=O}),le.jsx("g",{transform:m?`translate(${b},0)`:`translate(0, ${b})`,opacity:r.opacity,strokeWidth:r.lineWidth,children:x.map(D=>{if(!n.valuesMap[D])return null;let{y1:O,y2:I}=k[D],$=e.y(O),Q=e.y(I),ee=Math.abs($-Q),K=lK(e,"lineColor",r.lineColor,n.primaryGrouping,D),re=lK(e,"fillColor",r.fillColor,n.primaryGrouping,D);return le.jsxs("g",{children:[le.jsx("rect",{width:m?C:ee,height:m?ee:C,x:m?-C/2:Math.min($,Q),y:m?Math.min($,Q):-C/2,fill:re,stroke:K,onMouseOver:()=>h(D),onMouseLeave:()=>h(null)}),i&&le.jsx(oc,{content:[f.valueLabels[D],Ki(n.valuesMap[D].height)+(c?"%":"")],x:m?b:($+Q)/2,y:m?($+Q)/2:b,sideDistances:a,horizontal:m,offset:o>1?g/2:g/4,active:A===D,container:s})]},D)})})}function sK(e,t,n,r){let a=t.reduce((i,o,s)=>(i[o]=s,i),{});return e.filter(([,i])=>r?i<=n.one:!0).sort(([[i,o]],[[s,c]])=>i!==o?a[o]-a[i]:a[c]-a[s])}function A5t(e,t){let n=t.reduce((a,i,o)=>(a[i]=o,a),{}),r=[];return e.map(([[a,i]])=>{let o=n[a],s=n[i];for(let c=0;c<r.length;c++)if(r[c]<o)return r[c]=s,c;return r.push(s),r.length-1})}function uK(e,t,n,r){let a=t.reduce((o,s,c)=>(o[s]=c,o),{}),i=[];return sK(e,t,n,!r).forEach(([[o,s]])=>{let c=a[o],f=a[s];for(let A=0;A<i.length;A++)if(i[A]<c){i[A]=f;return}i.push(f)}),i.length}var p5t={ttest:"TTest",anova:"ANOVA",kruskalWallis:"Kruskal-Wallis",wilcoxon:"Wilcoxon"};function h5t(e,t){return e<=t.three?"***":e<=t.two?"**":e<=t.one?"*":"ns"}function SP(e,t,n,r){return!r&&e>n.one?"":t==="significance"?h5t(e,n):Ki(e)}var c2=18,BP=12;function m5t({orientation:e,scales:t,testMethod:n,values:r,statType:a,format:i,ns:o,significanceLevels:s,yShift:c}){if(!r.length)return null;let f=k=>(t.xPrimary(k)??0)+t.xPrimary.bandwidth()/2,A=e==="vertical",h=Math.abs(t.xPrimary.range()[1]-t.xPrimary.range()[0]),m=Math.abs(t.y.range()[1]-t.y.range()[0]),g=t.xPrimary.domain(),b=a==="pairwise"?sK(r,g,s,!o):r,C=a==="pairwise"?A5t(b,g):[],x=Math.max(...C);return le.jsxs("g",{fontSize:"14px",transform:A?`translate(0,${c})`:`translate(${m-c},0)`,children:[a==="overall"&&le.jsx("text",{x:A?h/2:-c2,y:A?c2:h/2,transform:A?"":`rotate(90,${-c2},${h/2})`,textAnchor:"middle",children:`${p5t[n]}, p = ${SP(r[0][1],"pValue",s,!0)}`}),a==="referenceGroup"&&le.jsx("g",{children:r.map(([[k],_])=>le.jsx("text",{x:A?f(k):-c2,y:A?c2:f(k),transform:A?"":`rotate(90,${-c2},${f(k)})`,textAnchor:"middle",children:SP(_,i,s,o)},k))}),a==="pairwise"&&le.jsx("g",{children:b.map(([[k,_],D],O)=>{let I=f(k),$=f(_),Q=(I+$)/2;return le.jsxs("g",{transform:A?`translate(0,${(x-C[O])*i2})`:`translate(${-(x-C[O])*i2},0)`,children:[le.jsx("text",{x:A?Q:-BP,y:A?BP:Q,transform:A?"":`rotate(90,${-BP},${Q})`,textAnchor:"middle",children:SP(D,i,s,o)}),le.jsx("path",{d:A?`M ${I},21 v-4 h ${$-I} v4`:`M -21,${I} h 4 v ${$-I} h-4`,fill:"none",stroke:Zt})]},`${k}_${_}`)})})]})}function v5t(e){return`translate(${e},0)`}function g5t(e){return`translate(0,${e})`}function y5t(e){return e==="bottom"?`translate(0,${ed})`:`translate(${-ed},0)`}function w5t(e){return e==="bottom"?"hanging":"central"}function C5t(e){return e==="bottom"?"middle":"end"}var cK=({scale:e,tickSize:t=6,tickPadding:n=ed,orient:r="bottom",onlyPositive:a=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function o(_){return D=>{let O=_(D);return O===void 0?0:+O}}let s=Math.abs(e.range()[0]-e.range()[1]),c=Math.min(Math.floor(s/tK),10),f=e.ticks(c).filter(_=>a&&_>=0||!a),A=f.some(_=>Math.abs(_)<1e-4&&_!==0||_>1e4)?",e":",f",h=_=>e.tickFormat(c,A)(_),m=Math.max(t,0)+n,g=o(e.copy()),b=r==="bottom"?v5t:g5t,C=r==="left"?-1:1,x={[(r==="left"?"x":"y")+"2"]:C*t},k={[r==="left"?"x":"y"]:C*m};return le.jsx("g",{children:f.map((_,D)=>le.jsxs("g",{className:"tick",transform:b(g(_)+i),children:[le.jsx("line",{stroke:Zt,...x}),le.jsx("g",{transform:y5t(r),children:le.jsx("text",{fill:Zt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:w5t(r),textAnchor:C5t(r),...k,children:h(_)})})]},D))})};function fK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function b5t({scales:e,orientation:t,violin:n,aes:r,maxViolinDensity:a,showTooltips:i,sideDistances:o,elementsAmount:s,tooltipsContainer:c}){let[f,A]=Vn.useState(!1),h=t==="vertical",m=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,g=e.xSecondary.bandwidth(),b=r.width==="auto"?g*.8:Math.min(g,r.width),C=fK(e,"lineColor",r.lineColor,n),x=fK(e,"fillColor",r.fillColor,n),k=n.getArea(t,e.y,b,a)??"",_=n.getLine(t,e.y,b,a)??"",D=Math.abs(e.y.range()[0]-e.y.range()[1]);return le.jsxs("g",{transform:h?`translate(${m},0)`:`translate(0, ${m})`,opacity:r.opacity,stroke:C,fill:x,strokeWidth:r.lineWidth,strokeDasharray:td(r.lineShape),children:[le.jsx("clipPath",{id:`violin_${n.key}`,children:le.jsx("path",{d:k})}),le.jsx("path",{d:k,stroke:"none"}),r.showQuartiles&&le.jsxs("g",{"clip-path":`url(#violin_${n.key})`,strokeWidth:r.lineWidth,stroke:C,children:[le.jsx("line",{x1:h?-b/2:e.y(n.quartiles.q1),x2:h?b/2:e.y(n.quartiles.q1),y1:h?e.y(n.quartiles.q1):-b/2,y2:h?e.y(n.quartiles.q1):b/2,strokeDasharray:td(r.quartilesLineStyle)}),le.jsx("line",{x1:h?-b/2:e.y(n.quartiles.q2),x2:h?b/2:e.y(n.quartiles.q2),y1:h?e.y(n.quartiles.q2):-b/2,y2:h?e.y(n.quartiles.q2):b/2,strokeDasharray:td(r.medianLineStyle)}),le.jsx("line",{x1:h?-b/2:e.y(n.quartiles.q3),x2:h?b/2:e.y(n.quartiles.q3),y1:h?e.y(n.quartiles.q3):-b/2,y2:h?e.y(n.quartiles.q3):b/2,strokeDasharray:td(r.quartilesLineStyle)})]}),le.jsx("path",{d:_,fill:"none"}),i&&c&&le.jsx("rect",{onMouseOver:()=>A(!0),onMouseLeave:()=>A(!1),width:h?g:D,x:h?-g/2:0,y:h?0:-g/2,height:h?D:g,fill:"transparent",stroke:"none"}),i&&le.jsx(oc,{content:[`Quartile 3 = ${Ki(n.quartiles.q3)}`,`Median = ${Ki(n.quartiles.q2)}`,`Quartile 1 = ${Ki(n.quartiles.q1)}`],x:h?m:e.y(n.quartiles.q2),y:h?e.y(n.quartiles.q2):m,sideDistances:o,horizontal:h,active:f,offset:s>1?b/2:b/4,container:c})]})}var E5t=1;function x5t({scaleX:e,scaleY:t,orientation:n,width:r,height:a,axisX:i,axisY:o,frameType:s}){let[c,f]=Vn.useState(e.domain()),A=Math.abs(t.range()[0]-t.range()[1]),h=Math.min(Math.floor(A/tK),10),[m,g]=Vn.useState(t.ticks(h)),b=e.bandwidth()/2,C=_=>(e(_)??0)+b,x=_=>t(_),k=n==="vertical";return Vn.useEffect(()=>{let _=e.domain(),D=t.ticks(h);f(_),g(D)},[e,t]),le.jsxs("g",{stroke:Jf,children:[i.showGrid&&c.map(_=>{let D=C(_)+(i.linesBetweenCategories?b:0);return le.jsx("line",{x1:k?D:0,x2:k?D:r,y1:k?0:D,y2:k?a:D},`x_${_}`)}),o.showGrid&&m.map(_=>{let D=x(_);return le.jsx("line",{x1:k?0:D,x2:k?r:D,y1:k?D:0,y2:k?D:a},`y_${_}`)}),s!=="empty"&&le.jsxs("g",{strokeWidth:E5t,children:[(i.showGrid||s!=="left")&&le.jsx("line",{stroke:s==="left"?Jf:Zt,x1:"0",x2:r,y1:a,y2:a}),(i.showGrid||s!=="bottom")&&le.jsx("line",{stroke:s==="bottom"?Jf:Zt,x1:"0",x2:"0",y1:"0",y2:a}),(i.showGrid||s==="full")&&le.jsx("line",{stroke:s==="full"?Zt:Jf,x1:r,x2:r,y1:"0",y2:a}),(o.showGrid||s==="full")&&le.jsx("line",{stroke:s==="full"?Zt:Jf,x1:"0",x2:r,y1:"0",y2:"0"})]})]})}function S5t(e,t,n){if(!e.length)return[];let r=[0];for(let a=0;a<e.length-1;a++){let i=e[a];if(i.meta.statType==="pairwise"){let o=uK(i.values[n],t,i.meta.significanceLevels,i.meta.ns);r.push(r[r.length-1]+i2*o)}else r.push(r[r.length-1]+i2)}return r}function dK(e){return typeof e=="string"?e:e.value}function B5t({facetSettings:e,facetTitle:t,dimensions:n,scales:r,orientation:a,layersData:i,statsData:o,facetKey:s,xAxis:c,yAxis:f,frameType:A,tooltips:h,tooltipsContainer:m,keyColumn:g,chartSizes:b,margins:C,xLabels:x,onlyPositive:k,secondaryGrouping:_}){let D=a==="vertical",O=S5t(o,r.xPrimary.domain(),s),I=c.showTicks?eK:0,$=f.showTicks?eK:0,Q=dK(c.title),ee=dK(f.title),K=n.chartEdgeSides.includes("left")||D&&!(e!=null&&e.sharedY)||!D&&!(e!=null&&e.sharedX),re=n.chartEdgeSides.includes("bottom")||D&&!(e!=null&&e.sharedX)||!D&&!(e!=null&&e.sharedY),U=n.chartEdgeSides.includes("left"),G=n.chartEdgeSides.includes("bottom"),{width:Z,height:Y}=n.inner,{left:X,top:oe,padding:me}=n,ae={left:C.left+X+me.left,right:b.totalWidth-(C.left+X+me.left),top:C.top+oe+me.top,bottom:b.totalHeight-(C.top+oe+me.top)},ye=`translate(${X+me.left},${oe+me.top})`,Ce=!1;return le.jsxs("g",{transform:ye,children:[Ce,t.length&&le.jsxs("g",{children:[A==="full"&&le.jsx("rect",{x:"0",y:-me.top,height:me.top,width:Z,fill:"#F7F8FA",stroke:Zt}),t.map((ce,ge)=>{let ze=t.length,Ne=(me.top-m9*ze)/2;return le.jsx("text",{fontSize:"14px",fontWeight:"500",fill:Zt,x:Z/2,dy:Ne+m9/2-me.top,y:ge*m9,textAnchor:"middle",dominantBaseline:"central",children:ce},ge)})]}),le.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Zt,children:[G&&le.jsx("text",{x:Z/2,y:Y+me.bottom-l1/2,children:D?Q:ee}),G&&Ce&&le.jsx("rect",{x:"0",y:Y+me.bottom-l1,width:Z,height:l1,fill:"none",stroke:"black"}),U&&le.jsx("text",{x:-me.left+l1/2,y:Y/2,transform:`rotate(-90,${-me.left+l1/2},${Y/2})`,children:D?ee:Q}),U&&Ce&&le.jsx("rect",{x:-me.left,y:"0",width:l1,height:Y,fill:"none",stroke:"black"})]}),le.jsx(x5t,{orientation:a,width:Z,height:Y,scaleX:r.xPrimary,scaleY:r.y,axisX:c,axisY:f,frameType:A}),re&&le.jsx("g",{transform:`translate(0,${Y})`,children:D?le.jsx(rK,{scale:r.xPrimary,orient:"bottom",labelsPosition:c.labelsPosition,tickSize:I,labels:x}):le.jsx(cK,{scale:r.y,onlyPositive:k,orient:"bottom",tickSize:$})}),K&&le.jsx("g",{children:D?le.jsx(cK,{scale:r.y,onlyPositive:k,orient:"left",tickSize:$}):le.jsx(rK,{scale:r.xPrimary,orient:"left",labelsPosition:c.labelsPosition,tickSize:I,labels:x})}),le.jsxs("g",{children:[i.map(ce=>le.jsxs("g",{children:[ce.type==="box"&&ce.geoms[s].map(ge=>le.jsx(t5t,{box:ge,elementsAmount:ce.geoms[s].length,scales:r,orientation:a,aes:ce.aes,hasKeyFromColumn:g!==null,sideDistances:ae,showTooltips:h.box.show,tooltipsContainer:m},ge.key)),ce.type==="violin"&&ce.geoms[s].map(ge=>le.jsx(b5t,{violin:ge,elementsAmount:ce.geoms[s].length,scales:r,orientation:a,maxViolinDensity:ce.meta.maxDensity,aes:ce.aes,sideDistances:ae,showTooltips:h.violin.show,tooltipsContainer:m},ge.key)),ce.type==="dot"&&ce.geoms[s].map(ge=>le.jsx(r5t,{geom:ge,scales:r,orientation:a,aes:ce.aes,hasKeyFromColumn:g!==null,sideDistances:ae,showTooltips:h.dot.show,tooltipsContainer:m},ge.key)),ce.type==="line"&&ce.geoms[s].map(ge=>le.jsx(o5t,{line:ge,scales:r,orientation:a,sideDistances:ae,aes:ce.aes,showTooltips:h.line.show,secondaryGrouping:_,tooltipsContainer:m},ge.key)),ce.type==="errorbar"&&ce.geoms[s].map(ge=>le.jsx(a5t,{errorBar:ge,scales:r,orientation:a,aes:ce.aes,sideDistances:ae,showTooltips:h.errorBar.show,tooltipsContainer:m},ge.key)),ce.type==="bar"&&ce.geoms[s].map(ge=>le.jsx(J2t,{bar:ge,scales:r,orientation:a,aes:ce.aes},ge.key)),ce.type==="stackedBar"&&ce.geoms[s].map(ge=>le.jsx(d5t,{geom:ge,elementsAmount:ce.geoms[s].length,scales:r,orientation:a,aes:ce.aes,normalize:ce.meta.normalize,sideDistances:ae,showTooltips:h.stackedBar.show,secondaryGrouping:_,tooltipsContainer:m},ge.key)),ce.type==="binnedDots"&&ce.geoms[s].map(ge=>le.jsx(q2t,{geom:ge,scales:r,orientation:a,aes:ce.aes,binsCount:ce.meta.binsCount,min:ce.meta.minY,max:ce.meta.maxY,hasKeyFromColumn:ce.meta.hasKeyFromColumn,sideDistances:ae,showTooltips:h.stackedBar.show,tooltipsContainer:m},ge.key)),ce.type==="pairedPoints"&&ce.geoms[s].map(ge=>le.jsx(u5t,{geom:ge,scales:r,orientation:a,sideDistances:ae,aes:ce.aes,showTooltips:h.pairedPoints.show,tooltipsContainer:m},ge.id)),ce.type==="sina"&&ce.geoms[s].map(ge=>le.jsx(f5t,{geom:ge,scales:r,orientation:a,sideDistances:ae,aes:ce.aes,hasKeyFromColumn:g!==null,showTooltips:!1,tooltipsContainer:m},ge.key)),ce.type==="logo"&&ce.geoms[s].map(ge=>le.jsx(s5t,{geom:ge,elementsAmount:ce.geoms[s].length,scales:r,orientation:a,aes:ce.aes,normalize:ce.meta.normalize,sideDistances:ae,showTooltips:!0,tooltipsContainer:m},ge.key))]},ce.type)),o.map((ce,ge)=>le.jsx(m5t,{yShift:O[ge],scales:r,orientation:a,statType:ce.meta.statType,values:ce.values[s],testMethod:ce.meta.testMethod,format:ce.meta.format,ns:ce.meta.ns,significanceLevels:ce.meta.significanceLevels},`${ce.meta.statType}_${ce.meta.testMethod}`))]})]})}var f2=class extends gb.Component{constructor(e){super(e),this.state={hasError:!1,message:""}}static getDerivedStateFromError(e){return{hasError:!0,message:e.message}}componentDidUpdate(e){e.dataId!==this.props.dataId&&this.setState({hasError:!1,message:"error.message"})}componentDidCatch(e,t){console.log(t)}render(){return this.state.hasError?le.jsx(Fm,{message:this.state.message}):this.props.children}};function k5t(e,t,n,r){return e==="left"?n:e==="right"?t-r:(t-(n+r))/2+n}function T5t(e){return e==="left"?"start":e==="right"?"end":"middle"}function d2({show:e,position:t,title:n,chartsWidth:r,leftPadding:a,rightPadding:i}){return e?le.jsx("g",{children:n.map((o,s)=>le.jsx("text",{x:k5t(t,r,a,i),textAnchor:T5t(t),y:-(n.length-s-1)*24-24-24/2,fontSize:"20px",fontFamily:"Manrope",fontWeight:"500",dominantBaseline:"central",children:o},`${o}_${s}`))}):null}var Hc=12,g9=-12,AK=14;function _5t(e=null){return e==="dashed"?"M1 11.25H6V12.75H1V11.25ZM9.5 11.25H14.5V12.75H9.5V11.25ZM18 11.25H23V12.75H18V11.25Z":e==="dotted"?"M2.75 11.25H1.25V12.75H2.75V11.25Z M11.25 11.25H12.75V12.75H11.25V11.25Z M22.75 11.25H21.25V12.75H22.75V11.25Z M7.75 11.25H6.25V12.75H7.75V11.25Z M16.25 11.25H17.75V12.75H16.25V11.25Z":e==="longdash"?"M1 11.25H10V12.75H1V11.25ZM14 11.25H23V12.75H14V11.25Z":e==="dotdash"?"M1 11.25H2.5V12.75H1V11.25ZM17 12.75H7V11.25H17V12.75ZM21.5 12.75V11.25H23V12.75H21.5Z":e==="twodash"?"M1 11.25H4V12.75H1V11.25ZM17.0261 12.75H7V11.25H17.0261V12.75ZM20 12.75V11.25H23V12.75H20Z":"M1 11.25H23V12.75H1V11.25Z"}var P5t=3,M5t=24;function D5t({aes:e,label:t,usedAes:n}){let r=n.lineShape,a=n.dotShape,i=n.fillColor||n.lineColor&&!n.lineShape||n.dotFill&&!n.dotShape,o=a?Af(e.dotShape??"21",P5t,i?Zt:e.dotFill??Zt):null,s=(a&&r?2*Hc:0)-6,c=r?s+M5t+8:Hc+8;return le.jsxs("g",{children:[i&&le.jsx("rect",{width:Hc,height:Hc,stroke:e.fillColor??e.lineColor,fill:e.fillColor??e.lineColor,rx:"1",ry:"1"}),a&&le.jsx("g",{transform:`translate(${Hc/2},${Hc/2})`,children:o}),r&&le.jsx("path",{transform:`translate(${s},-5)`,fillRule:"evenodd",clipRule:"evenodd",d:_5t(e.lineShape),fill:e.lineColor}),le.jsx("text",{x:c,y:Hc/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function H5t({aes:e,label:t}){let n=Af(e.shape,e.size,e.color);return le.jsxs("g",{children:[le.jsx("g",{transform:`translate(${Hc/2},${Hc/2})`,children:n}),le.jsx("text",{x:Hc+8,y:Hc/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function y9({legendData:e}){let t=e.items.filter(n=>n.type==="continuous");return le.jsxs("g",{children:[le.jsx("defs",{children:t.map(n=>le.jsx("linearGradient",{id:n.id,gradientTransform:"rotate(90)",children:n.scale.domain().reverse().map(r=>{let a=n.scale.domain(),i=a[a.length-1]-a[0],o=i>0?100-(r-a[0])/i*100:0;return le.jsx("stop",{offset:`${o}%`,stopColor:n.scale(r)},r)})},n.id))}),e.items.map(n=>{if(n.type==="continuous")return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[le.jsx("text",{fontWeight:500,fontSize:"14px",y:g9,children:n.title}),le.jsx("rect",{x:"0",y:"0",width:AK,height:n.height,stroke:Zt,fill:`url(#${n.id})`}),le.jsx("g",{transform:`translate(${AK},0)`,children:n.values.map(r=>{let a=n.tickPositionScale(r)??0;return le.jsxs("g",{transform:`translate(0,${a})`,children:[le.jsx("line",{x1:"0",x2:-4,stroke:Zt}),le.jsx("text",{x:8,y:4,children:r})]},r)})}),!1]},n.id);if(n.type==="discreteColor")return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[le.jsx("text",{fontWeight:500,fontSize:"14px",y:g9,children:n.title}),n.values.map((r,a)=>le.jsxs("g",{transform:`translate(0, ${a*(Hc+4)})`,children:[le.jsx("rect",{x:"0",y:"0",width:Hc,height:Hc,fill:n.scale(r),rx:"1",ry:"1",stroke:Zt}),le.jsx("text",{x:Hc+8,y:10,children:r})]},r)),!1]},n.id);if(n.type==="discreteMulti")return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[le.jsx("text",{fontWeight:600,y:g9,children:n.title}),n.values.map((r,a)=>le.jsx("g",{transform:`translate(0, ${a*(Hc+4)})`,children:le.jsx(D5t,{aes:n.scale(r),label:n.labels[r],usedAes:n.usedAes})},r)),!1]},n.id);if(n.type==="dots")return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[le.jsx("text",{fontWeight:500,y:g9,children:n.title}),n.values.map((r,a)=>le.jsx("g",{transform:`translate(0, ${a*(Hc+4)})`,children:le.jsx(H5t,{aes:n.scale(r),label:n.labels[r]})},r)),!1]},n.id);if(n.type==="size"){let r=n.height/n.values.length;return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[le.jsx("text",{fontWeight:500,y:g9,children:n.title}),n.values.map((a,i)=>{let o=n.scale(a);return le.jsxs("g",{transform:`translate(0, ${i*r})`,children:[le.jsx("circle",{r:o,cx:r/2,cy:r/2,fill:Zt}),le.jsx("text",{x:r+4,y:r/2,alignmentBaseline:"central",children:n.labels[a]})]},a)}),!1]},n.id)}})]})}function I5t({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,facetKeys:a,facetTitles:i,facetSettings:o,scales:s,layersData:c,statsData:f,legendData:A,margins:h,columnsCount:m,keyColumn:g,xLabels:b,chartTitle:C,onlyPositive:x,secondaryGrouping:k}){let[_,D]=Vn.useState(),{orientation:O,xAxis:I,yAxis:$,title:Q,legend:ee,frame:K}=t,re=r[a[0]].padding,U=r[a[m-1]].padding,G=n.chartsWidth+j8,Z=re.top;return le.jsx(f2,{dataId:e,children:le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${n.totalWidth} ${n.totalHeight}`,width:n.totalWidth,height:n.totalHeight,children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${h.left},${h.top})`,fontFamily:"Manrope",children:[le.jsx(d2,{title:C,show:Q.show,position:Q.position,leftPadding:re.left,rightPadding:U.right,chartsWidth:n.chartsWidth}),a.map(Y=>le.jsx(B5t,{facetKey:Y,facetTitle:i[Y],facetSettings:o,orientation:O,scales:{...s,xPrimary:s.xPrimary[Y],xSecondary:s.xSecondary[Y],y:s.y[Y]},chartSizes:n,margins:h,dimensions:r[Y],layersData:c,statsData:f,xAxis:I,yAxis:$,frameType:K.type,tooltips:t.tooltips,tooltipsContainer:_,keyColumn:g,xLabels:b[Y],onlyPositive:x,secondaryGrouping:k},Y)),ee.show&&le.jsx("g",{transform:`translate(${G},${Z})`,children:le.jsx(y9,{legendData:A})})]}),le.jsx("g",{ref:Y=>{Y&&!_&&D(Y)}})]})})}function pK(e,t){let n=Object.keys(e.values),r=e.reduce((a,i)=>{if(i.meta.statType==="pairwise"){let o=Object.values(i.values).map(s=>uK(s,t,i.meta.significanceLevels,i.meta.ns));return a+i2*Math.max(...o)}return(i.meta.ns?t.length>0:n.some(o=>i.values[o].some(([,s])=>s<i.meta.significanceLevels.one)))?a+i2:a},Q2t);return Math.max(h9.TOP,r)}function A2(e,t,n=r=>r){let r=A=>t==="log"?Math.log10(A):A,a=A=>t==="log"?Math.pow(10,A):A,i=e.map(n).map(r).sort((A,h)=>A-h),o=Dp(i,.25),s=Dp(i,.75),c=s-o,f=1.5;return[a(o-f*c),a(s+f*c)]}function L5t(e,t,n,r=14){let a=new Dc(`600 ${r}px Manrope`),i=[];e.split(new RegExp("(?=[_-])|(?<=[_-])")).forEach(h=>{a.getTextWidth(h)>n?i.push(...h.split("")):i.push(h)});let o="",s=0,c=0,f="";for(;s<=t;){let h=a.getTextWidth(o+i[c]);h<t&&(o+=i[c],f=o,c++),s=h}o="",s=0;let A=[];for(c;c<i.length;c++){let h=a.getTextWidth(o+i[c]);h<n?(o+=i[c],s=h):(A.push(o),o=i[c],s=a.getTextWidth(i[c]))}return{firstPart:f,lines:A,lastPart:o,lastPartLength:s}}function Om(e,t,n){let r=new Dc(`600 ${n}px Manrope`);if(e.trim()==="")return[];if(r.getTextWidth(e)<=t)return[e];let a=e.split(/\s+/),i=[],o="",s=0;for(let c=0;c<a.length;c++){let f=`${o} ${a[c]}`,A=r.getTextWidth(f);if(A<=t)o=f,s=A;else{let h=r.getTextWidth(a[c]);if(h>t){let{firstPart:m,lines:g,lastPart:b,lastPartLength:C}=L5t(a[c],t-s,t,n);i.push(`${o} ${m}`),i.push(...g),o=b,s=C}else i.push(o),o=a[c],s=h}}return i.push(o),i.filter(c=>c.length>0)}var hK=new Dc("600 14px Manrope"),R5t=16,kP=48,N5t=20,Pg=24;function TP(e,t){return Math.max(...e.map(n=>hK.getTextWidth(String(n))+N5t),hK.getTextWidth(t))}function $5t(e,t,n,r){let a=[[]],i=0,o=t,s=0;return e.forEach(c=>{i+r<=o?(a[s].push(c),i+=r):(a.push([c]),s++,i=r,o=n)}),a}function w9(e,t,n){let r=n??t,a=0,i=0,o=0;e.sort((c,f)=>c.type==="continuous"&&f.type!=="continuous"?-1:f.type==="continuous"&&c.type!=="continuous"?1:c.type==="dots"&&f.type!=="dots"?-1:f.type==="dots"&&c.type!=="dots"?1:0);let s=[];return e.forEach(c=>{let{type:f,values:A,title:h,id:m,scale:g}=c;if(f==="continuous"){let b=UX(A,h),C=r;t-i<C&&(o+=a+Pg,a=0,i=0);let x=o,k=i;b>a&&(a=b),i+=C+kP,i>=t&&(o+=a+Pg,a=0,i=0),s.push({...c,width:b,height:C,left:x,top:k})}else if(f==="size"){let{labels:b}=c,C=g(Math.max(...A))*2+4,x=TP(A.map(O=>b[O]),h),k=A.length*C;t-i<k&&(o+=a+Pg,a=0,i=0);let _=o,D=i;x>a&&(a=x),i+=k+kP,i>=t&&(o+=a+Pg,a=0,i=0),s.push({...c,width:x,height:k,left:_,top:D})}else{let{labels:b}=c,C=R5t,x=t-i;x<C&&(x=t,o+=a+Pg,a=0,i=0);let k=$5t(A,x,t,C),_=TP([],h),D=a===0,O=o+_+Pg;k.forEach((I,$)=>{let Q=$===k.length-1,ee=$>0?"":h,K=$>0?`${m}_${$}`:m,re=TP(I.map(Y=>b[Y]),D?"":ee),U=I.length*C,G=o,Z=i;re>a&&(a=re),Q?i+=U+kP:i=t,i>=t&&(o+=a+Pg,D&&Q&&o<O&&(o=O),a=0,i=0),s.push({...c,id:K,title:ee,width:re,height:U,left:G,top:Z,values:I})})}}),s}function F5t(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function V5t(e,t,n,r,a,i,o,s,c,f){let A=e==="vertical",h=o.includes("left")||A&&!(s!=null&&s.sharedY)||!A&&!(s!=null&&s.sharedX),m=o.includes("left")&&n.title!=="",g=o.includes("bottom")||A&&!(s!=null&&s.sharedX)||!A&&!(s!=null&&s.sharedY),b=o.includes("bottom")&&t.title!=="",C=r.yAxisCaptionsWidth,x=(n.showTicks?t2:0)+ed,k=m?l1:0,_=r.xAxisCaptionsWidthByRows[A?c:f],D=(t.showTicks?t2:0)+ed,O=b?l1:0,I=A?C+x+k:_+D+O,$=A?D+_+O:x+2*l1,Q=Math.max(...a.map(ee=>i[ee].length));return{left:h?I:CP,top:Q===0?0:O2t*2+Q*m9,bottom:g?$:CP,right:CP}}function O5t(e,t,n){let r=new Array(n).fill(null).map(()=>[]);for(let a=0;a<n;a++)for(let i=0;i<t;i++)i*n+a<e.length&&r[a].push(e[i*n+a]);return r}function mK(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function Q5t(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function z5t(e){return typeof e=="object"&&"type"in e}var U5t=class{constructor(){Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"component",le.jsx(le.Fragment,{}));Me(this,"chartsDimensions",{});Me(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Me(this,"columnsCount",1);Me(this,"rowsCount",1);Me(this,"scales",{xPrimary:{null:F5().range([0,600]).domain(["1"])},xSecondary:{null:F5().range([0,600]).domain(["1"])},y:{null:Da().domain([0,10]).range([350,0]).nice()},xPrimaryAes:Hl().unknown(qX),xSecondaryAes:Hl().unknown(qX)});Me(this,"facetTitles",{});Me(this,"mainTitle",[]);Me(this,"axisLabelsX",{});Me(this,"captionsSizes",{xAxisCaptionsWidthByRows:[],xCaptionsTail:0,yAxisCaptionsWidth:100});Me(this,"legend",{width:0,height:0,items:[]});Me(this,"margins",{left:0,right:0,top:0,bottom:0})}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=zh(this.rootNode))}updateChartSize(e,t,n,r,a,i){let o=pK(i,r),s=t.length,c=Math.min((n==null?void 0:n.nRows)??s,s),f=Math.min((n==null?void 0:n.nCols)??s,s);this.columnsCount=n!=null&&n.nRows?Math.ceil(s/c):f,this.rowsCount=Math.ceil(s/this.columnsCount);let{width:A,height:h}=e;a==="vertical"&&o>h9.TOP&&(h+=o),a==="horizontal"&&o>h9.TOP&&(A+=o),this.chartSizes.chartWidth=A,this.chartSizes.chartHeight=h}updateChartDimensions(e,t,n,r,a){let{chartWidth:i,chartHeight:o}=this.chartSizes,s=0,c=0;this.chartsDimensions=e.reduce((h,m,g)=>{let[b,C]=Q5t(g,this.columnsCount),x=F5t(g,e.length,this.columnsCount,this.rowsCount),k=V5t(n,r,a,this.captionsSizes,mK(e,this.rowsCount,this.columnsCount)[b],this.facetTitles,x,t,b,C),_=i+k.left+k.right,D=o+k.top+k.bottom;return h[m]={left:s,top:c,chartEdgeSides:x,padding:k,inner:{width:i,height:o},outer:{width:_,height:D}},s+=_,C===this.columnsCount-1&&(s=0,c+=D),h},{});let f=Math.max(...e.map(h=>this.chartsDimensions[h].outer.width+this.chartsDimensions[h].left)),A=Math.max(...e.map(h=>this.chartsDimensions[h].outer.height+this.chartsDimensions[h].top));this.chartSizes.chartsWidth=f,this.chartSizes.chartsHeight=A}updateViewport(e,t,n,r,a,i,o,s,c){let f=e==="vertical",A=pK(s,t),h=a===null||a.sharedX,m=a===null||a.sharedY,{chartHeight:g,chartWidth:b}=this.chartSizes;r.forEach(C=>{let x=i.scale==="log"?Rv():Da(),k=Math.min(...m?o.map(({meta:I})=>I.minY):o.map(({geoms:I})=>Math.min(...I[C].map(({boundsY:$})=>$.min)))),_=Math.max(...m?o.map(({meta:I})=>I.maxY):o.map(({geoms:I})=>Math.max(...I[C].map(({boundsY:$})=>$.max)))),D=x.copy().domain([k,_]).range(f?[g-h9.BOTTOM,A]:[h9.BOTTOM,b-A]);x.domain([D.invert(f?g:0),D.invert(f?0:b)]).range(f?[g,0]:[0,b]),this.scales.y[C]=x;let O=h?t:c[C];this.scales.xPrimary[C]=F5().domain(O).range(f?[0,b]:[g,0]),this.scales.xSecondary[C]=F5().domain(n).range([0,this.scales.xPrimary[C].bandwidth()])})}createFacetTitles(e,t){this.facetTitles=e.reduce((n,r,a)=>(t[a].length===1&&t[a][0]==="null"?n[r]=[]:n[r]=Om(t[a].join(", "),this.chartSizes.chartWidth,14),n),{})}createMainTitle(e,t){let n=this.chartsDimensions[e[0]],r=this.chartsDimensions[e[e.length-1]];this.mainTitle=Om(t.name,this.chartSizes.chartsWidth-n.padding.left-r.padding.right,20)}createAxisLabels(e,t,n,r){let a={center:120,"45deg":256,"90deg":320},i=r==="vertical";function o(s,c){return s==="center"?1/0:Math.floor(s==="45deg"?c*Math.sin(Math.PI/4)/bP:c/bP)}this.axisLabelsX=e.reduce((s,c)=>{let f=this.scales.xPrimary[c],A=f.bandwidth(),h=a[t.labelsPosition],m=t.labelsPosition==="center"?Math.min(h,A):h,g=n.valueLabels;return s[c]=f.domain().reduce((b,C)=>{let x=g[C];if(!i)b[C]=[x];else{let k=o(t.labelsPosition,A),_=Om(x,m,14);b[C]=_.length>k?[x]:_}return b},{}),s},{})}updateAesScales(e,t){if(e.inheritedAes){let{inheritedAes:n,keys:r}=e;this.scales.xPrimaryAes.domain(r).range(r.map(a=>n[a]))}else this.scales.xPrimaryAes.domain([]).range([]);if(t.inheritedAes){let{inheritedAes:n,keys:r}=t;this.scales.xSecondaryAes.domain(r).range(r.map(a=>n[a]))}else this.scales.xSecondaryAes.domain([]).range([])}updateCaptionsSize(e,t,n){let r=new Dc("600 14px Manrope"),a=e==="vertical";function i(g){return g.length?Math.max(...g.map(b=>r.getTextWidth(b))):0}function o(g){return g.length?Math.max(...g.map(i)):0}let s=[],c=0,f=mK(t,this.rowsCount,this.columnsCount),A=O5t(t,this.rowsCount,this.columnsCount);if(!a)s=A.map(g=>Math.max(...g.map(b=>o(this.scales.xPrimary[b].domain().map(C=>this.axisLabelsX[b][C])))));else{if(n.labelsPosition==="center"&&(s=f.map(g=>Math.max(...g.map(b=>Math.max(...this.scales.xPrimary[b].domain().map(C=>C?this.axisLabelsX[b][C].length*bP:0)))))),n.labelsPosition==="45deg"){let g=Math.sin(Math.PI/4);s=f.map(b=>Math.max(...b.map(C=>{let x=this.scales.xPrimary[C].domain().map(_=>this.axisLabelsX[C][_]),k=o(x);return k>0?k*g+14:0}))),c=Math.max(...A[0].map(b=>{let C=this.scales.xPrimary[b].domain(),x=this.axisLabelsX[b][C[0]];return Math.max(i(x)*g-this.scales.xPrimary[b].bandwidth()/2+14,0)}))}n.labelsPosition==="90deg"&&(s=f.map(g=>Math.max(...g.map(b=>o(this.scales.xPrimary[b].domain().map(C=>this.axisLabelsX[b][C]))))))}let h=Ir.flatten(t.map(g=>{let b=this.scales.y[g],C=b.ticks(),x=C.some(_=>Math.abs(_)<1e-4&&_!==0||_>1e4)?",e":",f",k=b.tickFormat(10,x);return C.map(k)})),m=i(h);this.captionsSizes={xCaptionsTail:c,xAxisCaptionsWidthByRows:s,yAxisCaptionsWidth:m}}updateMargins(e,t){let n=this.chartsDimensions[t[0]],r=this.chartsDimensions[t[t.length-1]],a=e==="vertical";this.margins={left:Math.max(z8,a?this.captionsSizes.xCaptionsTail-n.padding.left:0),right:Math.max(this.legend.width,z8),top:Math.max(24*this.mainTitle.length+24*2,z8),bottom:Math.max(z8,a?0:this.captionsSizes.xCaptionsTail-r.padding.bottom)},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartsHeight,this.legend.height)+this.margins.bottom}updateLegendSize(e,t,n,r){if(!e.show){this.legend={width:0,height:0,items:[]};return}let a=this.chartSizes.chartHeight,i={width:0,height:0,left:0,top:0},o=[];function s(b,C){return r.some(x=>{let k=x.aes[C];return k&&z5t(k)&&k.type===b})}function c(b){return{dotFill:s(b,"dotFill"),fillColor:s(b,"fillColor"),lineColor:s(b,"lineColor"),dotShape:s(b,"dotShape"),lineShape:s(b,"lineShape")}}let f=c("primaryGrouping"),A=c("secondaryGrouping");if(Object.values(f).some(b=>b)&&t.inheritedAes&&o.push({type:"discreteMulti",id:"primary",title:t.label,scale:this.scales.xPrimaryAes,values:t.keys,labels:t.valueLabels,usedAes:f,...i}),Object.values(A).some(b=>b)&&n.inheritedAes&&o.push({type:"discreteMulti",id:"secondary",title:n.label,scale:this.scales.xSecondaryAes,values:n.keys,labels:n.valueLabels,usedAes:A,...i}),!o.length){this.legend={width:0,height:0,items:[]};return}let h=w9(o,this.chartSizes.chartHeight),m=h[h.length-1],g=m.left+m.width+2*j8;this.legend={width:g,height:a,items:h}}render(e,t,n,r,a,i,o,s,c,f,A,h){var k;let{orientation:m,xAxis:g,yAxis:b,size:C}=t;this.updateChartSize(C,i,a,n.keys,m,c),this.updateViewport(m,n.keys,r.keys,i,a,b,s,c,A),this.createAxisLabels(i,g,n,m),this.createFacetTitles(i,o),this.updateCaptionsSize(m,i,g),this.updateChartDimensions(i,a,m,g,b),this.updateLegendSize(t.legend,n,r,s),this.createMainTitle(i,t.title),this.updateMargins(m,i),this.updateAesScales(n,r);let x=le.jsx(I5t,{settingsId:e,chartSettings:t,facetKeys:i,facetSettings:a,facetTitles:this.facetTitles,chartSizes:this.chartSizes,chartsDimensions:this.chartsDimensions,scales:this.scales,layersData:s,statsData:c,legendData:this.legend,margins:this.margins,columnsCount:this.columnsCount,keyColumn:f,xLabels:this.axisLabelsX,chartTitle:this.mainTitle,onlyPositive:h,secondaryGrouping:r});this.component=x,(k=this.reactRoot)==null||k.render(x)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},j5t=U5t;function G5t(e,t,n,r=!1){let a=e.map(t).sort((i,o)=>i-o);if(r){let i=Ir.find(a,o=>o>0);if(!i)throw Error("Group with all zeros in log scale");return a.map(o=>o===0?i:o).map(n)}return a.map(n)}var Y5t=class{constructor(e,t,n,r,a,i,o,s,c,f,A=!0){Me(this,"lower");Me(this,"middle");Me(this,"upper");Me(this,"min");Me(this,"max");Me(this,"outliers");Me(this,"primaryGrouping");Me(this,"secondaryGrouping");Me(this,"key");Me(this,"boundsY");if(e.length===0)throw Error("Unable to create box on empty data");if(o>s||o>c||s>c)throw Error(`Invalid box bounds values: lower=${o}, middle=${s}, upper=${c}`);if(f<0)throw Error(`Invalid box whiskers coefficient: k=${f}. It should be positive`);let h=I=>Number(I[t]);this.primaryGrouping=a===null?"":String(a),this.secondaryGrouping=i===null?"":String(i),this.key=`box_${this.primaryGrouping}_${this.secondaryGrouping}`;let m=I=>r==="log"?Math.log10(I):I,g=I=>r==="log"?Math.pow(10,I):I,b=G5t(e,h,m,r==="log"),C=Dp(b,o),x=Dp(b,s),k=Dp(b,c),_=k-C;this.upper=g(k),this.middle=g(x),this.lower=g(C),this.min=Math.max(mC(e,h),g(C-f*_)),this.max=Math.min(Ih(e,h),g(k+f*_)),this.outliers=e.filter(I=>h(I)<this.min||h(I)>this.max).map((I,$)=>({y:h(I),data:I,id:String(n?I[n]:$)}));let[D=1/0,O=-1/0]=$A(this.outliers,I=>I.y);this.boundsY={min:A?Math.min(this.min,D):this.min,max:A?Math.max(this.max,O):this.max}}};function W5t(e,t,n,r,a,i,o,s){let c=1/0,f=-1/0;return{type:"box",geoms:t.reduce((A,h)=>{let m=h.join("_");return A[m]=[],n.forEach(g=>{r.forEach(b=>{let C=a.getRowsByGrouping([...h,g,b]);if(!C.length)return;let x=new Y5t(C,i.value,(o==null?void 0:o.value)??null,s.scale,g,b,e.stat.lower,e.stat.medium,e.stat.upper,e.stat.k,e.aes.showOutliers);x.boundsY.min<c&&(c=x.boundsY.min),x.boundsY.max>f&&(f=x.boundsY.max),A[m].push(x)})}),A},{}),meta:{minY:c,maxY:f},aes:e.aes}}var vK=40;function X5t(e,t){return function(n){return t.map(function(r){return[r,tu(n,a=>e(r-a))]})}}function K5t(e){return function(t){return 1/Math.sqrt(2*Math.PI)*Math.pow(Math.E,-.5*Math.pow(t/e,2))}}function Z5t(e){let t=tu(e);return tu(e.map(n=>Math.pow(n-t,2)))}function J5t(e){return Math.sqrt(Z5t(e))}function q5t(e,t,n){let r=(n-t)/1.34,a=J5t(e);return 1.06*Math.min(a,r)*Math.pow(e.length,-1/5)}var e7t=class{constructor(e,t,n,r,a,i){Me(this,"getArea");Me(this,"getLine");Me(this,"maxDensity");Me(this,"primaryGrouping");Me(this,"secondaryGrouping");Me(this,"key");Me(this,"boundsY");Me(this,"quartiles");if(e.length===0)throw Error("Unable to calculate violin on empty data");if(r!=="auto"&&r<1)throw Error(`Unable to calculate violin with ${r} steps`);this.primaryGrouping=a===null?"":String(a),this.secondaryGrouping=i===null?"":String(i),this.key=`violin_${this.primaryGrouping}_${this.secondaryGrouping}`;let o=I=>t==="log"?Math.log10(I):I,s=I=>t==="log"?Math.pow(10,I):I,c=e.filter(I=>t==="log"&&Number(I)===0?(console.warn("Value = 0 on chart with log scale, it was removed from calculation"),!1):!0).map(o).sort((I,$)=>I-$),f=c[0],A=c[c.length-1],h=A-f,m=Dp(c,.25),g=Dp(c,.5),b=Dp(c,.75);this.quartiles={q1:s(m),q2:s(g),q3:s(b)};let C=q5t(c,m,b),x=r!=="auto"?r:C/3>h/vK?vK:h/(C/3),k=n?f:f-3*C,_=n?A:A+3*C,D=Da().domain([k,_]).ticks(x);this.boundsY={min:s(D[0]),max:s(D[D.length-1])};let O=X5t(K5t(C),D)(c).map(([I,$])=>[s(I),$]);this.maxDensity=Ih(O,([,I])=>I),this.getArea=(I,$,Q,ee)=>{let K=I==="vertical",re=ee??this.maxDensity,U=Da().domain([-re,re]).range([-Q/2,Q/2]);return K?VB().curve(A3).x0(G=>U(G[1])).x1(G=>U(-G[1])).y(G=>$(G[0]))(O):VB().curve(A3).y0(G=>U(G[1])).y1(G=>U(-G[1])).x(G=>$(G[0]))(O)},this.getLine=(I,$,Q,ee)=>{let K=I==="vertical",re=ee??this.maxDensity,U=Da().domain([-re,re]).range([-Q/2,Q/2]);return d3().curve(A3).x(K?G=>U(G[1]):G=>$(G[0])).y(K?G=>$(G[0]):G=>U(G[1]))(O)+" "+d3().curve(A3).x(K?G=>U(-G[1]):G=>$(G[0])).y(K?G=>$(G[0]):G=>U(-G[1]))(O)}}};function t7t(e,t,n,r,a,i,o){let s=0,c=1/0,f=-1/0;return{type:"violin",geoms:t.reduce((A,h)=>{let m=h.join("_");return A[m]=[],n.forEach(g=>{r.forEach(b=>{let C=a.getColumnByGrouping([...h,g,b],i.value);if(!C.length)return;let x=new e7t(C,o.scale,e.stat.trim,e.stat.stepsCount,g,b);x.maxDensity>s&&(s=x.maxDensity),x.boundsY.min<c&&(c=x.boundsY.min),x.boundsY.max>f&&(f=x.boundsY.max),A[m].push(x)})}),A},{}),meta:{maxDensity:s,minY:c,maxY:f},aes:e.aes}}var n7t=30;function r7t(e,t){return function(n){return t.map(function(r){return tu(n,a=>e(r-a))})}}function a7t(e){return function(t){return 1/Math.sqrt(2*Math.PI)*Math.pow(Math.E,-.5*Math.pow(t/e,2))}}function i7t(e){let t=tu(e);return tu(e.map(n=>Math.pow(n-t,2)))}function o7t(e){return Math.sqrt(i7t(e))}function l7t(e){let t=Dp(e,.25),n=(Dp(e,.75)-t)/1.34,r=o7t(e);return 1.06*Math.min(r,n)*Math.pow(e.length,-1/5)}var s7t=class{constructor(e,t,n,r,a,i){Me(this,"key");Me(this,"maxDensity");Me(this,"primaryGrouping");Me(this,"secondaryGrouping");Me(this,"points");Me(this,"boundsY");let o=n7t;if(e.length===0)throw Error("Unable to calculate sina on empty data");this.primaryGrouping=r===null?"":String(r),this.secondaryGrouping=a===null?"":String(a),this.key=`sina_${this.primaryGrouping}_${this.secondaryGrouping}`;let s=D=>n==="log"?Math.log10(D):D,c=D=>n==="log"?Math.pow(10,D):D,f=D=>Number(D[t.value]),A=e.filter(D=>n==="log"&&f(D)===0?(console.warn("Value = 0 on chart with log scale, it was removed from calculation"),!1):!0).sort((D,O)=>s(f(D))-s(f(O))),h=A.map(D=>s(f(D))),m=h[0],g=h[A.length-1],b=(g-m)/o,C=l7t(h),x=Ir.range(m+b,g,b);this.boundsY={min:c(m),max:c(g)};let k=r7t(a7t(C),x)(h),_=Da().domain(x).range(k).clamp(!0);this.maxDensity=Ih(k),this.points=A.map((D,O)=>({x:f(D),y:_(s(f(D)))/this.maxDensity,id:String(O),jitter:i(),data:D}))}};function u7t(e,t,n,r,a,i,o){let s=0,c=1/0,f=-1/0,A=nF(1);return{type:"sina",geoms:t.reduce((h,m)=>{let g=m.join("_");return h[g]=[],n.forEach(b=>{r.forEach(C=>{let x=a.getRowsByGrouping([...m,b,C]);if(!x.length)return;let k=x;if(!e.aes.showOutliers){let D=$=>Number($[i.value]),[O,I]=A2(x,o.scale,D);k=x.filter($=>{let Q=D($);return Q>=O&&Q<=I})}let _=new s7t(k,i,o.scale,b,C,A);_.maxDensity>s&&(s=_.maxDensity),_.boundsY.min<c&&(c=_.boundsY.min),_.boundsY.max>f&&(f=_.boundsY.max),h[g].push(_)})}),h},{}),meta:{maxDensity:s,minY:c,maxY:f},aes:e.aes}}function c7t(e,t,n,r,a,i,o,s){let c=1/0,f=-1/0,A=nF(1);return{type:"dot",geoms:t.reduce((h,m)=>{let g=m.join("_");return h[g]=[],n.forEach(b=>{r.forEach(C=>{let x=a.getRowsByGrouping([...m,b,C]);if(!x.length)return;let k=I=>Number(I[i.value]),_=x.map((I,$)=>({y:k(I),jitter:A(),id:String(s?I[s.value]:$),data:I}));if(!e.aes.showOutliers){let[I,$]=A2(x,o.scale,k);_=_.filter(({y:Q})=>Q>=I&&Q<=$)}let[D=1/0,O=-1/0]=$A(_,I=>I.y);D<c&&(c=D),O>f&&(f=O),h[g].push({key:`dots_${b}_${C}`,values:_,primaryGrouping:b,secondaryGrouping:C,boundsY:{min:D,max:O}})})}),h},{}),meta:{minY:c,maxY:f},aes:e.aes}}function f7t(e,t){if(t==="median")return mL(e,.5);if(t==="mean")return tu(e);vA(t,`Unknown line points calculation for dot layer: ${t}`)}function d7t(e,t,n,r,a,i,o){let s=1/0,c=-1/0;return{type:"line",geoms:t.reduce((f,A)=>{let h=A.join("_");f[h]=[];let m=-1/0,g=1/0;return e.aes.showOutliers||([m,g]=A2(a.getColumnByGrouping([...A],i.value),o.scale)),r.forEach(b=>{let C={key:`${b}`,boundsY:{min:1/0,max:-1/0},dots:{}},x=!1,k=D=>o.scale==="log"?Math.log10(D):D,_=D=>o.scale==="log"?Math.pow(10,D):D;n.forEach(D=>{let O=a.getColumnByGrouping([...A,D,b],i.value);if(!O.length){x=!0;return}let I=O;if(e.aes.showOutliers||(I=O.filter(Q=>Q>=m&&Q<=g)),!I.length){x=!0;return}let $=_(f7t(I.map(k),e.pointsValues));C.dots[D]=$,$<s&&(s=$),$>c&&(c=$),$<C.boundsY.min&&(C.boundsY.min=$),$>C.boundsY.max&&(C.boundsY.max=$)}),x||f[h].push(C)}),f},{}),meta:{minY:s,maxY:c},aes:e.aes}}function A7t(e){let t=tu(e);return tu(e.map(n=>Math.pow(n-t,2)))}function _P(e){return Math.sqrt(A7t(e))}function p7t(e){return _P(e)/Math.sqrt(e.length)}function h7t(e){return 1.96*_P(e)}function m7t(e,t){if(t==="median")return mL(e,.5);if(t==="mean")return tu(e);vA(t,"Unknown points calculation")}function v7t(e,t){if(t==="sd")return _P(e);if(t==="se")return p7t(e);if(t==="ci")return h7t(e);vA(t,"Unknown error interval calculation")}function g7t(e,t,n,r,a,i,o){let s=1/0,c=-1/0;return{type:"errorbar",geoms:t.reduce((f,A)=>{let h=A.join("_");f[h]=[];let m=b=>o.scale==="log"?Math.log10(b):b,g=b=>o.scale==="log"?Math.pow(10,b):b;return n.forEach(b=>{r.forEach(C=>{let x=a.getColumnByGrouping([...A,b,C],i.value);if(!x.length)return;let k=x.map(m),_=g(m7t(k,e.pointsValues)),D=g(v7t(k,e.interval)),O=_-D,I=_+D;O<s&&(s=O),I>c&&(c=I),f[h].push({key:`errorbar_${b}_${C}`,primaryGrouping:b,secondaryGrouping:C,value:_,min:O,max:I,boundsY:{min:O,max:I}})})}),f},{}),meta:{minY:s,maxY:c},aes:e.aes}}function y7t(e,t,n,r){if(e.length===0)throw Error("Unable to create bar on empty data");let a=s=>t==="log"?Math.log10(s):s,i=s=>t==="log"?Math.pow(10,s):s,o=s=>{let c=Number(s[n]);if(t==="log"&&c<1)throw Error(`Value < 1 in log scale: ${c}`);return c};switch(r){case"max":return Ih(e,o)??o(e[0]);case"min":return mC(e,o)??o(e[0]);case"median":{let s=e.map(c=>Number(c[n])).map(a).sort((c,f)=>c-f);return i(Dp(s,.5))}case"mean":return tu(e,o)??o(e[0]);default:vA(r,`Unknown bar height function ${r}`)}}function w7t(e,t,n,r,a,i,o){let s=-1/0,c=1/0;return{type:"bar",geoms:t.reduce((f,A)=>{let h=A.join("_");return f[h]=[],n.forEach(m=>{r.forEach(g=>{let b=a.getRowsByGrouping([...A,m,g]);if(!b.length)return;let C=y7t(b,o.scale,i.value,e.height);s=Math.max(s,C,0),c=Math.min(c,C,0),f[h].push({key:`bar_${m}_${g}`,value:C,primaryGrouping:m,secondaryGrouping:g,boundsY:{min:Math.min(0,C),max:Math.max(0,C)}})})}),f},{}),meta:{minY:c,maxY:s},aes:e.aes}}function C7t(e,t,n,r,a,i){let o=-1/0,s=1/0;return{type:"stackedBar",geoms:t.reduce((c,f)=>{let A=f.join("_");return c[A]=[],n.forEach(h=>{let m=0,g={};r.forEach(x=>{let k=a.getRowsByGrouping([...f,h,x]);if(!k.length)return;let _=Sc(k,D=>Number(D[i.value]));g[x]={height:_,key:x},m+=_});let b=m;e.normalize&&r.forEach(x=>{g[x]&&(g[x].height=g[x].height/b*100)}),o=Math.max(o,0,m),s=Math.min(s,0,m);let C=e.normalize?100:b;c[A].push({key:`stackedBar_${h}`,valuesMap:g,primaryGrouping:h,boundsY:{min:Math.min(C,0),max:Math.max(C,0)}})}),c},{}),meta:{minY:e.normalize?0:s,maxY:e.normalize?100:o,normalize:e.normalize},aes:e.aes}}var gK=30;function b7t(e,t,n,r,a,i){let o=e.map(m=>n(a(m))),s=e.length,c=e.map(A),f=[];function A(m,g){return{key:i(m,g),value:a(m)}}let h=0;for(let m=1;m<s;++m){let g=o[h],b=o[m],C=o[m-1];if(b>=g+t){let x=Math.min((g+C)/2,b-t);o.fill(x,h,m),f.push({x:r(x),count:m-h,dots:c.slice(h,m)}),h=m}}return o.fill((o[h]+o[s-1])/2,h,s),f.push({x:r((o[h]+o[s-1])/2),count:s-h,dots:c.slice(h,s)}),f}var E7t=class{constructor(e,t,n,r,a,i,o,s,c,f){Me(this,"bins");Me(this,"primaryGrouping");Me(this,"secondaryGrouping");Me(this,"key");Me(this,"boundsY");this.primaryGrouping=n===null?"":String(n),this.secondaryGrouping=r===null?"":String(r),this.key=`binnedDots_${this.primaryGrouping}_${this.secondaryGrouping}`;let A=e.filter(h=>s(h)===0&&c==="log"?(console.warn(`Item with ${t} = 0 is not shown on chart with log scale`),!1):!0).sort((h,m)=>i(s(h))-i(s(m)));this.bins=b7t(A,a,i,o,s,(h,m)=>String(f?h[f.value]:m)),this.boundsY={min:this.bins[0].x,max:this.bins[this.bins.length-1].x}}};function x7t(e,t,n,r,a,i,o){let s=x=>o.scale==="log"?Math.log10(x):x,c=x=>o.scale==="log"?Math.pow(10,x):x,f=x=>Number(x[i.value]),A=1/0,h=-1/0,m=a.getRowsByGrouping([]),[g=f(m[0]),b=f(m[0])]=$A(m.filter(x=>Number(x[i.value])===0&&o.scale==="log"?(console.warn(`Item with ${i.value} = 0 is not shown on chart with log scale`),!1):!0),x=>Number(x[i.value])),C=Math.abs(s(g)-s(b))/gK;return{type:"binnedDots",geoms:t.reduce((x,k)=>{let _=k.join("_");return x[_]=[],n.forEach(D=>{r.forEach(O=>{let I=a.getRowsByGrouping([...k,D,O]);if(!I.length)return;let $=I;if(!e.aes.showOutliers){let[ee,K]=A2(I,o.scale,f);$=I.filter(re=>{let U=f(re);return U>=ee&&U<=K})}let Q=new E7t($,i.value,D,O,C,s,c,f,o.scale,e.keyColumn);Q.boundsY.min<A&&(A=Q.boundsY.min),Q.boundsY.max>h&&(h=Q.boundsY.max),x[_].push(Q)})}),x},{}),meta:{minY:Math.min(g,b,A),maxY:Math.max(g,b,h),binsCount:gK,hasKeyFromColumn:e.keyColumn!==null},aes:e.aes}}function S7t(e,t){if(t.length===2)return"secondary";if(e.length===2&&t.length<2)return"primary";throw Error("Too many groups for paired points layer")}function yK(e,t,n,r,a,i,o,s,c){let f=Ir.groupBy(n,D=>D[a.value]),A=Ir.groupBy(r,D=>D[a.value]),h=Object.keys(f),m=Object.keys(A);if(Ir.uniq(h).length!==h.length||Ir.uniq(m).length!==m.length)throw Error(`Non unique keys in groups ${e}, ${t} for paired points layer`);if(h.length!==m.length||Ir.intersection(h,m).length!==h.length)throw Error(`Keys in groups ${e}, ${t} not match for paired points layer`);let g=D=>Number(D[i.value]),b=1/0,C=-1/0,x=!1,k=c==="log",_=h.map(D=>{let O=f[D][0],I=A[D][0],$=g(O),Q=g(I);return($===0||Q===0)&&(x=!0),b=Math.min(b,k&&$===0?1/0:$,k&&Q===0?1/0:Q),C=Math.max(C,k&&$===0?-1/0:$,k&&Q===0?-1/0:Q),{id:D,key1:{id:`${D}_${e}`,value:$,data:O},key2:{id:`${D}_${t}`,value:Q,data:I}}});if(!s){b=1/0,C=-1/0;let[D,O]=A2(n,c,g),[I,$]=A2(r,c,g);_=_.filter(({key1:Q,key2:ee})=>Q.value<D||Q.value>O||ee.value<I||ee.value>$?!1:(b=Math.min(b,k&&Q.value===0?1/0:Q.value,k&&ee.value===0?1/0:ee.value),C=Math.max(C,k&&Q.value===0?-1/0:Q.value,k&&ee.value===0?-1/0:ee.value),!0))}return b=x?b/10:b,C=Math.max(C,b),{id:`${e}_${t}`,key1:e,key2:t,pairs:_.map(D=>({...D,key1:{...D.key1,value:D.key1.value===0?b:D.key1.value},key2:{...D.key2,value:D.key2.value===0?b:D.key2.value}})),grouping:o,boundsY:{min:b,max:C}}}function B7t(e,t,n,r,a,i,o){let s=S7t(n,r),c=1/0,f=-1/0;return{type:"pairedPoints",geoms:t.reduce((A,h)=>{let m=h.join("_");if(A[m]=[],s==="primary"){let[g,b]=n,C=a.getRowsByGrouping([...h,g]),x=a.getRowsByGrouping([...h,b]),k=yK(g,b,C,x,e.linkColumn,i,s,e.aes.showOutliers,o.scale);c=Math.min(c,k.boundsY.min),f=Math.max(f,k.boundsY.max),A[m].push(k)}else s==="secondary"&&n.forEach(g=>{let[b,C]=r,x=a.getRowsByGrouping([...h,g,b]),k=a.getRowsByGrouping([...h,g,C]),_=yK(b,C,x,k,e.linkColumn,i,s,e.aes.showOutliers,o.scale);c=Math.min(c,_.boundsY.min),f=Math.max(f,_.boundsY.max),A[m].push(_)});return A},{}),meta:{minY:c,maxY:f},aes:e.aes}}function wK(e,t){let n;if(e==t){n=new Array(t+1);for(let r=0;r<n.length;++r)n[r]=r+1}else if(e<t){n=new Array(t-e+1);for(let r=0;r<n.length;++r)n[r]=e+r}else{n=new Array(e-t+1);for(let r=0;r<n.length;++r)n[r]=e-r}return n}function p2(e,t){return Ir.orderBy(e.map((n,r)=>[n,r]),([n])=>n,[t?"desc":"asc"]).map(([,n])=>n)}function k7t(e){if(e.length<1)throw new Error("cummin requires at least one element");let t=new Array(e.length),n=e[0];for(let r=0;r<e.length;++r)e[r]<n&&(n=e[r]),t[r]=n;return t}function T7t(e){if(e.length<1)throw new Error("cummax requires at least one element");let t=new Array(e.length),n=e[0];for(let r=0;r<e.length;++r)e[r]>n&&(n=e[r]),t[r]=n;return t}function CK(e,t){if(e.length<1)throw new Error("pmin requires at least one element");return e.map(n=>Math.min(n,t))}function _7t(e){if(e.length<1)throw new Error("pAdjust requires at least one element");return Math.min(...e)}function P7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=new Array(t);for(let r=0;r<t;++r){let a=e[r]*t;if(a>=1)n[r]=1;else if(0<=a)n[r]=a;else throw new Error(`${a} is outside [0, 1)`)}return n}function M7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=p2(e,!1),r=n.slice(),a=new Array(t).fill(0);for(let f=0;f<t;++f)a[f]=(t-f)*e[n[f]];let i=p2(r,!1),o=T7t(a),s=CK(o,1),c=new Array(t);for(let f=0;f<t;++f)c[f]=s[i[f]];return c}function D7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=wK(t,t),r=p2(e,!1),a=new Array(t);for(let h=0;h<t;++h)a[h]=e[r[h]];let i=r.slice(),o=p2(i,!1),s=new Array(t),c=new Array(t),f=new Array(t);for(let h=0;h<t;++h)f[h]=a[h]*t/n[h];let A=_7t(f);s.fill(A),c.fill(A);for(let h=t;h>=2;--h){let m=wK(1,t-h+1);for(let x=0;x<t-h+1;++x)m[x]--;let g=h-1,b=new Array(g);for(let x=0;x<g;++x)b[x]=t-h+2+x-1;let C=h*a[b[0]]/2;for(let x=1;x<g;++x){let k=a[b[x]]*h/(2+x);k<C&&(C=k)}for(let x=0;x<t-h+1;++x)s[m[x]]=Math.min(a[m[x]]*h,C);for(let x=0;x<g;++x)s[b[x]]=s[t-h];for(let x=0;x<t;++x)c[x]<s[x]&&(c[x]=s[x])}for(let h=0;h<t;++h)s[h]=c[o[h]];return s}var H7t=class{constructor(e,t,n){this.ni=e,this.o=t,this.ro=n}result(e){let t=k7t(e),n=CK(t,1),r=new Array(e.length);for(let a=0;a<e.length;++a)r[a]=n[this.ro[a]];return r}};function PP(e){let t=e.length,n=new Array(t),r=p2(e,!0);for(let i=0;i<t;++i){if(e[i]<0||e[i]>1)throw new Error("array["+i+"] = "+e[i]+" is outside [0, 1]");n[i]=t/(t-i)}let a=p2(r,!1);return new H7t(n,r,a)}function I7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=PP(e),r=new Array(t);for(let a=0;a<t;++a)r[a]=n.ni[a]*e[n.o[a]];return n.result(r)}function L7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=PP(e),r=new Array(t),a=0;for(let i=1;i<t+1;++i)a+=1/i;for(let i=0;i<t;++i)r[i]=a*n.ni[i]*e[n.o[i]];return n.result(r)}function R7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=PP(e),r=new Array(t);for(let a=0;a<t;++a)r[a]=(a+1)*e[n.o[a]];return n.result(r)}function bK(e,t){switch(t){case"BenjaminiHochberg":return I7t(e);case"BenjaminiYekutieli":return L7t(e);case"Bonferroni":return P7t(e);case"Hochberg":return R7t(e);case"Holm":return M7t(e);case"Hommel":return D7t(e);case null:return e;default:throw new Error(`Unknown p-value correction method: ${t}`)}}function N7t(e){let t=Math.abs(e),n=1/(1+t/2),r=n*Math.exp(-t*t-1.26551223+n*(1.00002368+n*(.37409196+n*(.09678418+n*(-.18628806+n*(.27886807+n*(-1.13520398+n*(1.48851587+n*(-.82215223+n*.17087277)))))))));return e>=0?r:2-r}function $7t(e){return .5*N7t(-e/Math.sqrt(2))}var F7t=class{constructor(e,t){this.value=e,this.position=t}getValue(){return this.value}getPosition(){return this.position}};function V7t(e){let t=new Array(e.length);for(let o=0;o<e.length;o++)t[o]=new F7t(e[o],o);let n=Q7t(t);t.sort((o,s)=>o.getValue()-s.getValue());let r=new Array(t.length),a=1;r[t[0].getPosition()]=a;let i=[];i.push(t[0].getPosition());for(let o=1;o<t.length;o++)t[o].getValue()>t[o-1].getValue()&&(a=o+1,i.length>1&&EK(r,i),i=[]),i.push(t[o].getPosition()),r[t[o].getPosition()]=a;return i.length>1&&EK(r,i),O7t(r,n),r}function EK(e,t){let n=(2*e[t[0]]+t.length-1)/2;t.forEach(r=>{e[r]=n})}function O7t(e,t){t.forEach(n=>{e[n]=NaN})}function Q7t(e){let t=[];for(let n=0;n<e.length;n++)isNaN(e[n].getValue())&&t.push(n);return t}var z7t=class{constructor(){Me(this,"SMALL_SAMPLE_SIZE",50)}mannWhitneyU(e,t){let n=[...e,...t],r=V7t(n),a=0;for(let s=0;s<e.length;s++)a+=r[s];let i=a-e.length*(e.length+1)/2,o=e.length*t.length-i;return Math.min(i,o)}mannWhitneyUTest(e,t,n){if(typeof n>"u")return e.length+t.length<=this.SMALL_SAMPLE_SIZE&&Object.keys(this.tiesMap(e,t)).length===0?this.mannWhitneyUTest(e,t,!0):this.mannWhitneyUTest(e,t,!1);let r=this.tiesMap(e,t),a=this.mannWhitneyU(e,t);if(n){if(Object.keys(r).length!==0)throw new Error;return this.exactP(e.length,t.length,a)}return this.approximateP(a,e.length,t.length,this.varU(e.length,t.length,r))}approximateP(e,t,n,r){let a=t*n/2;if(a==e)return 1;let i=-Math.abs(e-a+.5)/Math.sqrt(r);return 2*$7t(i)}exactP(e,t,n){let r=t*e;if(n>r)return 1;let a=n<r/2?n:r/2-n,i=0,o=0;for(;o<=a;)i+=this.uDensity(e,t,o),o++;return 2*i}uDensity(e,t,n){if(n<0||n>t*e)return 0;let r=this.uFrequencies(e,t);return r[Math.round(n+1)]/Ir.sum(r)}uFrequencies(e,t){let n=Math.max(t,e);if(n>100)throw Error("n or m > 100");let r=Math.min(t,e),a=new Array(e*t+2),i=new Array(e*t+2);for(let s=1;s<a.length;s++)a[s]=s<=n+1?1:0;i[1]=0;let o=n;for(let s=2;s<=r;s++){i[s]=0,o=o+n;let c=o+2,f=1+o/2,A=s;for(let h=1;h<=f;h++){A++,c=c-1;let m=a[h]+i[h];a[h]=m,i[A]=m-a[c],a[c]=m}}return a}varU(e,t,n){let r=e*t;if(Object.keys(n).length===0)return r*(e+t+1)/12;let a=Ir.sum(Object.values(n).map(o=>o*o*o-o)),i=e+t;return r/12*(i+1-a/(i*(i-1)))}tiesMap(e,t){let n={};for(let r=0;r<e.length;r++)n[e[r]]=n[e[r]]?n[e[r]]+1:1;for(let r=0;r<t.length;r++)n[t[r]]=n[t[r]]?n[t[r]]+1:1;for(let r in n)n[r]===1&&delete n[r];return n}};function MP(e,t,n){switch(t){case"ttest":{if(e.length>2)throw new Error("more than 2 datasets passed");if(n){if(e[0].length!==e[1].length)throw Error("Different size groups in paired test");return Aot(e[0],e[1]).pValue}let r=Mot(e[0],e[1]).pValue;return isNaN(r)?1:r}case"anova":{let r=gje(Ir.flatten(e),Ir.flatten(e.map((a,i)=>a.map(()=>String(i))))).pValue;return isNaN(r)?1:r}case"wilcoxon":{if(e.length>2)throw new Error("more than 2 datasets passed");if(n){if(e[0].length!==e[1].length)throw Error("Different size groups in paired test");return Pft(e[0],e[1]).pValue}let r=new z7t().mannWhitneyUTest(e[0],e[1]);return isNaN(r)?1:r}case"kruskalWallis":{let r=qut(...e).pValue;return isNaN(r)?1:r}default:throw new Error("Unknown test method")}}function U7t(e){return e.slice(0,-1).reduce((t,n,r)=>t.concat(e.slice(r+1).map(a=>[n,a])),[])}function j7t(e,t,n,r,a){return{type:"stats",values:t.reduce((i,o)=>{let s=[];switch(e.statType){case"overall":{let c=n.map(A=>a.getColumnByGrouping([...o,A],r.value)).filter(A=>A.length>0);if(c.length<2)break;let f=MP(c,e.testMethod,e.paired);s=[[["overall"],f]];break}case"referenceGroup":{let c=e.referenceGroup===null?null:String(e.referenceGroup);if(c!==null&&!n.includes(c))throw new Error(`Reference group ${c} for ${e.testMethod} test is not in available groups`);let f=a.getColumnByGrouping([...o,c],r.value);if(f.length===0){s=[];break}let A=n.filter(m=>m!==c).map(m=>[m,a.getColumnByGrouping([...o,m],r.value)]).filter(([,m])=>m.length>0);if(A.length<2&&e.correctionMethod!==null)break;let h=bK(A.map(([,m])=>MP([f,m],e.testMethod,e.paired)),e.correctionMethod);s=A.map(([m],g)=>[[m],h[g]]);break}case"pairwise":{let c=U7t(n).map(([A,h])=>[[A,h],[a.getColumnByGrouping([...o,A],r.value),a.getColumnByGrouping([...o,h],r.value)]]).filter(([,[A,h]])=>A.length&&h.length);if(c.length<1)break;let f=bK(c.map(([,A])=>MP(A,e.testMethod,e.paired)),e.correctionMethod);s=c.map(([A],h)=>[A,f[h]]);break}default:throw new Error("Unknown statType")}return i[o.join("_")]=s,i},{}),meta:{statType:e.statType,testMethod:e.testMethod,format:e.format,ns:e.ns,significanceLevels:e.significanceLevels}}}var C9="#3e9838",h2="21",m2=3,np=class{},xK=class extends np{constructor(t){super();Me(this,"type","box");Me(this,"stat",{upper:.75,medium:.5,lower:.25,k:1.5});Me(this,"aes",{showOutliers:!0,boxWidth:"auto",dotShape:h2,dotFill:Zt,dotSize:m2,lineColor:Zt,fillColor:C9,lineWidth:1,lineShape:"solid",opacity:1});this.stat={...this.stat,...t.stat},this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="box"&&Object.keys(this.stat).every(n=>this.stat[n]===t.stat[n])}},SK=class extends np{constructor(t){super();Me(this,"type","violin");Me(this,"stat",{bandwidth:"auto",stepsCount:40,trim:!0});Me(this,"aes",{width:"auto",lineColor:Zt,fillColor:C9,lineWidth:1,lineShape:"solid",opacity:1,showQuartiles:!0,medianLineStyle:"solid",quartilesLineStyle:"dashed"});this.stat={...this.stat,...t.stat},this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="violin"&&(this.stat.bandwidth!==t.stat.bandwidth||this.stat.trim!==t.stat.trim||this.stat.stepsCount!==t.stat.stepsCount)}},BK=class extends np{constructor(t){super();Me(this,"type","dot");Me(this,"aes",{showOutliers:!0,jitter:.8,lineColor:"none",dotFill:Zt,dotShape:h2,dotSize:m2,opacity:1});this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="dot"&&this.aes.showOutliers===t.aes.showOutliers}},kK=class extends np{constructor(t){super();Me(this,"type","line");Me(this,"pointsValues");Me(this,"aes",{showOutliers:!0,lineWidth:1,lineShape:"solid",fillColor:"none",lineColor:Zt,dotShape:h2,dotSize:m2,opacity:1});this.pointsValues=t.pointsValues,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="line"&&this.pointsValues===t.pointsValues}},TK=class extends np{constructor(t){super();Me(this,"type","errorbar");Me(this,"pointsValues");Me(this,"interval");Me(this,"aes",{showDots:!0,width:"auto",lineWidth:1,fillColor:"none",lineColor:Zt,dotShape:h2,dotSize:m2,opacity:1});this.pointsValues=t.pointsValues,this.interval=t.interval,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="errorbar"&&this.pointsValues===t.pointsValues&&this.interval===t.interval}},_K=class extends np{constructor(t){super();Me(this,"type","bar");Me(this,"height");Me(this,"aes",{width:"auto",lineWidth:1,fillColor:"none",lineColor:Zt,opacity:1});this.height=t.height??"max",this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="bar"&&this.height===t.height}},PK=class extends np{constructor(t){super();Me(this,"type","stackedBar");Me(this,"normalize",!1);Me(this,"aes",{width:"auto",lineWidth:1,fillColor:C9,lineColor:"none",opacity:1});this.normalize=t.normalize??!1,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="stackedBar"&&t.normalize===this.normalize}},MK=class extends np{constructor(t){super();Me(this,"type","logo");Me(this,"normalize",!1);Me(this,"aes",{width:"auto",fillColor:C9,lineColor:"none",opacity:1});this.normalize=t.normalize??!1,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="logo"&&t.normalize===this.normalize}},DK=class extends np{constructor(t){super();Me(this,"type","binnedDots");Me(this,"method");Me(this,"position");Me(this,"keyColumn");Me(this,"aes",{showOutliers:!0,width:"auto",lineWidth:1,fillColor:"none",lineColor:Zt,opacity:1});this.method=t.method??"dotdensity",this.position=t.position??"stack",this.keyColumn=t.keyColumn??null,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){var n,r;return t.type==="binnedDots"&&this.method===t.method&&this.position===t.position&&((n=this.keyColumn)==null?void 0:n.value)===((r=t.keyColumn)==null?void 0:r.value)}},HK=class extends np{constructor(t){super();Me(this,"type","pairedPoints");Me(this,"linkColumn");Me(this,"aes",{showOutliers:!0,lineWidth:1,lineColor:Zt,lineShape:"solid",dotFill:Zt,dotSize:m2,dotShape:h2,opacity:1});this.linkColumn=t.linkColumn,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="pairedPoints"&&this.aes.showOutliers===t.aes.showOutliers&&this.linkColumn.value===t.linkColumn.value}},IK=class extends np{constructor(t){super();Me(this,"type","sina");Me(this,"aes",{showOutliers:!0,width:"auto",dotFill:C9,dotSize:m2,dotShape:h2,opacity:1});this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="sina"&&this.aes.showOutliers===t.aes.showOutliers}},W8=class extends np{constructor(t){var n,r,a;super();Me(this,"type","stat");Me(this,"statType");Me(this,"testMethod");Me(this,"paired");Me(this,"ns");Me(this,"format");Me(this,"referenceGroup",null);Me(this,"correctionMethod",null);Me(this,"significanceLevels");this.statType=t.statType,this.testMethod=t.testMethod,this.paired=t.paired??!1,this.ns=t.ns??!0,this.format=t.format??"pValue",this.statType==="referenceGroup"&&(this.referenceGroup=t.referenceGroup??null),(this.statType==="referenceGroup"||this.statType==="pairwise")&&(this.correctionMethod=t.correctionMethod??null),this.significanceLevels={one:((n=t.significanceLevels)==null?void 0:n.one)??.05,two:((r=t.significanceLevels)==null?void 0:r.two)??.01,three:((a=t.significanceLevels)==null?void 0:a.three)??.001}}isEqualForCalculation(t){return t.type==="stat"&&Object.keys(this).every(n=>this[n]===t[n])}},LK=class{constructor(e){Me(this,"id");Me(this,"type","discrete");Me(this,"y");Me(this,"keyColumn");Me(this,"primaryGrouping");Me(this,"secondaryGrouping");Me(this,"facetSettings");Me(this,"facetBy");Me(this,"chartSettings");Me(this,"layers");var t,n,r,a,i,o,s,c;U3t.parse(e),this.id=Ir.uniqueId("settings"),this.y=e.y,this.keyColumn=e.keyColumn??null,this.primaryGrouping=e.primaryGrouping??null,this.secondaryGrouping=e.secondaryGrouping??null,this.facetSettings={sharedX:!0,sharedY:!0,titlePosition:"left",...e.facetSettings},this.facetBy=e.facetBy??[],this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(this.facetBy.length?400:600),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(this.facetBy.length?250:350)},title:{position:"center",show:!0,...e.title,name:((r=e.title)==null?void 0:r.name)??"Chart"},orientation:e.orientation??"vertical",yAxis:{title:((a=e.y)==null?void 0:a.label)??e.y.value??"",scale:"linear",showGrid:!0,showTicks:!0,...e.yAxis},xAxis:{title:((o=(i=e.primaryGrouping)==null?void 0:i.columnName)==null?void 0:o.label)??((s=e.primaryGrouping)==null?void 0:s.columnName.value)??"",showGrid:!0,showTicks:!0,linesBetweenCategories:!0,labelsPosition:"center",...e.xAxis},frame:{type:((c=e.frame)==null?void 0:c.type)??"full"},legend:{show:!0,position:"right",...e.legend},tooltips:{box:{show:!0},violin:{show:!0},boxOutliers:{show:!0},line:{show:!0},errorBar:{show:!0},dot:{show:!0},binnedDots:{show:!0},pairedPoints:{show:!0},stackedBar:{show:!0},...e.tooltips}},this.layers=e.layers.map(f=>{if(f.type==="box")return new xK(f);if(f.type==="violin")return new SK(f);if(f.type==="dot")return new BK(f);if(f.type==="line")return new kK(f);if(f.type==="errorbar")return new TK(f);if(f.type==="bar")return new _K(f);if(f.type==="stackedBar")return new PK(f);if(f.type==="stat")return new W8(f);if(f.type==="binnedDots")return new DK(f);if(f.type==="pairedPoints")return new HK(f);if(f.type==="sina")return new IK(f);if(f.type==="logo")return new MK(f);vA(f,"Unknown layer type")}).filter(Boolean)}};function RK(e,t=null,n=null){let r=(t==null?void 0:t.value)??null,a=r===null?["null"]:e.getColumnCategories(r);return Ir.intersection(n??a,a).map(String)}function NK(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}function X8(e,t){if(!t)return{keys:["null"],value:null,label:"",valueLabels:{null:""},inheritedAes:null};let n=t.columnName.value,r=Ir.uniqBy(e.rows,c=>c[n]),a=c=>String(c[n]),i=c=>t.columnName.valueLabels?String(c[t.columnName.valueLabels]):a(c),o=r.map(a),s=(t.order??o).map(String);return{keys:Ir.intersection(s,o),value:n,label:t.columnName.label??n,valueLabels:r.reduce((c,f)=>(c[a(f)]=i(f),c),{}),inheritedAes:t.inheritedAes??null}}var G7t=class extends Sg{constructor(t,n){super(t,n);Me(this,"settings");Me(this,"chartRenderer",new j5t);Me(this,"calculatedData",null);this.settings=new LK(n)}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new LK(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){console.warn("no chart state for discrete")}export(){return this._updateChart(),f3(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o;return t.chartSettings.yAxis.scale!==n.chartSettings.yAxis.scale||(((r=t.primaryGrouping)==null?void 0:r.columnName.value)??"")!==(((a=n.primaryGrouping)==null?void 0:a.columnName.value)??"")||(((i=t.secondaryGrouping)==null?void 0:i.columnName.value)??"")!==(((o=n.secondaryGrouping)==null?void 0:o.columnName.value)??"")||t.facetBy.some((s,c)=>{var f;return s.value!==((f=n.facetBy[c])==null?void 0:f.value)})||t.layers.length!==n.layers.length||t.layers.some((s,c)=>!s.isEqualForCalculation(n.layers[c]))}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{chartSettings:t,y:n,keyColumn:r,facetBy:a,layers:i,facetSettings:o}=this.settings,{yAxis:s}=t,c=this.data.rows.every(x=>{let k=x[n.value];return k===null||!(Number(k)<0)}),f=X8(this.data,this.settings.primaryGrouping),A=X8(this.data,this.settings.secondaryGrouping),h=a.map(x=>x.value)??null,m=a.length?NK(a.map(x=>{var k;return RK(this.data,x,(k=o==null?void 0:o.order)==null?void 0:k[x.value])})):[["null"]];this.data.setGrouping([...h,f.value,A.value]);let g=m.reduce((x,k)=>(x[k.join("_")]=f.keys.filter(_=>this.data.getRowsByGrouping([...k,_]).length>0),x),{}),b=i.filter(x=>!(x instanceof W8)).map(x=>{if(x instanceof xK)return W5t(x,m,f.keys,A.keys,this.data,n,r,s);if(x instanceof SK)return t7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof BK)return c7t(x,m,f.keys,A.keys,this.data,n,s,r);if(x instanceof kK)return d7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof TK)return g7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof _K)return w7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof PK)return C7t(x,m,f.keys,A.keys,this.data,n);if(x instanceof DK)return x7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof HK)return B7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof IK)return u7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof MK)return V2t(x,m,f.keys,A.keys,this.data,n);throw new Error("Unknown layer type")}),C=i.filter(x=>x instanceof W8).map(x=>{if(f.value===null)throw new Error("Cannot calculate p-value without data grouping");return j7t(x,m,f.keys,n,this.data)});this.calculatedData={layersData:b,statsLayersData:C,primaryGrouping:f,secondaryGrouping:A,facetKeyLists:m,nonEmptyGroupsByFacets:g,onlyPositive:c}}_updateAesInData(){if(this.calculatedData===null)return;let{layers:t,facetBy:n,primaryGrouping:r,secondaryGrouping:a,facetSettings:i}=this.settings,o=t.filter(s=>!(s instanceof W8));for(let s=0;s<o.length;s++){let c=o[s];"aes"in c&&(this.calculatedData.layersData[s].aes=c.aes)}this.calculatedData.primaryGrouping=X8(this.data,r),this.calculatedData.secondaryGrouping=X8(this.data,a),this.calculatedData.facetKeyLists=n.length?NK(n.map(s=>{var c;return RK(this.data,s,(c=i==null?void 0:i.order)==null?void 0:c[s.value])})):[["null"]]}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,keyColumn:r,facetSettings:a}=this.settings;this.chartRenderer.render(t,n,this.calculatedData.primaryGrouping,this.calculatedData.secondaryGrouping,a,this.calculatedData.facetKeyLists.map(i=>i.join("_")),this.calculatedData.facetKeyLists,this.calculatedData.layersData,this.calculatedData.statsLayersData,r,this.calculatedData.nonEmptyGroupsByFacets,this.calculatedData.onlyPositive)}};function Y7t(e){let t=cL(e),n=tu(e);return t===void 0||n===void 0||t===0?r=>r:r=>(r-n)/t}function W7t(e){let t=tu(e),[n,r]=$A(e);return t===void 0||n===void 0||r===void 0||r===n?a=>a:a=>(a-t)/(r-n)}function X7t(e,t){return e==="standardScaling"?Y7t(t):e==="meanNormalization"?W7t(t):n=>n}function DP(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}function K7t(e,t,n,r,a,i,o,s,c,f,A,h){let m=a.length?a.map(Y=>e.getColumnCategories(Y.value)):[["null"]],g=i.length?i.map(Y=>e.getColumnCategories(Y.value)):[["null"]],b=o.length?o.map(Y=>e.getColumnCategories(Y.value)):[["null"]],C=DP(m),x=DP(g),k=DP(b),_=C.map(Y=>Y.join("_")),D=x.map(Y=>Y.join("_")),O=k.map(Y=>Y.join("_")),I={meta:{facetKeys:_,xGroupKeys:D,yGroupKeys:O,xKeysByGroups:{},yKeysByGroups:{},xLabels:{},yLabels:{},xGroupLabels:{},yGroupLabels:{},xDataByKeys:{},yDataByKeys:{},facetKeyValues:_.reduce((Y,X,oe)=>(Y[X]=C[oe],Y),{}),xGroupKeyValues:D.reduce((Y,X,oe)=>(Y[X]=x[oe],Y),{}),yGroupKeyValues:O.reduce((Y,X,oe)=>(Y[X]=k[oe],Y),{}),valueExtent:[1/0,-1/0]},facets:{}},$=t.valueLabels??t.value,Q=n.valueLabels??n.value,ee=s.filter(Y=>Y.axis==="x").map(Y=>Y.valueColumn.value),K=s.filter(Y=>Y.axis==="y").map(Y=>Y.valueColumn.value),re=Object.values(c??{}).map(Y=>Y.value),U=Object.values(f??{}).map(Y=>Y.value),G=Ir.uniq([...ee,...re,$]),Z=Ir.uniq([...K,...U,Q]);if(e.rows.forEach(Y=>{let X=a.length?a.map(ze=>Y[ze.value]).join("_"):"null",oe=i.length?i.map(ze=>Y[ze.value]).join("_"):"null",me=o.length?o.map(ze=>Y[ze.value]).join("_"):"null",ae=i.length?i.map(ze=>Y[ze.valueLabels??ze.value]).join(", "):"",ye=o.length?o.map(ze=>Y[ze.valueLabels??ze.value]).join(", "):"";I.meta.xGroupLabels[oe]=ae,I.meta.yGroupLabels[oe]=ye;let Ce=Y[t.value],ce=Y[n.value],ge=Y[r.value]??h;if(!(Ce===null||ce===null||ge===null)){if(I.facets[X]||(I.facets[X]={xKeys:[],yKeys:[],xKeysByGroups:{},yKeysByGroups:{},cells:{}}),I.facets[X].xKeysByGroups[oe]||(I.facets[X].xKeysByGroups[oe]=[]),I.facets[X].yKeysByGroups[me]||(I.facets[X].yKeysByGroups[me]=[]),I.facets[X].xKeys.push(Ce),I.facets[X].yKeys.push(ce),I.facets[X].xKeysByGroups[oe].push(Ce),I.facets[X].yKeysByGroups[me].push(ce),I.facets[X].cells[Ce]||(I.facets[X].cells[Ce]={}),I.meta.valueExtent[0]=Math.min(ge,I.meta.valueExtent[0]),I.meta.valueExtent[1]=Math.max(ge,I.meta.valueExtent[1]),I.facets[X].cells[Ce][ce])throw Error(`More than 1 value for x=${Ce}, y=${ce}`);if(I.meta.xLabels[Ce]&&String(Y[$])!==I.meta.xLabels[Ce])throw Error(`More than 1 x-label value for x=${Ce}`);if(I.meta.yLabels[ce]&&String(Y[Q])!==I.meta.yLabels[ce])throw Error(`More than 1 y-label value for y=${ce}`);I.meta.xLabels[Ce]=String(Y[$]),I.meta.yLabels[ce]=String(Y[Q]),G.forEach(ze=>{let Ne=typeof I.meta.xDataByKeys[ze]<"u",Ge=Ne&&typeof I.meta.xDataByKeys[ze][Ce]<"u";if(Ne||(I.meta.xDataByKeys[ze]={}),Ge&&I.meta.xDataByKeys[ze][Ce]!==Y[ze])throw Error(`More than 1 value for x = ${Ce} and column = ${ze}`);Ge||(I.meta.xDataByKeys[ze][Ce]=Y[ze])}),Z.forEach(ze=>{let Ne=typeof I.meta.yDataByKeys[ze]<"u",Ge=Ne&&typeof I.meta.yDataByKeys[ze][ce]<"u";if(Ne||(I.meta.yDataByKeys[ze]={}),Ge&&I.meta.yDataByKeys[ze][ce]!==Y[ze])throw Error(`More than 1 value for y = ${ce} and column = ${ze}`);Ge||(I.meta.yDataByKeys[ze][ce]=Y[ze])}),I.facets[X].cells[Ce][ce]={id:`${Ce}_${ce}`,x:Ce,y:ce,value:ge,normalizedValue:ge,data:Y}}}),_.forEach(Y=>{let X=I.facets[Y];X.xKeys=Ir.uniq(X.xKeys),X.yKeys=Ir.uniq(X.yKeys),D.forEach(oe=>{I.facets[Y].xKeysByGroups[oe]=Ir.uniq(I.facets[Y].xKeysByGroups[oe])}),O.forEach(oe=>{I.facets[Y].yKeysByGroups[oe]=Ir.uniq(I.facets[Y].yKeysByGroups[oe])})}),A){let Y=[1/0,-1/0];_.forEach(X=>{let{xKeys:oe,yKeys:me,cells:ae}=I.facets[X],ye=A.direction==="row"?oe:me,Ce=A.direction==="row"?me:oe,ce=A.direction==="row"?(ge,ze)=>{var Ne;return(Ne=ae[ge])==null?void 0:Ne[ze]}:(ge,ze)=>{var Ne;return(Ne=ae[ze])==null?void 0:Ne[ge]};Ce.forEach(ge=>{let ze=[];ye.forEach(Ge=>{var Xe;let Oe=(Xe=ce(Ge,ge))==null?void 0:Xe.value;Oe!==void 0&&ze.push(Oe)});let Ne=X7t(A.method,ze);ye.forEach(Ge=>{let Oe=ce(Ge,ge);Oe!==void 0&&(Oe.normalizedValue=Ne(Oe.value),Y[0]=Math.min(Oe.normalizedValue,Y[0]),Y[1]=Math.max(Oe.normalizedValue,Y[1]))})})}),I.meta.valueExtent=Y}return I.meta.xKeysByGroups=D.reduce((Y,X)=>(Y[X]=Ir.uniq(Ir.flatten(_.map(oe=>I.facets[oe].xKeysByGroups[X]))),Y),{}),I.meta.yKeysByGroups=O.reduce((Y,X)=>(Y[X]=Ir.uniq(Ir.flatten(_.map(oe=>I.facets[oe].yKeysByGroups[X]))),Y),{}),I.meta.valueExtent[0]===1/0&&(I.meta.valueExtent[0]=0),I.meta.valueExtent[1]===-1/0&&(I.meta.valueExtent[1]=0),I}function $K(e,t){let n=0;for(let r=0;r<e.length;r++)n+=(e[r]-t[r])*(e[r]-t[r]);return n}function FK(e,t){return Math.sqrt($K(e,t))}var VK=(e,t,n)=>{let r=0;for(let a of e)for(let i of t)r+=n[a][i];return r/e.length/t.length},Z7t=(e,t,n)=>{let r=0;for(let a of e)for(let i of t)r=Math.max(r,n[a][i]);return r},J7t=(e,t,n)=>{let r=1/0;for(let a of e)for(let i of t)r=Math.min(r,n[a][i]);return r};function q7t(e){switch(e){case"average":return VK;case"complete":return Z7t;case"single":return J7t;default:return VK}}function ewt(e){switch(e){case"euclidean":return FK;case"squaredEuclidean":return $K;default:return FK}}function OK(e=[],t,n="euclidean",r="average"){let a=ewt(n),i=q7t(r),o=t.map(c=>t.map(f=>a(c,f))),s=e.map((c,f)=>({height:0,keys:[c],indexes:[f],children:[]}));for(let c=0;c<e.length&&!(c>=e.length-1);c++){let f=1/0,A=0,h=0;for(let g=0;g<s.length;g++)for(let b=g+1;b<s.length;b++){let C=i(s[g].indexes,s[b].indexes,o);C<f&&(f=C,A=g,h=b)}let m={keys:[...s[A].keys,...s[h].keys],indexes:[...s[A].indexes,...s[h].indexes],height:f,children:[s[A],s[h]]};s.splice(Math.max(A,h),1),s.splice(Math.min(A,h),1),s.push(m)}return s[0]}function twt(e,t,n,r){let{facetKeys:a,xGroupKeys:i,yGroupKeys:o}=e.meta,s={};if(t&&r.sharedX)throw Error("Dendrogram on X axis is not available with shared by facets X axis");return a.forEach(c=>{let f={hierarchyX:[],hierarchyY:[]},A=e.facets[c];if(t){let h=[],m=[];i.forEach(g=>{let b=A.xKeysByGroups[g],C=A.yKeys,x=OK(b,b.map(k=>C.map(_=>{var D;return((D=A.cells[k][_])==null?void 0:D.normalizedValue)??t.fillNA})),t.distance,t.linkage);e.facets[c].xKeysByGroups[g]=x.keys,m.push(...x.keys),h.push(x)}),e.facets[c].xKeys=m,f.hierarchyX=h.map(g=>vb(g))}if(n){let h=[],m=[];o.forEach(g=>{let b=A.yKeysByGroups[g],C=A.xKeys,x=OK(b,b.map(k=>C.map(_=>{var D;return((D=A.cells[_][k])==null?void 0:D.normalizedValue)??n.fillNA})),n.distance,n.linkage);e.facets[c].yKeysByGroups[g]=x.keys,m.push(...x.keys),h.push(x)}),e.facets[c].yKeys=m,f.hierarchyY=h.map(g=>vb(g))}s[c]=f}),s}function nwt(e,t,n,r,a,i,o,s,c,f,A,h,m,g){let b=h.length>1&&(!c||o.includes(t.groupingPosition)),C=!c||o.includes(t.position),x=A.length>1&&(!s||o.includes(e.groupingPosition)),k=!s||o.includes(e.position),_=f.length>1,D=r.filter(oe=>o.includes(oe.position)||!s&&["left","right"].includes(oe.position)||!c&&["top","bottom"].includes(oe.position)),O=D.filter(oe=>oe.position==="left").length,I=D.filter(oe=>oe.position==="right").length,$=D.filter(oe=>oe.position==="top").length,Q=D.filter(oe=>oe.position==="bottom").length,ee=e.showTicks?U8:0,K=t.showTicks?U8:0,re=k&&e.showTitle?Vm:0,U=C&&t.showTitle?Vm:0,G=k&&e.showAxisLabels&&m>o2?n.xAxisCaptions+ee+l2:0,Z=C&&t.showAxisLabels&&g>o2?n.yAxisCaptions+K+l2:0,Y=x&&e.showGroupLabels?n.xGroupCaptions:0,X=b&&t.showGroupLabels?n.yGroupCaptions:0;return{left:{dendro:!(i!=null&&i.hidden)&&(i==null?void 0:i.position)==="left"?i.size:0,axisTitle:t.position==="left"?U:0,groups:t.groupingPosition==="left"?X:0,axis:t.position==="left"?Z:0,annotations:O*Qd+(O&&s2)},right:{dendro:!(i!=null&&i.hidden)&&(i==null?void 0:i.position)==="right"?i.size:0,axisTitle:t.position==="right"?U:0,groups:t.groupingPosition==="right"?X:0,axis:t.position==="right"?Z:0,annotations:I*Qd+(I&&s2)},top:{facetTitle:_?U2t:0,dendro:!(a!=null&&a.hidden)&&(a==null?void 0:a.position)==="top"?a.size:0,axisTitle:e.position==="top"?re:0,groups:e.groupingPosition==="top"?Y:0,axis:e.position==="top"?G:0,annotations:$*Qd+($&&s2)},bottom:{dendro:!(a!=null&&a.hidden)&&(a==null?void 0:a.position)==="bottom"?a.size:0,axisTitle:e.position==="bottom"?re:0,groups:e.groupingPosition==="bottom"?Y:0,axis:e.position==="bottom"?G:0,annotations:Q*Qd+(Q&&s2)}}}function rwt(e,t,n){return{left:s1.left.reduce((r,a,i)=>{let o=i>0?s1.left[i-1]:null,s=e.left[a];return r[a]={x:o?r[o].x-s:-s,y:0,width:s,height:n,isVisible:s>0},r},{}),right:s1.right.reduce((r,a,i)=>{let o=i>0?s1.right[i-1]:null,s=e.right[a];return r[a]={x:o?r[o].x+r[o].width:t,y:0,width:s,height:n,isVisible:s>0},r},{}),top:s1.top.reduce((r,a,i)=>{let o=i>0?s1.top[i-1]:null,s=e.top[a];return r[a]={x:0,y:o?r[o].y-s:-s,width:t,height:s,isVisible:s>0},r},{}),bottom:s1.bottom.reduce((r,a,i)=>{let o=i>0?s1.bottom[i-1]:null,s=e.bottom[a];return r[a]={x:0,y:o?r[o].y+r[o].height:n,width:t,height:s,isVisible:s>0},r},{})}}function HP(e,t,n){let r=(t-e)/n,a=Ir.range(e,t-r/2,r);return a.push(t),a}function QK(e,t){let n=HP(0,1,e.length-1),r=Da().domain(n).range(e),a=HP(0,1,t.length-1).map(i=>r(i));return Hl().domain(t).range(a).unknown("#ccc")}function awt(e,t,n,r,a,i){let o=HP(0,1,e.length-1),s=Da().domain(o).range(e),c=[r,...o.filter(C=>C>r&&C<a),a],f=[a,...o.filter(C=>C>a&&C<i),i],A=(n-t)/2,h=c.map(C=>t+A*(C-r)/(a-r)),m=f.map(C=>(t+n)/2+A*(C-a)/(i-a)),g=c.map(C=>s(C)),b=f.map(C=>s(C));return Da().domain(h.concat(m.slice(1))).range(g.concat(b.slice(1)))}function iwt(e,t,n,r){let a=e.filter(A=>A.showTitle&&(t.includes(A.position)||!n&&["left","right"].includes(A.position)||!r&&["top","bottom"].includes(A.position))),i=a.filter(A=>A.titlePosition==="left").map(A=>A.valueColumn.label??A.valueColumn.value),o=a.filter(A=>A.titlePosition==="right").map(A=>A.valueColumn.label??A.valueColumn.value),s=a.filter(A=>A.titlePosition==="top").map(A=>A.valueColumn.label??A.valueColumn.value),c=a.filter(A=>A.titlePosition==="bottom").map(A=>A.valueColumn.label??A.valueColumn.value),f=new Dc("bold 14px Arial");return{left:Math.max(...i.map(A=>f.getTextWidth(A))),right:Math.max(...o.map(A=>f.getTextWidth(A))),top:Math.max(...s.map(A=>f.getTextWidth(A))),bottom:Math.max(...c.map(A=>f.getTextWidth(A)))}}function owt(e,t,n,r,a){let{facetKeys:i,xGroupKeys:o,yGroupKeys:s,xKeysByGroups:c,yKeysByGroups:f,xLabels:A,yLabels:h}=r.meta,m=e.xGroupLabels/180*Math.PI,g=e.yGroupLabels/180*Math.PI,b=e.xAxisLabels/180*Math.PI,C=e.yAxisLabels/180*Math.PI,x=0,k=0,_=e.xGroupLabels===45,D=e.xAxisLabels===45;if(_||D)if(!t.sharedX)i.forEach($=>{let Q=o.find(Z=>r.facets[$].xKeysByGroups[Z].length>0);if(!Q)return;let ee=r.facets[$].xKeysByGroups[Q],K=n.x[$],re=K>o2,U=ee.length*K/2,G=A[ee[0]];x=Math.max(x,(_?a.getTextWidth(Q)*Math.cos(m):0)-U,(D&&re?a.getTextWidth(G)*Math.cos(b):0)-K/2)});else{let $=o[0],Q=i[0];if($){let ee=c[$],K=n.x[Q],re=K>o2,U=ee.length*K/2,G=A[ee[0]];x=Math.max(x,(_?a.getTextWidth($)*Math.cos(m):0)-U,(D&&re?a.getTextWidth(G)*Math.cos(b):0)-K/2)}}let O=e.yGroupLabels===45,I=e.yAxisLabels===45;if(O||I)if(!t.sharedY)i.forEach($=>{let Q=Ir.findLast(s,Z=>r.facets[$].yKeysByGroups[Z].length>0);if(!Q)return;let ee=r.facets[$].yKeysByGroups[Q],K=n.y[$],re=K>o2,U=ee.length*K/2,G=h[ee[ee.length-1]];k=Math.max(k,(O?a.getTextWidth(Q)*Math.cos(g):0)-U,(I&&re?a.getTextWidth(G)*Math.cos(C):0)-K/2)});else{let $=s[s.length-1],Q=i[0];if($){let ee=f[$],K=n.y[Q],re=K>o2,U=ee.length*K/2,G=h[ee[ee.length-1]];k=Math.max(k,(O?a.getTextWidth($)*Math.cos(g):0)-U,(I&&re?a.getTextWidth(G)*Math.cos(C):0)-K/2)}}return{xCaptionTail:x,yCaptionTail:k}}function zK(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function lwt(e,t,n,r,a){if(e){let s=Qd/2,c=n==="top"?-5:a+5;return{x:s,y:c,rotate:t==="left"?-90:90,anchor:t==="left"&&n==="top"?"start":"end"}}let i=n==="right"?r+5:-5,o=Qd/2;return{x:i,y:o,rotate:0,anchor:n==="right"?"start":"end"}}function K8({data:e,scales:t,stepX:n,stepY:r,x:a,y:i,annotation:o,showTitle:s,width:c,height:f,colorScale:A,aes:h,frame:m,xGroupKeys:g,yGroupKeys:b,xKeysByGroups:C,yKeysByGroups:x,setSelectedAnnotation:k}){let{position:_,titlePosition:D,valueColumn:O}=o,I=_==="left"||_==="right",$=(I?t.y:t.x).domain(),Q=lwt(I,_,D,c,f);return le.jsxs("g",{transform:`translate(${a},${i})`,children:[$.map(ee=>{let K=e==null?void 0:e[ee],re=A.type==="continuous"?A.scale(Number(K)):A.scale(String(K)),U=I?0:t.x(ee),G=I?t.y(ee):0,Z=I?Qd:n,Y=I?r:Qd;return le.jsx("rect",{x:U,y:G,width:Z,height:Y,fill:re,stroke:h.cellStrokeColor,onMouseOver:()=>k({x:a+U+Z,y:i+G+Y/2,xKey:I?null:ee,yKey:I?ee:null,value:K,title:O.label??O.value}),onMouseLeave:()=>k(null)},ee)}),m.type==="groups"&&!I&&g.map(ee=>{let K=C[ee].length;if(K===0)return null;let re=K*n,U=t.x(C[ee][0]);return le.jsx("rect",{x:U,width:re,height:Qd,stroke:Zt,fill:"none"},`${U}_${i}`)}),m.type==="groups"&&I&&b.map(ee=>{let K=x[ee].length;if(K===0)return null;let re=K*r,U=t.y(x[ee][0]);return le.jsx("rect",{y:U,width:Qd,height:re,stroke:Zt,fill:"none"},`${a}_${U}`)}),s&&le.jsx("g",{fontWeight:"500",fontSize:"14px",transform:`translate(${Q.x},${Q.y}) rotate(${Q.rotate})`,children:le.jsx("text",{textAnchor:Q.anchor,dominantBaseline:"central",children:O.label??O.value})})]})}function Z8(e,t){return e.showTitle&&t.includes(e.titlePosition)}function swt({sideElementBBoxes:e,annotations:t,annotationColorScales:n,cellsMeta:r,chartEdgeSides:a,sharedX:i,sharedY:o,width:s,height:c,scales:f,stepX:A,stepY:h,aes:m,frame:g,xGroupKeys:b,yGroupKeys:C,xKeysByGroups:x,yKeysByGroups:k,setSelectedAnnotation:_}){let D=t.filter(U=>a.includes(U.position)||!i&&["left","right"].includes(U.position)||!o&&["top","bottom"].includes(U.position)),O=D.filter(U=>U.position==="left"),I=D.filter(U=>U.position==="right"),$=D.filter(U=>U.position==="top"),Q=D.filter(U=>U.position==="bottom"),{xDataByKeys:ee,yDataByKeys:K}=r,re={scales:f,stepX:A,stepY:h,width:s,height:c,aes:m,frame:g,xGroupKeys:b,yGroupKeys:C,xKeysByGroups:x,yKeysByGroups:k,setSelectedAnnotation:_};return le.jsxs("g",{children:[O.map((U,G)=>le.jsx(K8,{annotation:U,colorScale:n[U.id],data:K[U.valueColumn.value],showTitle:Z8(U,a),x:e.left.annotations.x+G*Qd,y:e.left.annotations.y,...re},U.id)),I.map((U,G)=>le.jsx(K8,{annotation:U,colorScale:n[U.id],data:K[U.valueColumn.value],showTitle:Z8(U,a),x:e.right.annotations.x+G*Qd+s2,y:e.right.annotations.y,...re},U.id)),$.map((U,G)=>le.jsx(K8,{annotation:U,colorScale:n[U.id],data:ee[U.valueColumn.value],showTitle:Z8(U,a),x:e.top.annotations.x,y:e.top.annotations.y+G*Qd,...re},U.id)),Q.map((U,G)=>le.jsx(K8,{annotation:U,colorScale:n[U.id],data:ee[U.valueColumn.value],showTitle:Z8(U,a),x:e.bottom.annotations.x,y:e.bottom.annotations.y+G*Qd+s2,...re},U.id))]})}function uwt({sideElementBBoxes:e,xGroupKeys:t,yGroupKeys:n,xKeysByGroups:r,yKeysByGroups:a,xGroupLabels:i,yGroupLabels:o,scales:s,stepX:c,stepY:f,xAxis:A,yAxis:h,labelAngles:m,debug:g}){let b=e.top.groups.isVisible||e.bottom.groups.isVisible,C=e.top.groups.isVisible?e.top.groups:e.bottom.groups,x=e.left.groups.isVisible||e.right.groups.isVisible,k=e.left.groups.isVisible?e.left.groups:e.right.groups;return le.jsxs("g",{children:[b&&le.jsx("g",{transform:`translate(${C.x},${C.y})`,children:t.map(_=>{let D=r[_].length;if(D===0)return null;let O=m.xGroupLabels!==0,I=A.groupingPosition==="top",$=D*c,Q=s.x(r[_][0])+$/2,ee=O?I?C.height:0:C.height/2,K=-m.xGroupLabels,re=O?I?"start":"end":"middle";return le.jsxs("g",{transform:`translate(${Q},${ee})`,children:[le.jsx("text",{transform:`rotate(${K})`,dominantBaseline:"central",textAnchor:re,children:i[_]}),g&&le.jsx("rect",{x:-$/2,width:$,height:C.height,stroke:"black",fill:"none"})]},_)})}),x&&le.jsx("g",{transform:`translate(${k.x},${k.y})`,children:n.map(_=>{let D=a[_].length;if(D===0)return null;let O=D*f,I=h.groupingPosition==="left",$=I?k.width:0,Q=s.y(a[_][0])+O/2,ee=m.yGroupLabels!==0,K=m.yGroupLabels===45?-45:(I?-1:1)*(90-m.yGroupLabels),re=ee?I?"end":"start":"middle";return le.jsxs("g",{transform:`translate(${$},${Q})`,children:[le.jsx("text",{y:ee?0:-k.width/2,transform:`rotate(${K})`,dominantBaseline:"central",textAnchor:re,children:o[_]}),g&&le.jsx("rect",{x:-k.width/2,y:-O/2,width:k.width,height:O,stroke:"black",fill:"none"})]},_)})})]})}function cwt({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:f,xLabels:A,yLabels:h}){let m=i.showTicks?U8:0,g=o.showTicks?U8:0,b=e.top.axis.isVisible||e.bottom.axis.isVisible,C=e.top.axisTitle.isVisible?e.top.axisTitle:e.bottom.axisTitle,x=e.top.axis.isVisible?e.top.axis:e.bottom.axis,k=e.left.axis.isVisible||e.right.axis.isVisible,_=e.left.axisTitle.isVisible?e.left.axisTitle:e.right.axisTitle,D=e.left.axis.isVisible?e.left.axis:e.right.axis;return le.jsxs("g",{children:[le.jsxs("g",{children:[C.isVisible&&le.jsxs("g",{transform:`translate(${C.x},${C.y})`,children:[le.jsx("text",{x:C.width/2,y:C.height/2,textAnchor:"middle",dominantBaseline:"central",children:i.title}),t&&le.jsx("rect",{width:C.width,height:C.height,stroke:Zt,fill:"none"})]}),b&&le.jsxs("g",{fontSize:"14px",transform:`translate(${x.x},${x.y})`,children:[n.map(O=>{let I=f.xAxisLabels!==0,$=i.position==="bottom",Q=$?0:x.height,ee=$?Q+m:Q-m,K=$?ee+l2:ee-l2,re=a.x(O)+s/2,U=-f.xAxisLabels;return le.jsxs("g",{children:[le.jsx("line",{x1:re,x2:re,y1:Q,y2:ee,stroke:Zt}),le.jsx("text",{x:re,y:K,textAnchor:I?$?"end":"start":"middle",transform:`rotate(${U},${re},${K})`,dominantBaseline:I?"central":$?"hanging":"auto",children:A[O]})]},O)}),t&&le.jsx("rect",{width:x.width,height:x.height,stroke:Zt,fill:"none"})]})]}),le.jsxs("g",{children:[_.isVisible&&le.jsx("g",{transform:`translate(
|
|
15186
|
+
M-${a},${t}L0,${t-2*a}L${a},${t}z`,fill:"none",stroke:n})}case"12":return le.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M0,-${t}L 0,${t} M -${t},0 L ${t},0`,fill:"none",stroke:n});case"13":return le.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:n});case"14":return le.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M-${t},${t}L0,${-t}L${t},${t}`,fill:"none",stroke:n});case"15":return le.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:n,stroke:n});case"16":return le.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:n,stroke:n});case"17":return le.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:n,stroke:n});case"18":{let a=t*F8;return le.jsx("path",{d:`M0,-${a}L ${a},0 L 0,${a} L -${a},0z`,fill:n,stroke:n})}case"20":{let a=t*2/3;return le.jsx("path",{d:`M -${a},0 a ${a},${a} 0 1,0 ${a*2},0 a ${a},${a} 0 1,0 -${a*2},0z`,fill:n,stroke:n})}case"22":return le.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:n,stroke:r??d9(n)});case"21":return le.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:n,stroke:r??d9(n)});case"24":return le.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:n,stroke:r??d9(n)});case"23":{let a=t*F8;return le.jsx("path",{d:`M0,-${a}L ${a},0 L 0,${a} L -${a},0z`,fill:n,stroke:r??d9(n)})}case"25":return le.jsx("path",{d:`M${-2*t*Math.tan(Math.PI/6)},-${t}L ${2*t*Math.tan(Math.PI/6)},-${t}L0,${t}z`,fill:n,stroke:r??d9(n)});default:vA(e,`Unknown point shape ${e}`)}}var P2t=12;function WX({nodes:e,rootPosition:t,showLeavesLabels:n,showNodesLabels:r,aesGetters:a,selectedNodeId:i,onClick:o,onSelectedUpdate:s}){let c=t==="top",[f,A]=Vn.useState(null);return Vn.useEffect(()=>{A(null)},[i]),le.jsxs(le.Fragment,{children:[le.jsx("g",{children:e.map(h=>{let m=h.data.rawData[0],g=a.nodeSize(m),b=a.nodeColor(m),C=c?h.x:h.y,x=c?h.y:h.x;return le.jsx("g",{transform:`translate(${C},${x})`,style:{cursor:"pointer"},onClick:k=>{k.stopPropagation(),o({x:C+ic.LEFT,y:x+ic.TOP,info:h.data.rawData}),s(h)},children:le.jsx("g",{children:le.jsx("circle",{cx:0,cy:0,r:g+P2t,fill:i===h.id?IX:f===h.id?b:"transparent",opacity:AP,onMouseOver:()=>A(h.id??null),onMouseLeave:()=>A(null)})})},h.id)})}),le.jsx("g",{children:e.map(h=>{let m=h.data.rawData[0],g=a.nodeShape(m),b=a.nodeSize(m),C=a.nodeColor(m),x=c?h.x:h.y,k=c?h.y:h.x;return le.jsx("g",{transform:`translate(${x},${k})`,style:{cursor:"pointer"},onClick:_=>{_.stopPropagation(),o({x:x+ic.LEFT,y:k+ic.TOP,info:h.data.rawData}),s(h)},children:le.jsx("g",{onMouseOver:()=>A(h.id??null),onMouseLeave:()=>A(null),children:Af(g,b,i===h.id?IX:C)})},h.id)})}),le.jsx("g",{children:e.map(h=>{let m=h.data.rawData[0],g=a.nodeSize(m),b=c?h.x:h.y,C=c?h.y:h.x;return le.jsx("g",{transform:`translate(${b},${C})`,style:{pointerEvents:"none"},children:(r&&h.children||n&&!h.children)&&le.jsx("text",{x:g+4,y:"4",paintOrder:"stroke",stroke:"white",strokeWidth:"3",children:h.data.label})},h.id)})})]})}var XX=14,V8=12,A9=12,O8=-12;function M2t({aes:e,label:t}){let n=Af(e.shape,e.size,e.color);return le.jsxs("g",{children:[le.jsx("g",{transform:`translate(${A9/2},${A9/2})`,children:n}),le.jsx("text",{x:A9+8,y:A9/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function D2t({legendData:e}){let t=e.items.filter(n=>n.type==="continuous");return le.jsxs("g",{children:[le.jsx("defs",{children:t.map(n=>le.jsx("linearGradient",{id:n.id,gradientTransform:"rotate(90)",children:n.scale.domain().map(r=>{let a=n.scale.domain(),i=a[a.length-1]-a[0],o=i>0?(r-a[0])/i*100:0;return le.jsx("stop",{offset:`${o}%`,stopColor:n.scale(r)},r)})},n.id))}),e.items.map(n=>{if(n.type==="continuous"){let r=Math.min(...n.values),a=Math.max(...n.values);return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[le.jsx("text",{fontWeight:500,fontSize:"14px",y:O8,children:n.title}),le.jsx("rect",{x:"0",y:"0",width:XX,height:n.height,stroke:Zt,fill:`url(#${n.id})`}),le.jsx("g",{transform:`translate(${XX},0)`,children:n.values.map(i=>{let o=a-r,s=o>0?n.height*(i-r)/o:0;return le.jsxs("g",{transform:`translate(0,${s})`,children:[le.jsx("line",{x1:"0",x2:-4,stroke:Zt}),le.jsx("text",{x:8,y:4,children:i})]},i)})}),!1]},n.id)}if(n.type==="discrete")return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[le.jsx("text",{fontWeight:500,fontSize:"14px",y:O8,children:n.title}),n.values.map((r,a)=>le.jsxs("g",{transform:`translate(0, ${a*(V8+4)})`,children:[le.jsx("rect",{x:"0",y:"0",width:V8,height:V8,fill:n.scale(r),rx:"1",ry:"1"}),le.jsx("text",{x:V8+8,y:10,children:r})]},r)),!1]},n.id);if(n.type==="nodes")return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[le.jsx("text",{fontWeight:500,y:O8,children:n.title}),n.values.map((r,a)=>le.jsx("g",{transform:`translate(0, ${a*(A9+4)})`,children:le.jsx(M2t,{aes:n.scale(r),label:n.labels[r]})},r)),!1]},n.id);if(n.type==="size"){let r=n.height/n.values.length;return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[le.jsx("text",{fontWeight:500,y:O8,children:n.title}),n.values.map((a,i)=>{let o=n.scale(a);return le.jsxs("g",{transform:`translate(0, ${i*r})`,children:[le.jsx("circle",{r:o,cx:r/2,cy:r/2,fill:Zt}),le.jsx("text",{x:r+4,y:r/2,alignmentBaseline:"central",children:n.labels[a]})]},a)}),!1]},n.id)}})]})}function KX(e){if(!e)return null;let t=new Set,n=e;for(;n;)t.add(n.id),n=n.parent;return t}function H2t({chartSettings:e,chartSizes:t,nodes:n,links:r,connectionType:a,rootPosition:i,edgeInheritance:o,showNodes:s,showEdges:c,showLeavesLabels:f,showNodesLabels:A,aesGetters:h,labels:m,heatmapData:g,heatmapScales:b,heatmapStep:C,heatmapColor:x,heatmapLabels:k,legendData:_,onClick:D}){let O=Vn.useRef(null),[I,$]=Vn.useState(null),Q=Vn.useRef(null);Vn.useEffect(()=>{Q.current&&$(Q.current);function X(){K(null),U(null)}function oe(me){Object.entries(me.detail).forEach(([ae,ye])=>{if(ae==="selectedNode"){let Ce=n.find(ce=>ce.data.rawData[0].id===ye)??null;K(KX(Ce)),U(Ce)}})}return document.addEventListener("click",X),document.addEventListener(pP,oe),()=>{document.removeEventListener("click",X),document.removeEventListener(pP,oe)}},[]);let[ee,K]=gb.useState(null),[re,U]=gb.useState(null),G=ee!==null,Z={connectionType:a,rootPosition:i,edgeInheritance:o,aesGetters:h},Y={rootPosition:i,showLeavesLabels:f,showNodesLabels:A,aesGetters:h,labels:m,onClick:D,selectedNodeId:re==null?void 0:re.id,onSelectedUpdate:X=>{K(KX(X)),U(X)}};return le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${t.totalWidth} ${t.totalHeight}`,ref:O,width:t.totalWidth,height:t.totalHeight,children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${ic.LEFT},${ic.TOP})`,fontFamily:"Manrope",children:[le.jsx("text",{x:"0",y:"-12",fontSize:"20",children:e.title.name}),le.jsxs("g",{opacity:G?AP:1,children:[c&&le.jsx(YX,{links:r.filter(X=>{let{source:oe,target:me}=X;return!ee||!(ee.has(oe.id??"")&&ee.has(me.id??""))}),selected:!1,...Z}),s&&le.jsx(WX,{nodes:n.filter(X=>!X.data.isFake&&!(ee!=null&&ee.has(X.id??""))),...Y})]}),G&&le.jsxs("g",{children:[c&&le.jsx(YX,{links:r.filter(X=>{let{source:oe,target:me}=X;return ee.has(oe.id??"")&&ee.has(me.id??"")}),selected:!0,...Z}),s&&le.jsx(WX,{nodes:n.filter(X=>!X.data.isFake&&(ee==null?void 0:ee.has(X.id??""))),...Y})]}),g!==null&&le.jsx("g",{transform:`translate(${t.treeWidth+30},0)`,children:le.jsx(T2t,{heatmapData:g,scales:b,step:C,colorScale:x,chartSizes:t,labels:k,selectedNode:re,tooltipsContainer:I})}),e.legend.show&&le.jsx("g",{transform:`translate(${t.treeWidth+30+t.heatmapWidth+30},0)`,children:le.jsx(D2t,{legendData:_})})]}),le.jsx("g",{ref:Q})]})}function Fm({message:e}){return le.jsx("div",{style:{width:"500px",height:"400px",color:"#ee1616",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"25px",fontFamily:"Arial",border:"1px solid"},children:e})}function p9(e){if(RX(e))return t=>e.valuesMap[String(t[e.columnName.value])];if($m(e)){let{domain:t,range:n}=e,r=Ny().domain(t).range(n);return a=>{let i=r(Number(a[e.columnName.value]));return Math.max(1,i)}}return t=>e}function I2t(e){return{nodeShape:p9(e.nodeShape),nodeColor:p9(e.nodeColor),nodeSize:p9(e.nodeSize),lineShape:p9(e.lineShape),lineColor:p9(e.lineColor)}}var L2t=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r){let o=e%2===0?[]:[n];for(let s=1;s<e/2+1;s++)o.push(n+s),o.unshift(n-s);return o}if(e<2)return[n,r];let a=(r-n)/(e-1),i=[];for(let o=0;o<e-1;o++)i.push(n+a*o);return i.push(r),i};function R2t(e,t=1,n,r){let a=(e<16?40:e<49?32:24)*t;return Math.max(Math.min(a,r??1/0),n??-1/0)}var N2t=class{constructor(){Me(this,"component",le.jsx(le.Fragment,{}));Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"chartSizes",{treeWidth:600,treeHeight:350,heatmapWidth:0,heatmapHeight:0,totalWidth:1200+ic.LEFT+ic.RIGHT,totalHeight:350+ic.TOP+ic.BOTTOM,labelsOffset:0});Me(this,"legend",{width:0,height:0,items:[]});Me(this,"heatmapScales",{x:Hl().domain(["null"]).range([1]),y:Hl().domain(["null"]).range([1])});Me(this,"heatmapStep",{x:0,y:0});Me(this,"heatmapColorScale",{scale:Hl([]),getter:()=>"white"});Me(this,"heatmapLabels",[])}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=zh(this.rootNode))}updateHeatmapScales(e,t,n){if(e===null){this.chartSizes.heatmapWidth=0;return}let{xKeysByGroups:r,xGroupKeys:a,xKeys:i,yKeys:o}=e,s=5,c=a.map(x=>r[x].length),f=c.reduce((x,k)=>x+k,0),A=this.chartSizes.treeHeight/o.length,h=Math.min(Math.max((400-(c.filter(x=>x>0).length-1)*s)/f,n.minCellWidth),n.maxCellWidth),m=[],g=0;a.forEach(x=>{let k=r[x];k.forEach(()=>{m.push(g),g+=h}),k.length>0&&(g+=s)}),this.heatmapScales.x=Hl().domain(i).range(m),this.heatmapScales.y=Hl().domain(o).range(o.map((x,k)=>k*A)),this.heatmapStep.x=h,this.heatmapStep.y=A;let{colorsList:b,colorsMap:C}=t.aes;if(t.valueType==="continuous"&&b){let x=Da().domain(L2t(b.length,e.meta.valueExtent)).range(b);this.heatmapColorScale={scale:x,getter:k=>x(k)}}if(t.valueType==="discrete"&&C){let x=Object.keys(C).filter(k=>e.meta.uniqueValues.has(k));this.heatmapColorScale={scale:Hl(x,x.map(k=>C[k])).unknown(s9),getter:k=>k?C[k]??s9:s9}}if(t.valueType==="stringSource"&&b){let x=[...e.meta.uniqueValues],k=Hl(x,x.map((_,D)=>b[D%b.length])).unknown(s9);this.heatmapColorScale={scale:k,getter:_=>_?k(_):s9}}this.chartSizes.heatmapWidth=this.heatmapScales.x(e.xKeys[e.xKeys.length-1])+this.heatmapStep.x}updateLegendSize(e,t,n,r,a,i){if(!e.show){this.legend={width:0,height:0,items:[]};return}let o=new Dc("600 14px Arial"),s=16,c=48,f=20,A=24;function h(O,I){return Math.max(...O.map($=>o.getTextWidth(String($))+f),o.getTextWidth(I))}let m=[];[n.nodeColor,n.nodeShape,n.lineColor].filter(RX).map(O=>O.columnName).forEach(O=>{let I=t[O.value];if(I.usedAes.length===0||!I.aesMap)return;let $=O.label??O.value,Q=I.values,ee={};Q.forEach(K=>{ee[K]||(ee[K]={...mP}),I.usedAes.forEach(re=>{var U,G,Z;(re==="dotFill"||re==="lineColor")&&(ee[K].color=((U=I.aesMap[K])==null?void 0:U[re])??Zt),re==="dotShape"&&(ee[K].shape=((G=I.aesMap[K])==null?void 0:G[re])??"21"),re==="dotSize"&&(ee[K].size=((Z=I.aesMap[K])==null?void 0:Z[re])??3)})}),m.push({columnKey:$,data:ee,values:I.values,labels:I.labels})});let g=[],b=0,C=0,x=0,k=Math.min(this.chartSizes.treeHeight,400);if(r&&a){let O=i.valueType,I=r.label??r.value;if(O==="continuous"){let $=this.heatmapColorScale.scale,Q=a2($,a.meta.valueExtent,4),ee={id:"heatmapValue",type:"continuous",width:UX(Q,I),height:k,left:0,top:0,title:I,scale:$,values:Q,labels:{}};g.push(ee),C=ee.height+c,b=ee.width}else{let $=this.heatmapColorScale.scale,Q=d2t($,I),ee=$.domain(),K=ee.length*s,re={id:"heatmapValue",type:"discrete",width:Q,height:K,left:0,top:0,title:I,scale:$,values:ee,labels:{}};g.push(re),C=re.height+c,b=re.width}}if(m.map(({columnKey:O,labels:I,values:$,data:Q})=>{C>k&&(C=0,x+=b+A);let ee=O,K=h($.map(Y=>I[Y]),ee),re=$.length*s;re>k&&(k=re);let U=Hl().domain($).range($.map(Y=>Q[Y])),G=x,Z=C;g.push({id:O,type:"nodes",width:K,height:re,left:G,top:Z,title:ee,scale:U,values:$,labels:I}),b=K,C+=re+c}),$m(n.nodeSize)){C>k&&(C=0,x+=b+A);let{columnName:O,domain:I,range:$}=n.nodeSize,Q=O.label??O.value,ee=Ny(I,$),K=ee.ticks(3),re=ee.tickFormat(3),U=K.reduce((oe,me)=>(oe[String(me)]=re(me),oe),{}),G=h(K.map(oe=>U[oe]),Q),Z=(ee(Math.max(...K))*2+4)*K.length;Z>k&&(k=Z);let Y=x,X=C;g.push({id:O.value,type:"size",width:G,height:Z,left:Y,top:X,title:Q,scale:ee,values:K,labels:U}),b=G,C+=Z+c}let _=x+b+2*yP,D=k;this.legend={width:_,height:D,items:g}}updateChartSizes(e,t,n){let r=n.leaves().length;this.chartSizes.treeWidth=t?e.width/2:e.width;let a=R2t(r,e.scale,e.minCellHeight,e.maxCellHeight)*r;this.chartSizes.treeHeight=a,this.chartSizes.heatmapHeight=a}updateTotalSizes(e){this.chartSizes.totalWidth=this.chartSizes.treeWidth+this.chartSizes.heatmapWidth+this.legend.width+ic.LEFT+ic.RIGHT,e&&(this.chartSizes.totalWidth+=30),this.legend.width>0&&(this.chartSizes.totalWidth+=30),this.chartSizes.totalHeight=Math.max(this.chartSizes.treeHeight,this.legend.height)+ic.TOP+ic.BOTTOM}prepareTableLabels(e){let t=new Dc("bold 14px Arial"),n="…";if(this.heatmapStep.x<12||!e){this.heatmapLabels=[];return}let r=this.heatmapStep.x-4;this.heatmapLabels=e.xKeys.map(a=>{let i=e.meta.xLabels[a],o=t.getTextWidth(i);if(o<r)return i;let s=i,c=s==null?void 0:s.length;for(;o>r&&c>0;)c--,s=(i==null?void 0:i.substring(0,c))+n,o=t.getTextWidth(s);return c>0?s:""})}addLabelsWidthToTreeArea(e,t){if(!t)return;let n=e.leaves(),r=new Dc("bold 14px Manrope"),a=0;n.forEach(i=>{if(!i.data.label)return;let o=r.getTextWidth(i.data.label),s=i.y+o-this.chartSizes.treeWidth+8;s>a&&(a=s)}),this.chartSizes.treeWidth+=a}render(e,t,n,r,a,i,o,s,c,f,A,h,m,g,b,C,x){var I;this.updateChartSizes(e.size,m,t),this.updateHeatmapScales(m,g,e.size),this.updateLegendSize(e.legend,b,f,h,m,g),this.prepareTableLabels(m);let k=r==="top"?[this.chartSizes.treeWidth,this.chartSizes.treeHeight]:[this.chartSizes.treeHeight,this.chartSizes.treeWidth];xB().size(k).separation(()=>1)(t);let _=t;d3t(_,r==="top"?this.chartSizes.treeHeight:this.chartSizes.treeWidth,C==="alignLeavesToLine"),A3t(_),this.addLabelsWidthToTreeArea(_,s),this.updateTotalSizes(m);let D=I2t(f),O=le.jsx(H2t,{chartSizes:this.chartSizes,chartSettings:e,nodes:_.descendants(),links:_.links(),connectionType:n,rootPosition:r,edgeInheritance:a,showNodes:i,showEdges:o,showLeavesLabels:s,showNodesLabels:c,aesGetters:D,labels:A,heatmapData:m,heatmapScales:this.heatmapScales,heatmapStep:this.heatmapStep,heatmapColor:this.heatmapColorScale.getter,heatmapLabels:this.heatmapLabels,legendData:this.legend,onClick:x});this.component=O,(I=this.reactRoot)==null||I.render(O)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},$2t=N2t,ZX=class{constructor(e){Me(this,"type","dendro");Me(this,"chartSettings");Me(this,"mode");Me(this,"leavesMode");Me(this,"id");Me(this,"parentId");Me(this,"height",null);Me(this,"labels");Me(this,"heatmapAnnotation");Me(this,"heatmapAxis");Me(this,"heatmapGroup");Me(this,"heatmapSettings");Me(this,"connectionType","rectangle");Me(this,"edgeInheritance","up");Me(this,"rootPosition","top");Me(this,"showNodes",!0);Me(this,"showEdges",!0);Me(this,"showLeavesLabels",!0);Me(this,"showNodesLabels",!0);Me(this,"aes",{nodeShape:"21",nodeColor:Zt,nodeSize:3,lineShape:"solid",lineColor:Zt});var t,n,r,a,i,o,s,c,f,A;r2t.parse(e),this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(e.facetSettings?400:560),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(e.facetSettings?250:350),scale:((r=e==null?void 0:e.size)==null?void 0:r.scale)??1,minCellWidth:((a=e==null?void 0:e.size)==null?void 0:a.minCellWidth)??a3t,maxCellWidth:((i=e==null?void 0:e.size)==null?void 0:i.maxCellWidth)??i3t,minCellHeight:(o=e==null?void 0:e.size)==null?void 0:o.minCellHeight,maxCellHeight:(s=e==null?void 0:e.size)==null?void 0:s.maxCellHeight},title:{position:"center",show:!0,...e.title,name:((c=e.title)==null?void 0:c.name)??"Dendrogram"},legend:{show:!0,position:"right",...e.legend}},this.mode=e.mode??"normal",this.leavesMode=e.leavesMode??"normal",this.id=e.id,this.parentId=e.parentId,this.height=e.height??null,this.labels=e.labels??this.id,this.heatmapAnnotation=e.heatmapAnnotation??null,this.heatmapAxis=e.heatmapAxis??null,this.heatmapGroup=e.heatmapGroup??[],this.heatmapSettings={valueType:((f=e.heatmapSettings)==null?void 0:f.valueType)??"continuous",aes:{colorsList:["#FFF680","#53D788","#36739D","#4A005C"],...(A=e.heatmapSettings)==null?void 0:A.aes}},this.connectionType=e.connectionType??this.connectionType,this.edgeInheritance=e.edgeInheritance??this.edgeInheritance,this.showNodes=e.showNodes??this.showNodes,this.showEdges=e.showEdges??this.showEdges,this.showLeavesLabels=e.showLeavesLabels??this.showLeavesLabels,this.showNodesLabels=e.showNodesLabels??this.showNodesLabels,this.rootPosition=e.rootPosition??this.rootPosition,this.aes={...this.aes,...e.aes}}};function Q8(e){return typeof e!="object"?!1:"valuesMap"in e}function JX(e,t){let{nodeColor:n,nodeShape:r,lineColor:a}=t,i=[n,r,a].filter(Q8);return Ir.uniqBy(i,o=>o.columnName.value).reduce((o,s)=>{let{columnName:c}=s,f=Ir.uniqBy(e.rows,b=>b[c.value]),A=b=>String(b[c.value]),h=b=>c.valueLabels?String(b[c.valueLabels]):A(b),m=new Set,g=f.reduce((b,C)=>{let x=A(C);return b[x]||(b[x]={}),b},{});return Q8(n)&&c.value===n.columnName.value&&(m.add("dotFill"),f.forEach(b=>{let C=A(b);g[C].dotFill=n.valuesMap[C]})),Q8(r)&&c.value===r.columnName.value&&(m.add("dotShape"),f.forEach(b=>{let C=A(b);g[C].dotShape=r.valuesMap[C]})),Q8(a)&&c.value===a.columnName.value&&(m.add("lineColor"),f.forEach(b=>{let C=A(b);g[C].lineColor=a.valuesMap[C]})),o[c.value]={values:f.map(A).sort(),usedAes:[...m],aesMap:g,labels:f.reduce((b,C)=>(b[A(C)]=h(C),b),{})},o},{})}var F2t=class extends Sg{constructor(t,n,r){super(t,n);Me(this,"settings");Me(this,"onClick",()=>Kx);Me(this,"chartRenderer",new $2t);Me(this,"calculatedData",null);this.settings=new ZX(n),r&&(this.onClick=r[0])}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new ZX(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){if(document){let r=new CustomEvent(pP,{detail:{[t]:n}});document.dispatchEvent(r)}}export(){return this._updateChart(),f3(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var A,h;let{mode:r,id:a,parentId:i,heatmapAnnotation:o,heatmapAxis:s,heatmapGroup:c}=n;function f(m,g){return m.length!==g.length||m.some((b,C)=>b.value!==g[C].value)}return t.mode!==r||t.id.value!==a.value||t.parentId.value!==i.value||((A=t.heatmapAnnotation)==null?void 0:A.value)!==(o==null?void 0:o.value)||((h=t.heatmapAxis)==null?void 0:h.value)!==(s==null?void 0:s.value)||f(t.heatmapGroup,c)}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{mode:t,id:n,parentId:r,aes:a,heatmapAnnotation:i,heatmapAxis:o,heatmapGroup:s,heatmapSettings:c,height:f,labels:A}=this.settings,h=f3t(n.value,r.value,(f==null?void 0:f.value)??null,A.valueLabels??A.value??null,this.data.rows,t==="useAllNodesAsLeaves"),m=s3t(this.data,c.valueType,i,o,s,n,h),g=JX(this.data,a);this.calculatedData={chartSizes:this.chartRenderer.chartSizes,hierarchy:h,heatmapData:m,legendLabels:g}}_updateAesInData(){this.calculatedData&&(this.calculatedData.legendLabels=JX(this.data,this.settings.aes))}_updateChart(){if(!this.calculatedData)return;let{heatmapAnnotation:t,chartSettings:n,connectionType:r,edgeInheritance:a,rootPosition:i,showNodes:o,showEdges:s,showLeavesLabels:c,showNodesLabels:f,aes:A,labels:h,heatmapSettings:m,leavesMode:g}=this.settings;this.chartRenderer.render(n,this.calculatedData.hierarchy,r,i,a,o,s,c,f,A,h,t,this.calculatedData.heatmapData,m,this.calculatedData.legendLabels,g,this.onClick)}};function V2t(e,t,n,r,a,i){let o=-1/0;return{type:"logo",geoms:t.reduce((s,c)=>{let f=c.join("_");return s[f]=[],n.forEach(A=>{let h=0,m={};r.forEach(b=>{let C=a.getRowsByGrouping([...c,A,b]);if(!C.length)return;let x=Sc(C,k=>Number(k[i.value]));m[b]={height:x,key:b},h+=x});let g=h;e.normalize&&r.forEach(b=>{m[b]&&(m[b].height=m[b].height/g*100)}),o=Math.max(o,h),s[f].push({key:`logo_${A}`,valuesMap:m,primaryGrouping:A,boundsY:{min:0,max:e.normalize?g:100}})}),s},{}),meta:{minY:0,maxY:e.normalize?100:o,normalize:e.normalize},aes:e.aes}}var h9={TOP:30,BOTTOM:30},l1=30,O2t=6,m9=20,CP=15,z8=24,i2=25,Q2t=12,qX={fillColor:"white",lineColor:Zt,lineWidth:1,lineShape:"solid",dotSize:3,dotFill:Zt,dotShape:"21"},bP=20,eK=4,ed=4,tK=25,z2t=15,_g=8,Vm=30,U2t=48,j2t=24,o2=16,l2=4,U8=4,j8=20,G2t=16,Qd=16,s2=8,s1={left:["annotations","axis","groups","axisTitle","dendro"],right:["annotations","axis","groups","axisTitle","dendro"],top:["annotations","axis","groups","axisTitle","dendro","facetTitle"],bottom:["annotations","axis","groups","axisTitle","dendro"]},nK={fillColor:"white",lineColor:Zt,lineWidth:1,lineShape:"solid",dotSize:3,dotFill:Zt,dotShape:"21"};function Y2t(e){return`translate(${e},0)`}function W2t(e){return`translate(0,${e})`}var v9=21;function X2t(e,t){if(e==="45deg"){let n=t==="left"?-v9/2:0,r=t==="bottom"?v9/2:-v9/2;return`translate(${n},${r}) rotate(-45)`}return e==="90deg"&&t==="bottom"?`translate(${-v9/2},${ed+v9/2}) rotate(-90)`:t==="bottom"?`translate(0,${ed})`:`translate(${-ed},0)`}function K2t(e,t){return t==="left"||t==="bottom"&&e==="90deg"?"central":e==="center"?"hanging":"auto"}function Z2t(e,t){return t==="left"||t==="bottom"&&e!=="center"?"end":"middle"}var rK=({scale:e,tickSize:t=6,tickPadding:n=ed,orient:r="bottom",labelsPosition:a="center",labels:i={},offset:o=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function s(x,k){return x.bandwidth&&(k=Math.max(0,x.bandwidth()-k*2)/2),x!=null&&x.round()&&(k=Math.round(k)),_=>{let D=x(_);return D===void 0?0:D+k}}let c=e.domain(),f=x=>i[x]??[x],A=Math.max(t,0)+n,h=s(e.copy(),o),m=r==="bottom"?Y2t:W2t,g=r==="left"?-1:1,b={[(r==="left"?"x":"y")+"2"]:g*t},C={[r==="left"?"x":"y"]:g*A};return le.jsx("g",{children:c.map((x,k)=>le.jsxs("g",{className:"tick",transform:m(h(x)+o),children:[le.jsx("line",{stroke:Zt,...b}),le.jsx("g",{transform:X2t(a,r),children:f(x).map((_,D)=>le.jsx("text",{fill:Zt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:K2t(a,r),textAnchor:Z2t(a,r),dy:20*D,...C,children:_},`${_}_${D}`))})]},k))})};function aK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function J2t({scales:e,orientation:t,bar:n,aes:r}){let a=t==="vertical",i=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,o=e.xSecondary.bandwidth(),s=r.width==="auto"?o*.8:Math.min(o,r.width),c=Math.abs(e.y(n.value)-e.y(0)),f=aK(e,"lineColor",r.lineColor,n),A=aK(e,"fillColor",r.fillColor,n);return le.jsx("g",{transform:a?`translate(${i},0)`:`translate(0, ${i})`,opacity:r.opacity,stroke:f,strokeWidth:r.lineWidth,children:le.jsx("rect",{width:a?s:c,height:a?c:s,x:a?-s/2:e.y(n.boundsY.min),y:a?e.y(n.boundsY.max):-s/2,fill:A})})}function Ki(e){return isNaN(e)?"?":e===0?"0":Math.abs(e)<.01?j5(".1e")(e):j5(".2f")(e)}function iK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function q2t({scales:e,orientation:t,geom:n,aes:r,min:a,max:i,binsCount:o,hasKeyFromColumn:s,sideDistances:c,showTooltips:f,tooltipsContainer:A}){let[h,m]=Vn.useState(null),g=t==="vertical",b=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,C=iK(e,"lineColor",r.lineColor,n),x=iK(e,"fillColor",r.fillColor,n),k=n.bins,_=r.dotSize?r.dotSize:Math.abs(e.y(i)-e.y(a))/o/2;return le.jsx("g",{transform:g?`translate(${b},0)`:`translate(0, ${b})`,stroke:C,fill:x,strokeWidth:r.lineWidth,children:k.map(({x:D,count:O,dots:I})=>le.jsx("g",{transform:g?`translate(0,${e.y(D)})`:`translate(${e.y(D)},0)`,children:I.map(($,Q)=>{let ee=(Q-O/2)*2*_+_,K=g?ee:0,re=g?0:ee;return le.jsxs("g",{children:[le.jsx("circle",{opacity:r.opacity,cx:K,cy:re,r:_,onMouseOver:()=>m($.key),onMouseLeave:()=>m(null)}),f&&le.jsx(oc,{content:s?[$.key,Ki($.value)]:[Ki($.value)],x:(g?b:e.y(D))+K,y:(g?e.y(D):b)+re,sideDistances:c,horizontal:g,offset:_,active:h===$.key,container:A})]},$.key)})},D))})}function td(e=null){switch(e){case null:return"";case"solid":return"";case"dashed":return"6 6";case"dotted":return"1.5 4";case"dotdash":return"1.4 4 8 4";case"longdash":return"10 4";case"twodash":return"3 3 9 3";default:vA(e,`Unknown line shape ${e}`)}}function G8(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function e5t(e,t){return t?[e.id,`${Ki(e.y)}`]:[`${Ki(e.y)}`]}function t5t({scales:e,orientation:t,box:n,aes:r,hasKeyFromColumn:a,sideDistances:i,showTooltips:o,elementsAmount:s,tooltipsContainer:c}){let[f,A]=Vn.useState(!1),[h,m]=Vn.useState(null),g=t==="vertical",b=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,C=e.xSecondary.bandwidth(),x=r.boxWidth==="auto"?C*.8:Math.min(C,r.boxWidth),k=Math.abs(e.y(n.lower)-e.y(n.upper)),_=G8(e,"lineColor",r.lineColor,n),D=G8(e,"fillColor",r.fillColor,n),O=G8(e,"dotShape",r.dotShape,n),I=G8(e,"dotSize",r.dotSize,n),$=Af(O,I,_),Q=Math.abs(e.y.range()[0]-e.y.range()[1]);return le.jsxs("g",{transform:g?`translate(${b},0)`:`translate(0, ${b})`,opacity:r.opacity,stroke:_,strokeWidth:r.lineWidth,strokeDasharray:td(r.lineShape),children:[le.jsx("line",{x1:g?0:e.y(n.min),x2:g?0:e.y(n.lower),y1:g?e.y(n.min):0,y2:g?e.y(n.lower):0}),le.jsx("line",{x1:g?0:e.y(n.upper),x2:g?0:e.y(n.max),y1:g?e.y(n.upper):0,y2:g?e.y(n.max):0}),le.jsx("rect",{width:g?x:k,height:g?k:x,x:g?-x/2:e.y(n.lower),y:g?e.y(n.upper):-x/2,fill:D}),le.jsx("line",{x1:g?-x/2:e.y(n.middle),x2:g?x/2:e.y(n.middle),y1:g?e.y(n.middle):-x/2,y2:g?e.y(n.middle):x/2}),o&&c&&le.jsx("rect",{onMouseOver:()=>A(!0),onMouseLeave:()=>A(!1),width:g?C:Q,x:g?-C/2:0,y:g?0:-C/2,height:g?Q:C,fill:"transparent",stroke:"none"}),r.showOutliers&&n.outliers.map(ee=>le.jsxs("g",{transform:g?`translate(0,${e.y(ee.y)})`:`translate(${e.y(ee.y)},0)`,strokeDasharray:"0",children:[$,o&&c&&le.jsx("circle",{onMouseOver:()=>m(ee.id),onMouseLeave:()=>m(null),r:"15",fill:"transparent",stroke:"none"}),o&&le.jsx(oc,{content:e5t(ee,a),x:g?b:e.y(ee.y),y:g?e.y(ee.y):b,sideDistances:i,horizontal:!0,active:h===ee.id,container:c})]},ee.id)),o&&le.jsx(oc,{content:[`Max = ${Ki(n.max)}`,`Upper = ${Ki(n.upper)}`,`Median = ${Ki(n.middle)}`,`Lower = ${Ki(n.lower)}`,`Min = ${Ki(n.min)}`],x:g?b:e.y(n.middle),y:g?e.y(n.middle):b,sideDistances:i,horizontal:g,active:f,offset:s>1?C/2:C/4,container:c})]})}function EP(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function n5t(e,t,n){return n?[t,`${Ki(e)}`]:[`${Ki(e)}`]}function r5t({scales:e,orientation:t,geom:n,aes:r,hasKeyFromColumn:a,sideDistances:i,showTooltips:o,tooltipsContainer:s}){let[c,f]=Vn.useState(null),A=t==="vertical",h=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,m=e.xSecondary.bandwidth()*r.jitter,g=_=>(1-_*2)*(m/2),b=EP(e,"lineColor",r.lineColor,n),C=EP(e,"dotFill",r.dotFill,n),x=EP(e,"dotShape",r.dotShape,n),k=Af(x,r.dotSize,C);return le.jsx("g",{transform:A?`translate(${h},0)`:`translate(0, ${h})`,stroke:b,children:n.values.map(({y:_,jitter:D,id:O})=>le.jsxs("g",{opacity:r.opacity,transform:A?`translate(${g(D)},${e.y(_)})`:`translate(${e.y(_)},${g(D)})`,children:[k,o&&s&&le.jsx("circle",{onMouseOver:()=>f(O),onMouseLeave:()=>f(null),r:"4",fill:"transparent",stroke:"none"}),o&&le.jsx(oc,{content:n5t(_,O,a),x:h+g(D),y:e.y(_),active:c===O,sideDistances:i,container:s})]},O))})}function xP(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function a5t({scales:e,orientation:t,errorBar:n,aes:r,sideDistances:a,showTooltips:i,tooltipsContainer:o}){let[s,c]=Vn.useState(!1),f=t==="vertical",A=xP(e,"lineColor",r.lineColor,n),h=xP(e,"fillColor",r.fillColor,n),m=xP(e,"dotShape",r.dotShape,n),g=(e.xPrimary(n.primaryGrouping)??0)+e.xPrimary.bandwidth()/2,b=r.width==="auto"?e.xPrimary.bandwidth()*.2:r.width,C=e.y(n.min),x=e.y(n.max),k=e.y(n.value),_=Af(m,r.dotSize,h);return le.jsxs("g",{opacity:r.opacity,stroke:A,fill:"none",transform:f?`translate(${g},0)`:`translate(0,${g})`,strokeWidth:r.lineWidth,children:[le.jsx("line",{x1:f?0:C,x2:f?0:x,y1:f?C:0,y2:f?x:0}),le.jsx("line",{x1:f?-b/2:C,x2:f?b/2:C,y1:f?C:-b/2,y2:f?C:b/2}),le.jsx("line",{x1:f?-b/2:x,x2:f?b/2:x,y1:f?x:-b/2,y2:f?x:b/2}),r.showDots&&le.jsxs("g",{transform:f?`translate(0,${k})`:`translate(${k},0)`,children:[_,i&&o&&le.jsx("circle",{onMouseOver:()=>c(!0),onMouseLeave:()=>c(!1),r:"15",fill:"transparent",stroke:"none"}),i&&le.jsx(oc,{content:[Ki(n.value)],x:f?g:k,y:f?k:g,sideDistances:a,horizontal:!0,active:s,container:o})]})]})}function Y8(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")throw new Error("Line cannot have aesthetics by primary grouping");if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.key)[t]}return n}function i5t(e,t,n){let r=n.xPrimary.bandwidth()/2;return t.map(a=>[(n.xPrimary(a)??0)+r,n.y(e[a]),a,e[a]])}function o5t({scales:e,orientation:t,line:n,aes:r,sideDistances:a,showTooltips:i,secondaryGrouping:o,tooltipsContainer:s}){let[c,f]=Vn.useState(null),A=t==="vertical",h=Y8(e,"lineColor",r.lineColor,n),m=Y8(e,"dotFill",r.fillColor,n),g=Y8(e,"lineShape",r.lineShape,n),b=Y8(e,"dotShape",r.dotShape,n),C=i5t(n.dots,e.xPrimary.domain(),e),x=Af(b,r.dotSize,m);return le.jsxs("g",{opacity:r.opacity,stroke:h,strokeDasharray:td(g),strokeWidth:r.lineWidth,children:[le.jsx("polyline",{points:C.map(([k,_])=>A?[k,_]:[_,k]).join(" "),stroke:h,fill:"none"},n.key),r.dotShape!==null&&le.jsx("g",{children:C.map(([k,_,D,O])=>le.jsxs("g",{transform:A?`translate(${k},${_})`:`translate(${_},${k})`,strokeDasharray:"none",stroke:"none",children:[x,i&&s&&le.jsx("circle",{onMouseOver:()=>f(D),onMouseLeave:()=>f(null),r:"15",fill:"transparent",stroke:"none"}),i&&le.jsx(oc,{content:[o.valueLabels[n.key],Ki(O)],x:A?k:_,y:A?_:k,sideDistances:a,horizontal:!0,active:c===D,container:s})]},D))})]})}var l5t={A:rr.A,B:rr.B,C:rr.C,D:rr.D,E:rr.E,F:rr.F,G:rr.G,H:rr.H,I:rr.I,J:rr.J,K:rr.K,L:rr.L,M:rr.M,N:rr.N,O:rr.O,P:rr.P,Q:rr.Q,R:rr.R,S:rr.S,T:rr.T,U:rr.U,V:rr.V,W:rr.W,X:rr.X,Y:rr.Y,Z:rr.Z,a:rr.LC_a,b:rr.LC_b,c:rr.LC_c,d:rr.LC_d,e:rr.LC_e,f:rr.LC_f,g:rr.LC_g,h:rr.LC_h,i:rr.LC_i,j:rr.LC_j,k:rr.LC_k,l:rr.LC_l,m:rr.LC_m,n:rr.LC_n,o:rr.LC_o,p:rr.LC_p,q:rr.LC_q,r:rr.LC_r,s:rr.LC_s,t:rr.LC_t,u:rr.LC_u,v:rr.LC_v,w:rr.LC_w,x:rr.LC_x,y:rr.LC_y,z:rr.LC_z,N0:rr.N0,N1:rr.N1,N2:rr.N2,N3:rr.N3,N4:rr.N4,N5:rr.N5,N6:rr.N6,N7:rr.N7,N8:rr.N8,N9:rr.N9};function s5t({scales:e,orientation:t,geom:n,aes:r,sideDistances:a,showTooltips:i,elementsAmount:o,tooltipsContainer:s,normalize:c}){let[f,A]=Vn.useState(null),h=t==="vertical",m=e.xPrimary.bandwidth(),g=(e.xPrimary(n.primaryGrouping)??0)+m/2,b=r.width==="auto"?m*.9:Math.min(m,r.width),C=[...e.xSecondary.domain()].filter(_=>n.valuesMap[_]).sort((_,D)=>{let O=n.valuesMap[_],I=n.valuesMap[D];return O.height-I.height}),x={},k=0;return C.forEach(_=>{if(!n.valuesMap[_])return;let D=n.valuesMap[_].height;x[_]={y1:k,y2:k+D},k+=D}),le.jsx("g",{transform:h?`translate(${g},0)`:`translate(0, ${g})`,opacity:r.opacity,children:C.map(_=>{if(!n.valuesMap[_])return null;let{y1:D,y2:O}=x[_],I=e.y(D),$=e.y(O),Q=Math.abs(I-$),ee=typeof r.fillColor=="string"?r.fillColor:r.fillColor[_],K=h?-b/2:Math.min(I,$),re=h?Math.min(I,$):-b/2,U=l5t[_];if(U)return le.jsxs("g",{children:[le.jsx("g",{transform:`translate(${K},${re})`,children:le.jsx("g",{transform:h?`scale(${b/100},${Q/100})`:`scale(${Q/100},${b/100})`,fill:ee,onMouseOver:()=>A(_),onMouseLeave:()=>A(null),children:le.jsx(U,{})})}),i&&le.jsx(oc,{content:[_,Ki(n.valuesMap[_].height)+(c?"%":"")],x:h?g:(I+$)/2,y:h?(I+$)/2:g,sideDistances:a,horizontal:h,offset:o>1?m/2:m/4,active:f===_,container:s})]},_)})})}function u2(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r)[t]}return n}function u5t({scales:e,orientation:t,geom:n,aes:r,sideDistances:a,showTooltips:i,tooltipsContainer:o}){let[s,c]=Vn.useState(null),f=t==="vertical",A=u2(e,"lineColor",r.lineColor,n.id),h=u2(e,"lineShape",r.lineShape,n.id),m=u2(e,"fillColor",r.dotFill,n.key1),g=u2(e,"dotShape",r.dotShape,n.key1),b=u2(e,"fillColor",r.dotFill,n.key2),C=u2(e,"dotShape",r.dotShape,n.key2),x=Af(g,r.dotSize,m),k=Af(C,r.dotSize,b);function _(D){return n.grouping==="primary"?(e.xPrimary(D)??0)+e.xPrimary.bandwidth()/2:(e.xPrimary(n.id)??0)+(e.xSecondary(D)??0)+e.xSecondary.bandwidth()/2}return le.jsx("g",{opacity:r.opacity,children:n.pairs.map(D=>{let O=f?_(n.key1):e.y(D.key1.value),I=f?_(n.key2):e.y(D.key2.value),$=f?e.y(D.key1.value):_(n.key1),Q=f?e.y(D.key2.value):_(n.key2);return le.jsxs("g",{children:[le.jsx("line",{x1:O,y1:$,x2:I,y2:Q,stroke:A,strokeDasharray:td(h),strokeWidth:r.lineWidth,fill:"none"}),le.jsxs("g",{transform:`translate(${O},${$})`,children:[x,i&&o&&le.jsx("circle",{onMouseOver:()=>c(D.key1.id),onMouseLeave:()=>c(null),r:"15",fill:"transparent",stroke:"none"}),i&&le.jsx(oc,{content:[D.id,Ki(D.key1.value)],x:O,y:$,sideDistances:a,horizontal:!0,active:s===D.key1.id,container:o})]}),le.jsxs("g",{transform:`translate(${I},${Q})`,children:[k,i&&o&&le.jsx("circle",{onMouseOver:()=>c(D.key2.id),onMouseLeave:()=>c(null),r:"15",fill:"transparent",stroke:"none"}),i&&le.jsx(oc,{content:[D.id,Ki(D.key2.value)],x:I,y:Q,sideDistances:a,horizontal:!0,active:s===D.key2.id,container:o})]})]},D.id)})})}function oK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function c5t(e,t,n){return n?[t,`${Ki(e)}`]:[`${Ki(e)}`]}function f5t({scales:e,orientation:t,geom:n,aes:r,hasKeyFromColumn:a,sideDistances:i,showTooltips:o,tooltipsContainer:s}){let[c,f]=Vn.useState(null),A=t==="vertical",h=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,m=e.xSecondary.bandwidth(),g=r.width==="auto"?m*.8:Math.min(m,r.width),b=_=>(1-_*2)*(g/2),C=oK(e,"dotFill",r.dotFill,n),x=oK(e,"dotShape",r.dotShape,n),k=Af(x,r.dotSize,C);return le.jsx("g",{transform:A?`translate(${h},0)`:`translate(0, ${h})`,children:n.points.map(({x:_,y:D,jitter:O,id:I})=>{let $=A?D*b(O):e.y(_),Q=A?e.y(_):D*b(O);return le.jsxs("g",{opacity:r.opacity,transform:`translate(${$},${Q})`,children:[k,o&&s&&le.jsx("circle",{onMouseOver:()=>f(I),onMouseLeave:()=>f(null),r:"4",fill:"transparent",stroke:"none"}),o&&le.jsx(oc,{content:c5t(D,I,a),x:h+$,y:Q,active:c===I,sideDistances:i,container:s})]},I)})})}function lK(e,t,n,r,a){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(a)[t]}return n}function d5t({scales:e,orientation:t,geom:n,aes:r,sideDistances:a,showTooltips:i,elementsAmount:o,tooltipsContainer:s,normalize:c,secondaryGrouping:f}){let[A,h]=Vn.useState(null),m=t==="vertical",g=e.xPrimary.bandwidth(),b=(e.xPrimary(n.primaryGrouping)??0)+g/2,C=r.width==="auto"?g*.8:Math.min(g,r.width),x=e.xSecondary.domain().reverse(),k={},_=0;return x.forEach(D=>{if(!n.valuesMap[D])return;let O=n.valuesMap[D].height;k[D]={y1:_,y2:_+O},_+=O}),le.jsx("g",{transform:m?`translate(${b},0)`:`translate(0, ${b})`,opacity:r.opacity,strokeWidth:r.lineWidth,children:x.map(D=>{if(!n.valuesMap[D])return null;let{y1:O,y2:I}=k[D],$=e.y(O),Q=e.y(I),ee=Math.abs($-Q),K=lK(e,"lineColor",r.lineColor,n.primaryGrouping,D),re=lK(e,"fillColor",r.fillColor,n.primaryGrouping,D);return le.jsxs("g",{children:[le.jsx("rect",{width:m?C:ee,height:m?ee:C,x:m?-C/2:Math.min($,Q),y:m?Math.min($,Q):-C/2,fill:re,stroke:K,onMouseOver:()=>h(D),onMouseLeave:()=>h(null)}),i&&le.jsx(oc,{content:[f.valueLabels[D],Ki(n.valuesMap[D].height)+(c?"%":"")],x:m?b:($+Q)/2,y:m?($+Q)/2:b,sideDistances:a,horizontal:m,offset:o>1?g/2:g/4,active:A===D,container:s})]},D)})})}function sK(e,t,n,r){let a=t.reduce((i,o,s)=>(i[o]=s,i),{});return e.filter(([,i])=>r?i<=n.one:!0).sort(([[i,o]],[[s,c]])=>i!==o?a[o]-a[i]:a[c]-a[s])}function A5t(e,t){let n=t.reduce((a,i,o)=>(a[i]=o,a),{}),r=[];return e.map(([[a,i]])=>{let o=n[a],s=n[i];for(let c=0;c<r.length;c++)if(r[c]<o)return r[c]=s,c;return r.push(s),r.length-1})}function uK(e,t,n,r){let a=t.reduce((o,s,c)=>(o[s]=c,o),{}),i=[];return sK(e,t,n,!r).forEach(([[o,s]])=>{let c=a[o],f=a[s];for(let A=0;A<i.length;A++)if(i[A]<c){i[A]=f;return}i.push(f)}),i.length}var p5t={ttest:"TTest",anova:"ANOVA",kruskalWallis:"Kruskal-Wallis",wilcoxon:"Wilcoxon"};function h5t(e,t){return e<=t.three?"***":e<=t.two?"**":e<=t.one?"*":"ns"}function SP(e,t,n,r){return!r&&e>n.one?"":t==="significance"?h5t(e,n):Ki(e)}var c2=18,BP=12;function m5t({orientation:e,scales:t,testMethod:n,values:r,statType:a,format:i,ns:o,significanceLevels:s,yShift:c}){if(!r.length)return null;let f=k=>(t.xPrimary(k)??0)+t.xPrimary.bandwidth()/2,A=e==="vertical",h=Math.abs(t.xPrimary.range()[1]-t.xPrimary.range()[0]),m=Math.abs(t.y.range()[1]-t.y.range()[0]),g=t.xPrimary.domain(),b=a==="pairwise"?sK(r,g,s,!o):r,C=a==="pairwise"?A5t(b,g):[],x=Math.max(...C);return le.jsxs("g",{fontSize:"14px",transform:A?`translate(0,${c})`:`translate(${m-c},0)`,children:[a==="overall"&&le.jsx("text",{x:A?h/2:-c2,y:A?c2:h/2,transform:A?"":`rotate(90,${-c2},${h/2})`,textAnchor:"middle",children:`${p5t[n]}, p = ${SP(r[0][1],"pValue",s,!0)}`}),a==="referenceGroup"&&le.jsx("g",{children:r.map(([[k],_])=>le.jsx("text",{x:A?f(k):-c2,y:A?c2:f(k),transform:A?"":`rotate(90,${-c2},${f(k)})`,textAnchor:"middle",children:SP(_,i,s,o)},k))}),a==="pairwise"&&le.jsx("g",{children:b.map(([[k,_],D],O)=>{let I=f(k),$=f(_),Q=(I+$)/2;return le.jsxs("g",{transform:A?`translate(0,${(x-C[O])*i2})`:`translate(${-(x-C[O])*i2},0)`,children:[le.jsx("text",{x:A?Q:-BP,y:A?BP:Q,transform:A?"":`rotate(90,${-BP},${Q})`,textAnchor:"middle",children:SP(D,i,s,o)}),le.jsx("path",{d:A?`M ${I},21 v-4 h ${$-I} v4`:`M -21,${I} h 4 v ${$-I} h-4`,fill:"none",stroke:Zt})]},`${k}_${_}`)})})]})}function v5t(e){return`translate(${e},0)`}function g5t(e){return`translate(0,${e})`}function y5t(e){return e==="bottom"?`translate(0,${ed})`:`translate(${-ed},0)`}function w5t(e){return e==="bottom"?"hanging":"central"}function C5t(e){return e==="bottom"?"middle":"end"}var cK=({scale:e,tickSize:t=6,tickPadding:n=ed,orient:r="bottom",onlyPositive:a=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function o(_){return D=>{let O=_(D);return O===void 0?0:+O}}let s=Math.abs(e.range()[0]-e.range()[1]),c=Math.min(Math.floor(s/tK),10),f=e.ticks(c).filter(_=>a&&_>=0||!a),A=f.some(_=>Math.abs(_)<1e-4&&_!==0||_>1e4)?",e":",f",h=_=>e.tickFormat(c,A)(_),m=Math.max(t,0)+n,g=o(e.copy()),b=r==="bottom"?v5t:g5t,C=r==="left"?-1:1,x={[(r==="left"?"x":"y")+"2"]:C*t},k={[r==="left"?"x":"y"]:C*m};return le.jsx("g",{children:f.map((_,D)=>le.jsxs("g",{className:"tick",transform:b(g(_)+i),children:[le.jsx("line",{stroke:Zt,...x}),le.jsx("g",{transform:y5t(r),children:le.jsx("text",{fill:Zt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:w5t(r),textAnchor:C5t(r),...k,children:h(_)})})]},D))})};function fK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function b5t({scales:e,orientation:t,violin:n,aes:r,maxViolinDensity:a,showTooltips:i,sideDistances:o,elementsAmount:s,tooltipsContainer:c}){let[f,A]=Vn.useState(!1),h=t==="vertical",m=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,g=e.xSecondary.bandwidth(),b=r.width==="auto"?g*.8:Math.min(g,r.width),C=fK(e,"lineColor",r.lineColor,n),x=fK(e,"fillColor",r.fillColor,n),k=n.getArea(t,e.y,b,a)??"",_=n.getLine(t,e.y,b,a)??"",D=Math.abs(e.y.range()[0]-e.y.range()[1]);return le.jsxs("g",{transform:h?`translate(${m},0)`:`translate(0, ${m})`,opacity:r.opacity,stroke:C,fill:x,strokeWidth:r.lineWidth,strokeDasharray:td(r.lineShape),children:[le.jsx("clipPath",{id:`violin_${n.key}`,children:le.jsx("path",{d:k})}),le.jsx("path",{d:k,stroke:"none"}),r.showQuartiles&&le.jsxs("g",{"clip-path":`url(#violin_${n.key})`,strokeWidth:r.lineWidth,stroke:C,children:[le.jsx("line",{x1:h?-b/2:e.y(n.quartiles.q1),x2:h?b/2:e.y(n.quartiles.q1),y1:h?e.y(n.quartiles.q1):-b/2,y2:h?e.y(n.quartiles.q1):b/2,strokeDasharray:td(r.quartilesLineStyle)}),le.jsx("line",{x1:h?-b/2:e.y(n.quartiles.q2),x2:h?b/2:e.y(n.quartiles.q2),y1:h?e.y(n.quartiles.q2):-b/2,y2:h?e.y(n.quartiles.q2):b/2,strokeDasharray:td(r.medianLineStyle)}),le.jsx("line",{x1:h?-b/2:e.y(n.quartiles.q3),x2:h?b/2:e.y(n.quartiles.q3),y1:h?e.y(n.quartiles.q3):-b/2,y2:h?e.y(n.quartiles.q3):b/2,strokeDasharray:td(r.quartilesLineStyle)})]}),le.jsx("path",{d:_,fill:"none"}),i&&c&&le.jsx("rect",{onMouseOver:()=>A(!0),onMouseLeave:()=>A(!1),width:h?g:D,x:h?-g/2:0,y:h?0:-g/2,height:h?D:g,fill:"transparent",stroke:"none"}),i&&le.jsx(oc,{content:[`Quartile 3 = ${Ki(n.quartiles.q3)}`,`Median = ${Ki(n.quartiles.q2)}`,`Quartile 1 = ${Ki(n.quartiles.q1)}`],x:h?m:e.y(n.quartiles.q2),y:h?e.y(n.quartiles.q2):m,sideDistances:o,horizontal:h,active:f,offset:s>1?b/2:b/4,container:c})]})}var E5t=1;function x5t({scaleX:e,scaleY:t,orientation:n,width:r,height:a,axisX:i,axisY:o,frameType:s}){let[c,f]=Vn.useState(e.domain()),A=Math.abs(t.range()[0]-t.range()[1]),h=Math.min(Math.floor(A/tK),10),[m,g]=Vn.useState(t.ticks(h)),b=e.bandwidth()/2,C=_=>(e(_)??0)+b,x=_=>t(_),k=n==="vertical";return Vn.useEffect(()=>{let _=e.domain(),D=t.ticks(h);f(_),g(D)},[e,t]),le.jsxs("g",{stroke:Jf,children:[i.showGrid&&c.map(_=>{let D=C(_)+(i.linesBetweenCategories?b:0);return le.jsx("line",{x1:k?D:0,x2:k?D:r,y1:k?0:D,y2:k?a:D},`x_${_}`)}),o.showGrid&&m.map(_=>{let D=x(_);return le.jsx("line",{x1:k?0:D,x2:k?r:D,y1:k?D:0,y2:k?D:a},`y_${_}`)}),s!=="empty"&&le.jsxs("g",{strokeWidth:E5t,children:[(i.showGrid||s!=="left")&&le.jsx("line",{stroke:s==="left"?Jf:Zt,x1:"0",x2:r,y1:a,y2:a}),(i.showGrid||s!=="bottom")&&le.jsx("line",{stroke:s==="bottom"?Jf:Zt,x1:"0",x2:"0",y1:"0",y2:a}),(i.showGrid||s==="full")&&le.jsx("line",{stroke:s==="full"?Zt:Jf,x1:r,x2:r,y1:"0",y2:a}),(o.showGrid||s==="full")&&le.jsx("line",{stroke:s==="full"?Zt:Jf,x1:"0",x2:r,y1:"0",y2:"0"})]})]})}function S5t(e,t,n){if(!e.length)return[];let r=[0];for(let a=0;a<e.length-1;a++){let i=e[a];if(i.meta.statType==="pairwise"){let o=uK(i.values[n],t,i.meta.significanceLevels,i.meta.ns);r.push(r[r.length-1]+i2*o)}else r.push(r[r.length-1]+i2)}return r}function dK(e){return typeof e=="string"?e:e.value}function B5t({facetSettings:e,facetTitle:t,dimensions:n,scales:r,orientation:a,layersData:i,statsData:o,facetKey:s,xAxis:c,yAxis:f,frameType:A,tooltips:h,tooltipsContainer:m,keyColumn:g,chartSizes:b,margins:C,xLabels:x,onlyPositive:k,secondaryGrouping:_}){let D=a==="vertical",O=S5t(o,r.xPrimary.domain(),s),I=c.showTicks?eK:0,$=f.showTicks?eK:0,Q=dK(c.title),ee=dK(f.title),K=n.chartEdgeSides.includes("left")||D&&!(e!=null&&e.sharedY)||!D&&!(e!=null&&e.sharedX),re=n.chartEdgeSides.includes("bottom")||D&&!(e!=null&&e.sharedX)||!D&&!(e!=null&&e.sharedY),U=n.chartEdgeSides.includes("left"),G=n.chartEdgeSides.includes("bottom"),{width:Z,height:Y}=n.inner,{left:X,top:oe,padding:me}=n,ae={left:C.left+X+me.left,right:b.totalWidth-(C.left+X+me.left),top:C.top+oe+me.top,bottom:b.totalHeight-(C.top+oe+me.top)},ye=`translate(${X+me.left},${oe+me.top})`,Ce=!1;return le.jsxs("g",{transform:ye,children:[Ce,t.length&&le.jsxs("g",{children:[A==="full"&&le.jsx("rect",{x:"0",y:-me.top,height:me.top,width:Z,fill:"#F7F8FA",stroke:Zt}),t.map((ce,ge)=>{let ze=t.length,Ne=(me.top-m9*ze)/2;return le.jsx("text",{fontSize:"14px",fontWeight:"500",fill:Zt,x:Z/2,dy:Ne+m9/2-me.top,y:ge*m9,textAnchor:"middle",dominantBaseline:"central",children:ce},ge)})]}),le.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Zt,children:[G&&le.jsx("text",{x:Z/2,y:Y+me.bottom-l1/2,children:D?Q:ee}),G&&Ce&&le.jsx("rect",{x:"0",y:Y+me.bottom-l1,width:Z,height:l1,fill:"none",stroke:"black"}),U&&le.jsx("text",{x:-me.left+l1/2,y:Y/2,transform:`rotate(-90,${-me.left+l1/2},${Y/2})`,children:D?ee:Q}),U&&Ce&&le.jsx("rect",{x:-me.left,y:"0",width:l1,height:Y,fill:"none",stroke:"black"})]}),le.jsx(x5t,{orientation:a,width:Z,height:Y,scaleX:r.xPrimary,scaleY:r.y,axisX:c,axisY:f,frameType:A}),re&&le.jsx("g",{transform:`translate(0,${Y})`,children:D?le.jsx(rK,{scale:r.xPrimary,orient:"bottom",labelsPosition:c.labelsPosition,tickSize:I,labels:x}):le.jsx(cK,{scale:r.y,onlyPositive:k,orient:"bottom",tickSize:$})}),K&&le.jsx("g",{children:D?le.jsx(cK,{scale:r.y,onlyPositive:k,orient:"left",tickSize:$}):le.jsx(rK,{scale:r.xPrimary,orient:"left",labelsPosition:c.labelsPosition,tickSize:I,labels:x})}),le.jsxs("g",{children:[i.map(ce=>le.jsxs("g",{children:[ce.type==="box"&&ce.geoms[s].map(ge=>le.jsx(t5t,{box:ge,elementsAmount:ce.geoms[s].length,scales:r,orientation:a,aes:ce.aes,hasKeyFromColumn:g!==null,sideDistances:ae,showTooltips:h.box.show,tooltipsContainer:m},ge.key)),ce.type==="violin"&&ce.geoms[s].map(ge=>le.jsx(b5t,{violin:ge,elementsAmount:ce.geoms[s].length,scales:r,orientation:a,maxViolinDensity:ce.meta.maxDensity,aes:ce.aes,sideDistances:ae,showTooltips:h.violin.show,tooltipsContainer:m},ge.key)),ce.type==="dot"&&ce.geoms[s].map(ge=>le.jsx(r5t,{geom:ge,scales:r,orientation:a,aes:ce.aes,hasKeyFromColumn:g!==null,sideDistances:ae,showTooltips:h.dot.show,tooltipsContainer:m},ge.key)),ce.type==="line"&&ce.geoms[s].map(ge=>le.jsx(o5t,{line:ge,scales:r,orientation:a,sideDistances:ae,aes:ce.aes,showTooltips:h.line.show,secondaryGrouping:_,tooltipsContainer:m},ge.key)),ce.type==="errorbar"&&ce.geoms[s].map(ge=>le.jsx(a5t,{errorBar:ge,scales:r,orientation:a,aes:ce.aes,sideDistances:ae,showTooltips:h.errorBar.show,tooltipsContainer:m},ge.key)),ce.type==="bar"&&ce.geoms[s].map(ge=>le.jsx(J2t,{bar:ge,scales:r,orientation:a,aes:ce.aes},ge.key)),ce.type==="stackedBar"&&ce.geoms[s].map(ge=>le.jsx(d5t,{geom:ge,elementsAmount:ce.geoms[s].length,scales:r,orientation:a,aes:ce.aes,normalize:ce.meta.normalize,sideDistances:ae,showTooltips:h.stackedBar.show,secondaryGrouping:_,tooltipsContainer:m},ge.key)),ce.type==="binnedDots"&&ce.geoms[s].map(ge=>le.jsx(q2t,{geom:ge,scales:r,orientation:a,aes:ce.aes,binsCount:ce.meta.binsCount,min:ce.meta.minY,max:ce.meta.maxY,hasKeyFromColumn:ce.meta.hasKeyFromColumn,sideDistances:ae,showTooltips:h.stackedBar.show,tooltipsContainer:m},ge.key)),ce.type==="pairedPoints"&&ce.geoms[s].map(ge=>le.jsx(u5t,{geom:ge,scales:r,orientation:a,sideDistances:ae,aes:ce.aes,showTooltips:h.pairedPoints.show,tooltipsContainer:m},ge.id)),ce.type==="sina"&&ce.geoms[s].map(ge=>le.jsx(f5t,{geom:ge,scales:r,orientation:a,sideDistances:ae,aes:ce.aes,hasKeyFromColumn:g!==null,showTooltips:!1,tooltipsContainer:m},ge.key)),ce.type==="logo"&&ce.geoms[s].map(ge=>le.jsx(s5t,{geom:ge,elementsAmount:ce.geoms[s].length,scales:r,orientation:a,aes:ce.aes,normalize:ce.meta.normalize,sideDistances:ae,showTooltips:!0,tooltipsContainer:m},ge.key))]},ce.type)),o.map((ce,ge)=>le.jsx(m5t,{yShift:O[ge],scales:r,orientation:a,statType:ce.meta.statType,values:ce.values[s],testMethod:ce.meta.testMethod,format:ce.meta.format,ns:ce.meta.ns,significanceLevels:ce.meta.significanceLevels},`${ce.meta.statType}_${ce.meta.testMethod}`))]})]})}var f2=class extends gb.Component{constructor(e){super(e),this.state={hasError:!1,message:""}}static getDerivedStateFromError(e){return{hasError:!0,message:e.message}}componentDidUpdate(e){e.dataId!==this.props.dataId&&this.setState({hasError:!1,message:"error.message"})}componentDidCatch(e,t){console.log(t)}render(){return this.state.hasError?le.jsx(Fm,{message:this.state.message}):this.props.children}};function k5t(e,t,n,r){return e==="left"?n:e==="right"?t-r:(t-(n+r))/2+n}function T5t(e){return e==="left"?"start":e==="right"?"end":"middle"}function d2({show:e,position:t,title:n,chartsWidth:r,leftPadding:a,rightPadding:i}){return e?le.jsx("g",{children:n.map((o,s)=>le.jsx("text",{x:k5t(t,r,a,i),textAnchor:T5t(t),y:-(n.length-s-1)*24-24-24/2,fontSize:"20px",fontFamily:"Manrope",fontWeight:"500",dominantBaseline:"central",children:o},`${o}_${s}`))}):null}var Hc=12,g9=-12,AK=14;function _5t(e=null){return e==="dashed"?"M1 11.25H6V12.75H1V11.25ZM9.5 11.25H14.5V12.75H9.5V11.25ZM18 11.25H23V12.75H18V11.25Z":e==="dotted"?"M2.75 11.25H1.25V12.75H2.75V11.25Z M11.25 11.25H12.75V12.75H11.25V11.25Z M22.75 11.25H21.25V12.75H22.75V11.25Z M7.75 11.25H6.25V12.75H7.75V11.25Z M16.25 11.25H17.75V12.75H16.25V11.25Z":e==="longdash"?"M1 11.25H10V12.75H1V11.25ZM14 11.25H23V12.75H14V11.25Z":e==="dotdash"?"M1 11.25H2.5V12.75H1V11.25ZM17 12.75H7V11.25H17V12.75ZM21.5 12.75V11.25H23V12.75H21.5Z":e==="twodash"?"M1 11.25H4V12.75H1V11.25ZM17.0261 12.75H7V11.25H17.0261V12.75ZM20 12.75V11.25H23V12.75H20Z":"M1 11.25H23V12.75H1V11.25Z"}var P5t=3,M5t=24;function D5t({aes:e,label:t,usedAes:n}){let r=n.lineShape,a=n.dotShape,i=n.fillColor||n.lineColor&&!n.lineShape||n.dotFill&&!n.dotShape,o=a?Af(e.dotShape??"21",P5t,i?Zt:e.dotFill??Zt):null,s=(a&&r?2*Hc:0)-6,c=r?s+M5t+8:Hc+8;return le.jsxs("g",{children:[i&&le.jsx("rect",{width:Hc,height:Hc,stroke:e.fillColor??e.lineColor,fill:e.fillColor??e.lineColor,rx:"1",ry:"1"}),a&&le.jsx("g",{transform:`translate(${Hc/2},${Hc/2})`,children:o}),r&&le.jsx("path",{transform:`translate(${s},-5)`,fillRule:"evenodd",clipRule:"evenodd",d:_5t(e.lineShape),fill:e.lineColor}),le.jsx("text",{x:c,y:Hc/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function H5t({aes:e,label:t}){let n=Af(e.shape,e.size,e.color);return le.jsxs("g",{children:[le.jsx("g",{transform:`translate(${Hc/2},${Hc/2})`,children:n}),le.jsx("text",{x:Hc+8,y:Hc/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function y9({legendData:e}){let t=e.items.filter(n=>n.type==="continuous");return le.jsxs("g",{children:[le.jsx("defs",{children:t.map(n=>le.jsx("linearGradient",{id:n.id,gradientTransform:"rotate(90)",children:n.scale.domain().reverse().map(r=>{let a=n.scale.domain(),i=a[a.length-1]-a[0],o=i>0?100-(r-a[0])/i*100:0;return le.jsx("stop",{offset:`${o}%`,stopColor:n.scale(r)},r)})},n.id))}),e.items.map(n=>{if(n.type==="continuous")return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[le.jsx("text",{fontWeight:500,fontSize:"14px",y:g9,children:n.title}),le.jsx("rect",{x:"0",y:"0",width:AK,height:n.height,stroke:Zt,fill:`url(#${n.id})`}),le.jsx("g",{transform:`translate(${AK},0)`,children:n.values.map(r=>{let a=n.tickPositionScale(r)??0;return le.jsxs("g",{transform:`translate(0,${a})`,children:[le.jsx("line",{x1:"0",x2:-4,stroke:Zt}),le.jsx("text",{x:8,y:4,children:r})]},r)})}),!1]},n.id);if(n.type==="discreteColor")return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[le.jsx("text",{fontWeight:500,fontSize:"14px",y:g9,children:n.title}),n.values.map((r,a)=>le.jsxs("g",{transform:`translate(0, ${a*(Hc+4)})`,children:[le.jsx("rect",{x:"0",y:"0",width:Hc,height:Hc,fill:n.scale(r),rx:"1",ry:"1",stroke:Zt}),le.jsx("text",{x:Hc+8,y:10,children:r})]},r)),!1]},n.id);if(n.type==="discreteMulti")return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[le.jsx("text",{fontWeight:600,y:g9,children:n.title}),n.values.map((r,a)=>le.jsx("g",{transform:`translate(0, ${a*(Hc+4)})`,children:le.jsx(D5t,{aes:n.scale(r),label:n.labels[r],usedAes:n.usedAes})},r)),!1]},n.id);if(n.type==="dots")return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[le.jsx("text",{fontWeight:500,y:g9,children:n.title}),n.values.map((r,a)=>le.jsx("g",{transform:`translate(0, ${a*(Hc+4)})`,children:le.jsx(H5t,{aes:n.scale(r),label:n.labels[r]})},r)),!1]},n.id);if(n.type==="size"){let r=n.height/n.values.length;return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[le.jsx("text",{fontWeight:500,y:g9,children:n.title}),n.values.map((a,i)=>{let o=n.scale(a);return le.jsxs("g",{transform:`translate(0, ${i*r})`,children:[le.jsx("circle",{r:o,cx:r/2,cy:r/2,fill:Zt}),le.jsx("text",{x:r+4,y:r/2,alignmentBaseline:"central",children:n.labels[a]})]},a)}),!1]},n.id)}})]})}function I5t({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,facetKeys:a,facetTitles:i,facetSettings:o,scales:s,layersData:c,statsData:f,legendData:A,margins:h,columnsCount:m,keyColumn:g,xLabels:b,chartTitle:C,onlyPositive:x,secondaryGrouping:k}){let[_,D]=Vn.useState(),{orientation:O,xAxis:I,yAxis:$,title:Q,legend:ee,frame:K}=t,re=r[a[0]].padding,U=r[a[m-1]].padding,G=n.chartsWidth+j8,Z=re.top;return le.jsx(f2,{dataId:e,children:le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${n.totalWidth} ${n.totalHeight}`,width:n.totalWidth,height:n.totalHeight,children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${h.left},${h.top})`,fontFamily:"Manrope",children:[le.jsx(d2,{title:C,show:Q.show,position:Q.position,leftPadding:re.left,rightPadding:U.right,chartsWidth:n.chartsWidth}),a.map(Y=>le.jsx(B5t,{facetKey:Y,facetTitle:i[Y],facetSettings:o,orientation:O,scales:{...s,xPrimary:s.xPrimary[Y],xSecondary:s.xSecondary[Y],y:s.y[Y]},chartSizes:n,margins:h,dimensions:r[Y],layersData:c,statsData:f,xAxis:I,yAxis:$,frameType:K.type,tooltips:t.tooltips,tooltipsContainer:_,keyColumn:g,xLabels:b[Y],onlyPositive:x,secondaryGrouping:k},Y)),ee.show&&le.jsx("g",{transform:`translate(${G},${Z})`,children:le.jsx(y9,{legendData:A})})]}),le.jsx("g",{ref:Y=>{Y&&!_&&D(Y)}})]})})}function pK(e,t){let n=Object.keys(e.values),r=e.reduce((a,i)=>{if(i.meta.statType==="pairwise"){let o=Object.values(i.values).map(s=>uK(s,t,i.meta.significanceLevels,i.meta.ns));return a+i2*Math.max(...o)}return(i.meta.ns?t.length>0:n.some(o=>i.values[o].some(([,s])=>s<i.meta.significanceLevels.one)))?a+i2:a},Q2t);return Math.max(h9.TOP,r)}function A2(e,t,n=r=>r){let r=A=>t==="log"?Math.log10(A):A,a=A=>t==="log"?Math.pow(10,A):A,i=e.map(n).map(r).sort((A,h)=>A-h),o=Dp(i,.25),s=Dp(i,.75),c=s-o,f=1.5;return[a(o-f*c),a(s+f*c)]}function L5t(e,t,n,r=14){let a=new Dc(`600 ${r}px Manrope`),i=[];e.split(new RegExp("(?=[_-])|(?<=[_-])")).forEach(h=>{a.getTextWidth(h)>n?i.push(...h.split("")):i.push(h)});let o="",s=0,c=0,f="";for(;s<=t;){let h=a.getTextWidth(o+i[c]);h<t&&(o+=i[c],f=o,c++),s=h}o="",s=0;let A=[];for(c;c<i.length;c++){let h=a.getTextWidth(o+i[c]);h<n?(o+=i[c],s=h):(A.push(o),o=i[c],s=a.getTextWidth(i[c]))}return{firstPart:f,lines:A,lastPart:o,lastPartLength:s}}function Om(e,t,n){let r=new Dc(`600 ${n}px Manrope`);if(e.trim()==="")return[];if(r.getTextWidth(e)<=t)return[e];let a=e.split(/\s+/),i=[],o="",s=0;for(let c=0;c<a.length;c++){let f=`${o} ${a[c]}`,A=r.getTextWidth(f);if(A<=t)o=f,s=A;else{let h=r.getTextWidth(a[c]);if(h>t){let{firstPart:m,lines:g,lastPart:b,lastPartLength:C}=L5t(a[c],t-s,t,n);i.push(`${o} ${m}`),i.push(...g),o=b,s=C}else i.push(o),o=a[c],s=h}}return i.push(o),i.filter(c=>c.length>0)}var hK=new Dc("600 14px Manrope"),R5t=16,kP=48,N5t=20,Pg=24;function TP(e,t){return Math.max(...e.map(n=>hK.getTextWidth(String(n))+N5t),hK.getTextWidth(t))}function $5t(e,t,n,r){let a=[[]],i=0,o=t,s=0;return e.forEach(c=>{i+r<=o?(a[s].push(c),i+=r):(a.push([c]),s++,i=r,o=n)}),a}function w9(e,t,n){let r=n??t,a=0,i=0,o=0;e.sort((c,f)=>c.type==="continuous"&&f.type!=="continuous"?-1:f.type==="continuous"&&c.type!=="continuous"?1:c.type==="dots"&&f.type!=="dots"?-1:f.type==="dots"&&c.type!=="dots"?1:0);let s=[];return e.forEach(c=>{let{type:f,values:A,title:h,id:m,scale:g}=c;if(f==="continuous"){let b=UX(A,h),C=r;t-i<C&&(o+=a+Pg,a=0,i=0);let x=o,k=i;b>a&&(a=b),i+=C+kP,i>=t&&(o+=a+Pg,a=0,i=0),s.push({...c,width:b,height:C,left:x,top:k})}else if(f==="size"){let{labels:b}=c,C=g(Math.max(...A))*2+4,x=TP(A.map(O=>b[O]),h),k=A.length*C;t-i<k&&(o+=a+Pg,a=0,i=0);let _=o,D=i;x>a&&(a=x),i+=k+kP,i>=t&&(o+=a+Pg,a=0,i=0),s.push({...c,width:x,height:k,left:_,top:D})}else{let{labels:b}=c,C=R5t,x=t-i;x<C&&(x=t,o+=a+Pg,a=0,i=0);let k=$5t(A,x,t,C),_=TP([],h),D=a===0,O=o+_+Pg;k.forEach((I,$)=>{let Q=$===k.length-1,ee=$>0?"":h,K=$>0?`${m}_${$}`:m,re=TP(I.map(Y=>b[Y]),D?"":ee),U=I.length*C,G=o,Z=i;re>a&&(a=re),Q?i+=U+kP:i=t,i>=t&&(o+=a+Pg,D&&Q&&o<O&&(o=O),a=0,i=0),s.push({...c,id:K,title:ee,width:re,height:U,left:G,top:Z,values:I})})}}),s}function F5t(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function V5t(e,t,n,r,a,i,o,s,c,f){let A=e==="vertical",h=o.includes("left")||A&&!(s!=null&&s.sharedY)||!A&&!(s!=null&&s.sharedX),m=o.includes("left")&&n.title!=="",g=o.includes("bottom")||A&&!(s!=null&&s.sharedX)||!A&&!(s!=null&&s.sharedY),b=o.includes("bottom")&&t.title!=="",C=r.yAxisCaptionsWidth,x=(n.showTicks?t2:0)+ed,k=m?l1:0,_=r.xAxisCaptionsWidthByRows[A?c:f],D=(t.showTicks?t2:0)+ed,O=b?l1:0,I=A?C+x+k:_+D+O,$=A?D+_+O:x+2*l1,Q=Math.max(...a.map(ee=>i[ee].length));return{left:h?I:CP,top:Q===0?0:O2t*2+Q*m9,bottom:g?$:CP,right:CP}}function O5t(e,t,n){let r=new Array(n).fill(null).map(()=>[]);for(let a=0;a<n;a++)for(let i=0;i<t;i++)i*n+a<e.length&&r[a].push(e[i*n+a]);return r}function mK(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function Q5t(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function z5t(e){return typeof e=="object"&&"type"in e}var U5t=class{constructor(){Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"component",le.jsx(le.Fragment,{}));Me(this,"chartsDimensions",{});Me(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Me(this,"columnsCount",1);Me(this,"rowsCount",1);Me(this,"scales",{xPrimary:{null:F5().range([0,600]).domain(["1"])},xSecondary:{null:F5().range([0,600]).domain(["1"])},y:{null:Da().domain([0,10]).range([350,0]).nice()},xPrimaryAes:Hl().unknown(qX),xSecondaryAes:Hl().unknown(qX)});Me(this,"facetTitles",{});Me(this,"mainTitle",[]);Me(this,"axisLabelsX",{});Me(this,"captionsSizes",{xAxisCaptionsWidthByRows:[],xCaptionsTail:0,yAxisCaptionsWidth:100});Me(this,"legend",{width:0,height:0,items:[]});Me(this,"margins",{left:0,right:0,top:0,bottom:0})}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=zh(this.rootNode))}updateChartSize(e,t,n,r,a,i){let o=pK(i,r),s=t.length,c=Math.min((n==null?void 0:n.nRows)??s,s),f=Math.min((n==null?void 0:n.nCols)??s,s);this.columnsCount=n!=null&&n.nRows?Math.ceil(s/c):f,this.rowsCount=Math.ceil(s/this.columnsCount);let{width:A,height:h}=e;a==="vertical"&&o>h9.TOP&&(h+=o),a==="horizontal"&&o>h9.TOP&&(A+=o),this.chartSizes.chartWidth=A,this.chartSizes.chartHeight=h}updateChartDimensions(e,t,n,r,a){let{chartWidth:i,chartHeight:o}=this.chartSizes,s=0,c=0;this.chartsDimensions=e.reduce((h,m,g)=>{let[b,C]=Q5t(g,this.columnsCount),x=F5t(g,e.length,this.columnsCount,this.rowsCount),k=V5t(n,r,a,this.captionsSizes,mK(e,this.rowsCount,this.columnsCount)[b],this.facetTitles,x,t,b,C),_=i+k.left+k.right,D=o+k.top+k.bottom;return h[m]={left:s,top:c,chartEdgeSides:x,padding:k,inner:{width:i,height:o},outer:{width:_,height:D}},s+=_,C===this.columnsCount-1&&(s=0,c+=D),h},{});let f=Math.max(...e.map(h=>this.chartsDimensions[h].outer.width+this.chartsDimensions[h].left)),A=Math.max(...e.map(h=>this.chartsDimensions[h].outer.height+this.chartsDimensions[h].top));this.chartSizes.chartsWidth=f,this.chartSizes.chartsHeight=A}updateViewport(e,t,n,r,a,i,o,s,c){let f=e==="vertical",A=pK(s,t),h=a===null||a.sharedX,m=a===null||a.sharedY,{chartHeight:g,chartWidth:b}=this.chartSizes;r.forEach(C=>{let x=i.scale==="log"?Rv():Da(),k=Math.min(...m?o.map(({meta:I})=>I.minY):o.map(({geoms:I})=>Math.min(...I[C].map(({boundsY:$})=>$.min)))),_=Math.max(...m?o.map(({meta:I})=>I.maxY):o.map(({geoms:I})=>Math.max(...I[C].map(({boundsY:$})=>$.max)))),D=x.copy().domain([k,_]).range(f?[g-h9.BOTTOM,A]:[h9.BOTTOM,b-A]);x.domain([D.invert(f?g:0),D.invert(f?0:b)]).range(f?[g,0]:[0,b]),this.scales.y[C]=x;let O=h?t:c[C];this.scales.xPrimary[C]=F5().domain(O).range(f?[0,b]:[g,0]),this.scales.xSecondary[C]=F5().domain(n).range([0,this.scales.xPrimary[C].bandwidth()])})}createFacetTitles(e,t){this.facetTitles=e.reduce((n,r,a)=>(t[a].length===1&&t[a][0]==="null"?n[r]=[]:n[r]=Om(t[a].join(", "),this.chartSizes.chartWidth,14),n),{})}createMainTitle(e,t){let n=this.chartsDimensions[e[0]],r=this.chartsDimensions[e[e.length-1]];this.mainTitle=Om(t.name,this.chartSizes.chartsWidth-n.padding.left-r.padding.right,20)}createAxisLabels(e,t,n,r){let a={center:120,"45deg":256,"90deg":320},i=r==="vertical";function o(s,c){return s==="center"?1/0:Math.floor(s==="45deg"?c*Math.sin(Math.PI/4)/bP:c/bP)}this.axisLabelsX=e.reduce((s,c)=>{let f=this.scales.xPrimary[c],A=f.bandwidth(),h=a[t.labelsPosition],m=t.labelsPosition==="center"?Math.min(h,A):h,g=n.valueLabels;return s[c]=f.domain().reduce((b,C)=>{let x=g[C];if(!i)b[C]=[x];else{let k=o(t.labelsPosition,A),_=Om(x,m,14);b[C]=_.length>k?[x]:_}return b},{}),s},{})}updateAesScales(e,t){if(e.inheritedAes){let{inheritedAes:n,keys:r}=e;this.scales.xPrimaryAes.domain(r).range(r.map(a=>n[a]))}else this.scales.xPrimaryAes.domain([]).range([]);if(t.inheritedAes){let{inheritedAes:n,keys:r}=t;this.scales.xSecondaryAes.domain(r).range(r.map(a=>n[a]))}else this.scales.xSecondaryAes.domain([]).range([])}updateCaptionsSize(e,t,n){let r=new Dc("600 14px Manrope"),a=e==="vertical";function i(g){return g.length?Math.max(...g.map(b=>r.getTextWidth(b))):0}function o(g){return g.length?Math.max(...g.map(i)):0}let s=[],c=0,f=mK(t,this.rowsCount,this.columnsCount),A=O5t(t,this.rowsCount,this.columnsCount);if(!a)s=A.map(g=>Math.max(...g.map(b=>o(this.scales.xPrimary[b].domain().map(C=>this.axisLabelsX[b][C])))));else{if(n.labelsPosition==="center"&&(s=f.map(g=>Math.max(...g.map(b=>Math.max(...this.scales.xPrimary[b].domain().map(C=>C?this.axisLabelsX[b][C].length*bP:0)))))),n.labelsPosition==="45deg"){let g=Math.sin(Math.PI/4);s=f.map(b=>Math.max(...b.map(C=>{let x=this.scales.xPrimary[C].domain().map(_=>this.axisLabelsX[C][_]),k=o(x);return k>0?k*g+14:0}))),c=Math.max(...A[0].map(b=>{let C=this.scales.xPrimary[b].domain(),x=this.axisLabelsX[b][C[0]];return Math.max(i(x)*g-this.scales.xPrimary[b].bandwidth()/2+14,0)}))}n.labelsPosition==="90deg"&&(s=f.map(g=>Math.max(...g.map(b=>o(this.scales.xPrimary[b].domain().map(C=>this.axisLabelsX[b][C]))))))}let h=Ir.flatten(t.map(g=>{let b=this.scales.y[g],C=b.ticks(),x=C.some(_=>Math.abs(_)<1e-4&&_!==0||_>1e4)?",e":",f",k=b.tickFormat(10,x);return C.map(k)})),m=i(h);this.captionsSizes={xCaptionsTail:c,xAxisCaptionsWidthByRows:s,yAxisCaptionsWidth:m}}updateMargins(e,t){let n=this.chartsDimensions[t[0]],r=this.chartsDimensions[t[t.length-1]],a=e==="vertical";this.margins={left:Math.max(z8,a?this.captionsSizes.xCaptionsTail-n.padding.left:0),right:Math.max(this.legend.width,z8),top:Math.max(24*this.mainTitle.length+24*2,z8),bottom:Math.max(z8,a?0:this.captionsSizes.xCaptionsTail-r.padding.bottom)},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartsHeight,this.legend.height)+this.margins.bottom}updateLegendSize(e,t,n,r){if(!e.show){this.legend={width:0,height:0,items:[]};return}let a=this.chartSizes.chartHeight,i={width:0,height:0,left:0,top:0},o=[];function s(b,C){return r.some(x=>{let k=x.aes[C];return k&&z5t(k)&&k.type===b})}function c(b){return{dotFill:s(b,"dotFill"),fillColor:s(b,"fillColor"),lineColor:s(b,"lineColor"),dotShape:s(b,"dotShape"),lineShape:s(b,"lineShape")}}let f=c("primaryGrouping"),A=c("secondaryGrouping");if(Object.values(f).some(b=>b)&&t.inheritedAes&&o.push({type:"discreteMulti",id:"primary",title:t.label,scale:this.scales.xPrimaryAes,values:t.keys,labels:t.valueLabels,usedAes:f,...i}),Object.values(A).some(b=>b)&&n.inheritedAes&&o.push({type:"discreteMulti",id:"secondary",title:n.label,scale:this.scales.xSecondaryAes,values:n.keys,labels:n.valueLabels,usedAes:A,...i}),!o.length){this.legend={width:0,height:0,items:[]};return}let h=w9(o,this.chartSizes.chartHeight),m=h[h.length-1],g=m.left+m.width+2*j8;this.legend={width:g,height:a,items:h}}render(e,t,n,r,a,i,o,s,c,f,A,h){var k;let{orientation:m,xAxis:g,yAxis:b,size:C}=t;this.updateChartSize(C,i,a,n.keys,m,c),this.updateViewport(m,n.keys,r.keys,i,a,b,s,c,A),this.createAxisLabels(i,g,n,m),this.createFacetTitles(i,o),this.updateCaptionsSize(m,i,g),this.updateChartDimensions(i,a,m,g,b),this.updateLegendSize(t.legend,n,r,s),this.createMainTitle(i,t.title),this.updateMargins(m,i),this.updateAesScales(n,r);let x=le.jsx(I5t,{settingsId:e,chartSettings:t,facetKeys:i,facetSettings:a,facetTitles:this.facetTitles,chartSizes:this.chartSizes,chartsDimensions:this.chartsDimensions,scales:this.scales,layersData:s,statsData:c,legendData:this.legend,margins:this.margins,columnsCount:this.columnsCount,keyColumn:f,xLabels:this.axisLabelsX,chartTitle:this.mainTitle,onlyPositive:h,secondaryGrouping:r});this.component=x,(k=this.reactRoot)==null||k.render(x)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},j5t=U5t;function G5t(e,t,n,r=!1){let a=e.map(t).sort((i,o)=>i-o);if(r){let i=Ir.find(a,o=>o>0);if(!i)throw Error("Group with all zeros in log scale");return a.map(o=>o===0?i:o).map(n)}return a.map(n)}var Y5t=class{constructor(e,t,n,r,a,i,o,s,c,f,A=!0){Me(this,"lower");Me(this,"middle");Me(this,"upper");Me(this,"min");Me(this,"max");Me(this,"outliers");Me(this,"primaryGrouping");Me(this,"secondaryGrouping");Me(this,"key");Me(this,"boundsY");if(e.length===0)throw Error("Unable to create box on empty data");if(o>s||o>c||s>c)throw Error(`Invalid box bounds values: lower=${o}, middle=${s}, upper=${c}`);if(f<0)throw Error(`Invalid box whiskers coefficient: k=${f}. It should be positive`);let h=I=>Number(I[t]);this.primaryGrouping=a===null?"":String(a),this.secondaryGrouping=i===null?"":String(i),this.key=`box_${this.primaryGrouping}_${this.secondaryGrouping}`;let m=I=>r==="log"?Math.log10(I):I,g=I=>r==="log"?Math.pow(10,I):I,b=G5t(e,h,m,r==="log"),C=Dp(b,o),x=Dp(b,s),k=Dp(b,c),_=k-C;this.upper=g(k),this.middle=g(x),this.lower=g(C),this.min=Math.max(mC(e,h),g(C-f*_)),this.max=Math.min(Ih(e,h),g(k+f*_)),this.outliers=e.filter(I=>h(I)<this.min||h(I)>this.max).map((I,$)=>({y:h(I),data:I,id:String(n?I[n]:$)}));let[D=1/0,O=-1/0]=$A(this.outliers,I=>I.y);this.boundsY={min:A?Math.min(this.min,D):this.min,max:A?Math.max(this.max,O):this.max}}};function W5t(e,t,n,r,a,i,o,s){let c=1/0,f=-1/0;return{type:"box",geoms:t.reduce((A,h)=>{let m=h.join("_");return A[m]=[],n.forEach(g=>{r.forEach(b=>{let C=a.getRowsByGrouping([...h,g,b]);if(!C.length)return;let x=new Y5t(C,i.value,(o==null?void 0:o.value)??null,s.scale,g,b,e.stat.lower,e.stat.medium,e.stat.upper,e.stat.k,e.aes.showOutliers);x.boundsY.min<c&&(c=x.boundsY.min),x.boundsY.max>f&&(f=x.boundsY.max),A[m].push(x)})}),A},{}),meta:{minY:c,maxY:f},aes:e.aes}}var vK=40;function X5t(e,t){return function(n){return t.map(function(r){return[r,tu(n,a=>e(r-a))]})}}function K5t(e){return function(t){return 1/Math.sqrt(2*Math.PI)*Math.pow(Math.E,-.5*Math.pow(t/e,2))}}function Z5t(e){let t=tu(e);return tu(e.map(n=>Math.pow(n-t,2)))}function J5t(e){return Math.sqrt(Z5t(e))}function q5t(e,t,n){let r=(n-t)/1.34,a=J5t(e);return 1.06*Math.min(a,r)*Math.pow(e.length,-1/5)}var e7t=class{constructor(e,t,n,r,a,i){Me(this,"getArea");Me(this,"getLine");Me(this,"maxDensity");Me(this,"primaryGrouping");Me(this,"secondaryGrouping");Me(this,"key");Me(this,"boundsY");Me(this,"quartiles");if(e.length===0)throw Error("Unable to calculate violin on empty data");if(r!=="auto"&&r<1)throw Error(`Unable to calculate violin with ${r} steps`);this.primaryGrouping=a===null?"":String(a),this.secondaryGrouping=i===null?"":String(i),this.key=`violin_${this.primaryGrouping}_${this.secondaryGrouping}`;let o=I=>t==="log"?Math.log10(I):I,s=I=>t==="log"?Math.pow(10,I):I,c=e.filter(I=>t==="log"&&Number(I)===0?(console.warn("Value = 0 on chart with log scale, it was removed from calculation"),!1):!0).map(o).sort((I,$)=>I-$),f=c[0],A=c[c.length-1],h=A-f,m=Dp(c,.25),g=Dp(c,.5),b=Dp(c,.75);this.quartiles={q1:s(m),q2:s(g),q3:s(b)};let C=q5t(c,m,b),x=r!=="auto"?r:C/3>h/vK?vK:h/(C/3),k=n?f:f-3*C,_=n?A:A+3*C,D=Da().domain([k,_]).ticks(x);this.boundsY={min:s(D[0]),max:s(D[D.length-1])};let O=X5t(K5t(C),D)(c).map(([I,$])=>[s(I),$]);this.maxDensity=Ih(O,([,I])=>I),this.getArea=(I,$,Q,ee)=>{let K=I==="vertical",re=ee??this.maxDensity,U=Da().domain([-re,re]).range([-Q/2,Q/2]);return K?VB().curve(A3).x0(G=>U(G[1])).x1(G=>U(-G[1])).y(G=>$(G[0]))(O):VB().curve(A3).y0(G=>U(G[1])).y1(G=>U(-G[1])).x(G=>$(G[0]))(O)},this.getLine=(I,$,Q,ee)=>{let K=I==="vertical",re=ee??this.maxDensity,U=Da().domain([-re,re]).range([-Q/2,Q/2]);return d3().curve(A3).x(K?G=>U(G[1]):G=>$(G[0])).y(K?G=>$(G[0]):G=>U(G[1]))(O)+" "+d3().curve(A3).x(K?G=>U(-G[1]):G=>$(G[0])).y(K?G=>$(G[0]):G=>U(-G[1]))(O)}}};function t7t(e,t,n,r,a,i,o){let s=0,c=1/0,f=-1/0;return{type:"violin",geoms:t.reduce((A,h)=>{let m=h.join("_");return A[m]=[],n.forEach(g=>{r.forEach(b=>{let C=a.getColumnByGrouping([...h,g,b],i.value);if(!C.length)return;let x=new e7t(C,o.scale,e.stat.trim,e.stat.stepsCount,g,b);x.maxDensity>s&&(s=x.maxDensity),x.boundsY.min<c&&(c=x.boundsY.min),x.boundsY.max>f&&(f=x.boundsY.max),A[m].push(x)})}),A},{}),meta:{maxDensity:s,minY:c,maxY:f},aes:e.aes}}var n7t=30;function r7t(e,t){return function(n){return t.map(function(r){return tu(n,a=>e(r-a))})}}function a7t(e){return function(t){return 1/Math.sqrt(2*Math.PI)*Math.pow(Math.E,-.5*Math.pow(t/e,2))}}function i7t(e){let t=tu(e);return tu(e.map(n=>Math.pow(n-t,2)))}function o7t(e){return Math.sqrt(i7t(e))}function l7t(e){let t=Dp(e,.25),n=(Dp(e,.75)-t)/1.34,r=o7t(e);return 1.06*Math.min(r,n)*Math.pow(e.length,-1/5)}var s7t=class{constructor(e,t,n,r,a,i){Me(this,"key");Me(this,"maxDensity");Me(this,"primaryGrouping");Me(this,"secondaryGrouping");Me(this,"points");Me(this,"boundsY");let o=n7t;if(e.length===0)throw Error("Unable to calculate sina on empty data");this.primaryGrouping=r===null?"":String(r),this.secondaryGrouping=a===null?"":String(a),this.key=`sina_${this.primaryGrouping}_${this.secondaryGrouping}`;let s=D=>n==="log"?Math.log10(D):D,c=D=>n==="log"?Math.pow(10,D):D,f=D=>Number(D[t.value]),A=e.filter(D=>n==="log"&&f(D)===0?(console.warn("Value = 0 on chart with log scale, it was removed from calculation"),!1):!0).sort((D,O)=>s(f(D))-s(f(O))),h=A.map(D=>s(f(D))),m=h[0],g=h[A.length-1],b=(g-m)/o,C=l7t(h),x=Ir.range(m+b,g,b);this.boundsY={min:c(m),max:c(g)};let k=r7t(a7t(C),x)(h),_=Da().domain(x).range(k).clamp(!0);this.maxDensity=Ih(k),this.points=A.map((D,O)=>({x:f(D),y:_(s(f(D)))/this.maxDensity,id:String(O),jitter:i(),data:D}))}};function u7t(e,t,n,r,a,i,o){let s=0,c=1/0,f=-1/0,A=nF(1);return{type:"sina",geoms:t.reduce((h,m)=>{let g=m.join("_");return h[g]=[],n.forEach(b=>{r.forEach(C=>{let x=a.getRowsByGrouping([...m,b,C]);if(!x.length)return;let k=x;if(!e.aes.showOutliers){let D=$=>Number($[i.value]),[O,I]=A2(x,o.scale,D);k=x.filter($=>{let Q=D($);return Q>=O&&Q<=I})}let _=new s7t(k,i,o.scale,b,C,A);_.maxDensity>s&&(s=_.maxDensity),_.boundsY.min<c&&(c=_.boundsY.min),_.boundsY.max>f&&(f=_.boundsY.max),h[g].push(_)})}),h},{}),meta:{maxDensity:s,minY:c,maxY:f},aes:e.aes}}function c7t(e,t,n,r,a,i,o,s){let c=1/0,f=-1/0,A=nF(1);return{type:"dot",geoms:t.reduce((h,m)=>{let g=m.join("_");return h[g]=[],n.forEach(b=>{r.forEach(C=>{let x=a.getRowsByGrouping([...m,b,C]);if(!x.length)return;let k=I=>Number(I[i.value]),_=x.map((I,$)=>({y:k(I),jitter:A(),id:String(s?I[s.value]:$),data:I}));if(!e.aes.showOutliers){let[I,$]=A2(x,o.scale,k);_=_.filter(({y:Q})=>Q>=I&&Q<=$)}let[D=1/0,O=-1/0]=$A(_,I=>I.y);D<c&&(c=D),O>f&&(f=O),h[g].push({key:`dots_${b}_${C}`,values:_,primaryGrouping:b,secondaryGrouping:C,boundsY:{min:D,max:O}})})}),h},{}),meta:{minY:c,maxY:f},aes:e.aes}}function f7t(e,t){if(t==="median")return mL(e,.5);if(t==="mean")return tu(e);vA(t,`Unknown line points calculation for dot layer: ${t}`)}function d7t(e,t,n,r,a,i,o){let s=1/0,c=-1/0;return{type:"line",geoms:t.reduce((f,A)=>{let h=A.join("_");f[h]=[];let m=-1/0,g=1/0;return e.aes.showOutliers||([m,g]=A2(a.getColumnByGrouping([...A],i.value),o.scale)),r.forEach(b=>{let C={key:`${b}`,boundsY:{min:1/0,max:-1/0},dots:{}},x=!1,k=D=>o.scale==="log"?Math.log10(D):D,_=D=>o.scale==="log"?Math.pow(10,D):D;n.forEach(D=>{let O=a.getColumnByGrouping([...A,D,b],i.value);if(!O.length){x=!0;return}let I=O;if(e.aes.showOutliers||(I=O.filter(Q=>Q>=m&&Q<=g)),!I.length){x=!0;return}let $=_(f7t(I.map(k),e.pointsValues));C.dots[D]=$,$<s&&(s=$),$>c&&(c=$),$<C.boundsY.min&&(C.boundsY.min=$),$>C.boundsY.max&&(C.boundsY.max=$)}),x||f[h].push(C)}),f},{}),meta:{minY:s,maxY:c},aes:e.aes}}function A7t(e){let t=tu(e);return tu(e.map(n=>Math.pow(n-t,2)))}function _P(e){return Math.sqrt(A7t(e))}function p7t(e){return _P(e)/Math.sqrt(e.length)}function h7t(e){return 1.96*_P(e)}function m7t(e,t){if(t==="median")return mL(e,.5);if(t==="mean")return tu(e);vA(t,"Unknown points calculation")}function v7t(e,t){if(t==="sd")return _P(e);if(t==="se")return p7t(e);if(t==="ci")return h7t(e);vA(t,"Unknown error interval calculation")}function g7t(e,t,n,r,a,i,o){let s=1/0,c=-1/0;return{type:"errorbar",geoms:t.reduce((f,A)=>{let h=A.join("_");f[h]=[];let m=b=>o.scale==="log"?Math.log10(b):b,g=b=>o.scale==="log"?Math.pow(10,b):b;return n.forEach(b=>{r.forEach(C=>{let x=a.getColumnByGrouping([...A,b,C],i.value);if(!x.length)return;let k=x.map(m),_=g(m7t(k,e.pointsValues)),D=g(v7t(k,e.interval)),O=_-D,I=_+D;O<s&&(s=O),I>c&&(c=I),f[h].push({key:`errorbar_${b}_${C}`,primaryGrouping:b,secondaryGrouping:C,value:_,min:O,max:I,boundsY:{min:O,max:I}})})}),f},{}),meta:{minY:s,maxY:c},aes:e.aes}}function y7t(e,t,n,r){if(e.length===0)throw Error("Unable to create bar on empty data");let a=s=>t==="log"?Math.log10(s):s,i=s=>t==="log"?Math.pow(10,s):s,o=s=>{let c=Number(s[n]);if(t==="log"&&c<1)throw Error(`Value < 1 in log scale: ${c}`);return c};switch(r){case"max":return Ih(e,o)??o(e[0]);case"min":return mC(e,o)??o(e[0]);case"median":{let s=e.map(c=>Number(c[n])).map(a).sort((c,f)=>c-f);return i(Dp(s,.5))}case"mean":return tu(e,o)??o(e[0]);default:vA(r,`Unknown bar height function ${r}`)}}function w7t(e,t,n,r,a,i,o){let s=-1/0,c=1/0;return{type:"bar",geoms:t.reduce((f,A)=>{let h=A.join("_");return f[h]=[],n.forEach(m=>{r.forEach(g=>{let b=a.getRowsByGrouping([...A,m,g]);if(!b.length)return;let C=y7t(b,o.scale,i.value,e.height);s=Math.max(s,C,0),c=Math.min(c,C,0),f[h].push({key:`bar_${m}_${g}`,value:C,primaryGrouping:m,secondaryGrouping:g,boundsY:{min:Math.min(0,C),max:Math.max(0,C)}})})}),f},{}),meta:{minY:c,maxY:s},aes:e.aes}}function C7t(e,t,n,r,a,i){let o=-1/0,s=1/0;return{type:"stackedBar",geoms:t.reduce((c,f)=>{let A=f.join("_");return c[A]=[],n.forEach(h=>{let m=0,g={};r.forEach(x=>{let k=a.getRowsByGrouping([...f,h,x]);if(!k.length)return;let _=Sc(k,D=>Number(D[i.value]));g[x]={height:_,key:x},m+=_});let b=m;e.normalize&&r.forEach(x=>{g[x]&&(g[x].height=g[x].height/b*100)}),o=Math.max(o,0,m),s=Math.min(s,0,m);let C=e.normalize?100:b;c[A].push({key:`stackedBar_${h}`,valuesMap:g,primaryGrouping:h,boundsY:{min:Math.min(C,0),max:Math.max(C,0)}})}),c},{}),meta:{minY:e.normalize?0:s,maxY:e.normalize?100:o,normalize:e.normalize},aes:e.aes}}var gK=30;function b7t(e,t,n,r,a,i){let o=e.map(m=>n(a(m))),s=e.length,c=e.map(A),f=[];function A(m,g){return{key:i(m,g),value:a(m)}}let h=0;for(let m=1;m<s;++m){let g=o[h],b=o[m],C=o[m-1];if(b>=g+t){let x=Math.min((g+C)/2,b-t);o.fill(x,h,m),f.push({x:r(x),count:m-h,dots:c.slice(h,m)}),h=m}}return o.fill((o[h]+o[s-1])/2,h,s),f.push({x:r((o[h]+o[s-1])/2),count:s-h,dots:c.slice(h,s)}),f}var E7t=class{constructor(e,t,n,r,a,i,o,s,c,f){Me(this,"bins");Me(this,"primaryGrouping");Me(this,"secondaryGrouping");Me(this,"key");Me(this,"boundsY");this.primaryGrouping=n===null?"":String(n),this.secondaryGrouping=r===null?"":String(r),this.key=`binnedDots_${this.primaryGrouping}_${this.secondaryGrouping}`;let A=e.filter(h=>s(h)===0&&c==="log"?(console.warn(`Item with ${t} = 0 is not shown on chart with log scale`),!1):!0).sort((h,m)=>i(s(h))-i(s(m)));this.bins=b7t(A,a,i,o,s,(h,m)=>String(f?h[f.value]:m)),this.boundsY={min:this.bins[0].x,max:this.bins[this.bins.length-1].x}}};function x7t(e,t,n,r,a,i,o){let s=x=>o.scale==="log"?Math.log10(x):x,c=x=>o.scale==="log"?Math.pow(10,x):x,f=x=>Number(x[i.value]),A=1/0,h=-1/0,m=a.getRowsByGrouping([]),[g=f(m[0]),b=f(m[0])]=$A(m.filter(x=>Number(x[i.value])===0&&o.scale==="log"?(console.warn(`Item with ${i.value} = 0 is not shown on chart with log scale`),!1):!0),x=>Number(x[i.value])),C=Math.abs(s(g)-s(b))/gK;return{type:"binnedDots",geoms:t.reduce((x,k)=>{let _=k.join("_");return x[_]=[],n.forEach(D=>{r.forEach(O=>{let I=a.getRowsByGrouping([...k,D,O]);if(!I.length)return;let $=I;if(!e.aes.showOutliers){let[ee,K]=A2(I,o.scale,f);$=I.filter(re=>{let U=f(re);return U>=ee&&U<=K})}let Q=new E7t($,i.value,D,O,C,s,c,f,o.scale,e.keyColumn);Q.boundsY.min<A&&(A=Q.boundsY.min),Q.boundsY.max>h&&(h=Q.boundsY.max),x[_].push(Q)})}),x},{}),meta:{minY:Math.min(g,b,A),maxY:Math.max(g,b,h),binsCount:gK,hasKeyFromColumn:e.keyColumn!==null},aes:e.aes}}function S7t(e,t){if(t.length===2)return"secondary";if(e.length===2&&t.length<2)return"primary";throw Error("Too many groups for paired points layer")}function yK(e,t,n,r,a,i,o,s,c){let f=Ir.groupBy(n,D=>D[a.value]),A=Ir.groupBy(r,D=>D[a.value]),h=Object.keys(f),m=Object.keys(A);if(Ir.uniq(h).length!==h.length||Ir.uniq(m).length!==m.length)throw Error(`Non unique keys in groups ${e}, ${t} for paired points layer`);if(h.length!==m.length||Ir.intersection(h,m).length!==h.length)throw Error(`Keys in groups ${e}, ${t} not match for paired points layer`);let g=D=>Number(D[i.value]),b=1/0,C=-1/0,x=!1,k=c==="log",_=h.map(D=>{let O=f[D][0],I=A[D][0],$=g(O),Q=g(I);return($===0||Q===0)&&(x=!0),b=Math.min(b,k&&$===0?1/0:$,k&&Q===0?1/0:Q),C=Math.max(C,k&&$===0?-1/0:$,k&&Q===0?-1/0:Q),{id:D,key1:{id:`${D}_${e}`,value:$,data:O},key2:{id:`${D}_${t}`,value:Q,data:I}}});if(!s){b=1/0,C=-1/0;let[D,O]=A2(n,c,g),[I,$]=A2(r,c,g);_=_.filter(({key1:Q,key2:ee})=>Q.value<D||Q.value>O||ee.value<I||ee.value>$?!1:(b=Math.min(b,k&&Q.value===0?1/0:Q.value,k&&ee.value===0?1/0:ee.value),C=Math.max(C,k&&Q.value===0?-1/0:Q.value,k&&ee.value===0?-1/0:ee.value),!0))}return b=x?b/10:b,C=Math.max(C,b),{id:`${e}_${t}`,key1:e,key2:t,pairs:_.map(D=>({...D,key1:{...D.key1,value:D.key1.value===0?b:D.key1.value},key2:{...D.key2,value:D.key2.value===0?b:D.key2.value}})),grouping:o,boundsY:{min:b,max:C}}}function B7t(e,t,n,r,a,i,o){let s=S7t(n,r),c=1/0,f=-1/0;return{type:"pairedPoints",geoms:t.reduce((A,h)=>{let m=h.join("_");if(A[m]=[],s==="primary"){let[g,b]=n,C=a.getRowsByGrouping([...h,g]),x=a.getRowsByGrouping([...h,b]),k=yK(g,b,C,x,e.linkColumn,i,s,e.aes.showOutliers,o.scale);c=Math.min(c,k.boundsY.min),f=Math.max(f,k.boundsY.max),A[m].push(k)}else s==="secondary"&&n.forEach(g=>{let[b,C]=r,x=a.getRowsByGrouping([...h,g,b]),k=a.getRowsByGrouping([...h,g,C]),_=yK(b,C,x,k,e.linkColumn,i,s,e.aes.showOutliers,o.scale);c=Math.min(c,_.boundsY.min),f=Math.max(f,_.boundsY.max),A[m].push(_)});return A},{}),meta:{minY:c,maxY:f},aes:e.aes}}function wK(e,t){let n;if(e==t){n=new Array(t+1);for(let r=0;r<n.length;++r)n[r]=r+1}else if(e<t){n=new Array(t-e+1);for(let r=0;r<n.length;++r)n[r]=e+r}else{n=new Array(e-t+1);for(let r=0;r<n.length;++r)n[r]=e-r}return n}function p2(e,t){return Ir.orderBy(e.map((n,r)=>[n,r]),([n])=>n,[t?"desc":"asc"]).map(([,n])=>n)}function k7t(e){if(e.length<1)throw new Error("cummin requires at least one element");let t=new Array(e.length),n=e[0];for(let r=0;r<e.length;++r)e[r]<n&&(n=e[r]),t[r]=n;return t}function T7t(e){if(e.length<1)throw new Error("cummax requires at least one element");let t=new Array(e.length),n=e[0];for(let r=0;r<e.length;++r)e[r]>n&&(n=e[r]),t[r]=n;return t}function CK(e,t){if(e.length<1)throw new Error("pmin requires at least one element");return e.map(n=>Math.min(n,t))}function _7t(e){if(e.length<1)throw new Error("pAdjust requires at least one element");return Math.min(...e)}function P7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=new Array(t);for(let r=0;r<t;++r){let a=e[r]*t;if(a>=1)n[r]=1;else if(0<=a)n[r]=a;else throw new Error(`${a} is outside [0, 1)`)}return n}function M7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=p2(e,!1),r=n.slice(),a=new Array(t).fill(0);for(let f=0;f<t;++f)a[f]=(t-f)*e[n[f]];let i=p2(r,!1),o=T7t(a),s=CK(o,1),c=new Array(t);for(let f=0;f<t;++f)c[f]=s[i[f]];return c}function D7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=wK(t,t),r=p2(e,!1),a=new Array(t);for(let h=0;h<t;++h)a[h]=e[r[h]];let i=r.slice(),o=p2(i,!1),s=new Array(t),c=new Array(t),f=new Array(t);for(let h=0;h<t;++h)f[h]=a[h]*t/n[h];let A=_7t(f);s.fill(A),c.fill(A);for(let h=t;h>=2;--h){let m=wK(1,t-h+1);for(let x=0;x<t-h+1;++x)m[x]--;let g=h-1,b=new Array(g);for(let x=0;x<g;++x)b[x]=t-h+2+x-1;let C=h*a[b[0]]/2;for(let x=1;x<g;++x){let k=a[b[x]]*h/(2+x);k<C&&(C=k)}for(let x=0;x<t-h+1;++x)s[m[x]]=Math.min(a[m[x]]*h,C);for(let x=0;x<g;++x)s[b[x]]=s[t-h];for(let x=0;x<t;++x)c[x]<s[x]&&(c[x]=s[x])}for(let h=0;h<t;++h)s[h]=c[o[h]];return s}var H7t=class{constructor(e,t,n){this.ni=e,this.o=t,this.ro=n}result(e){let t=k7t(e),n=CK(t,1),r=new Array(e.length);for(let a=0;a<e.length;++a)r[a]=n[this.ro[a]];return r}};function PP(e){let t=e.length,n=new Array(t),r=p2(e,!0);for(let i=0;i<t;++i){if(e[i]<0||e[i]>1)throw new Error("array["+i+"] = "+e[i]+" is outside [0, 1]");n[i]=t/(t-i)}let a=p2(r,!1);return new H7t(n,r,a)}function I7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=PP(e),r=new Array(t);for(let a=0;a<t;++a)r[a]=n.ni[a]*e[n.o[a]];return n.result(r)}function L7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=PP(e),r=new Array(t),a=0;for(let i=1;i<t+1;++i)a+=1/i;for(let i=0;i<t;++i)r[i]=a*n.ni[i]*e[n.o[i]];return n.result(r)}function R7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=PP(e),r=new Array(t);for(let a=0;a<t;++a)r[a]=(a+1)*e[n.o[a]];return n.result(r)}function bK(e,t){switch(t){case"BenjaminiHochberg":return I7t(e);case"BenjaminiYekutieli":return L7t(e);case"Bonferroni":return P7t(e);case"Hochberg":return R7t(e);case"Holm":return M7t(e);case"Hommel":return D7t(e);case null:return e;default:throw new Error(`Unknown p-value correction method: ${t}`)}}function N7t(e){let t=Math.abs(e),n=1/(1+t/2),r=n*Math.exp(-t*t-1.26551223+n*(1.00002368+n*(.37409196+n*(.09678418+n*(-.18628806+n*(.27886807+n*(-1.13520398+n*(1.48851587+n*(-.82215223+n*.17087277)))))))));return e>=0?r:2-r}function $7t(e){return .5*N7t(-e/Math.sqrt(2))}var F7t=class{constructor(e,t){this.value=e,this.position=t}getValue(){return this.value}getPosition(){return this.position}};function V7t(e){let t=new Array(e.length);for(let o=0;o<e.length;o++)t[o]=new F7t(e[o],o);let n=Q7t(t);t.sort((o,s)=>o.getValue()-s.getValue());let r=new Array(t.length),a=1;r[t[0].getPosition()]=a;let i=[];i.push(t[0].getPosition());for(let o=1;o<t.length;o++)t[o].getValue()>t[o-1].getValue()&&(a=o+1,i.length>1&&EK(r,i),i=[]),i.push(t[o].getPosition()),r[t[o].getPosition()]=a;return i.length>1&&EK(r,i),O7t(r,n),r}function EK(e,t){let n=(2*e[t[0]]+t.length-1)/2;t.forEach(r=>{e[r]=n})}function O7t(e,t){t.forEach(n=>{e[n]=NaN})}function Q7t(e){let t=[];for(let n=0;n<e.length;n++)isNaN(e[n].getValue())&&t.push(n);return t}var z7t=class{constructor(){Me(this,"SMALL_SAMPLE_SIZE",50)}mannWhitneyU(e,t){let n=[...e,...t],r=V7t(n),a=0;for(let s=0;s<e.length;s++)a+=r[s];let i=a-e.length*(e.length+1)/2,o=e.length*t.length-i;return Math.min(i,o)}mannWhitneyUTest(e,t,n){if(typeof n>"u")return e.length+t.length<=this.SMALL_SAMPLE_SIZE&&Object.keys(this.tiesMap(e,t)).length===0?this.mannWhitneyUTest(e,t,!0):this.mannWhitneyUTest(e,t,!1);let r=this.tiesMap(e,t),a=this.mannWhitneyU(e,t);if(n){if(Object.keys(r).length!==0)throw new Error;return this.exactP(e.length,t.length,a)}return this.approximateP(a,e.length,t.length,this.varU(e.length,t.length,r))}approximateP(e,t,n,r){let a=t*n/2;if(a==e)return 1;let i=-Math.abs(e-a+.5)/Math.sqrt(r);return 2*$7t(i)}exactP(e,t,n){let r=t*e;if(n>r)return 1;let a=n<r/2?n:r/2-n,i=0,o=0;for(;o<=a;)i+=this.uDensity(e,t,o),o++;return 2*i}uDensity(e,t,n){if(n<0||n>t*e)return 0;let r=this.uFrequencies(e,t);return r[Math.round(n+1)]/Ir.sum(r)}uFrequencies(e,t){let n=Math.max(t,e);if(n>100)throw Error("n or m > 100");let r=Math.min(t,e),a=new Array(e*t+2),i=new Array(e*t+2);for(let s=1;s<a.length;s++)a[s]=s<=n+1?1:0;i[1]=0;let o=n;for(let s=2;s<=r;s++){i[s]=0,o=o+n;let c=o+2,f=1+o/2,A=s;for(let h=1;h<=f;h++){A++,c=c-1;let m=a[h]+i[h];a[h]=m,i[A]=m-a[c],a[c]=m}}return a}varU(e,t,n){let r=e*t;if(Object.keys(n).length===0)return r*(e+t+1)/12;let a=Ir.sum(Object.values(n).map(o=>o*o*o-o)),i=e+t;return r/12*(i+1-a/(i*(i-1)))}tiesMap(e,t){let n={};for(let r=0;r<e.length;r++)n[e[r]]=n[e[r]]?n[e[r]]+1:1;for(let r=0;r<t.length;r++)n[t[r]]=n[t[r]]?n[t[r]]+1:1;for(let r in n)n[r]===1&&delete n[r];return n}};function MP(e,t,n){switch(t){case"ttest":{if(e.length>2)throw new Error("more than 2 datasets passed");if(n){if(e[0].length!==e[1].length)throw Error("Different size groups in paired test");return Aot(e[0],e[1]).pValue}let r=Mot(e[0],e[1]).pValue;return isNaN(r)?1:r}case"anova":{let r=gje(Ir.flatten(e),Ir.flatten(e.map((a,i)=>a.map(()=>String(i))))).pValue;return isNaN(r)?1:r}case"wilcoxon":{if(e.length>2)throw new Error("more than 2 datasets passed");if(n){if(e[0].length!==e[1].length)throw Error("Different size groups in paired test");return Pft(e[0],e[1]).pValue}let r=new z7t().mannWhitneyUTest(e[0],e[1]);return isNaN(r)?1:r}case"kruskalWallis":{let r=qut(...e).pValue;return isNaN(r)?1:r}default:throw new Error("Unknown test method")}}function U7t(e){return e.slice(0,-1).reduce((t,n,r)=>t.concat(e.slice(r+1).map(a=>[n,a])),[])}function j7t(e,t,n,r,a){return{type:"stats",values:t.reduce((i,o)=>{let s=[];switch(e.statType){case"overall":{let c=n.map(A=>a.getColumnByGrouping([...o,A],r.value)).filter(A=>A.length>0);if(c.length<2)break;let f=MP(c,e.testMethod,e.paired);s=[[["overall"],f]];break}case"referenceGroup":{let c=e.referenceGroup===null?null:String(e.referenceGroup);if(c!==null&&!n.includes(c))throw new Error(`Reference group ${c} for ${e.testMethod} test is not in available groups`);let f=a.getColumnByGrouping([...o,c],r.value);if(f.length===0){s=[];break}let A=n.filter(m=>m!==c).map(m=>[m,a.getColumnByGrouping([...o,m],r.value)]).filter(([,m])=>m.length>0);if(A.length<2&&e.correctionMethod!==null)break;let h=bK(A.map(([,m])=>MP([f,m],e.testMethod,e.paired)),e.correctionMethod);s=A.map(([m],g)=>[[m],h[g]]);break}case"pairwise":{let c=U7t(n).map(([A,h])=>[[A,h],[a.getColumnByGrouping([...o,A],r.value),a.getColumnByGrouping([...o,h],r.value)]]).filter(([,[A,h]])=>A.length&&h.length);if(c.length<1)break;let f=bK(c.map(([,A])=>MP(A,e.testMethod,e.paired)),e.correctionMethod);s=c.map(([A],h)=>[A,f[h]]);break}default:throw new Error("Unknown statType")}return i[o.join("_")]=s,i},{}),meta:{statType:e.statType,testMethod:e.testMethod,format:e.format,ns:e.ns,significanceLevels:e.significanceLevels}}}var C9="#3e9838",h2="21",m2=3,np=class{},xK=class extends np{constructor(t){super();Me(this,"type","box");Me(this,"stat",{upper:.75,medium:.5,lower:.25,k:1.5});Me(this,"aes",{showOutliers:!0,boxWidth:"auto",dotShape:h2,dotFill:Zt,dotSize:m2,lineColor:Zt,fillColor:C9,lineWidth:1,lineShape:"solid",opacity:1});this.stat={...this.stat,...t.stat},this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="box"&&Object.keys(this.stat).every(n=>this.stat[n]===t.stat[n])}},SK=class extends np{constructor(t){super();Me(this,"type","violin");Me(this,"stat",{bandwidth:"auto",stepsCount:40,trim:!0});Me(this,"aes",{width:"auto",lineColor:Zt,fillColor:C9,lineWidth:1,lineShape:"solid",opacity:1,showQuartiles:!0,medianLineStyle:"solid",quartilesLineStyle:"dashed"});this.stat={...this.stat,...t.stat},this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="violin"&&(this.stat.bandwidth!==t.stat.bandwidth||this.stat.trim!==t.stat.trim||this.stat.stepsCount!==t.stat.stepsCount)}},BK=class extends np{constructor(t){super();Me(this,"type","dot");Me(this,"aes",{showOutliers:!0,jitter:.8,lineColor:"none",dotFill:Zt,dotShape:h2,dotSize:m2,opacity:1});this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="dot"&&this.aes.showOutliers===t.aes.showOutliers}},kK=class extends np{constructor(t){super();Me(this,"type","line");Me(this,"pointsValues");Me(this,"aes",{showOutliers:!0,lineWidth:1,lineShape:"solid",fillColor:"none",lineColor:Zt,dotShape:h2,dotSize:m2,opacity:1});this.pointsValues=t.pointsValues,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="line"&&this.pointsValues===t.pointsValues}},TK=class extends np{constructor(t){super();Me(this,"type","errorbar");Me(this,"pointsValues");Me(this,"interval");Me(this,"aes",{showDots:!0,width:"auto",lineWidth:1,fillColor:"none",lineColor:Zt,dotShape:h2,dotSize:m2,opacity:1});this.pointsValues=t.pointsValues,this.interval=t.interval,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="errorbar"&&this.pointsValues===t.pointsValues&&this.interval===t.interval}},_K=class extends np{constructor(t){super();Me(this,"type","bar");Me(this,"height");Me(this,"aes",{width:"auto",lineWidth:1,fillColor:"none",lineColor:Zt,opacity:1});this.height=t.height??"max",this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="bar"&&this.height===t.height}},PK=class extends np{constructor(t){super();Me(this,"type","stackedBar");Me(this,"normalize",!1);Me(this,"aes",{width:"auto",lineWidth:1,fillColor:C9,lineColor:"none",opacity:1});this.normalize=t.normalize??!1,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="stackedBar"&&t.normalize===this.normalize}},MK=class extends np{constructor(t){super();Me(this,"type","logo");Me(this,"normalize",!1);Me(this,"aes",{width:"auto",fillColor:C9,lineColor:"none",opacity:1});this.normalize=t.normalize??!1,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="logo"&&t.normalize===this.normalize}},DK=class extends np{constructor(t){super();Me(this,"type","binnedDots");Me(this,"method");Me(this,"position");Me(this,"keyColumn");Me(this,"aes",{showOutliers:!0,width:"auto",lineWidth:1,fillColor:"none",lineColor:Zt,opacity:1});this.method=t.method??"dotdensity",this.position=t.position??"stack",this.keyColumn=t.keyColumn??null,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){var n,r;return t.type==="binnedDots"&&this.method===t.method&&this.position===t.position&&((n=this.keyColumn)==null?void 0:n.value)===((r=t.keyColumn)==null?void 0:r.value)}},HK=class extends np{constructor(t){super();Me(this,"type","pairedPoints");Me(this,"linkColumn");Me(this,"aes",{showOutliers:!0,lineWidth:1,lineColor:Zt,lineShape:"solid",dotFill:Zt,dotSize:m2,dotShape:h2,opacity:1});this.linkColumn=t.linkColumn,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="pairedPoints"&&this.aes.showOutliers===t.aes.showOutliers&&this.linkColumn.value===t.linkColumn.value}},IK=class extends np{constructor(t){super();Me(this,"type","sina");Me(this,"aes",{showOutliers:!0,width:"auto",dotFill:C9,dotSize:m2,dotShape:h2,opacity:1});this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="sina"&&this.aes.showOutliers===t.aes.showOutliers}},W8=class extends np{constructor(t){var n,r,a;super();Me(this,"type","stat");Me(this,"statType");Me(this,"testMethod");Me(this,"paired");Me(this,"ns");Me(this,"format");Me(this,"referenceGroup",null);Me(this,"correctionMethod",null);Me(this,"significanceLevels");this.statType=t.statType,this.testMethod=t.testMethod,this.paired=t.paired??!1,this.ns=t.ns??!0,this.format=t.format??"pValue",this.statType==="referenceGroup"&&(this.referenceGroup=t.referenceGroup??null),(this.statType==="referenceGroup"||this.statType==="pairwise")&&(this.correctionMethod=t.correctionMethod??null),this.significanceLevels={one:((n=t.significanceLevels)==null?void 0:n.one)??.05,two:((r=t.significanceLevels)==null?void 0:r.two)??.01,three:((a=t.significanceLevels)==null?void 0:a.three)??.001}}isEqualForCalculation(t){return t.type==="stat"&&Object.keys(this).every(n=>this[n]===t[n])}},LK=class{constructor(e){Me(this,"id");Me(this,"type","discrete");Me(this,"y");Me(this,"keyColumn");Me(this,"primaryGrouping");Me(this,"secondaryGrouping");Me(this,"facetSettings");Me(this,"facetBy");Me(this,"chartSettings");Me(this,"layers");var t,n,r,a,i,o,s,c;U3t.parse(e),this.id=Ir.uniqueId("settings"),this.y=e.y,this.keyColumn=e.keyColumn??null,this.primaryGrouping=e.primaryGrouping??null,this.secondaryGrouping=e.secondaryGrouping??null,this.facetSettings={sharedX:!0,sharedY:!0,titlePosition:"left",...e.facetSettings},this.facetBy=e.facetBy??[],this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(this.facetBy.length?400:600),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(this.facetBy.length?250:350)},title:{position:"center",show:!0,...e.title,name:((r=e.title)==null?void 0:r.name)??"Chart"},orientation:e.orientation??"vertical",yAxis:{title:((a=e.y)==null?void 0:a.label)??e.y.value??"",scale:"linear",showGrid:!0,showTicks:!0,...e.yAxis},xAxis:{title:((o=(i=e.primaryGrouping)==null?void 0:i.columnName)==null?void 0:o.label)??((s=e.primaryGrouping)==null?void 0:s.columnName.value)??"",showGrid:!0,showTicks:!0,linesBetweenCategories:!0,labelsPosition:"center",...e.xAxis},frame:{type:((c=e.frame)==null?void 0:c.type)??"full"},legend:{show:!0,position:"right",...e.legend},tooltips:{box:{show:!0},violin:{show:!0},boxOutliers:{show:!0},line:{show:!0},errorBar:{show:!0},dot:{show:!0},binnedDots:{show:!0},pairedPoints:{show:!0},stackedBar:{show:!0},...e.tooltips}},this.layers=e.layers.map(f=>{if(f.type==="box")return new xK(f);if(f.type==="violin")return new SK(f);if(f.type==="dot")return new BK(f);if(f.type==="line")return new kK(f);if(f.type==="errorbar")return new TK(f);if(f.type==="bar")return new _K(f);if(f.type==="stackedBar")return new PK(f);if(f.type==="stat")return new W8(f);if(f.type==="binnedDots")return new DK(f);if(f.type==="pairedPoints")return new HK(f);if(f.type==="sina")return new IK(f);if(f.type==="logo")return new MK(f);vA(f,"Unknown layer type")}).filter(Boolean)}};function RK(e,t=null,n=null){let r=(t==null?void 0:t.value)??null,a=r===null?["null"]:e.getColumnCategories(r);return Ir.intersection(n??a,a).map(String)}function NK(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}function X8(e,t){if(!t)return{keys:["null"],value:null,label:"",valueLabels:{null:""},inheritedAes:null};let n=t.columnName.value,r=Ir.uniqBy(e.rows,c=>c[n]),a=c=>String(c[n]),i=c=>t.columnName.valueLabels?String(c[t.columnName.valueLabels]):a(c),o=r.map(a),s=(t.order??o).map(String);return{keys:Ir.intersection(s,o),value:n,label:t.columnName.label??n,valueLabels:r.reduce((c,f)=>(c[a(f)]=i(f),c),{}),inheritedAes:t.inheritedAes??null}}var G7t=class extends Sg{constructor(t,n){super(t,n);Me(this,"settings");Me(this,"chartRenderer",new j5t);Me(this,"calculatedData",null);this.settings=new LK(n)}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new LK(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){console.warn("no chart state for discrete")}export(){return this._updateChart(),f3(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o;return t.chartSettings.yAxis.scale!==n.chartSettings.yAxis.scale||(((r=t.primaryGrouping)==null?void 0:r.columnName.value)??"")!==(((a=n.primaryGrouping)==null?void 0:a.columnName.value)??"")||(((i=t.secondaryGrouping)==null?void 0:i.columnName.value)??"")!==(((o=n.secondaryGrouping)==null?void 0:o.columnName.value)??"")||t.facetBy.some((s,c)=>{var f;return s.value!==((f=n.facetBy[c])==null?void 0:f.value)})||t.layers.length!==n.layers.length||t.layers.some((s,c)=>!s.isEqualForCalculation(n.layers[c]))}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{chartSettings:t,y:n,keyColumn:r,facetBy:a,layers:i,facetSettings:o}=this.settings,{yAxis:s}=t,c=this.data.rows.every(x=>{let k=x[n.value];return k===null||!(Number(k)<0)}),f=X8(this.data,this.settings.primaryGrouping),A=X8(this.data,this.settings.secondaryGrouping),h=a.map(x=>x.value)??null,m=a.length?NK(a.map(x=>{var k;return RK(this.data,x,(k=o==null?void 0:o.order)==null?void 0:k[x.value])})):[["null"]];this.data.setGrouping([...h,f.value,A.value]);let g=m.reduce((x,k)=>(x[k.join("_")]=f.keys.filter(_=>this.data.getRowsByGrouping([...k,_]).length>0),x),{}),b=i.filter(x=>!(x instanceof W8)).map(x=>{if(x instanceof xK)return W5t(x,m,f.keys,A.keys,this.data,n,r,s);if(x instanceof SK)return t7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof BK)return c7t(x,m,f.keys,A.keys,this.data,n,s,r);if(x instanceof kK)return d7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof TK)return g7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof _K)return w7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof PK)return C7t(x,m,f.keys,A.keys,this.data,n);if(x instanceof DK)return x7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof HK)return B7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof IK)return u7t(x,m,f.keys,A.keys,this.data,n,s);if(x instanceof MK)return V2t(x,m,f.keys,A.keys,this.data,n);throw new Error("Unknown layer type")}),C=i.filter(x=>x instanceof W8).map(x=>{if(f.value===null)throw new Error("Cannot calculate p-value without data grouping");return j7t(x,m,f.keys,n,this.data)});this.calculatedData={layersData:b,statsLayersData:C,primaryGrouping:f,secondaryGrouping:A,facetKeyLists:m,nonEmptyGroupsByFacets:g,onlyPositive:c}}_updateAesInData(){if(this.calculatedData===null)return;let{layers:t,facetBy:n,primaryGrouping:r,secondaryGrouping:a,facetSettings:i}=this.settings,o=t.filter(s=>!(s instanceof W8));for(let s=0;s<o.length;s++){let c=o[s];"aes"in c&&(this.calculatedData.layersData[s].aes=c.aes)}this.calculatedData.primaryGrouping=X8(this.data,r),this.calculatedData.secondaryGrouping=X8(this.data,a),this.calculatedData.facetKeyLists=n.length?NK(n.map(s=>{var c;return RK(this.data,s,(c=i==null?void 0:i.order)==null?void 0:c[s.value])})):[["null"]]}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,keyColumn:r,facetSettings:a}=this.settings;this.chartRenderer.render(t,n,this.calculatedData.primaryGrouping,this.calculatedData.secondaryGrouping,a,this.calculatedData.facetKeyLists.map(i=>i.join("_")),this.calculatedData.facetKeyLists,this.calculatedData.layersData,this.calculatedData.statsLayersData,r,this.calculatedData.nonEmptyGroupsByFacets,this.calculatedData.onlyPositive)}};function Y7t(e){let t=cL(e),n=tu(e);return t===void 0||n===void 0||t===0?r=>r:r=>(r-n)/t}function W7t(e){let t=tu(e),[n,r]=$A(e);return t===void 0||n===void 0||r===void 0||r===n?a=>a:a=>(a-t)/(r-n)}function X7t(e,t){return e==="standardScaling"?Y7t(t):e==="meanNormalization"?W7t(t):n=>n}function DP(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}function K7t(e,t,n,r,a,i,o,s,c,f,A,h){let m=a.length?a.map(Y=>e.getColumnCategories(Y.value)):[["null"]],g=i.length?i.map(Y=>e.getColumnCategories(Y.value)):[["null"]],b=o.length?o.map(Y=>e.getColumnCategories(Y.value)):[["null"]],C=DP(m),x=DP(g),k=DP(b),_=C.map(Y=>Y.join("_")),D=x.map(Y=>Y.join("_")),O=k.map(Y=>Y.join("_")),I={meta:{facetKeys:_,xGroupKeys:D,yGroupKeys:O,xKeysByGroups:{},yKeysByGroups:{},xLabels:{},yLabels:{},xGroupLabels:{},yGroupLabels:{},xDataByKeys:{},yDataByKeys:{},facetKeyValues:_.reduce((Y,X,oe)=>(Y[X]=C[oe],Y),{}),xGroupKeyValues:D.reduce((Y,X,oe)=>(Y[X]=x[oe],Y),{}),yGroupKeyValues:O.reduce((Y,X,oe)=>(Y[X]=k[oe],Y),{}),valueExtent:[1/0,-1/0]},facets:{}},$=t.valueLabels??t.value,Q=n.valueLabels??n.value,ee=s.filter(Y=>Y.axis==="x").map(Y=>Y.valueColumn.value),K=s.filter(Y=>Y.axis==="y").map(Y=>Y.valueColumn.value),re=Object.values(c??{}).map(Y=>Y.value),U=Object.values(f??{}).map(Y=>Y.value),G=Ir.uniq([...ee,...re,$]),Z=Ir.uniq([...K,...U,Q]);if(e.rows.forEach(Y=>{let X=a.length?a.map(ze=>Y[ze.value]).join("_"):"null",oe=i.length?i.map(ze=>Y[ze.value]).join("_"):"null",me=o.length?o.map(ze=>Y[ze.value]).join("_"):"null",ae=i.length?i.map(ze=>Y[ze.valueLabels??ze.value]).join(", "):"",ye=o.length?o.map(ze=>Y[ze.valueLabels??ze.value]).join(", "):"";I.meta.xGroupLabels[oe]=ae,I.meta.yGroupLabels[oe]=ye;let Ce=Y[t.value],ce=Y[n.value],ge=Y[r.value]??h;if(!(Ce===null||ce===null||ge===null)){if(I.facets[X]||(I.facets[X]={xKeys:[],yKeys:[],xKeysByGroups:{},yKeysByGroups:{},cells:{}}),I.facets[X].xKeysByGroups[oe]||(I.facets[X].xKeysByGroups[oe]=[]),I.facets[X].yKeysByGroups[me]||(I.facets[X].yKeysByGroups[me]=[]),I.facets[X].xKeys.push(Ce),I.facets[X].yKeys.push(ce),I.facets[X].xKeysByGroups[oe].push(Ce),I.facets[X].yKeysByGroups[me].push(ce),I.facets[X].cells[Ce]||(I.facets[X].cells[Ce]={}),I.meta.valueExtent[0]=Math.min(ge,I.meta.valueExtent[0]),I.meta.valueExtent[1]=Math.max(ge,I.meta.valueExtent[1]),I.facets[X].cells[Ce][ce])throw Error(`More than 1 value for x=${Ce}, y=${ce}`);if(I.meta.xLabels[Ce]&&String(Y[$])!==I.meta.xLabels[Ce])throw Error(`More than 1 x-label value for x=${Ce}`);if(I.meta.yLabels[ce]&&String(Y[Q])!==I.meta.yLabels[ce])throw Error(`More than 1 y-label value for y=${ce}`);I.meta.xLabels[Ce]=String(Y[$]),I.meta.yLabels[ce]=String(Y[Q]),G.forEach(ze=>{let Ne=typeof I.meta.xDataByKeys[ze]<"u",Ge=Ne&&typeof I.meta.xDataByKeys[ze][Ce]<"u";if(Ne||(I.meta.xDataByKeys[ze]={}),Ge&&I.meta.xDataByKeys[ze][Ce]!==Y[ze])throw Error(`More than 1 value for x = ${Ce} and column = ${ze}`);Ge||(I.meta.xDataByKeys[ze][Ce]=Y[ze])}),Z.forEach(ze=>{let Ne=typeof I.meta.yDataByKeys[ze]<"u",Ge=Ne&&typeof I.meta.yDataByKeys[ze][ce]<"u";if(Ne||(I.meta.yDataByKeys[ze]={}),Ge&&I.meta.yDataByKeys[ze][ce]!==Y[ze])throw Error(`More than 1 value for y = ${ce} and column = ${ze}`);Ge||(I.meta.yDataByKeys[ze][ce]=Y[ze])}),I.facets[X].cells[Ce][ce]={id:`${Ce}_${ce}`,x:Ce,y:ce,value:ge,normalizedValue:ge,data:Y}}}),I.meta.facetKeys=I.meta.facetKeys.filter(Y=>I.facets[Y]),I.meta.facetKeys.forEach(Y=>{let X=I.facets[Y];X.xKeys=Ir.uniq(X.xKeys),X.yKeys=Ir.uniq(X.yKeys),D.forEach(oe=>{I.facets[Y].xKeysByGroups[oe]=Ir.uniq(I.facets[Y].xKeysByGroups[oe])}),O.forEach(oe=>{I.facets[Y].yKeysByGroups[oe]=Ir.uniq(I.facets[Y].yKeysByGroups[oe])})}),A){let Y=[1/0,-1/0];I.meta.facetKeys.forEach(X=>{let{xKeys:oe,yKeys:me,cells:ae}=I.facets[X],ye=A.direction==="row"?oe:me,Ce=A.direction==="row"?me:oe,ce=A.direction==="row"?(ge,ze)=>{var Ne;return(Ne=ae[ge])==null?void 0:Ne[ze]}:(ge,ze)=>{var Ne;return(Ne=ae[ze])==null?void 0:Ne[ge]};Ce.forEach(ge=>{let ze=[];ye.forEach(Ge=>{var Xe;let Oe=(Xe=ce(Ge,ge))==null?void 0:Xe.value;Oe!==void 0&&ze.push(Oe)});let Ne=X7t(A.method,ze);ye.forEach(Ge=>{let Oe=ce(Ge,ge);Oe!==void 0&&(Oe.normalizedValue=Ne(Oe.value),Y[0]=Math.min(Oe.normalizedValue,Y[0]),Y[1]=Math.max(Oe.normalizedValue,Y[1]))})})}),I.meta.valueExtent=Y}return I.meta.xKeysByGroups=D.reduce((Y,X)=>(Y[X]=Ir.uniq(Ir.flatten(I.meta.facetKeys.map(oe=>I.facets[oe].xKeysByGroups[X]))),Y),{}),I.meta.yKeysByGroups=O.reduce((Y,X)=>(Y[X]=Ir.uniq(Ir.flatten(I.meta.facetKeys.map(oe=>I.facets[oe].yKeysByGroups[X]))),Y),{}),I.meta.valueExtent[0]===1/0&&(I.meta.valueExtent[0]=0),I.meta.valueExtent[1]===-1/0&&(I.meta.valueExtent[1]=0),I}function $K(e,t){let n=0;for(let r=0;r<e.length;r++)n+=(e[r]-t[r])*(e[r]-t[r]);return n}function FK(e,t){return Math.sqrt($K(e,t))}var VK=(e,t,n)=>{let r=0;for(let a of e)for(let i of t)r+=n[a][i];return r/e.length/t.length},Z7t=(e,t,n)=>{let r=0;for(let a of e)for(let i of t)r=Math.max(r,n[a][i]);return r},J7t=(e,t,n)=>{let r=1/0;for(let a of e)for(let i of t)r=Math.min(r,n[a][i]);return r};function q7t(e){switch(e){case"average":return VK;case"complete":return Z7t;case"single":return J7t;default:return VK}}function ewt(e){switch(e){case"euclidean":return FK;case"squaredEuclidean":return $K;default:return FK}}function OK(e=[],t,n="euclidean",r="average"){let a=ewt(n),i=q7t(r),o=t.map(c=>t.map(f=>a(c,f))),s=e.map((c,f)=>({height:0,keys:[c],indexes:[f],children:[]}));for(let c=0;c<e.length&&!(c>=e.length-1);c++){let f=1/0,A=0,h=0;for(let g=0;g<s.length;g++)for(let b=g+1;b<s.length;b++){let C=i(s[g].indexes,s[b].indexes,o);C<f&&(f=C,A=g,h=b)}let m={keys:[...s[A].keys,...s[h].keys],indexes:[...s[A].indexes,...s[h].indexes],height:f,children:[s[A],s[h]]};s.splice(Math.max(A,h),1),s.splice(Math.min(A,h),1),s.push(m)}return s[0]}function twt(e,t,n,r){let{facetKeys:a,xGroupKeys:i,yGroupKeys:o}=e.meta,s={};if(t&&r.sharedX)throw Error("Dendrogram on X axis is not available with shared by facets X axis");return a.forEach(c=>{let f={hierarchyX:[],hierarchyY:[]},A=e.facets[c];if(t){let h=[],m=[];i.forEach(g=>{let b=A.xKeysByGroups[g],C=A.yKeys,x=OK(b,b.map(k=>C.map(_=>{var D;return((D=A.cells[k][_])==null?void 0:D.normalizedValue)??t.fillNA})),t.distance,t.linkage);e.facets[c].xKeysByGroups[g]=x.keys,m.push(...x.keys),h.push(x)}),e.facets[c].xKeys=m,f.hierarchyX=h.map(g=>vb(g))}if(n){let h=[],m=[];o.forEach(g=>{let b=A.yKeysByGroups[g],C=A.xKeys,x=OK(b,b.map(k=>C.map(_=>{var D;return((D=A.cells[_][k])==null?void 0:D.normalizedValue)??n.fillNA})),n.distance,n.linkage);e.facets[c].yKeysByGroups[g]=x.keys,m.push(...x.keys),h.push(x)}),e.facets[c].yKeys=m,f.hierarchyY=h.map(g=>vb(g))}s[c]=f}),s}function nwt(e,t,n,r,a,i,o,s,c,f,A,h,m,g){let b=h.length>1&&(!c||o.includes(t.groupingPosition)),C=!c||o.includes(t.position),x=A.length>1&&(!s||o.includes(e.groupingPosition)),k=!s||o.includes(e.position),_=f.length>1,D=r.filter(oe=>o.includes(oe.position)||!s&&["left","right"].includes(oe.position)||!c&&["top","bottom"].includes(oe.position)),O=D.filter(oe=>oe.position==="left").length,I=D.filter(oe=>oe.position==="right").length,$=D.filter(oe=>oe.position==="top").length,Q=D.filter(oe=>oe.position==="bottom").length,ee=e.showTicks?U8:0,K=t.showTicks?U8:0,re=k&&e.showTitle?Vm:0,U=C&&t.showTitle?Vm:0,G=k&&e.showAxisLabels&&m>o2?n.xAxisCaptions+ee+l2:0,Z=C&&t.showAxisLabels&&g>o2?n.yAxisCaptions+K+l2:0,Y=x&&e.showGroupLabels?n.xGroupCaptions:0,X=b&&t.showGroupLabels?n.yGroupCaptions:0;return{left:{dendro:!(i!=null&&i.hidden)&&(i==null?void 0:i.position)==="left"?i.size:0,axisTitle:t.position==="left"?U:0,groups:t.groupingPosition==="left"?X:0,axis:t.position==="left"?Z:0,annotations:O*Qd+(O&&s2)},right:{dendro:!(i!=null&&i.hidden)&&(i==null?void 0:i.position)==="right"?i.size:0,axisTitle:t.position==="right"?U:0,groups:t.groupingPosition==="right"?X:0,axis:t.position==="right"?Z:0,annotations:I*Qd+(I&&s2)},top:{facetTitle:_?U2t:0,dendro:!(a!=null&&a.hidden)&&(a==null?void 0:a.position)==="top"?a.size:0,axisTitle:e.position==="top"?re:0,groups:e.groupingPosition==="top"?Y:0,axis:e.position==="top"?G:0,annotations:$*Qd+($&&s2)},bottom:{dendro:!(a!=null&&a.hidden)&&(a==null?void 0:a.position)==="bottom"?a.size:0,axisTitle:e.position==="bottom"?re:0,groups:e.groupingPosition==="bottom"?Y:0,axis:e.position==="bottom"?G:0,annotations:Q*Qd+(Q&&s2)}}}function rwt(e,t,n){return{left:s1.left.reduce((r,a,i)=>{let o=i>0?s1.left[i-1]:null,s=e.left[a];return r[a]={x:o?r[o].x-s:-s,y:0,width:s,height:n,isVisible:s>0},r},{}),right:s1.right.reduce((r,a,i)=>{let o=i>0?s1.right[i-1]:null,s=e.right[a];return r[a]={x:o?r[o].x+r[o].width:t,y:0,width:s,height:n,isVisible:s>0},r},{}),top:s1.top.reduce((r,a,i)=>{let o=i>0?s1.top[i-1]:null,s=e.top[a];return r[a]={x:0,y:o?r[o].y-s:-s,width:t,height:s,isVisible:s>0},r},{}),bottom:s1.bottom.reduce((r,a,i)=>{let o=i>0?s1.bottom[i-1]:null,s=e.bottom[a];return r[a]={x:0,y:o?r[o].y+r[o].height:n,width:t,height:s,isVisible:s>0},r},{})}}function HP(e,t,n){let r=(t-e)/n,a=Ir.range(e,t-r/2,r);return a.push(t),a}function QK(e,t){let n=HP(0,1,e.length-1),r=Da().domain(n).range(e),a=HP(0,1,t.length-1).map(i=>r(i));return Hl().domain(t).range(a).unknown("#ccc")}function awt(e,t,n,r,a,i){let o=HP(0,1,e.length-1),s=Da().domain(o).range(e),c=[r,...o.filter(C=>C>r&&C<a),a],f=[a,...o.filter(C=>C>a&&C<i),i],A=(n-t)/2,h=c.map(C=>t+A*(C-r)/(a-r)),m=f.map(C=>(t+n)/2+A*(C-a)/(i-a)),g=c.map(C=>s(C)),b=f.map(C=>s(C));return Da().domain(h.concat(m.slice(1))).range(g.concat(b.slice(1)))}function iwt(e,t,n,r){let a=e.filter(A=>A.showTitle&&(t.includes(A.position)||!n&&["left","right"].includes(A.position)||!r&&["top","bottom"].includes(A.position))),i=a.filter(A=>A.titlePosition==="left").map(A=>A.valueColumn.label??A.valueColumn.value),o=a.filter(A=>A.titlePosition==="right").map(A=>A.valueColumn.label??A.valueColumn.value),s=a.filter(A=>A.titlePosition==="top").map(A=>A.valueColumn.label??A.valueColumn.value),c=a.filter(A=>A.titlePosition==="bottom").map(A=>A.valueColumn.label??A.valueColumn.value),f=new Dc("bold 14px Arial");return{left:Math.max(...i.map(A=>f.getTextWidth(A))),right:Math.max(...o.map(A=>f.getTextWidth(A))),top:Math.max(...s.map(A=>f.getTextWidth(A))),bottom:Math.max(...c.map(A=>f.getTextWidth(A)))}}function owt(e,t,n,r,a){let{facetKeys:i,xGroupKeys:o,yGroupKeys:s,xKeysByGroups:c,yKeysByGroups:f,xLabels:A,yLabels:h}=r.meta,m=e.xGroupLabels/180*Math.PI,g=e.yGroupLabels/180*Math.PI,b=e.xAxisLabels/180*Math.PI,C=e.yAxisLabels/180*Math.PI,x=0,k=0,_=e.xGroupLabels===45,D=e.xAxisLabels===45;if(_||D)if(!t.sharedX)i.forEach($=>{let Q=o.find(Z=>r.facets[$].xKeysByGroups[Z].length>0);if(!Q)return;let ee=r.facets[$].xKeysByGroups[Q],K=n.x[$],re=K>o2,U=ee.length*K/2,G=A[ee[0]];x=Math.max(x,(_?a.getTextWidth(Q)*Math.cos(m):0)-U,(D&&re?a.getTextWidth(G)*Math.cos(b):0)-K/2)});else{let $=o[0],Q=i[0];if($){let ee=c[$],K=n.x[Q],re=K>o2,U=ee.length*K/2,G=A[ee[0]];x=Math.max(x,(_?a.getTextWidth($)*Math.cos(m):0)-U,(D&&re?a.getTextWidth(G)*Math.cos(b):0)-K/2)}}let O=e.yGroupLabels===45,I=e.yAxisLabels===45;if(O||I)if(!t.sharedY)i.forEach($=>{let Q=Ir.findLast(s,Z=>r.facets[$].yKeysByGroups[Z].length>0);if(!Q)return;let ee=r.facets[$].yKeysByGroups[Q],K=n.y[$],re=K>o2,U=ee.length*K/2,G=h[ee[ee.length-1]];k=Math.max(k,(O?a.getTextWidth(Q)*Math.cos(g):0)-U,(I&&re?a.getTextWidth(G)*Math.cos(C):0)-K/2)});else{let $=s[s.length-1],Q=i[0];if($){let ee=f[$],K=n.y[Q],re=K>o2,U=ee.length*K/2,G=h[ee[ee.length-1]];k=Math.max(k,(O?a.getTextWidth($)*Math.cos(g):0)-U,(I&&re?a.getTextWidth(G)*Math.cos(C):0)-K/2)}}return{xCaptionTail:x,yCaptionTail:k}}function zK(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function lwt(e,t,n,r,a){if(e){let s=Qd/2,c=n==="top"?-5:a+5;return{x:s,y:c,rotate:t==="left"?-90:90,anchor:t==="left"&&n==="top"?"start":"end"}}let i=n==="right"?r+5:-5,o=Qd/2;return{x:i,y:o,rotate:0,anchor:n==="right"?"start":"end"}}function K8({data:e,scales:t,stepX:n,stepY:r,x:a,y:i,annotation:o,showTitle:s,width:c,height:f,colorScale:A,aes:h,frame:m,xGroupKeys:g,yGroupKeys:b,xKeysByGroups:C,yKeysByGroups:x,setSelectedAnnotation:k}){let{position:_,titlePosition:D,valueColumn:O}=o,I=_==="left"||_==="right",$=(I?t.y:t.x).domain(),Q=lwt(I,_,D,c,f);return le.jsxs("g",{transform:`translate(${a},${i})`,children:[$.map(ee=>{let K=e==null?void 0:e[ee],re=A.type==="continuous"?A.scale(Number(K)):A.scale(String(K)),U=I?0:t.x(ee),G=I?t.y(ee):0,Z=I?Qd:n,Y=I?r:Qd;return le.jsx("rect",{x:U,y:G,width:Z,height:Y,fill:re,stroke:h.cellStrokeColor,onMouseOver:()=>k({x:a+U+Z,y:i+G+Y/2,xKey:I?null:ee,yKey:I?ee:null,value:K,title:O.label??O.value}),onMouseLeave:()=>k(null)},ee)}),m.type==="groups"&&!I&&g.map(ee=>{let K=C[ee].length;if(K===0)return null;let re=K*n,U=t.x(C[ee][0]);return le.jsx("rect",{x:U,width:re,height:Qd,stroke:Zt,fill:"none"},`${U}_${i}`)}),m.type==="groups"&&I&&b.map(ee=>{let K=x[ee].length;if(K===0)return null;let re=K*r,U=t.y(x[ee][0]);return le.jsx("rect",{y:U,width:Qd,height:re,stroke:Zt,fill:"none"},`${a}_${U}`)}),s&&le.jsx("g",{fontWeight:"500",fontSize:"14px",transform:`translate(${Q.x},${Q.y}) rotate(${Q.rotate})`,children:le.jsx("text",{textAnchor:Q.anchor,dominantBaseline:"central",children:O.label??O.value})})]})}function Z8(e,t){return e.showTitle&&t.includes(e.titlePosition)}function swt({sideElementBBoxes:e,annotations:t,annotationColorScales:n,cellsMeta:r,chartEdgeSides:a,sharedX:i,sharedY:o,width:s,height:c,scales:f,stepX:A,stepY:h,aes:m,frame:g,xGroupKeys:b,yGroupKeys:C,xKeysByGroups:x,yKeysByGroups:k,setSelectedAnnotation:_}){let D=t.filter(U=>a.includes(U.position)||!i&&["left","right"].includes(U.position)||!o&&["top","bottom"].includes(U.position)),O=D.filter(U=>U.position==="left"),I=D.filter(U=>U.position==="right"),$=D.filter(U=>U.position==="top"),Q=D.filter(U=>U.position==="bottom"),{xDataByKeys:ee,yDataByKeys:K}=r,re={scales:f,stepX:A,stepY:h,width:s,height:c,aes:m,frame:g,xGroupKeys:b,yGroupKeys:C,xKeysByGroups:x,yKeysByGroups:k,setSelectedAnnotation:_};return le.jsxs("g",{children:[O.map((U,G)=>le.jsx(K8,{annotation:U,colorScale:n[U.id],data:K[U.valueColumn.value],showTitle:Z8(U,a),x:e.left.annotations.x+G*Qd,y:e.left.annotations.y,...re},U.id)),I.map((U,G)=>le.jsx(K8,{annotation:U,colorScale:n[U.id],data:K[U.valueColumn.value],showTitle:Z8(U,a),x:e.right.annotations.x+G*Qd+s2,y:e.right.annotations.y,...re},U.id)),$.map((U,G)=>le.jsx(K8,{annotation:U,colorScale:n[U.id],data:ee[U.valueColumn.value],showTitle:Z8(U,a),x:e.top.annotations.x,y:e.top.annotations.y+G*Qd,...re},U.id)),Q.map((U,G)=>le.jsx(K8,{annotation:U,colorScale:n[U.id],data:ee[U.valueColumn.value],showTitle:Z8(U,a),x:e.bottom.annotations.x,y:e.bottom.annotations.y+G*Qd+s2,...re},U.id))]})}function uwt({sideElementBBoxes:e,xGroupKeys:t,yGroupKeys:n,xKeysByGroups:r,yKeysByGroups:a,xGroupLabels:i,yGroupLabels:o,scales:s,stepX:c,stepY:f,xAxis:A,yAxis:h,labelAngles:m,debug:g}){let b=e.top.groups.isVisible||e.bottom.groups.isVisible,C=e.top.groups.isVisible?e.top.groups:e.bottom.groups,x=e.left.groups.isVisible||e.right.groups.isVisible,k=e.left.groups.isVisible?e.left.groups:e.right.groups;return le.jsxs("g",{children:[b&&le.jsx("g",{transform:`translate(${C.x},${C.y})`,children:t.map(_=>{let D=r[_].length;if(D===0)return null;let O=m.xGroupLabels!==0,I=A.groupingPosition==="top",$=D*c,Q=s.x(r[_][0])+$/2,ee=O?I?C.height:0:C.height/2,K=-m.xGroupLabels,re=O?I?"start":"end":"middle";return le.jsxs("g",{transform:`translate(${Q},${ee})`,children:[le.jsx("text",{transform:`rotate(${K})`,dominantBaseline:"central",textAnchor:re,children:i[_]}),g&&le.jsx("rect",{x:-$/2,width:$,height:C.height,stroke:"black",fill:"none"})]},_)})}),x&&le.jsx("g",{transform:`translate(${k.x},${k.y})`,children:n.map(_=>{let D=a[_].length;if(D===0)return null;let O=D*f,I=h.groupingPosition==="left",$=I?k.width:0,Q=s.y(a[_][0])+O/2,ee=m.yGroupLabels!==0,K=m.yGroupLabels===45?-45:(I?-1:1)*(90-m.yGroupLabels),re=ee?I?"end":"start":"middle";return le.jsxs("g",{transform:`translate(${$},${Q})`,children:[le.jsx("text",{y:ee?0:-k.width/2,transform:`rotate(${K})`,dominantBaseline:"central",textAnchor:re,children:o[_]}),g&&le.jsx("rect",{x:-k.width/2,y:-O/2,width:k.width,height:O,stroke:"black",fill:"none"})]},_)})})]})}function cwt({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:f,xLabels:A,yLabels:h}){let m=i.showTicks?U8:0,g=o.showTicks?U8:0,b=e.top.axis.isVisible||e.bottom.axis.isVisible,C=e.top.axisTitle.isVisible?e.top.axisTitle:e.bottom.axisTitle,x=e.top.axis.isVisible?e.top.axis:e.bottom.axis,k=e.left.axis.isVisible||e.right.axis.isVisible,_=e.left.axisTitle.isVisible?e.left.axisTitle:e.right.axisTitle,D=e.left.axis.isVisible?e.left.axis:e.right.axis;return le.jsxs("g",{children:[le.jsxs("g",{children:[C.isVisible&&le.jsxs("g",{transform:`translate(${C.x},${C.y})`,children:[le.jsx("text",{x:C.width/2,y:C.height/2,textAnchor:"middle",dominantBaseline:"central",children:i.title}),t&&le.jsx("rect",{width:C.width,height:C.height,stroke:Zt,fill:"none"})]}),b&&le.jsxs("g",{fontSize:"14px",transform:`translate(${x.x},${x.y})`,children:[n.map(O=>{let I=f.xAxisLabels!==0,$=i.position==="bottom",Q=$?0:x.height,ee=$?Q+m:Q-m,K=$?ee+l2:ee-l2,re=a.x(O)+s/2,U=-f.xAxisLabels;return le.jsxs("g",{children:[le.jsx("line",{x1:re,x2:re,y1:Q,y2:ee,stroke:Zt}),le.jsx("text",{x:re,y:K,textAnchor:I?$?"end":"start":"middle",transform:`rotate(${U},${re},${K})`,dominantBaseline:I?"central":$?"hanging":"auto",children:A[O]})]},O)}),t&&le.jsx("rect",{width:x.width,height:x.height,stroke:Zt,fill:"none"})]})]}),le.jsxs("g",{children:[_.isVisible&&le.jsx("g",{transform:`translate(
|
|
15187
15187
|
${_.x+_.width/2},
|
|
15188
|
-
${_.y+_.height/2})`,children:le.jsx("text",{transform:`rotate(${o.position==="left"?-90:90})`,dominantBaseline:"central",textAnchor:"middle",children:o.title})}),t&&le.jsx("rect",{x:_.x,y:_.y,width:_.width,height:_.height,stroke:Zt,fill:"none"}),k&&le.jsx("g",{fontSize:"14px",transform:`translate(${D.x},${D.y})`,children:r.map(O=>{let I=f.yAxisLabels!==0,$=o.position==="left",Q=-(90-f.yAxisLabels),ee=f.yAxisLabels===0?"middle":$?"end":"start",K=I?"central":$?"auto":"hanging",re=$?D.width:0,U=$?re-g:re+g,G=$?U-l2:U+l2,Z=a.y(O)+c/2;return le.jsxs("g",{children:[le.jsx("line",{x1:re,x2:U,y1:Z,y2:Z,stroke:Zt}),le.jsx("text",{x:G,y:Z,textAnchor:ee,transform:`rotate(${Q},${G},${Z})`,dominantBaseline:K,children:h[O]})]},O)})}),t&&le.jsx("rect",{x:D.x,y:D.y,height:D.height,width:D.width,stroke:Zt,fill:"none"})]})]})}function fwt({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,xGroupKeys:f,yGroupKeys:A,xKeysByGroups:h,yKeysByGroups:m,labelAngles:g,xLabels:b,yLabels:C,xGroupLabels:x,yGroupLabels:k}){return le.jsxs("g",{fontWeight:"500",children:[le.jsx(cwt,{sideElementBBoxes:e,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:g,xLabels:b,yLabels:C,debug:t}),le.jsx(uwt,{sideElementBBoxes:e,xGroupKeys:f,yGroupKeys:A,xKeysByGroups:h,yKeysByGroups:m,xGroupLabels:x,yGroupLabels:k,scales:a,stepX:s,stepY:c,xAxis:i,yAxis:o,labelAngles:g,debug:t})]})}function UK(e,t="top"){let{source:n,target:r}=e;return t==="top"||t==="bottom"?`M ${n.x},${n.y} L ${r.x},${n.y} L${r.x},${r.y}`:`M ${n.x},${n.y} L ${n.x},${r.y} L${r.x},${r.y}`}function jK(e,t,n,r,a){if(!n)return"";let i=n.aes[e];if(!f9(i))return i;let o=i.value,s=a[o],c=r[o][t.data.keys[0]];return t.data.keys.every(f=>c===r[o][f])?s(String(c))[e]:s.unknown()[e]}var GK={x:0,y:0,width:0,height:0};function dwt({dendrograms:e,sideElementBBoxes:t,xDataByKeys:n,yDataByKeys:r,aesScales:a}){let i=e.x.data,o=e.y.data,s=i?t[i.position].dendro:GK,c=o?t[o.position].dendro:GK;function f(h,m){return jK(h,m,i,n,a)}function A(h,m){return jK(h,m,o,r,a)}return le.jsxs("g",{children:[le.jsx("g",{transform:`translate(${s.x},${s.y})`,children:i&&!i.hidden&&e.x.trees.map((h,m)=>{let g=h.links(),b=h.descendants();return le.jsxs("g",{children:[g.map(C=>{let x=i.edgeInheritance==="up"?C.source:C.target;return le.jsx("path",{d:UK(C,i.position),stroke:f("lineColor",x),strokeWidth:f("lineWidth",x),strokeDasharray:td(f("lineShape",x)),fill:"none"},`${C.source.x},${C.source.y},${C.target.x},${C.target.y}`)}),i.showNodes&&b.map(C=>le.jsx("g",{transform:`translate(${C.x},${C.y})`,children:Af(f("dotShape",C),f("dotSize",C),f("dotFill",C))},`${C.x},${C.y}`))]},m)})}),le.jsx("g",{transform:`translate(${c.x},${c.y})`,children:o&&!o.hidden&&e.y.trees.map((h,m)=>{let g=h.links(),b=h.descendants();return le.jsxs("g",{children:[g.map(C=>{let x=o.edgeInheritance==="up"?C.source:C.target;return le.jsx("path",{d:UK(C,o.position),stroke:A("lineColor",x),strokeWidth:A("lineWidth",x),strokeDasharray:td(A("lineShape",x)),fill:"none"},`${C.source.x},${C.source.y},${C.target.x},${C.target.y}`)}),o.showNodes&&b.map(C=>le.jsx("g",{transform:`translate(${C.x},${C.y})`,children:Af(A("dotShape",C),A("dotSize",C),A("dotFill",C))},`${C.x},${C.y}`))]},m)})})]})}function Awt({frame:e,width:t,height:n,xGroupKeys:r,yGroupKeys:a,xKeysByGroups:i,yKeysByGroups:o,scales:s,stepX:c,stepY:f}){return le.jsxs("g",{children:[e.type==="full"&&le.jsx("rect",{fill:"none",stroke:Zt,x:"0",y:"0",width:t,height:n}),e.type==="groups"&&r.map(A=>{let h=i[A].length;if(h===0)return null;let m=h*c,g=s.x(i[A][0]);return a.map(b=>{let C=o[b].length;if(C===0)return null;let x=C*f,k=s.y(o[b][0]);return le.jsx("rect",{x:g,y:k,width:m,height:x,stroke:Zt,fill:"none"},`${g}_${k}`)})})]})}function IP(e){if(e===null)return"null";if(typeof e=="number"){let t=e>0?Math.floor(e):Math.ceil(e),n=e-t;return t+Number(n.toPrecision(2))}return e}function pwt(e,t,n=[]){let r=e.data,a=[`X: ${t.xLabels[e.x]}`,`Y: ${t.yLabels[e.y]}`,`Value: ${IP(e.value)}${e.value!==e.normalizedValue?` (${IP(e.normalizedValue)})`:""}`];for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function hwt(e,t){let n=[];return e.xKey&&n.push(`X: ${t.xLabels[e.xKey]}`),e.yKey&&n.push(`Y: ${t.yLabels[e.yKey]}`),n.push(`${e.title}: ${IP(e.value)}`),n}function mwt({dendrograms:e,facetKey:t,dimensions:n,scales:r,cells:a,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,colorScale:f,chartSettings:A,cellsMeta:h,stepX:m,stepY:g,sharedX:b,sharedY:C,annotations:x,annotationColorScales:k,dendrogramAesScales:_,aes:D,labelAngles:O,chartSizes:I,margins:$,tooltipsContainer:Q}){let[ee,K]=Vn.useState(null),[re,U]=Vn.useState(null),{xAxis:G,yAxis:Z,tooltips:Y}=A,{width:X,height:oe}=n.inner,{padding:me,chartEdgeSides:ae,sideElementBBoxes:ye}=n,{xGroupLabels:Ce,yGroupLabels:ce,xLabels:ge,yLabels:ze}=h,Ne=r.x.domain(),Ge=r.y.domain(),Oe={left:$.left+n.left+me.left,right:I.totalWidth-($.left+n.left+me.left),top:$.top+n.top+me.top,bottom:I.totalHeight-($.top+n.top+me.top)},Xe=!1;return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:G2t,children:[le.jsxs("g",{transform:`translate(${me.left},${me.top})`,children:[le.jsx(swt,{sideElementBBoxes:ye,annotations:x,cellsMeta:h,annotationColorScales:k,sharedX:b,sharedY:C,chartEdgeSides:ae,width:X,height:oe,scales:r,stepX:m,stepY:g,aes:D,frame:A.frame,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,setSelectedAnnotation:U}),le.jsx(dwt,{dendrograms:e,sideElementBBoxes:ye,xDataByKeys:h.xDataByKeys,yDataByKeys:h.yDataByKeys,aesScales:_}),ye.top.facetTitle.isVisible&&le.jsx("text",{x:ye.top.facetTitle.x,y:ye.top.facetTitle.y+ye.top.facetTitle.height-j2t,fontWeight:"500",fontSize:"20px",children:h.facetKeyValues[t].join(", ")}),Xe,Ne.map(dt=>Ge.map(Ye=>{var He;let rt=(He=a==null?void 0:a[dt])==null?void 0:He[Ye];return rt?le.jsx("rect",{x:r.x(dt),y:r.y(Ye),width:m,height:g,stroke:D.cellStrokeColor,fill:rt.value===null?D.emptyCellColor:f(rt.normalizedValue),onMouseOver:()=>K(rt),onMouseLeave:()=>K(null)},rt?rt.id:`${dt}_${Ye}`):null})),le.jsx(Awt,{frame:A.frame,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,scales:r,stepX:m,stepY:g,width:X,height:oe}),le.jsx(fwt,{xAxis:G,yAxis:Z,scales:r,stepX:m,stepY:g,debug:Xe,sideElementBBoxes:ye,xKeys:Ne,yKeys:Ge,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,xGroupLabels:Ce,yGroupLabels:ce,labelAngles:O,xLabels:ge,yLabels:ze})]}),A.tooltips.show&&ee&&le.jsx(oc,{content:pwt(ee,h,Y==null?void 0:Y.content),x:r.x(String(ee.x))+m/2,y:r.y(String(ee.y))+g/2,offset:Ne.length>1?m/2:0,active:!0,sideDistances:Oe,container:Q}),A.tooltips.show&&re&&le.jsx(oc,{content:hwt(re,h),x:re.x,y:re.y,offset:0,active:!0,sideDistances:Oe,container:Q})]})}function vwt({margins:e,captionsSizes:t,settingsId:n,chartSettings:r,chartSizes:a,chartsDimensions:i,facetKeys:o,facetSettings:s,xGroupKeys:c,yGroupKeys:f,scales:A,colorScale:h,groupedCells:m,cellsMeta:g,step:b,annotations:C,annotationColorScales:x,legend:k,aes:_,dendrograms:D,dendrogramAesScales:O,columnsCount:I,labelAngles:$}){let[Q,ee]=Vn.useState(),K=Vn.useRef(null);Vn.useEffect(()=>{K.current&&ee(K.current)},[]);let re=i[o[0]].padding,U=i[o[I-1]].padding,G=e.left+a.chartsWidth+j8,Z=e.top+re.top;return le.jsx(f2,{dataId:n,children:le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${a.totalWidth} ${a.totalHeight}`,width:a.totalWidth,height:a.totalHeight,fontFamily:"Manrope",children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${e.left},${e.top})`,children:[le.jsx(d2,{title:[r.title.name],show:r.title.show,position:r.title.position,leftPadding:re.left,rightPadding:U.right,chartsWidth:a.chartsWidth}),o.map(Y=>{let{cells:X,xKeysByGroups:oe,yKeysByGroups:me}=m[Y];return le.jsx(mwt,{dendrograms:D[Y],captionsSizes:t,facetKey:Y,dimensions:i[Y],xGroupKeys:c,yGroupKeys:f,xKeysByGroups:s.sharedX?g.xKeysByGroups:oe,yKeysByGroups:s.sharedY?g.yKeysByGroups:me,sharedX:s.sharedX,sharedY:s.sharedY,scales:{x:A.x[Y],y:A.y[Y]},cells:X,cellsMeta:g,stepX:b.x[Y],stepY:b.y[Y],colorScale:h,chartSettings:r,aes:_,annotations:C,annotationColorScales:x,dendrogramAesScales:O,labelAngles:$,margins:e,chartSizes:a,tooltipsContainer:Q},Y)})]}),le.jsx("g",{transform:`translate(${G},${Z})`,children:le.jsx(y9,{legendData:k})}),le.jsx("g",{ref:K})]})})}function YK(e,t,n){function r(a){a[n]=t(a.data.height),a.children&&a.children.forEach(r)}r(e)}function WK(e,t,n,r=n){function a(i){i[r]=i[n]+t,i.children&&i.children.forEach(a)}a(e)}var gwt=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r){let o=e%2===0?[]:[n];for(let s=1;s<e/2+1;s++)o.push(n+s),o.unshift(n-s);return o}if(e<2)return[n,r];let a=(r-n)/(e-1),i=[];for(let o=0;o<e-1;o++)i.push(n+a*o);return i.push(r),i};function XK(e,t,n){let r=n;return e&&(e.colorRange&&(r=e.colorRange),e.method==="standardScaling"&&(r=[-2,2]),e.method==="meanNormalization"&&(r=[-.75,.75])),gwt(t,r)}var ywt=class{constructor(){Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"component",le.jsx(le.Fragment,{}));Me(this,"chartsDimensions",{});Me(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Me(this,"margins",{top:_g,bottom:_g,left:_g,right:_g});Me(this,"captionsSizes",{xAxisCaptions:100,yAxisCaptions:100,xGroupCaptions:Vm,yGroupCaptions:Vm,xCaptionTail:0,yCaptionTail:0});Me(this,"labelAngles",{xAxisLabels:0,yAxisLabels:0,xGroupLabels:0,yGroupLabels:0});Me(this,"columnsCount",1);Me(this,"rowsCount",1);Me(this,"scales",{x:{null:Hl().domain(["null"]).range([1])},y:{null:Hl().domain(["null"]).range([1])}});Me(this,"step",{x:{},y:{}});Me(this,"colorScale",Da().domain([0,1]).range(["white","black"]));Me(this,"annotationColorScales",{});Me(this,"dendrogramAesScales",{});Me(this,"legend",{width:0,height:0,items:[]});Me(this,"dendrograms",{})}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=zh(this.rootNode))}updateMargins(e){this.margins={top:e.show?24+24*2:_g,bottom:_g,left:_g,right:this.legend.width},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartsHeight+this.margins.bottom,this.legend.height)}updateLegendSize(e,t,n,r,a){if(!t.show){this.legend={width:0,height:0,items:[]};return}let i=this.chartSizes.chartHeight,o=[],s={width:0,height:0,left:0,top:0},c=m=>m.reduce((g,b)=>(g[b]=String(b),g),{});if(e==="continuous"){let m=this.colorScale,g=a2(m,a),b=Da([g[0],g[g.length-1]],[i,0]),C=r.label??r.value;o.push({...s,type:"continuous",id:"heatmapValue",scale:m,values:g,title:C,tickPositionScale:b})}else if(e==="discrete"){let m=this.colorScale,g=r.label??r.value,b=m.domain(),C=c(b);o.push({...s,type:"discreteColor",id:"heatmapValue",title:g,scale:m,values:b,labels:C})}if(n.forEach(m=>{let g=m.valueColumn.label??m.valueColumn.value;if(m.type==="continuous"){let b=this.annotationColorScales[m.id].scale,C=a2(b,a),x=Da([C[0],C[C.length-1]],[i,0]);o.push({...s,type:"continuous",id:m.id,tickPositionScale:x,title:g,scale:b,values:C})}if(m.type==="discrete"){let b=this.annotationColorScales[m.id].scale,C=b.domain(),x=c(C);o.push({...s,type:"discreteColor",id:m.id,title:g,scale:b,values:C,labels:x})}}),!o.length){this.legend={width:0,height:0,items:[]};return}let f=w9(o,this.chartSizes.chartHeight),A=f[f.length-1],h=A.left+A.width+2*j8;this.legend={width:h,height:i,items:f}}updateCaptionsSize(e,t,n,r){let a=new Dc("bold 14px Arial"),{xGroupKeys:i,yGroupKeys:o,xGroupLabels:s,yGroupLabels:c,xKeysByGroups:f,yKeysByGroups:A,xLabels:h,yLabels:m}=e.meta;this.labelAngles={xAxisLabels:t.axisLabelsAngle,yAxisLabels:n.axisLabelsAngle,xGroupLabels:t.groupLabelsAngle,yGroupLabels:n.groupLabelsAngle};let g=Ir.flatten(Object.values(f)),b=Ir.flatten(Object.values(A)),C=g.map(K=>a.getTextWidth(h[K])),x=b.map(K=>a.getTextWidth(m[K])),k=i.map(K=>a.getTextWidth(s[K])),_=o.map(K=>a.getTextWidth(c[K])),{xCaptionTail:D,yCaptionTail:O}=owt(this.labelAngles,r,this.step,e,a),I=this.labelAngles.xGroupLabels/180*Math.PI,$=this.labelAngles.yGroupLabels/180*Math.PI,Q=this.labelAngles.xAxisLabels/180*Math.PI,ee=this.labelAngles.yAxisLabels/180*Math.PI;this.captionsSizes={xCaptionTail:D,yCaptionTail:O,xGroupCaptions:Math.max(...k,0)*Math.sin(I)||Vm,yGroupCaptions:Math.max(..._,0)*Math.sin($)||Vm,xAxisCaptions:Math.max(...C,0)*Math.sin(Q)||Vm,yAxisCaptions:Math.max(...x,0)*Math.sin(ee)||Vm}}updateChartDimensions(e,t,n,r,a,i,o,s,c,f){let A=t.length,h=Math.min(a.nRows??A,A),m=Math.min(a.nCols??A,A);this.columnsCount=a.nRows?Math.ceil(A/h):m,this.rowsCount=Math.ceil(A/this.columnsCount);let{width:g,height:b}=e,{sharedX:C,sharedY:x}=a;this.chartsDimensions={};let k=0,_=0;t.forEach((I,$)=>{let Q=$%this.columnsCount+1,ee=zK($,t.length,this.columnsCount,this.rowsCount),K=this.step.x[I],re=this.step.y[I],U=nwt(i,o,this.captionsSizes,s,c,f,ee,C,x,t,n,r,K,re),G=iwt(s,ee,C,x);function Z(ae){return Math.max(s1[ae].reduce((ye,Ce)=>ye+U[ae][Ce],0),G[ae],z2t)}let Y={left:Z("left"),right:Z("right"),top:Z("top"),bottom:Z("bottom")};Y.left<this.captionsSizes.xCaptionTail&&(Y.left=this.captionsSizes.xCaptionTail),Y.bottom<this.captionsSizes.yCaptionTail&&(Y.bottom=this.captionsSizes.yCaptionTail);let X=rwt(U,g,b),oe=g+Y.left+Y.right,me=b+Y.top+Y.bottom;this.chartsDimensions[I]={left:k,top:_,inner:{width:g,height:b},outer:{width:oe,height:me},padding:Y,sideElementBBoxes:X,chartEdgeSides:ee},k+=oe,Q===this.columnsCount&&(k=0,_+=me)});let D=t.slice(0,this.columnsCount).reduce((I,$)=>I+this.chartsDimensions[$].outer.width,0),O=t.filter((I,$)=>$%this.columnsCount===0).reduce((I,$)=>I+this.chartsDimensions[$].outer.height,0);this.chartSizes.chartsWidth=D,this.chartSizes.chartsHeight=O}updateChartsSizes(e){let{width:t,height:n}=e;this.chartSizes.chartWidth=t,this.chartSizes.chartHeight=n}updateScales(e,t,n,r,a,i,o,s,c){let{width:f,height:A}=a,{meta:h,facets:m}=t,{sharedX:g,sharedY:b}=r,C=(k,_={})=>k.sort((D,O)=>i.sorting==="asc"?(_[D]??D).localeCompare(_[O]??O,"en",{numeric:!0}):(_[O]??O).localeCompare(_[D]??D,"en",{numeric:!0})),x=(k,_={})=>k.sort((D,O)=>o.sorting==="asc"?(_[D]??D).localeCompare(_[O]??O,"en",{numeric:!0}):(_[O]??O).localeCompare(_[D]??D,"en",{numeric:!0}));e.forEach(k=>{let _=m[k],D=C(h.xGroupKeys),O=x(h.yGroupKeys),{xKeysByGroups:I}=g?h:_,{yKeysByGroups:$}=b?h:_,Q=D.map(ye=>I[ye].length),ee=O.map(ye=>$[ye].length),K=Q.reduce((ye,Ce)=>ye+Ce,0),re=ee.reduce((ye,Ce)=>ye+Ce,0),U=(f-(Q.filter(ye=>ye>0).length-1)*n)/K,G=(A-(ee.filter(ye=>ye>0).length-1)*n)/re,Z=[],Y=[],X=0;D.forEach(ye=>{let Ce=s?I[ye]:C(I[ye],h.xLabels);Y.push(...Ce),Ce.forEach(()=>{Z.push(X),X+=U}),Ce.length>0&&(X+=n)});let oe=[],me=[],ae=0;O.forEach(ye=>{let Ce=c?$[ye]:x($[ye],h.yLabels);me.push(...Ce),Ce.forEach(()=>{oe.push(ae),ae+=G}),Ce.length>0&&(ae+=n)}),this.scales.x[k]=Hl().domain(Y).range(Z),this.scales.y[k]=Hl().domain(me).range(oe),this.step.x[k]=U,this.step.y[k]=G})}updateAesScale(e,t,n,r,a,i,o){if(e==="continuous")n.valueColors?this.colorScale=Da().domain(n.valuesByColors??XK(o,n.valueColors.length,t)).range(n.valueColors):n.colorsList&&(this.colorScale=Da().domain(XK(o,n.colorsList.length,t)).range(n.colorsList));else if(n.colorsMap){let f=Object.entries(n.colorsMap);this.colorScale=Hl().domain(f.map(A=>A[0])).range(f.map(A=>A[1])).unknown("#ccc")}else n.colorsList&&(this.colorScale=QK(n.colorsList,i.map(String)));let{xDataByKeys:s,yDataByKeys:c}=a.meta;r.forEach(f=>{let{colors:A,type:h,axis:m,valueColumn:g}=f,b=(m==="x"?s:c)[g.value];if(h==="discrete"){let C=Ir.uniq(Object.values(b).map(String)).sort();this.annotationColorScales[f.id]={type:"discrete",scale:QK(A,C)}}else{let C=Object.values(b).map(Number);if(!C.length)return;let[x=C[0],k=C[0]]=$A(C);this.annotationColorScales[f.id]={type:"continuous",scale:awt(A,x,k,0,.5,1)}}})}updateDendrogram(e,t,n,r,a,i,o){e.forEach(s=>{this.dendrograms[s]={x:{trees:[],data:i},y:{trees:[],data:o}};let{xKeysByGroups:c,yKeysByGroups:f}=r[s],{hierarchyX:A,hierarchyY:h}=a[s],m=Math.max(...A.map(b=>b.data.height)),g=Math.max(...h.map(b=>b.data.height));i&&(this.dendrograms[s].x.trees=A.map((b,C)=>{let x=t[C],k=c[x];xB().separation(()=>1).size([k.length*this.step.x[s],i.size])(b);let _=b,D=Da().domain(i.position==="top"?[0,m]:[m,0]).range([i.size,0]);return YK(_,D,"y"),WK(_,this.scales.x[s](k[0]),"x"),_}),this.dendrograms[s].x.data=i),o&&(this.dendrograms[s].y.trees=h.map((b,C)=>{let x=n[C],k=f[x];xB().separation(()=>1).size([k.length*this.step.y[s],o.size])(b);let _=b,D=Da().domain(o.position==="left"?[0,g]:[g,0]).range([o.size,0]);return WK(_,this.scales.y[s](k[0]),"x","y"),YK(_,D,"x"),_}),this.dendrograms[s].y.data=o)})}updateDendrogramAesScales(e){if(!e)return;let t=Object.keys(e);this.dendrogramAesScales=t.reduce((n,r)=>{let a=e[r],i=Object.keys(a);return n[r]=Hl().domain(i).range(i.map(o=>({...nK,...a[o]}))).unknown(nK),n},{})}render(e,t,n,r,a,i,o,s,c,f,A,h,m){var K;let{meta:g,facets:b}=a,{facetKeys:C,xGroupKeys:x,yGroupKeys:k,valueExtent:_}=g,{xAxis:D,yAxis:O,title:I,size:$,valueType:Q}=t;this.updateChartsSizes($),this.updateAesScale(Q,_,r,i,a,h,m),this.updateScales(C,a,r.groupGap,n,$,t.xAxis,t.yAxis,s,c),this.updateCaptionsSize(a,D,O,n),this.updateChartDimensions($,C,x,k,n,D,O,i,s,c),this.updateLegendSize(Q,t.legend,i,o,_),this.updateMargins(I),this.updateDendrogram(C,x,k,b,f,s,c),this.updateDendrogramAesScales(A);let ee=le.jsx(vwt,{aes:r,annotations:i,annotationColorScales:this.annotationColorScales,captionsSizes:this.captionsSizes,cellsMeta:g,columnsCount:this.columnsCount,chartsDimensions:this.chartsDimensions,chartSettings:t,chartSizes:this.chartSizes,colorScale:this.colorScale,dendrogramAesScales:this.dendrogramAesScales,dendrograms:this.dendrograms,facetKeys:C,facetSettings:n,groupedCells:b,labelAngles:this.labelAngles,legend:this.legend,margins:this.margins,scales:this.scales,settingsId:e,step:this.step,xGroupKeys:x,yGroupKeys:k});this.component=ee,(K=this.reactRoot)==null||K.render(ee)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},wwt=ywt,LP={lineColor:Zt,dotShape:"21",dotFill:Zt,dotSize:3,lineShape:"solid",lineWidth:1},KK={size:150,distance:"euclidean",linkage:"average",fillNA:0,showNodes:!0,hidden:!1,edgeInheritance:"up",aes:LP},ZK=class{constructor(e){Me(this,"id");Me(this,"type","heatmap");Me(this,"facetSettings");Me(this,"xColumn");Me(this,"xGroupBy");Me(this,"yColumn");Me(this,"yGroupBy");Me(this,"valueColumn");Me(this,"facetBy");Me(this,"normalization");Me(this,"chartSettings");Me(this,"aes");Me(this,"annotations");Me(this,"dendrogramX");Me(this,"dendrogramY");Me(this,"inheritedDendrogramAes");Me(this,"NAValueAs");var t,n,r,a,i,o,s,c,f,A,h,m,g;if(t2t.parse(e),this.id=Ir.uniqueId("settings"),this.facetSettings={sharedX:(e.facetBy??[]).length>0,sharedY:(e.facetBy??[]).length>0,...e.facetSettings},this.xColumn=e.xColumn,this.xGroupBy=e.xGroupBy??[],this.yColumn=e.yColumn,this.yGroupBy=e.yGroupBy??[],this.valueColumn=e.valueColumn,this.facetBy=e.facetBy??[],this.chartSettings={title:{position:"left",show:!0,...e.title,name:((t=e.title)==null?void 0:t.name)??"Chart"},size:{width:((n=e==null?void 0:e.size)==null?void 0:n.width)??(this.facetBy.length?400:600),height:((r=e==null?void 0:e.size)==null?void 0:r.height)??(this.facetBy.length?250:350)},frame:{type:((a=e.frame)==null?void 0:a.type)??"none"},valueType:e.valueType??"continuous",yAxis:{title:e.yColumn.label??e.yColumn.value,showTicks:!0,showTitle:!0,showAxisLabels:!0,showGroupLabels:!0,position:"left",groupingPosition:"left",axisLabelsAngle:90,groupLabelsAngle:0,sorting:"asc",...e.yAxis},xAxis:{title:e.xColumn.label??e.xColumn.value,showTicks:!0,showTitle:!0,showAxisLabels:!0,showGroupLabels:!0,position:"bottom",groupingPosition:"bottom",axisLabelsAngle:90,groupLabelsAngle:0,sorting:"asc",...e.xAxis},legend:{show:!0,position:"right",...e.legend},tooltips:{show:!0,...e.tooltips}},this.normalization=this.chartSettings.valueType==="continuous"?e.normalization??null:null,this.NAValueAs=e.NAValueAs??null,this.aes={colorsList:((i=e.aes)==null?void 0:i.colorsList)??["black","white","red"],colorsMap:((o=e.aes)==null?void 0:o.colorsMap)??null,valueColors:((s=e.aes)==null?void 0:s.valueColors)??null,valuesByColors:((c=e.aes)==null?void 0:c.valuesByColors)??null,cellStrokeColor:((f=e.aes)==null?void 0:f.cellStrokeColor)??"none",groupGap:((A=e.aes)==null?void 0:A.groupGap)??3,emptyCellColor:((h=e.aes)==null?void 0:h.emptyCellColor)??"white"},this.annotations=(e.annotations??[]).map(b=>b.axis==="x"?{id:Ir.uniqueId("annotation"),axis:"x",valueColumn:b.valueColumn,position:b.position??this.chartSettings.xAxis.position,titlePosition:b.titlePosition??"right",showTitle:b.showTitle??!0,type:b.type,colors:b.colors??["white","black"]}:{id:Ir.uniqueId("annotation"),axis:"y",valueColumn:b.valueColumn,position:b.position??this.chartSettings.yAxis.position,titlePosition:b.titlePosition??"top",showTitle:b.showTitle??!0,type:b.type,colors:b.colors??["white","black"]}),e.valueType==="discrete"&&(e.dendrogramX||e.dendrogramY))throw Error("Dendrogram is not available with discrete cells values");this.dendrogramX=e.dendrogramX?{...KK,position:"top",...e.dendrogramX,aes:{...LP,...(m=e.dendrogramX)==null?void 0:m.aes}}:null,this.dendrogramY=e.dendrogramY?{...KK,position:"left",...e.dendrogramY,aes:{...LP,...(g=e.dendrogramY)==null?void 0:g.aes}}:null,this.inheritedDendrogramAes=e.inheritedDendrogramAes??null}},Cwt=class extends Sg{constructor(t,n){super(t,n);Me(this,"settings");Me(this,"chartRenderer",new wwt);Me(this,"calculatedData",null);this.settings=new ZK(n)}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new ZK(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){console.warn("no chart state for heatmap")}export(){return this._updateChart(),f3(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var I,$,Q,ee,K,re,U,G,Z,Y,X,oe;let{xColumn:r,yColumn:a,valueColumn:i,xGroupBy:o,yGroupBy:s,facetBy:c,annotations:f,chartSettings:A,facetSettings:h,dendrogramX:m,dendrogramY:g,normalization:b,NAValueAs:C}=n,x=Object.values(((I=t.dendrogramX)==null?void 0:I.aes)||{}).filter(f9),k=Object.values((m==null?void 0:m.aes)||{}).filter(f9),_=Object.values((($=t.dendrogramY)==null?void 0:$.aes)||{}).filter(f9),D=Object.values((g==null?void 0:g.aes)||{}).filter(f9);function O(me,ae){return me.length!==ae.length||me.some((ye,Ce)=>ye.value!==ae[Ce].value)}return t.xColumn.value!==r.value||t.yColumn.value!==a.value||t.valueColumn.value!==i.value||O(t.xGroupBy,o)||O(t.yGroupBy,s)||O(t.facetBy,c)||O(t.annotations.map(me=>me.valueColumn),f.map(me=>me.valueColumn))||O(x,k)||O(_,D)||(n.dendrogramX||t.dendrogramX)&&(((Q=t.dendrogramX)==null?void 0:Q.distance)!==((ee=n.dendrogramX)==null?void 0:ee.distance)||((K=t.dendrogramX)==null?void 0:K.linkage)!==((re=n.dendrogramX)==null?void 0:re.linkage))||(n.dendrogramY||t.dendrogramY)&&(((U=t.dendrogramY)==null?void 0:U.distance)!==((G=n.dendrogramY)==null?void 0:G.distance)||((Z=t.dendrogramY)==null?void 0:Z.linkage)!==((Y=n.dendrogramY)==null?void 0:Y.linkage))||t.chartSettings.valueType!==A.valueType||t.facetSettings.sharedX!==h.sharedX||t.facetSettings.sharedY!==h.sharedY||((X=t.normalization)==null?void 0:X.method)!==(b==null?void 0:b.method)||((oe=t.normalization)==null?void 0:oe.direction)!==(b==null?void 0:b.direction)||t.NAValueAs!==C}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{xColumn:t,yColumn:n,valueColumn:r,xGroupBy:a,yGroupBy:i,facetBy:o,chartSettings:s,facetSettings:c,annotations:f,dendrogramX:A,dendrogramY:h,normalization:m,NAValueAs:g}=this.settings,b=K7t(this.data,t,n,r,o,a,i,f,A,h,m,g),C=twt(b,A,h,c),x=s.valueType==="discrete"?this.data.getColumnCategories(r.value):[];this.calculatedData={groupedCellsData:b,dendrogramsData:C,cellUniqValues:x}}_updateAesInData(){}_updateChart(){if(!this.calculatedData)return;let{id:t,valueColumn:n,chartSettings:r,facetSettings:a,aes:i,annotations:o,dendrogramX:s,dendrogramY:c,inheritedDendrogramAes:f,normalization:A}=this.settings;this.chartRenderer.render(t,r,a,i,this.calculatedData.groupedCellsData,o,n,s,c,this.calculatedData.dendrogramsData,f,this.calculatedData.cellUniqValues,A)}},JK=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r)return[n];if(e<2)return[(n+r)/2];let a=(r-n)/e,i=[];for(let o=1;o<e;o++)i.push(n+a*o);return i};function bwt(e,t,n){let[r=0,a=0]=$A(e,s=>s[t.value]),i=JK(n,[r,a]),o=pL().thresholds(i).value(s=>s[t.value])(e);return{bins:o,minX:o[0].x0??0,maxX:o[o.length-1].x1??0,maxCount:Ih(o,s=>s.length)??0}}function Ewt(e,t,n){let[r=0,a=0]=$A(e,A=>A[t.value]),i=[r,a],o=JK(n,[r,a]),s=q1().domain(i).range(i),c=o.map(A=>s.invert(A)),f=pL().thresholds(c).value(A=>A[t.value])(e);return{bins:f,minX:f[0].x0??0,maxX:f[f.length-1].x1??0,maxCount:Ih(f,A=>A.length)??0}}function xwt(e,t,n,r,a){let i={};return t.forEach(o=>{let s=e.getRowsByGrouping([...o]);i[o.join("_")]=a==="linear"?bwt(s,n,r):Ewt(s,n,r)}),i}var Swt={TOP:30,BOTTOM:0,LEFT:10,RIGHT:10};function b9(e,t,n=!1){let r=Math.abs(e.range()[0]-e.range()[1]),a=n?Math.min(Math.floor(r/45),10):10,i=e.ticks(a).filter(c=>t&&c>=0||!t),o=new Set(i);if(!n&&i.length>1){let c=e(i[0]),f=e(i[0]);for(let A=1;A<i.length;A++)f=e(i[A]),Math.abs(f-c)>=20?c=f:o.delete(i[A])}n&&i.length>2&&Math.abs(e(i[1])-e(i[0]))<45&&(i=i.filter((c,f)=>f%2===0));let s=i.some(c=>Math.abs(c)<1e-4&&c!==0||c>1e4)?",e":",f";return{ticks:i,format:c=>o.has(c)?e.tickFormat(a,s)(c):""}}function Bwt(e){return`translate(${e},0)`}function kwt(e){return`translate(0,${e})`}function Twt(e){return e==="bottom"?`translate(0,${ed})`:`translate(${-ed},0)`}function _wt(e){return e==="bottom"?"hanging":"central"}function Pwt(e){return e==="bottom"?"middle":"end"}var qK=({scale:e,tickSize:t=6,tickPadding:n=ed,orient:r="bottom",onlyPositive:a=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function o(C){return x=>{let k=C(x);return k===void 0?0:+k}}let{ticks:s,format:c}=b9(e,a,r==="bottom"),f=Math.max(t,0)+n,A=o(e.copy()),h=r==="bottom"?Bwt:kwt,m=r==="left"?-1:1,g={[(r==="left"?"x":"y")+"2"]:m*t},b={[r==="left"?"x":"y"]:m*f};return le.jsx("g",{children:s.map((C,x)=>le.jsxs("g",{className:"tick",transform:h(A(C)+i),children:[le.jsx("line",{stroke:Zt,...g}),le.jsx("g",{transform:Twt(r),children:le.jsx("text",{fill:Zt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:_wt(r),textAnchor:Pwt(r),...b,children:c(C)})})]},x))})},Mwt=1;function eZ({scaleX:e,scaleY:t,width:n,height:r,axisX:a,axisY:i,frameType:o,updatingKey:s=""}){let[c,f]=Vn.useState(e.ticks()),[A,h]=Vn.useState(t.ticks()),{significantLines:m=[]}=a,{significantLines:g=[]}=i;return Vn.useEffect(()=>{let b=e.ticks().filter(x=>!m.includes(x)),C=t.ticks().filter(x=>!g.includes(x));f(b),h(C)},[e,t,s]),le.jsxs("g",{stroke:Jf,children:[a.showGrid&&c.map(b=>{let C=e(b);return le.jsx("line",{x1:C,x2:C,y1:0,y2:r},`x_${C}_${r}`)}),i.showGrid&&A.map(b=>{let C=t(b);return le.jsx("line",{x1:0,x2:n,y1:C,y2:C},`y_${C}_${n}`)}),le.jsx("g",{strokeDasharray:td(a.significantLinesStyle),stroke:Zt,children:m.map(b=>{let C=e(b);return C<0||C>n?null:le.jsx("line",{x1:C,x2:C,y1:0,y2:r},`significant_${C}_${r}`)})}),le.jsx("g",{strokeDasharray:td(i.significantLinesStyle),stroke:Zt,children:g.map(b=>{let C=t(b);return C<0||C>r?null:le.jsx("line",{x1:0,x2:n,y1:C,y2:C},`significant_${C}_${n}`)})}),o!=="empty"&&le.jsxs("g",{strokeWidth:Mwt,children:[(a.showGrid||o!=="left")&&le.jsx("line",{stroke:o==="left"?Jf:Zt,x1:"0",x2:n,y1:r,y2:r}),(a.showGrid||o!=="bottom")&&le.jsx("line",{stroke:o==="bottom"?Jf:Zt,x1:"0",x2:"0",y1:"0",y2:r}),(a.showGrid||o==="full")&&le.jsx("line",{stroke:o==="full"?Zt:Jf,x1:n,x2:n,y1:"0",y2:r}),(i.showGrid||o==="full")&&le.jsx("line",{stroke:o==="full"?Zt:Jf,x1:"0",x2:n,y1:"0",y2:"0"})]})]})}function Dwt({width:e,height:t,dimensions:n,scales:r,xAxis:a,yAxis:i,frameType:o,histogramData:s,facetSettings:c,captionsSizes:f,facetTitle:A,layers:h,aesColorGetter:m}){let{padding:g}=n,b=a.showTicks?4:0,C=i.showTicks?4:0,x=n.chartEdgeSides.includes("left")||!(c!=null&&c.sharedY),k=n.chartEdgeSides.includes("bottom")||!(c!=null&&c.sharedX),_=n.chartEdgeSides.includes("bottom"),D=!1;return le.jsxs("g",{transform:`translate(${n.left+g.left},${n.top+g.top})`,children:[D,A.length&&le.jsxs("g",{children:[o==="full"&&le.jsx("rect",{x:"0",y:-g.top,height:g.top,width:e,fill:"#F7F8FA",stroke:Zt}),A.map((O,I)=>{let $=A.length,Q=(g.top-20*$)/2;return le.jsx("text",{fontSize:"14px",fontWeight:"500",fill:Zt,x:e/2,dy:Q+20/2-g.top,y:I*20,textAnchor:"middle",dominantBaseline:"central",children:O},I)})]}),le.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Zt,children:[_&&le.jsx("text",{x:e/2,y:t+g.bottom-12-20/2,children:a.title}),D]}),le.jsx(eZ,{width:e,height:t,scaleX:r.x,scaleY:r.y,axisX:a,axisY:i,frameType:o}),k&&le.jsxs("g",{transform:`translate(0,${t})`,children:[le.jsx(qK,{scale:r.x,orient:"bottom",onlyPositive:!0,tickSize:b}),D]}),x&&le.jsxs("g",{children:[le.jsx(qK,{scale:r.y,orient:"left",tickSize:C}),D]}),h.map(O=>s.bins.map(I=>le.jsx("rect",{x:r.x(I.x0),y:r.y(I.length),fill:I[0]?m(O.aes.fillColor,I[0]):"",stroke:Zt,width:r.x(I.x1)-r.x(I.x0),height:r.y(0)-r.y(I.length),opacity:O.aes.opacity??1},I.x0)))]})}function Hwt({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,columnsCount:a,facetKeys:i,facetSettings:o,scales:s,margins:c,mainTitle:f,facetTitles:A,captionsSizes:h,histogramDataByFacets:m,layers:g,aesColorGetter:b}){let{xAxis:C,yAxis:x,title:k,frame:_}=t,D=r[i[0]].padding,O=r[i[a-1]].padding;return le.jsx(f2,{dataId:e,children:le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${n.totalWidth} ${n.totalHeight}`,width:n.totalWidth,height:n.totalHeight,children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${c.left},${c.top})`,fontFamily:"Manrope",children:[le.jsx(d2,{title:f,show:k.show,position:k.position,leftPadding:D.left,rightPadding:O.right,chartsWidth:n.chartsWidth}),i.map(I=>le.jsx(Dwt,{scales:{x:s.x[I],y:s.y[I]},width:n.chartWidth,height:n.chartHeight,dimensions:r[I],margins:c,chartSizes:n,facetSettings:o,xAxis:C,yAxis:x,frameType:_.type,facetTitle:A[I],captionsSizes:h,histogramData:m[I],layers:g,aesColorGetter:b},I))]})]})})}function Iwt(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function Lwt(e,t,n,r,a,i,o){let s=i.includes("left")||!(o!=null&&o.sharedY),c=i.includes("bottom")||!(o!=null&&o.sharedX),f=i.includes("bottom")&&e.title!=="",A=n.yAxisCaptionsWidth+2*6,h=(t.showTicks?4:0)+6,m=n.xAxisCaptionsWidth+2*6,g=e.showTicks?4:0,b=f?32:0,C=A+h+8,x=m+g+b+8,k=Math.max(...r.map(_=>a[_].length));return{left:s?C:12,top:k===0?0:6*2+k*20,bottom:c?x+8:12,right:12}}function Rwt(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function Nwt(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function $wt(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function Fwt(e,t){return function(n,r){var a,i;if($wt(n)){let o=n.value;return(i=((a=e[o])==null?void 0:a[String(r[o])])??hP)==null?void 0:i[t]}return n}}var Vwt=class{constructor(){Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"component",le.jsx(le.Fragment,{}));Me(this,"margins",{top:24,bottom:24,left:24,right:24});Me(this,"chartsDimensions",{});Me(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Me(this,"columnsCount",1);Me(this,"rowsCount",1);Me(this,"scales",{x:{null:Da().domain([0,10]).range([0,600])},y:{null:Da().domain([0,10]).range([350,0])}});Me(this,"captionsSizes",{xAxisCaptionsWidth:30,yAxisCaptionsWidth:100});Me(this,"facetTitles",{});Me(this,"mainTitle",[])}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=zh(this.rootNode))}updateChartSizes(e){this.chartSizes.chartWidth=e.width,this.chartSizes.chartHeight=e.height}updateChartDimensions(e,t,n,r){let{chartWidth:a,chartHeight:i}=this.chartSizes,o=0,s=0;this.chartsDimensions=e.reduce((A,h,m)=>{let[g,b]=Nwt(m,this.columnsCount),C=Iwt(m,e.length,this.columnsCount,this.rowsCount),x=Lwt(n,r,this.captionsSizes,Rwt(e,this.rowsCount,this.columnsCount)[g],this.facetTitles,C,t),k=a+x.left+x.right,_=i+x.top+x.bottom;return A[h]={left:o,top:s,chartEdgeSides:C,padding:x,inner:{width:a,height:i},outer:{width:k,height:_}},o+=k,b===this.columnsCount-1&&(o=0,s+=_),A},{});let c=Math.max(...e.map(A=>this.chartsDimensions[A].outer.width+this.chartsDimensions[A].left)),f=Math.max(...e.map(A=>this.chartsDimensions[A].outer.height+this.chartsDimensions[A].top));this.chartSizes.chartsWidth=c,this.chartSizes.chartsHeight=f}updateViewport(e,t,n,r,a){let i=e.length,o=Math.min(t.nRows??i,i),s=Math.min(t.nCols??i,i);this.columnsCount=t.nRows?Math.ceil(i/o):s,this.rowsCount=Math.ceil(i/this.columnsCount);let[c,f]=[1/0,-1/0],A=-1/0,h=e.reduce((m,g)=>{let b=a[g],{minX:C,maxX:x,maxCount:k}=b;return c=Math.min(c,C),f=Math.max(f,x),A=Math.max(A,k),m[g]={minX:C,maxX:x,maxY:k},m},{});e.forEach(m=>{let g=n.scale==="log"?q1():Da(),b=h[m],C=t.sharedX?c:b.minX,x=t.sharedX?f:b.maxX;g.domain([C,x]).range([0,this.chartSizes.chartWidth]),this.scales.x[m]=g}),e.forEach(m=>{let g=r.scale==="log"?q1():Da(),b=h[m],C=0,x=t.sharedY?A:b.maxY,k=[this.chartSizes.chartHeight,0],_=g.copy().domain([C,x]).range([this.chartSizes.chartHeight,Swt.TOP]);g.domain([_.invert(this.chartSizes.chartHeight),_.invert(0)]).range(k),this.scales.y[m]=g})}updateCaptionsSize(){let e=new Dc("600 14px Arial"),t=0;function n(r){return Math.max(...r.map(a=>e.getTextWidth(a)))}Object.values(this.scales.y).forEach(r=>{let{ticks:a,format:i}=b9(r,!1);t=Math.max(t,n(a.map(i)))}),this.captionsSizes={xAxisCaptionsWidth:20,yAxisCaptionsWidth:t}}createMainTitle(e,t){let n=this.chartsDimensions[e[0]],r=this.chartsDimensions[e[e.length-1]];this.mainTitle=Om(t.name,this.chartSizes.chartsWidth-n.padding.left-r.padding.right,20)}createFacetTitles(e,t){this.facetTitles=e.reduce((n,r,a)=>(t[a].length===1&&t[a][0]==="null"?n[r]=[]:n[r]=Om(t[a].join(", "),this.chartSizes.chartWidth,14),n),{})}updateMargins(){let e=24*this.mainTitle.length,t=e>0?e+24*2:0;this.margins={top:Math.max(t,24),bottom:24,left:24,right:24},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+this.chartSizes.chartsHeight+this.margins.bottom}render(e,t,n,r,a,i,o,s){var g;let{xAxis:c,yAxis:f,size:A,title:h}=t;this.updateChartSizes(A),this.updateViewport(r,n,c,f,i),this.updateCaptionsSize(),this.createFacetTitles(r,a),this.updateChartDimensions(r,n,c,f),this.createMainTitle(r,h),this.updateMargins();let m=le.jsx(Hwt,{settingsId:e,chartSettings:t,facetKeys:r,facetSettings:n,chartSizes:this.chartSizes,chartsDimensions:this.chartsDimensions,scales:this.scales,columnsCount:this.columnsCount,margins:this.margins,mainTitle:this.mainTitle,facetTitles:this.facetTitles,captionsSizes:this.captionsSizes,histogramDataByFacets:i,layers:o,aesColorGetter:Fwt(s,"fillColor")});this.component=m,(g=this.reactRoot)==null||g.render(m)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},Owt=Vwt,Qwt=10,zwt=class{constructor(e){Me(this,"type","bins");Me(this,"aes",{fillColor:"white",opacity:1});this.aes={...this.aes,...e.aes}}},Uwt=class{constructor(e){Me(this,"type","binsLine");Me(this,"aes",{opacity:1});this.aes={...this.aes,...e.aes}}},tZ=class{constructor(e){Me(this,"id");Me(this,"type","histogram");Me(this,"valueColumn");Me(this,"binsCount");Me(this,"facetSettings");Me(this,"facetBy");Me(this,"grouping");Me(this,"chartSettings");Me(this,"inheritedAes");Me(this,"layers");var t,n,r,a,i,o,s,c;s2t.parse(e),this.id=Ir.uniqueId("settings"),this.facetSettings={sharedX:!0,sharedY:!0,titlePosition:"left",...e.facetSettings},this.valueColumn=e.valueColumn,this.binsCount=e.binsCount??Qwt,this.facetBy=e.facetBy??[],this.grouping=e.grouping??[],this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(this.facetBy.length?400:600),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(this.facetBy.length?250:350)},title:{position:"center",show:!0,...e.title,name:((r=e.title)==null?void 0:r.name)??"Chart"},yAxis:{showGrid:!0,showTicks:!0,scale:((a=e.xAxis)==null?void 0:a.scale)??"linear",...e.yAxis},xAxis:{title:e.valueColumn.label??e.valueColumn.value??"",scale:((i=e.xAxis)==null?void 0:i.scale)??"linear",showGrid:((o=e.xAxis)==null?void 0:o.showGrid)??!0,showTicks:((s=e.xAxis)==null?void 0:s.showTicks)??!0},frame:{type:((c=e.frame)==null?void 0:c.type)??"full"},legend:{show:!0,position:"right",...e.legend}},this.inheritedAes=e.inheritedAes??{},this.layers=e.layers.map(f=>{if(f.type==="bins")return new zwt(f);if(f.type==="binsLine")return new Uwt(f);vA(f,"Unknown layer type")}).filter(Boolean)}};function nZ(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}var jwt=class extends Sg{constructor(t,n){super(t,n);Me(this,"settings");Me(this,"chartRenderer",new Owt);Me(this,"calculatedData",null);this.settings=new tZ(n)}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new tZ(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){console.warn("no chart state for histogram")}export(){return this._updateChart(),f3(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){return t.valueColumn.value!==n.valueColumn.value||t.facetBy.some((r,a)=>{var i;return r.value!==((i=n.facetBy[a])==null?void 0:i.value)})||t.grouping.length!==n.grouping.length||t.grouping.some((r,a)=>{var i;return r.value!==((i=n.grouping[a])==null?void 0:i.value)})||t.layers.length!==n.layers.length||t.layers.some((r,a)=>r.type!==n.layers[a].type)||t.binsCount!==n.binsCount||t.chartSettings.xAxis.scale!==n.chartSettings.xAxis.scale}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{valueColumn:t,facetBy:n,binsCount:r,chartSettings:a}=this.settings,i=n.map(f=>this.data.getColumnCategories(f.value)),o=i.length?nZ([...i]):[["null"]],s=n.map(f=>f.value)??null;this.data.setGrouping([...s]);let c=xwt(this.data,o,t,r,a.xAxis.scale);this.calculatedData={facetKeys:o.map(f=>f.join(", ")),facetKeysCombinations:o,histogramDataByFacets:c}}_updateAesInData(){this.calculatedData}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,facetSettings:r,inheritedAes:a,layers:i}=this.settings;this.chartRenderer.render(t,n,r,this.calculatedData.facetKeys,this.calculatedData.facetKeysCombinations,this.calculatedData.histogramDataByFacets,i,a)}};function Gwt(e,t,n,r,a,i){let o={};return t.forEach(s=>{let c=[],f=1/0,A=1/0,h=-1/0,m=-1/0;i.forEach(g=>{e.getRowsByGrouping([...s,g]).forEach(b=>{let C=b[n.value],x=b[r.value];f=Math.min(f,C),A=Math.min(A,x),h=Math.max(h,C),m=Math.max(m,x),C!==null&&x!==null&&c.push({id:`${Object.values(b)}`,x:C,y:x,label:a?b[a.valueLabels??a.value]:null,data:b})})}),c.sort((g,b)=>g.x-b.x),o[s.join("_")]={minX:f,maxX:h,minY:A,maxY:m,dots:c}}),o}function Ywt(e,t,n,r,a){return t.reduce((i,o)=>{let s=n[o].dots;return i[o]=e.map(c=>{if(c.type==="curve")return{type:"curve",info:c,geoms:r.map(f=>{let A=s.filter(m=>a.every((g,b)=>m.data[g.value]===f[b])),h=a.reduce((m,g,b)=>(m[g.value]=f[b],m),{});return{dots:A,data:h}})};if(c.type==="dots")return{type:"dots",info:c,geoms:s};vA(c,"Unknown scatterplot layer type")}),i},{})}var rZ=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r){let o=e%2===0?[]:[n];for(let s=1;s<e/2+1;s++)o.push(n+s),o.unshift(n-s);return o}if(e<2)return[n,r];let a=(r-n)/(e-1),i=[];for(let o=0;o<e-1;o++)i.push(n+a*o);return i.push(r),i};function Wwt(e,t,n){if(n==="linear")return rZ(e,t);if(n==="log"){let r=rZ(e,t),a=q1(t,t),i=r.map(o=>a.invert(o));return i[0]=t[0],i[i.length-1]=t[1],i}return[]}function J8(e,t,n){return(n==="log"?q1():Da()).domain(Wwt(e.length,t,n)).range(e)}function RP(e){let t=e.xPosition!=="middle"&&e.yPosition!=="middle",n=e.padding*(t?.7:1);return e.xPosition==="right"?e.x+n:e.xPosition==="middle"?e.x-e.width/2:e.x-e.width-n}function aZ(e){let t=e.xPosition!=="middle"&&e.yPosition!=="middle",n=e.padding*(t?.7:1);return e.yPosition==="middle"?e.y-e.height/2:e.yPosition==="top"?e.y-n-e.height:e.y+n}function Xwt(e,t){return RP(e)-t}function Kwt(e,t){return aZ(e)-t}function iZ(e){let t=RP(e),n=t+e.width,r=aZ(e),a=r+e.height;return{minX:t,maxX:n,minY:r,maxY:a}}function oZ(e,t,n){let r=Xwt(e,n),a=RP(e)+e.width+n,i=Kwt(e,t),o=i+e.height+2*t;return{minX:r,maxX:a,minY:i,maxY:o}}function Zwt(e,t,n){return e.minX>=0&&e.maxX<=t&&e.minY>=0&&e.maxY<=n}var q8=2;function Jwt(e,t=q8,n=q8){e.forEach(r=>{r.bbox=iZ(r),r.outerBBox=oZ(r,t,n)})}function eE(e,t,n,r=q8,a=q8){let i=[],o=new Dft,s=[["middle","right"],["top","right"],["bottom","right"],["middle","left"],["top","left"],["bottom","left"],["top","middle"],["bottom","middle"]];for(let c of e)for(let[f,A]of s){let h={...c,yPosition:f,xPosition:A};if(h.bbox=iZ(h),h.outerBBox=oZ(h,r,a),Zwt(h.outerBBox,t,n)&&!o.collides(h.outerBBox)){i.push(h),o.insert(h.outerBBox);break}}return i}function qwt(e){return`translate(${e},0)`}function e9t(e){return`translate(0,${e})`}function t9t(e){return e==="bottom"?`translate(0,${ed})`:`translate(${-ed},0)`}function n9t(e){return e==="bottom"?"hanging":"central"}function r9t(e){return e==="bottom"?"middle":"end"}var tE=({scale:e,tickSize:t=6,tickPadding:n=ed,orient:r="bottom",onlyPositive:a=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function o(C){return x=>{let k=C(x);return k===void 0?0:+k}}let{ticks:s,format:c}=b9(e,a,r==="bottom"),f=Math.max(t,0)+n,A=o(e.copy()),h=r==="bottom"?qwt:e9t,m=r==="left"?-1:1,g={[(r==="left"?"x":"y")+"2"]:m*t},b={[r==="left"?"x":"y"]:m*f};return le.jsx("g",{children:s.map((C,x)=>le.jsxs("g",{className:"tick",transform:h(A(C)+i),children:[le.jsx("line",{stroke:Zt,...g}),le.jsx("g",{transform:t9t(r),children:le.jsx("text",{fill:Zt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:n9t(r),textAnchor:r9t(r),...b,children:c(C)})})]},x))})},a9t=1;function i9t({scaleX:e,scaleY:t,width:n,height:r,axisX:a,axisY:i,frameType:o,updatingKey:s=""}){let[c,f]=Vn.useState(e.ticks()),[A,h]=Vn.useState(t.ticks()),{significantLines:m=[]}=a,{significantLines:g=[]}=i;return Vn.useEffect(()=>{let b=e.ticks().filter(x=>!m.includes(x)),C=t.ticks().filter(x=>!g.includes(x));f(b),h(C)},[e,t,s]),le.jsxs("g",{stroke:Jf,children:[a.showGrid&&c.map(b=>{let C=e(b);return le.jsx("line",{x1:C,x2:C,y1:0,y2:r},`x_${C}_${r}`)}),i.showGrid&&A.map(b=>{let C=t(b);return le.jsx("line",{x1:0,x2:n,y1:C,y2:C},`y_${C}_${n}`)}),le.jsx("g",{strokeDasharray:td(a.significantLinesStyle),stroke:Zt,children:m.map(b=>{let C=e(b);return le.jsx("line",{x1:C,x2:C,y1:0,y2:r},`significant_${C}_${r}`)})}),le.jsx("g",{strokeDasharray:td(i.significantLinesStyle),stroke:Zt,children:g.map(b=>{let C=t(b);return le.jsx("line",{x1:0,x2:n,y1:C,y2:C},`significant_${C}_${n}`)})}),o!=="empty"&&le.jsxs("g",{strokeWidth:a9t,children:[(a.showGrid||o!=="left")&&le.jsx("line",{stroke:o==="left"?Jf:Zt,x1:"0",x2:n,y1:r,y2:r}),(a.showGrid||o!=="bottom")&&le.jsx("line",{stroke:o==="bottom"?Jf:Zt,x1:"0",x2:"0",y1:"0",y2:r}),(a.showGrid||o==="full")&&le.jsx("line",{stroke:o==="full"?Zt:Jf,x1:n,x2:n,y1:"0",y2:r}),(i.showGrid||o==="full")&&le.jsx("line",{stroke:o==="full"?Zt:Jf,x1:"0",x2:n,y1:"0",y2:"0"})]})]})}var o9t=new Dc("16px Manrope");function lZ(e,t){return typeof e=="string"?e:t.length?t[0].data[e.value]:""}function l9t(e,t,n=[]){let r=e.data,a=[`x: ${Ki(e.x)}`,`y: ${Ki(e.y)}`];t.label&&a.unshift(`${t.label}: ${r[t.label]}`);for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function s9t(e){return typeof e.r2>"u"?null:le.jsxs(le.Fragment,{children:[le.jsx("tspan",{children:"R"}),le.jsx("tspan",{fontSize:"10px",dy:"-8",children:"2"}),le.jsx("tspan",{dy:"8",children:` = ${Ki(e.r2)}`})]})}function u9t(e){return typeof e.pValue>"u"?null:le.jsx("tspan",{children:`p-value = ${Ki(e.pValue)}`})}function c9t(e){if(typeof e.coefficients>"u")return null;let{slope:t,slopeError:n,intercept:r,interceptError:a}=e.coefficients;return le.jsx("tspan",{children:le.jsx("tspan",{children:`slope = ${Ki(t)} ± ${Ki(n)}, intercept = ${Ki(r)} ± ${Ki(a)}`})})}function f9t(e){let t=[s9t(e),u9t(e),c9t(e)].filter(n=>n!==null);return le.jsx(le.Fragment,{children:t.map((n,r)=>le.jsxs("tspan",{children:[n,le.jsx("tspan",{children:r<t.length-1&&", "})]},r))})}var NP=3;function sZ(e,t,n,r){if(!r)return[];let a=[];for(let i of e){let o=i.label;if(!o)continue;let s=o9t.getTextMetrics(String(o));a.push({name:String(o),width:s.width,height:s.actualBoundingBoxAscent+s.actualBoundingBoxDescent,x:t.x(i.x),y:t.y(i.y),xPosition:"right",yPosition:"middle",bbox:{minX:0,maxX:0,minY:0,maxY:0},dot:i,padding:n.dotSize(r.info.aes.dotSize,i.data)+NP})}return a}function d9t({width:e,height:t,dimensions:n,scales:r,xAxis:a,yAxis:i,frameType:o,dotsData:s,facetSettings:c,trendsData:f,keyColumn:A,margins:h,chartSizes:m,tooltips:g,tooltipsContainer:b,captionsSizes:C,facetTitle:x,onlyPositive:k,layersData:_,aesGetters:D}){let[O,I]=Vn.useState(null),{padding:$}=n,{dots:Q}=s,ee=a.showTicks?t2:0,K=i.showTicks?t2:0,re=lZ(a.title,Q),U=lZ(i.title,Q),G=n.chartEdgeSides.includes("left")||!(c!=null&&c.sharedY),Z=n.chartEdgeSides.includes("bottom")||!(c!=null&&c.sharedX),Y=n.chartEdgeSides.includes("left"),X=n.chartEdgeSides.includes("bottom"),oe={left:h.left+n.left+$.left,right:m.totalWidth-(h.left+n.left+$.left),top:h.top+n.top+$.top,bottom:m.totalHeight-(h.top+n.top+$.top)},me=!1,[ae,ye]=Vn.useState(()=>sZ(Q,r,D,_.find(Ne=>Ne.type==="dots"))),[Ce,ce]=Vn.useState(()=>eE(ae,e,t,NP,NP)),[ge,ze]=Vn.useState(null);return Vn.useEffect(()=>{ye(sZ(Q,r,D,_.find(Ne=>Ne.type==="dots")))},[Q,r,D,_]),Vn.useEffect(()=>{let Ne=eE(ae,e,t);ce(Ne)},[ae,e,t]),le.jsxs("g",{transform:`translate(${n.left+$.left},${n.top+$.top})`,children:[me,x.length&&le.jsxs("g",{children:[o==="full"&&le.jsx("rect",{x:"0",y:-$.top,height:$.top,width:e,fill:"#F7F8FA",stroke:Zt}),x.map((Ne,Ge)=>{let Oe=x.length,Xe=($.top-vP*Oe)/2;return le.jsx("text",{fontSize:"14px",fontWeight:"500",fill:Zt,x:e/2,dy:Xe+vP/2-$.top,y:Ge*vP,textAnchor:"middle",dominantBaseline:"central",children:Ne},Ge)})]}),le.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Zt,children:[X&&le.jsx("text",{x:e/2,y:t+$.bottom-Rm-u9/2,children:re}),me,Y&&le.jsx("text",{x:-$.left+Rm+u9/2,y:t/2,transform:`rotate(-90,${-$.left+Rm+u9/2},${t/2})`,children:U}),me]}),le.jsx(i9t,{width:e,height:t,scaleX:r.x,scaleY:r.y,axisX:a,axisY:i,frameType:o}),Z&&le.jsxs("g",{transform:`translate(0,${t})`,children:[le.jsx(tE,{scale:r.x,orient:"bottom",onlyPositive:k.x,tickSize:ee}),me]}),G&&le.jsxs("g",{children:[le.jsx(tE,{scale:r.y,orient:"left",onlyPositive:k.y,tickSize:K}),me]}),f&&f.map(({predict:Ne,getArea:Ge,color:Oe,data:Xe,bounded:dt,xBounds:Ye,stats:rt},He)=>{let[$e,ut]=dt?Ye:r.x.domain(),ct=(ut-$e)/15,Bt=Ne($e),dn=Ne(ut);if(isNaN(Bt)||isNaN(dn))return null;let gn=D.dotColor(Oe,Xe);return le.jsxs("g",{children:[le.jsx("text",{y:He*20+20,fill:gn,x:e-8,textAnchor:"end",children:f9t(rt)}),le.jsx("path",{d:Ge(r.x,r.y,Ir.range($e,ut+ct/2,ct)),fill:gn,opacity:.2}),le.jsx("line",{x1:r.x($e),x2:r.x(ut),y1:r.y(Bt),y2:r.y(dn),stroke:gn})]},He)}),_.map((Ne,Ge)=>{if(Ne.type==="dots")return le.jsxs("g",{children:[Q.map(Oe=>le.jsx("g",{transform:`translate(${r.x(Oe.x)},${r.y(Oe.y)})`,onMouseOver:()=>I(Oe),onMouseLeave:()=>I(null),children:Af(D.dotShape(Ne.info.aes.dotShape,Oe.data),D.dotSize(Ne.info.aes.dotSize,Oe.data),D.dotColor(Ne.info.aes.dotFill,Oe.data))},Oe.id)),Ce.map(Oe=>{let{name:Xe,height:dt,bbox:Ye,width:rt}=Oe;return le.jsx("g",{children:le.jsxs("g",{transform:`translate(${Ye.minX},${Ye.minY})`,children:[le.jsx("rect",{x:"0",y:"0",width:rt,height:dt,fill:"transparent",stroke:"none",onMouseOver:()=>ze(Oe.dot),onMouseLeave:()=>ze(null)}),le.jsx("text",{x:0,y:dt/2,stroke:"white",strokeWidth:2,paintOrder:"stroke",style:{pointerEvents:"none"},fontFamily:"Manrope",fontSize:"16px",dominantBaseline:"middle",children:Xe})]})},Oe.dot.id)}),ge&&le.jsxs("g",{transform:`translate(${r.x(ge.x)},${r.y(ge.y)})`,children:[Af(D.dotShape(Ne.info.aes.dotShape,ge.data),D.dotSize(Ne.info.aes.dotSize,ge.data)+1,"white","white"),Af(D.dotShape(Ne.info.aes.dotShape,ge.data),D.dotSize(Ne.info.aes.dotSize,ge.data),D.dotColor(Ne.info.aes.dotFill,ge.data))]},"activeDot")]},Ge);if(Ne.type==="curve"&&!Ne.info.smoothing)return Ne.geoms.map((Oe,Xe)=>le.jsx("g",{children:le.jsx("polyline",{points:Oe.dots.map(dt=>`${r.x(dt.x)},${r.y(dt.y)}`).join(" "),fill:"none",stroke:D.lineColor(Ne.info.aes.lineColor,Oe.data),strokeWidth:Ne.info.aes.lineWidth,strokeDasharray:td(Ne.info.aes.lineShape)})},Xe));if(Ne.type==="curve"&&Ne.info.smoothing)return Ne.geoms.map((Oe,Xe)=>le.jsx("g",{children:le.jsx("path",{d:d3().curve(A3).x(dt=>r.x(dt.x)).y(dt=>r.y(dt.y))(Oe.dots)??"",fill:"none",stroke:D.lineColor(Ne.info.aes.lineColor,Oe.data),strokeWidth:Ne.info.aes.lineWidth,strokeDasharray:td(Ne.info.aes.lineShape)})},Xe))}),g.show&&O&&le.jsx(oc,{content:l9t(O,A,g==null?void 0:g.content),x:r.x(O.x),y:r.y(O.y),active:!0,sideDistances:oe,container:b})]})}function A9t({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,facetKeys:a,facetSettings:i,scales:o,groupedDots:s,legendData:c,trendsData:f,columnsCount:A,margins:h,keyColumn:m,mainTitle:g,facetTitles:b,captionsSizes:C,onlyPositive:x,layersData:k,aesGetters:_}){let[D,O]=Vn.useState(),I=Vn.useRef(null);Vn.useEffect(()=>{I.current&&O(I.current)},[]);let{xAxis:$,yAxis:Q,title:ee,frame:K,legend:re,tooltips:U}=t,G=r[a[0]].padding,Z=r[a[A-1]].padding,Y=n.chartsWidth+yP,X=G.top;return le.jsx(f2,{dataId:e,children:le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${n.totalWidth} ${n.totalHeight}`,width:n.totalWidth,height:n.totalHeight,children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${h.left},${h.top})`,fontFamily:"Manrope",children:[le.jsx(d2,{title:g,show:ee.show,position:ee.position,leftPadding:G.left,rightPadding:Z.right,chartsWidth:n.chartsWidth}),a.map(oe=>le.jsx(d9t,{scales:{x:o.x[oe],y:o.y[oe]},width:n.chartWidth,height:n.chartHeight,dimensions:r[oe],margins:h,chartSizes:n,facetSettings:i,xAxis:$,yAxis:Q,frameType:K.type,dotsData:s[oe],trendsData:f?f[oe]:null,tooltips:U,tooltipsContainer:D,keyColumn:m,facetTitle:b[oe],captionsSizes:C,layersData:k[oe],onlyPositive:x,aesGetters:_},oe)),re.show&&le.jsx("g",{transform:`translate(${Y},${X})`,children:le.jsx(y9,{legendData:c})})]}),le.jsx("g",{ref:I})]})})}function p9t(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function h9t(e,t,n,r,a,i,o){let s=i.includes("left")||!(o!=null&&o.sharedY),c=i.includes("left")&&t.title!=="",f=i.includes("bottom")||!(o!=null&&o.sharedX),A=i.includes("bottom")&&e.title!=="",h=n.yAxisCaptionsWidth+2*gP,m=(t.showTicks?t2:0)+gP,g=c?u9+Rm:0,b=n.xAxisCaptionsWidth+2*gP,C=e.showTicks?t2:0,x=A?u9+Rm:0,k=h+m+g+LX,_=b+C+x+LX,D=Math.max(...r.map(O=>a[O].length));return{left:s?k:Rm,top:D===0?0:p3t*2+D*m9,bottom:f?_+8:Rm,right:Rm}}function m9t(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function v9t(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function g9t(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function v2(e,t){return function(n,r){var a,i;if($m(n)&&t==="dotSize"){let{domain:o,range:s}=n,c=Ny().domain(o).range(s)(Number(r[n.columnName.value]));return Math.max(1,c)}if($m(n)&&(t==="dotFill"||t==="lineColor")){let{domain:o,range:s,type:c="linear"}=n;return J8(s,o,c)(Number(r[n.columnName.value]))}if(g9t(n)){let o=n.value;return(i=((a=e[o])==null?void 0:a[String(r[o])])??hP)==null?void 0:i[t]}return n}}function y9t(e){return{dotShape:v2(e,"dotShape"),dotColor:v2(e,"dotFill"),dotSize:v2(e,"dotSize"),lineShape:v2(e,"lineShape"),lineColor:v2(e,"lineColor"),trendColor:v2(e,"dotFill")}}var w9t=class{constructor(){Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"component",le.jsx(le.Fragment,{}));Me(this,"margins",{top:qf,bottom:qf,left:qf,right:qf});Me(this,"chartsDimensions",{});Me(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Me(this,"columnsCount",1);Me(this,"rowsCount",1);Me(this,"scales",{x:{null:Da().domain([0,10]).range([0,600])},y:{null:Da().domain([0,10]).range([350,0])}});Me(this,"captionsSizes",{xAxisCaptionsWidth:30,yAxisCaptionsWidth:100});Me(this,"facetTitles",{});Me(this,"mainTitle",[]);Me(this,"legend",{width:0,height:0,items:[]})}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=zh(this.rootNode))}updateChartSizes(e){this.chartSizes.chartWidth=e.width,this.chartSizes.chartHeight=e.height}updateChartDimensions(e,t,n,r){let{chartWidth:a,chartHeight:i}=this.chartSizes,o=0,s=0;this.chartsDimensions=e.reduce((A,h,m)=>{let[g,b]=v9t(m,this.columnsCount),C=p9t(m,e.length,this.columnsCount,this.rowsCount),x=h9t(n,r,this.captionsSizes,m9t(e,this.rowsCount,this.columnsCount)[g],this.facetTitles,C,t),k=a+x.left+x.right,_=i+x.top+x.bottom;return A[h]={left:o,top:s,chartEdgeSides:C,padding:x,inner:{width:a,height:i},outer:{width:k,height:_}},o+=k,b===this.columnsCount-1&&(o=0,s+=_),A},{});let c=Math.max(...e.map(A=>this.chartsDimensions[A].outer.width+this.chartsDimensions[A].left)),f=Math.max(...e.map(A=>this.chartsDimensions[A].outer.height+this.chartsDimensions[A].top));this.chartSizes.chartsWidth=c,this.chartSizes.chartsHeight=f}updateViewport(e,t,n,r,a,i){let o=e.length,s=Math.min(t.nRows??o,o),c=Math.min(t.nCols??o,o);this.columnsCount=t.nRows?Math.ceil(o/s):c,this.rowsCount=Math.ceil(o/this.columnsCount);let[f,A]=[1/0,-1/0],[h,m]=[1/0,-1/0],g=e.reduce((C,x)=>{let k=a[x],{minX:_,minY:D,maxX:O,maxY:I}=k;return f=Math.min(f,_),h=Math.min(h,D),A=Math.max(A,O),m=Math.max(m,I),C[x]={minX:_,maxX:O,minY:D,maxY:I},C},{});e.forEach(C=>{let x=n.scale==="log"?Rv():Da(),k=g[C],_=n.lowerValue?Number(n.lowerValue):t.sharedX?f:k.minX,D=n.upperValue?Number(n.upperValue):t.sharedX?A:k.maxX;if(typeof n.symmetricRange<"u"){let $=n.symmetricRange;if($>=_&&$<=D){let Q=Math.max($-_,D-$);_=$-Q,D=$+Q}}let O=[0,this.chartSizes.chartWidth],I=x.copy().domain([_,D]).range([L8.LEFT,this.chartSizes.chartWidth-L8.RIGHT]);x.domain([I.invert(0),I.invert(this.chartSizes.chartWidth)]).range(O).nice(),this.scales.x[C]=x});let b=e.reduce((C,x)=>{let k=i?i[x]:[];return C[x]=k.reduce((_,D)=>{let O=D.bounded?D.xBounds:this.scales.x[x].domain(),I=D.getInterval(O[0]),$=D.getInterval(O[1]);return _.minY=Math.min(_.minY,isNaN(I.left)?_.minY:I.left,isNaN($.left)?_.minY:$.left),_.maxY=Math.max(_.maxY,isNaN(I.right)?_.maxY:I.right,isNaN($.right)?_.maxY:$.right),_},{minY:1/0,maxY:-1/0}),h=Math.min(h,C[x].minY),m=Math.max(m,C[x].maxY),C},{});e.forEach(C=>{let x=r.scale==="log"?Rv():Da(),k=g[C],_=b[C],D=r.lowerValue?Number(r.lowerValue):t.sharedY?h:Math.min(k.minY,_.minY),O=r.upperValue?Number(r.upperValue):t.sharedY?m:Math.max(k.maxY,_.maxY);if(typeof r.symmetricRange<"u"){let Q=r.symmetricRange;if(Q>=D&&Q<=O){let ee=Math.max(Q-D,O-Q);D=Q-ee,O=Q+ee}}let I=[this.chartSizes.chartHeight,0],$=x.copy().domain([D,O]).range([this.chartSizes.chartHeight-L8.BOTTOM,L8.TOP]);x.domain([$.invert(this.chartSizes.chartHeight),$.invert(0)]).range(I).nice(),this.scales.y[C]=x})}updateCaptionsSize(e){let t=new Dc("600 14px Arial"),n=0;function r(a){return Math.max(...a.map(i=>t.getTextWidth(i)))}Object.values(this.scales.y).forEach(a=>{let{ticks:i,format:o}=b9(a,e);n=Math.max(n,r(i.map(o)))}),this.captionsSizes={xAxisCaptionsWidth:20,yAxisCaptionsWidth:n}}createMainTitle(e,t){let n=this.chartsDimensions[e[0]],r=this.chartsDimensions[e[e.length-1]];this.mainTitle=Om(t.name,this.chartSizes.chartsWidth-n.padding.left-r.padding.right,20)}createFacetTitles(e,t){this.facetTitles=e.reduce((n,r,a)=>(t[a].length===1&&t[a][0]==="null"?n[r]=[]:n[r]=Om(t[a].join(", "),this.chartSizes.chartWidth,14),n),{})}updateMargins(){let e=24*this.mainTitle.length,t=e>0?e+24*2:0;this.margins={top:Math.max(t,qf),bottom:qf,left:qf,right:this.legend.width},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartsHeight,this.legend.height)+this.margins.bottom}updateLegendSize(e,t,n,r){if(!e.show){this.legend={width:0,height:0,items:[]};return}let a=[],i={width:0,height:0,left:0,top:0};if(n.forEach(A=>{let h=t[A.value];if(h.usedAes.length===0||!h.aesMap)return;let m={};h.values.forEach(C=>{m[C]||(m[C]={...mP}),h.usedAes.forEach(x=>{var k,_,D;(x==="dotFill"||x==="lineColor")&&(m[C].color=((k=h.aesMap[C])==null?void 0:k[x])??Zt),x==="dotShape"&&(m[C].shape=((_=h.aesMap[C])==null?void 0:_[x])??"21"),x==="dotSize"&&(m[C].size=((D=h.aesMap[C])==null?void 0:D[x])??3)})});let g=A.label??A.value,b=Hl().domain(h.values).range(h.values.map(C=>m[C]));a.push({...i,id:A.value,type:"dots",title:g,scale:b,values:h.values,labels:h.labels})}),r.forEach(A=>{if(A.type==="dots"&&$m(A.aes.dotFill)){let{domain:h,range:m,columnName:g,type:b="linear"}=A.aes.dotFill,C=g.label??g.value,x=J8(m,h,"linear"),k=(b==="log"?q1():Da()).domain(h).range([height,0]),_=a2(k,h);a.push({...i,id:"dotFill",type:"continuous",title:C,scale:x,tickPositionScale:k,values:_})}if(A.type==="dots"&&$m(A.aes.dotSize)){let{columnName:h,domain:m,range:g}=A.aes.dotSize,b=h.label??h.value,C=Ny(m,g),x=C.ticks(3),k=C.tickFormat(3),_=x.reduce((D,O)=>(D[String(O)]=k(O),D),{});a.push({...i,id:h.value,type:"size",title:b,scale:C,values:x,labels:_})}}),!a.length){this.legend={width:0,height:0,items:[]};return}let o=w9(a,this.chartSizes.chartHeight),s=o[o.length-1],c=s.left+s.width+2*yP,f=this.chartSizes.chartHeight;this.legend={width:c,height:f,items:o}}render(e,t,n,r,a,i,o,s,c,f,A,h,m,g){var O;let{xAxis:b,yAxis:C,size:x,title:k,legend:_}=t;this.updateChartSizes(x),this.updateViewport(r,n,b,C,i,o),this.updateCaptionsSize(c.y),this.createFacetTitles(r,a),this.updateChartDimensions(r,n,b,C),this.updateLegendSize(_,f,m,g),this.createMainTitle(r,k),this.updateMargins();let D=le.jsx(A9t,{settingsId:e,chartSettings:t,facetKeys:r,facetSettings:n,chartSizes:this.chartSizes,chartsDimensions:this.chartsDimensions,scales:this.scales,groupedDots:i,trendsData:o,legendData:this.legend,columnsCount:this.columnsCount,margins:this.margins,keyColumn:s,mainTitle:this.mainTitle,facetTitles:this.facetTitles,captionsSizes:this.captionsSizes,onlyPositive:c,layersData:A,aesGetters:y9t(h)});this.component=D,(O=this.reactRoot)==null||O.render(D)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},C9t=w9t,b9t=class{constructor(e){Me(this,"type","dots");Me(this,"aes",{dotFill:Zt,dotShape:"21",dotSize:3,opacity:1});this.aes={...this.aes,...e.aes}}},E9t=class{constructor(e){Me(this,"type","curve");Me(this,"smoothing");Me(this,"aes",{lineColor:Zt,lineWidth:1,lineShape:"solid",opacity:1});this.smoothing=e.smoothing??!1,this.aes={...this.aes,...e.aes}}},uZ=class{constructor(e){Me(this,"id");Me(this,"type","scatterplot");Me(this,"keyColumn");Me(this,"facetSettings");Me(this,"x");Me(this,"y");Me(this,"facetBy");Me(this,"grouping");Me(this,"label");Me(this,"chartSettings");Me(this,"inheritedAes");Me(this,"trend");Me(this,"layers");var t,n,r,a;W3t.parse(e),this.id=Ir.uniqueId("settings"),this.keyColumn=e.keyColumn,this.facetSettings={sharedX:!0,sharedY:!0,titlePosition:"left",...e.facetSettings},this.x=e.x,this.y=e.y,this.facetBy=e.facetBy??[],this.grouping=e.grouping??[],this.label=e.label??null,this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(this.facetBy.length?400:600),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(this.facetBy.length?250:350)},title:{position:"center",show:!0,...e.title,name:((r=e.title)==null?void 0:r.name)??"Chart"},yAxis:{title:e.y.label??e.y.value,scale:"linear",showGrid:!0,showTicks:!0,...e.yAxis},xAxis:{title:e.x.label??e.x.value,scale:"linear",showGrid:!0,showTicks:!0,...e.xAxis},frame:{type:((a=e.frame)==null?void 0:a.type)??"full"},legend:{show:!0,position:"right",...e.legend},tooltips:{show:!0,...e.tooltips}},this.inheritedAes=e.inheritedAes??{},this.trend=e!=null&&e.trend?{bounded:e.trend.bounded??!1,color:e.trend.color??Zt}:null,this.layers=e.layers.map(i=>{if(i.type==="dots")return new b9t(i);if(i.type==="curve")return new E9t(i);vA(i,"Unknown layer type")}).filter(Boolean)}},x9t=oht(r3t()),cZ=.05;function S9t(e){let t=3.3871328727963665,n=133.14166789178438,r=1971.5909503065513,a=13731.69376550946,i=45921.95393154987,o=67265.7709270087,s=33430.57558358813,c=2509.0809287301227,f=42.31333070160091,A=687.1870074920579,h=5394.196021424751,m=21213.794301586597,g=39307.89580009271,b=28729.085735721943,C=5226.495278852854,x=1.4234371107496835,k=4.630337846156546,_=5.769497221460691,D=3.6478483247632045,O=1.2704582524523684,I=.2417807251774506,$=.022723844989269184,Q=.0007745450142783414,ee=2.053191626637759,K=1.6763848301838038,re=.6897673349851,U=.14810397642748008,G=.015198666563616457,Z=.0005475938084995345,Y=10507500716444169e-25,X=6.657904643501103,oe=5.463784911164114,me=1.7848265399172913,ae=.29656057182850487,ye=.026532189526576124,Ce=.0012426609473880784,ce=27115555687434876e-21,ge=20103343992922881e-23,ze=.599832206555888,Ne=.1369298809227358,Ge=.014875361290850615,Oe=.0007868691311456133,Xe=18463183175100548e-21,dt=1421511758316446e-22,Ye=20442631033899397e-31,rt=e-.5,He,$e;return Math.abs(rt)<=.425?(He=.180625-rt*rt,$e=rt*(((((((c*He+s)*He+o)*He+i)*He+a)*He+r)*He+n)*He+t)/(((((((C*He+b)*He+g)*He+m)*He+h)*He+A)*He+f)*He+1),$e):(He=e,He=Math.sqrt(-Math.log(He)),He<=5?(He+=-1.6,$e=(((((((Q*He+$)*He+I)*He+O)*He+D)*He+_)*He+k)*He+x)/(((((((Y*He+Z)*He+G)*He+U)*He+re)*He+K)*He+ee)*He+1)):(He+=-5,$e=(((((((ge*He+ce)*He+Ce)*He+ye)*He+ae)*He+me)*He+oe)*He+X)/(((((((Ye*He+dt)*He+Xe)*He+Oe)*He+Ge)*He+Ne)*He+ze)*He+1)),$e=-$e,$e)}function fZ(e,t){let{sin:n,cos:r,sqrt:a,pow:i,exp:o,PI:s}=Math,c,f;if(t==1)return r(e*s/2)/n(e*s/2);if(t==2)return a(2/(e*(2-e))-2);let A=1/(t-.5),h=48/(A*A),m=((20700*A/h-98)*A-16)*A+96.36,g=((94.5/(h+m)-3)/h+1)*a(A*s*.5)*t;return c=g*e,f=i(c,2/t),f>.05+A?(c=S9t(e/2),f=c*c,t<5&&(m=m+.3*(t-4.5)*(c+.6)),m=(((.05*g*c-5)*c-7)*c-2)*c+h+m,f=(((((.4*f+6.3)*f+36)*f+94.5)/m-f-3)/h+1)*c,f=A*f*f,f>.002?f=o(f)-1:f=.5*f*f+f):f=((1/(((t+6)/(t*f)-.089*g-.822)*(t+2)*3)+.5/(t+4))*f-1)*(t+1)/(t+2)+1/f,a(t*f)}function B9t(e){let t=e.length,n=0,r=0,a=0,i=0;for(let c=0;c<e.length;++c){let f=e[c].x,A=e[c].y;if(!Number.isFinite(f)||!Number.isFinite(A)){--t;continue}n+=f,r+=A,a+=f*A,i+=f*f}let o=(t*a-n*r)/(t*i-n*n),s=(r-o*n)/t;return[o,s]}function k9t(e,t,n){let r=A=>A*t+n,a=e.length,i=Sc(e,A=>A.x)/e.length,o=fZ(cZ,a-2),s=Math.sqrt(Sc(e,A=>(A.y-r(A.x))**2)/(a-2)/Sc(e,A=>(A.x-i)**2)),c=s*o,f=s*Math.sqrt(Sc(e,A=>A.x**2)/a)*o;return{slope:t,intercept:n,slopeError:c,interceptError:f}}function T9t(e,t){let n=Sc(e,s=>s.x)/e.length,r=0,a=0;for(let s=0;s<e.length;++s)r+=Math.pow(e[s].x-n,2),a+=Math.pow(e[s].y-t(e[s].x),2);let i=Math.sqrt(a/(e.length-2)),o=fZ(cZ,e.length-2);return function(s){let c=t(s),f=i*Math.sqrt(1/e.length+Math.pow(s-n,2)/r),A=c-o*f,h=c+o*f;return{x:s,y:c,left:isNaN(A)?c:A,right:isNaN(h)?c:h}}}function _9t(e){let t=e.length;return Math.pow((t*Sc(e,n=>n.x*n.y)-Sc(e,n=>n.x)*Sc(e,n=>n.y))/(Math.sqrt(t*Sc(e,n=>n.x*n.x)-Math.pow(Sc(e,n=>n.x),2))*Math.sqrt(t*Sc(e,n=>n.y*n.y)-Math.pow(Sc(e,n=>n.y),2))),2)}function P9t(e,t){let n=tu(e,t);return tu(e.map(r=>(t(r)-n)**2))}function dZ(e,t){return Math.sqrt(P9t(e,t))}function M9t(e,t,n){let r=tu(e,t),a=tu(e,n),i=e.length;return Sc(e,o=>(o.x-r)*(o.y-a))/i}function D9t(e){let t=M9t(e,a=>a.x,a=>a.y),n=dZ(e,a=>a.x),r=dZ(e,a=>a.y);return t/(n*r)}function H9t(e,t){let n=e.length,r=1,a=1,i=n-r-1,o=tu(e,m=>m.y),s=Sc(e,m=>(t(m.x)-o)**2),c=Sc(e,m=>(t(m.x)-m.y)**2),f=s/a,A=c/i,h=f/A;return 1-(0,x9t.default)(h,a,i)}function I9t(e,t,n,r,a){return a?t.reduce((i,o)=>{let s=e[o].dots;return i[o]=n.map(c=>{let f=s.filter(x=>r.every((k,_)=>String(x.data[k.value])===c[_])),[A=0,h=0]=$A(f,x=>x.x),[m,g]=B9t(f),b=x=>m*x+g,C=T9t(f,b);return{predict:b,getInterval:C,getArea:(x,k,_)=>VB().x(D=>x(D.x)).y0(D=>k(D.left)).y1(D=>k(D.right))(_.map(C))??"",color:a.color,bounded:a.bounded,data:f[0].data,showStats:!0,xBounds:[A,h],stats:{r2:_9t(f),r:D9t(f),pValue:H9t(f,b),coefficients:k9t(f,m,g)}}}),i},{}):null}function AZ(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}function pZ(e){return typeof e=="object"&&"type"in e&&e.type==="grouping"}function L9t(e,t,n,r){return t.reduce((a,i)=>{let o=Ir.uniqBy(e.rows,h=>h[i.value]),s=h=>String(h[i.value]),c=h=>i.valueLabels?String(h[i.valueLabels]):s(h),f=new Set;n.forEach(h=>{h.aes&&Object.entries(h.aes).forEach(([m,g])=>{pZ(g)&&g.value===i.value&&f.add(m)})});let A=o.reduce((h,m)=>(h[s(m)]=c(m),h),{});return a[i.value]={values:o.map(s).filter(h=>h!=="null").sort((h,m)=>A[h].localeCompare(A[m],"en",{numeric:!0})),usedAes:[...f],aesMap:r[i.value],labels:A},a},{})}var R9t=class extends Sg{constructor(t,n){super(t,n);Me(this,"settings");Me(this,"chartRenderer",new C9t);Me(this,"calculatedData",null);this.settings=new uZ(n)}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new uZ(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){console.warn("no chart state for scatterplot")}export(){return this._updateChart(),f3(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o;return t.facetBy.some((s,c)=>{var f;return s.value!==((f=n.facetBy[c])==null?void 0:f.value)})||t.grouping.length!==n.grouping.length||t.grouping.some((s,c)=>{var f;return s.value!==((f=n.grouping[c])==null?void 0:f.value)})||(((r=t.label)==null?void 0:r.value)||((a=n.label)==null?void 0:a.value))&&((i=t.label)==null?void 0:i.value)!==((o=n.label)==null?void 0:o.value)||t.layers.length!==n.layers.length||t.layers.some((s,c)=>s.type!==n.layers[c].type)||!!t.trend!=!!n.trend}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{x:t,y:n,facetBy:r,grouping:a,keyColumn:i,trend:o,layers:s,inheritedAes:c,label:f}=this.settings,A=this.data.getColumnCategories(i.value),h=r.map($=>this.data.getColumnCategories($.value)),m=a.map($=>this.data.getColumnCategories($.value)),g=h.length?AZ([...h]):[["null"]],b=m.length?AZ([...m]):[["null"]],C=r.map($=>$.value)??null;this.data.setGrouping([...C,i.value]);let x={x:this.data.rows.every($=>{let Q=$[t.value];return Q===null||!(Number(Q)<0)}),y:this.data.rows.every($=>{let Q=$[n.value];return Q===null||!(Number(Q)<0)})},k=Gwt(this.data,g,t,n,f,A),_=Object.keys(k),D=I9t(k,_,b,a,o),O=L9t(this.data,a,s,c),I=Ywt(s,_,k,b,a);this.calculatedData={onlyPositive:x,dotsByFacets:k,facetKeys:_,facetKeysCombinations:g,trendsData:D,legendLabels:O,layersData:I}}_updateAesInData(){let t=this.calculatedData;if(!t)return;let{grouping:n,trend:r,layers:a,inheritedAes:i}=this.settings,{facetKeys:o,trendsData:s}=t;o.forEach(c=>{for(let f=0;f<a.length;f++)t.layersData[c][f].info=a[f]}),n.forEach(c=>{let f=new Set;a.forEach(A=>{A.aes&&Object.entries(A.aes).forEach(([h,m])=>{pZ(m)&&m.value===c.value&&f.add(h)})}),t.legendLabels[c.value].usedAes=[...f],t.legendLabels[c.value].aesMap=i[c.value]}),s&&r&&Object.keys(s).forEach(c=>{s[c].forEach(f=>{f.color=r.color,f.bounded=r.bounded})})}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,facetSettings:r,grouping:a,keyColumn:i,inheritedAes:o,layers:s}=this.settings;this.chartRenderer.render(t,n,r,this.calculatedData.facetKeys,this.calculatedData.facetKeysCombinations,this.calculatedData.dotsByFacets,this.calculatedData.trendsData,i,this.calculatedData.onlyPositive,this.calculatedData.legendLabels,this.calculatedData.layersData,o,a,s)}},nE={TOP:30,BOTTOM:30,LEFT:30,RIGHT:30},E9=20,hZ=4,$P=24;function N9t(e,t,n=[]){let r=e.data,a=[`x: ${Ki(e.x)}`,`y: ${Ki(e.y)}`];t.label&&a.unshift(`${t.label}: ${r[t.label]}`);for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function mZ(e){return typeof e=="string"?e:e.label??e.value}var vZ=d3().curve(A3);function $9t({scales:e,chartSettings:t,mainTitle:n,keyColumn:r,margins:a,chartSizes:i,onlyPositive:o,container:s,zoomStateKey:c,legendData:f,dotsByGrouping:A,layers:h,aesGetters:m,selectedDot:g=null}){var G;let{title:b,xAxis:C,yAxis:x,frame:k,legend:_}=t,D=C.showTicks?hZ:0,O=x.showTicks?hZ:0,I=C.title,$=x.title,Q={left:0,right:i.chartWidth,top:0,bottom:i.chartHeight};if(!s)return null;let ee=h.find(Z=>Z.type==="curve"),[K,re]=Vn.useState([]);function U(){let Z=Object.entries(A).map(([Y,X])=>({key:Y,d:ee!=null&&ee.smoothing?vZ(X)??"":X.map(oe=>`${e.x(oe.x)},${e.y(oe.y)}`).join(" "),dot:X[0]}));re(Z)}return Vn.useEffect(()=>{ee&&(vZ.x(Z=>e.x(Z.x)).y(Z=>e.y(Z.y)),U())},[c]),Vn.useEffect(()=>{ee&&U()},[ee==null?void 0:ee.smoothing]),le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${i.totalWidth} ${i.totalHeight}`,width:i.totalWidth,height:i.totalHeight,style:{pointerEvents:"none"},children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${a.left},${a.top})`,fontFamily:"Manrope",children:[le.jsx("clipPath",{id:"viewportClipPath",children:le.jsx("rect",{x:"0",y:"0",width:i.chartWidth,height:i.chartHeight})}),le.jsx(d2,{title:n,show:b.show,position:b.position,leftPadding:a.left,rightPadding:a.right,chartsWidth:i.chartWidth}),le.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Zt,children:[I&&le.jsx("text",{x:i.chartWidth/2,y:i.chartHeight+a.bottom-E9/2,children:mZ(I)}),$&&le.jsx("text",{x:-a.left+E9/2,y:i.chartHeight/2,transform:`rotate(-90,${-a.left+E9/2},${i.chartHeight/2})`,children:mZ($)})]}),le.jsx(eZ,{width:i.chartWidth,height:i.chartHeight,scaleX:e.x,scaleY:e.y,axisX:C,axisY:x,updatingKey:c,frameType:k.type}),le.jsx("g",{transform:`translate(0,${i.chartHeight})`,children:le.jsx(tE,{scale:e.x,orient:"bottom",onlyPositive:o.x,tickSize:D})}),le.jsx("g",{children:le.jsx(tE,{scale:e.y,orient:"left",onlyPositive:o.y,tickSize:O})}),ee&&ee.smoothing&&le.jsx("g",{clipPath:"url(#viewportClipPath)",children:K.map(({key:Z,d:Y,dot:X})=>le.jsx("path",{d:Y,fill:"none",stroke:m.dotFill(X.data),strokeWidth:ee.aes.lineWidth,strokeDasharray:m.lineType(X.data)},Z))}),ee&&!ee.smoothing&&le.jsx("g",{clipPath:"url(#viewportClipPath)",children:K.map(({key:Z,d:Y,dot:X})=>le.jsx("polyline",{points:Y,fill:"none",stroke:m.dotFill(X.data),strokeWidth:ee.aes.lineWidth,strokeDasharray:m.lineType(X.data)},Z))}),g&&le.jsx(oc,{content:N9t(g,r,(G=t.tooltips)==null?void 0:G.content),x:e.x(g.x),y:e.y(g.y),active:!0,sideDistances:Q,container:s}),_.show&&le.jsx("g",{transform:`translate(${i.chartWidth+$P},0)`,children:le.jsx(y9,{legendData:f})})]})]})}var F9t=gb.memo($9t),V9t=20;function O9t({scales:e,chartSizes:t,disabled:n,onPolygonUpdate:r}){let[a,i]=Vn.useState([]),[o,s]=Vn.useState(null),[c,f]=Vn.useState(null),A=Vn.useRef(null),h=Vn.useRef(null),m=Vn.useRef(null),g=Vn.useRef(a);function b(){A.current=null,h.current=null,m.current=null,g.current=[],i([]),s(null)}function C(_){n||_.key!=="Escape"||b()}Vn.useEffect(()=>{n&&(A.current=null,h.current=null,m.current=null,s(null))},[n]),Vn.useEffect(()=>(document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)),[]),Vn.useEffect(()=>{if(o&&c)return;if(a.length===0){r([]);return}let _=a.map(D=>D[0]);_.push(a[a.length-1][1]),r(_)},[a]);function x(){if(!A.current||n)return;let _=[...A.current],D=e.x.invert(_[0]),O=e.y.invert(_[1]),I=g.current,$=m.current,Q=h.current&&I.length>1?Math.sqrt((_[0]-h.current[0])**2+(_[1]-h.current[1])**2):1/0;m.current?m.current&&Q>V9t?(I=[...I,[m.current,[D,O]]],$=[D,O]):(I=[...I,[m.current,[D,O]]],I.length>2&&(I=[...I,[I[I.length-1][1],I[0][0]]]),$=null,I.length<=2?r([]):r(I.map(ee=>ee[0])),h.current=null):(h.current=_,I=[],$=[D,O],r([])),i(I),s($),g.current=I,m.current=$}function k(_){let D=[_.nativeEvent.offsetX,_.nativeEvent.offsetY];f(D),A.current=D}return le.jsxs("g",{children:[le.jsx("rect",{fill:"transparent",width:t.chartWidth,height:t.chartHeight,onMouseMove:k,onClick:x}),a.map(([_,D],O)=>le.jsx("line",{x1:e.x(_[0]),y1:e.y(_[1]),x2:e.x(D[0]),y2:e.y(D[1]),stroke:Zt,style:{pointerEvents:"none"}},O)),o&&c&&le.jsx("line",{x1:e.x(o[0]),y1:e.y(o[1]),x2:c[0],y2:c[1],stroke:Zt,style:{pointerEvents:"none"}},"lastLine")]})}function Q9t({scales:e,container:t,labels:n,aesGetters:r,chartSizes:a,onPolygonUpdate:i,lassoMode:o,selectedDot:s=null}){return t?le.jsxs("g",{children:[n.map(c=>{let{name:f,height:A,bbox:h,width:m}=c;return le.jsx("g",{children:le.jsxs("g",{transform:`translate(${h.minX},${h.minY})`,children:[le.jsx("rect",{x:"0",y:"0",width:m,height:A,fill:"transparent",stroke:"none"}),le.jsx("text",{x:0,y:A/2,stroke:"white",strokeWidth:2,paintOrder:"stroke",style:{pointerEvents:"none"},fontFamily:"Manrope",fontSize:"16px",dominantBaseline:"middle",children:f})]})},c.dot.id)}),le.jsx(O9t,{scales:e,chartSizes:a,disabled:!o,onPolygonUpdate:i}),s&&le.jsx("circle",{cx:e.x(s.x),cy:e.y(s.y),r:5,fill:r.dotFill(s.data)})]}):null}var z9t=Q9t;function U9t({settingsId:e,scales:t,chartSettings:n,mainTitle:r,keyColumn:a,margins:i,chartSizes:o,captionsSizes:s,onlyPositive:c,container:f,zoomStateKey:A,aesGetters:h,legendData:m,labels:g,onPolygonUpdate:b,lassoMode:C,dotsByGrouping:x,layers:k,selectedDot:_=null}){return f?le.jsx("div",{children:le.jsxs(f2,{dataId:e,children:[le.jsx(F9t,{aesGetters:h,dotsByGrouping:x,layers:k,scales:t,keyColumn:a,margins:i,mainTitle:r,captionsSizes:s,chartSettings:n,chartSizes:o,onlyPositive:c,container:f,selectedDot:_,zoomStateKey:A,legendData:m}),HB.createPortal(le.jsx(z9t,{scales:t,container:f,aesGetters:h,labels:g,chartSizes:o,selectedDot:_,onPolygonUpdate:b,lassoMode:C}),f)]})}):null}var gZ=e=>e.selection()!==e,yZ=(e,t)=>{e=e||"g";let n=(i,o)=>o,r=null,a=function(i,o){o=o||(g=>g);let s=i.selection(),c=gZ(i)?i:null,f=s.selectChildren(t==null?e:`${e}.${t}`).data(o,n),A=f.enter().append(e).attr("class",t),h=f.exit();f=f.merge(A);let m=c||r;return m&&(f=f.transition(m).style("opacity",1),A.style("opacity",1e-6),h=h.transition(m).style("opacity",1e-6)),h.remove(),f.enter=()=>A,f.exit=()=>h,f};return a.element=(...i)=>i.length?(e=i[0],a):e,a.className=(...i)=>i.length?(t=i[0],a):t,a.key=(...i)=>i.length?(n=i[0],a):n,a.transition=(...i)=>i.length?(r=i[0],a):r,a},wZ=(e,t,n)=>{let r=t[n];if(typeof r!="function")throw new Error(`Attempt to rebind ${n} which isn't a function on the source object`);return(...a)=>{var i=r.apply(t,a);return i===t?e:i}},CZ=(e,t,...n)=>{for(let r of n)e[r]=wZ(e,t,r);return e},j9t=e=>t=>e.reduce((n,r)=>n&&r(n),t),FP=(e,t,...n)=>{let r=j9t(n);for(let a of Object.keys(t)){let i=r(a);i&&(e[i]=wZ(e,t,a))}return e},G9t=e=>e.map(t=>typeof t=="string"?new RegExp(`^${t}$`):t),Y9t=(...e)=>(e=G9t(e),t=>e.every(n=>!n.test(t))&&t),g2=e=>typeof e=="function"?e:()=>e;function W9t(){let e=arguments;return function(t,n){for(let r=0,a=e.length;r<a;r++)if(e[r](t,n)==null)return!1;return!0}}var X9t=(e,t)=>{switch(e){case"left":return t/2;case"right":return-t/2;default:return 0}},bZ=e=>{let t=Object.assign({},e),n=()=>{};return Object.keys(t).forEach(r=>{n[r]=(...a)=>a.length?(t[r]=a[0],n):t[r]}),n},K9t=()=>{let e=()=>0,t=s=>s.x,n=s=>s.y,r="center",a=()=>5,i="vertical",o=bZ({decorate:()=>{},defined:(s,c)=>W9t(e,t,n)(s,c),xScale:J1(),yScale:J1()});return o.values=(s,c)=>{let f=a(s,c),A=X9t(r,f),h=o.xScale(),m=o.yScale();if(i==="vertical"){let g=m(n(s,c),c),b=m(e(s,c),c),C=h(t(s,c),c)+A;return{d:s,x:C,y:g,y0:b,width:f,height:g-b,origin:[C,g],baseOrigin:[C,b],transposedX:C,transposedY:g}}else{let g=h(n(s,c),c),b=h(e(s,c),c),C=m(t(s,c),c)+A;return{d:s,x:C,y:g,y0:b,width:f,height:g-b,origin:[g,C],baseOrigin:[b,C],transposedX:g,transposedY:C}}},o.xValues=()=>i==="vertical"?[t]:[e,n],o.yValues=()=>i!=="vertical"?[t]:[e,n],o.baseValue=(...s)=>s.length?(e=g2(s[0]),o):e,o.crossValue=(...s)=>s.length?(t=g2(s[0]),o):t,o.mainValue=(...s)=>s.length?(n=g2(s[0]),o):n,o.bandwidth=(...s)=>s.length?(a=g2(s[0]),o):a,o.align=(...s)=>s.length?(r=s[0],o):r,o.orient=(...s)=>s.length?(i=s[0],o):i,o},Z9t=()=>{let e=K9t(),t=g2(64),n=X$,r=qw(),a=qw(),i=qw().type(nh.UNSIGNED_SHORT),o=qw().type(nh.UNSIGNED_BYTE),s=L0t().crossValueAttribute(r).mainValueAttribute(a).sizeAttribute(i).definedAttribute(o),c=(b,C)=>!1,f=z0t,A=[],h=null,m=null,g=b=>{let C=f(e.xScale()),x=f(e.yScale()),k=!c(A,b);k&&(A=b,i.value((_,D)=>t(_,D)).data(b),o.value((_,D)=>e.defined()(_,D)).data(b)),(k||C.scale!==h)&&(h=C.scale,e.orient()==="vertical"?r.value((_,D)=>C.scale(e.crossValue()(_,D))).data(b):r.value((_,D)=>C.scale(e.mainValue()(_,D))).data(b)),(k||x.scale!==m)&&(m=x.scale,e.orient()==="vertical"?a.value((_,D)=>x.scale(e.mainValue()(_,D))).data(b):a.value((_,D)=>x.scale(e.crossValue()(_,D))).data(b)),s.xScale(C.webglScale).yScale(x.webglScale).type(K0t(n)).decorate(_=>e.decorate()(_,b,0)),s(b.length)};return g.size=(...b)=>b.length?(t=g2(b[0]),g):t,g.type=(...b)=>b.length?(n=b[0],g):n,g.equals=(...b)=>b.length?(c=b[0],g):c,g.scaleMapper=(...b)=>b.length?(f=b[0],g):f,FP(g,e,Y9t("baseValue","bandwidth","align")),CZ(g,s,"context","pixelRatio"),g},EZ=()=>{let e=[],t=a=>a,n=(a,i)=>i,r=bZ({decorate:()=>{},xScale:J1(),yScale:J1()});return r.xValues=()=>e.map(a=>a.xValues()).reduce((a,i)=>a.concat(i)),r.yValues=()=>e.map(a=>a.yValues()).reduce((a,i)=>a.concat(i)),r.mapping=(...a)=>a.length?(t=a[0],r):t,r.key=(...a)=>a.length?(n=a[0],r):n,r.series=(...a)=>a.length?(e=a[0],r):e,r},J9t=()=>{let e=EZ(),t=yZ("g"),n=yZ("g","multi"),r=a=>{gZ(a)&&(n.transition(a),t.transition(a));let i=e.mapping(),o=e.series(),s=e.xScale(),c=e.yScale();a.each((f,A,h)=>{let m=n(iu(h[A]),o);m.each((g,b,C)=>{g.xScale(s).yScale(c);let x=i(f,b,o);t(iu(C[b]),[x]).call(g)}),m.selection().order(),e.decorate()(m,f,A)})};return FP(r,e),CZ(r,n,"key"),r},q9t=()=>{let e=null,t=1,n=EZ(),r=a=>{let i=n.mapping(),o=n.series(),s=n.xScale(),c=n.yScale();o.forEach((f,A)=>{let h=i(a,A,o);f.context(e).pixelRatio(t).xScale(s).yScale(c);let m;f.decorate?(m=f.decorate(),f.decorate((g,b,C)=>{n.decorate()(g,a,A),m(g,b,C)})):n.decorate()(e,a,A),f(h),m&&f.decorate(m)})};return r.context=(...a)=>a.length?(e=a[0],r):e,r.pixelRatio=(...a)=>a.length?(t=a[0],r):t,FP(r,n),r};function e4t(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function rE(e={},t,n){return function(r){var a,i;if(e4t(n)){let o=n.value,s=r[o];return(i=((a=e[o])==null?void 0:a[String(s)])??hP)==null?void 0:i[t]}if($m(n)&&t==="dotFill"){let{domain:o,range:s,type:c="linear"}=n;return J8(s,o,c)(Number(r[n.columnName.value]))}return n}}var t4t=class{constructor(){Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"canvasNode",null);Me(this,"svgLayerElement",null);Me(this,"svgLayerComponent",le.jsx(le.Fragment,{}));Me(this,"tools",null);Me(this,"margins",{top:qf,bottom:qf,left:qf,right:qf});Me(this,"chartSizes",{chartWidth:600,chartHeight:350,totalWidth:600,totalHeight:350});Me(this,"scales",{x:Da().domain([0,10]).range([0,600]),y:Da().domain([0,10]).range([350,0]),xOriginal:Da().domain([0,10]).range([0,600]),yOriginal:Da().domain([0,10]).range([350,0])});Me(this,"polygon",[]);Me(this,"onPolygonUpdateOutside",()=>{});Me(this,"zoomStateKey","");Me(this,"selectedDot",null);Me(this,"captionsSizes",{xAxisCaptionsWidth:30,yAxisCaptionsWidth:100});Me(this,"mainTitle",[]);Me(this,"legend",{width:0,height:0,items:[]});Me(this,"notCalculatedProps",{});Me(this,"allPossibleLabels",[]);Me(this,"visibleLabels",[]);Me(this,"lassoMode",!1);Me(this,"onPolygonUpdate",e=>{this.polygon=e,this.updateByLasso(),this.onPolygonUpdateOutside(e)})}clear(){var e,t;this.parentNode&&this.rootNode&&this.canvasNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),(t=this.parentNode)==null||t.removeChild(this.canvasNode),this.parentNode=null,this.rootNode=null,this.canvasNode=null,this.svgLayerElement=null,this.tools=null),setTimeout(()=>{var n;(n=this.reactRoot)==null||n.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.canvasNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.parentNode.appendChild(this.canvasNode),this.reactRoot=zh(this.rootNode))}updateChartSizes(e){this.chartSizes.chartWidth=e.width,this.chartSizes.chartHeight=e.height}updateViewport(e,t,n){let r=e.scale==="log"?Rv():Da(),{minX:a,minY:i,maxX:o,maxY:s}=n;if(e.lowerValue!==void 0&&(a=Math.max(a,e.lowerValue)),e.upperValue!==void 0&&(o=Math.min(o,e.upperValue)),t.lowerValue!==void 0&&(i=Math.max(i,t.lowerValue)),t.upperValue!==void 0&&(s=Math.min(s,t.upperValue)),e.symmetricRange!==void 0){let g=e.symmetricRange;if(g>=a&&g<=o){let b=Math.max(g-a,o-g);a=g-b,o=g+b}}if(typeof t.symmetricRange<"u"){let g=t.symmetricRange;if(g>=i&&g<=s){let b=Math.max(g-i,s-g);i=g-b,s=g+b}}let c=[0,this.chartSizes.chartWidth],f=r.copy().domain([a,o]).range([nE.LEFT,this.chartSizes.chartWidth-nE.RIGHT]);r.domain([f.invert(0),f.invert(this.chartSizes.chartWidth)]).range(c).nice(),this.scales.x=r,this.scales.xOriginal=r.copy();let A=t.scale==="log"?Rv():Da(),h=[this.chartSizes.chartHeight,0],m=A.copy().domain([i,s]).range([this.chartSizes.chartHeight-nE.BOTTOM,nE.TOP]);A.domain([m.invert(this.chartSizes.chartHeight),m.invert(0)]).range(h).nice(),this.scales.y=A,this.scales.yOriginal=A.copy()}updateCaptionsSize(e){let t=new Dc("600 14px Arial");function n(o){return Math.max(...o.map(s=>t.getTextWidth(s)))}let{ticks:r,format:a}=b9(this.scales.y,e),i=n(r.map(a));this.captionsSizes={xAxisCaptionsWidth:20,yAxisCaptionsWidth:i}}createMainTitle(e){this.mainTitle=Om(e.name,this.chartSizes.totalWidth-this.margins.left-this.margins.right,20)}updateMargins(){let e=24*this.mainTitle.length,t=e>0?e+24*2:0;this.margins={top:Math.max(t,qf),bottom:qf+this.captionsSizes.xAxisCaptionsWidth+E9,left:qf+this.captionsSizes.yAxisCaptionsWidth+E9,right:this.legend.width+(this.legend.width>0?$P:0)+qf},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartHeight,this.legend.height)+this.margins.bottom,iu(this.canvasNode).style("width",this.chartSizes.chartWidth+"px").style("height",this.chartSizes.chartHeight+"px").style("top",this.margins.top+"px").style("left",this.margins.left+"px")}updateLegendSize(e,t,n,r){if(!e.show){this.legend={width:0,height:0,items:[]};return}let a=[],i={width:0,height:0,left:0,top:0};if(n.forEach(A=>{let h=t[A.value];if(h.usedAes.length===0||!h.aesMap)return;let m={};h.values.forEach(C=>{m[C]||(m[C]={...mP}),h.usedAes.forEach(x=>{var k,_;x==="dotFill"&&(m[C].color=((k=h.aesMap[C])==null?void 0:k[x])??Zt),x==="dotSize"&&(m[C].size=((_=h.aesMap[C])==null?void 0:_[x])??3)})});let g=A.label??A.value,b=Hl().domain(h.values).range(h.values.map(C=>m[C]));a.push({...i,id:A.value,type:"dots",title:g,scale:b,values:h.values,labels:h.labels})}),r.forEach(A=>{if(A.type==="dots"&&$m(A.aes.dotFill)){let{domain:h,range:m,columnName:g,type:b="linear"}=A.aes.dotFill,C=g.label??g.value,x=J8(m,h,"linear"),k=(b==="log"?q1():Da()).domain(h).range([height,0]),_=a2(k,h);a.push({...i,id:"dotFill",type:"continuous",title:C,scale:x,tickPositionScale:k,values:_})}}),!a.length){this.legend={width:0,height:0,items:[]};return}let o=w9(a,this.chartSizes.chartHeight),s=o[o.length-1],c=s.left+s.width+2*$P,f=this.chartSizes.chartHeight;this.legend={width:c,height:f,items:o}}initSettings(e,t,n,r,a,i,o,s){let{xAxis:c,yAxis:f,size:A,title:h,legend:m}=t;this.updateChartSizes(A),this.updateViewport(c,f,n),this.updateCaptionsSize(r.y),this.updateLegendSize(m,o,s,i),this.createMainTitle(h),this.updateMargins();let g=i.find($=>$.type==="dots"),b=i.find($=>$.type==="curve"),C={dotFill:rE(a,"dotFill",g.aes.dotFill),lineType:rE(a,"lineShape",(b==null?void 0:b.aes.lineShape)??"solid")},x=J0t().data(e).value($=>{let Q=Ly(C.dotFill($.data));return[Q.r/255,Q.g/255,Q.b/255,1]}),k=Z9t().equals(($,Q)=>$===Q).size(50).crossValue($=>$.x).mainValue($=>$.y).decorate($=>x($)),_=t0t().scaleExtent([.1,1e3]).filter(()=>!this.lassoMode).on("start",()=>{this.selectedDot=null}).on("zoom",$=>{let Q=$.transform,ee=Q.rescaleX(this.scales.xOriginal),K=Q.rescaleY(this.scales.yOriginal);this.scales.x.domain(ee.domain()),this.scales.y.domain(K.domain()),this.zoomStateKey=`${Q.x}_${Q.y}_${Q.k}`,this.renderSvgLayer(),this.renderWebglLayer()}).on("end",()=>{this.allPossibleLabels.forEach($=>{$.x=this.scales.x($.dot.x),$.y=this.scales.y($.dot.y)}),this.visibleLabels=eE(this.allPossibleLabels,this.chartSizes.chartWidth,this.chartSizes.chartHeight),this.renderSvgLayer()}),D=N_().x($=>$.x).y($=>$.y).addAll(e),O=q0t().on("point",([$])=>{var U,G;if(!$){this.selectedDot=null,this.renderSvgLayer();return}let Q=this.scales.x.invert($.x),ee=this.scales.y.invert($.y),K=(U=this.tools)==null?void 0:U.qt.find(Q,ee),re=this.selectedDot&&!K||!this.selectedDot&&K||((G=this.selectedDot)==null?void 0:G.id)!==(K==null?void 0:K.id);this.selectedDot=K??null,re&&this.renderSvgLayer()}),I=_0t({xScale:this.scales.x,yScale:this.scales.y}).xAxisHeight(()=>"0").yAxisWidth(()=>"0").svgPlotArea(J9t()).webglPlotArea(q9t().series([k]).mapping($=>$)).decorate($=>{let Q=$.enter();Q&&!this.svgLayerElement&&(Q.style("grid-template-columns","0 auto 1fr auto 0"),Q.style("grid-template-rows","0 auto 1fr auto 0"),this.svgLayerElement=Q.select(".svg-plot-area.plot-area svg").node()),Q.select(".svg-plot-area.plot-area").call(_).call(O)});this.tools={webglChart:I,zoom:_,qt:D,fillColor:x,pointSeries:k,aesGetters:C},iu(this.canvasNode).datum(e).style("position","absolute").style("width",this.chartSizes.chartWidth+"px").style("height",this.chartSizes.chartHeight+"px").style("top",this.margins.top+"px").style("left",this.margins.left+"px")}updateAes(e,t){var i;if(this.tools===null)return;let n=t.find(o=>o.type==="dots"),r=t.find(o=>o.type==="curve"),a={dotFill:rE(e,"dotFill",n.aes.dotFill),lineType:rE(e,"lineShape",(r==null?void 0:r.aes.lineShape)??"solid")};this.tools.aesGetters=a,(i=this.tools)==null||i.fillColor.value(o=>{var A;let s=((A=this.tools)==null?void 0:A.aesGetters.dotFill)??(()=>Zt),c=Ly(s(o.data)),f=this.polygon.length<2||dX(this.polygon,[o.x,o.y])?1:.2;return[c.r/255,c.g/255,c.b/255,f]})}updateByLasso(){var e;this.tools!==null&&((e=this.tools)==null||e.fillColor.value(t=>{var i;let n=((i=this.tools)==null?void 0:i.aesGetters.dotFill)??(()=>Zt),r=Ly(n(t.data)),a=this.polygon.length<2||dX(this.polygon,[t.x,t.y])?1:.4;return[r.r/255,r.g/255,r.b/255,a]}),this.renderWebglLayer())}updateData(e){this.tools!==null&&(iu(this.canvasNode).datum(e),this.tools.fillColor.data(e),this.tools.qt=N_().x(t=>t.x).y(t=>t.y).addAll(e))}render(e,t,n,r,a,i,o,s,c,f,A,h,m,g){if(this.lassoMode=g,this.tools===null)this.initSettings(a,t,i,r,s,c,f,A),this.onPolygonUpdateOutside=m;else{let{title:b,legend:C}=t;this.updateLegendSize(C,f,A,c),this.createMainTitle(b),this.updateMargins(),this.updateAes(s,c)}this.allPossibleLabels=h,this.allPossibleLabels.forEach(b=>{b.x=this.scales.x(b.dot.x),b.y=this.scales.y(b.dot.y)}),this.visibleLabels=eE(this.allPossibleLabels,this.chartSizes.chartWidth,this.chartSizes.chartHeight),this.notCalculatedProps={settingsId:e,chartSettings:t,onlyPositive:r,keyColumn:n,dotsByGrouping:o,layers:c},this.renderWebglLayer(),this.renderSvgLayer()}renderWebglLayer(){var e,t;(e=this.tools)!=null&&e.webglChart&&iu(this.canvasNode).call((t=this.tools)==null?void 0:t.webglChart)}renderSvgLayer(){var t,n;this.visibleLabels.forEach(r=>{r.x=this.scales.x(r.dot.x),r.y=this.scales.y(r.dot.y)}),Jwt(this.visibleLabels);let e={settingsId:this.notCalculatedProps.settingsId,chartSettings:this.notCalculatedProps.chartSettings,onlyPositive:this.notCalculatedProps.onlyPositive,keyColumn:this.notCalculatedProps.keyColumn,dotsByGrouping:this.notCalculatedProps.dotsByGrouping,layers:this.notCalculatedProps.layers,chartSizes:this.chartSizes,scales:this.scales,margins:this.margins,mainTitle:this.mainTitle,captionsSizes:this.captionsSizes,container:this.svgLayerElement,zoomStateKey:this.zoomStateKey,selectedDot:this.selectedDot,aesGetters:(t=this.tools)==null?void 0:t.aesGetters,legendData:this.legend,labels:this.visibleLabels,onPolygonUpdate:this.onPolygonUpdate,lassoMode:this.lassoMode};this.svgLayerComponent=le.jsx(U9t,{...e}),(n=this.reactRoot)==null||n.render(this.svgLayerComponent)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},n4t=t4t,aE=H.object({type:H.literal("grouping"),value:H.string()}),r4t=H.object({type:H.literal("dots"),aes:H.optional(H.object({dotFill:H.optional(H.union([H.string(),aE,rh(H.string())])),dotShape:H.optional(H.union([Od,aE])),dotSize:H.optional(H.union([H.number(),aE]))}))}),a4t=H.object({type:H.literal("curve"),smoothing:H.optional(H.boolean()),aes:H.optional(H.object({lineWidth:H.optional(H.number()),lineShape:H.optional(tp),lineColor:H.optional(H.union([H.string(),aE,rh(H.string())])),opacity:H.optional(H.number())}))}),i4t=H.union([r4t,a4t]),o4t=H.object({type:H.literal("scatterplot-umap"),title:H.object({name:H.string(),show:H.optional(H.boolean()),position:H.optional(Nm)}),size:H.optional(H.object({width:H.optional(H.number()),height:H.optional(H.number())})),legend:H.optional(H.object({show:H.optional(H.boolean()),position:H.optional(Bg)})),tooltips:H.optional(H.object({show:H.optional(H.boolean()),content:H.optional(H.array(Tr))})),frame:H.optional(H.object({type:H.optional(c9)})),keyColumn:Tr,x:Tr,y:Tr,xAxis:H.optional(r2),yAxis:H.optional(r2),grouping:H.optional(H.array(Tr)),label:H.optional(Tr),inheritedAes:H.optional(H.record(H.string(),n2)),layers:H.array(i4t),lassoMode:H.optional(H.boolean())}),l4t=class{constructor(e){Me(this,"type","dots");Me(this,"aes",{dotFill:Zt,dotShape:"21",dotSize:3,opacity:1});this.aes={...this.aes,...e.aes}}},s4t=class{constructor(e){Me(this,"type","curve");Me(this,"smoothing");Me(this,"aes",{lineColor:Zt,lineWidth:1,lineShape:"solid",opacity:1});this.smoothing=e.smoothing??!1,this.aes={...this.aes,...e.aes}}},xZ=class{constructor(e){Me(this,"id");Me(this,"type","scatterplot-umap");Me(this,"keyColumn");Me(this,"x");Me(this,"y");Me(this,"grouping");Me(this,"label");Me(this,"chartSettings");Me(this,"inheritedAes");Me(this,"layers");Me(this,"lassoMode");var t,n,r,a;o4t.parse(e),this.id=Ir.uniqueId("settings"),this.keyColumn=e.keyColumn,this.x=e.x,this.y=e.y,this.grouping=e.grouping??[],this.label=e.label??null,this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??600,height:((n=e==null?void 0:e.size)==null?void 0:n.height)??350},title:{position:"center",show:!0,...e.title,name:((r=e.title)==null?void 0:r.name)??"Chart"},yAxis:{title:e.y.label??e.y.value,scale:"linear",showGrid:!0,showTicks:!0,...e.yAxis},xAxis:{title:e.x.label??e.x.value,scale:"linear",showGrid:!0,showTicks:!0,...e.xAxis},frame:{type:((a=e.frame)==null?void 0:a.type)??"full"},legend:{show:!0,position:"right",...e.legend},tooltips:{show:!0,...e.tooltips}},this.inheritedAes=e.inheritedAes??{},this.layers=e.layers.map(i=>{if(i.type==="dots")return new l4t(i);if(i.type==="curve")return new s4t(i);throw new Error("Unknown layer type")}).filter(Boolean),this.lassoMode=e.lassoMode??!1}};function SZ(e){return typeof e=="object"&&"type"in e&&e.type==="grouping"}function u4t(e,t,n,r){return t.reduce((a,i)=>{let o=Ir.uniqBy(e.rows,h=>h[i.value]),s=h=>String(h[i.value]),c=h=>i.valueLabels?String(h[i.valueLabels]):s(h),f=new Set;n.forEach(h=>{h.aes&&Object.entries(h.aes).forEach(([m,g])=>{SZ(g)&&g.value===i.value&&f.add(m)})});let A=o.reduce((h,m)=>(h[s(m)]=c(m),h),{});return a[i.value]={values:o.map(s).sort((h,m)=>A[h].localeCompare(A[m],"en",{numeric:!0})),usedAes:[...f],aesMap:r[i.value],labels:A},a},{})}var c4t=10;function f4t(e){let t=[],n=new Dc("16px Manrope");for(let r of e){let a=r.label;if(!a)continue;let i=n.getTextMetrics(String(a));t.push({name:String(a),width:i.width,height:i.actualBoundingBoxAscent+i.actualBoundingBoxDescent,x:0,y:0,xPosition:"right",yPosition:"middle",bbox:{minX:0,maxX:0,minY:0,maxY:0},dot:r,padding:c4t})}return t}var d4t=class extends Sg{constructor(t,n,r){super(t,n);Me(this,"settings");Me(this,"chartRenderer",new n4t);Me(this,"onPolygonUpdate",()=>Kx);Me(this,"calculatedData",null);this.settings=new xZ(n),r&&(this.onPolygonUpdate=r[0])}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new xZ(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){t==="polygon"&&(this.chartRenderer.polygon=n,this._updateChart())}export(){return console.warn("export not implemented"),""}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o;return t.grouping.length!==n.grouping.length||t.grouping.some((s,c)=>{var f;return s.value!==((f=n.grouping[c])==null?void 0:f.value)})||(((r=t.label)==null?void 0:r.value)||((a=n.label)==null?void 0:a.value))&&((i=t.label)==null?void 0:i.value)!==((o=n.label)==null?void 0:o.value)}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{x:t,y:n,keyColumn:r,label:a,grouping:i,layers:o,inheritedAes:s}=this.settings,c={x:!0,y:!0},f={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0},A=o.some(x=>x.type==="curve"),h=new Set,m={},g=this.data.rows.reduce((x,k)=>{if(k[t.value]===null||k[n.value]===null)return x;let _=Number(k[t.value]),D=Number(k[n.value]);c.x&&_!==null&&_<0&&(c.x=!1),c.y&&D!==null&&D<0&&(c.y=!1),_!==null&&_<f.minX&&(f.minX=_),_!==null&&_>f.maxX&&(f.maxX=_),D!==null&&D<f.minY&&(f.minY=D),D!==null&&D>f.maxY&&(f.maxY=D);let O={x:_,y:D,id:String(k[r.value]),label:a&&k[a.value]?String(k[a.value]):null,data:k};if(A){let I=i.map($=>k[$.value]).join("_");h.add(I),m[I]||(m[I]=[]),m[I].push(O)}return x.push(O),x},[]),b=[...h];A&&b.forEach(x=>{m[x].sort((k,_)=>k.x-_.x)});let C=u4t(this.data,i,o,s);this.calculatedData={onlyPositive:c,dots:g,dotsByGrouping:m,groupingKeys:b,allPossibleLabels:f4t(g),dotsExtents:f,legendLabels:C},this.chartRenderer.updateData(g)}_updateAesInData(){let t=this.calculatedData;if(!t)return;let{layers:n,inheritedAes:r,grouping:a}=this.settings;this.chartRenderer.updateAes(r,n),a.forEach(i=>{let o=new Set;n.forEach(s=>{s.aes&&Object.entries(s.aes).forEach(([c,f])=>{SZ(f)&&f.value===i.value&&o.add(c)})}),t.legendLabels[i.value].usedAes=[...o],t.legendLabels[i.value].aesMap=r[i.value]})}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,keyColumn:r,inheritedAes:a,layers:i,grouping:o,lassoMode:s}=this.settings;this.chartRenderer.render(t,n,r,this.calculatedData.onlyPositive,this.calculatedData.dots,this.calculatedData.dotsExtents,this.calculatedData.dotsByGrouping,a,i,this.calculatedData.legendLabels,o,this.calculatedData.allPossibleLabels,this.onPolygonUpdate,s)}};function A4t(e){let t=cL(e),n=tu(e);return t===void 0||n===void 0||t===0?r=>r:r=>(r-n)/t}function p4t(e){let t=tu(e),[n,r]=$A(e);return t===void 0||n===void 0||r===void 0?a=>a:a=>(a-t)/(r-n)}function h4t(e,t){return e==="standardScaling"?A4t(t):e==="meanNormalization"?p4t(t):n=>n}function m4t(e,t,n,r,a,i,o,s,c,f){let A={meta:{facetKeys:o,xKeys:[],yKeys:[],xLabels:{},yLabels:{},facetKeyValues:o.reduce((C,x,k)=>(C[x]=s[k],C),{}),valueExtentSize:[1/0,-1/0],valueExtentColor:[1/0,-1/0]},facets:{}},h=new Set,m=new Set,g=t.valueLabels??t.value,b=n.valueLabels??n.value;if(e.rows.forEach(C=>{let x=i.length?i.map(I=>C[I.value]).join("_"):"null",k=C[t.value],_=C[n.value],D=C[r.value]??f,O=C[a.value]??f;if(!(k===null||_===null||D===null||O===null)){if(A.facets[x]||(A.facets[x]={xKeys:[],yKeys:[],cells:{}}),A.facets[x].xKeys.push(k),A.facets[x].yKeys.push(_),h.has(k)||(h.add(k),A.meta.xKeys.push(k)),m.has(_)||(m.add(_),A.meta.yKeys.push(_)),A.facets[x].cells[k]||(A.facets[x].cells[k]={}),A.meta.valueExtentSize[0]=Math.min(D,A.meta.valueExtentSize[0]),A.meta.valueExtentSize[1]=Math.max(D,A.meta.valueExtentSize[1]),A.meta.valueExtentColor[0]=Math.min(O,A.meta.valueExtentColor[0]),A.meta.valueExtentColor[1]=Math.max(O,A.meta.valueExtentColor[1]),A.facets[x].cells[k][_])throw Error(`More than 1 value for x=${k}, y=${_}`);if(A.meta.xLabels[k]&&String(C[g])!==A.meta.xLabels[k])throw Error(`More than 1 x-label value for x=${k}`);if(A.meta.yLabels[_]&&String(C[b])!==A.meta.yLabels[_])throw Error(`More than 1 y-label value for y=${_}`);A.meta.xLabels[k]=String(C[g]),A.meta.yLabels[_]=String(C[b]),A.meta&&(A.facets[x].cells[k][_]={id:`${k}_${_}`,x:k,y:_,sizeValue:D,normalizedSizeValue:D,colorValue:O,normalizedColorValue:O,data:C})}}),o.forEach(C=>{let x=A.facets[C];x.xKeys=Ir.uniq(x.xKeys),x.yKeys=Ir.uniq(x.yKeys)}),c){let C=[1/0,-1/0];o.forEach(x=>{let{xKeys:k,yKeys:_,cells:D}=A.facets[x],O=c.direction==="row"?k:_,I=c.direction==="row"?_:k,$=c.direction==="row"?(Q,ee)=>{var K;return(K=D[Q])==null?void 0:K[ee]}:(Q,ee)=>{var K;return(K=D[ee])==null?void 0:K[Q]};I.forEach(Q=>{let ee=[];O.forEach(re=>{var G;let U=(G=$(re,Q))==null?void 0:G.colorValue;U!==void 0&&ee.push(U)});let K=h4t(c.method,ee);O.forEach(re=>{let U=$(re,Q);U!==void 0&&(U.normalizedColorValue=K(U.colorValue),C[0]=Math.min(U.normalizedColorValue,C[0]),C[1]=Math.max(U.normalizedColorValue,C[1]))})})}),A.meta.valueExtentColor=C}return A.meta.valueExtentSize[0]===1/0&&(A.meta.valueExtentSize[0]=0),A.meta.valueExtentSize[1]===-1/0&&(A.meta.valueExtentSize[1]=0),A.meta.valueExtentColor[0]===1/0&&(A.meta.valueExtentColor[0]=0),A.meta.valueExtentColor[1]===-1/0&&(A.meta.valueExtentColor[1]=0),A}var v4t=15,Mg=8,iE=30,g4t=48,y4t=24,oE=16,y2=4,lE=4,BZ=20,w4t=16,u1={left:["axis","axisTitle"],right:["axis","axisTitle"],top:["axis","axisTitle","facetTitle"],bottom:["axis","axisTitle"]};function C4t(e,t,n,r,a,i,o){let s=r.includes(t.position),c=r.includes(e.position),f=a.length>1,A=e.showTicks?lE:0,h=t.showTicks?lE:0,m=c&&e.showTitle?iE:0,g=s&&t.showTitle?iE:0,b=c&&e.showAxisLabels&&i>oE?n.xAxisCaptions+A+y2:0,C=s&&t.showAxisLabels&&o>oE?n.yAxisCaptions+h+y2:0;return{left:{axisTitle:t.position==="left"?g:0,axis:t.position==="left"?C:0},right:{axisTitle:t.position==="right"?g:0,axis:t.position==="right"?C:0},top:{facetTitle:f?g4t:0,axisTitle:e.position==="top"?m:0,axis:e.position==="top"?b:0},bottom:{axisTitle:e.position==="bottom"?m:0,axis:e.position==="bottom"?b:0}}}function b4t(e,t,n){return{left:u1.left.reduce((r,a,i)=>{let o=i>0?u1.left[i-1]:null,s=e.left[a];return r[a]={x:o?r[o].x-s:-s,y:0,width:s,height:n,isVisible:s>0},r},{}),right:u1.right.reduce((r,a,i)=>{let o=i>0?u1.right[i-1]:null,s=e.right[a];return r[a]={x:o?r[o].x+r[o].width:t,y:0,width:s,height:n,isVisible:s>0},r},{}),top:u1.top.reduce((r,a,i)=>{let o=i>0?u1.top[i-1]:null,s=e.top[a];return r[a]={x:0,y:o?r[o].y-s:-s,width:t,height:s,isVisible:s>0},r},{}),bottom:u1.bottom.reduce((r,a,i)=>{let o=i>0?u1.bottom[i-1]:null,s=e.bottom[a];return r[a]={x:0,y:o?r[o].y+r[o].height:n,width:t,height:s,isVisible:s>0},r},{})}}function E4t(e,t,n,r){let{xLabels:a,yLabels:i}=n.meta,o=e.xAxisLabels/180*Math.PI,s=e.yAxisLabels/180*Math.PI,c=0,f=0,A=e.xAxisLabels===45;if(A){let m=n.meta.xKeys,g=t.x,b=g>oE,C=a[m[0]];c=Math.max(c,(A&&b?r.getTextWidth(C)*Math.cos(o):0)-g/2)}let h=e.yAxisLabels===45;if(h){let m=n.meta.yKeys;if(m.length){let g=t.y,b=g>oE,C=i[m[m.length-1]];f=Math.max(f,(h&&b?r.getTextWidth(C)*Math.cos(s):0)-g/2)}}return{xCaptionTail:c,yCaptionTail:f}}function x4t({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:f,xLabels:A,yLabels:h}){let m=i.showTicks?lE:0,g=o.showTicks?lE:0,b=e.top.axis.isVisible||e.bottom.axis.isVisible,C=e.top.axisTitle.isVisible?e.top.axisTitle:e.bottom.axisTitle,x=e.top.axis.isVisible?e.top.axis:e.bottom.axis,k=e.left.axis.isVisible||e.right.axis.isVisible,_=e.left.axisTitle.isVisible?e.left.axisTitle:e.right.axisTitle,D=e.left.axis.isVisible?e.left.axis:e.right.axis;return le.jsxs("g",{children:[le.jsxs("g",{children:[C.isVisible&&le.jsxs("g",{transform:`translate(${C.x},${C.y})`,children:[le.jsx("text",{x:C.width/2,y:C.height/2,textAnchor:"middle",dominantBaseline:"central",children:i.title}),t&&le.jsx("rect",{width:C.width,height:C.height,stroke:Zt,fill:"none"})]}),b&&le.jsxs("g",{fontSize:"14px",transform:`translate(${x.x},${x.y})`,children:[n.map(O=>{let I=f.xAxisLabels!==0,$=i.position==="bottom",Q=$?0:x.height,ee=$?Q+m:Q-m,K=$?ee+y2:ee-y2,re=a.x(O)+s/2,U=-f.xAxisLabels;return le.jsxs("g",{children:[le.jsx("line",{x1:re,x2:re,y1:Q,y2:ee,stroke:Zt}),le.jsx("text",{x:re,y:K,textAnchor:I?$?"end":"start":"middle",transform:`rotate(${U},${re},${K})`,dominantBaseline:I?"central":$?"hanging":"auto",children:A[O]})]},O)}),t&&le.jsx("rect",{width:x.width,height:x.height,stroke:Zt,fill:"none"})]})]}),le.jsxs("g",{children:[_.isVisible&&le.jsx("g",{transform:`translate(
|
|
15188
|
+
${_.y+_.height/2})`,children:le.jsx("text",{transform:`rotate(${o.position==="left"?-90:90})`,dominantBaseline:"central",textAnchor:"middle",children:o.title})}),t&&le.jsx("rect",{x:_.x,y:_.y,width:_.width,height:_.height,stroke:Zt,fill:"none"}),k&&le.jsx("g",{fontSize:"14px",transform:`translate(${D.x},${D.y})`,children:r.map(O=>{let I=f.yAxisLabels!==0,$=o.position==="left",Q=-(90-f.yAxisLabels),ee=f.yAxisLabels===0?"middle":$?"end":"start",K=I?"central":$?"auto":"hanging",re=$?D.width:0,U=$?re-g:re+g,G=$?U-l2:U+l2,Z=a.y(O)+c/2;return le.jsxs("g",{children:[le.jsx("line",{x1:re,x2:U,y1:Z,y2:Z,stroke:Zt}),le.jsx("text",{x:G,y:Z,textAnchor:ee,transform:`rotate(${Q},${G},${Z})`,dominantBaseline:K,children:h[O]})]},O)})}),t&&le.jsx("rect",{x:D.x,y:D.y,height:D.height,width:D.width,stroke:Zt,fill:"none"})]})]})}function fwt({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,xGroupKeys:f,yGroupKeys:A,xKeysByGroups:h,yKeysByGroups:m,labelAngles:g,xLabels:b,yLabels:C,xGroupLabels:x,yGroupLabels:k}){return le.jsxs("g",{fontWeight:"500",children:[le.jsx(cwt,{sideElementBBoxes:e,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:g,xLabels:b,yLabels:C,debug:t}),le.jsx(uwt,{sideElementBBoxes:e,xGroupKeys:f,yGroupKeys:A,xKeysByGroups:h,yKeysByGroups:m,xGroupLabels:x,yGroupLabels:k,scales:a,stepX:s,stepY:c,xAxis:i,yAxis:o,labelAngles:g,debug:t})]})}function UK(e,t="top"){let{source:n,target:r}=e;return t==="top"||t==="bottom"?`M ${n.x},${n.y} L ${r.x},${n.y} L${r.x},${r.y}`:`M ${n.x},${n.y} L ${n.x},${r.y} L${r.x},${r.y}`}function jK(e,t,n,r,a){if(!n)return"";let i=n.aes[e];if(!f9(i))return i;let o=i.value,s=a[o],c=r[o][t.data.keys[0]];return t.data.keys.every(f=>c===r[o][f])?s(String(c))[e]:s.unknown()[e]}var GK={x:0,y:0,width:0,height:0};function dwt({dendrograms:e,sideElementBBoxes:t,xDataByKeys:n,yDataByKeys:r,aesScales:a}){let i=e.x.data,o=e.y.data,s=i?t[i.position].dendro:GK,c=o?t[o.position].dendro:GK;function f(h,m){return jK(h,m,i,n,a)}function A(h,m){return jK(h,m,o,r,a)}return le.jsxs("g",{children:[le.jsx("g",{transform:`translate(${s.x},${s.y})`,children:i&&!i.hidden&&e.x.trees.map((h,m)=>{let g=h.links(),b=h.descendants();return le.jsxs("g",{children:[g.map(C=>{let x=i.edgeInheritance==="up"?C.source:C.target;return le.jsx("path",{d:UK(C,i.position),stroke:f("lineColor",x),strokeWidth:f("lineWidth",x),strokeDasharray:td(f("lineShape",x)),fill:"none"},`${C.source.x},${C.source.y},${C.target.x},${C.target.y}`)}),i.showNodes&&b.map(C=>le.jsx("g",{transform:`translate(${C.x},${C.y})`,children:Af(f("dotShape",C),f("dotSize",C),f("dotFill",C))},`${C.x},${C.y}`))]},m)})}),le.jsx("g",{transform:`translate(${c.x},${c.y})`,children:o&&!o.hidden&&e.y.trees.map((h,m)=>{let g=h.links(),b=h.descendants();return le.jsxs("g",{children:[g.map(C=>{let x=o.edgeInheritance==="up"?C.source:C.target;return le.jsx("path",{d:UK(C,o.position),stroke:A("lineColor",x),strokeWidth:A("lineWidth",x),strokeDasharray:td(A("lineShape",x)),fill:"none"},`${C.source.x},${C.source.y},${C.target.x},${C.target.y}`)}),o.showNodes&&b.map(C=>le.jsx("g",{transform:`translate(${C.x},${C.y})`,children:Af(A("dotShape",C),A("dotSize",C),A("dotFill",C))},`${C.x},${C.y}`))]},m)})})]})}function Awt({frame:e,width:t,height:n,xGroupKeys:r,yGroupKeys:a,xKeysByGroups:i,yKeysByGroups:o,scales:s,stepX:c,stepY:f}){return le.jsxs("g",{children:[e.type==="full"&&le.jsx("rect",{fill:"none",stroke:Zt,x:"0",y:"0",width:t,height:n}),e.type==="groups"&&r.map(A=>{let h=i[A].length;if(h===0)return null;let m=h*c,g=s.x(i[A][0]);return a.map(b=>{let C=o[b].length;if(C===0)return null;let x=C*f,k=s.y(o[b][0]);return le.jsx("rect",{x:g,y:k,width:m,height:x,stroke:Zt,fill:"none"},`${g}_${k}`)})})]})}function IP(e){if(e===null)return"null";if(typeof e=="number"){let t=e>0?Math.floor(e):Math.ceil(e),n=e-t;return t+Number(n.toPrecision(2))}return e}function pwt(e,t,n=[]){let r=e.data,a=[`X: ${t.xLabels[e.x]}`,`Y: ${t.yLabels[e.y]}`,`Value: ${IP(e.value)}${e.value!==e.normalizedValue?` (${IP(e.normalizedValue)})`:""}`];for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function hwt(e,t){let n=[];return e.xKey&&n.push(`X: ${t.xLabels[e.xKey]}`),e.yKey&&n.push(`Y: ${t.yLabels[e.yKey]}`),n.push(`${e.title}: ${IP(e.value)}`),n}function mwt({dendrograms:e,facetKey:t,dimensions:n,scales:r,cells:a,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,colorScale:f,chartSettings:A,cellsMeta:h,stepX:m,stepY:g,sharedX:b,sharedY:C,annotations:x,annotationColorScales:k,dendrogramAesScales:_,aes:D,labelAngles:O,chartSizes:I,margins:$,tooltipsContainer:Q}){let[ee,K]=Vn.useState(null),[re,U]=Vn.useState(null),{xAxis:G,yAxis:Z,tooltips:Y}=A,{width:X,height:oe}=n.inner,{padding:me,chartEdgeSides:ae,sideElementBBoxes:ye}=n,{xGroupLabels:Ce,yGroupLabels:ce,xLabels:ge,yLabels:ze}=h,Ne=r.x.domain(),Ge=r.y.domain(),Oe={left:$.left+n.left+me.left,right:I.totalWidth-($.left+n.left+me.left),top:$.top+n.top+me.top,bottom:I.totalHeight-($.top+n.top+me.top)},Xe=!1;return le.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:G2t,children:[le.jsxs("g",{transform:`translate(${me.left},${me.top})`,children:[le.jsx(swt,{sideElementBBoxes:ye,annotations:x,cellsMeta:h,annotationColorScales:k,sharedX:b,sharedY:C,chartEdgeSides:ae,width:X,height:oe,scales:r,stepX:m,stepY:g,aes:D,frame:A.frame,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,setSelectedAnnotation:U}),le.jsx(dwt,{dendrograms:e,sideElementBBoxes:ye,xDataByKeys:h.xDataByKeys,yDataByKeys:h.yDataByKeys,aesScales:_}),ye.top.facetTitle.isVisible&&le.jsx("text",{x:ye.top.facetTitle.x,y:ye.top.facetTitle.y+ye.top.facetTitle.height-j2t,fontWeight:"500",fontSize:"20px",children:h.facetKeyValues[t].join(", ")}),Xe,Ne.map(dt=>Ge.map(Ye=>{var He;let rt=(He=a==null?void 0:a[dt])==null?void 0:He[Ye];return rt?le.jsx("rect",{x:r.x(dt),y:r.y(Ye),width:m,height:g,stroke:D.cellStrokeColor,fill:rt.value===null?D.emptyCellColor:f(rt.normalizedValue),onMouseOver:()=>K(rt),onMouseLeave:()=>K(null)},rt?rt.id:`${dt}_${Ye}`):null})),le.jsx(Awt,{frame:A.frame,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,scales:r,stepX:m,stepY:g,width:X,height:oe}),le.jsx(fwt,{xAxis:G,yAxis:Z,scales:r,stepX:m,stepY:g,debug:Xe,sideElementBBoxes:ye,xKeys:Ne,yKeys:Ge,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,xGroupLabels:Ce,yGroupLabels:ce,labelAngles:O,xLabels:ge,yLabels:ze})]}),A.tooltips.show&&ee&&le.jsx(oc,{content:pwt(ee,h,Y==null?void 0:Y.content),x:r.x(String(ee.x))+m/2,y:r.y(String(ee.y))+g/2,offset:Ne.length>1?m/2:0,active:!0,sideDistances:Oe,container:Q}),A.tooltips.show&&re&&le.jsx(oc,{content:hwt(re,h),x:re.x,y:re.y,offset:0,active:!0,sideDistances:Oe,container:Q})]})}function vwt({margins:e,captionsSizes:t,settingsId:n,chartSettings:r,chartSizes:a,chartsDimensions:i,facetKeys:o,facetSettings:s,xGroupKeys:c,yGroupKeys:f,scales:A,colorScale:h,groupedCells:m,cellsMeta:g,step:b,annotations:C,annotationColorScales:x,legend:k,aes:_,dendrograms:D,dendrogramAesScales:O,columnsCount:I,labelAngles:$}){let[Q,ee]=Vn.useState(),K=Vn.useRef(null);Vn.useEffect(()=>{K.current&&ee(K.current)},[]);let re=i[o[0]].padding,U=i[o[I-1]].padding,G=e.left+a.chartsWidth+j8,Z=e.top+re.top;return le.jsx(f2,{dataId:n,children:le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${a.totalWidth} ${a.totalHeight}`,width:a.totalWidth,height:a.totalHeight,fontFamily:"Manrope",children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${e.left},${e.top})`,children:[le.jsx(d2,{title:[r.title.name],show:r.title.show,position:r.title.position,leftPadding:re.left,rightPadding:U.right,chartsWidth:a.chartsWidth}),o.map(Y=>{let{cells:X,xKeysByGroups:oe,yKeysByGroups:me}=m[Y];return le.jsx(mwt,{dendrograms:D[Y],captionsSizes:t,facetKey:Y,dimensions:i[Y],xGroupKeys:c,yGroupKeys:f,xKeysByGroups:s.sharedX?g.xKeysByGroups:oe,yKeysByGroups:s.sharedY?g.yKeysByGroups:me,sharedX:s.sharedX,sharedY:s.sharedY,scales:{x:A.x[Y],y:A.y[Y]},cells:X,cellsMeta:g,stepX:b.x[Y],stepY:b.y[Y],colorScale:h,chartSettings:r,aes:_,annotations:C,annotationColorScales:x,dendrogramAesScales:O,labelAngles:$,margins:e,chartSizes:a,tooltipsContainer:Q},Y)})]}),le.jsx("g",{transform:`translate(${G},${Z})`,children:le.jsx(y9,{legendData:k})}),le.jsx("g",{ref:K})]})})}function YK(e,t,n){function r(a){a[n]=t(a.data.height),a.children&&a.children.forEach(r)}r(e)}function WK(e,t,n,r=n){function a(i){i[r]=i[n]+t,i.children&&i.children.forEach(a)}a(e)}var gwt=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r){let o=e%2===0?[]:[n];for(let s=1;s<e/2+1;s++)o.push(n+s),o.unshift(n-s);return o}if(e<2)return[n,r];let a=(r-n)/(e-1),i=[];for(let o=0;o<e-1;o++)i.push(n+a*o);return i.push(r),i};function XK(e,t,n){let r=n;return e&&(e.colorRange&&(r=e.colorRange),e.method==="standardScaling"&&(r=[-2,2]),e.method==="meanNormalization"&&(r=[-.75,.75])),gwt(t,r)}var ywt=class{constructor(){Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"component",le.jsx(le.Fragment,{}));Me(this,"chartsDimensions",{});Me(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Me(this,"margins",{top:_g,bottom:_g,left:_g,right:_g});Me(this,"captionsSizes",{xAxisCaptions:100,yAxisCaptions:100,xGroupCaptions:Vm,yGroupCaptions:Vm,xCaptionTail:0,yCaptionTail:0});Me(this,"labelAngles",{xAxisLabels:0,yAxisLabels:0,xGroupLabels:0,yGroupLabels:0});Me(this,"columnsCount",1);Me(this,"rowsCount",1);Me(this,"scales",{x:{null:Hl().domain(["null"]).range([1])},y:{null:Hl().domain(["null"]).range([1])}});Me(this,"step",{x:{},y:{}});Me(this,"colorScale",Da().domain([0,1]).range(["white","black"]));Me(this,"annotationColorScales",{});Me(this,"dendrogramAesScales",{});Me(this,"legend",{width:0,height:0,items:[]});Me(this,"dendrograms",{})}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=zh(this.rootNode))}updateMargins(e){this.margins={top:e.show?24+24*2:_g,bottom:_g,left:_g,right:this.legend.width},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartsHeight+this.margins.bottom,this.legend.height)}updateLegendSize(e,t,n,r,a){if(!t.show){this.legend={width:0,height:0,items:[]};return}let i=this.chartSizes.chartHeight,o=[],s={width:0,height:0,left:0,top:0},c=m=>m.reduce((g,b)=>(g[b]=String(b),g),{});if(e==="continuous"){let m=this.colorScale,g=a2(m,a),b=Da([g[0],g[g.length-1]],[i,0]),C=r.label??r.value;o.push({...s,type:"continuous",id:"heatmapValue",scale:m,values:g,title:C,tickPositionScale:b})}else if(e==="discrete"){let m=this.colorScale,g=r.label??r.value,b=m.domain(),C=c(b);o.push({...s,type:"discreteColor",id:"heatmapValue",title:g,scale:m,values:b,labels:C})}if(n.forEach(m=>{let g=m.valueColumn.label??m.valueColumn.value;if(m.type==="continuous"){let b=this.annotationColorScales[m.id].scale,C=a2(b,a),x=Da([C[0],C[C.length-1]],[i,0]);o.push({...s,type:"continuous",id:m.id,tickPositionScale:x,title:g,scale:b,values:C})}if(m.type==="discrete"){let b=this.annotationColorScales[m.id].scale,C=b.domain(),x=c(C);o.push({...s,type:"discreteColor",id:m.id,title:g,scale:b,values:C,labels:x})}}),!o.length){this.legend={width:0,height:0,items:[]};return}let f=w9(o,this.chartSizes.chartHeight),A=f[f.length-1],h=A.left+A.width+2*j8;this.legend={width:h,height:i,items:f}}updateCaptionsSize(e,t,n,r){let a=new Dc("bold 14px Arial"),{xGroupKeys:i,yGroupKeys:o,xGroupLabels:s,yGroupLabels:c,xKeysByGroups:f,yKeysByGroups:A,xLabels:h,yLabels:m}=e.meta;this.labelAngles={xAxisLabels:t.axisLabelsAngle,yAxisLabels:n.axisLabelsAngle,xGroupLabels:t.groupLabelsAngle,yGroupLabels:n.groupLabelsAngle};let g=Ir.flatten(Object.values(f)),b=Ir.flatten(Object.values(A)),C=g.map(K=>a.getTextWidth(h[K])),x=b.map(K=>a.getTextWidth(m[K])),k=i.map(K=>a.getTextWidth(s[K])),_=o.map(K=>a.getTextWidth(c[K])),{xCaptionTail:D,yCaptionTail:O}=owt(this.labelAngles,r,this.step,e,a),I=this.labelAngles.xGroupLabels/180*Math.PI,$=this.labelAngles.yGroupLabels/180*Math.PI,Q=this.labelAngles.xAxisLabels/180*Math.PI,ee=this.labelAngles.yAxisLabels/180*Math.PI;this.captionsSizes={xCaptionTail:D,yCaptionTail:O,xGroupCaptions:Math.max(...k,0)*Math.sin(I)||Vm,yGroupCaptions:Math.max(..._,0)*Math.sin($)||Vm,xAxisCaptions:Math.max(...C,0)*Math.sin(Q)||Vm,yAxisCaptions:Math.max(...x,0)*Math.sin(ee)||Vm}}updateChartDimensions(e,t,n,r,a,i,o,s,c,f){let A=t.length,h=Math.min(a.nRows??A,A),m=Math.min(a.nCols??A,A);this.columnsCount=a.nRows?Math.ceil(A/h):m,this.rowsCount=Math.ceil(A/this.columnsCount);let{width:g,height:b}=e,{sharedX:C,sharedY:x}=a;this.chartsDimensions={};let k=0,_=0;t.forEach((I,$)=>{let Q=$%this.columnsCount+1,ee=zK($,t.length,this.columnsCount,this.rowsCount),K=this.step.x[I],re=this.step.y[I],U=nwt(i,o,this.captionsSizes,s,c,f,ee,C,x,t,n,r,K,re),G=iwt(s,ee,C,x);function Z(ae){return Math.max(s1[ae].reduce((ye,Ce)=>ye+U[ae][Ce],0),G[ae],z2t)}let Y={left:Z("left"),right:Z("right"),top:Z("top"),bottom:Z("bottom")};Y.left<this.captionsSizes.xCaptionTail&&(Y.left=this.captionsSizes.xCaptionTail),Y.bottom<this.captionsSizes.yCaptionTail&&(Y.bottom=this.captionsSizes.yCaptionTail);let X=rwt(U,g,b),oe=g+Y.left+Y.right,me=b+Y.top+Y.bottom;this.chartsDimensions[I]={left:k,top:_,inner:{width:g,height:b},outer:{width:oe,height:me},padding:Y,sideElementBBoxes:X,chartEdgeSides:ee},k+=oe,Q===this.columnsCount&&(k=0,_+=me)});let D=t.slice(0,this.columnsCount).reduce((I,$)=>I+this.chartsDimensions[$].outer.width,0),O=t.filter((I,$)=>$%this.columnsCount===0).reduce((I,$)=>I+this.chartsDimensions[$].outer.height,0);this.chartSizes.chartsWidth=D,this.chartSizes.chartsHeight=O}updateChartsSizes(e){let{width:t,height:n}=e;this.chartSizes.chartWidth=t,this.chartSizes.chartHeight=n}updateScales(e,t,n,r,a,i,o,s,c){let{width:f,height:A}=a,{meta:h,facets:m}=t,{sharedX:g,sharedY:b}=r,C=(k,_={})=>k.sort((D,O)=>i.sorting==="asc"?(_[D]??D).localeCompare(_[O]??O,"en",{numeric:!0}):(_[O]??O).localeCompare(_[D]??D,"en",{numeric:!0})),x=(k,_={})=>k.sort((D,O)=>o.sorting==="asc"?(_[D]??D).localeCompare(_[O]??O,"en",{numeric:!0}):(_[O]??O).localeCompare(_[D]??D,"en",{numeric:!0}));e.forEach(k=>{let _=m[k],D=C(h.xGroupKeys),O=x(h.yGroupKeys),{xKeysByGroups:I}=g?h:_,{yKeysByGroups:$}=b?h:_,Q=D.map(ye=>I[ye].length),ee=O.map(ye=>$[ye].length),K=Q.reduce((ye,Ce)=>ye+Ce,0),re=ee.reduce((ye,Ce)=>ye+Ce,0),U=(f-(Q.filter(ye=>ye>0).length-1)*n)/K,G=(A-(ee.filter(ye=>ye>0).length-1)*n)/re,Z=[],Y=[],X=0;D.forEach(ye=>{let Ce=s?I[ye]:C(I[ye],h.xLabels);Y.push(...Ce),Ce.forEach(()=>{Z.push(X),X+=U}),Ce.length>0&&(X+=n)});let oe=[],me=[],ae=0;O.forEach(ye=>{let Ce=c?$[ye]:x($[ye],h.yLabels);me.push(...Ce),Ce.forEach(()=>{oe.push(ae),ae+=G}),Ce.length>0&&(ae+=n)}),this.scales.x[k]=Hl().domain(Y).range(Z),this.scales.y[k]=Hl().domain(me).range(oe),this.step.x[k]=U,this.step.y[k]=G})}updateAesScale(e,t,n,r,a,i,o){if(e==="continuous")n.valueColors?this.colorScale=Da().domain(n.valuesByColors??XK(o,n.valueColors.length,t)).range(n.valueColors):n.colorsList&&(this.colorScale=Da().domain(XK(o,n.colorsList.length,t)).range(n.colorsList));else if(n.colorsMap){let f=Object.entries(n.colorsMap);this.colorScale=Hl().domain(f.map(A=>A[0])).range(f.map(A=>A[1])).unknown("#ccc")}else n.colorsList&&(this.colorScale=QK(n.colorsList,i.map(String)));let{xDataByKeys:s,yDataByKeys:c}=a.meta;r.forEach(f=>{let{colors:A,type:h,axis:m,valueColumn:g}=f,b=(m==="x"?s:c)[g.value];if(h==="discrete"){let C=Ir.uniq(Object.values(b).map(String)).sort();this.annotationColorScales[f.id]={type:"discrete",scale:QK(A,C)}}else{let C=Object.values(b).map(Number);if(!C.length)return;let[x=C[0],k=C[0]]=$A(C);this.annotationColorScales[f.id]={type:"continuous",scale:awt(A,x,k,0,.5,1)}}})}updateDendrogram(e,t,n,r,a,i,o){e.forEach(s=>{this.dendrograms[s]={x:{trees:[],data:i},y:{trees:[],data:o}};let{xKeysByGroups:c,yKeysByGroups:f}=r[s],{hierarchyX:A,hierarchyY:h}=a[s],m=Math.max(...A.map(b=>b.data.height)),g=Math.max(...h.map(b=>b.data.height));i&&(this.dendrograms[s].x.trees=A.map((b,C)=>{let x=t[C],k=c[x];xB().separation(()=>1).size([k.length*this.step.x[s],i.size])(b);let _=b,D=Da().domain(i.position==="top"?[0,m]:[m,0]).range([i.size,0]);return YK(_,D,"y"),WK(_,this.scales.x[s](k[0]),"x"),_}),this.dendrograms[s].x.data=i),o&&(this.dendrograms[s].y.trees=h.map((b,C)=>{let x=n[C],k=f[x];xB().separation(()=>1).size([k.length*this.step.y[s],o.size])(b);let _=b,D=Da().domain(o.position==="left"?[0,g]:[g,0]).range([o.size,0]);return WK(_,this.scales.y[s](k[0]),"x","y"),YK(_,D,"x"),_}),this.dendrograms[s].y.data=o)})}updateDendrogramAesScales(e){if(!e)return;let t=Object.keys(e);this.dendrogramAesScales=t.reduce((n,r)=>{let a=e[r],i=Object.keys(a);return n[r]=Hl().domain(i).range(i.map(o=>({...nK,...a[o]}))).unknown(nK),n},{})}render(e,t,n,r,a,i,o,s,c,f,A,h,m){var K;let{meta:g,facets:b}=a,{facetKeys:C,xGroupKeys:x,yGroupKeys:k,valueExtent:_}=g,{xAxis:D,yAxis:O,title:I,size:$,valueType:Q}=t;this.updateChartsSizes($),this.updateAesScale(Q,_,r,i,a,h,m),this.updateScales(C,a,r.groupGap,n,$,t.xAxis,t.yAxis,s,c),this.updateCaptionsSize(a,D,O,n),this.updateChartDimensions($,C,x,k,n,D,O,i,s,c),this.updateLegendSize(Q,t.legend,i,o,_),this.updateMargins(I),this.updateDendrogram(C,x,k,b,f,s,c),this.updateDendrogramAesScales(A);let ee=le.jsx(vwt,{aes:r,annotations:i,annotationColorScales:this.annotationColorScales,captionsSizes:this.captionsSizes,cellsMeta:g,columnsCount:this.columnsCount,chartsDimensions:this.chartsDimensions,chartSettings:t,chartSizes:this.chartSizes,colorScale:this.colorScale,dendrogramAesScales:this.dendrogramAesScales,dendrograms:this.dendrograms,facetKeys:C,facetSettings:n,groupedCells:b,labelAngles:this.labelAngles,legend:this.legend,margins:this.margins,scales:this.scales,settingsId:e,step:this.step,xGroupKeys:x,yGroupKeys:k});this.component=ee,(K=this.reactRoot)==null||K.render(ee)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},wwt=ywt,LP={lineColor:Zt,dotShape:"21",dotFill:Zt,dotSize:3,lineShape:"solid",lineWidth:1},KK={size:150,distance:"euclidean",linkage:"average",fillNA:0,showNodes:!0,hidden:!1,edgeInheritance:"up",aes:LP},ZK=class{constructor(e){Me(this,"id");Me(this,"type","heatmap");Me(this,"facetSettings");Me(this,"xColumn");Me(this,"xGroupBy");Me(this,"yColumn");Me(this,"yGroupBy");Me(this,"valueColumn");Me(this,"facetBy");Me(this,"normalization");Me(this,"chartSettings");Me(this,"aes");Me(this,"annotations");Me(this,"dendrogramX");Me(this,"dendrogramY");Me(this,"inheritedDendrogramAes");Me(this,"NAValueAs");var t,n,r,a,i,o,s,c,f,A,h,m,g;if(t2t.parse(e),this.id=Ir.uniqueId("settings"),this.facetSettings={sharedX:(e.facetBy??[]).length>0,sharedY:(e.facetBy??[]).length>0,...e.facetSettings},this.xColumn=e.xColumn,this.xGroupBy=e.xGroupBy??[],this.yColumn=e.yColumn,this.yGroupBy=e.yGroupBy??[],this.valueColumn=e.valueColumn,this.facetBy=e.facetBy??[],this.chartSettings={title:{position:"left",show:!0,...e.title,name:((t=e.title)==null?void 0:t.name)??"Chart"},size:{width:((n=e==null?void 0:e.size)==null?void 0:n.width)??(this.facetBy.length?400:600),height:((r=e==null?void 0:e.size)==null?void 0:r.height)??(this.facetBy.length?250:350)},frame:{type:((a=e.frame)==null?void 0:a.type)??"none"},valueType:e.valueType??"continuous",yAxis:{title:e.yColumn.label??e.yColumn.value,showTicks:!0,showTitle:!0,showAxisLabels:!0,showGroupLabels:!0,position:"left",groupingPosition:"left",axisLabelsAngle:90,groupLabelsAngle:0,sorting:"asc",...e.yAxis},xAxis:{title:e.xColumn.label??e.xColumn.value,showTicks:!0,showTitle:!0,showAxisLabels:!0,showGroupLabels:!0,position:"bottom",groupingPosition:"bottom",axisLabelsAngle:90,groupLabelsAngle:0,sorting:"asc",...e.xAxis},legend:{show:!0,position:"right",...e.legend},tooltips:{show:!0,...e.tooltips}},this.normalization=this.chartSettings.valueType==="continuous"?e.normalization??null:null,this.NAValueAs=e.NAValueAs??null,this.aes={colorsList:((i=e.aes)==null?void 0:i.colorsList)??["black","white","red"],colorsMap:((o=e.aes)==null?void 0:o.colorsMap)??null,valueColors:((s=e.aes)==null?void 0:s.valueColors)??null,valuesByColors:((c=e.aes)==null?void 0:c.valuesByColors)??null,cellStrokeColor:((f=e.aes)==null?void 0:f.cellStrokeColor)??"none",groupGap:((A=e.aes)==null?void 0:A.groupGap)??3,emptyCellColor:((h=e.aes)==null?void 0:h.emptyCellColor)??"white"},this.annotations=(e.annotations??[]).map(b=>b.axis==="x"?{id:Ir.uniqueId("annotation"),axis:"x",valueColumn:b.valueColumn,position:b.position??this.chartSettings.xAxis.position,titlePosition:b.titlePosition??"right",showTitle:b.showTitle??!0,type:b.type,colors:b.colors??["white","black"]}:{id:Ir.uniqueId("annotation"),axis:"y",valueColumn:b.valueColumn,position:b.position??this.chartSettings.yAxis.position,titlePosition:b.titlePosition??"top",showTitle:b.showTitle??!0,type:b.type,colors:b.colors??["white","black"]}),e.valueType==="discrete"&&(e.dendrogramX||e.dendrogramY))throw Error("Dendrogram is not available with discrete cells values");this.dendrogramX=e.dendrogramX?{...KK,position:"top",...e.dendrogramX,aes:{...LP,...(m=e.dendrogramX)==null?void 0:m.aes}}:null,this.dendrogramY=e.dendrogramY?{...KK,position:"left",...e.dendrogramY,aes:{...LP,...(g=e.dendrogramY)==null?void 0:g.aes}}:null,this.inheritedDendrogramAes=e.inheritedDendrogramAes??null}},Cwt=class extends Sg{constructor(t,n){super(t,n);Me(this,"settings");Me(this,"chartRenderer",new wwt);Me(this,"calculatedData",null);this.settings=new ZK(n)}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new ZK(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){console.warn("no chart state for heatmap")}export(){return this._updateChart(),f3(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var I,$,Q,ee,K,re,U,G,Z,Y,X,oe;let{xColumn:r,yColumn:a,valueColumn:i,xGroupBy:o,yGroupBy:s,facetBy:c,annotations:f,chartSettings:A,facetSettings:h,dendrogramX:m,dendrogramY:g,normalization:b,NAValueAs:C}=n,x=Object.values(((I=t.dendrogramX)==null?void 0:I.aes)||{}).filter(f9),k=Object.values((m==null?void 0:m.aes)||{}).filter(f9),_=Object.values((($=t.dendrogramY)==null?void 0:$.aes)||{}).filter(f9),D=Object.values((g==null?void 0:g.aes)||{}).filter(f9);function O(me,ae){return me.length!==ae.length||me.some((ye,Ce)=>ye.value!==ae[Ce].value)}return t.xColumn.value!==r.value||t.yColumn.value!==a.value||t.valueColumn.value!==i.value||O(t.xGroupBy,o)||O(t.yGroupBy,s)||O(t.facetBy,c)||O(t.annotations.map(me=>me.valueColumn),f.map(me=>me.valueColumn))||O(x,k)||O(_,D)||(n.dendrogramX||t.dendrogramX)&&(((Q=t.dendrogramX)==null?void 0:Q.distance)!==((ee=n.dendrogramX)==null?void 0:ee.distance)||((K=t.dendrogramX)==null?void 0:K.linkage)!==((re=n.dendrogramX)==null?void 0:re.linkage))||(n.dendrogramY||t.dendrogramY)&&(((U=t.dendrogramY)==null?void 0:U.distance)!==((G=n.dendrogramY)==null?void 0:G.distance)||((Z=t.dendrogramY)==null?void 0:Z.linkage)!==((Y=n.dendrogramY)==null?void 0:Y.linkage))||t.chartSettings.valueType!==A.valueType||t.facetSettings.sharedX!==h.sharedX||t.facetSettings.sharedY!==h.sharedY||((X=t.normalization)==null?void 0:X.method)!==(b==null?void 0:b.method)||((oe=t.normalization)==null?void 0:oe.direction)!==(b==null?void 0:b.direction)||t.NAValueAs!==C}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{xColumn:t,yColumn:n,valueColumn:r,xGroupBy:a,yGroupBy:i,facetBy:o,chartSettings:s,facetSettings:c,annotations:f,dendrogramX:A,dendrogramY:h,normalization:m,NAValueAs:g}=this.settings,b=K7t(this.data,t,n,r,o,a,i,f,A,h,m,g),C=twt(b,A,h,c),x=s.valueType==="discrete"?this.data.getColumnCategories(r.value):[];this.calculatedData={groupedCellsData:b,dendrogramsData:C,cellUniqValues:x}}_updateAesInData(){}_updateChart(){if(!this.calculatedData)return;let{id:t,valueColumn:n,chartSettings:r,facetSettings:a,aes:i,annotations:o,dendrogramX:s,dendrogramY:c,inheritedDendrogramAes:f,normalization:A}=this.settings;this.chartRenderer.render(t,r,a,i,this.calculatedData.groupedCellsData,o,n,s,c,this.calculatedData.dendrogramsData,f,this.calculatedData.cellUniqValues,A)}},JK=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r)return[n];if(e<2)return[(n+r)/2];let a=(r-n)/e,i=[];for(let o=1;o<e;o++)i.push(n+a*o);return i};function bwt(e,t,n){let[r=0,a=0]=$A(e,s=>s[t.value]),i=JK(n,[r,a]),o=pL().thresholds(i).value(s=>s[t.value])(e);return{bins:o,minX:o[0].x0??0,maxX:o[o.length-1].x1??0,maxCount:Ih(o,s=>s.length)??0}}function Ewt(e,t,n){let[r=0,a=0]=$A(e,A=>A[t.value]),i=[r,a],o=JK(n,[r,a]),s=q1().domain(i).range(i),c=o.map(A=>s.invert(A)),f=pL().thresholds(c).value(A=>A[t.value])(e);return{bins:f,minX:f[0].x0??0,maxX:f[f.length-1].x1??0,maxCount:Ih(f,A=>A.length)??0}}function xwt(e,t,n,r,a){let i={};return t.forEach(o=>{let s=e.getRowsByGrouping([...o]);i[o.join("_")]=a==="linear"?bwt(s,n,r):Ewt(s,n,r)}),i}var Swt={TOP:30,BOTTOM:0,LEFT:10,RIGHT:10};function b9(e,t,n=!1){let r=Math.abs(e.range()[0]-e.range()[1]),a=n?Math.min(Math.floor(r/45),10):10,i=e.ticks(a).filter(c=>t&&c>=0||!t),o=new Set(i);if(!n&&i.length>1){let c=e(i[0]),f=e(i[0]);for(let A=1;A<i.length;A++)f=e(i[A]),Math.abs(f-c)>=20?c=f:o.delete(i[A])}n&&i.length>2&&Math.abs(e(i[1])-e(i[0]))<45&&(i=i.filter((c,f)=>f%2===0));let s=i.some(c=>Math.abs(c)<1e-4&&c!==0||c>1e4)?",e":",f";return{ticks:i,format:c=>o.has(c)?e.tickFormat(a,s)(c):""}}function Bwt(e){return`translate(${e},0)`}function kwt(e){return`translate(0,${e})`}function Twt(e){return e==="bottom"?`translate(0,${ed})`:`translate(${-ed},0)`}function _wt(e){return e==="bottom"?"hanging":"central"}function Pwt(e){return e==="bottom"?"middle":"end"}var qK=({scale:e,tickSize:t=6,tickPadding:n=ed,orient:r="bottom",onlyPositive:a=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function o(C){return x=>{let k=C(x);return k===void 0?0:+k}}let{ticks:s,format:c}=b9(e,a,r==="bottom"),f=Math.max(t,0)+n,A=o(e.copy()),h=r==="bottom"?Bwt:kwt,m=r==="left"?-1:1,g={[(r==="left"?"x":"y")+"2"]:m*t},b={[r==="left"?"x":"y"]:m*f};return le.jsx("g",{children:s.map((C,x)=>le.jsxs("g",{className:"tick",transform:h(A(C)+i),children:[le.jsx("line",{stroke:Zt,...g}),le.jsx("g",{transform:Twt(r),children:le.jsx("text",{fill:Zt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:_wt(r),textAnchor:Pwt(r),...b,children:c(C)})})]},x))})},Mwt=1;function eZ({scaleX:e,scaleY:t,width:n,height:r,axisX:a,axisY:i,frameType:o,updatingKey:s=""}){let[c,f]=Vn.useState(e.ticks()),[A,h]=Vn.useState(t.ticks()),{significantLines:m=[]}=a,{significantLines:g=[]}=i;return Vn.useEffect(()=>{let b=e.ticks().filter(x=>!m.includes(x)),C=t.ticks().filter(x=>!g.includes(x));f(b),h(C)},[e,t,s]),le.jsxs("g",{stroke:Jf,children:[a.showGrid&&c.map(b=>{let C=e(b);return le.jsx("line",{x1:C,x2:C,y1:0,y2:r},`x_${C}_${r}`)}),i.showGrid&&A.map(b=>{let C=t(b);return le.jsx("line",{x1:0,x2:n,y1:C,y2:C},`y_${C}_${n}`)}),le.jsx("g",{strokeDasharray:td(a.significantLinesStyle),stroke:Zt,children:m.map(b=>{let C=e(b);return C<0||C>n?null:le.jsx("line",{x1:C,x2:C,y1:0,y2:r},`significant_${C}_${r}`)})}),le.jsx("g",{strokeDasharray:td(i.significantLinesStyle),stroke:Zt,children:g.map(b=>{let C=t(b);return C<0||C>r?null:le.jsx("line",{x1:0,x2:n,y1:C,y2:C},`significant_${C}_${n}`)})}),o!=="empty"&&le.jsxs("g",{strokeWidth:Mwt,children:[(a.showGrid||o!=="left")&&le.jsx("line",{stroke:o==="left"?Jf:Zt,x1:"0",x2:n,y1:r,y2:r}),(a.showGrid||o!=="bottom")&&le.jsx("line",{stroke:o==="bottom"?Jf:Zt,x1:"0",x2:"0",y1:"0",y2:r}),(a.showGrid||o==="full")&&le.jsx("line",{stroke:o==="full"?Zt:Jf,x1:n,x2:n,y1:"0",y2:r}),(i.showGrid||o==="full")&&le.jsx("line",{stroke:o==="full"?Zt:Jf,x1:"0",x2:n,y1:"0",y2:"0"})]})]})}function Dwt({width:e,height:t,dimensions:n,scales:r,xAxis:a,yAxis:i,frameType:o,histogramData:s,facetSettings:c,captionsSizes:f,facetTitle:A,layers:h,aesColorGetter:m}){let{padding:g}=n,b=a.showTicks?4:0,C=i.showTicks?4:0,x=n.chartEdgeSides.includes("left")||!(c!=null&&c.sharedY),k=n.chartEdgeSides.includes("bottom")||!(c!=null&&c.sharedX),_=n.chartEdgeSides.includes("bottom"),D=!1;return le.jsxs("g",{transform:`translate(${n.left+g.left},${n.top+g.top})`,children:[D,A.length&&le.jsxs("g",{children:[o==="full"&&le.jsx("rect",{x:"0",y:-g.top,height:g.top,width:e,fill:"#F7F8FA",stroke:Zt}),A.map((O,I)=>{let $=A.length,Q=(g.top-20*$)/2;return le.jsx("text",{fontSize:"14px",fontWeight:"500",fill:Zt,x:e/2,dy:Q+20/2-g.top,y:I*20,textAnchor:"middle",dominantBaseline:"central",children:O},I)})]}),le.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Zt,children:[_&&le.jsx("text",{x:e/2,y:t+g.bottom-12-20/2,children:a.title}),D]}),le.jsx(eZ,{width:e,height:t,scaleX:r.x,scaleY:r.y,axisX:a,axisY:i,frameType:o}),k&&le.jsxs("g",{transform:`translate(0,${t})`,children:[le.jsx(qK,{scale:r.x,orient:"bottom",onlyPositive:!0,tickSize:b}),D]}),x&&le.jsxs("g",{children:[le.jsx(qK,{scale:r.y,orient:"left",tickSize:C}),D]}),h.map(O=>s.bins.map(I=>le.jsx("rect",{x:r.x(I.x0),y:r.y(I.length),fill:I[0]?m(O.aes.fillColor,I[0]):"",stroke:Zt,width:r.x(I.x1)-r.x(I.x0),height:r.y(0)-r.y(I.length),opacity:O.aes.opacity??1},I.x0)))]})}function Hwt({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,columnsCount:a,facetKeys:i,facetSettings:o,scales:s,margins:c,mainTitle:f,facetTitles:A,captionsSizes:h,histogramDataByFacets:m,layers:g,aesColorGetter:b}){let{xAxis:C,yAxis:x,title:k,frame:_}=t,D=r[i[0]].padding,O=r[i[a-1]].padding;return le.jsx(f2,{dataId:e,children:le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${n.totalWidth} ${n.totalHeight}`,width:n.totalWidth,height:n.totalHeight,children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${c.left},${c.top})`,fontFamily:"Manrope",children:[le.jsx(d2,{title:f,show:k.show,position:k.position,leftPadding:D.left,rightPadding:O.right,chartsWidth:n.chartsWidth}),i.map(I=>le.jsx(Dwt,{scales:{x:s.x[I],y:s.y[I]},width:n.chartWidth,height:n.chartHeight,dimensions:r[I],margins:c,chartSizes:n,facetSettings:o,xAxis:C,yAxis:x,frameType:_.type,facetTitle:A[I],captionsSizes:h,histogramData:m[I],layers:g,aesColorGetter:b},I))]})]})})}function Iwt(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function Lwt(e,t,n,r,a,i,o){let s=i.includes("left")||!(o!=null&&o.sharedY),c=i.includes("bottom")||!(o!=null&&o.sharedX),f=i.includes("bottom")&&e.title!=="",A=n.yAxisCaptionsWidth+2*6,h=(t.showTicks?4:0)+6,m=n.xAxisCaptionsWidth+2*6,g=e.showTicks?4:0,b=f?32:0,C=A+h+8,x=m+g+b+8,k=Math.max(...r.map(_=>a[_].length));return{left:s?C:12,top:k===0?0:6*2+k*20,bottom:c?x+8:12,right:12}}function Rwt(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function Nwt(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function $wt(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function Fwt(e,t){return function(n,r){var a,i;if($wt(n)){let o=n.value;return(i=((a=e[o])==null?void 0:a[String(r[o])])??hP)==null?void 0:i[t]}return n}}var Vwt=class{constructor(){Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"component",le.jsx(le.Fragment,{}));Me(this,"margins",{top:24,bottom:24,left:24,right:24});Me(this,"chartsDimensions",{});Me(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Me(this,"columnsCount",1);Me(this,"rowsCount",1);Me(this,"scales",{x:{null:Da().domain([0,10]).range([0,600])},y:{null:Da().domain([0,10]).range([350,0])}});Me(this,"captionsSizes",{xAxisCaptionsWidth:30,yAxisCaptionsWidth:100});Me(this,"facetTitles",{});Me(this,"mainTitle",[])}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=zh(this.rootNode))}updateChartSizes(e){this.chartSizes.chartWidth=e.width,this.chartSizes.chartHeight=e.height}updateChartDimensions(e,t,n,r){let{chartWidth:a,chartHeight:i}=this.chartSizes,o=0,s=0;this.chartsDimensions=e.reduce((A,h,m)=>{let[g,b]=Nwt(m,this.columnsCount),C=Iwt(m,e.length,this.columnsCount,this.rowsCount),x=Lwt(n,r,this.captionsSizes,Rwt(e,this.rowsCount,this.columnsCount)[g],this.facetTitles,C,t),k=a+x.left+x.right,_=i+x.top+x.bottom;return A[h]={left:o,top:s,chartEdgeSides:C,padding:x,inner:{width:a,height:i},outer:{width:k,height:_}},o+=k,b===this.columnsCount-1&&(o=0,s+=_),A},{});let c=Math.max(...e.map(A=>this.chartsDimensions[A].outer.width+this.chartsDimensions[A].left)),f=Math.max(...e.map(A=>this.chartsDimensions[A].outer.height+this.chartsDimensions[A].top));this.chartSizes.chartsWidth=c,this.chartSizes.chartsHeight=f}updateViewport(e,t,n,r,a){let i=e.length,o=Math.min(t.nRows??i,i),s=Math.min(t.nCols??i,i);this.columnsCount=t.nRows?Math.ceil(i/o):s,this.rowsCount=Math.ceil(i/this.columnsCount);let[c,f]=[1/0,-1/0],A=-1/0,h=e.reduce((m,g)=>{let b=a[g],{minX:C,maxX:x,maxCount:k}=b;return c=Math.min(c,C),f=Math.max(f,x),A=Math.max(A,k),m[g]={minX:C,maxX:x,maxY:k},m},{});e.forEach(m=>{let g=n.scale==="log"?q1():Da(),b=h[m],C=t.sharedX?c:b.minX,x=t.sharedX?f:b.maxX;g.domain([C,x]).range([0,this.chartSizes.chartWidth]),this.scales.x[m]=g}),e.forEach(m=>{let g=r.scale==="log"?q1():Da(),b=h[m],C=0,x=t.sharedY?A:b.maxY,k=[this.chartSizes.chartHeight,0],_=g.copy().domain([C,x]).range([this.chartSizes.chartHeight,Swt.TOP]);g.domain([_.invert(this.chartSizes.chartHeight),_.invert(0)]).range(k),this.scales.y[m]=g})}updateCaptionsSize(){let e=new Dc("600 14px Arial"),t=0;function n(r){return Math.max(...r.map(a=>e.getTextWidth(a)))}Object.values(this.scales.y).forEach(r=>{let{ticks:a,format:i}=b9(r,!1);t=Math.max(t,n(a.map(i)))}),this.captionsSizes={xAxisCaptionsWidth:20,yAxisCaptionsWidth:t}}createMainTitle(e,t){let n=this.chartsDimensions[e[0]],r=this.chartsDimensions[e[e.length-1]];this.mainTitle=Om(t.name,this.chartSizes.chartsWidth-n.padding.left-r.padding.right,20)}createFacetTitles(e,t){this.facetTitles=e.reduce((n,r,a)=>(t[a].length===1&&t[a][0]==="null"?n[r]=[]:n[r]=Om(t[a].join(", "),this.chartSizes.chartWidth,14),n),{})}updateMargins(){let e=24*this.mainTitle.length,t=e>0?e+24*2:0;this.margins={top:Math.max(t,24),bottom:24,left:24,right:24},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+this.chartSizes.chartsHeight+this.margins.bottom}render(e,t,n,r,a,i,o,s){var g;let{xAxis:c,yAxis:f,size:A,title:h}=t;this.updateChartSizes(A),this.updateViewport(r,n,c,f,i),this.updateCaptionsSize(),this.createFacetTitles(r,a),this.updateChartDimensions(r,n,c,f),this.createMainTitle(r,h),this.updateMargins();let m=le.jsx(Hwt,{settingsId:e,chartSettings:t,facetKeys:r,facetSettings:n,chartSizes:this.chartSizes,chartsDimensions:this.chartsDimensions,scales:this.scales,columnsCount:this.columnsCount,margins:this.margins,mainTitle:this.mainTitle,facetTitles:this.facetTitles,captionsSizes:this.captionsSizes,histogramDataByFacets:i,layers:o,aesColorGetter:Fwt(s,"fillColor")});this.component=m,(g=this.reactRoot)==null||g.render(m)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},Owt=Vwt,Qwt=10,zwt=class{constructor(e){Me(this,"type","bins");Me(this,"aes",{fillColor:"white",opacity:1});this.aes={...this.aes,...e.aes}}},Uwt=class{constructor(e){Me(this,"type","binsLine");Me(this,"aes",{opacity:1});this.aes={...this.aes,...e.aes}}},tZ=class{constructor(e){Me(this,"id");Me(this,"type","histogram");Me(this,"valueColumn");Me(this,"binsCount");Me(this,"facetSettings");Me(this,"facetBy");Me(this,"grouping");Me(this,"chartSettings");Me(this,"inheritedAes");Me(this,"layers");var t,n,r,a,i,o,s,c;s2t.parse(e),this.id=Ir.uniqueId("settings"),this.facetSettings={sharedX:!0,sharedY:!0,titlePosition:"left",...e.facetSettings},this.valueColumn=e.valueColumn,this.binsCount=e.binsCount??Qwt,this.facetBy=e.facetBy??[],this.grouping=e.grouping??[],this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(this.facetBy.length?400:600),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(this.facetBy.length?250:350)},title:{position:"center",show:!0,...e.title,name:((r=e.title)==null?void 0:r.name)??"Chart"},yAxis:{showGrid:!0,showTicks:!0,scale:((a=e.xAxis)==null?void 0:a.scale)??"linear",...e.yAxis},xAxis:{title:e.valueColumn.label??e.valueColumn.value??"",scale:((i=e.xAxis)==null?void 0:i.scale)??"linear",showGrid:((o=e.xAxis)==null?void 0:o.showGrid)??!0,showTicks:((s=e.xAxis)==null?void 0:s.showTicks)??!0},frame:{type:((c=e.frame)==null?void 0:c.type)??"full"},legend:{show:!0,position:"right",...e.legend}},this.inheritedAes=e.inheritedAes??{},this.layers=e.layers.map(f=>{if(f.type==="bins")return new zwt(f);if(f.type==="binsLine")return new Uwt(f);vA(f,"Unknown layer type")}).filter(Boolean)}};function nZ(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}var jwt=class extends Sg{constructor(t,n){super(t,n);Me(this,"settings");Me(this,"chartRenderer",new Owt);Me(this,"calculatedData",null);this.settings=new tZ(n)}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new tZ(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){console.warn("no chart state for histogram")}export(){return this._updateChart(),f3(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){return t.valueColumn.value!==n.valueColumn.value||t.facetBy.some((r,a)=>{var i;return r.value!==((i=n.facetBy[a])==null?void 0:i.value)})||t.grouping.length!==n.grouping.length||t.grouping.some((r,a)=>{var i;return r.value!==((i=n.grouping[a])==null?void 0:i.value)})||t.layers.length!==n.layers.length||t.layers.some((r,a)=>r.type!==n.layers[a].type)||t.binsCount!==n.binsCount||t.chartSettings.xAxis.scale!==n.chartSettings.xAxis.scale}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{valueColumn:t,facetBy:n,binsCount:r,chartSettings:a}=this.settings,i=n.map(f=>this.data.getColumnCategories(f.value)),o=i.length?nZ([...i]):[["null"]],s=n.map(f=>f.value)??null;this.data.setGrouping([...s]);let c=xwt(this.data,o,t,r,a.xAxis.scale);this.calculatedData={facetKeys:o.map(f=>f.join(", ")),facetKeysCombinations:o,histogramDataByFacets:c}}_updateAesInData(){this.calculatedData}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,facetSettings:r,inheritedAes:a,layers:i}=this.settings;this.chartRenderer.render(t,n,r,this.calculatedData.facetKeys,this.calculatedData.facetKeysCombinations,this.calculatedData.histogramDataByFacets,i,a)}};function Gwt(e,t,n,r,a,i){let o={};return t.forEach(s=>{let c=[],f=1/0,A=1/0,h=-1/0,m=-1/0;i.forEach(g=>{e.getRowsByGrouping([...s,g]).forEach(b=>{let C=b[n.value],x=b[r.value];f=Math.min(f,C),A=Math.min(A,x),h=Math.max(h,C),m=Math.max(m,x),C!==null&&x!==null&&c.push({id:`${Object.values(b)}`,x:C,y:x,label:a?b[a.valueLabels??a.value]:null,data:b})})}),c.sort((g,b)=>g.x-b.x),o[s.join("_")]={minX:f,maxX:h,minY:A,maxY:m,dots:c}}),o}function Ywt(e,t,n,r,a){return t.reduce((i,o)=>{let s=n[o].dots;return i[o]=e.map(c=>{if(c.type==="curve")return{type:"curve",info:c,geoms:r.map(f=>{let A=s.filter(m=>a.every((g,b)=>m.data[g.value]===f[b])),h=a.reduce((m,g,b)=>(m[g.value]=f[b],m),{});return{dots:A,data:h}})};if(c.type==="dots")return{type:"dots",info:c,geoms:s};vA(c,"Unknown scatterplot layer type")}),i},{})}var rZ=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r){let o=e%2===0?[]:[n];for(let s=1;s<e/2+1;s++)o.push(n+s),o.unshift(n-s);return o}if(e<2)return[n,r];let a=(r-n)/(e-1),i=[];for(let o=0;o<e-1;o++)i.push(n+a*o);return i.push(r),i};function Wwt(e,t,n){if(n==="linear")return rZ(e,t);if(n==="log"){let r=rZ(e,t),a=q1(t,t),i=r.map(o=>a.invert(o));return i[0]=t[0],i[i.length-1]=t[1],i}return[]}function J8(e,t,n){return(n==="log"?q1():Da()).domain(Wwt(e.length,t,n)).range(e)}function RP(e){let t=e.xPosition!=="middle"&&e.yPosition!=="middle",n=e.padding*(t?.7:1);return e.xPosition==="right"?e.x+n:e.xPosition==="middle"?e.x-e.width/2:e.x-e.width-n}function aZ(e){let t=e.xPosition!=="middle"&&e.yPosition!=="middle",n=e.padding*(t?.7:1);return e.yPosition==="middle"?e.y-e.height/2:e.yPosition==="top"?e.y-n-e.height:e.y+n}function Xwt(e,t){return RP(e)-t}function Kwt(e,t){return aZ(e)-t}function iZ(e){let t=RP(e),n=t+e.width,r=aZ(e),a=r+e.height;return{minX:t,maxX:n,minY:r,maxY:a}}function oZ(e,t,n){let r=Xwt(e,n),a=RP(e)+e.width+n,i=Kwt(e,t),o=i+e.height+2*t;return{minX:r,maxX:a,minY:i,maxY:o}}function Zwt(e,t,n){return e.minX>=0&&e.maxX<=t&&e.minY>=0&&e.maxY<=n}var q8=2;function Jwt(e,t=q8,n=q8){e.forEach(r=>{r.bbox=iZ(r),r.outerBBox=oZ(r,t,n)})}function eE(e,t,n,r=q8,a=q8){let i=[],o=new Dft,s=[["middle","right"],["top","right"],["bottom","right"],["middle","left"],["top","left"],["bottom","left"],["top","middle"],["bottom","middle"]];for(let c of e)for(let[f,A]of s){let h={...c,yPosition:f,xPosition:A};if(h.bbox=iZ(h),h.outerBBox=oZ(h,r,a),Zwt(h.outerBBox,t,n)&&!o.collides(h.outerBBox)){i.push(h),o.insert(h.outerBBox);break}}return i}function qwt(e){return`translate(${e},0)`}function e9t(e){return`translate(0,${e})`}function t9t(e){return e==="bottom"?`translate(0,${ed})`:`translate(${-ed},0)`}function n9t(e){return e==="bottom"?"hanging":"central"}function r9t(e){return e==="bottom"?"middle":"end"}var tE=({scale:e,tickSize:t=6,tickPadding:n=ed,orient:r="bottom",onlyPositive:a=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function o(C){return x=>{let k=C(x);return k===void 0?0:+k}}let{ticks:s,format:c}=b9(e,a,r==="bottom"),f=Math.max(t,0)+n,A=o(e.copy()),h=r==="bottom"?qwt:e9t,m=r==="left"?-1:1,g={[(r==="left"?"x":"y")+"2"]:m*t},b={[r==="left"?"x":"y"]:m*f};return le.jsx("g",{children:s.map((C,x)=>le.jsxs("g",{className:"tick",transform:h(A(C)+i),children:[le.jsx("line",{stroke:Zt,...g}),le.jsx("g",{transform:t9t(r),children:le.jsx("text",{fill:Zt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:n9t(r),textAnchor:r9t(r),...b,children:c(C)})})]},x))})},a9t=1;function i9t({scaleX:e,scaleY:t,width:n,height:r,axisX:a,axisY:i,frameType:o,updatingKey:s=""}){let[c,f]=Vn.useState(e.ticks()),[A,h]=Vn.useState(t.ticks()),{significantLines:m=[]}=a,{significantLines:g=[]}=i;return Vn.useEffect(()=>{let b=e.ticks().filter(x=>!m.includes(x)),C=t.ticks().filter(x=>!g.includes(x));f(b),h(C)},[e,t,s]),le.jsxs("g",{stroke:Jf,children:[a.showGrid&&c.map(b=>{let C=e(b);return le.jsx("line",{x1:C,x2:C,y1:0,y2:r},`x_${C}_${r}`)}),i.showGrid&&A.map(b=>{let C=t(b);return le.jsx("line",{x1:0,x2:n,y1:C,y2:C},`y_${C}_${n}`)}),le.jsx("g",{strokeDasharray:td(a.significantLinesStyle),stroke:Zt,children:m.map(b=>{let C=e(b);return le.jsx("line",{x1:C,x2:C,y1:0,y2:r},`significant_${C}_${r}`)})}),le.jsx("g",{strokeDasharray:td(i.significantLinesStyle),stroke:Zt,children:g.map(b=>{let C=t(b);return le.jsx("line",{x1:0,x2:n,y1:C,y2:C},`significant_${C}_${n}`)})}),o!=="empty"&&le.jsxs("g",{strokeWidth:a9t,children:[(a.showGrid||o!=="left")&&le.jsx("line",{stroke:o==="left"?Jf:Zt,x1:"0",x2:n,y1:r,y2:r}),(a.showGrid||o!=="bottom")&&le.jsx("line",{stroke:o==="bottom"?Jf:Zt,x1:"0",x2:"0",y1:"0",y2:r}),(a.showGrid||o==="full")&&le.jsx("line",{stroke:o==="full"?Zt:Jf,x1:n,x2:n,y1:"0",y2:r}),(i.showGrid||o==="full")&&le.jsx("line",{stroke:o==="full"?Zt:Jf,x1:"0",x2:n,y1:"0",y2:"0"})]})]})}var o9t=new Dc("16px Manrope");function lZ(e,t){return typeof e=="string"?e:t.length?t[0].data[e.value]:""}function l9t(e,t,n=[]){let r=e.data,a=[`x: ${Ki(e.x)}`,`y: ${Ki(e.y)}`];t.label&&a.unshift(`${t.label}: ${r[t.label]}`);for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function s9t(e){return typeof e.r2>"u"?null:le.jsxs(le.Fragment,{children:[le.jsx("tspan",{children:"R"}),le.jsx("tspan",{fontSize:"10px",dy:"-8",children:"2"}),le.jsx("tspan",{dy:"8",children:` = ${Ki(e.r2)}`})]})}function u9t(e){return typeof e.pValue>"u"?null:le.jsx("tspan",{children:`p-value = ${Ki(e.pValue)}`})}function c9t(e){if(typeof e.coefficients>"u")return null;let{slope:t,slopeError:n,intercept:r,interceptError:a}=e.coefficients;return le.jsx("tspan",{children:le.jsx("tspan",{children:`slope = ${Ki(t)} ± ${Ki(n)}, intercept = ${Ki(r)} ± ${Ki(a)}`})})}function f9t(e){let t=[s9t(e),u9t(e),c9t(e)].filter(n=>n!==null);return le.jsx(le.Fragment,{children:t.map((n,r)=>le.jsxs("tspan",{children:[n,le.jsx("tspan",{children:r<t.length-1&&", "})]},r))})}var NP=3;function sZ(e,t,n,r){if(!r)return[];let a=[];for(let i of e){let o=i.label;if(!o)continue;let s=o9t.getTextMetrics(String(o));a.push({name:String(o),width:s.width,height:s.actualBoundingBoxAscent+s.actualBoundingBoxDescent,x:t.x(i.x),y:t.y(i.y),xPosition:"right",yPosition:"middle",bbox:{minX:0,maxX:0,minY:0,maxY:0},dot:i,padding:n.dotSize(r.info.aes.dotSize,i.data)+NP})}return a}function d9t({width:e,height:t,dimensions:n,scales:r,xAxis:a,yAxis:i,frameType:o,dotsData:s,facetSettings:c,trendsData:f,keyColumn:A,margins:h,chartSizes:m,tooltips:g,tooltipsContainer:b,captionsSizes:C,facetTitle:x,onlyPositive:k,layersData:_,aesGetters:D}){let[O,I]=Vn.useState(null),{padding:$}=n,{dots:Q}=s,ee=a.showTicks?t2:0,K=i.showTicks?t2:0,re=lZ(a.title,Q),U=lZ(i.title,Q),G=n.chartEdgeSides.includes("left")||!(c!=null&&c.sharedY),Z=n.chartEdgeSides.includes("bottom")||!(c!=null&&c.sharedX),Y=n.chartEdgeSides.includes("left"),X=n.chartEdgeSides.includes("bottom"),oe={left:h.left+n.left+$.left,right:m.totalWidth-(h.left+n.left+$.left),top:h.top+n.top+$.top,bottom:m.totalHeight-(h.top+n.top+$.top)},me=!1,[ae,ye]=Vn.useState(()=>sZ(Q,r,D,_.find(Ne=>Ne.type==="dots"))),[Ce,ce]=Vn.useState(()=>eE(ae,e,t,NP,NP)),[ge,ze]=Vn.useState(null);return Vn.useEffect(()=>{ye(sZ(Q,r,D,_.find(Ne=>Ne.type==="dots")))},[Q,r,D,_]),Vn.useEffect(()=>{let Ne=eE(ae,e,t);ce(Ne)},[ae,e,t]),le.jsxs("g",{transform:`translate(${n.left+$.left},${n.top+$.top})`,children:[me,x.length&&le.jsxs("g",{children:[o==="full"&&le.jsx("rect",{x:"0",y:-$.top,height:$.top,width:e,fill:"#F7F8FA",stroke:Zt}),x.map((Ne,Ge)=>{let Oe=x.length,Xe=($.top-vP*Oe)/2;return le.jsx("text",{fontSize:"14px",fontWeight:"500",fill:Zt,x:e/2,dy:Xe+vP/2-$.top,y:Ge*vP,textAnchor:"middle",dominantBaseline:"central",children:Ne},Ge)})]}),le.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Zt,children:[X&&le.jsx("text",{x:e/2,y:t+$.bottom-Rm-u9/2,children:re}),me,Y&&le.jsx("text",{x:-$.left+Rm+u9/2,y:t/2,transform:`rotate(-90,${-$.left+Rm+u9/2},${t/2})`,children:U}),me]}),le.jsx(i9t,{width:e,height:t,scaleX:r.x,scaleY:r.y,axisX:a,axisY:i,frameType:o}),Z&&le.jsxs("g",{transform:`translate(0,${t})`,children:[le.jsx(tE,{scale:r.x,orient:"bottom",onlyPositive:k.x,tickSize:ee}),me]}),G&&le.jsxs("g",{children:[le.jsx(tE,{scale:r.y,orient:"left",onlyPositive:k.y,tickSize:K}),me]}),f&&f.map(({predict:Ne,getArea:Ge,color:Oe,data:Xe,bounded:dt,xBounds:Ye,stats:rt},He)=>{let[$e,ut]=dt?Ye:r.x.domain(),ct=(ut-$e)/15,Bt=Ne($e),dn=Ne(ut);if(isNaN(Bt)||isNaN(dn))return null;let gn=D.dotColor(Oe,Xe);return le.jsxs("g",{children:[le.jsx("text",{y:He*20+20,fill:gn,x:e-8,textAnchor:"end",children:f9t(rt)}),le.jsx("path",{d:Ge(r.x,r.y,Ir.range($e,ut+ct/2,ct)),fill:gn,opacity:.2}),le.jsx("line",{x1:r.x($e),x2:r.x(ut),y1:r.y(Bt),y2:r.y(dn),stroke:gn})]},He)}),_.map((Ne,Ge)=>{if(Ne.type==="dots")return le.jsxs("g",{children:[Q.map(Oe=>le.jsx("g",{transform:`translate(${r.x(Oe.x)},${r.y(Oe.y)})`,onMouseOver:()=>I(Oe),onMouseLeave:()=>I(null),children:Af(D.dotShape(Ne.info.aes.dotShape,Oe.data),D.dotSize(Ne.info.aes.dotSize,Oe.data),D.dotColor(Ne.info.aes.dotFill,Oe.data))},Oe.id)),Ce.map(Oe=>{let{name:Xe,height:dt,bbox:Ye,width:rt}=Oe;return le.jsx("g",{children:le.jsxs("g",{transform:`translate(${Ye.minX},${Ye.minY})`,children:[le.jsx("rect",{x:"0",y:"0",width:rt,height:dt,fill:"transparent",stroke:"none",onMouseOver:()=>ze(Oe.dot),onMouseLeave:()=>ze(null)}),le.jsx("text",{x:0,y:dt/2,stroke:"white",strokeWidth:2,paintOrder:"stroke",style:{pointerEvents:"none"},fontFamily:"Manrope",fontSize:"16px",dominantBaseline:"middle",children:Xe})]})},Oe.dot.id)}),ge&&le.jsxs("g",{transform:`translate(${r.x(ge.x)},${r.y(ge.y)})`,children:[Af(D.dotShape(Ne.info.aes.dotShape,ge.data),D.dotSize(Ne.info.aes.dotSize,ge.data)+1,"white","white"),Af(D.dotShape(Ne.info.aes.dotShape,ge.data),D.dotSize(Ne.info.aes.dotSize,ge.data),D.dotColor(Ne.info.aes.dotFill,ge.data))]},"activeDot")]},Ge);if(Ne.type==="curve"&&!Ne.info.smoothing)return Ne.geoms.map((Oe,Xe)=>le.jsx("g",{children:le.jsx("polyline",{points:Oe.dots.map(dt=>`${r.x(dt.x)},${r.y(dt.y)}`).join(" "),fill:"none",stroke:D.lineColor(Ne.info.aes.lineColor,Oe.data),strokeWidth:Ne.info.aes.lineWidth,strokeDasharray:td(Ne.info.aes.lineShape)})},Xe));if(Ne.type==="curve"&&Ne.info.smoothing)return Ne.geoms.map((Oe,Xe)=>le.jsx("g",{children:le.jsx("path",{d:d3().curve(A3).x(dt=>r.x(dt.x)).y(dt=>r.y(dt.y))(Oe.dots)??"",fill:"none",stroke:D.lineColor(Ne.info.aes.lineColor,Oe.data),strokeWidth:Ne.info.aes.lineWidth,strokeDasharray:td(Ne.info.aes.lineShape)})},Xe))}),g.show&&O&&le.jsx(oc,{content:l9t(O,A,g==null?void 0:g.content),x:r.x(O.x),y:r.y(O.y),active:!0,sideDistances:oe,container:b})]})}function A9t({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,facetKeys:a,facetSettings:i,scales:o,groupedDots:s,legendData:c,trendsData:f,columnsCount:A,margins:h,keyColumn:m,mainTitle:g,facetTitles:b,captionsSizes:C,onlyPositive:x,layersData:k,aesGetters:_}){let[D,O]=Vn.useState(),I=Vn.useRef(null);Vn.useEffect(()=>{I.current&&O(I.current)},[]);let{xAxis:$,yAxis:Q,title:ee,frame:K,legend:re,tooltips:U}=t,G=r[a[0]].padding,Z=r[a[A-1]].padding,Y=n.chartsWidth+yP,X=G.top;return le.jsx(f2,{dataId:e,children:le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${n.totalWidth} ${n.totalHeight}`,width:n.totalWidth,height:n.totalHeight,children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${h.left},${h.top})`,fontFamily:"Manrope",children:[le.jsx(d2,{title:g,show:ee.show,position:ee.position,leftPadding:G.left,rightPadding:Z.right,chartsWidth:n.chartsWidth}),a.map(oe=>le.jsx(d9t,{scales:{x:o.x[oe],y:o.y[oe]},width:n.chartWidth,height:n.chartHeight,dimensions:r[oe],margins:h,chartSizes:n,facetSettings:i,xAxis:$,yAxis:Q,frameType:K.type,dotsData:s[oe],trendsData:f?f[oe]:null,tooltips:U,tooltipsContainer:D,keyColumn:m,facetTitle:b[oe],captionsSizes:C,layersData:k[oe],onlyPositive:x,aesGetters:_},oe)),re.show&&le.jsx("g",{transform:`translate(${Y},${X})`,children:le.jsx(y9,{legendData:c})})]}),le.jsx("g",{ref:I})]})})}function p9t(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function h9t(e,t,n,r,a,i,o){let s=i.includes("left")||!(o!=null&&o.sharedY),c=i.includes("left")&&t.title!=="",f=i.includes("bottom")||!(o!=null&&o.sharedX),A=i.includes("bottom")&&e.title!=="",h=n.yAxisCaptionsWidth+2*gP,m=(t.showTicks?t2:0)+gP,g=c?u9+Rm:0,b=n.xAxisCaptionsWidth+2*gP,C=e.showTicks?t2:0,x=A?u9+Rm:0,k=h+m+g+LX,_=b+C+x+LX,D=Math.max(...r.map(O=>a[O].length));return{left:s?k:Rm,top:D===0?0:p3t*2+D*m9,bottom:f?_+8:Rm,right:Rm}}function m9t(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function v9t(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function g9t(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function v2(e,t){return function(n,r){var a,i;if($m(n)&&t==="dotSize"){let{domain:o,range:s}=n,c=Ny().domain(o).range(s)(Number(r[n.columnName.value]));return Math.max(1,c)}if($m(n)&&(t==="dotFill"||t==="lineColor")){let{domain:o,range:s,type:c="linear"}=n;return J8(s,o,c)(Number(r[n.columnName.value]))}if(g9t(n)){let o=n.value;return(i=((a=e[o])==null?void 0:a[String(r[o])])??hP)==null?void 0:i[t]}return n}}function y9t(e){return{dotShape:v2(e,"dotShape"),dotColor:v2(e,"dotFill"),dotSize:v2(e,"dotSize"),lineShape:v2(e,"lineShape"),lineColor:v2(e,"lineColor"),trendColor:v2(e,"dotFill")}}var w9t=class{constructor(){Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"component",le.jsx(le.Fragment,{}));Me(this,"margins",{top:qf,bottom:qf,left:qf,right:qf});Me(this,"chartsDimensions",{});Me(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Me(this,"columnsCount",1);Me(this,"rowsCount",1);Me(this,"scales",{x:{null:Da().domain([0,10]).range([0,600])},y:{null:Da().domain([0,10]).range([350,0])}});Me(this,"captionsSizes",{xAxisCaptionsWidth:30,yAxisCaptionsWidth:100});Me(this,"facetTitles",{});Me(this,"mainTitle",[]);Me(this,"legend",{width:0,height:0,items:[]})}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=zh(this.rootNode))}updateChartSizes(e){this.chartSizes.chartWidth=e.width,this.chartSizes.chartHeight=e.height}updateChartDimensions(e,t,n,r){let{chartWidth:a,chartHeight:i}=this.chartSizes,o=0,s=0;this.chartsDimensions=e.reduce((A,h,m)=>{let[g,b]=v9t(m,this.columnsCount),C=p9t(m,e.length,this.columnsCount,this.rowsCount),x=h9t(n,r,this.captionsSizes,m9t(e,this.rowsCount,this.columnsCount)[g],this.facetTitles,C,t),k=a+x.left+x.right,_=i+x.top+x.bottom;return A[h]={left:o,top:s,chartEdgeSides:C,padding:x,inner:{width:a,height:i},outer:{width:k,height:_}},o+=k,b===this.columnsCount-1&&(o=0,s+=_),A},{});let c=Math.max(...e.map(A=>this.chartsDimensions[A].outer.width+this.chartsDimensions[A].left)),f=Math.max(...e.map(A=>this.chartsDimensions[A].outer.height+this.chartsDimensions[A].top));this.chartSizes.chartsWidth=c,this.chartSizes.chartsHeight=f}updateViewport(e,t,n,r,a,i){let o=e.length,s=Math.min(t.nRows??o,o),c=Math.min(t.nCols??o,o);this.columnsCount=t.nRows?Math.ceil(o/s):c,this.rowsCount=Math.ceil(o/this.columnsCount);let[f,A]=[1/0,-1/0],[h,m]=[1/0,-1/0],g=e.reduce((C,x)=>{let k=a[x],{minX:_,minY:D,maxX:O,maxY:I}=k;return f=Math.min(f,_),h=Math.min(h,D),A=Math.max(A,O),m=Math.max(m,I),C[x]={minX:_,maxX:O,minY:D,maxY:I},C},{});e.forEach(C=>{let x=n.scale==="log"?Rv():Da(),k=g[C],_=n.lowerValue?Number(n.lowerValue):t.sharedX?f:k.minX,D=n.upperValue?Number(n.upperValue):t.sharedX?A:k.maxX;if(typeof n.symmetricRange<"u"){let $=n.symmetricRange;if($>=_&&$<=D){let Q=Math.max($-_,D-$);_=$-Q,D=$+Q}}let O=[0,this.chartSizes.chartWidth],I=x.copy().domain([_,D]).range([L8.LEFT,this.chartSizes.chartWidth-L8.RIGHT]);x.domain([I.invert(0),I.invert(this.chartSizes.chartWidth)]).range(O).nice(),this.scales.x[C]=x});let b=e.reduce((C,x)=>{let k=i?i[x]:[];return C[x]=k.reduce((_,D)=>{let O=D.bounded?D.xBounds:this.scales.x[x].domain(),I=D.getInterval(O[0]),$=D.getInterval(O[1]);return _.minY=Math.min(_.minY,isNaN(I.left)?_.minY:I.left,isNaN($.left)?_.minY:$.left),_.maxY=Math.max(_.maxY,isNaN(I.right)?_.maxY:I.right,isNaN($.right)?_.maxY:$.right),_},{minY:1/0,maxY:-1/0}),h=Math.min(h,C[x].minY),m=Math.max(m,C[x].maxY),C},{});e.forEach(C=>{let x=r.scale==="log"?Rv():Da(),k=g[C],_=b[C],D=r.lowerValue?Number(r.lowerValue):t.sharedY?h:Math.min(k.minY,_.minY),O=r.upperValue?Number(r.upperValue):t.sharedY?m:Math.max(k.maxY,_.maxY);if(typeof r.symmetricRange<"u"){let Q=r.symmetricRange;if(Q>=D&&Q<=O){let ee=Math.max(Q-D,O-Q);D=Q-ee,O=Q+ee}}let I=[this.chartSizes.chartHeight,0],$=x.copy().domain([D,O]).range([this.chartSizes.chartHeight-L8.BOTTOM,L8.TOP]);x.domain([$.invert(this.chartSizes.chartHeight),$.invert(0)]).range(I).nice(),this.scales.y[C]=x})}updateCaptionsSize(e){let t=new Dc("600 14px Arial"),n=0;function r(a){return Math.max(...a.map(i=>t.getTextWidth(i)))}Object.values(this.scales.y).forEach(a=>{let{ticks:i,format:o}=b9(a,e);n=Math.max(n,r(i.map(o)))}),this.captionsSizes={xAxisCaptionsWidth:20,yAxisCaptionsWidth:n}}createMainTitle(e,t){let n=this.chartsDimensions[e[0]],r=this.chartsDimensions[e[e.length-1]];this.mainTitle=Om(t.name,this.chartSizes.chartsWidth-n.padding.left-r.padding.right,20)}createFacetTitles(e,t){this.facetTitles=e.reduce((n,r,a)=>(t[a].length===1&&t[a][0]==="null"?n[r]=[]:n[r]=Om(t[a].join(", "),this.chartSizes.chartWidth,14),n),{})}updateMargins(){let e=24*this.mainTitle.length,t=e>0?e+24*2:0;this.margins={top:Math.max(t,qf),bottom:qf,left:qf,right:this.legend.width},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartsHeight,this.legend.height)+this.margins.bottom}updateLegendSize(e,t,n,r){if(!e.show){this.legend={width:0,height:0,items:[]};return}let a=[],i={width:0,height:0,left:0,top:0};if(n.forEach(A=>{let h=t[A.value];if(h.usedAes.length===0||!h.aesMap)return;let m={};h.values.forEach(C=>{m[C]||(m[C]={...mP}),h.usedAes.forEach(x=>{var k,_,D;(x==="dotFill"||x==="lineColor")&&(m[C].color=((k=h.aesMap[C])==null?void 0:k[x])??Zt),x==="dotShape"&&(m[C].shape=((_=h.aesMap[C])==null?void 0:_[x])??"21"),x==="dotSize"&&(m[C].size=((D=h.aesMap[C])==null?void 0:D[x])??3)})});let g=A.label??A.value,b=Hl().domain(h.values).range(h.values.map(C=>m[C]));a.push({...i,id:A.value,type:"dots",title:g,scale:b,values:h.values,labels:h.labels})}),r.forEach(A=>{if(A.type==="dots"&&$m(A.aes.dotFill)){let{domain:h,range:m,columnName:g,type:b="linear"}=A.aes.dotFill,C=g.label??g.value,x=J8(m,h,"linear"),k=(b==="log"?q1():Da()).domain(h).range([height,0]),_=a2(k,h);a.push({...i,id:"dotFill",type:"continuous",title:C,scale:x,tickPositionScale:k,values:_})}if(A.type==="dots"&&$m(A.aes.dotSize)){let{columnName:h,domain:m,range:g}=A.aes.dotSize,b=h.label??h.value,C=Ny(m,g),x=C.ticks(3),k=C.tickFormat(3),_=x.reduce((D,O)=>(D[String(O)]=k(O),D),{});a.push({...i,id:h.value,type:"size",title:b,scale:C,values:x,labels:_})}}),!a.length){this.legend={width:0,height:0,items:[]};return}let o=w9(a,this.chartSizes.chartHeight),s=o[o.length-1],c=s.left+s.width+2*yP,f=this.chartSizes.chartHeight;this.legend={width:c,height:f,items:o}}render(e,t,n,r,a,i,o,s,c,f,A,h,m,g){var O;let{xAxis:b,yAxis:C,size:x,title:k,legend:_}=t;this.updateChartSizes(x),this.updateViewport(r,n,b,C,i,o),this.updateCaptionsSize(c.y),this.createFacetTitles(r,a),this.updateChartDimensions(r,n,b,C),this.updateLegendSize(_,f,m,g),this.createMainTitle(r,k),this.updateMargins();let D=le.jsx(A9t,{settingsId:e,chartSettings:t,facetKeys:r,facetSettings:n,chartSizes:this.chartSizes,chartsDimensions:this.chartsDimensions,scales:this.scales,groupedDots:i,trendsData:o,legendData:this.legend,columnsCount:this.columnsCount,margins:this.margins,keyColumn:s,mainTitle:this.mainTitle,facetTitles:this.facetTitles,captionsSizes:this.captionsSizes,onlyPositive:c,layersData:A,aesGetters:y9t(h)});this.component=D,(O=this.reactRoot)==null||O.render(D)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},C9t=w9t,b9t=class{constructor(e){Me(this,"type","dots");Me(this,"aes",{dotFill:Zt,dotShape:"21",dotSize:3,opacity:1});this.aes={...this.aes,...e.aes}}},E9t=class{constructor(e){Me(this,"type","curve");Me(this,"smoothing");Me(this,"aes",{lineColor:Zt,lineWidth:1,lineShape:"solid",opacity:1});this.smoothing=e.smoothing??!1,this.aes={...this.aes,...e.aes}}},uZ=class{constructor(e){Me(this,"id");Me(this,"type","scatterplot");Me(this,"keyColumn");Me(this,"facetSettings");Me(this,"x");Me(this,"y");Me(this,"facetBy");Me(this,"grouping");Me(this,"label");Me(this,"chartSettings");Me(this,"inheritedAes");Me(this,"trend");Me(this,"layers");var t,n,r,a;W3t.parse(e),this.id=Ir.uniqueId("settings"),this.keyColumn=e.keyColumn,this.facetSettings={sharedX:!0,sharedY:!0,titlePosition:"left",...e.facetSettings},this.x=e.x,this.y=e.y,this.facetBy=e.facetBy??[],this.grouping=e.grouping??[],this.label=e.label??null,this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(this.facetBy.length?400:600),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(this.facetBy.length?250:350)},title:{position:"center",show:!0,...e.title,name:((r=e.title)==null?void 0:r.name)??"Chart"},yAxis:{title:e.y.label??e.y.value,scale:"linear",showGrid:!0,showTicks:!0,...e.yAxis},xAxis:{title:e.x.label??e.x.value,scale:"linear",showGrid:!0,showTicks:!0,...e.xAxis},frame:{type:((a=e.frame)==null?void 0:a.type)??"full"},legend:{show:!0,position:"right",...e.legend},tooltips:{show:!0,...e.tooltips}},this.inheritedAes=e.inheritedAes??{},this.trend=e!=null&&e.trend?{bounded:e.trend.bounded??!1,color:e.trend.color??Zt}:null,this.layers=e.layers.map(i=>{if(i.type==="dots")return new b9t(i);if(i.type==="curve")return new E9t(i);vA(i,"Unknown layer type")}).filter(Boolean)}},x9t=oht(r3t()),cZ=.05;function S9t(e){let t=3.3871328727963665,n=133.14166789178438,r=1971.5909503065513,a=13731.69376550946,i=45921.95393154987,o=67265.7709270087,s=33430.57558358813,c=2509.0809287301227,f=42.31333070160091,A=687.1870074920579,h=5394.196021424751,m=21213.794301586597,g=39307.89580009271,b=28729.085735721943,C=5226.495278852854,x=1.4234371107496835,k=4.630337846156546,_=5.769497221460691,D=3.6478483247632045,O=1.2704582524523684,I=.2417807251774506,$=.022723844989269184,Q=.0007745450142783414,ee=2.053191626637759,K=1.6763848301838038,re=.6897673349851,U=.14810397642748008,G=.015198666563616457,Z=.0005475938084995345,Y=10507500716444169e-25,X=6.657904643501103,oe=5.463784911164114,me=1.7848265399172913,ae=.29656057182850487,ye=.026532189526576124,Ce=.0012426609473880784,ce=27115555687434876e-21,ge=20103343992922881e-23,ze=.599832206555888,Ne=.1369298809227358,Ge=.014875361290850615,Oe=.0007868691311456133,Xe=18463183175100548e-21,dt=1421511758316446e-22,Ye=20442631033899397e-31,rt=e-.5,He,$e;return Math.abs(rt)<=.425?(He=.180625-rt*rt,$e=rt*(((((((c*He+s)*He+o)*He+i)*He+a)*He+r)*He+n)*He+t)/(((((((C*He+b)*He+g)*He+m)*He+h)*He+A)*He+f)*He+1),$e):(He=e,He=Math.sqrt(-Math.log(He)),He<=5?(He+=-1.6,$e=(((((((Q*He+$)*He+I)*He+O)*He+D)*He+_)*He+k)*He+x)/(((((((Y*He+Z)*He+G)*He+U)*He+re)*He+K)*He+ee)*He+1)):(He+=-5,$e=(((((((ge*He+ce)*He+Ce)*He+ye)*He+ae)*He+me)*He+oe)*He+X)/(((((((Ye*He+dt)*He+Xe)*He+Oe)*He+Ge)*He+Ne)*He+ze)*He+1)),$e=-$e,$e)}function fZ(e,t){let{sin:n,cos:r,sqrt:a,pow:i,exp:o,PI:s}=Math,c,f;if(t==1)return r(e*s/2)/n(e*s/2);if(t==2)return a(2/(e*(2-e))-2);let A=1/(t-.5),h=48/(A*A),m=((20700*A/h-98)*A-16)*A+96.36,g=((94.5/(h+m)-3)/h+1)*a(A*s*.5)*t;return c=g*e,f=i(c,2/t),f>.05+A?(c=S9t(e/2),f=c*c,t<5&&(m=m+.3*(t-4.5)*(c+.6)),m=(((.05*g*c-5)*c-7)*c-2)*c+h+m,f=(((((.4*f+6.3)*f+36)*f+94.5)/m-f-3)/h+1)*c,f=A*f*f,f>.002?f=o(f)-1:f=.5*f*f+f):f=((1/(((t+6)/(t*f)-.089*g-.822)*(t+2)*3)+.5/(t+4))*f-1)*(t+1)/(t+2)+1/f,a(t*f)}function B9t(e){let t=e.length,n=0,r=0,a=0,i=0;for(let c=0;c<e.length;++c){let f=e[c].x,A=e[c].y;if(!Number.isFinite(f)||!Number.isFinite(A)){--t;continue}n+=f,r+=A,a+=f*A,i+=f*f}let o=(t*a-n*r)/(t*i-n*n),s=(r-o*n)/t;return[o,s]}function k9t(e,t,n){let r=A=>A*t+n,a=e.length,i=Sc(e,A=>A.x)/e.length,o=fZ(cZ,a-2),s=Math.sqrt(Sc(e,A=>(A.y-r(A.x))**2)/(a-2)/Sc(e,A=>(A.x-i)**2)),c=s*o,f=s*Math.sqrt(Sc(e,A=>A.x**2)/a)*o;return{slope:t,intercept:n,slopeError:c,interceptError:f}}function T9t(e,t){let n=Sc(e,s=>s.x)/e.length,r=0,a=0;for(let s=0;s<e.length;++s)r+=Math.pow(e[s].x-n,2),a+=Math.pow(e[s].y-t(e[s].x),2);let i=Math.sqrt(a/(e.length-2)),o=fZ(cZ,e.length-2);return function(s){let c=t(s),f=i*Math.sqrt(1/e.length+Math.pow(s-n,2)/r),A=c-o*f,h=c+o*f;return{x:s,y:c,left:isNaN(A)?c:A,right:isNaN(h)?c:h}}}function _9t(e){let t=e.length;return Math.pow((t*Sc(e,n=>n.x*n.y)-Sc(e,n=>n.x)*Sc(e,n=>n.y))/(Math.sqrt(t*Sc(e,n=>n.x*n.x)-Math.pow(Sc(e,n=>n.x),2))*Math.sqrt(t*Sc(e,n=>n.y*n.y)-Math.pow(Sc(e,n=>n.y),2))),2)}function P9t(e,t){let n=tu(e,t);return tu(e.map(r=>(t(r)-n)**2))}function dZ(e,t){return Math.sqrt(P9t(e,t))}function M9t(e,t,n){let r=tu(e,t),a=tu(e,n),i=e.length;return Sc(e,o=>(o.x-r)*(o.y-a))/i}function D9t(e){let t=M9t(e,a=>a.x,a=>a.y),n=dZ(e,a=>a.x),r=dZ(e,a=>a.y);return t/(n*r)}function H9t(e,t){let n=e.length,r=1,a=1,i=n-r-1,o=tu(e,m=>m.y),s=Sc(e,m=>(t(m.x)-o)**2),c=Sc(e,m=>(t(m.x)-m.y)**2),f=s/a,A=c/i,h=f/A;return 1-(0,x9t.default)(h,a,i)}function I9t(e,t,n,r,a){return a?t.reduce((i,o)=>{let s=e[o].dots;return i[o]=n.map(c=>{let f=s.filter(x=>r.every((k,_)=>String(x.data[k.value])===c[_])),[A=0,h=0]=$A(f,x=>x.x),[m,g]=B9t(f),b=x=>m*x+g,C=T9t(f,b);return{predict:b,getInterval:C,getArea:(x,k,_)=>VB().x(D=>x(D.x)).y0(D=>k(D.left)).y1(D=>k(D.right))(_.map(C))??"",color:a.color,bounded:a.bounded,data:f[0].data,showStats:!0,xBounds:[A,h],stats:{r2:_9t(f),r:D9t(f),pValue:H9t(f,b),coefficients:k9t(f,m,g)}}}),i},{}):null}function AZ(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}function pZ(e){return typeof e=="object"&&"type"in e&&e.type==="grouping"}function L9t(e,t,n,r){return t.reduce((a,i)=>{let o=Ir.uniqBy(e.rows,h=>h[i.value]),s=h=>String(h[i.value]),c=h=>i.valueLabels?String(h[i.valueLabels]):s(h),f=new Set;n.forEach(h=>{h.aes&&Object.entries(h.aes).forEach(([m,g])=>{pZ(g)&&g.value===i.value&&f.add(m)})});let A=o.reduce((h,m)=>(h[s(m)]=c(m),h),{});return a[i.value]={values:o.map(s).filter(h=>h!=="null").sort((h,m)=>A[h].localeCompare(A[m],"en",{numeric:!0})),usedAes:[...f],aesMap:r[i.value],labels:A},a},{})}var R9t=class extends Sg{constructor(t,n){super(t,n);Me(this,"settings");Me(this,"chartRenderer",new C9t);Me(this,"calculatedData",null);this.settings=new uZ(n)}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new uZ(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){console.warn("no chart state for scatterplot")}export(){return this._updateChart(),f3(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o;return t.facetBy.some((s,c)=>{var f;return s.value!==((f=n.facetBy[c])==null?void 0:f.value)})||t.grouping.length!==n.grouping.length||t.grouping.some((s,c)=>{var f;return s.value!==((f=n.grouping[c])==null?void 0:f.value)})||(((r=t.label)==null?void 0:r.value)||((a=n.label)==null?void 0:a.value))&&((i=t.label)==null?void 0:i.value)!==((o=n.label)==null?void 0:o.value)||t.layers.length!==n.layers.length||t.layers.some((s,c)=>s.type!==n.layers[c].type)||!!t.trend!=!!n.trend}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{x:t,y:n,facetBy:r,grouping:a,keyColumn:i,trend:o,layers:s,inheritedAes:c,label:f}=this.settings,A=this.data.getColumnCategories(i.value),h=r.map($=>this.data.getColumnCategories($.value)),m=a.map($=>this.data.getColumnCategories($.value)),g=h.length?AZ([...h]):[["null"]],b=m.length?AZ([...m]):[["null"]],C=r.map($=>$.value)??null;this.data.setGrouping([...C,i.value]);let x={x:this.data.rows.every($=>{let Q=$[t.value];return Q===null||!(Number(Q)<0)}),y:this.data.rows.every($=>{let Q=$[n.value];return Q===null||!(Number(Q)<0)})},k=Gwt(this.data,g,t,n,f,A),_=Object.keys(k),D=I9t(k,_,b,a,o),O=L9t(this.data,a,s,c),I=Ywt(s,_,k,b,a);this.calculatedData={onlyPositive:x,dotsByFacets:k,facetKeys:_,facetKeysCombinations:g,trendsData:D,legendLabels:O,layersData:I}}_updateAesInData(){let t=this.calculatedData;if(!t)return;let{grouping:n,trend:r,layers:a,inheritedAes:i}=this.settings,{facetKeys:o,trendsData:s}=t;o.forEach(c=>{for(let f=0;f<a.length;f++)t.layersData[c][f].info=a[f]}),n.forEach(c=>{let f=new Set;a.forEach(A=>{A.aes&&Object.entries(A.aes).forEach(([h,m])=>{pZ(m)&&m.value===c.value&&f.add(h)})}),t.legendLabels[c.value].usedAes=[...f],t.legendLabels[c.value].aesMap=i[c.value]}),s&&r&&Object.keys(s).forEach(c=>{s[c].forEach(f=>{f.color=r.color,f.bounded=r.bounded})})}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,facetSettings:r,grouping:a,keyColumn:i,inheritedAes:o,layers:s}=this.settings;this.chartRenderer.render(t,n,r,this.calculatedData.facetKeys,this.calculatedData.facetKeysCombinations,this.calculatedData.dotsByFacets,this.calculatedData.trendsData,i,this.calculatedData.onlyPositive,this.calculatedData.legendLabels,this.calculatedData.layersData,o,a,s)}},nE={TOP:30,BOTTOM:30,LEFT:30,RIGHT:30},E9=20,hZ=4,$P=24;function N9t(e,t,n=[]){let r=e.data,a=[`x: ${Ki(e.x)}`,`y: ${Ki(e.y)}`];t.label&&a.unshift(`${t.label}: ${r[t.label]}`);for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function mZ(e){return typeof e=="string"?e:e.label??e.value}var vZ=d3().curve(A3);function $9t({scales:e,chartSettings:t,mainTitle:n,keyColumn:r,margins:a,chartSizes:i,onlyPositive:o,container:s,zoomStateKey:c,legendData:f,dotsByGrouping:A,layers:h,aesGetters:m,selectedDot:g=null}){var G;let{title:b,xAxis:C,yAxis:x,frame:k,legend:_}=t,D=C.showTicks?hZ:0,O=x.showTicks?hZ:0,I=C.title,$=x.title,Q={left:0,right:i.chartWidth,top:0,bottom:i.chartHeight};if(!s)return null;let ee=h.find(Z=>Z.type==="curve"),[K,re]=Vn.useState([]);function U(){let Z=Object.entries(A).map(([Y,X])=>({key:Y,d:ee!=null&&ee.smoothing?vZ(X)??"":X.map(oe=>`${e.x(oe.x)},${e.y(oe.y)}`).join(" "),dot:X[0]}));re(Z)}return Vn.useEffect(()=>{ee&&(vZ.x(Z=>e.x(Z.x)).y(Z=>e.y(Z.y)),U())},[c]),Vn.useEffect(()=>{ee&&U()},[ee==null?void 0:ee.smoothing]),le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${i.totalWidth} ${i.totalHeight}`,width:i.totalWidth,height:i.totalHeight,style:{pointerEvents:"none"},children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${a.left},${a.top})`,fontFamily:"Manrope",children:[le.jsx("clipPath",{id:"viewportClipPath",children:le.jsx("rect",{x:"0",y:"0",width:i.chartWidth,height:i.chartHeight})}),le.jsx(d2,{title:n,show:b.show,position:b.position,leftPadding:a.left,rightPadding:a.right,chartsWidth:i.chartWidth}),le.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Zt,children:[I&&le.jsx("text",{x:i.chartWidth/2,y:i.chartHeight+a.bottom-E9/2,children:mZ(I)}),$&&le.jsx("text",{x:-a.left+E9/2,y:i.chartHeight/2,transform:`rotate(-90,${-a.left+E9/2},${i.chartHeight/2})`,children:mZ($)})]}),le.jsx(eZ,{width:i.chartWidth,height:i.chartHeight,scaleX:e.x,scaleY:e.y,axisX:C,axisY:x,updatingKey:c,frameType:k.type}),le.jsx("g",{transform:`translate(0,${i.chartHeight})`,children:le.jsx(tE,{scale:e.x,orient:"bottom",onlyPositive:o.x,tickSize:D})}),le.jsx("g",{children:le.jsx(tE,{scale:e.y,orient:"left",onlyPositive:o.y,tickSize:O})}),ee&&ee.smoothing&&le.jsx("g",{clipPath:"url(#viewportClipPath)",children:K.map(({key:Z,d:Y,dot:X})=>le.jsx("path",{d:Y,fill:"none",stroke:m.dotFill(X.data),strokeWidth:ee.aes.lineWidth,strokeDasharray:m.lineType(X.data)},Z))}),ee&&!ee.smoothing&&le.jsx("g",{clipPath:"url(#viewportClipPath)",children:K.map(({key:Z,d:Y,dot:X})=>le.jsx("polyline",{points:Y,fill:"none",stroke:m.dotFill(X.data),strokeWidth:ee.aes.lineWidth,strokeDasharray:m.lineType(X.data)},Z))}),g&&le.jsx(oc,{content:N9t(g,r,(G=t.tooltips)==null?void 0:G.content),x:e.x(g.x),y:e.y(g.y),active:!0,sideDistances:Q,container:s}),_.show&&le.jsx("g",{transform:`translate(${i.chartWidth+$P},0)`,children:le.jsx(y9,{legendData:f})})]})]})}var F9t=gb.memo($9t),V9t=20;function O9t({scales:e,chartSizes:t,disabled:n,onPolygonUpdate:r}){let[a,i]=Vn.useState([]),[o,s]=Vn.useState(null),[c,f]=Vn.useState(null),A=Vn.useRef(null),h=Vn.useRef(null),m=Vn.useRef(null),g=Vn.useRef(a);function b(){A.current=null,h.current=null,m.current=null,g.current=[],i([]),s(null)}function C(_){n||_.key!=="Escape"||b()}Vn.useEffect(()=>{n&&(A.current=null,h.current=null,m.current=null,s(null))},[n]),Vn.useEffect(()=>(document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)),[]),Vn.useEffect(()=>{if(o&&c)return;if(a.length===0){r([]);return}let _=a.map(D=>D[0]);_.push(a[a.length-1][1]),r(_)},[a]);function x(){if(!A.current||n)return;let _=[...A.current],D=e.x.invert(_[0]),O=e.y.invert(_[1]),I=g.current,$=m.current,Q=h.current&&I.length>1?Math.sqrt((_[0]-h.current[0])**2+(_[1]-h.current[1])**2):1/0;m.current?m.current&&Q>V9t?(I=[...I,[m.current,[D,O]]],$=[D,O]):(I=[...I,[m.current,[D,O]]],I.length>2&&(I=[...I,[I[I.length-1][1],I[0][0]]]),$=null,I.length<=2?r([]):r(I.map(ee=>ee[0])),h.current=null):(h.current=_,I=[],$=[D,O],r([])),i(I),s($),g.current=I,m.current=$}function k(_){let D=[_.nativeEvent.offsetX,_.nativeEvent.offsetY];f(D),A.current=D}return le.jsxs("g",{children:[le.jsx("rect",{fill:"transparent",width:t.chartWidth,height:t.chartHeight,onMouseMove:k,onClick:x}),a.map(([_,D],O)=>le.jsx("line",{x1:e.x(_[0]),y1:e.y(_[1]),x2:e.x(D[0]),y2:e.y(D[1]),stroke:Zt,style:{pointerEvents:"none"}},O)),o&&c&&le.jsx("line",{x1:e.x(o[0]),y1:e.y(o[1]),x2:c[0],y2:c[1],stroke:Zt,style:{pointerEvents:"none"}},"lastLine")]})}function Q9t({scales:e,container:t,labels:n,aesGetters:r,chartSizes:a,onPolygonUpdate:i,lassoMode:o,selectedDot:s=null}){return t?le.jsxs("g",{children:[n.map(c=>{let{name:f,height:A,bbox:h,width:m}=c;return le.jsx("g",{children:le.jsxs("g",{transform:`translate(${h.minX},${h.minY})`,children:[le.jsx("rect",{x:"0",y:"0",width:m,height:A,fill:"transparent",stroke:"none"}),le.jsx("text",{x:0,y:A/2,stroke:"white",strokeWidth:2,paintOrder:"stroke",style:{pointerEvents:"none"},fontFamily:"Manrope",fontSize:"16px",dominantBaseline:"middle",children:f})]})},c.dot.id)}),le.jsx(O9t,{scales:e,chartSizes:a,disabled:!o,onPolygonUpdate:i}),s&&le.jsx("circle",{cx:e.x(s.x),cy:e.y(s.y),r:5,fill:r.dotFill(s.data)})]}):null}var z9t=Q9t;function U9t({settingsId:e,scales:t,chartSettings:n,mainTitle:r,keyColumn:a,margins:i,chartSizes:o,captionsSizes:s,onlyPositive:c,container:f,zoomStateKey:A,aesGetters:h,legendData:m,labels:g,onPolygonUpdate:b,lassoMode:C,dotsByGrouping:x,layers:k,selectedDot:_=null}){return f?le.jsx("div",{children:le.jsxs(f2,{dataId:e,children:[le.jsx(F9t,{aesGetters:h,dotsByGrouping:x,layers:k,scales:t,keyColumn:a,margins:i,mainTitle:r,captionsSizes:s,chartSettings:n,chartSizes:o,onlyPositive:c,container:f,selectedDot:_,zoomStateKey:A,legendData:m}),HB.createPortal(le.jsx(z9t,{scales:t,container:f,aesGetters:h,labels:g,chartSizes:o,selectedDot:_,onPolygonUpdate:b,lassoMode:C}),f)]})}):null}var gZ=e=>e.selection()!==e,yZ=(e,t)=>{e=e||"g";let n=(i,o)=>o,r=null,a=function(i,o){o=o||(g=>g);let s=i.selection(),c=gZ(i)?i:null,f=s.selectChildren(t==null?e:`${e}.${t}`).data(o,n),A=f.enter().append(e).attr("class",t),h=f.exit();f=f.merge(A);let m=c||r;return m&&(f=f.transition(m).style("opacity",1),A.style("opacity",1e-6),h=h.transition(m).style("opacity",1e-6)),h.remove(),f.enter=()=>A,f.exit=()=>h,f};return a.element=(...i)=>i.length?(e=i[0],a):e,a.className=(...i)=>i.length?(t=i[0],a):t,a.key=(...i)=>i.length?(n=i[0],a):n,a.transition=(...i)=>i.length?(r=i[0],a):r,a},wZ=(e,t,n)=>{let r=t[n];if(typeof r!="function")throw new Error(`Attempt to rebind ${n} which isn't a function on the source object`);return(...a)=>{var i=r.apply(t,a);return i===t?e:i}},CZ=(e,t,...n)=>{for(let r of n)e[r]=wZ(e,t,r);return e},j9t=e=>t=>e.reduce((n,r)=>n&&r(n),t),FP=(e,t,...n)=>{let r=j9t(n);for(let a of Object.keys(t)){let i=r(a);i&&(e[i]=wZ(e,t,a))}return e},G9t=e=>e.map(t=>typeof t=="string"?new RegExp(`^${t}$`):t),Y9t=(...e)=>(e=G9t(e),t=>e.every(n=>!n.test(t))&&t),g2=e=>typeof e=="function"?e:()=>e;function W9t(){let e=arguments;return function(t,n){for(let r=0,a=e.length;r<a;r++)if(e[r](t,n)==null)return!1;return!0}}var X9t=(e,t)=>{switch(e){case"left":return t/2;case"right":return-t/2;default:return 0}},bZ=e=>{let t=Object.assign({},e),n=()=>{};return Object.keys(t).forEach(r=>{n[r]=(...a)=>a.length?(t[r]=a[0],n):t[r]}),n},K9t=()=>{let e=()=>0,t=s=>s.x,n=s=>s.y,r="center",a=()=>5,i="vertical",o=bZ({decorate:()=>{},defined:(s,c)=>W9t(e,t,n)(s,c),xScale:J1(),yScale:J1()});return o.values=(s,c)=>{let f=a(s,c),A=X9t(r,f),h=o.xScale(),m=o.yScale();if(i==="vertical"){let g=m(n(s,c),c),b=m(e(s,c),c),C=h(t(s,c),c)+A;return{d:s,x:C,y:g,y0:b,width:f,height:g-b,origin:[C,g],baseOrigin:[C,b],transposedX:C,transposedY:g}}else{let g=h(n(s,c),c),b=h(e(s,c),c),C=m(t(s,c),c)+A;return{d:s,x:C,y:g,y0:b,width:f,height:g-b,origin:[g,C],baseOrigin:[b,C],transposedX:g,transposedY:C}}},o.xValues=()=>i==="vertical"?[t]:[e,n],o.yValues=()=>i!=="vertical"?[t]:[e,n],o.baseValue=(...s)=>s.length?(e=g2(s[0]),o):e,o.crossValue=(...s)=>s.length?(t=g2(s[0]),o):t,o.mainValue=(...s)=>s.length?(n=g2(s[0]),o):n,o.bandwidth=(...s)=>s.length?(a=g2(s[0]),o):a,o.align=(...s)=>s.length?(r=s[0],o):r,o.orient=(...s)=>s.length?(i=s[0],o):i,o},Z9t=()=>{let e=K9t(),t=g2(64),n=X$,r=qw(),a=qw(),i=qw().type(nh.UNSIGNED_SHORT),o=qw().type(nh.UNSIGNED_BYTE),s=L0t().crossValueAttribute(r).mainValueAttribute(a).sizeAttribute(i).definedAttribute(o),c=(b,C)=>!1,f=z0t,A=[],h=null,m=null,g=b=>{let C=f(e.xScale()),x=f(e.yScale()),k=!c(A,b);k&&(A=b,i.value((_,D)=>t(_,D)).data(b),o.value((_,D)=>e.defined()(_,D)).data(b)),(k||C.scale!==h)&&(h=C.scale,e.orient()==="vertical"?r.value((_,D)=>C.scale(e.crossValue()(_,D))).data(b):r.value((_,D)=>C.scale(e.mainValue()(_,D))).data(b)),(k||x.scale!==m)&&(m=x.scale,e.orient()==="vertical"?a.value((_,D)=>x.scale(e.mainValue()(_,D))).data(b):a.value((_,D)=>x.scale(e.crossValue()(_,D))).data(b)),s.xScale(C.webglScale).yScale(x.webglScale).type(K0t(n)).decorate(_=>e.decorate()(_,b,0)),s(b.length)};return g.size=(...b)=>b.length?(t=g2(b[0]),g):t,g.type=(...b)=>b.length?(n=b[0],g):n,g.equals=(...b)=>b.length?(c=b[0],g):c,g.scaleMapper=(...b)=>b.length?(f=b[0],g):f,FP(g,e,Y9t("baseValue","bandwidth","align")),CZ(g,s,"context","pixelRatio"),g},EZ=()=>{let e=[],t=a=>a,n=(a,i)=>i,r=bZ({decorate:()=>{},xScale:J1(),yScale:J1()});return r.xValues=()=>e.map(a=>a.xValues()).reduce((a,i)=>a.concat(i)),r.yValues=()=>e.map(a=>a.yValues()).reduce((a,i)=>a.concat(i)),r.mapping=(...a)=>a.length?(t=a[0],r):t,r.key=(...a)=>a.length?(n=a[0],r):n,r.series=(...a)=>a.length?(e=a[0],r):e,r},J9t=()=>{let e=EZ(),t=yZ("g"),n=yZ("g","multi"),r=a=>{gZ(a)&&(n.transition(a),t.transition(a));let i=e.mapping(),o=e.series(),s=e.xScale(),c=e.yScale();a.each((f,A,h)=>{let m=n(iu(h[A]),o);m.each((g,b,C)=>{g.xScale(s).yScale(c);let x=i(f,b,o);t(iu(C[b]),[x]).call(g)}),m.selection().order(),e.decorate()(m,f,A)})};return FP(r,e),CZ(r,n,"key"),r},q9t=()=>{let e=null,t=1,n=EZ(),r=a=>{let i=n.mapping(),o=n.series(),s=n.xScale(),c=n.yScale();o.forEach((f,A)=>{let h=i(a,A,o);f.context(e).pixelRatio(t).xScale(s).yScale(c);let m;f.decorate?(m=f.decorate(),f.decorate((g,b,C)=>{n.decorate()(g,a,A),m(g,b,C)})):n.decorate()(e,a,A),f(h),m&&f.decorate(m)})};return r.context=(...a)=>a.length?(e=a[0],r):e,r.pixelRatio=(...a)=>a.length?(t=a[0],r):t,FP(r,n),r};function e4t(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function rE(e={},t,n){return function(r){var a,i;if(e4t(n)){let o=n.value,s=r[o];return(i=((a=e[o])==null?void 0:a[String(s)])??hP)==null?void 0:i[t]}if($m(n)&&t==="dotFill"){let{domain:o,range:s,type:c="linear"}=n;return J8(s,o,c)(Number(r[n.columnName.value]))}return n}}var t4t=class{constructor(){Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"canvasNode",null);Me(this,"svgLayerElement",null);Me(this,"svgLayerComponent",le.jsx(le.Fragment,{}));Me(this,"tools",null);Me(this,"margins",{top:qf,bottom:qf,left:qf,right:qf});Me(this,"chartSizes",{chartWidth:600,chartHeight:350,totalWidth:600,totalHeight:350});Me(this,"scales",{x:Da().domain([0,10]).range([0,600]),y:Da().domain([0,10]).range([350,0]),xOriginal:Da().domain([0,10]).range([0,600]),yOriginal:Da().domain([0,10]).range([350,0])});Me(this,"polygon",[]);Me(this,"onPolygonUpdateOutside",()=>{});Me(this,"zoomStateKey","");Me(this,"selectedDot",null);Me(this,"captionsSizes",{xAxisCaptionsWidth:30,yAxisCaptionsWidth:100});Me(this,"mainTitle",[]);Me(this,"legend",{width:0,height:0,items:[]});Me(this,"notCalculatedProps",{});Me(this,"allPossibleLabels",[]);Me(this,"visibleLabels",[]);Me(this,"lassoMode",!1);Me(this,"onPolygonUpdate",e=>{this.polygon=e,this.updateByLasso(),this.onPolygonUpdateOutside(e)})}clear(){var e,t;this.parentNode&&this.rootNode&&this.canvasNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),(t=this.parentNode)==null||t.removeChild(this.canvasNode),this.parentNode=null,this.rootNode=null,this.canvasNode=null,this.svgLayerElement=null,this.tools=null),setTimeout(()=>{var n;(n=this.reactRoot)==null||n.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.canvasNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.parentNode.appendChild(this.canvasNode),this.reactRoot=zh(this.rootNode))}updateChartSizes(e){this.chartSizes.chartWidth=e.width,this.chartSizes.chartHeight=e.height}updateViewport(e,t,n){let r=e.scale==="log"?Rv():Da(),{minX:a,minY:i,maxX:o,maxY:s}=n;if(e.lowerValue!==void 0&&(a=Math.max(a,e.lowerValue)),e.upperValue!==void 0&&(o=Math.min(o,e.upperValue)),t.lowerValue!==void 0&&(i=Math.max(i,t.lowerValue)),t.upperValue!==void 0&&(s=Math.min(s,t.upperValue)),e.symmetricRange!==void 0){let g=e.symmetricRange;if(g>=a&&g<=o){let b=Math.max(g-a,o-g);a=g-b,o=g+b}}if(typeof t.symmetricRange<"u"){let g=t.symmetricRange;if(g>=i&&g<=s){let b=Math.max(g-i,s-g);i=g-b,s=g+b}}let c=[0,this.chartSizes.chartWidth],f=r.copy().domain([a,o]).range([nE.LEFT,this.chartSizes.chartWidth-nE.RIGHT]);r.domain([f.invert(0),f.invert(this.chartSizes.chartWidth)]).range(c).nice(),this.scales.x=r,this.scales.xOriginal=r.copy();let A=t.scale==="log"?Rv():Da(),h=[this.chartSizes.chartHeight,0],m=A.copy().domain([i,s]).range([this.chartSizes.chartHeight-nE.BOTTOM,nE.TOP]);A.domain([m.invert(this.chartSizes.chartHeight),m.invert(0)]).range(h).nice(),this.scales.y=A,this.scales.yOriginal=A.copy()}updateCaptionsSize(e){let t=new Dc("600 14px Arial");function n(o){return Math.max(...o.map(s=>t.getTextWidth(s)))}let{ticks:r,format:a}=b9(this.scales.y,e),i=n(r.map(a));this.captionsSizes={xAxisCaptionsWidth:20,yAxisCaptionsWidth:i}}createMainTitle(e){this.mainTitle=Om(e.name,this.chartSizes.totalWidth-this.margins.left-this.margins.right,20)}updateMargins(){let e=24*this.mainTitle.length,t=e>0?e+24*2:0;this.margins={top:Math.max(t,qf),bottom:qf+this.captionsSizes.xAxisCaptionsWidth+E9,left:qf+this.captionsSizes.yAxisCaptionsWidth+E9,right:this.legend.width+(this.legend.width>0?$P:0)+qf},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartHeight,this.legend.height)+this.margins.bottom,iu(this.canvasNode).style("width",this.chartSizes.chartWidth+"px").style("height",this.chartSizes.chartHeight+"px").style("top",this.margins.top+"px").style("left",this.margins.left+"px")}updateLegendSize(e,t,n,r){if(!e.show){this.legend={width:0,height:0,items:[]};return}let a=[],i={width:0,height:0,left:0,top:0};if(n.forEach(A=>{let h=t[A.value];if(h.usedAes.length===0||!h.aesMap)return;let m={};h.values.forEach(C=>{m[C]||(m[C]={...mP}),h.usedAes.forEach(x=>{var k,_;x==="dotFill"&&(m[C].color=((k=h.aesMap[C])==null?void 0:k[x])??Zt),x==="dotSize"&&(m[C].size=((_=h.aesMap[C])==null?void 0:_[x])??3)})});let g=A.label??A.value,b=Hl().domain(h.values).range(h.values.map(C=>m[C]));a.push({...i,id:A.value,type:"dots",title:g,scale:b,values:h.values,labels:h.labels})}),r.forEach(A=>{if(A.type==="dots"&&$m(A.aes.dotFill)){let{domain:h,range:m,columnName:g,type:b="linear"}=A.aes.dotFill,C=g.label??g.value,x=J8(m,h,"linear"),k=(b==="log"?q1():Da()).domain(h).range([height,0]),_=a2(k,h);a.push({...i,id:"dotFill",type:"continuous",title:C,scale:x,tickPositionScale:k,values:_})}}),!a.length){this.legend={width:0,height:0,items:[]};return}let o=w9(a,this.chartSizes.chartHeight),s=o[o.length-1],c=s.left+s.width+2*$P,f=this.chartSizes.chartHeight;this.legend={width:c,height:f,items:o}}initSettings(e,t,n,r,a,i,o,s){let{xAxis:c,yAxis:f,size:A,title:h,legend:m}=t;this.updateChartSizes(A),this.updateViewport(c,f,n),this.updateCaptionsSize(r.y),this.updateLegendSize(m,o,s,i),this.createMainTitle(h),this.updateMargins();let g=i.find($=>$.type==="dots"),b=i.find($=>$.type==="curve"),C={dotFill:rE(a,"dotFill",g.aes.dotFill),lineType:rE(a,"lineShape",(b==null?void 0:b.aes.lineShape)??"solid")},x=J0t().data(e).value($=>{let Q=Ly(C.dotFill($.data));return[Q.r/255,Q.g/255,Q.b/255,1]}),k=Z9t().equals(($,Q)=>$===Q).size(50).crossValue($=>$.x).mainValue($=>$.y).decorate($=>x($)),_=t0t().scaleExtent([.1,1e3]).filter(()=>!this.lassoMode).on("start",()=>{this.selectedDot=null}).on("zoom",$=>{let Q=$.transform,ee=Q.rescaleX(this.scales.xOriginal),K=Q.rescaleY(this.scales.yOriginal);this.scales.x.domain(ee.domain()),this.scales.y.domain(K.domain()),this.zoomStateKey=`${Q.x}_${Q.y}_${Q.k}`,this.renderSvgLayer(),this.renderWebglLayer()}).on("end",()=>{this.allPossibleLabels.forEach($=>{$.x=this.scales.x($.dot.x),$.y=this.scales.y($.dot.y)}),this.visibleLabels=eE(this.allPossibleLabels,this.chartSizes.chartWidth,this.chartSizes.chartHeight),this.renderSvgLayer()}),D=N_().x($=>$.x).y($=>$.y).addAll(e),O=q0t().on("point",([$])=>{var U,G;if(!$){this.selectedDot=null,this.renderSvgLayer();return}let Q=this.scales.x.invert($.x),ee=this.scales.y.invert($.y),K=(U=this.tools)==null?void 0:U.qt.find(Q,ee),re=this.selectedDot&&!K||!this.selectedDot&&K||((G=this.selectedDot)==null?void 0:G.id)!==(K==null?void 0:K.id);this.selectedDot=K??null,re&&this.renderSvgLayer()}),I=_0t({xScale:this.scales.x,yScale:this.scales.y}).xAxisHeight(()=>"0").yAxisWidth(()=>"0").svgPlotArea(J9t()).webglPlotArea(q9t().series([k]).mapping($=>$)).decorate($=>{let Q=$.enter();Q&&!this.svgLayerElement&&(Q.style("grid-template-columns","0 auto 1fr auto 0"),Q.style("grid-template-rows","0 auto 1fr auto 0"),this.svgLayerElement=Q.select(".svg-plot-area.plot-area svg").node()),Q.select(".svg-plot-area.plot-area").call(_).call(O)});this.tools={webglChart:I,zoom:_,qt:D,fillColor:x,pointSeries:k,aesGetters:C},iu(this.canvasNode).datum(e).style("position","absolute").style("width",this.chartSizes.chartWidth+"px").style("height",this.chartSizes.chartHeight+"px").style("top",this.margins.top+"px").style("left",this.margins.left+"px")}updateAes(e,t){var i;if(this.tools===null)return;let n=t.find(o=>o.type==="dots"),r=t.find(o=>o.type==="curve"),a={dotFill:rE(e,"dotFill",n.aes.dotFill),lineType:rE(e,"lineShape",(r==null?void 0:r.aes.lineShape)??"solid")};this.tools.aesGetters=a,(i=this.tools)==null||i.fillColor.value(o=>{var A;let s=((A=this.tools)==null?void 0:A.aesGetters.dotFill)??(()=>Zt),c=Ly(s(o.data)),f=this.polygon.length<2||dX(this.polygon,[o.x,o.y])?1:.2;return[c.r/255,c.g/255,c.b/255,f]})}updateByLasso(){var e;this.tools!==null&&((e=this.tools)==null||e.fillColor.value(t=>{var i;let n=((i=this.tools)==null?void 0:i.aesGetters.dotFill)??(()=>Zt),r=Ly(n(t.data)),a=this.polygon.length<2||dX(this.polygon,[t.x,t.y])?1:.4;return[r.r/255,r.g/255,r.b/255,a]}),this.renderWebglLayer())}updateData(e){this.tools!==null&&(iu(this.canvasNode).datum(e),this.tools.fillColor.data(e),this.tools.qt=N_().x(t=>t.x).y(t=>t.y).addAll(e))}render(e,t,n,r,a,i,o,s,c,f,A,h,m,g){if(this.lassoMode=g,this.tools===null)this.initSettings(a,t,i,r,s,c,f,A),this.onPolygonUpdateOutside=m;else{let{title:b,legend:C}=t;this.updateLegendSize(C,f,A,c),this.createMainTitle(b),this.updateMargins(),this.updateAes(s,c)}this.allPossibleLabels=h,this.allPossibleLabels.forEach(b=>{b.x=this.scales.x(b.dot.x),b.y=this.scales.y(b.dot.y)}),this.visibleLabels=eE(this.allPossibleLabels,this.chartSizes.chartWidth,this.chartSizes.chartHeight),this.notCalculatedProps={settingsId:e,chartSettings:t,onlyPositive:r,keyColumn:n,dotsByGrouping:o,layers:c},this.renderWebglLayer(),this.renderSvgLayer()}renderWebglLayer(){var e,t;(e=this.tools)!=null&&e.webglChart&&iu(this.canvasNode).call((t=this.tools)==null?void 0:t.webglChart)}renderSvgLayer(){var t,n;this.visibleLabels.forEach(r=>{r.x=this.scales.x(r.dot.x),r.y=this.scales.y(r.dot.y)}),Jwt(this.visibleLabels);let e={settingsId:this.notCalculatedProps.settingsId,chartSettings:this.notCalculatedProps.chartSettings,onlyPositive:this.notCalculatedProps.onlyPositive,keyColumn:this.notCalculatedProps.keyColumn,dotsByGrouping:this.notCalculatedProps.dotsByGrouping,layers:this.notCalculatedProps.layers,chartSizes:this.chartSizes,scales:this.scales,margins:this.margins,mainTitle:this.mainTitle,captionsSizes:this.captionsSizes,container:this.svgLayerElement,zoomStateKey:this.zoomStateKey,selectedDot:this.selectedDot,aesGetters:(t=this.tools)==null?void 0:t.aesGetters,legendData:this.legend,labels:this.visibleLabels,onPolygonUpdate:this.onPolygonUpdate,lassoMode:this.lassoMode};this.svgLayerComponent=le.jsx(U9t,{...e}),(n=this.reactRoot)==null||n.render(this.svgLayerComponent)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},n4t=t4t,aE=H.object({type:H.literal("grouping"),value:H.string()}),r4t=H.object({type:H.literal("dots"),aes:H.optional(H.object({dotFill:H.optional(H.union([H.string(),aE,rh(H.string())])),dotShape:H.optional(H.union([Od,aE])),dotSize:H.optional(H.union([H.number(),aE]))}))}),a4t=H.object({type:H.literal("curve"),smoothing:H.optional(H.boolean()),aes:H.optional(H.object({lineWidth:H.optional(H.number()),lineShape:H.optional(tp),lineColor:H.optional(H.union([H.string(),aE,rh(H.string())])),opacity:H.optional(H.number())}))}),i4t=H.union([r4t,a4t]),o4t=H.object({type:H.literal("scatterplot-umap"),title:H.object({name:H.string(),show:H.optional(H.boolean()),position:H.optional(Nm)}),size:H.optional(H.object({width:H.optional(H.number()),height:H.optional(H.number())})),legend:H.optional(H.object({show:H.optional(H.boolean()),position:H.optional(Bg)})),tooltips:H.optional(H.object({show:H.optional(H.boolean()),content:H.optional(H.array(Tr))})),frame:H.optional(H.object({type:H.optional(c9)})),keyColumn:Tr,x:Tr,y:Tr,xAxis:H.optional(r2),yAxis:H.optional(r2),grouping:H.optional(H.array(Tr)),label:H.optional(Tr),inheritedAes:H.optional(H.record(H.string(),n2)),layers:H.array(i4t),lassoMode:H.optional(H.boolean())}),l4t=class{constructor(e){Me(this,"type","dots");Me(this,"aes",{dotFill:Zt,dotShape:"21",dotSize:3,opacity:1});this.aes={...this.aes,...e.aes}}},s4t=class{constructor(e){Me(this,"type","curve");Me(this,"smoothing");Me(this,"aes",{lineColor:Zt,lineWidth:1,lineShape:"solid",opacity:1});this.smoothing=e.smoothing??!1,this.aes={...this.aes,...e.aes}}},xZ=class{constructor(e){Me(this,"id");Me(this,"type","scatterplot-umap");Me(this,"keyColumn");Me(this,"x");Me(this,"y");Me(this,"grouping");Me(this,"label");Me(this,"chartSettings");Me(this,"inheritedAes");Me(this,"layers");Me(this,"lassoMode");var t,n,r,a;o4t.parse(e),this.id=Ir.uniqueId("settings"),this.keyColumn=e.keyColumn,this.x=e.x,this.y=e.y,this.grouping=e.grouping??[],this.label=e.label??null,this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??600,height:((n=e==null?void 0:e.size)==null?void 0:n.height)??350},title:{position:"center",show:!0,...e.title,name:((r=e.title)==null?void 0:r.name)??"Chart"},yAxis:{title:e.y.label??e.y.value,scale:"linear",showGrid:!0,showTicks:!0,...e.yAxis},xAxis:{title:e.x.label??e.x.value,scale:"linear",showGrid:!0,showTicks:!0,...e.xAxis},frame:{type:((a=e.frame)==null?void 0:a.type)??"full"},legend:{show:!0,position:"right",...e.legend},tooltips:{show:!0,...e.tooltips}},this.inheritedAes=e.inheritedAes??{},this.layers=e.layers.map(i=>{if(i.type==="dots")return new l4t(i);if(i.type==="curve")return new s4t(i);throw new Error("Unknown layer type")}).filter(Boolean),this.lassoMode=e.lassoMode??!1}};function SZ(e){return typeof e=="object"&&"type"in e&&e.type==="grouping"}function u4t(e,t,n,r){return t.reduce((a,i)=>{let o=Ir.uniqBy(e.rows,h=>h[i.value]),s=h=>String(h[i.value]),c=h=>i.valueLabels?String(h[i.valueLabels]):s(h),f=new Set;n.forEach(h=>{h.aes&&Object.entries(h.aes).forEach(([m,g])=>{SZ(g)&&g.value===i.value&&f.add(m)})});let A=o.reduce((h,m)=>(h[s(m)]=c(m),h),{});return a[i.value]={values:o.map(s).sort((h,m)=>A[h].localeCompare(A[m],"en",{numeric:!0})),usedAes:[...f],aesMap:r[i.value],labels:A},a},{})}var c4t=10;function f4t(e){let t=[],n=new Dc("16px Manrope");for(let r of e){let a=r.label;if(!a)continue;let i=n.getTextMetrics(String(a));t.push({name:String(a),width:i.width,height:i.actualBoundingBoxAscent+i.actualBoundingBoxDescent,x:0,y:0,xPosition:"right",yPosition:"middle",bbox:{minX:0,maxX:0,minY:0,maxY:0},dot:r,padding:c4t})}return t}var d4t=class extends Sg{constructor(t,n,r){super(t,n);Me(this,"settings");Me(this,"chartRenderer",new n4t);Me(this,"onPolygonUpdate",()=>Kx);Me(this,"calculatedData",null);this.settings=new xZ(n),r&&(this.onPolygonUpdate=r[0])}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new xZ(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){t==="polygon"&&(this.chartRenderer.polygon=n,this._updateChart())}export(){return console.warn("export not implemented"),""}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o;return t.grouping.length!==n.grouping.length||t.grouping.some((s,c)=>{var f;return s.value!==((f=n.grouping[c])==null?void 0:f.value)})||(((r=t.label)==null?void 0:r.value)||((a=n.label)==null?void 0:a.value))&&((i=t.label)==null?void 0:i.value)!==((o=n.label)==null?void 0:o.value)}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{x:t,y:n,keyColumn:r,label:a,grouping:i,layers:o,inheritedAes:s}=this.settings,c={x:!0,y:!0},f={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0},A=o.some(x=>x.type==="curve"),h=new Set,m={},g=this.data.rows.reduce((x,k)=>{if(k[t.value]===null||k[n.value]===null)return x;let _=Number(k[t.value]),D=Number(k[n.value]);c.x&&_!==null&&_<0&&(c.x=!1),c.y&&D!==null&&D<0&&(c.y=!1),_!==null&&_<f.minX&&(f.minX=_),_!==null&&_>f.maxX&&(f.maxX=_),D!==null&&D<f.minY&&(f.minY=D),D!==null&&D>f.maxY&&(f.maxY=D);let O={x:_,y:D,id:String(k[r.value]),label:a&&k[a.value]?String(k[a.value]):null,data:k};if(A){let I=i.map($=>k[$.value]).join("_");h.add(I),m[I]||(m[I]=[]),m[I].push(O)}return x.push(O),x},[]),b=[...h];A&&b.forEach(x=>{m[x].sort((k,_)=>k.x-_.x)});let C=u4t(this.data,i,o,s);this.calculatedData={onlyPositive:c,dots:g,dotsByGrouping:m,groupingKeys:b,allPossibleLabels:f4t(g),dotsExtents:f,legendLabels:C},this.chartRenderer.updateData(g)}_updateAesInData(){let t=this.calculatedData;if(!t)return;let{layers:n,inheritedAes:r,grouping:a}=this.settings;this.chartRenderer.updateAes(r,n),a.forEach(i=>{let o=new Set;n.forEach(s=>{s.aes&&Object.entries(s.aes).forEach(([c,f])=>{SZ(f)&&f.value===i.value&&o.add(c)})}),t.legendLabels[i.value].usedAes=[...o],t.legendLabels[i.value].aesMap=r[i.value]})}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,keyColumn:r,inheritedAes:a,layers:i,grouping:o,lassoMode:s}=this.settings;this.chartRenderer.render(t,n,r,this.calculatedData.onlyPositive,this.calculatedData.dots,this.calculatedData.dotsExtents,this.calculatedData.dotsByGrouping,a,i,this.calculatedData.legendLabels,o,this.calculatedData.allPossibleLabels,this.onPolygonUpdate,s)}};function A4t(e){let t=cL(e),n=tu(e);return t===void 0||n===void 0||t===0?r=>r:r=>(r-n)/t}function p4t(e){let t=tu(e),[n,r]=$A(e);return t===void 0||n===void 0||r===void 0?a=>a:a=>(a-t)/(r-n)}function h4t(e,t){return e==="standardScaling"?A4t(t):e==="meanNormalization"?p4t(t):n=>n}function m4t(e,t,n,r,a,i,o,s,c){let f=o.map(C=>C.join("_")),A={meta:{facetKeys:f,xKeys:[],yKeys:[],xLabels:{},yLabels:{},facetKeyValues:f.reduce((C,x,k)=>(C[x]=o[k],C),{}),valueExtentSize:[1/0,-1/0],valueExtentColor:[1/0,-1/0]},facets:{}},h=new Set,m=new Set,g=t.valueLabels??t.value,b=n.valueLabels??n.value;if(e.rows.forEach(C=>{let x=i.length?i.map(I=>C[I.value]).join("_"):"null",k=C[t.value],_=C[n.value],D=C[r.value]??c,O=C[a.value]??c;if(!(k===null||_===null||D===null||O===null)){if(A.facets[x]||(A.facets[x]={xKeys:[],yKeys:[],cells:{}}),A.facets[x].xKeys.push(k),A.facets[x].yKeys.push(_),h.has(k)||(h.add(k),A.meta.xKeys.push(k)),m.has(_)||(m.add(_),A.meta.yKeys.push(_)),A.facets[x].cells[k]||(A.facets[x].cells[k]={}),A.meta.valueExtentSize[0]=Math.min(D,A.meta.valueExtentSize[0]),A.meta.valueExtentSize[1]=Math.max(D,A.meta.valueExtentSize[1]),A.meta.valueExtentColor[0]=Math.min(O,A.meta.valueExtentColor[0]),A.meta.valueExtentColor[1]=Math.max(O,A.meta.valueExtentColor[1]),A.facets[x].cells[k][_])throw Error(`More than 1 value for x=${k}, y=${_}`);if(A.meta.xLabels[k]&&String(C[g])!==A.meta.xLabels[k])throw Error(`More than 1 x-label value for x=${k}`);if(A.meta.yLabels[_]&&String(C[b])!==A.meta.yLabels[_])throw Error(`More than 1 y-label value for y=${_}`);A.meta.xLabels[k]=String(C[g]),A.meta.yLabels[_]=String(C[b]),A.meta&&(A.facets[x].cells[k][_]={id:`${k}_${_}`,x:k,y:_,sizeValue:D,normalizedSizeValue:D,colorValue:O,normalizedColorValue:O,data:C})}}),A.meta.facetKeys=A.meta.facetKeys.filter(C=>A.facets[C]),A.meta.facetKeys.forEach(C=>{let x=A.facets[C];x.xKeys=Ir.uniq(x.xKeys),x.yKeys=Ir.uniq(x.yKeys)}),s){let C=[1/0,-1/0];A.meta.facetKeys.forEach(x=>{if(!A.facets[x])return;let{xKeys:k,yKeys:_,cells:D}=A.facets[x],O=s.direction==="row"?k:_,I=s.direction==="row"?_:k,$=s.direction==="row"?(Q,ee)=>{var K;return(K=D[Q])==null?void 0:K[ee]}:(Q,ee)=>{var K;return(K=D[ee])==null?void 0:K[Q]};I.forEach(Q=>{let ee=[];O.forEach(re=>{var G;let U=(G=$(re,Q))==null?void 0:G.colorValue;U!==void 0&&ee.push(U)});let K=h4t(s.method,ee);O.forEach(re=>{let U=$(re,Q);U!==void 0&&(U.normalizedColorValue=K(U.colorValue),C[0]=Math.min(U.normalizedColorValue,C[0]),C[1]=Math.max(U.normalizedColorValue,C[1]))})})}),A.meta.valueExtentColor=C}return A.meta.valueExtentSize[0]===1/0&&(A.meta.valueExtentSize[0]=0),A.meta.valueExtentSize[1]===-1/0&&(A.meta.valueExtentSize[1]=0),A.meta.valueExtentColor[0]===1/0&&(A.meta.valueExtentColor[0]=0),A.meta.valueExtentColor[1]===-1/0&&(A.meta.valueExtentColor[1]=0),A}var v4t=15,Mg=8,iE=30,g4t=48,y4t=24,oE=16,y2=4,lE=4,BZ=20,w4t=16,u1={left:["axis","axisTitle"],right:["axis","axisTitle"],top:["axis","axisTitle","facetTitle"],bottom:["axis","axisTitle"]};function C4t(e,t,n,r,a,i,o){let s=r.includes(t.position),c=r.includes(e.position),f=a.length>1,A=e.showTicks?lE:0,h=t.showTicks?lE:0,m=c&&e.showTitle?iE:0,g=s&&t.showTitle?iE:0,b=c&&e.showAxisLabels&&i>oE?n.xAxisCaptions+A+y2:0,C=s&&t.showAxisLabels&&o>oE?n.yAxisCaptions+h+y2:0;return{left:{axisTitle:t.position==="left"?g:0,axis:t.position==="left"?C:0},right:{axisTitle:t.position==="right"?g:0,axis:t.position==="right"?C:0},top:{facetTitle:f?g4t:0,axisTitle:e.position==="top"?m:0,axis:e.position==="top"?b:0},bottom:{axisTitle:e.position==="bottom"?m:0,axis:e.position==="bottom"?b:0}}}function b4t(e,t,n){return{left:u1.left.reduce((r,a,i)=>{let o=i>0?u1.left[i-1]:null,s=e.left[a];return r[a]={x:o?r[o].x-s:-s,y:0,width:s,height:n,isVisible:s>0},r},{}),right:u1.right.reduce((r,a,i)=>{let o=i>0?u1.right[i-1]:null,s=e.right[a];return r[a]={x:o?r[o].x+r[o].width:t,y:0,width:s,height:n,isVisible:s>0},r},{}),top:u1.top.reduce((r,a,i)=>{let o=i>0?u1.top[i-1]:null,s=e.top[a];return r[a]={x:0,y:o?r[o].y-s:-s,width:t,height:s,isVisible:s>0},r},{}),bottom:u1.bottom.reduce((r,a,i)=>{let o=i>0?u1.bottom[i-1]:null,s=e.bottom[a];return r[a]={x:0,y:o?r[o].y+r[o].height:n,width:t,height:s,isVisible:s>0},r},{})}}function E4t(e,t,n,r){let{xLabels:a,yLabels:i}=n.meta,o=e.xAxisLabels/180*Math.PI,s=e.yAxisLabels/180*Math.PI,c=0,f=0,A=e.xAxisLabels===45;if(A){let m=n.meta.xKeys,g=t.x,b=g>oE,C=a[m[0]];c=Math.max(c,(A&&b?r.getTextWidth(C)*Math.cos(o):0)-g/2)}let h=e.yAxisLabels===45;if(h){let m=n.meta.yKeys;if(m.length){let g=t.y,b=g>oE,C=i[m[m.length-1]];f=Math.max(f,(h&&b?r.getTextWidth(C)*Math.cos(s):0)-g/2)}}return{xCaptionTail:c,yCaptionTail:f}}function x4t({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:f,xLabels:A,yLabels:h}){let m=i.showTicks?lE:0,g=o.showTicks?lE:0,b=e.top.axis.isVisible||e.bottom.axis.isVisible,C=e.top.axisTitle.isVisible?e.top.axisTitle:e.bottom.axisTitle,x=e.top.axis.isVisible?e.top.axis:e.bottom.axis,k=e.left.axis.isVisible||e.right.axis.isVisible,_=e.left.axisTitle.isVisible?e.left.axisTitle:e.right.axisTitle,D=e.left.axis.isVisible?e.left.axis:e.right.axis;return le.jsxs("g",{children:[le.jsxs("g",{children:[C.isVisible&&le.jsxs("g",{transform:`translate(${C.x},${C.y})`,children:[le.jsx("text",{x:C.width/2,y:C.height/2,textAnchor:"middle",dominantBaseline:"central",children:i.title}),t&&le.jsx("rect",{width:C.width,height:C.height,stroke:Zt,fill:"none"})]}),b&&le.jsxs("g",{fontSize:"14px",transform:`translate(${x.x},${x.y})`,children:[n.map(O=>{let I=f.xAxisLabels!==0,$=i.position==="bottom",Q=$?0:x.height,ee=$?Q+m:Q-m,K=$?ee+y2:ee-y2,re=a.x(O)+s/2,U=-f.xAxisLabels;return le.jsxs("g",{children:[le.jsx("line",{x1:re,x2:re,y1:Q,y2:ee,stroke:Zt}),le.jsx("text",{x:re,y:K,textAnchor:I?$?"end":"start":"middle",transform:`rotate(${U},${re},${K})`,dominantBaseline:I?"central":$?"hanging":"auto",children:A[O]})]},O)}),t&&le.jsx("rect",{width:x.width,height:x.height,stroke:Zt,fill:"none"})]})]}),le.jsxs("g",{children:[_.isVisible&&le.jsx("g",{transform:`translate(
|
|
15189
15189
|
${_.x+_.width/2},
|
|
15190
|
-
${_.y+_.height/2})`,children:le.jsx("text",{transform:`rotate(${o.position==="left"?-90:90})`,dominantBaseline:"central",textAnchor:"middle",children:o.title})}),t&&le.jsx("rect",{x:_.x,y:_.y,width:_.width,height:_.height,stroke:Zt,fill:"none"}),k&&le.jsx("g",{fontSize:"14px",transform:`translate(${D.x},${D.y})`,children:r.map(O=>{let I=f.yAxisLabels!==0,$=o.position==="left",Q=-(90-f.yAxisLabels),ee=f.yAxisLabels===0?"middle":$?"end":"start",K=I?"central":$?"auto":"hanging",re=$?D.width:0,U=$?re-g:re+g,G=$?U-y2:U+y2,Z=a.y(O)+c/2;return le.jsxs("g",{children:[le.jsx("line",{x1:re,x2:U,y1:Z,y2:Z,stroke:Zt}),le.jsx("text",{x:G,y:Z,textAnchor:ee,transform:`rotate(${Q},${G},${Z})`,dominantBaseline:K,children:h[O]})]},O)})}),t&&le.jsx("rect",{x:D.x,y:D.y,height:D.height,width:D.width,stroke:Zt,fill:"none"})]})]})}function sE(e){if(e===null)return"null";if(typeof e=="number"){let t=e>0?Math.floor(e):Math.ceil(e),n=e-t;return t+Number(n.toPrecision(2))}return e}function S4t(e,t,n=[]){let r=e.data,a=[`X: ${t.xLabels[e.x]}`,`Y: ${t.yLabels[e.y]}`,`Value (color): ${sE(e.colorValue)}${e.colorValue!==e.normalizedColorValue?` (${sE(e.normalizedColorValue)})`:""}`,`Value (size): ${sE(e.sizeValue)}${e.sizeValue!==e.normalizedSizeValue?` (${sE(e.normalizedSizeValue)})`:""}`];for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function B4t({facetKey:e,dimensions:t,scales:n,cells:r,colorScale:a,sizeScale:i,chartSettings:o,cellsMeta:s,stepX:c,stepY:f,aes:A,labelAngles:h,chartSizes:m,margins:g,tooltipsContainer:b}){let[C,x]=Vn.useState(null),{xAxis:k,yAxis:_,tooltips:D}=o,{width:O,height:I}=t.inner,{padding:$,sideElementBBoxes:Q}=t,{xLabels:ee,yLabels:K}=s,re=n.x.domain(),U=n.y.domain(),G={left:g.left+t.left+$.left,right:m.totalWidth-(g.left+t.left+$.left),top:g.top+t.top+$.top,bottom:m.totalHeight-(g.top+t.top+$.top)},Z=!1;return le.jsxs("g",{transform:`translate(${t.left},${t.top})`,fontSize:w4t,children:[le.jsxs("g",{transform:`translate(${$.left},${$.top})`,children:[Q.top.facetTitle.isVisible&&le.jsx("text",{x:Q.top.facetTitle.x,y:Q.top.facetTitle.y+Q.top.facetTitle.height-y4t,fontWeight:"500",fontSize:"20px",children:s.facetKeyValues[e].join(", ")}),Z,re.map(Y=>U.map(X=>{var me;let oe=(me=r==null?void 0:r[Y])==null?void 0:me[X];return oe?le.jsx("circle",{cx:n.x(Y)+c/2,cy:n.y(X)+f/2,r:i(oe.normalizedSizeValue),stroke:A.cellStrokeColor,fill:oe.colorValue===null?A.emptyCellColor:a(oe.normalizedColorValue),onMouseOver:()=>x(oe),onMouseLeave:()=>x(null)},oe?oe.id:`${Y}_${X}`):null})),le.jsx("g",{children:o.frame.type==="full"&&le.jsx("rect",{fill:"none",stroke:Zt,x:"0",y:"0",width:O,height:I})}),le.jsx("g",{fontWeight:"500",children:le.jsx(x4t,{sideElementBBoxes:Q,xKeys:re,yKeys:U,scales:n,xAxis:k,yAxis:_,stepX:c,stepY:f,labelAngles:h,xLabels:ee,yLabels:K,debug:Z})})]}),o.tooltips.show&&C&&le.jsx(oc,{content:S4t(C,s,D==null?void 0:D.content),x:n.x(String(C.x))+c/2,y:n.y(String(C.y))+f/2,offset:re.length>1?c/2:0,active:!0,sideDistances:G,container:b})]})}function k4t({margins:e,captionsSizes:t,settingsId:n,chartSettings:r,chartSizes:a,chartsDimensions:i,facetKeys:o,scales:s,colorScale:c,sizeScale:f,groupedCells:A,cellsMeta:h,step:m,legend:g,aes:b,columnsCount:C,labelAngles:x}){let[k,_]=Vn.useState(),D=Vn.useRef(null);Vn.useEffect(()=>{D.current&&_(D.current)},[]);let O=i[o[0]].padding,I=i[o[C-1]].padding,$=e.left+a.chartsWidth+BZ,Q=e.top+O.top;return le.jsx(f2,{dataId:n,children:le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${a.totalWidth} ${a.totalHeight}`,width:a.totalWidth,height:a.totalHeight,fontFamily:"Manrope",children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${e.left},${e.top})`,children:[le.jsx(d2,{title:[r.title.name],show:r.title.show,position:r.title.position,leftPadding:O.left,rightPadding:I.right,chartsWidth:a.chartsWidth}),o.map(ee=>{let{cells:K}=A[ee];return le.jsx(B4t,{captionsSizes:t,facetKey:ee,dimensions:i[ee],scales:s,cells:K,cellsMeta:h,stepX:m.x,stepY:m.y,colorScale:c,sizeScale:f,chartSettings:r,aes:b,labelAngles:x,margins:e,chartSizes:a,tooltipsContainer:k},ee)})]}),le.jsx("g",{transform:`translate(${$},${Q})`,children:le.jsx(y9,{legendData:g})}),le.jsx("g",{ref:D})]})})}var T4t=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r){let o=e%2===0?[]:[n];for(let s=1;s<e/2+1;s++)o.push(n+s),o.unshift(n-s);return o}if(e<2)return[n,r];let a=(r-n)/(e-1),i=[];for(let o=0;o<e-1;o++)i.push(n+a*o);return i.push(r),i};function _4t(e,t,n){let r=n;return e&&(e.colorRange&&(r=e.colorRange),e.method==="standardScaling"&&(r=[-2,2]),e.method==="meanNormalization"&&(r=[-.75,.75])),T4t(t,r)}var P4t=class{constructor(){Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"component",le.jsx(le.Fragment,{}));Me(this,"chartsDimensions",{});Me(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Me(this,"margins",{top:Mg,bottom:Mg,left:Mg,right:Mg});Me(this,"captionsSizes",{xAxisCaptions:100,yAxisCaptions:100,xCaptionTail:0,yCaptionTail:0});Me(this,"labelAngles",{xAxisLabels:0,yAxisLabels:0});Me(this,"columnsCount",1);Me(this,"rowsCount",1);Me(this,"scales",{x:Hl().domain(["null"]).range([1]),y:Hl().domain(["null"]).range([1])});Me(this,"step",{x:10,y:10});Me(this,"colorScale",Da().domain([0,1]).range(["white","black"]));Me(this,"sizeScale",Ny().domain([0,1]).range([3,20]));Me(this,"legend",{width:0,height:0,items:[]})}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=zh(this.rootNode))}updateMargins(e){this.margins={top:e.show?24+24*2:Mg,bottom:Mg,left:Mg,right:this.legend.width},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartsHeight+this.margins.bottom,this.legend.height)}updateLegendSize(e,t,n){if(!e.show){this.legend={width:0,height:0,items:[]};return}let r=[],a=this.chartSizes.chartHeight,i=Math.min(this.chartSizes.chartHeight,350),o={width:0,height:0,left:0,top:0},s=this.colorScale.domain(),c=a2(this.colorScale,[s[0],s[s.length-1]]),f=t.label??t.value,A=Da([c[0],c[c.length-1]],[i,0]);r.push({id:"colorValue",type:"continuous",scale:this.colorScale,tickPositionScale:A,values:c,title:f,...o});let h=n.label??n.value,m=this.sizeScale.ticks(3),g=this.sizeScale.tickFormat(3),b=m.reduce((_,D)=>(_[String(D)]=g(D),_),{});if(r.push({id:"sizeValue",type:"size",title:h,scale:this.sizeScale,values:m,labels:b,...o}),!r.length){this.legend={width:0,height:0,items:[]};return}let C=w9(r,a,i),x=C[C.length-1],k=x.left+x.width+2*BZ;this.legend={width:k,height:a,items:C}}updateCaptionsSize(e,t,n){let r=new Dc("bold 14px Arial"),{xKeys:a,yKeys:i,xLabels:o,yLabels:s}=e.meta;this.labelAngles={xAxisLabels:t.axisLabelsAngle,yAxisLabels:n.axisLabelsAngle};let c=a.map(b=>r.getTextWidth(o[b])),f=i.map(b=>r.getTextWidth(s[b])),{xCaptionTail:A,yCaptionTail:h}=E4t(this.labelAngles,this.step,e,r),m=this.labelAngles.xAxisLabels/180*Math.PI,g=this.labelAngles.yAxisLabels/180*Math.PI;this.captionsSizes={xCaptionTail:A,yCaptionTail:h,xAxisCaptions:Math.max(...c,0)*Math.sin(m)||iE,yAxisCaptions:Math.max(...f,0)*Math.sin(g)||iE}}updateChartDimensions(e,t,n,r){let a=e.length,i=Math.min(t.nRows??a,a),o=Math.min(t.nCols??a,a);this.columnsCount=t.nRows?Math.ceil(a/i):o,this.rowsCount=Math.ceil(a/this.columnsCount),this.chartsDimensions={};let s=0,c=0;e.forEach((h,m)=>{let g=m%this.columnsCount+1,b=zK(m,e.length,this.columnsCount,this.rowsCount),C=this.chartSizes.chartWidth,x=this.chartSizes.chartHeight,k=C4t(n,r,this.captionsSizes,b,e,this.step.x,this.step.y);function _(Q){return Math.max(u1[Q].reduce((ee,K)=>ee+k[Q][K],0),v4t)}let D={left:_("left"),right:_("right"),top:_("top"),bottom:_("bottom")};D.left<this.captionsSizes.xCaptionTail&&(D.left=this.captionsSizes.xCaptionTail),D.bottom<this.captionsSizes.yCaptionTail&&(D.bottom=this.captionsSizes.yCaptionTail);let O=b4t(k,C,x),I=C+D.left+D.right,$=x+D.top+D.bottom;this.chartsDimensions[h]={left:s,top:c,inner:{width:C,height:x},outer:{width:I,height:$},padding:D,sideElementBBoxes:O,chartEdgeSides:b},s+=I,g===this.columnsCount&&(s=0,c+=$)});let f=e.slice(0,this.columnsCount).reduce((h,m)=>h+this.chartsDimensions[m].outer.width,0),A=e.filter((h,m)=>m%this.columnsCount===0).reduce((h,m)=>h+this.chartsDimensions[m].outer.height,0);this.chartSizes.chartsWidth=f,this.chartSizes.chartsHeight=A}updateChartsSizes(e,t){let{width:n,height:r,cellSize:a}=t;a&&(this.chartSizes.chartWidth=e.meta.xKeys.length*a,this.chartSizes.chartHeight=e.meta.yKeys.length*a),n&&r&&(this.chartSizes.chartWidth=n,this.chartSizes.chartHeight=r)}updateScales(e,t,n,r){let{width:a,height:i,cellSize:o}=t,{meta:s}=e,c=(b,C={})=>[...b].sort((x,k)=>n.sorting==="asc"?(C[x]??x).localeCompare(C[k]??k,"en",{numeric:!0}):(C[k]??k).localeCompare(C[x]??x,"en",{numeric:!0})),f=(b,C={})=>[...b].sort((x,k)=>r.sorting==="asc"?(C[x]??x).localeCompare(C[k]??k,"en",{numeric:!0}):(C[k]??k).localeCompare(C[x]??x,"en",{numeric:!0})),A=c(s.xKeys,s.xLabels),h=f(s.yKeys,s.yLabels);o?(this.step.x=o,this.step.y=o):a&&i&&(this.step.x=a/A.length,this.step.y=i/h.length);let m=new Array(A.length).fill(null).map((b,C)=>C*this.step.x),g=new Array(h.length).fill(null).map((b,C)=>C*this.step.y);this.scales.x=Hl().domain(A).range(m),this.scales.y=Hl().domain(h).range(g)}updateAesScale(e,t,n,r){this.colorScale=Da().domain(_4t(r,e.colorsList.length,n)).range(e.colorsList),this.sizeScale=Ny(t,[e.minRadius,e.maxRadius])}render(e,t,n,r,a,i,o,s,c){var _;let{meta:f,facets:A}=a,{valueExtentSize:h,valueExtentColor:m}=f,{xAxis:g,yAxis:b,title:C,size:x}=t;this.updateChartsSizes(a,x),this.updateAesScale(c,h,m,s),this.updateScales(a,x,t.xAxis,t.yAxis),this.updateCaptionsSize(a,g,b),this.updateChartDimensions(r,n,g,b),this.updateLegendSize(t.legend,i,o),this.updateMargins(C);let k=le.jsx(k4t,{aes:c,captionsSizes:this.captionsSizes,cellsMeta:f,columnsCount:this.columnsCount,chartsDimensions:this.chartsDimensions,chartSettings:t,chartSizes:this.chartSizes,sizeScale:this.sizeScale,colorScale:this.colorScale,facetKeys:r,facetSettings:n,groupedCells:A,labelAngles:this.labelAngles,legend:this.legend,margins:this.margins,scales:this.scales,settingsId:e,step:this.step});this.component=k,(_=this.reactRoot)==null||_.render(k)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},M4t=P4t,kZ=class{constructor(e){Me(this,"id");Me(this,"type","bubble");Me(this,"facetSettings");Me(this,"valueColumnSize");Me(this,"valueColumnColor");Me(this,"xColumn");Me(this,"yColumn");Me(this,"facetBy");Me(this,"normalization");Me(this,"NAValueAs");Me(this,"chartSettings");Me(this,"aes");var a,i,o,s,c,f,A,h,m,g;u2t.parse(e),this.id=Ir.uniqueId("settings"),this.facetSettings={titlePosition:"left",...e.facetSettings},this.facetBy=e.facetBy??[],this.valueColumnSize=e.valueSize,this.valueColumnColor=e.valueColor,this.xColumn=e.xColumn,this.yColumn=e.yColumn,this.NAValueAs=e.NAValueAs??null,this.normalization=e.normalization??null;let t=((a=e.size)==null?void 0:a.cellSize)??null,n=t?null:((i=e==null?void 0:e.size)==null?void 0:i.width)??(this.facetBy.length?400:600),r=t?null:((o=e==null?void 0:e.size)==null?void 0:o.height)??(this.facetBy.length?250:350);this.chartSettings={size:{width:n,height:r,cellSize:t},title:{position:"center",show:!0,...e.title,name:((s=e.title)==null?void 0:s.name)??"Chart"},yAxis:{title:e.yColumn.label??e.yColumn.value,showTicks:!0,showTitle:!0,showAxisLabels:!0,position:"left",axisLabelsAngle:90,sorting:"asc",...e.yAxis},xAxis:{title:e.xColumn.label??e.xColumn.value,showTicks:!0,showTitle:!0,showAxisLabels:!0,position:"bottom",axisLabelsAngle:90,sorting:"asc",...e.xAxis},frame:{type:((c=e.frame)==null?void 0:c.type)??"full"},legend:{show:!0,position:"right",...e.legend},tooltips:{show:!0,...e.tooltips}},this.aes={minRadius:((f=e.aes)==null?void 0:f.minRadius)??3,maxRadius:((A=e.aes)==null?void 0:A.maxRadius)??20,colorsList:((h=e.aes)==null?void 0:h.colorsList)??["black","white","red"],cellStrokeColor:((m=e.aes)==null?void 0:m.cellStrokeColor)??Zt,emptyCellColor:((g=e.aes)==null?void 0:g.emptyCellColor)??"white"}}},D4t=class extends Sg{constructor(t,n){super(t,n);Me(this,"settings");Me(this,"chartRenderer",new M4t);Me(this,"calculatedData",null);this.settings=new kZ(n)}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new kZ(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){console.warn("no chart state for bubble chart")}export(){return this._updateChart(),f3(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o;return t.facetBy.some((s,c)=>{var f;return s.value!==((f=n.facetBy[c])==null?void 0:f.value)})||((r=t.normalization)==null?void 0:r.method)!==((a=n.normalization)==null?void 0:a.method)||((i=t.normalization)==null?void 0:i.direction)!==((o=n.normalization)==null?void 0:o.direction)||t.xColumn.value!==n.xColumn.value||t.yColumn.value!==n.yColumn.value||t.valueColumnColor.value!==n.valueColumnColor.value||t.valueColumnSize.value!==n.valueColumnSize.value||t.NAValueAs!==n.NAValueAs}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{facetBy:t,xColumn:n,yColumn:r,valueColumnSize:a,valueColumnColor:i,normalization:o,NAValueAs:s}=this.settings,c=t.map(h=>this.data.getColumnCategories(h.value)),f=(c.length?nZ([...c]):[["null"]]).map(h=>h.join(", ")),A=t.map(h=>h.value)??null;this.data.setGrouping([...A]),this.calculatedData={facetKeys:f,groupedCellsData:m4t(this.data,n,r,a,i,t,f,c,o,s)}}_updateAesInData(){this.calculatedData}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,facetSettings:r,valueColumnColor:a,valueColumnSize:i,normalization:o,aes:s}=this.settings;this.chartRenderer.render(t,n,r,this.calculatedData.facetKeys,this.calculatedData.groupedCellsData,a,i,o,s)}};function H4t(e){return"type"in e&&e.type==="columns"}var TZ=class DI{constructor(t,n){Me(this,"id");Me(this,"data");Me(this,"rowsCount");Me(this,"columnNames");Me(this,"rowsGrouped");this.id=t,this.data=n,this.columnNames=Object.keys(n),this.rowsCount=this.columnNames.length?n[this.columnNames[0]].length:0}static from(t){if(t instanceof DI)return t;if(H4t(t))return new DI(t.id,t.values);vA(t,"Unknown input data format")}get rows(){let t=this.columnNames,n=[];for(let r=0;r<this.rowsCount;r++)n.push(t.reduce((a,i)=>(a[i]=this.data[i][r],a),{}));return n}getColumn(t){return this.data[t]}getColumnCategories(t){if(!this.columnNames.includes(t))throw new Error(`Column ${t} does not exist`);return Ir.uniq(this.getColumn(t)).map(String)}setGrouping(t){let n={grouped:{},rows:this.rows},r=[n];t.forEach(a=>{let i=a===null?["null"]:this.getColumnCategories(a),o=[];r.forEach(s=>{if(a===null)s.grouped={null:{rows:s.rows,grouped:{}}},o.push(s.grouped.null);else{let c=Ir.groupBy(s.rows,f=>String(f[a]));s.grouped=i.reduce((f,A)=>(f[A]={rows:c[A]??[],grouped:{}},o.push(f[A]),f),{})}}),r=o}),this.rowsGrouped=n.grouped}getColumnByGrouping(t,n){if(!this.rowsGrouped)return[];if(!t.length)return this.rows.map(a=>Number(a[n]));let r={grouped:this.rowsGrouped,rows:this.rows};return t.forEach(a=>{let i=r.grouped[a??"null"];if(!i)return[];r=i}),r.rows.map(a=>Number(a[n]))}getRowsByGrouping(t){if(!this.rowsGrouped)return[];if(!t.length)return this.rows;let n={grouped:this.rowsGrouped,rows:this.rows};return t.forEach(r=>{let a=n.grouped[r??"null"];if(!a)return[];n=a}),n==null?void 0:n.rows}},I4t=class HI{constructor(t){Me(this,"node");Me(this,"chart");this.chart=t}static createChart(t,n,r){let{type:a}=n;if(a==="discrete")return new G7t(t,n);if(a==="dendro")return new F2t(t,n,r);if(a==="scatterplot")return new R9t(t,n);if(a==="scatterplot-umap")return new d4t(t,n,r);if(a==="heatmap")return new Cwt(t,n);if(a==="histogram")return new jwt(t,n);if(a==="bubble")return new D4t(t,n);vA(a,`Unknown chart type: ${a}`)}static newPlot(t,n,r){let a=TZ.from(t);return new this(HI.createChart(a,n,r))}get calculatedData(){return this.chart.calculatedData}mount(t){this.node=t,this.chart.mount(t)}unmount(){delete this.node,this.chart.unmount()}updateSettingsAndData(t,n){if(n.type!==this.chart.settings.type){let r=HI.createChart(this.chart.data,n);this.node?(this.chart.unmount(),this.chart=r,this.chart.mount(this.node)):this.chart=r}else this.chart.updateSettingsAndData(TZ.from(t),n)}updateChartState(t,n){this.chart.updateChartState(t,n)}export(){return this.chart.export()}};/*! Bundled license information:
|
|
15190
|
+
${_.y+_.height/2})`,children:le.jsx("text",{transform:`rotate(${o.position==="left"?-90:90})`,dominantBaseline:"central",textAnchor:"middle",children:o.title})}),t&&le.jsx("rect",{x:_.x,y:_.y,width:_.width,height:_.height,stroke:Zt,fill:"none"}),k&&le.jsx("g",{fontSize:"14px",transform:`translate(${D.x},${D.y})`,children:r.map(O=>{let I=f.yAxisLabels!==0,$=o.position==="left",Q=-(90-f.yAxisLabels),ee=f.yAxisLabels===0?"middle":$?"end":"start",K=I?"central":$?"auto":"hanging",re=$?D.width:0,U=$?re-g:re+g,G=$?U-y2:U+y2,Z=a.y(O)+c/2;return le.jsxs("g",{children:[le.jsx("line",{x1:re,x2:U,y1:Z,y2:Z,stroke:Zt}),le.jsx("text",{x:G,y:Z,textAnchor:ee,transform:`rotate(${Q},${G},${Z})`,dominantBaseline:K,children:h[O]})]},O)})}),t&&le.jsx("rect",{x:D.x,y:D.y,height:D.height,width:D.width,stroke:Zt,fill:"none"})]})]})}function sE(e){if(e===null)return"null";if(typeof e=="number"){let t=e>0?Math.floor(e):Math.ceil(e),n=e-t;return t+Number(n.toPrecision(2))}return e}function S4t(e,t,n=[]){let r=e.data,a=[`X: ${t.xLabels[e.x]}`,`Y: ${t.yLabels[e.y]}`,`Value (color): ${sE(e.colorValue)}${e.colorValue!==e.normalizedColorValue?` (${sE(e.normalizedColorValue)})`:""}`,`Value (size): ${sE(e.sizeValue)}${e.sizeValue!==e.normalizedSizeValue?` (${sE(e.normalizedSizeValue)})`:""}`];for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function B4t({facetKey:e,dimensions:t,scales:n,cells:r,colorScale:a,sizeScale:i,chartSettings:o,cellsMeta:s,stepX:c,stepY:f,aes:A,labelAngles:h,chartSizes:m,margins:g,tooltipsContainer:b}){let[C,x]=Vn.useState(null),{xAxis:k,yAxis:_,tooltips:D}=o,{width:O,height:I}=t.inner,{padding:$,sideElementBBoxes:Q}=t,{xLabels:ee,yLabels:K}=s,re=n.x.domain(),U=n.y.domain(),G={left:g.left+t.left+$.left,right:m.totalWidth-(g.left+t.left+$.left),top:g.top+t.top+$.top,bottom:m.totalHeight-(g.top+t.top+$.top)},Z=!1;return le.jsxs("g",{transform:`translate(${t.left},${t.top})`,fontSize:w4t,children:[le.jsxs("g",{transform:`translate(${$.left},${$.top})`,children:[Q.top.facetTitle.isVisible&&le.jsx("text",{x:Q.top.facetTitle.x,y:Q.top.facetTitle.y+Q.top.facetTitle.height-y4t,fontWeight:"500",fontSize:"20px",children:s.facetKeyValues[e].join(", ")}),Z,re.map(Y=>U.map(X=>{var me;let oe=(me=r==null?void 0:r[Y])==null?void 0:me[X];return oe?le.jsx("circle",{cx:n.x(Y)+c/2,cy:n.y(X)+f/2,r:i(oe.normalizedSizeValue),stroke:A.cellStrokeColor,fill:oe.colorValue===null?A.emptyCellColor:a(oe.normalizedColorValue),onMouseOver:()=>x(oe),onMouseLeave:()=>x(null)},oe?oe.id:`${Y}_${X}`):null})),le.jsx("g",{children:o.frame.type==="full"&&le.jsx("rect",{fill:"none",stroke:Zt,x:"0",y:"0",width:O,height:I})}),le.jsx("g",{fontWeight:"500",children:le.jsx(x4t,{sideElementBBoxes:Q,xKeys:re,yKeys:U,scales:n,xAxis:k,yAxis:_,stepX:c,stepY:f,labelAngles:h,xLabels:ee,yLabels:K,debug:Z})})]}),o.tooltips.show&&C&&le.jsx(oc,{content:S4t(C,s,D==null?void 0:D.content),x:n.x(String(C.x))+c/2,y:n.y(String(C.y))+f/2,offset:re.length>1?c/2:0,active:!0,sideDistances:G,container:b})]})}function k4t({margins:e,captionsSizes:t,settingsId:n,chartSettings:r,chartSizes:a,chartsDimensions:i,facetKeys:o,scales:s,colorScale:c,sizeScale:f,groupedCells:A,cellsMeta:h,step:m,legend:g,aes:b,columnsCount:C,labelAngles:x}){let[k,_]=Vn.useState(),D=Vn.useRef(null);Vn.useEffect(()=>{D.current&&_(D.current)},[]);let O=i[o[0]].padding,I=i[o[C-1]].padding,$=e.left+a.chartsWidth+BZ,Q=e.top+O.top;return le.jsx(f2,{dataId:n,children:le.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${a.totalWidth} ${a.totalHeight}`,width:a.totalWidth,height:a.totalHeight,fontFamily:"Manrope",children:[le.jsx("defs",{children:Tg}),le.jsxs("g",{transform:`translate(${e.left},${e.top})`,children:[le.jsx(d2,{title:[r.title.name],show:r.title.show,position:r.title.position,leftPadding:O.left,rightPadding:I.right,chartsWidth:a.chartsWidth}),o.map(ee=>{let{cells:K}=A[ee];return le.jsx(B4t,{captionsSizes:t,facetKey:ee,dimensions:i[ee],scales:s,cells:K,cellsMeta:h,stepX:m.x,stepY:m.y,colorScale:c,sizeScale:f,chartSettings:r,aes:b,labelAngles:x,margins:e,chartSizes:a,tooltipsContainer:k},ee)})]}),le.jsx("g",{transform:`translate(${$},${Q})`,children:le.jsx(y9,{legendData:g})}),le.jsx("g",{ref:D})]})})}var T4t=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r){let o=e%2===0?[]:[n];for(let s=1;s<e/2+1;s++)o.push(n+s),o.unshift(n-s);return o}if(e<2)return[n,r];let a=(r-n)/(e-1),i=[];for(let o=0;o<e-1;o++)i.push(n+a*o);return i.push(r),i};function _4t(e,t,n){let r=n;return e&&(e.colorRange&&(r=e.colorRange),e.method==="standardScaling"&&(r=[-2,2]),e.method==="meanNormalization"&&(r=[-.75,.75])),T4t(t,r)}var P4t=class{constructor(){Me(this,"reactRoot",null);Me(this,"parentNode",null);Me(this,"rootNode",null);Me(this,"component",le.jsx(le.Fragment,{}));Me(this,"chartsDimensions",{});Me(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Me(this,"margins",{top:Mg,bottom:Mg,left:Mg,right:Mg});Me(this,"captionsSizes",{xAxisCaptions:100,yAxisCaptions:100,xCaptionTail:0,yCaptionTail:0});Me(this,"labelAngles",{xAxisLabels:0,yAxisLabels:0});Me(this,"columnsCount",1);Me(this,"rowsCount",1);Me(this,"scales",{x:Hl().domain(["null"]).range([1]),y:Hl().domain(["null"]).range([1])});Me(this,"step",{x:10,y:10});Me(this,"colorScale",Da().domain([0,1]).range(["white","black"]));Me(this,"sizeScale",Ny().domain([0,1]).range([3,20]));Me(this,"legend",{width:0,height:0,items:[]})}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=zh(this.rootNode))}updateMargins(e){this.margins={top:e.show?24+24*2:Mg,bottom:Mg,left:Mg,right:this.legend.width},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartsHeight+this.margins.bottom,this.legend.height)}updateLegendSize(e,t,n){if(!e.show){this.legend={width:0,height:0,items:[]};return}let r=[],a=this.chartSizes.chartHeight,i=Math.min(this.chartSizes.chartHeight,350),o={width:0,height:0,left:0,top:0},s=this.colorScale.domain(),c=a2(this.colorScale,[s[0],s[s.length-1]]),f=t.label??t.value,A=Da([c[0],c[c.length-1]],[i,0]);r.push({id:"colorValue",type:"continuous",scale:this.colorScale,tickPositionScale:A,values:c,title:f,...o});let h=n.label??n.value,m=this.sizeScale.ticks(3),g=this.sizeScale.tickFormat(3),b=m.reduce((_,D)=>(_[String(D)]=g(D),_),{});if(r.push({id:"sizeValue",type:"size",title:h,scale:this.sizeScale,values:m,labels:b,...o}),!r.length){this.legend={width:0,height:0,items:[]};return}let C=w9(r,a,i),x=C[C.length-1],k=x.left+x.width+2*BZ;this.legend={width:k,height:a,items:C}}updateCaptionsSize(e,t,n){let r=new Dc("bold 14px Arial"),{xKeys:a,yKeys:i,xLabels:o,yLabels:s}=e.meta;this.labelAngles={xAxisLabels:t.axisLabelsAngle,yAxisLabels:n.axisLabelsAngle};let c=a.map(b=>r.getTextWidth(o[b])),f=i.map(b=>r.getTextWidth(s[b])),{xCaptionTail:A,yCaptionTail:h}=E4t(this.labelAngles,this.step,e,r),m=this.labelAngles.xAxisLabels/180*Math.PI,g=this.labelAngles.yAxisLabels/180*Math.PI;this.captionsSizes={xCaptionTail:A,yCaptionTail:h,xAxisCaptions:Math.max(...c,0)*Math.sin(m)||iE,yAxisCaptions:Math.max(...f,0)*Math.sin(g)||iE}}updateChartDimensions(e,t,n,r){let a=e.length,i=Math.min(t.nRows??a,a),o=Math.min(t.nCols??a,a);this.columnsCount=t.nRows?Math.ceil(a/i):o,this.rowsCount=Math.ceil(a/this.columnsCount),this.chartsDimensions={};let s=0,c=0;e.forEach((h,m)=>{let g=m%this.columnsCount+1,b=zK(m,e.length,this.columnsCount,this.rowsCount),C=this.chartSizes.chartWidth,x=this.chartSizes.chartHeight,k=C4t(n,r,this.captionsSizes,b,e,this.step.x,this.step.y);function _(Q){return Math.max(u1[Q].reduce((ee,K)=>ee+k[Q][K],0),v4t)}let D={left:_("left"),right:_("right"),top:_("top"),bottom:_("bottom")};D.left<this.captionsSizes.xCaptionTail&&(D.left=this.captionsSizes.xCaptionTail),D.bottom<this.captionsSizes.yCaptionTail&&(D.bottom=this.captionsSizes.yCaptionTail);let O=b4t(k,C,x),I=C+D.left+D.right,$=x+D.top+D.bottom;this.chartsDimensions[h]={left:s,top:c,inner:{width:C,height:x},outer:{width:I,height:$},padding:D,sideElementBBoxes:O,chartEdgeSides:b},s+=I,g===this.columnsCount&&(s=0,c+=$)});let f=e.slice(0,this.columnsCount).reduce((h,m)=>h+this.chartsDimensions[m].outer.width,0),A=e.filter((h,m)=>m%this.columnsCount===0).reduce((h,m)=>h+this.chartsDimensions[m].outer.height,0);this.chartSizes.chartsWidth=f,this.chartSizes.chartsHeight=A}updateChartsSizes(e,t){let{width:n,height:r,cellSize:a}=t;a&&(this.chartSizes.chartWidth=e.meta.xKeys.length*a,this.chartSizes.chartHeight=e.meta.yKeys.length*a),n&&r&&(this.chartSizes.chartWidth=n,this.chartSizes.chartHeight=r)}updateScales(e,t,n,r){let{width:a,height:i,cellSize:o}=t,{meta:s}=e,c=(b,C={})=>[...b].sort((x,k)=>n.sorting==="asc"?(C[x]??x).localeCompare(C[k]??k,"en",{numeric:!0}):(C[k]??k).localeCompare(C[x]??x,"en",{numeric:!0})),f=(b,C={})=>[...b].sort((x,k)=>r.sorting==="asc"?(C[x]??x).localeCompare(C[k]??k,"en",{numeric:!0}):(C[k]??k).localeCompare(C[x]??x,"en",{numeric:!0})),A=c(s.xKeys,s.xLabels),h=f(s.yKeys,s.yLabels);o?(this.step.x=o,this.step.y=o):a&&i&&(this.step.x=a/A.length,this.step.y=i/h.length);let m=new Array(A.length).fill(null).map((b,C)=>C*this.step.x),g=new Array(h.length).fill(null).map((b,C)=>C*this.step.y);this.scales.x=Hl().domain(A).range(m),this.scales.y=Hl().domain(h).range(g)}updateAesScale(e,t,n,r){this.colorScale=Da().domain(_4t(r,e.colorsList.length,n)).range(e.colorsList),this.sizeScale=Ny(t,[e.minRadius,e.maxRadius])}render(e,t,n,r,a,i,o,s,c){var _;let{meta:f,facets:A}=a,{valueExtentSize:h,valueExtentColor:m}=f,{xAxis:g,yAxis:b,title:C,size:x}=t;this.updateChartsSizes(a,x),this.updateAesScale(c,h,m,s),this.updateScales(a,x,t.xAxis,t.yAxis),this.updateCaptionsSize(a,g,b),this.updateChartDimensions(r,n,g,b),this.updateLegendSize(t.legend,i,o),this.updateMargins(C);let k=le.jsx(k4t,{aes:c,captionsSizes:this.captionsSizes,cellsMeta:f,columnsCount:this.columnsCount,chartsDimensions:this.chartsDimensions,chartSettings:t,chartSizes:this.chartSizes,sizeScale:this.sizeScale,colorScale:this.colorScale,facetKeys:r,facetSettings:n,groupedCells:A,labelAngles:this.labelAngles,legend:this.legend,margins:this.margins,scales:this.scales,settingsId:e,step:this.step});this.component=k,(_=this.reactRoot)==null||_.render(k)}renderError(e){var t;(t=this.reactRoot)==null||t.render(le.jsx(Fm,{message:e}))}},M4t=P4t,kZ=class{constructor(e){Me(this,"id");Me(this,"type","bubble");Me(this,"facetSettings");Me(this,"valueColumnSize");Me(this,"valueColumnColor");Me(this,"xColumn");Me(this,"yColumn");Me(this,"facetBy");Me(this,"normalization");Me(this,"NAValueAs");Me(this,"chartSettings");Me(this,"aes");var a,i,o,s,c,f,A,h,m,g;u2t.parse(e),this.id=Ir.uniqueId("settings"),this.facetSettings={titlePosition:"left",...e.facetSettings},this.facetBy=e.facetBy??[],this.valueColumnSize=e.valueSize,this.valueColumnColor=e.valueColor,this.xColumn=e.xColumn,this.yColumn=e.yColumn,this.NAValueAs=e.NAValueAs??null,this.normalization=e.normalization??null;let t=((a=e.size)==null?void 0:a.cellSize)??null,n=t?null:((i=e==null?void 0:e.size)==null?void 0:i.width)??(this.facetBy.length?400:600),r=t?null:((o=e==null?void 0:e.size)==null?void 0:o.height)??(this.facetBy.length?250:350);this.chartSettings={size:{width:n,height:r,cellSize:t},title:{position:"center",show:!0,...e.title,name:((s=e.title)==null?void 0:s.name)??"Chart"},yAxis:{title:e.yColumn.label??e.yColumn.value,showTicks:!0,showTitle:!0,showAxisLabels:!0,position:"left",axisLabelsAngle:90,sorting:"asc",...e.yAxis},xAxis:{title:e.xColumn.label??e.xColumn.value,showTicks:!0,showTitle:!0,showAxisLabels:!0,position:"bottom",axisLabelsAngle:90,sorting:"asc",...e.xAxis},frame:{type:((c=e.frame)==null?void 0:c.type)??"full"},legend:{show:!0,position:"right",...e.legend},tooltips:{show:!0,...e.tooltips}},this.aes={minRadius:((f=e.aes)==null?void 0:f.minRadius)??3,maxRadius:((A=e.aes)==null?void 0:A.maxRadius)??20,colorsList:((h=e.aes)==null?void 0:h.colorsList)??["black","white","red"],cellStrokeColor:((m=e.aes)==null?void 0:m.cellStrokeColor)??Zt,emptyCellColor:((g=e.aes)==null?void 0:g.emptyCellColor)??"white"}}},D4t=class extends Sg{constructor(t,n){super(t,n);Me(this,"settings");Me(this,"chartRenderer",new M4t);Me(this,"calculatedData",null);this.settings=new kZ(n)}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new kZ(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){console.warn("no chart state for bubble chart")}export(){return this._updateChart(),f3(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o;return t.facetBy.some((s,c)=>{var f;return s.value!==((f=n.facetBy[c])==null?void 0:f.value)})||((r=t.normalization)==null?void 0:r.method)!==((a=n.normalization)==null?void 0:a.method)||((i=t.normalization)==null?void 0:i.direction)!==((o=n.normalization)==null?void 0:o.direction)||t.xColumn.value!==n.xColumn.value||t.yColumn.value!==n.yColumn.value||t.valueColumnColor.value!==n.valueColumnColor.value||t.valueColumnSize.value!==n.valueColumnSize.value||t.NAValueAs!==n.NAValueAs}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{facetBy:t,xColumn:n,yColumn:r,valueColumnSize:a,valueColumnColor:i,normalization:o,NAValueAs:s}=this.settings,c=t.map(m=>this.data.getColumnCategories(m.value)),f=c.length?nZ([...c]):[["null"]],A=t.map(m=>m.value)??null;this.data.setGrouping([...A]);let h=m4t(this.data,n,r,a,i,t,f,o,s);this.calculatedData={facetKeys:h.meta.facetKeys,groupedCellsData:h}}_updateAesInData(){this.calculatedData}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,facetSettings:r,valueColumnColor:a,valueColumnSize:i,normalization:o,aes:s}=this.settings;this.chartRenderer.render(t,n,r,this.calculatedData.facetKeys,this.calculatedData.groupedCellsData,a,i,o,s)}};function H4t(e){return"type"in e&&e.type==="columns"}var TZ=class DI{constructor(t,n){Me(this,"id");Me(this,"data");Me(this,"rowsCount");Me(this,"columnNames");Me(this,"rowsGrouped");this.id=t,this.data=n,this.columnNames=Object.keys(n),this.rowsCount=this.columnNames.length?n[this.columnNames[0]].length:0}static from(t){if(t instanceof DI)return t;if(H4t(t))return new DI(t.id,t.values);vA(t,"Unknown input data format")}get rows(){let t=this.columnNames,n=[];for(let r=0;r<this.rowsCount;r++)n.push(t.reduce((a,i)=>(a[i]=this.data[i][r],a),{}));return n}getColumn(t){return this.data[t]}getColumnCategories(t){if(!this.columnNames.includes(t))throw new Error(`Column ${t} does not exist`);return Ir.uniq(this.getColumn(t)).map(String)}setGrouping(t){let n={grouped:{},rows:this.rows},r=[n];t.forEach(a=>{let i=a===null?["null"]:this.getColumnCategories(a),o=[];r.forEach(s=>{if(a===null)s.grouped={null:{rows:s.rows,grouped:{}}},o.push(s.grouped.null);else{let c=Ir.groupBy(s.rows,f=>String(f[a]));s.grouped=i.reduce((f,A)=>(f[A]={rows:c[A]??[],grouped:{}},o.push(f[A]),f),{})}}),r=o}),this.rowsGrouped=n.grouped}getColumnByGrouping(t,n){if(!this.rowsGrouped)return[];if(!t.length)return this.rows.map(a=>Number(a[n]));let r={grouped:this.rowsGrouped,rows:this.rows};return t.forEach(a=>{let i=r.grouped[a??"null"];if(!i)return[];r=i}),r.rows.map(a=>Number(a[n]))}getRowsByGrouping(t){if(!this.rowsGrouped)return[];if(!t.length)return this.rows;let n={grouped:this.rowsGrouped,rows:this.rows};return t.forEach(r=>{let a=n.grouped[r??"null"];if(!a)return[];n=a}),n==null?void 0:n.rows}},I4t=class HI{constructor(t){Me(this,"node");Me(this,"chart");this.chart=t}static createChart(t,n,r){let{type:a}=n;if(a==="discrete")return new G7t(t,n);if(a==="dendro")return new F2t(t,n,r);if(a==="scatterplot")return new R9t(t,n);if(a==="scatterplot-umap")return new d4t(t,n,r);if(a==="heatmap")return new Cwt(t,n);if(a==="histogram")return new jwt(t,n);if(a==="bubble")return new D4t(t,n);vA(a,`Unknown chart type: ${a}`)}static newPlot(t,n,r){let a=TZ.from(t);return new this(HI.createChart(a,n,r))}get calculatedData(){return this.chart.calculatedData}mount(t){this.node=t,this.chart.mount(t)}unmount(){delete this.node,this.chart.unmount()}updateSettingsAndData(t,n){if(n.type!==this.chart.settings.type){let r=HI.createChart(this.chart.data,n);this.node?(this.chart.unmount(),this.chart=r,this.chart.mount(this.node)):this.chart=r}else this.chart.updateSettingsAndData(TZ.from(t),n)}updateChartState(t,n){this.chart.updateChartState(t,n)}export(){return this.chart.export()}};/*! Bundled license information:
|
|
15191
15191
|
|
|
15192
15192
|
@stdlib/utils-define-property/lib/define_property.js:
|
|
15193
15193
|
(**
|