@nocobase/plugin-data-visualization 0.21.0-alpha.2 → 0.21.0-alpha.4

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.
@@ -1,4 +1,4 @@
1
- (function(ct,z){typeof exports=="object"&&typeof module!="undefined"?z(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("react"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@formily/core"),require("@formily/react"),require("antd"),require("lodash"),require("react-i18next"),require("dayjs"),require("@formily/shared"),require("ahooks"),require("@nocobase/utils/client"),require("@emotion/css")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","react","@ant-design/icons","@formily/antd-v5","@formily/core","@formily/react","antd","lodash","react-i18next","dayjs","@formily/shared","ahooks","@nocobase/utils/client","@emotion/css"],z):(ct=typeof globalThis!="undefined"?globalThis:ct||self,z(ct["@nocobase/plugin-data-visualization"]={},ct["@nocobase/client"],ct.jsxRuntime,ct.react,ct["@ant-design/icons"],ct["@formily/antd-v5"],ct["@formily/core"],ct["@formily/react"],ct.antd,ct.lodash,ct["react-i18next"],ct.dayjs,ct["@formily/shared"],ct.ahooks,ct["@nocobase/utils"],ct["@emotion/css"]))})(this,function(ct,z,Y,q,Nn,me,wn,vt,Ot,nn,Ey,hn,Ya,Ei,My,nl){"use strict";var MMt=Object.defineProperty,PMt=Object.defineProperties;var AMt=Object.getOwnPropertyDescriptors;var Sy=Object.getOwnPropertySymbols;var eB=Object.prototype.hasOwnProperty,nB=Object.prototype.propertyIsEnumerable;var CS=(ct,z)=>(z=Symbol[ct])?z:Symbol.for("Symbol."+ct),Ce=Math.pow,TS=(ct,z,Y)=>z in ct?MMt(ct,z,{enumerable:!0,configurable:!0,writable:!0,value:Y}):ct[z]=Y,rt=(ct,z)=>{for(var Y in z||(z={}))eB.call(z,Y)&&TS(ct,Y,z[Y]);if(Sy)for(var Y of Sy(z))nB.call(z,Y)&&TS(ct,Y,z[Y]);return ct},bt=(ct,z)=>PMt(ct,AMt(z));var rB=(ct,z)=>{var Y={};for(var q in ct)eB.call(ct,q)&&z.indexOf(q)<0&&(Y[q]=ct[q]);if(ct!=null&&Sy)for(var q of Sy(ct))z.indexOf(q)<0&&nB.call(ct,q)&&(Y[q]=ct[q]);return Y};var ni=(ct,z,Y)=>(TS(ct,typeof z!="symbol"?z+"":z,Y),Y);var Cr=(ct,z,Y)=>new Promise((q,Nn)=>{var me=Ot=>{try{vt(Y.next(Ot))}catch(nn){Nn(nn)}},wn=Ot=>{try{vt(Y.throw(Ot))}catch(nn){Nn(nn)}},vt=Ot=>Ot.done?q(Ot.value):Promise.resolve(Ot.value).then(me,wn);vt((Y=Y.apply(ct,z)).next())}),CMt=function(ct,z){this[0]=ct,this[1]=z};var iB=ct=>{var z=ct[CS("asyncIterator")],Y=!1,q,Nn={};return z==null?(z=ct[CS("iterator")](),q=me=>Nn[me]=wn=>z[me](wn)):(z=z.call(ct),q=me=>Nn[me]=wn=>{if(Y){if(Y=!1,me==="throw")throw wn;return wn}return Y=!0,{done:!1,value:new CMt(new Promise(vt=>{var Ot=z[me](wn);if(!(Ot instanceof Object))throw TypeError("Object expected");vt(Ot)}),1)}}),Nn[CS("iterator")]=()=>Nn,q("next"),"throw"in z?q("throw"):Nn.throw=me=>{throw me},"return"in z&&q("return"),Nn};function wB(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const kS="data-visualization";function It(t){return z.i18n.t(t,{ns:[kS,"client"]})}function ae(){return Ey.useTranslation([kS,"client"],{nsMode:"fallback"})}const Py={datetime:[{label:It("YYYY"),value:"YYYY"},{label:It("MM"),value:"MM"},{label:It("DD"),value:"DD"},{label:It("YYYY-MM"),value:"YYYY-MM"},{label:It("YYYY-MM-DD"),value:"YYYY-MM-DD"},{label:It("YYYY-MM-DD hh:mm"),value:"YYYY-MM-DD hh:mm"},{label:It("YYYY-MM-DD hh:mm:ss"),value:"YYYY-MM-DD hh:mm:ss"}],date:[{label:It("YYYY"),value:"YYYY"},{label:It("MM"),value:"MM"},{label:It("DD"),value:"DD"},{label:It("YYYY-MM"),value:"YYYY-MM"},{label:It("YYYY-MM-DD"),value:"YYYY-MM-DD"}],time:[{label:It("hh:mm:ss"),value:"hh:mm:ss"},{label:It("hh:mm"),value:"hh:mm"},{label:It("hh"),value:"hh"}]},OB=q.createContext(null),Ay={didCatch:!1,error:null};let LS=class extends q.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Ay}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var n,r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(Ay)}}componentDidCatch(e,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,e,n)}componentDidUpdate(e,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&_B(e.resetKeys,i)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(Ay)}}render(){const{children:e,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=e;if(o){const l={error:a,resetErrorBoundary:this.resetErrorBoundary};if(q.isValidElement(i))s=i;else if(typeof n=="function")s=n(l);else if(r)s=q.createElement(r,l);else throw a}return q.createElement(OB.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}};function _B(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((n,r)=>!Object.is(n,e[r]))}const NS=(t,e={})=>{const{collection:n}=t;return{type:"void","x-decorator":"ChartRendererProvider","x-decorator-props":t,"x-acl-action":`${n}:list`,"x-designer":"ChartRenderer.Designer","x-component":"CardItem","x-component-props":{size:"small"},"x-initializer":"charts:addBlock",properties:{[Ya.uid()]:{type:"void","x-component":"ChartRenderer","x-component-props":e}}}},ou=t=>{let e,n;return Array.isArray(t)?t.length===1?n=t[0]:t.length>1&&([e,n]=t):n=t,{target:e,name:n,alias:e?`${e}.${n}`:n}},fh=(t,e)=>{var o,a;const{target:n,name:r}=ou(e);return n?(a=(o=t.find(s=>s.name===n))==null?void 0:o.targetFields)==null?void 0:a.find(s=>s.name===r):t.find(s=>s.name===r)},rl=(t,e)=>{const n=s=>s.map(l=>{const c=fh(t,l.field);return bt(rt({},c),{key:l.alias||(c==null?void 0:c.key),label:l.alias||(c==null?void 0:c.label),value:l.alias||(c==null?void 0:c.value)})}),r=e.measures||[],i=e.dimensions||[];return[...new Map([...n(r),...n(i)].map(s=>[s.value,s])).values()]},SB=(t,e,n)=>{const r=(i,o)=>{var l;const a=(l=i.uiSchema)==null?void 0:l.enum;if(!a||!Array.isArray(a))return o;const s=a.find(c=>c.value===o);return vt.Schema.compile((s==null?void 0:s.label)||o,n)};return e.map(i=>{const o={};return Object.entries(i).forEach(([a,s])=>{const l=t.find(c=>c.value===a);if(!l){o[a]=s;return}switch(l.interface){case"select":case"radioGroup":o[a]=r(l,s);break;default:o[a]=s}}),o})},Cy=t=>{if(typeof t=="object"&&t!==null)if(Array.isArray(t)){const e=t.map(n=>Cy(n)).filter(Boolean);return e.length>0?e:null}else{const e={};for(const n in t){const r=Cy(t[n]);r!=null&&!(typeof r=="object"&&Object.keys(r).length===0)&&(e[n]=r)}return Object.keys(e).length>0?e:null}else if(typeof t=="string"&&t.startsWith("{{$nFilter.")&&t.endsWith("}}"))return null;return t},EB=(t,e)=>{const n=e.split(".");let r=nn.get(t,n.slice(0,-1).join("."));return Array.isArray(r)?r=r.map(i=>nn.get(i,n.slice(-1)[0])):r=nn.get(r,n.slice(-1)[0]),r},MB=t=>({boolean:"Checkbox",integer:"InputNumber",bigInt:"InputNumber",double:"InputNumber",decimal:"InputNumber",date:"DatePicker",string:"Input"})[t],PB=t=>({boolean:"boolean",integer:"integer",bigInt:"integer",double:"number",decimal:"number",date:"datetime",string:"input"})[t],il=q.createContext({});il.displayName="ChartDataContext";const AB=t=>{const[e,n]=q.useState({}),r=Ei.useMemoizedFn((o,{dataSource:a,collection:s,service:l,query:c})=>{n(u=>bt(rt({},u),{[o]:{dataSource:a,collection:s,service:l,query:c}}))}),i=Ei.useMemoizedFn(o=>{n(a=>bt(rt({},a),{[o]:void 0}))});return Y.jsx(il.Provider,{value:{charts:e,addChart:r,removeChart:i},children:t.children})},Tr=q.createContext({});Tr.displayName="ChartFilterContext";const CB=t=>{const[e,n]=q.useState(!1),[r,i]=q.useState(!1),[o,a]=q.useState({}),[s,l]=q.useState({collapsed:!1,row:1}),[c,u]=q.useState(),f=Ei.useMemoizedFn((g,y)=>{a(m=>bt(rt({},m),{[g]:rt(rt({},m[g]||{}),y)}))}),d=Ei.useMemoizedFn(g=>{a(y=>{const m=rt({},y);return m[g]=void 0,m})}),h=Ei.useMemoizedFn(u),p=Ei.useMemoizedFn(i),v=({collapsed:g,row:y})=>{l(m=>({collapsed:g!==void 0?g:m.collapsed,row:y!==void 0?y:m.row}))};return q.useEffect(()=>n(!0),[]),Y.jsx(Tr.Provider,{value:{ready:e,enabled:r,setEnabled:p,fields:o,setField:f,removeField:d,collapse:s,setCollapse:v,form:c,setForm:h},children:t.children})},ri=q.createContext({});ri.displayName="ChartRendererContext";const IS=t=>{const{query:e,config:n,collection:r,transform:i,dataSource:o=z.DEFAULT_DATA_SOURCE_KEY}=t,{addChart:a}=q.useContext(il),{ready:s,form:l,enabled:c}=q.useContext(Tr),{getFilter:u,hasFilter:f,appendFilter:d}=al(),h=vt.useFieldSchema(),p=z.useAPIClient(),v=z.useRequest((g,y,m,b)=>new Promise((x,w)=>{var S;if(!(y&&((S=m==null?void 0:m.measures)!=null&&S.length))||c&&!l)return x(void 0);const O=u(),_=!b&&f({dataSource:g,collection:y,query:m},O)?d({dataSource:g,collection:y,query:m},O):m;p.request({url:"charts:query",method:"POST",data:bt(rt({uid:h==null?void 0:h["x-uid"],dataSource:g,collection:y},_),{filter:Cy(_.filter),dimensions:((m==null?void 0:m.dimensions)||[]).map(E=>{const M=rt({},E);if(E.format&&!E.alias){const{alias:P}=ou(E.field);M.alias=P}return M}),measures:((m==null?void 0:m.measures)||[]).map(E=>{const M=rt({},E);if(E.aggregation&&!E.alias){const{alias:P}=ou(E.field);M.alias=P}return M})})}).then(E=>{var M;x((M=E==null?void 0:E.data)==null?void 0:M.data)}).finally(()=>{!b&&(h!=null&&h["x-uid"])&&a(h==null?void 0:h["x-uid"],{dataSource:g,collection:y,service:v,query:m})}).catch(w)}),{defaultParams:[o,r,e],ready:s&&(!c||!!l)});return Y.jsx(z.CollectionManagerProvider,{dataSource:o,children:Y.jsx(z.MaybeCollectionProvider,{collection:r,children:Y.jsx(Ot.ConfigProvider,{card:{style:{boxShadow:"none"}},children:Y.jsx(ri.Provider,{value:{dataSource:o,collection:r,config:n,transform:i,service:v,query:e},children:t.children})})})})};class TB{constructor(){ni(this,"charts",new Map)}setGroup(e,n){this.charts.set(e,n)}addGroup(e,n){if(this.charts.has(e))throw new Error(`[data-visualization] Chart group "${e}" already exists`);this.setGroup(e,n)}add(e,n){var r;this.charts.has(e)||this.setGroup(e,[]),(r=this.charts.get(e))==null||r.push(n)}getChartTypes(){const e=[];this.charts.forEach((r,i)=>{const o=r.map(a=>({key:`${i}.${a.name}`,label:It(a.title),value:`${i}.${a.name}`}));e.push({label:It(i),children:o})});const n=e.findIndex(r=>r.label===It("Built-in"));if(n>-1){const[r]=e.splice(n,1);e.unshift(r)}return e}getCharts(){const e={};return this.charts.forEach((n,r)=>{n.forEach(i=>{e[`${r}.${i.name}`]=i})}),e}getChart(e){return this.getCharts()[e]}}const jS=()=>z.usePlugin(_y).charts.getChartTypes(),kB=()=>{var e,n,r;return(r=(n=(e=jS()[0])==null?void 0:e.children)==null?void 0:n[0])==null?void 0:r.value},$S=()=>z.usePlugin(_y).charts.getCharts(),LB=t=>z.usePlugin(_y).charts.getChart(t),{Paragraph:NB,Text:IB}=Ot.Typography,Ty=t=>{const{t:e}=ae(),n=q.useContext(ri),{config:r,transform:i,dataSource:o,collection:a,service:s,data:l}=n,c=Wa(o,a),u=FS(l,o,a),f=(r==null?void 0:r.general)||{},d=(r==null?void 0:r.advanced)||{},h=z.useAPIClient(),p=LB(r==null?void 0:r.chartType),v=h.auth.getLocale(),g=HB(i,v),y=p==null?void 0:p.getProps({data:u,general:f,advanced:d,fieldProps:Object.keys(u[0]||{}).reduce((b,x)=>{if(!b[x]){const w=fh(c,x.split(".")),O=g[x];b[x]={label:(w==null?void 0:w.label)||x,transformer:O,interface:w==null?void 0:w.interface}}return b},{})}),m=p==null?void 0:p.Component;return p?!(u&&u.length)&&!s.loading?Y.jsx(Ot.Empty,{image:Ot.Empty.PRESENTED_IMAGE_SIMPLE,description:e("No data")}):Y.jsx(Ot.Spin,{spinning:s.loading,children:Y.jsx(LS,{onError:b=>{console.error(b)},FallbackComponent:jB,children:Y.jsx(m,rt({},y))})}):Y.jsx(Ot.Empty,{image:Ot.Empty.PRESENTED_IMAGE_SIMPLE,description:e("Please configure chart")})};Ty.Designer=function(){const{t:e}=ae(),{setVisible:n,setCurrent:r}=q.useContext(Mi),{removeChart:i}=q.useContext(il),{service:o}=q.useContext(ri),a=vt.useField(),s=vt.useFieldSchema(),{insertAdjacent:l}=z.useDesignable(),c=z.useDataSource(),{name:u,title:f}=z.useCollection_deprecated();return Y.jsxs(z.GeneralSchemaDesigner,{disableInitializer:!0,title:f||u,children:[Y.jsx(z.SchemaSettingsItem,{title:"Configure",onClick:()=>Cr(this,null,function*(){r({schema:s,field:a,dataSource:c.key,collection:u,service:o,data:o.data}),n(!0)}),children:e("Configure")},"configure"),Y.jsx(z.SchemaSettingsItem,{title:"Duplicate",onClick:()=>l("afterEnd",z.gridRowColWrap(NS(s==null?void 0:s["x-decorator-props"]))),children:e("Duplicate")},"duplicate"),Y.jsx(z.SchemaSettingsBlockTitleItem,{}),Y.jsx(z.SchemaSettingsDivider,{}),Y.jsx(z.SchemaSettingsRemove,{breakRemoveOn:{"x-component":"ChartV2Block"},confirm:{onOk:()=>{i(s["x-uid"])}}})]})};const jB=({error:t})=>{const{t:e}=ae();return Y.jsx("div",{style:{backgroundColor:"white"},children:Y.jsx(Ot.Result,{status:"error",title:e("Render Failed"),subTitle:e("Please check the configuration."),children:Y.jsx(NB,{copyable:!0,children:Y.jsx(IB,{type:"danger",style:{whiteSpace:"pre-line",textAlign:"center"},children:t.message})})})})},au=t=>{const{current:e}=q.useContext(Mi),{dataSource:n=t||z.DEFAULT_DATA_SOURCE_KEY,collection:r}=e||{},i=z.useDataSourceManager(),o=i.getDataSource(n),a=i.collectionFieldInterfaceManager;return{cm:o==null?void 0:o.collectionManager,fim:a,collection:r}},$B=t=>(t||[]).filter(n=>n.interface).map(n=>{var r;return bt(rt({},n),{key:n.name,label:((r=n.uiSchema)==null?void 0:r.title)||n.name,value:n.name})}),Wa=(t,e)=>{const{t:n}=Ey.useTranslation(),{cm:r,fim:i,collection:o}=au(t),a=r.getCollectionFields(e||o),s=$B(a);return q.useMemo(()=>s.map(l=>{var d,h,p,v;const c=(d=i.getFieldInterface(l.interface))==null?void 0:d.filterable,u=vt.Schema.compile(((h=l.uiSchema)==null?void 0:h.title)||l.name,{t:n});if(!(c&&(c!=null&&c.nested||(p=c==null?void 0:c.children)!=null&&p.length)))return bt(rt({},l),{label:u});let f=[];if(c!=null&&c.nested){const g=(r.getCollectionFields(l.target)||[]).filter(y=>y.interface).map(y=>{var m;return bt(rt({},y),{key:`${l.name}.${y.name}`,label:`${u} / ${vt.Schema.compile(((m=y.uiSchema)==null?void 0:m.title)||y.name,{t:n})}`,value:`${l.name}.${y.name}`})});f=[...f,...g]}if((v=c==null?void 0:c.children)!=null&&v.length){const g=c.children.map(y=>{var m;return bt(rt({},y),{key:`${l.name}.${y.name}`,label:`${u} / ${vt.Schema.compile(((m=y.schema)==null?void 0:m.title)||y.title||y.name,{t:n})}`,value:`${l.name}.${y.name}`})});f=[...f,...g]}return bt(rt({},l),{label:u,targetFields:f})}),[s])},DS=t=>e=>{const n=e.query("query").get("value")||{},r=rl(t,n);e.dataSource=r},DB=t=>e=>{var o;const n=e.query(".field").get("value");if(!n){e.dataSource=[];return}let r=[];switch((o=fh(t,n))==null?void 0:o.interface){case"datetime":case"createdAt":case"updatedAt":r=Py.datetime;break;case"date":r=Py.date;break;case"time":r=Py.time;break;default:r=[]}e.dataSource=r},FB=()=>{const{t}=Ey.useTranslation(),e=z.useDataSourceManager(),{parseAction:n}=z.useACLRoleContext(),i=e.getAllCollections({filterCollection:o=>n(`${o.name}:list`)}).filter(({key:o,isDBInstance:a})=>o===z.DEFAULT_DATA_SOURCE_KEY||a).map(({key:o,displayName:a,collections:s})=>({value:o,label:a,children:s.map(l=>({value:l.name,label:l.title}))}));return q.useMemo(()=>vt.Schema.compile(i,{t}),[i])},RB=(t,e)=>n=>{const r=n.query("query").get("value")||{},{measures:i=[]}=r;if(!i.some(s=>s.aggregation)){n.componentProps.fieldNames={label:"title",value:"name",children:"children"},n.dataSource=t;return}const a=rl(e,r);n.componentProps.fieldNames={},n.dataSource=a},BB=(t,e)=>n=>{const r=n.query("query").get("value")||{},{measures:i=[]}=r,o=i.some(u=>u.aggregation);let a=t;const s=[];o?(a=rl(e,r),a.forEach(u=>{s.push(u.value)})):a.forEach(u=>{const f=u.children||[];f.length||s.push(u.value||u.name),f.forEach(d=>{s.push(`${u.name}.${d.name}`)})});const c=(n.value||[]).reduce((u,f)=>{const{alias:d}=ou(f.field);return(!f.field||s.includes(d))&&u.push(f),u},[]);n.setValue(c)},FS=(t,e,n)=>{var c;const{t:r}=ae(),{service:i,query:o}=q.useContext(ri),a=Wa(e,n),s=vt.useForm(),l=rl(a,((c=s==null?void 0:s.values)==null?void 0:c.query)||o);return SB(l,(i==null?void 0:i.data)||t||[],{t:r})},zB=(t,e,n=2,r=[])=>{const{cm:i,fim:o,collection:a}=au(t),l=i.getCollectionFields(e||a).filter(d=>!r.includes(d.interface)),c=(d,h,p)=>{var x;if(!d.interface)return;const v=o.getFieldInterface(d.interface);if(!(v!=null&&v.filterable))return;const{nested:g,children:y}=v.filterable,m=p?`${p}.${d.name}`:d.name,b=bt(rt({},d),{name:d.name,title:((x=d==null?void 0:d.uiSchema)==null?void 0:x.title)||d.name,schema:d==null?void 0:d.uiSchema,key:m});if(!(d.target&&h>n)){if(h>n)return b;if(y!=null&&y.length&&(b.children=y.map(w=>bt(rt({},w),{key:`${d.name}.${w.name}`}))),g){const w=i.getCollectionFields(d.target).filter(_=>!r.includes(_.interface)),O=u(w,h+1,d.name).filter(Boolean);b.children=b.children||[],b.children.push(...O)}return b}},u=(d,h,p)=>{const v=[];return d.forEach(g=>{const y=c(g,h,p);y&&v.push(y)}),v};return u(l,1)},YB=(t,e)=>{const{cm:n,fim:r,collection:i}=au(t);return q.useMemo(()=>{const o=n.getCollectionFields(e||i),a=(c,u)=>{var g,y;if(!c.interface)return;const f=r.getFieldInterface(c.interface);if(!(f!=null&&f.filterable))return;const{nested:d,children:h,operators:p}=f.filterable,v={name:c.name,title:((g=c==null?void 0:c.uiSchema)==null?void 0:g.title)||c.name,schema:c==null?void 0:c.uiSchema,operators:((y=p==null?void 0:p.filter)==null?void 0:y.call(p,m=>!(m!=null&&m.visible)||m.visible(c)))||[],interface:c.interface};if(!(c.target&&u>2)){if(u>2)return v;if(h!=null&&h.length&&(v.children=h),d){const m=n.getCollectionFields(c.target),b=s(m,u+1).filter(Boolean);v.children=v.children||[],v.children.push(...b)}return v}},s=(c,u)=>{const f=[];return c.forEach(d=>{const h=a(d,u);h&&f.push(h)}),f};return s(o,1)},[e,n,r])},ky={datetime:{YYYY:t=>hn(t).format("YYYY"),MM:t=>hn(t).format("MM"),DD:t=>hn(t).format("DD"),"YYYY-MM":t=>hn(t).format("YYYY-MM"),"YYYY-MM-DD":t=>hn(t).format("YYYY-MM-DD"),"YYYY-MM-DD hh:mm":t=>hn(t).format("YYYY-MM-DD hh:mm"),"YYYY-MM-DD hh:mm:ss":t=>hn(t).format("YYYY-MM-DD hh:mm:ss")},date:{YYYY:t=>hn(t).format("YYYY"),MM:t=>hn(t).format("MM"),DD:t=>hn(t).format("DD"),"YYYY-MM":t=>hn(t).format("YYYY-MM"),"YYYY-MM-DD":t=>hn(t).format("YYYY-MM-DD")},time:{"hh:mm:ss":t=>hn(t).format("hh:mm:ss"),"hh:mm":t=>hn(t).format("hh:mm"),hh:t=>hn(t).format("hh")},number:{Percent:t=>new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(t),Currency:(t,e="en-US")=>{const n={"zh-CN":"CNY","en-US":"USD","ja-JP":"JPY","ko-KR":"KRW","pt-BR":"BRL","ru-RU":"RUB","tr-TR":"TRY","es-ES":"EUR"}[e];return new Intl.NumberFormat(e,{style:"currency",currency:n}).format(t)},Exponential:t=>(+t).toExponential(),Abbreviation:(t,e="en-US")=>new Intl.NumberFormat(e,{notation:"compact"}).format(t)}},WB=t=>e=>{const n=e.query(".field").get("value"),r=e.query("query").get("value")||{},o=rl(t,r).find(f=>f.value===n),a=Object.keys(ky);e.dataSource=a.map(f=>({label:It(f),value:f}));const s={createdAt:"datetime",updatedAt:"datetime",double:"number",integer:"number",percent:"number"},l=o==null?void 0:o.interface,c=o==null?void 0:o.type,u=s[l]||s[c]||c;if(a.includes(u)){e.setState({value:u,disabled:!0});return}e.setState({value:null,disabled:!1})},GB=t=>{const e=t.query(".type").get("value");if(!e){t.dataSource=[];return}const n=Object.keys(ky[e]||{}).map(r=>({label:It(r),value:r}));t.dataSource=n},HB=(t,e="en-US")=>(t||[]).filter(n=>n.field&&n.type&&n.format).reduce((n,r)=>{const i=ky[r.type][r.format];return i&&(n[r.field]=o=>i(o,e)),n},{});function su(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var UB=function(e){return VB(e)&&!XB(e)};function VB(t){return!!t&&typeof t=="object"}function XB(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||ZB(t)}var qB=typeof Symbol=="function"&&Symbol.for,KB=qB?Symbol.for("react.element"):60103;function ZB(t){return t.$$typeof===KB}function QB(t){return Array.isArray(t)?[]:{}}function lu(t,e){return e.clone!==!1&&e.isMergeableObject(t)?ol(QB(t),t,e):t}function JB(t,e,n){return t.concat(e).map(function(r){return lu(r,n)})}function t7(t,e){if(!e.customMerge)return ol;var n=e.customMerge(t);return typeof n=="function"?n:ol}function e7(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function RS(t){return Object.keys(t).concat(e7(t))}function BS(t,e){try{return e in t}catch(n){return!1}}function n7(t,e){return BS(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function r7(t,e,n){var r={};return n.isMergeableObject(t)&&RS(t).forEach(function(i){r[i]=lu(t[i],n)}),RS(e).forEach(function(i){n7(t,i)||(BS(t,i)&&n.isMergeableObject(e[i])?r[i]=t7(i,n)(t[i],e[i],n):r[i]=lu(e[i],n))}),r}function ol(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||JB,n.isMergeableObject=n.isMergeableObject||UB,n.cloneUnlessOtherwiseSpecified=lu;var r=Array.isArray(e),i=Array.isArray(t),o=r===i;return o?r?n.arrayMerge(t,e,n):r7(t,e,n):lu(e,n)}ol.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,i){return ol(r,i,n)},{})};var i7=ol,o7=i7;const a7=su(o7),s7=()=>({title:'{{t("Options")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"object","x-decorator":"ArrayItems.Item",properties:{space:{type:"void","x-component":"Space",properties:{label:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Option label")}}'},required:!0},value:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Option value")}}'},required:!0},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:"Add","x-component":"ArrayItems.Addition"}}}),Ly=t=>{const e={type:"boolean","x-content":'{{ t("Show time") }}',"x-decorator":"FormItem","x-component":"Checkbox"},n={type:"string",title:'{{t("Date format")}}',"x-component":"Radio.Group","x-decorator":"FormItem",default:"YYYY-MM-DD",enum:[{label:'{{t("Year/Month/Day")}}',value:"YYYY/MM/DD"},{label:'{{t("Year-Month-Day")}}',value:"YYYY-MM-DD"},{label:'{{t("Day/Month/Year")}}',value:"DD/MM/YYYY"}]},r=s7();return{DatePicker:{type:"object",properties:{dateFormat:n,showTime:e}},"DatePicker.RangePicker":{type:"object",properties:{dateFormat:n,showTime:e}},Select:{type:"object",properties:{mode:{type:"string",enum:[{label:'{{ t("Single select") }}',value:""},{label:'{{ t("Multiple select") }}',value:"multiple"}],"x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{defaultValue:""}},options:r}},"Checkbox.Group":{type:"object",properties:{options:r}},"Radio.Group":{type:"object",properties:{options:r}}}[t]},l7=(t,e)=>{if(!t)return t;if(hn.isDayjs(t))return e.showTime||(t=t.startOf("day")),My.moment2str(t,e);if(Array.isArray(t)&&t.length&&hn.isDayjs(t[0])){let n=t[0],r=t[1];return e.showTime&&(n=n.startOf("day"),r=r.endOf("day")),[n.toISOString(),r.toISOString()]}return t},zS=(t,e)=>Cr(this,null,function*(){const n=t.initialValue;if(!(typeof n=="string"&&(n==null?void 0:n.startsWith("{{$"))&&(n==null?void 0:n.endsWith("}}")))||!e)t.setValue(n),t.setInitialValue(n);else{t.loading=!0;const i=yield e.parseVariable(n),o=l7(i,t.componentProps);t.setValue(o),t.setInitialValue(o),t.loading=!1}}),dh="-",cu=(t,e)=>t?`${t}${dh}${e}`:e,YS=t=>{const[e,n]=t.split(dh);return n?{dataSource:e,fieldName:n}:{dataSource:z.DEFAULT_DATA_SOURCE_KEY,fieldName:e}},Ny=(t,e,n)=>vt.Schema.isSchemaInstance(t)?t.reduceProperties((r,i)=>{let o=i[e];if(o.includes(dh)||(o=`${z.DEFAULT_DATA_SOURCE_KEY}${dh}${o}`),o===n)return i;if(i["x-component"]!=="Action.Container"&&i["x-component"]!=="AssociationField.Viewer"){const a=Ny(i,e,n);if(a)return a}return r}):null,Iy=()=>{const{charts:t}=q.useContext(il),e=q.useMemo(()=>Object.values(t).filter(i=>i).reduce((i,o)=>{var l;const{dataSource:a,collection:s}=o;return(l=i[a])!=null&&l.includes(s)||(i[a]=[...i[a]||[],s]),i},{}),[t]),n=q.useMemo(()=>Object.keys(e).length>1,[e]),r=q.useCallback((i,o)=>{var a;return((a=e[i])==null?void 0:a.includes(o))||!1},[e]);return{chartCollections:e,showDataSource:n,getIsChartCollectionExists:r}},al=()=>{const t=z.useDataSourceManager(),{charts:e}=q.useContext(il),{fieldSchema:n}=z.useActionContext(),r=n==null?void 0:n["x-action"],{fields:i,form:o}=q.useContext(Tr),a=({dataSource:h,collection:p,cm:v,fim:g})=>{const y=v.getCollectionFields(p.name),m=(_,S,E,M)=>{var j,L,I,D,F;const P=((j=_.uiSchema)==null?void 0:j.title)||_.name,C=g.getFieldInterface(_.interface),A=(I=(L=C==null?void 0:C.filterable)==null?void 0:L.operators)==null?void 0:I[0],T=v.getCollection(_.target);S=S?`${S} / ${P}`:P;let k={type:"string",title:S,name:`${E}.${_.name}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-component":"CollectionField","x-decorator":"ChartFilterFormItem","x-data-source":h,"x-collection-field":`${M}.${_.name}`,"x-component-props":bt(rt({},(D=_.uiSchema)==null?void 0:D["x-component-props"]),{"filter-operator":A})};if(_.interface==="formula"){const R=MB(_.dataType)||"Input";k=bt(rt({},k),{"x-component":R})}return["oho","o2m"].includes(_.interface)&&nn.set(k,"x-component-props.useOriginalFilter",!0),{key:`${E}.${_.name}`,name:_.name,type:"item",title:((F=_==null?void 0:_.uiSchema)==null?void 0:F.title)||_.name,Component:"CollectionFieldInitializer",find:Ny,remove:(R,B)=>{B(R,{breakRemoveOn:{"x-component":"Grid"}})},schemaInitialize:R=>{var B;(B=C==null?void 0:C.schemaInitialize)==null||B.call(C,R,{field:_,block:"FilterForm",readPretty:o.readPretty,action:r,targetCollection:T})},schema:k}},b=(_,S,E,M)=>{var k;const P=((k=_.uiSchema)==null?void 0:k.title)||_.name;S=S?`${S} / ${P}`:P;const C=_.operators[0];let A=bt(rt({type:"string",name:`${E}.${_.name}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-decorator":"ChartFilterFormItem","x-data-source":h,"x-collection-field":`${M}.${_.name}`},_.schema),{title:S,"x-component-props":{"filter-operator":C}});return C!=null&&C.noValue&&(A=bt(rt({},A),{"x-component":"ChartFilterCheckbox","x-component-props":bt(rt({},A["x-component-props"]),{content:vt.Schema.compile(C.label,{t:z.i18n.t})})})),{key:`${E}.${_.name}`,name:_.name,type:"item",title:_.title||_.name,Component:"CollectionFieldInitializer",find:Ny,remove:(N,j)=>{j(N,{breakRemoveOn:{"x-component":"Grid"}})},schema:A}},x=(_,S,E,M,P)=>{var j,L,I;if(!_.interface||_.isForeignKey)return;const C=g.getFieldInterface(_.interface);if(!(C!=null&&C.filterable))return;const{nested:A,children:T}=C.filterable,k=((j=_.uiSchema)==null?void 0:j.title)||_.name,N=m(_,E,M,P);if(!(_.target&&S>2)){if(E=E?`${E} / ${k}`:k,T!=null&&T.length&&!["chinaRegion","createdBy","updatedBy","attachment"].includes(_.interface)){const D=T.map(F=>b(F,E,`${M}.${_.name}`,`${P}.${_.name}`));return{key:`${M}.${_.name}`,name:_.name,type:"subMenu",title:((L=_==null?void 0:_.uiSchema)==null?void 0:L.title)||_.name,children:D}}if(!S||S>2)return N;if(A){const F=v.getCollectionFields(_.target).map(R=>x(R,S+1,"",`${M}.${_.name}`,`${P}.${_.name}`));return{key:`${M}.${_.name}`,name:_.name,type:"subMenu",title:((I=_==null?void 0:_.uiSchema)==null?void 0:I.title)||_.name,children:F.filter(Boolean)}}return N}},w=[],O=[];return y.forEach(_=>{const S=_.interface,E=x(_,0,"",cu(h,p.name),p.name);if(E&&w.push(E),["m2o"].includes(S)){const M=x(_,1,"",cu(h,p.name),p.name);M&&O.push(M)}}),O.length&&w.push({name:"divider",type:"divider"},{name:"displayAssociationFields",type:"itemGroup",title:z.i18n.t("Display association fields"),children:O}),w},s=()=>{const h=(o==null?void 0:o.values)||{},p={};return Object.entries(i).filter(([v,g])=>g).forEach(([v,g])=>{const{operator:y}=g||{},{dataSource:m,fieldName:b}=YS(v);let x=b;const _=t.getDataSource(m).collectionManager.getCollectionField(x);if(_!=null&&_.target){const C=_.targetKey||"id";x=`${x}.${C}`,v=`${v}.${C}`}const[S,...E]=x.split("."),M=EB(h,v),P=(y==null?void 0:y.value)||"$eq";if(S!=="custom"){const C=cu(m,S);p[C]=p[C]||{$and:[]};const A={};nn.set(A,E.join("."),{[P]:M}),p[C].$and.push(A)}else p[S]=p[S]||{},p[S][`$nFilter.${E.join(".")}`]=M}),p},l=(h,p)=>{if(!h)return!1;const{dataSource:v,collection:g,query:y}=h,{parameters:m}=My.parse(y.filter||"");return p[cu(v,g)]||p.custom&&(m==null?void 0:m.find(({key:b})=>nn.has(p.custom,b)))},c=(h,p)=>{const{dataSource:v,collection:g,query:y}=h;let m=rt({},y);const b=rt({},m.filter||{});let x={};const w=My.parse(b),{parameters:O}=w;return p.custom&&(O!=null&&O.find(_=>p.custom[_.key]))&&(x=w(p.custom)),x=a7(b,x),m=bt(rt({},m),{filter:{$and:[x,p[cu(v,g)]]}}),m},u=()=>Cr(this,null,function*(){const h=s(),p=Object.values(e).filter(v=>l(v,h)).map(v=>()=>Cr(this,null,function*(){const{dataSource:g,service:y,collection:m}=v;yield y.runAsync(g,m,c(v,h),!0)}));yield Promise.all(p.map(v=>v()))}),f=()=>Cr(this,null,function*(){const h=Object.values(e).filter(p=>p).map(p=>()=>Cr(this,null,function*(){const{service:v,dataSource:g,collection:y,query:m}=p;yield v.runAsync(g,y,m,!0)}));yield Promise.all(h.map(p=>p()))}),d=Ei.useMemoizedFn(h=>h.split(" / ").map(p=>z.i18n.t(vt.Schema.compile(p,{t:z.i18n.t}))).join(" / "));return{filter:u,refresh:f,getChartFilterFields:a,getFilter:s,hasFilter:l,appendFilter:c,getTranslatedTitle:d}},c7=()=>{const{t}=ae(),e=Ei.useMemoizedFn(t),{enabled:n,fields:r}=q.useContext(Tr),i=Object.entries(r).filter(([a,s])=>a.startsWith("custom.")&&s).map(([a,{title:s}])=>{const l=a.replace(/^custom\./,"");return{key:l,value:l,label:s}}),o=q.useMemo(()=>({label:e("Current filter"),value:"$nFilter",key:"$nFilter",children:i}),[i,e]);return!n||!i.length?null:o},WS=()=>{const{t}=ae(),{chartCollections:e}=Iy(),n=z.useDataSourceManager(),r=n.collectionFieldInterfaceManager,{values:i}=GS(),o=(a,s,l)=>{var d,h,p;if(!s.interface)return;const c=r.getFieldInterface(s.interface);if(!(c!=null&&c.filterable))return;const{nested:u}=c.filterable,f={value:s.name,label:t(((d=s==null?void 0:s.uiSchema)==null?void 0:d.title)||s.name)};if(!(s.target&&l>2)){if(l>2)return f;if(u){const g=a.getCollectionFields(s.target).map(y=>o(a,y,l+1));return{value:s.name,label:t(((h=s==null?void 0:s.uiSchema)==null?void 0:h.title)||s.name),children:g.filter(y=>y)}}if(!(!i.includes((p=s.uiSchema)==null?void 0:p["x-component"])&&!i.includes(s.interface)))return f}};return q.useMemo(()=>Object.entries(e).map(([s,l])=>{const c=n.getDataSource(s);return{value:s,label:vt.Schema.compile(c.displayName,{t}),children:l.map(u=>{const f=c.collectionManager,d=f.getCollection(u),p=f.getCollectionFields(u).map(v=>o(f,v,1)).filter(v=>v);return{value:u,label:vt.Schema.compile(d.title,{t}),children:p}})}}),[e])},GS=()=>{const{t}=ae(),e=[{label:t("Input"),value:"Input"},{label:t("Number"),value:"InputNumber"},{label:t("Date"),value:"DatePicker"},{label:t("Date range"),value:"DatePicker.RangePicker"},{label:t("Time"),value:"TimePicker"},{label:t("Time range"),value:"TimePicker.RangePicker"},{label:t("Select"),value:"Select"},{label:t("Radio group"),value:"Radio.Group"},{label:t("Checkbox group"),value:"Checkbox.Group"}];return{options:e,values:e.map(n=>n.value)}},u7=(t,e)=>{const{t:n}=ae(),r=z.useDataSourceManager(),{showDataSource:i}=Iy();return q.useMemo(()=>{var p;const o=r.getDataSource(t);if(!o)return;const a=o.collectionManager;if(!e)return;const{fieldName:s}=YS(e),[l,...c]=s.split(".");if(!(c!=null&&c.length))return;const u=a.getCollection(l);let f=l,d,h=vt.Schema.compile(u==null?void 0:u.title,{t:n});for(;f&&c.length>0;){const v=c.shift();d=a.getCollectionField(`${f}.${v}`);const g=((p=d==null?void 0:d.uiSchema)==null?void 0:p.title)||(d==null?void 0:d.name);g&&(h+=` / ${vt.Schema.compile(g,{t:n})}`),d!=null&&d.target?f=d.target:f=null}return i?`${vt.Schema.compile(o.displayName,{t:n})} > ${h}`:h},[e,t,i])},f7=()=>{const t=vt.useField(),{operator:e,schema:n}=t.data||{},{currentUserSettings:r}=z.useCurrentUserVariable({collectionField:{uiSchema:n},uiSchema:n}),{datetimeSettings:i}=z.useDatetimeVariable({operator:e,schema:n}),o=c7(),a=q.useMemo(()=>[r,i,o].filter(Boolean),[i,r,o]);return!e||!n?[]:a},hh=(t={},e={})=>bt(rt({type:"array","x-decorator":"FormItem","x-component":"ArrayItems"},e),{items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:bt(rt({sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"}},t),{remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}})}}},properties:{add:{type:"void",title:'{{t("Add field")}}',"x-component":"ArrayItems.Addition"}}}),d7=t=>({type:"void",properties:{config:{type:"object",properties:{chartType:{type:"string",title:'{{t("Chart type")}}',"x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Please select a chart type.")}}'},enum:"{{ chartTypes }}"},[Ya.uid()]:{type:"void",properties:{general:t}},[Ya.uid()]:{type:"void",properties:{advanced:{type:"json",title:'{{t("JSON config")}}',"x-decorator":"FormItem","x-decorator-props":{extra:It("Same properties set in the form above will be overwritten by this JSON config.")},"x-component":"Input.JSON","x-component-props":{autoSize:{minRows:3}}}}},reference:{type:"string","x-reactions":{dependencies:[".chartType"],fulfill:{schema:{"x-content":"{{ getReference($deps[0]) }}"}}}}}}}}),h7={type:"void",properties:{settings:{type:"void",properties:{collection:{title:'{{t("Collection")}}',type:"string","x-decorator":"FormItem","x-component":"Cascader",enum:"{{ collectionOptions }}","x-component-props":{onChange:"{{ onCollectionChange }}",placeholder:'{{t("Collection")}}'}}}},query:{type:"object",properties:{builder:{type:"void",properties:{collapse:{type:"void","x-decorator":"FormItem","x-component":"FormCollapse","x-component-props":{formCollapse:"{{formCollapse}}"},properties:{pane1:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:It("Measures"),key:"measures"},properties:{measures:hh({field:{type:"string","x-decorator":"FormItem","x-component":"Cascader","x-component-props":{placeholder:'{{t("Field")}}',fieldNames:{label:"title",value:"name",children:"children"}},enum:"{{ fieldOptions }}",required:!0},aggregation:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Aggregation")}}'},enum:[{label:'{{t("Sum")}}',value:"sum"},{label:'{{t("Count")}}',value:"count"},{label:'{{t("Avg")}}',value:"avg"},{label:'{{t("Max")}}',value:"max"},{label:'{{t("Min")}}',value:"min"}]},alias:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Alias")}}',style:{minWidth:"100px"}}}},{required:!0,"x-component-props":{style:{overflow:"auto"}}})}},pane2:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:It("Dimensions"),key:"dimensions"},properties:{dimensions:hh({field:{type:"string","x-decorator":"FormItem","x-component":"Cascader","x-component-props":{placeholder:'{{t("Field")}}',fieldNames:{label:"title",value:"name",children:"children"}},enum:"{{ fieldOptions }}",required:!0},format:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Format")}}',style:{maxWidth:"120px"}},"x-reactions":"{{ useFormatterOptions }}","x-visible":"{{ $self.dataSource && $self.dataSource.length }}"},alias:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Alias")}}',style:{minWidth:"100px"}}}},{"x-component-props":{style:{overflow:"auto"}}})}},pane3:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:It("Filter"),key:"filter"},properties:{filter:{type:"object","x-decorator":"FormItem","x-decorator-props":{style:{overflow:"auto"}},enum:"{{ filterOptions }}","x-component":"Filter","x-component-props":{dynamicComponent:"FilterDynamicComponent"}}}},pane4:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:It("Sort"),key:"sort"},properties:{orders:hh({field:{type:"string","x-decorator":"FormItem","x-component":"Cascader","x-component-props":{placeholder:'{{t("Field")}}'},"x-reactions":"{{ useOrderOptions }}",required:!0},order:{type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{defaultValue:"ASC",optionType:"button",style:{width:"128px"}},enum:["ASC","DESC"]}},{"x-reactions":"{{ useOrderReaction }}","x-component-props":{style:{overflow:"auto"}}})}}}},limit:{title:'{{t("Limit")}}',type:"number","x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{defaultValue:2e3,min:1,style:{width:"100px"}}}}},cache:{type:"object",properties:{enabled:{type:"boolean",title:'{{t("Enable cache")}}',"x-decorator":"FormItem","x-component":"Switch"},ttl:{type:"number",title:'{{t("TTL (second)")}}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{defaultValue:60,min:1,style:{width:"100px"}}}}}}}}},p7={type:"void",properties:{transform:hh({field:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Field")}}',style:{maxWidth:"100px"}},"x-reactions":"{{ useChartFields }}"},type:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Type")}}'},"x-reactions":"{{ useFieldTypeOptions }}"},format:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Format")}}'},"x-reactions":"{{ useTransformers }}","x-visible":"{{ $self.dataSource && $self.dataSource.length }}"}},{"x-decorator-props":{style:{width:"50%"}}})}};function v7(t){const{value:e,onChange:n,renderSchemaComponent:r}=t,i=f7();return Y.jsx(z.Variable.Input,{value:e,onChange:n,scope:i,children:r()})}const Mi=q.createContext({visible:!0});Mi.displayName="ChartConfigContext";const g7=t=>{var s;const{insertAdjacent:e}=z.useDesignable(),[n,r]=q.useState(!1),[i,o]=q.useState({}),{token:a}=Ot.theme.useToken();return Y.jsxs(Mi.Provider,{value:{visible:n,setVisible:r,current:i,setCurrent:o},children:[Y.jsx("div",{className:nl.css`
1
+ (function(ct,z){typeof exports=="object"&&typeof module!="undefined"?z(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("react"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@formily/core"),require("@formily/react"),require("antd"),require("lodash"),require("react-i18next"),require("dayjs"),require("@formily/shared"),require("ahooks"),require("@nocobase/utils/client"),require("@emotion/css")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","react","@ant-design/icons","@formily/antd-v5","@formily/core","@formily/react","antd","lodash","react-i18next","dayjs","@formily/shared","ahooks","@nocobase/utils/client","@emotion/css"],z):(ct=typeof globalThis!="undefined"?globalThis:ct||self,z(ct["@nocobase/plugin-data-visualization"]={},ct["@nocobase/client"],ct.jsxRuntime,ct.react,ct["@ant-design/icons"],ct["@formily/antd-v5"],ct["@formily/core"],ct["@formily/react"],ct.antd,ct.lodash,ct["react-i18next"],ct.dayjs,ct["@formily/shared"],ct.ahooks,ct["@nocobase/utils"],ct["@emotion/css"]))})(this,function(ct,z,Y,q,Nn,me,wn,vt,Ot,nn,Ey,hn,Ya,Ei,My,nl){"use strict";var MMt=Object.defineProperty,PMt=Object.defineProperties;var AMt=Object.getOwnPropertyDescriptors;var Sy=Object.getOwnPropertySymbols;var eB=Object.prototype.hasOwnProperty,nB=Object.prototype.propertyIsEnumerable;var CS=(ct,z)=>(z=Symbol[ct])?z:Symbol.for("Symbol."+ct),Ce=Math.pow,TS=(ct,z,Y)=>z in ct?MMt(ct,z,{enumerable:!0,configurable:!0,writable:!0,value:Y}):ct[z]=Y,rt=(ct,z)=>{for(var Y in z||(z={}))eB.call(z,Y)&&TS(ct,Y,z[Y]);if(Sy)for(var Y of Sy(z))nB.call(z,Y)&&TS(ct,Y,z[Y]);return ct},bt=(ct,z)=>PMt(ct,AMt(z));var rB=(ct,z)=>{var Y={};for(var q in ct)eB.call(ct,q)&&z.indexOf(q)<0&&(Y[q]=ct[q]);if(ct!=null&&Sy)for(var q of Sy(ct))z.indexOf(q)<0&&nB.call(ct,q)&&(Y[q]=ct[q]);return Y};var ni=(ct,z,Y)=>(TS(ct,typeof z!="symbol"?z+"":z,Y),Y);var Cr=(ct,z,Y)=>new Promise((q,Nn)=>{var me=Ot=>{try{vt(Y.next(Ot))}catch(nn){Nn(nn)}},wn=Ot=>{try{vt(Y.throw(Ot))}catch(nn){Nn(nn)}},vt=Ot=>Ot.done?q(Ot.value):Promise.resolve(Ot.value).then(me,wn);vt((Y=Y.apply(ct,z)).next())}),CMt=function(ct,z){this[0]=ct,this[1]=z};var iB=ct=>{var z=ct[CS("asyncIterator")],Y=!1,q,Nn={};return z==null?(z=ct[CS("iterator")](),q=me=>Nn[me]=wn=>z[me](wn)):(z=z.call(ct),q=me=>Nn[me]=wn=>{if(Y){if(Y=!1,me==="throw")throw wn;return wn}return Y=!0,{done:!1,value:new CMt(new Promise(vt=>{var Ot=z[me](wn);if(!(Ot instanceof Object))throw TypeError("Object expected");vt(Ot)}),1)}}),Nn[CS("iterator")]=()=>Nn,q("next"),"throw"in z?q("throw"):Nn.throw=me=>{throw me},"return"in z&&q("return"),Nn};function wB(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const kS="data-visualization";function It(t){return z.i18n.t(t,{ns:[kS,"client"]})}function ae(){return Ey.useTranslation([kS,"client"],{nsMode:"fallback"})}const Py={datetime:[{label:It("YYYY"),value:"YYYY"},{label:It("MM"),value:"MM"},{label:It("DD"),value:"DD"},{label:It("YYYY-MM"),value:"YYYY-MM"},{label:It("YYYY-MM-DD"),value:"YYYY-MM-DD"},{label:It("YYYY-MM-DD hh:mm"),value:"YYYY-MM-DD hh:mm"},{label:It("YYYY-MM-DD hh:mm:ss"),value:"YYYY-MM-DD hh:mm:ss"}],date:[{label:It("YYYY"),value:"YYYY"},{label:It("MM"),value:"MM"},{label:It("DD"),value:"DD"},{label:It("YYYY-MM"),value:"YYYY-MM"},{label:It("YYYY-MM-DD"),value:"YYYY-MM-DD"}],time:[{label:It("hh:mm:ss"),value:"hh:mm:ss"},{label:It("hh:mm"),value:"hh:mm"},{label:It("hh"),value:"hh"}]},OB=q.createContext(null),Ay={didCatch:!1,error:null};let LS=class extends q.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Ay}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var n,r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(Ay)}}componentDidCatch(e,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,e,n)}componentDidUpdate(e,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&_B(e.resetKeys,i)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(Ay)}}render(){const{children:e,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=e;if(o){const l={error:a,resetErrorBoundary:this.resetErrorBoundary};if(q.isValidElement(i))s=i;else if(typeof n=="function")s=n(l);else if(r)s=q.createElement(r,l);else throw a}return q.createElement(OB.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}};function _B(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((n,r)=>!Object.is(n,e[r]))}const NS=(t,e={})=>{const{collection:n}=t;return{type:"void","x-decorator":"ChartRendererProvider","x-decorator-props":t,"x-acl-action":`${n}:list`,"x-designer":"ChartRenderer.Designer","x-component":"CardItem","x-component-props":{size:"small"},"x-initializer":"charts:addBlock",properties:{[Ya.uid()]:{type:"void","x-component":"ChartRenderer","x-component-props":e}}}},ou=t=>{let e,n;return Array.isArray(t)?t.length===1?n=t[0]:t.length>1&&([e,n]=t):n=t,{target:e,name:n,alias:e?`${e}.${n}`:n}},fh=(t,e)=>{var o,a;const{target:n,name:r}=ou(e);return n?(a=(o=t.find(s=>s.name===n))==null?void 0:o.targetFields)==null?void 0:a.find(s=>s.name===r):t.find(s=>s.name===r)},rl=(t,e)=>{const n=s=>s.map(l=>{const c=fh(t,l.field);return bt(rt({},c),{key:l.alias||(c==null?void 0:c.key),label:l.alias||(c==null?void 0:c.label),value:l.alias||(c==null?void 0:c.value)})}),r=e.measures||[],i=e.dimensions||[];return[...new Map([...n(r),...n(i)].map(s=>[s.value,s])).values()]},SB=(t,e,n)=>{const r=(i,o)=>{var l;const a=(l=i.uiSchema)==null?void 0:l.enum;if(!a||!Array.isArray(a))return o;const s=a.find(c=>c.value===o);return vt.Schema.compile((s==null?void 0:s.label)||o,n)};return e.map(i=>{const o={};return Object.entries(i).forEach(([a,s])=>{const l=t.find(c=>c.value===a);if(!l){o[a]=s;return}switch(l.interface){case"select":case"radioGroup":o[a]=r(l,s);break;default:o[a]=s}}),o})},Cy=t=>{if(typeof t=="object"&&t!==null)if(Array.isArray(t)){const e=t.map(n=>Cy(n)).filter(Boolean);return e.length>0?e:null}else{const e={};for(const n in t){const r=Cy(t[n]);r!=null&&!(typeof r=="object"&&Object.keys(r).length===0)&&(e[n]=r)}return Object.keys(e).length>0?e:null}else if(typeof t=="string"&&t.startsWith("{{$nFilter.")&&t.endsWith("}}"))return null;return t},EB=(t,e)=>{const n=e.split(".");let r=nn.get(t,n.slice(0,-1).join("."));return Array.isArray(r)?r=r.map(i=>nn.get(i,n.slice(-1)[0])):r=nn.get(r,n.slice(-1)[0]),r},MB=t=>({boolean:"Checkbox",integer:"InputNumber",bigInt:"InputNumber",double:"InputNumber",decimal:"InputNumber",date:"DatePicker",string:"Input"})[t],PB=t=>({boolean:"boolean",integer:"integer",bigInt:"integer",double:"number",decimal:"number",date:"datetime",string:"input"})[t],il=q.createContext({});il.displayName="ChartDataContext";const AB=t=>{const[e,n]=q.useState({}),r=Ei.useMemoizedFn((o,{dataSource:a,collection:s,service:l,query:c})=>{n(u=>bt(rt({},u),{[o]:{dataSource:a,collection:s,service:l,query:c}}))}),i=Ei.useMemoizedFn(o=>{n(a=>bt(rt({},a),{[o]:void 0}))});return Y.jsx(il.Provider,{value:{charts:e,addChart:r,removeChart:i},children:t.children})},Tr=q.createContext({});Tr.displayName="ChartFilterContext";const CB=t=>{const[e,n]=q.useState(!1),[r,i]=q.useState(!1),[o,a]=q.useState({}),[s,l]=q.useState({collapsed:!1,row:1}),[c,u]=q.useState(),f=Ei.useMemoizedFn((g,y)=>{a(m=>bt(rt({},m),{[g]:rt(rt({},m[g]||{}),y)}))}),d=Ei.useMemoizedFn(g=>{a(y=>{const m=rt({},y);return m[g]=void 0,m})}),h=Ei.useMemoizedFn(u),p=Ei.useMemoizedFn(i),v=({collapsed:g,row:y})=>{l(m=>({collapsed:g!==void 0?g:m.collapsed,row:y!==void 0?y:m.row}))};return q.useEffect(()=>n(!0),[]),Y.jsx(Tr.Provider,{value:{ready:e,enabled:r,setEnabled:p,fields:o,setField:f,removeField:d,collapse:s,setCollapse:v,form:c,setForm:h},children:t.children})},ri=q.createContext({});ri.displayName="ChartRendererContext";const IS=t=>{const{query:e,config:n,collection:r,transform:i,dataSource:o=z.DEFAULT_DATA_SOURCE_KEY}=t,{addChart:a}=q.useContext(il),{ready:s,form:l,enabled:c}=q.useContext(Tr),{getFilter:u,hasFilter:f,appendFilter:d}=al(),h=vt.useFieldSchema(),p=z.useAPIClient(),v=z.useRequest((g,y,m,b)=>new Promise((x,w)=>{var S;if(!(y&&((S=m==null?void 0:m.measures)!=null&&S.length))||c&&!l)return x(void 0);const O=u(),_=!b&&f({dataSource:g,collection:y,query:m},O)?d({dataSource:g,collection:y,query:m},O):m;p.request({url:"charts:query",method:"POST",data:bt(rt({uid:h==null?void 0:h["x-uid"],dataSource:g,collection:y},_),{filter:Cy(_.filter),dimensions:((m==null?void 0:m.dimensions)||[]).map(E=>{const M=rt({},E);if(E.format&&!E.alias){const{alias:P}=ou(E.field);M.alias=P}return M}),measures:((m==null?void 0:m.measures)||[]).map(E=>{const M=rt({},E);if(E.aggregation&&!E.alias){const{alias:P}=ou(E.field);M.alias=P}return M})})}).then(E=>{var M;x((M=E==null?void 0:E.data)==null?void 0:M.data)}).finally(()=>{!b&&(h!=null&&h["x-uid"])&&a(h==null?void 0:h["x-uid"],{dataSource:g,collection:y,service:v,query:m})}).catch(w)}),{defaultParams:[o,r,e],ready:s&&(!c||!!l)});return Y.jsx(z.CollectionManagerProvider,{dataSource:o,children:Y.jsx(z.MaybeCollectionProvider,{collection:r,children:Y.jsx(Ot.ConfigProvider,{card:{style:{boxShadow:"none"}},children:Y.jsx(ri.Provider,{value:{dataSource:o,collection:r,config:n,transform:i,service:v,query:e},children:t.children})})})})};class TB{constructor(){ni(this,"charts",new Map)}setGroup(e,n){this.charts.set(e,n)}addGroup(e,n){if(this.charts.has(e))throw new Error(`[data-visualization] Chart group "${e}" already exists`);this.setGroup(e,n)}add(e,n){var r;this.charts.has(e)||this.setGroup(e,[]),(r=this.charts.get(e))==null||r.push(n)}getChartTypes(){const e=[];this.charts.forEach((r,i)=>{const o=r.map(a=>({key:`${i}.${a.name}`,label:It(a.title),value:`${i}.${a.name}`}));e.push({label:It(i),children:o})});const n=e.findIndex(r=>r.label===It("Built-in"));if(n>-1){const[r]=e.splice(n,1);e.unshift(r)}return e}getCharts(){const e={};return this.charts.forEach((n,r)=>{n.forEach(i=>{e[`${r}.${i.name}`]=i})}),e}getChart(e){return this.getCharts()[e]}}const jS=()=>z.usePlugin(_y).charts.getChartTypes(),kB=()=>{var e,n,r;return(r=(n=(e=jS()[0])==null?void 0:e.children)==null?void 0:n[0])==null?void 0:r.value},$S=()=>z.usePlugin(_y).charts.getCharts(),LB=t=>z.usePlugin(_y).charts.getChart(t),{Paragraph:NB,Text:IB}=Ot.Typography,Ty=t=>{const{t:e}=ae(),n=q.useContext(ri),{config:r,transform:i,dataSource:o,collection:a,service:s,data:l}=n,c=Wa(o,a),u=FS(l,o,a),f=(r==null?void 0:r.general)||{},d=(r==null?void 0:r.advanced)||{},h=z.useAPIClient(),p=LB(r==null?void 0:r.chartType),v=h.auth.getLocale(),g=HB(i,v),y=p==null?void 0:p.getProps({data:u,general:f,advanced:d,fieldProps:Object.keys(u[0]||{}).reduce((b,x)=>{if(!b[x]){const w=fh(c,x.split(".")),O=g[x];b[x]={label:(w==null?void 0:w.label)||x,transformer:O,interface:w==null?void 0:w.interface}}return b},{})}),m=p==null?void 0:p.Component;return p?!(u&&u.length)&&!s.loading?Y.jsx(Ot.Empty,{image:Ot.Empty.PRESENTED_IMAGE_SIMPLE,description:e("No data")}):Y.jsx(Ot.Spin,{spinning:s.loading,children:Y.jsx(LS,{onError:b=>{console.error(b)},FallbackComponent:jB,children:Y.jsx(m,rt({},y))})}):Y.jsx(Ot.Empty,{image:Ot.Empty.PRESENTED_IMAGE_SIMPLE,description:e("Please configure chart")})};Ty.Designer=function(){const{t:e}=ae(),{setVisible:n,setCurrent:r}=q.useContext(Mi),{removeChart:i}=q.useContext(il),{service:o}=q.useContext(ri),a=vt.useField(),s=vt.useFieldSchema(),{insertAdjacent:l}=z.useDesignable(),c=z.useDataSource(),{name:u,title:f}=z.useCollection_deprecated();return Y.jsxs(z.GeneralSchemaDesigner,{disableInitializer:!0,title:f||u,children:[Y.jsx(z.SchemaSettingsItem,{title:"Configure",onClick:()=>Cr(this,null,function*(){r({schema:s,field:a,dataSource:c.key,collection:u,service:o,data:o.data}),n(!0)}),children:e("Configure")},"configure"),Y.jsx(z.SchemaSettingsItem,{title:"Duplicate",onClick:()=>l("afterEnd",z.gridRowColWrap(NS(s==null?void 0:s["x-decorator-props"]))),children:e("Duplicate")},"duplicate"),Y.jsx(z.SchemaSettingsBlockTitleItem,{}),Y.jsx(z.SchemaSettingsDivider,{}),Y.jsx(z.SchemaSettingsRemove,{breakRemoveOn:{"x-component":"ChartV2Block"},confirm:{onOk:()=>{i(s["x-uid"])}}})]})};const jB=({error:t})=>{const{t:e}=ae();return Y.jsx("div",{style:{backgroundColor:"white"},children:Y.jsx(Ot.Result,{status:"error",title:e("Render Failed"),subTitle:e("Please check the configuration."),children:Y.jsx(NB,{copyable:!0,children:Y.jsx(IB,{type:"danger",style:{whiteSpace:"pre-line",textAlign:"center"},children:t.message})})})})},au=t=>{const{current:e}=q.useContext(Mi),{dataSource:n=t||z.DEFAULT_DATA_SOURCE_KEY,collection:r}=e||{},i=z.useDataSourceManager(),o=i.getDataSource(n),a=i.collectionFieldInterfaceManager;return{cm:o==null?void 0:o.collectionManager,fim:a,collection:r}},$B=t=>(t||[]).filter(n=>n.interface).map(n=>{var r;return bt(rt({},n),{key:n.name,label:((r=n.uiSchema)==null?void 0:r.title)||n.name,value:n.name})}),Wa=(t,e)=>{const{t:n}=Ey.useTranslation(),{cm:r,fim:i,collection:o}=au(t),a=r.getCollectionFields(e||o),s=$B(a);return q.useMemo(()=>s.map(l=>{var d,h,p,v;const c=(d=i.getFieldInterface(l.interface))==null?void 0:d.filterable,u=vt.Schema.compile(((h=l.uiSchema)==null?void 0:h.title)||l.name,{t:n});if(!(c&&(c!=null&&c.nested||(p=c==null?void 0:c.children)!=null&&p.length)))return bt(rt({},l),{label:u});let f=[];if(c!=null&&c.nested){const g=(r.getCollectionFields(l.target)||[]).filter(y=>y.interface).map(y=>{var m;return bt(rt({},y),{key:`${l.name}.${y.name}`,label:`${u} / ${vt.Schema.compile(((m=y.uiSchema)==null?void 0:m.title)||y.name,{t:n})}`,value:`${l.name}.${y.name}`})});f=[...f,...g]}if((v=c==null?void 0:c.children)!=null&&v.length){const g=c.children.map(y=>{var m;return bt(rt({},y),{key:`${l.name}.${y.name}`,label:`${u} / ${vt.Schema.compile(((m=y.schema)==null?void 0:m.title)||y.title||y.name,{t:n})}`,value:`${l.name}.${y.name}`})});f=[...f,...g]}return bt(rt({},l),{label:u,targetFields:f})}),[s])},DS=t=>e=>{const n=e.query("query").get("value")||{},r=rl(t,n);e.dataSource=r},DB=t=>e=>{var o;const n=e.query(".field").get("value");if(!n){e.dataSource=[];return}let r=[];switch((o=fh(t,n))==null?void 0:o.interface){case"datetime":case"createdAt":case"updatedAt":r=Py.datetime;break;case"date":r=Py.date;break;case"time":r=Py.time;break;default:r=[]}e.dataSource=r},FB=()=>{const{t}=Ey.useTranslation(),e=z.useDataSourceManager(),{parseAction:n}=z.useACLRoleContext(),i=e.getAllCollections({filterCollection:o=>n(`${o.name}:list`)}).filter(({key:o,isDBInstance:a})=>o===z.DEFAULT_DATA_SOURCE_KEY||a).map(({key:o,displayName:a,collections:s})=>({value:o,label:a,children:s.map(l=>({value:l.name,label:l.title}))}));return q.useMemo(()=>vt.Schema.compile(i,{t}),[i])},RB=(t,e)=>n=>{const r=n.query("query").get("value")||{},{measures:i=[]}=r;if(!i.some(s=>s.aggregation)){n.componentProps.fieldNames={label:"title",value:"name",children:"children"},n.dataSource=t;return}const a=rl(e,r);n.componentProps.fieldNames={},n.dataSource=a},BB=(t,e)=>n=>{const r=n.query("query").get("value")||{},{measures:i=[]}=r,o=i.some(u=>u.aggregation);let a=t;const s=[];o?(a=rl(e,r),a.forEach(u=>{s.push(u.value)})):a.forEach(u=>{const f=u.children||[];f.length||s.push(u.value||u.name),f.forEach(d=>{s.push(`${u.name}.${d.name}`)})});const c=(n.value||[]).reduce((u,f)=>{const{alias:d}=ou(f.field);return(!f.field||s.includes(d))&&u.push(f),u},[]);n.setValue(c)},FS=(t,e,n)=>{var c;const{t:r}=ae(),{service:i,query:o}=q.useContext(ri),a=Wa(e,n),s=vt.useForm(),l=rl(a,((c=s==null?void 0:s.values)==null?void 0:c.query)||o);return SB(l,(i==null?void 0:i.data)||t||[],{t:r})},zB=(t,e,n=2,r=[])=>{const{cm:i,fim:o,collection:a}=au(t),l=i.getCollectionFields(e||a).filter(d=>!r.includes(d.interface)),c=(d,h,p)=>{var x;if(!d.interface||d.isForeignKey)return;const v=o.getFieldInterface(d.interface);if(!(v!=null&&v.filterable))return;const{nested:g,children:y}=v.filterable,m=p?`${p}.${d.name}`:d.name,b=bt(rt({},d),{name:d.name,title:((x=d==null?void 0:d.uiSchema)==null?void 0:x.title)||d.name,schema:d==null?void 0:d.uiSchema,key:m});if(!(d.target&&h>n)){if(h>n)return b;if(y!=null&&y.length&&(b.children=y.map(w=>bt(rt({},w),{key:`${d.name}.${w.name}`}))),g){const w=i.getCollectionFields(d.target).filter(_=>!r.includes(_.interface)),O=u(w,h+1,d.name).filter(Boolean);b.children=b.children||[],b.children.push(...O)}return b}},u=(d,h,p)=>{const v=[];return d.forEach(g=>{const y=c(g,h,p);y&&v.push(y)}),v};return u(l,1)},YB=(t,e)=>{const{cm:n,fim:r,collection:i}=au(t);return q.useMemo(()=>{const o=n.getCollectionFields(e||i),a=(c,u)=>{var g,y;if(!c.interface||c.isForeignKey)return;const f=r.getFieldInterface(c.interface);if(!(f!=null&&f.filterable))return;const{nested:d,children:h,operators:p}=f.filterable,v={name:c.name,title:((g=c==null?void 0:c.uiSchema)==null?void 0:g.title)||c.name,schema:c==null?void 0:c.uiSchema,operators:((y=p==null?void 0:p.filter)==null?void 0:y.call(p,m=>!(m!=null&&m.visible)||m.visible(c)))||[],interface:c.interface};if(!(c.target&&u>2)){if(u>2)return v;if(h!=null&&h.length&&(v.children=h),d){const m=n.getCollectionFields(c.target),b=s(m,u+1).filter(Boolean);v.children=v.children||[],v.children.push(...b)}return v}},s=(c,u)=>{const f=[];return c.forEach(d=>{const h=a(d,u);h&&f.push(h)}),f};return s(o,1)},[e,n,r])},ky={datetime:{YYYY:t=>hn(t).format("YYYY"),MM:t=>hn(t).format("MM"),DD:t=>hn(t).format("DD"),"YYYY-MM":t=>hn(t).format("YYYY-MM"),"YYYY-MM-DD":t=>hn(t).format("YYYY-MM-DD"),"YYYY-MM-DD hh:mm":t=>hn(t).format("YYYY-MM-DD hh:mm"),"YYYY-MM-DD hh:mm:ss":t=>hn(t).format("YYYY-MM-DD hh:mm:ss")},date:{YYYY:t=>hn(t).format("YYYY"),MM:t=>hn(t).format("MM"),DD:t=>hn(t).format("DD"),"YYYY-MM":t=>hn(t).format("YYYY-MM"),"YYYY-MM-DD":t=>hn(t).format("YYYY-MM-DD")},time:{"hh:mm:ss":t=>hn(t).format("hh:mm:ss"),"hh:mm":t=>hn(t).format("hh:mm"),hh:t=>hn(t).format("hh")},number:{Percent:t=>new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(t),Currency:(t,e="en-US")=>{const n={"zh-CN":"CNY","en-US":"USD","ja-JP":"JPY","ko-KR":"KRW","pt-BR":"BRL","ru-RU":"RUB","tr-TR":"TRY","es-ES":"EUR"}[e];return new Intl.NumberFormat(e,{style:"currency",currency:n}).format(t)},Exponential:t=>(+t).toExponential(),Abbreviation:(t,e="en-US")=>new Intl.NumberFormat(e,{notation:"compact"}).format(t)}},WB=t=>e=>{const n=e.query(".field").get("value"),r=e.query("query").get("value")||{},o=rl(t,r).find(f=>f.value===n),a=Object.keys(ky);e.dataSource=a.map(f=>({label:It(f),value:f}));const s={createdAt:"datetime",updatedAt:"datetime",double:"number",integer:"number",percent:"number"},l=o==null?void 0:o.interface,c=o==null?void 0:o.type,u=s[l]||s[c]||c;if(a.includes(u)){e.setState({value:u,disabled:!0});return}e.setState({value:null,disabled:!1})},GB=t=>{const e=t.query(".type").get("value");if(!e){t.dataSource=[];return}const n=Object.keys(ky[e]||{}).map(r=>({label:It(r),value:r}));t.dataSource=n},HB=(t,e="en-US")=>(t||[]).filter(n=>n.field&&n.type&&n.format).reduce((n,r)=>{const i=ky[r.type][r.format];return i&&(n[r.field]=o=>i(o,e)),n},{});function su(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var UB=function(e){return VB(e)&&!XB(e)};function VB(t){return!!t&&typeof t=="object"}function XB(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||ZB(t)}var qB=typeof Symbol=="function"&&Symbol.for,KB=qB?Symbol.for("react.element"):60103;function ZB(t){return t.$$typeof===KB}function QB(t){return Array.isArray(t)?[]:{}}function lu(t,e){return e.clone!==!1&&e.isMergeableObject(t)?ol(QB(t),t,e):t}function JB(t,e,n){return t.concat(e).map(function(r){return lu(r,n)})}function t7(t,e){if(!e.customMerge)return ol;var n=e.customMerge(t);return typeof n=="function"?n:ol}function e7(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function RS(t){return Object.keys(t).concat(e7(t))}function BS(t,e){try{return e in t}catch(n){return!1}}function n7(t,e){return BS(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function r7(t,e,n){var r={};return n.isMergeableObject(t)&&RS(t).forEach(function(i){r[i]=lu(t[i],n)}),RS(e).forEach(function(i){n7(t,i)||(BS(t,i)&&n.isMergeableObject(e[i])?r[i]=t7(i,n)(t[i],e[i],n):r[i]=lu(e[i],n))}),r}function ol(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||JB,n.isMergeableObject=n.isMergeableObject||UB,n.cloneUnlessOtherwiseSpecified=lu;var r=Array.isArray(e),i=Array.isArray(t),o=r===i;return o?r?n.arrayMerge(t,e,n):r7(t,e,n):lu(e,n)}ol.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,i){return ol(r,i,n)},{})};var i7=ol,o7=i7;const a7=su(o7),s7=()=>({title:'{{t("Options")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"object","x-decorator":"ArrayItems.Item",properties:{space:{type:"void","x-component":"Space",properties:{label:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Option label")}}'},required:!0},value:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Option value")}}'},required:!0},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:"Add","x-component":"ArrayItems.Addition"}}}),Ly=t=>{const e={type:"boolean","x-content":'{{ t("Show time") }}',"x-decorator":"FormItem","x-component":"Checkbox"},n={type:"string",title:'{{t("Date format")}}',"x-component":"Radio.Group","x-decorator":"FormItem",default:"YYYY-MM-DD",enum:[{label:'{{t("Year/Month/Day")}}',value:"YYYY/MM/DD"},{label:'{{t("Year-Month-Day")}}',value:"YYYY-MM-DD"},{label:'{{t("Day/Month/Year")}}',value:"DD/MM/YYYY"}]},r=s7();return{DatePicker:{type:"object",properties:{dateFormat:n,showTime:e}},"DatePicker.RangePicker":{type:"object",properties:{dateFormat:n,showTime:e}},Select:{type:"object",properties:{mode:{type:"string",enum:[{label:'{{ t("Single select") }}',value:""},{label:'{{ t("Multiple select") }}',value:"multiple"}],"x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{defaultValue:""}},options:r}},"Checkbox.Group":{type:"object",properties:{options:r}},"Radio.Group":{type:"object",properties:{options:r}}}[t]},l7=(t,e)=>{if(!t)return t;if(hn.isDayjs(t))return e.showTime||(t=t.startOf("day")),My.moment2str(t,e);if(Array.isArray(t)&&t.length&&hn.isDayjs(t[0])){let n=t[0],r=t[1];return e.showTime&&(n=n.startOf("day"),r=r.endOf("day")),[n.toISOString(),r.toISOString()]}return t},zS=(t,e)=>Cr(this,null,function*(){const n=t.initialValue;if(!(typeof n=="string"&&(n==null?void 0:n.startsWith("{{$"))&&(n==null?void 0:n.endsWith("}}")))||!e)t.setValue(n),t.setInitialValue(n);else{t.loading=!0;const i=yield e.parseVariable(n),o=l7(i,t.componentProps);t.setValue(o),t.setInitialValue(o),t.loading=!1}}),dh="-",cu=(t,e)=>t?`${t}${dh}${e}`:e,YS=t=>{const[e,n]=t.split(dh);return n?{dataSource:e,fieldName:n}:{dataSource:z.DEFAULT_DATA_SOURCE_KEY,fieldName:e}},Ny=(t,e,n)=>vt.Schema.isSchemaInstance(t)?t.reduceProperties((r,i)=>{let o=i[e];if(o.includes(dh)||(o=`${z.DEFAULT_DATA_SOURCE_KEY}${dh}${o}`),o===n)return i;if(i["x-component"]!=="Action.Container"&&i["x-component"]!=="AssociationField.Viewer"){const a=Ny(i,e,n);if(a)return a}return r}):null,Iy=()=>{const{charts:t}=q.useContext(il),e=q.useMemo(()=>Object.values(t).filter(i=>i).reduce((i,o)=>{var l;const{dataSource:a,collection:s}=o;return(l=i[a])!=null&&l.includes(s)||(i[a]=[...i[a]||[],s]),i},{}),[t]),n=q.useMemo(()=>Object.keys(e).length>1,[e]),r=q.useCallback((i,o)=>{var a;return((a=e[i])==null?void 0:a.includes(o))||!1},[e]);return{chartCollections:e,showDataSource:n,getIsChartCollectionExists:r}},al=()=>{const t=z.useDataSourceManager(),{charts:e}=q.useContext(il),{fieldSchema:n}=z.useActionContext(),r=n==null?void 0:n["x-action"],{fields:i,form:o}=q.useContext(Tr),a=({dataSource:h,collection:p,cm:v,fim:g})=>{const y=v.getCollectionFields(p.name),m=(_,S,E,M)=>{var j,L,I,D,F;const P=((j=_.uiSchema)==null?void 0:j.title)||_.name,C=g.getFieldInterface(_.interface),A=(I=(L=C==null?void 0:C.filterable)==null?void 0:L.operators)==null?void 0:I[0],T=v.getCollection(_.target);S=S?`${S} / ${P}`:P;let k={type:"string",title:S,name:`${E}.${_.name}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-component":"CollectionField","x-decorator":"ChartFilterFormItem","x-data-source":h,"x-collection-field":`${M}.${_.name}`,"x-component-props":bt(rt({},(D=_.uiSchema)==null?void 0:D["x-component-props"]),{"filter-operator":A})};if(_.interface==="formula"){const R=MB(_.dataType)||"Input";k=bt(rt({},k),{"x-component":R})}return["oho","o2m"].includes(_.interface)&&nn.set(k,"x-component-props.useOriginalFilter",!0),{key:`${E}.${_.name}`,name:_.name,type:"item",title:((F=_==null?void 0:_.uiSchema)==null?void 0:F.title)||_.name,Component:"CollectionFieldInitializer",find:Ny,remove:(R,B)=>{B(R,{breakRemoveOn:{"x-component":"Grid"}})},schemaInitialize:R=>{var B;(B=C==null?void 0:C.schemaInitialize)==null||B.call(C,R,{field:_,block:"FilterForm",readPretty:o.readPretty,action:r,targetCollection:T})},schema:k}},b=(_,S,E,M)=>{var k;const P=((k=_.uiSchema)==null?void 0:k.title)||_.name;S=S?`${S} / ${P}`:P;const C=_.operators[0];let A=bt(rt({type:"string",name:`${E}.${_.name}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-decorator":"ChartFilterFormItem","x-data-source":h,"x-collection-field":`${M}.${_.name}`},_.schema),{title:S,"x-component-props":{"filter-operator":C}});return C!=null&&C.noValue&&(A=bt(rt({},A),{"x-component":"ChartFilterCheckbox","x-component-props":bt(rt({},A["x-component-props"]),{content:vt.Schema.compile(C.label,{t:z.i18n.t})})})),{key:`${E}.${_.name}`,name:_.name,type:"item",title:_.title||_.name,Component:"CollectionFieldInitializer",find:Ny,remove:(N,j)=>{j(N,{breakRemoveOn:{"x-component":"Grid"}})},schema:A}},x=(_,S,E,M,P)=>{var j,L,I;if(!_.interface||_.isForeignKey)return;const C=g.getFieldInterface(_.interface);if(!(C!=null&&C.filterable))return;const{nested:A,children:T}=C.filterable,k=((j=_.uiSchema)==null?void 0:j.title)||_.name,N=m(_,E,M,P);if(!(_.target&&S>2)){if(E=E?`${E} / ${k}`:k,T!=null&&T.length&&!["chinaRegion","createdBy","updatedBy","attachment"].includes(_.interface)){const D=T.map(F=>b(F,E,`${M}.${_.name}`,`${P}.${_.name}`));return{key:`${M}.${_.name}`,name:_.name,type:"subMenu",title:((L=_==null?void 0:_.uiSchema)==null?void 0:L.title)||_.name,children:D}}if(!S||S>2)return N;if(A){const F=v.getCollectionFields(_.target).map(R=>x(R,S+1,"",`${M}.${_.name}`,`${P}.${_.name}`));return{key:`${M}.${_.name}`,name:_.name,type:"subMenu",title:((I=_==null?void 0:_.uiSchema)==null?void 0:I.title)||_.name,children:F.filter(Boolean)}}return N}},w=[],O=[];return y.forEach(_=>{const S=_.interface,E=x(_,0,"",cu(h,p.name),p.name);if(E&&w.push(E),["m2o"].includes(S)){const M=x(_,1,"",cu(h,p.name),p.name);M&&O.push(M)}}),O.length&&w.push({name:"divider",type:"divider"},{name:"displayAssociationFields",type:"itemGroup",title:z.i18n.t("Display association fields"),children:O}),w},s=()=>{const h=(o==null?void 0:o.values)||{},p={};return Object.entries(i).filter(([v,g])=>g).forEach(([v,g])=>{const{operator:y}=g||{},{dataSource:m,fieldName:b}=YS(v);let x=b;const _=t.getDataSource(m).collectionManager.getCollectionField(x);if(_!=null&&_.target){const C=_.targetKey||"id";x=`${x}.${C}`,v=`${v}.${C}`}const[S,...E]=x.split("."),M=EB(h,v),P=(y==null?void 0:y.value)||"$eq";if(S!=="custom"){const C=cu(m,S);p[C]=p[C]||{$and:[]};const A={};nn.set(A,E.join("."),{[P]:M}),p[C].$and.push(A)}else p[S]=p[S]||{},p[S][`$nFilter.${E.join(".")}`]=M}),p},l=(h,p)=>{if(!h)return!1;const{dataSource:v,collection:g,query:y}=h,{parameters:m}=My.parse(y.filter||"");return p[cu(v,g)]||p.custom&&(m==null?void 0:m.find(({key:b})=>nn.has(p.custom,b)))},c=(h,p)=>{const{dataSource:v,collection:g,query:y}=h;let m=rt({},y);const b=rt({},m.filter||{});let x={};const w=My.parse(b),{parameters:O}=w;return p.custom&&(O!=null&&O.find(_=>p.custom[_.key]))&&(x=w(p.custom)),x=a7(b,x),m=bt(rt({},m),{filter:{$and:[x,p[cu(v,g)]]}}),m},u=()=>Cr(this,null,function*(){const h=s(),p=Object.values(e).filter(v=>l(v,h)).map(v=>()=>Cr(this,null,function*(){const{dataSource:g,service:y,collection:m}=v;yield y.runAsync(g,m,c(v,h),!0)}));yield Promise.all(p.map(v=>v()))}),f=()=>Cr(this,null,function*(){const h=Object.values(e).filter(p=>p).map(p=>()=>Cr(this,null,function*(){const{service:v,dataSource:g,collection:y,query:m}=p;yield v.runAsync(g,y,m,!0)}));yield Promise.all(h.map(p=>p()))}),d=Ei.useMemoizedFn(h=>h.split(" / ").map(p=>z.i18n.t(vt.Schema.compile(p,{t:z.i18n.t}))).join(" / "));return{filter:u,refresh:f,getChartFilterFields:a,getFilter:s,hasFilter:l,appendFilter:c,getTranslatedTitle:d}},c7=()=>{const{t}=ae(),e=Ei.useMemoizedFn(t),{enabled:n,fields:r}=q.useContext(Tr),i=Object.entries(r).filter(([a,s])=>a.startsWith("custom.")&&s).map(([a,{title:s}])=>{const l=a.replace(/^custom\./,"");return{key:l,value:l,label:s}}),o=q.useMemo(()=>({label:e("Current filter"),value:"$nFilter",key:"$nFilter",children:i}),[i,e]);return!n||!i.length?null:o},WS=()=>{const{t}=ae(),{chartCollections:e}=Iy(),n=z.useDataSourceManager(),r=n.collectionFieldInterfaceManager,{values:i}=GS(),o=(a,s,l)=>{var d,h,p;if(!s.interface)return;const c=r.getFieldInterface(s.interface);if(!(c!=null&&c.filterable))return;const{nested:u}=c.filterable,f={value:s.name,label:t(((d=s==null?void 0:s.uiSchema)==null?void 0:d.title)||s.name)};if(!(s.target&&l>2)){if(l>2)return f;if(u){const g=a.getCollectionFields(s.target).map(y=>o(a,y,l+1));return{value:s.name,label:t(((h=s==null?void 0:s.uiSchema)==null?void 0:h.title)||s.name),children:g.filter(y=>y)}}if(!(!i.includes((p=s.uiSchema)==null?void 0:p["x-component"])&&!i.includes(s.interface)))return f}};return q.useMemo(()=>Object.entries(e).map(([s,l])=>{const c=n.getDataSource(s);return{value:s,label:vt.Schema.compile(c.displayName,{t}),children:l.map(u=>{const f=c.collectionManager,d=f.getCollection(u),p=f.getCollectionFields(u).map(v=>o(f,v,1)).filter(v=>v);return{value:u,label:vt.Schema.compile(d.title,{t}),children:p}})}}),[e])},GS=()=>{const{t}=ae(),e=[{label:t("Input"),value:"Input"},{label:t("Number"),value:"InputNumber"},{label:t("Date"),value:"DatePicker"},{label:t("Date range"),value:"DatePicker.RangePicker"},{label:t("Time"),value:"TimePicker"},{label:t("Time range"),value:"TimePicker.RangePicker"},{label:t("Select"),value:"Select"},{label:t("Radio group"),value:"Radio.Group"},{label:t("Checkbox group"),value:"Checkbox.Group"}];return{options:e,values:e.map(n=>n.value)}},u7=(t,e)=>{const{t:n}=ae(),r=z.useDataSourceManager(),{showDataSource:i}=Iy();return q.useMemo(()=>{var p;const o=r.getDataSource(t);if(!o)return;const a=o.collectionManager;if(!e)return;const{fieldName:s}=YS(e),[l,...c]=s.split(".");if(!(c!=null&&c.length))return;const u=a.getCollection(l);let f=l,d,h=vt.Schema.compile(u==null?void 0:u.title,{t:n});for(;f&&c.length>0;){const v=c.shift();d=a.getCollectionField(`${f}.${v}`);const g=((p=d==null?void 0:d.uiSchema)==null?void 0:p.title)||(d==null?void 0:d.name);g&&(h+=` / ${vt.Schema.compile(g,{t:n})}`),d!=null&&d.target?f=d.target:f=null}return i?`${vt.Schema.compile(o.displayName,{t:n})} > ${h}`:h},[e,t,i])},f7=()=>{const t=vt.useField(),{operator:e,schema:n}=t.data||{},{currentUserSettings:r}=z.useCurrentUserVariable({collectionField:{uiSchema:n},uiSchema:n}),{datetimeSettings:i}=z.useDatetimeVariable({operator:e,schema:n}),o=c7(),a=q.useMemo(()=>[r,i,o].filter(Boolean),[i,r,o]);return!e||!n?[]:a},hh=(t={},e={})=>bt(rt({type:"array","x-decorator":"FormItem","x-component":"ArrayItems"},e),{items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:bt(rt({sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"}},t),{remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}})}}},properties:{add:{type:"void",title:'{{t("Add field")}}',"x-component":"ArrayItems.Addition"}}}),d7=t=>({type:"void",properties:{config:{type:"object",properties:{chartType:{type:"string",title:'{{t("Chart type")}}',"x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Please select a chart type.")}}'},enum:"{{ chartTypes }}"},[Ya.uid()]:{type:"void",properties:{general:t}},[Ya.uid()]:{type:"void",properties:{advanced:{type:"json",title:'{{t("JSON config")}}',"x-decorator":"FormItem","x-decorator-props":{extra:It("Same properties set in the form above will be overwritten by this JSON config.")},"x-component":"Input.JSON","x-component-props":{autoSize:{minRows:3}}}}},reference:{type:"string","x-reactions":{dependencies:[".chartType"],fulfill:{schema:{"x-content":"{{ getReference($deps[0]) }}"}}}}}}}}),h7={type:"void",properties:{settings:{type:"void",properties:{collection:{title:'{{t("Collection")}}',type:"string","x-decorator":"FormItem","x-component":"Cascader",enum:"{{ collectionOptions }}","x-component-props":{onChange:"{{ onCollectionChange }}",placeholder:'{{t("Collection")}}'}}}},query:{type:"object",properties:{builder:{type:"void",properties:{collapse:{type:"void","x-decorator":"FormItem","x-component":"FormCollapse","x-component-props":{formCollapse:"{{formCollapse}}"},properties:{pane1:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:It("Measures"),key:"measures"},properties:{measures:hh({field:{type:"string","x-decorator":"FormItem","x-component":"Cascader","x-component-props":{placeholder:'{{t("Field")}}',fieldNames:{label:"title",value:"name",children:"children"}},enum:"{{ fieldOptions }}",required:!0},aggregation:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Aggregation")}}'},enum:[{label:'{{t("Sum")}}',value:"sum"},{label:'{{t("Count")}}',value:"count"},{label:'{{t("Avg")}}',value:"avg"},{label:'{{t("Max")}}',value:"max"},{label:'{{t("Min")}}',value:"min"}]},alias:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Alias")}}',style:{minWidth:"100px"}}}},{required:!0,"x-component-props":{style:{overflow:"auto"}}})}},pane2:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:It("Dimensions"),key:"dimensions"},properties:{dimensions:hh({field:{type:"string","x-decorator":"FormItem","x-component":"Cascader","x-component-props":{placeholder:'{{t("Field")}}',fieldNames:{label:"title",value:"name",children:"children"}},enum:"{{ fieldOptions }}",required:!0},format:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Format")}}',style:{maxWidth:"120px"}},"x-reactions":"{{ useFormatterOptions }}","x-visible":"{{ $self.dataSource && $self.dataSource.length }}"},alias:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Alias")}}',style:{minWidth:"100px"}}}},{"x-component-props":{style:{overflow:"auto"}}})}},pane3:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:It("Filter"),key:"filter"},properties:{filter:{type:"object","x-decorator":"FormItem","x-decorator-props":{style:{overflow:"auto"}},enum:"{{ filterOptions }}","x-component":"Filter","x-component-props":{dynamicComponent:"FilterDynamicComponent"}}}},pane4:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:It("Sort"),key:"sort"},properties:{orders:hh({field:{type:"string","x-decorator":"FormItem","x-component":"Cascader","x-component-props":{placeholder:'{{t("Field")}}'},"x-reactions":"{{ useOrderOptions }}",required:!0},order:{type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{defaultValue:"ASC",optionType:"button",style:{width:"128px"}},enum:["ASC","DESC"]}},{"x-reactions":"{{ useOrderReaction }}","x-component-props":{style:{overflow:"auto"}}})}}}},limit:{title:'{{t("Limit")}}',type:"number","x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{defaultValue:2e3,min:1,style:{width:"100px"}}}}},cache:{type:"object",properties:{enabled:{type:"boolean",title:'{{t("Enable cache")}}',"x-decorator":"FormItem","x-component":"Switch"},ttl:{type:"number",title:'{{t("TTL (second)")}}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{defaultValue:60,min:1,style:{width:"100px"}}}}}}}}},p7={type:"void",properties:{transform:hh({field:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Field")}}',style:{maxWidth:"100px"}},"x-reactions":"{{ useChartFields }}"},type:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Type")}}'},"x-reactions":"{{ useFieldTypeOptions }}"},format:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Format")}}'},"x-reactions":"{{ useTransformers }}","x-visible":"{{ $self.dataSource && $self.dataSource.length }}"}},{"x-decorator-props":{style:{width:"50%"}}})}};function v7(t){const{value:e,onChange:n,renderSchemaComponent:r}=t,i=f7();return Y.jsx(z.Variable.Input,{value:e,onChange:n,scope:i,children:r()})}const Mi=q.createContext({visible:!0});Mi.displayName="ChartConfigContext";const g7=t=>{var s;const{insertAdjacent:e}=z.useDesignable(),[n,r]=q.useState(!1),[i,o]=q.useState({}),{token:a}=Ot.theme.useToken();return Y.jsxs(Mi.Provider,{value:{visible:n,setVisible:r,current:i,setCurrent:o},children:[Y.jsx("div",{className:nl.css`
2
2
  .ant-card {
3
3
  border: ${a.lineWidth}px ${a.lineType} ${a.colorBorderSecondary};
4
4
  }
@@ -151,4 +151,4 @@ Error generating stack: `+o.message+`
151
151
  transform: translate(24px, 0);
152
152
  }
153
153
  }
154
- `,n.classList.add("loading"),n.innerHTML="<div></div><div></div><div></div><div></div>",e.appendChild(r),e.appendChild(n)},fmt=function(t){var e=t.loadingTemplate,n=t.theme,r=n===void 0?"light":n,i=q.useRef(null);q.useEffect(function(){!e&&i.current&&umt(i.current)},[]);var o=function(){return e||q.createElement("div",{ref:i})};return q.createElement("div",{className:"charts-loading-container",style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",left:0,top:0,zIndex:99,backgroundColor:r==="dark"?"rgb(20, 20, 20)":"rgb(255, 255, 255)"}},o())},dmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hmt=function(t){dmt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={hasError:!1},n.renderError=function(r){var i=n.props.errorTemplate;switch(r){default:return typeof i=="function"?i(r):i||q.createElement("h5",null,"组件出错了,请核查后重试: ",r.message)}},n}return e.getDerivedStateFromError=function(n){return{hasError:!0,error:n}},e.getDerivedStateFromProps=function(n,r){return r.children!==n.children?{children:n.children,hasError:!1,error:void 0}:null},e.prototype.render=function(){return this.state.hasError?this.renderError(this.state.error):q.createElement(q.Fragment,null,this.props.children)},e}(q.Component),pmt=typeof global=="object"&&global&&global.Object===Object&&global;const fR=pmt;var vmt=typeof self=="object"&&self&&self.Object===Object&&self,gmt=fR||vmt||Function("return this")();const wi=gmt;var ymt=wi.Symbol;const ti=ymt;var dR=Object.prototype,mmt=dR.hasOwnProperty,bmt=dR.toString,Ud=ti?ti.toStringTag:void 0;function xmt(t){var e=mmt.call(t,Ud),n=t[Ud];try{t[Ud]=void 0;var r=!0}catch(o){}var i=bmt.call(t);return r&&(e?t[Ud]=n:delete t[Ud]),i}var wmt=Object.prototype,Omt=wmt.toString;function _mt(t){return Omt.call(t)}var Smt="[object Null]",Emt="[object Undefined]",hR=ti?ti.toStringTag:void 0;function Qi(t){return t==null?t===void 0?Emt:Smt:hR&&hR in Object(t)?xmt(t):_mt(t)}function sr(t){return t!=null&&typeof t=="object"}var Mmt="[object Symbol]";function Vd(t){return typeof t=="symbol"||sr(t)&&Qi(t)==Mmt}var Pmt=NaN;function pR(t){return typeof t=="number"?t:Vd(t)?Pmt:+t}function Zg(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Amt=Array.isArray;const Vt=Amt;var Cmt=1/0,vR=ti?ti.prototype:void 0,gR=vR?vR.toString:void 0;function Qg(t){if(typeof t=="string")return t;if(Vt(t))return Zg(t,Qg)+"";if(Vd(t))return gR?gR.call(t):"";var e=t+"";return e=="0"&&1/t==-Cmt?"-0":e}function Tmt(t,e){return function(n,r){var i;if(n===void 0&&r===void 0)return e;if(n!==void 0&&(i=n),r!==void 0){if(i===void 0)return r;typeof n=="string"||typeof r=="string"?(n=Qg(n),r=Qg(r)):(n=pR(n),r=pR(r)),i=t(n,r)}return i}}var kmt=/\s/;function Lmt(t){for(var e=t.length;e--&&kmt.test(t.charAt(e)););return e}var Nmt=/^\s+/;function Imt(t){return t&&t.slice(0,Lmt(t)+1).replace(Nmt,"")}function Gn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var yR=NaN,jmt=/^[-+]0x[0-9a-f]+$/i,$mt=/^0b[01]+$/i,Dmt=/^0o[0-7]+$/i,Fmt=parseInt;function mR(t){if(typeof t=="number")return t;if(Vd(t))return yR;if(Gn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Gn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Imt(t);var n=$mt.test(t);return n||Dmt.test(t)?Fmt(t.slice(2),n?2:8):jmt.test(t)?yR:+t}var bR=1/0,Rmt=17976931348623157e292;function Bmt(t){if(!t)return t===0?t:0;if(t=mR(t),t===bR||t===-bR){var e=t<0?-1:1;return e*Rmt}return t===t?t:0}function xR(t){var e=Bmt(t),n=e%1;return e===e?n?e-n:e:0}function __(t){return t}var zmt="[object AsyncFunction]",Ymt="[object Function]",Wmt="[object GeneratorFunction]",Gmt="[object Proxy]";function Uc(t){if(!Gn(t))return!1;var e=Qi(t);return e==Ymt||e==Wmt||e==zmt||e==Gmt}var Hmt=wi["__core-js_shared__"];const S_=Hmt;var wR=function(){var t=/[^.]+$/.exec(S_&&S_.keys&&S_.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Umt(t){return!!wR&&wR in t}var Vmt=Function.prototype,Xmt=Vmt.toString;function Gs(t){if(t!=null){try{return Xmt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var qmt=/[\\^$.*+?()[\]{}|]/g,Kmt=/^\[object .+?Constructor\]$/,Zmt=Function.prototype,Qmt=Object.prototype,Jmt=Zmt.toString,t1t=Qmt.hasOwnProperty,e1t=RegExp("^"+Jmt.call(t1t).replace(qmt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function n1t(t){if(!Gn(t)||Umt(t))return!1;var e=Uc(t)?e1t:Kmt;return e.test(Gs(t))}function r1t(t,e){return t==null?void 0:t[e]}function Hs(t,e){var n=r1t(t,e);return n1t(n)?n:void 0}var i1t=Hs(wi,"WeakMap");const Xd=i1t;var o1t=Xd&&new Xd;const OR=o1t;var _R=Object.create,a1t=function(){function t(){}return function(e){if(!Gn(e))return{};if(_R)return _R(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();const E_=a1t;function s1t(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function M_(){}var l1t=4294967295;function Vc(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=l1t,this.__views__=[]}Vc.prototype=E_(M_.prototype),Vc.prototype.constructor=Vc;function SR(){}var c1t=OR?function(t){return OR.get(t)}:SR;const ER=c1t;var u1t={};const MR=u1t;var f1t=Object.prototype,d1t=f1t.hasOwnProperty;function Jg(t){for(var e=t.name+"",n=MR[e],r=d1t.call(MR,e)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==t)return i.name}return e}function Da(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Da.prototype=E_(M_.prototype),Da.prototype.constructor=Da;function P_(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function h1t(t){if(t instanceof Vc)return t.clone();var e=new Da(t.__wrapped__,t.__chain__);return e.__actions__=P_(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var p1t=Object.prototype,v1t=p1t.hasOwnProperty;function ty(t){if(sr(t)&&!Vt(t)&&!(t instanceof Vc)){if(t instanceof Da)return t;if(v1t.call(t,"__wrapped__"))return h1t(t)}return new Da(t)}ty.prototype=M_.prototype,ty.prototype.constructor=ty;function PR(t){var e=Jg(t),n=ty[e];if(typeof n!="function"||!(e in Vc.prototype))return!1;if(t===n)return!0;var r=ER(n);return!!r&&t===r[0]}var g1t=800,y1t=16,m1t=Date.now;function b1t(t){var e=0,n=0;return function(){var r=m1t(),i=y1t-(r-n);if(n=r,i>0){if(++e>=g1t)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function x1t(t){return function(){return t}}var w1t=function(){try{var t=Hs(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();const ey=w1t;var O1t=ey?function(t,e){return ey(t,"toString",{configurable:!0,enumerable:!1,value:x1t(e),writable:!0})}:__,_1t=b1t(O1t);const AR=_1t;function S1t(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function E1t(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function M1t(t){return t!==t}function P1t(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function CR(t,e,n){return e===e?P1t(t,e,n):E1t(t,M1t,n)}function A1t(t,e){var n=t==null?0:t.length;return!!n&&CR(t,e,0)>-1}var C1t=9007199254740991,T1t=/^(?:0|[1-9]\d*)$/;function ny(t,e){var n=typeof t;return e=e==null?C1t:e,!!e&&(n=="number"||n!="symbol"&&T1t.test(t))&&t>-1&&t%1==0&&t<e}function ry(t,e,n){e=="__proto__"&&ey?ey(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function qd(t,e){return t===e||t!==t&&e!==e}var k1t=Object.prototype,L1t=k1t.hasOwnProperty;function iy(t,e,n){var r=t[e];(!(L1t.call(t,e)&&qd(r,n))||n===void 0&&!(e in t))&&ry(t,e,n)}function Us(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=r?r(n[s],t[s],s,n,t):void 0;l===void 0&&(l=t[s]),i?ry(n,s,l):iy(n,s,l)}return n}var TR=Math.max;function kR(t,e,n){return e=TR(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=TR(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=n(a),s1t(t,this,s)}}function N1t(t,e){return AR(kR(t,e,__),t+"")}var I1t=9007199254740991;function A_(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=I1t}function Fa(t){return t!=null&&A_(t.length)&&!Uc(t)}function j1t(t,e,n){if(!Gn(n))return!1;var r=typeof e;return(r=="number"?Fa(n)&&ny(e,n.length):r=="string"&&e in n)?qd(n[e],t):!1}function LR(t){return N1t(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,a&&j1t(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var s=n[r];s&&t(e,s,r,o)}return e})}var $1t=Object.prototype;function oy(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||$1t;return t===n}function D1t(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var F1t="[object Arguments]";function NR(t){return sr(t)&&Qi(t)==F1t}var IR=Object.prototype,R1t=IR.hasOwnProperty,B1t=IR.propertyIsEnumerable,z1t=NR(function(){return arguments}())?NR:function(t){return sr(t)&&R1t.call(t,"callee")&&!B1t.call(t,"callee")};const Kd=z1t;function Y1t(){return!1}var jR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,$R=jR&&typeof module=="object"&&module&&!module.nodeType&&module,W1t=$R&&$R.exports===jR,DR=W1t?wi.Buffer:void 0,G1t=DR?DR.isBuffer:void 0,H1t=G1t||Y1t;const Zd=H1t;var U1t="[object Arguments]",V1t="[object Array]",X1t="[object Boolean]",q1t="[object Date]",K1t="[object Error]",Z1t="[object Function]",Q1t="[object Map]",J1t="[object Number]",tbt="[object Object]",ebt="[object RegExp]",nbt="[object Set]",rbt="[object String]",ibt="[object WeakMap]",obt="[object ArrayBuffer]",abt="[object DataView]",sbt="[object Float32Array]",lbt="[object Float64Array]",cbt="[object Int8Array]",ubt="[object Int16Array]",fbt="[object Int32Array]",dbt="[object Uint8Array]",hbt="[object Uint8ClampedArray]",pbt="[object Uint16Array]",vbt="[object Uint32Array]",Ee={};Ee[sbt]=Ee[lbt]=Ee[cbt]=Ee[ubt]=Ee[fbt]=Ee[dbt]=Ee[hbt]=Ee[pbt]=Ee[vbt]=!0,Ee[U1t]=Ee[V1t]=Ee[obt]=Ee[X1t]=Ee[abt]=Ee[q1t]=Ee[K1t]=Ee[Z1t]=Ee[Q1t]=Ee[J1t]=Ee[tbt]=Ee[ebt]=Ee[nbt]=Ee[rbt]=Ee[ibt]=!1;function gbt(t){return sr(t)&&A_(t.length)&&!!Ee[Qi(t)]}function C_(t){return function(e){return t(e)}}var FR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,Qd=FR&&typeof module=="object"&&module&&!module.nodeType&&module,ybt=Qd&&Qd.exports===FR,T_=ybt&&fR.process,mbt=function(){try{var t=Qd&&Qd.require&&Qd.require("util").types;return t||T_&&T_.binding&&T_.binding("util")}catch(e){}}();const Xc=mbt;var RR=Xc&&Xc.isTypedArray,bbt=RR?C_(RR):gbt;const k_=bbt;var xbt=Object.prototype,wbt=xbt.hasOwnProperty;function BR(t,e){var n=Vt(t),r=!n&&Kd(t),i=!n&&!r&&Zd(t),o=!n&&!r&&!i&&k_(t),a=n||r||i||o,s=a?D1t(t.length,String):[],l=s.length;for(var c in t)(e||wbt.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ny(c,l)))&&s.push(c);return s}function zR(t,e){return function(n){return t(e(n))}}var Obt=zR(Object.keys,Object);const _bt=Obt;var Sbt=Object.prototype,Ebt=Sbt.hasOwnProperty;function Mbt(t){if(!oy(t))return _bt(t);var e=[];for(var n in Object(t))Ebt.call(t,n)&&n!="constructor"&&e.push(n);return e}function Vs(t){return Fa(t)?BR(t):Mbt(t)}var Pbt=Object.prototype,Abt=Pbt.hasOwnProperty,Cbt=LR(function(t,e){if(oy(e)||Fa(e)){Us(e,Vs(e),t);return}for(var n in e)Abt.call(e,n)&&iy(t,n,e[n])});const YR=Cbt;function Tbt(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var kbt=Object.prototype,Lbt=kbt.hasOwnProperty;function Nbt(t){if(!Gn(t))return Tbt(t);var e=oy(t),n=[];for(var r in t)r=="constructor"&&(e||!Lbt.call(t,r))||n.push(r);return n}function Jd(t){return Fa(t)?BR(t,!0):Nbt(t)}var Ibt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jbt=/^\w*$/;function L_(t,e){if(Vt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Vd(t)?!0:jbt.test(t)||!Ibt.test(t)||e!=null&&t in Object(e)}var $bt=Hs(Object,"create");const th=$bt;function Dbt(){this.__data__=th?th(null):{},this.size=0}function Fbt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Rbt="__lodash_hash_undefined__",Bbt=Object.prototype,zbt=Bbt.hasOwnProperty;function Ybt(t){var e=this.__data__;if(th){var n=e[t];return n===Rbt?void 0:n}return zbt.call(e,t)?e[t]:void 0}var Wbt=Object.prototype,Gbt=Wbt.hasOwnProperty;function Hbt(t){var e=this.__data__;return th?e[t]!==void 0:Gbt.call(e,t)}var Ubt="__lodash_hash_undefined__";function Vbt(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=th&&e===void 0?Ubt:e,this}function Xs(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Xs.prototype.clear=Dbt,Xs.prototype.delete=Fbt,Xs.prototype.get=Ybt,Xs.prototype.has=Hbt,Xs.prototype.set=Vbt;function Xbt(){this.__data__=[],this.size=0}function ay(t,e){for(var n=t.length;n--;)if(qd(t[n][0],e))return n;return-1}var qbt=Array.prototype,Kbt=qbt.splice;function Zbt(t){var e=this.__data__,n=ay(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():Kbt.call(e,n,1),--this.size,!0}function Qbt(t){var e=this.__data__,n=ay(e,t);return n<0?void 0:e[n][1]}function Jbt(t){return ay(this.__data__,t)>-1}function txt(t,e){var n=this.__data__,r=ay(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Io(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Io.prototype.clear=Xbt,Io.prototype.delete=Zbt,Io.prototype.get=Qbt,Io.prototype.has=Jbt,Io.prototype.set=txt;var ext=Hs(wi,"Map");const eh=ext;function nxt(){this.size=0,this.__data__={hash:new Xs,map:new(eh||Io),string:new Xs}}function rxt(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function sy(t,e){var n=t.__data__;return rxt(e)?n[typeof e=="string"?"string":"hash"]:n.map}function ixt(t){var e=sy(this,t).delete(t);return this.size-=e?1:0,e}function oxt(t){return sy(this,t).get(t)}function axt(t){return sy(this,t).has(t)}function sxt(t,e){var n=sy(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function jo(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}jo.prototype.clear=nxt,jo.prototype.delete=ixt,jo.prototype.get=oxt,jo.prototype.has=axt,jo.prototype.set=sxt;var lxt="Expected a function";function N_(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(lxt);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(N_.Cache||jo),n}N_.Cache=jo;var cxt=500;function uxt(t){var e=N_(t,function(r){return n.size===cxt&&n.clear(),r}),n=e.cache;return e}var fxt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,dxt=/\\(\\)?/g,hxt=uxt(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(fxt,function(n,r,i,o){e.push(i?o.replace(dxt,"$1"):r||n)}),e});const pxt=hxt;function I_(t){return t==null?"":Qg(t)}function qc(t,e){return Vt(t)?t:L_(t,e)?[t]:pxt(I_(t))}var vxt=1/0;function Kc(t){if(typeof t=="string"||Vd(t))return t;var e=t+"";return e=="0"&&1/t==-vxt?"-0":e}function ly(t,e){e=qc(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Kc(e[n++])];return n&&n==r?t:void 0}function ve(t,e,n){var r=t==null?void 0:ly(t,e);return r===void 0?n:r}function j_(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var WR=ti?ti.isConcatSpreadable:void 0;function gxt(t){return Vt(t)||Kd(t)||!!(WR&&t&&t[WR])}function GR(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=gxt),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?GR(s,e-1,n,r,i):j_(i,s):r||(i[i.length]=s)}return i}function yxt(t){var e=t==null?0:t.length;return e?GR(t,1):[]}function $_(t){return AR(kR(t,void 0,yxt),t+"")}var mxt=zR(Object.getPrototypeOf,Object);const D_=mxt;var bxt="[object Object]",xxt=Function.prototype,wxt=Object.prototype,HR=xxt.toString,Oxt=wxt.hasOwnProperty,_xt=HR.call(Object);function F_(t){if(!sr(t)||Qi(t)!=bxt)return!1;var e=D_(t);if(e===null)return!0;var n=Oxt.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&HR.call(n)==_xt}function Sxt(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}var Ext=wi.isFinite,Mxt=Math.min;function Pxt(t){var e=Math[t];return function(n,r){if(n=mR(n),r=r==null?0:Mxt(xR(r),292),r&&Ext(n)){var i=(I_(n)+"e").split("e"),o=e(i[0]+"e"+(+i[1]+r));return i=(I_(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return e(n)}}var Axt=Pxt("ceil");const Cxt=Axt;function Txt(){this.__data__=new Io,this.size=0}function kxt(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Lxt(t){return this.__data__.get(t)}function Nxt(t){return this.__data__.has(t)}var Ixt=200;function jxt(t,e){var n=this.__data__;if(n instanceof Io){var r=n.__data__;if(!eh||r.length<Ixt-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new jo(r)}return n.set(t,e),this.size=n.size,this}function Oi(t){var e=this.__data__=new Io(t);this.size=e.size}Oi.prototype.clear=Txt,Oi.prototype.delete=kxt,Oi.prototype.get=Lxt,Oi.prototype.has=Nxt,Oi.prototype.set=jxt;function $xt(t,e){return t&&Us(e,Vs(e),t)}function Dxt(t,e){return t&&Us(e,Jd(e),t)}var UR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,VR=UR&&typeof module=="object"&&module&&!module.nodeType&&module,Fxt=VR&&VR.exports===UR,XR=Fxt?wi.Buffer:void 0,qR=XR?XR.allocUnsafe:void 0;function KR(t,e){if(e)return t.slice();var n=t.length,r=qR?qR(n):new t.constructor(n);return t.copy(r),r}function Rxt(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function ZR(){return[]}var Bxt=Object.prototype,zxt=Bxt.propertyIsEnumerable,QR=Object.getOwnPropertySymbols,Yxt=QR?function(t){return t==null?[]:(t=Object(t),Rxt(QR(t),function(e){return zxt.call(t,e)}))}:ZR;const R_=Yxt;function Wxt(t,e){return Us(t,R_(t),e)}var Gxt=Object.getOwnPropertySymbols,Hxt=Gxt?function(t){for(var e=[];t;)j_(e,R_(t)),t=D_(t);return e}:ZR;const JR=Hxt;function Uxt(t,e){return Us(t,JR(t),e)}function t9(t,e,n){var r=e(t);return Vt(t)?r:j_(r,n(t))}function B_(t){return t9(t,Vs,R_)}function e9(t){return t9(t,Jd,JR)}var Vxt=Hs(wi,"DataView");const z_=Vxt;var Xxt=Hs(wi,"Promise");const Y_=Xxt;var qxt=Hs(wi,"Set");const Zc=qxt;var n9="[object Map]",Kxt="[object Object]",r9="[object Promise]",i9="[object Set]",o9="[object WeakMap]",a9="[object DataView]",Zxt=Gs(z_),Qxt=Gs(eh),Jxt=Gs(Y_),t2t=Gs(Zc),e2t=Gs(Xd),qs=Qi;(z_&&qs(new z_(new ArrayBuffer(1)))!=a9||eh&&qs(new eh)!=n9||Y_&&qs(Y_.resolve())!=r9||Zc&&qs(new Zc)!=i9||Xd&&qs(new Xd)!=o9)&&(qs=function(t){var e=Qi(t),n=e==Kxt?t.constructor:void 0,r=n?Gs(n):"";if(r)switch(r){case Zxt:return a9;case Qxt:return n9;case Jxt:return r9;case t2t:return i9;case e2t:return o9}return e});const nh=qs;var n2t=Object.prototype,r2t=n2t.hasOwnProperty;function i2t(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&r2t.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var o2t=wi.Uint8Array;const cy=o2t;function W_(t){var e=new t.constructor(t.byteLength);return new cy(e).set(new cy(t)),e}function a2t(t,e){var n=e?W_(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var s2t=/\w*$/;function l2t(t){var e=new t.constructor(t.source,s2t.exec(t));return e.lastIndex=t.lastIndex,e}var s9=ti?ti.prototype:void 0,l9=s9?s9.valueOf:void 0;function c2t(t){return l9?Object(l9.call(t)):{}}function c9(t,e){var n=e?W_(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var u2t="[object Boolean]",f2t="[object Date]",d2t="[object Map]",h2t="[object Number]",p2t="[object RegExp]",v2t="[object Set]",g2t="[object String]",y2t="[object Symbol]",m2t="[object ArrayBuffer]",b2t="[object DataView]",x2t="[object Float32Array]",w2t="[object Float64Array]",O2t="[object Int8Array]",_2t="[object Int16Array]",S2t="[object Int32Array]",E2t="[object Uint8Array]",M2t="[object Uint8ClampedArray]",P2t="[object Uint16Array]",A2t="[object Uint32Array]";function C2t(t,e,n){var r=t.constructor;switch(e){case m2t:return W_(t);case u2t:case f2t:return new r(+t);case b2t:return a2t(t,n);case x2t:case w2t:case O2t:case _2t:case S2t:case E2t:case M2t:case P2t:case A2t:return c9(t,n);case d2t:return new r;case h2t:case g2t:return new r(t);case p2t:return l2t(t);case v2t:return new r;case y2t:return c2t(t)}}function u9(t){return typeof t.constructor=="function"&&!oy(t)?E_(D_(t)):{}}var T2t="[object Map]";function k2t(t){return sr(t)&&nh(t)==T2t}var f9=Xc&&Xc.isMap,L2t=f9?C_(f9):k2t;const N2t=L2t;var I2t="[object Set]";function j2t(t){return sr(t)&&nh(t)==I2t}var d9=Xc&&Xc.isSet,$2t=d9?C_(d9):j2t;const D2t=$2t;var F2t=1,R2t=2,B2t=4,h9="[object Arguments]",z2t="[object Array]",Y2t="[object Boolean]",W2t="[object Date]",G2t="[object Error]",p9="[object Function]",H2t="[object GeneratorFunction]",U2t="[object Map]",V2t="[object Number]",v9="[object Object]",X2t="[object RegExp]",q2t="[object Set]",K2t="[object String]",Z2t="[object Symbol]",Q2t="[object WeakMap]",J2t="[object ArrayBuffer]",twt="[object DataView]",ewt="[object Float32Array]",nwt="[object Float64Array]",rwt="[object Int8Array]",iwt="[object Int16Array]",owt="[object Int32Array]",awt="[object Uint8Array]",swt="[object Uint8ClampedArray]",lwt="[object Uint16Array]",cwt="[object Uint32Array]",ge={};ge[h9]=ge[z2t]=ge[J2t]=ge[twt]=ge[Y2t]=ge[W2t]=ge[ewt]=ge[nwt]=ge[rwt]=ge[iwt]=ge[owt]=ge[U2t]=ge[V2t]=ge[v9]=ge[X2t]=ge[q2t]=ge[K2t]=ge[Z2t]=ge[awt]=ge[swt]=ge[lwt]=ge[cwt]=!0,ge[G2t]=ge[p9]=ge[Q2t]=!1;function rh(t,e,n,r,i,o){var a,s=e&F2t,l=e&R2t,c=e&B2t;if(n&&(a=i?n(t,r,i,o):n(t)),a!==void 0)return a;if(!Gn(t))return t;var u=Vt(t);if(u){if(a=i2t(t),!s)return P_(t,a)}else{var f=nh(t),d=f==p9||f==H2t;if(Zd(t))return KR(t,s);if(f==v9||f==h9||d&&!i){if(a=l||d?{}:u9(t),!s)return l?Uxt(t,Dxt(a,t)):Wxt(t,$xt(a,t))}else{if(!ge[f])return i?t:{};a=C2t(t,f,s)}}o||(o=new Oi);var h=o.get(t);if(h)return h;o.set(t,a),D2t(t)?t.forEach(function(g){a.add(rh(g,e,n,g,t,o))}):N2t(t)&&t.forEach(function(g,y){a.set(y,rh(g,e,n,y,t,o))});var p=c?l?e9:B_:l?Jd:Vs,v=u?void 0:p(t);return S1t(v||t,function(g,y){v&&(y=g,g=t[y]),iy(a,y,rh(g,e,n,y,t,o))}),a}var uwt=1,fwt=4;function g9(t){return rh(t,uwt|fwt)}var dwt="__lodash_hash_undefined__";function hwt(t){return this.__data__.set(t,dwt),this}function pwt(t){return this.__data__.has(t)}function ih(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new jo;++e<n;)this.add(t[e])}ih.prototype.add=ih.prototype.push=hwt,ih.prototype.has=pwt;function vwt(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function y9(t,e){return t.has(e)}var gwt=1,ywt=2;function m9(t,e,n,r,i,o){var a=n&gwt,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=n&ywt?new ih:void 0;for(o.set(t,e),o.set(e,t);++f<s;){var p=t[f],v=e[f];if(r)var g=a?r(v,p,f,e,t,o):r(p,v,f,t,e,o);if(g!==void 0){if(g)continue;d=!1;break}if(h){if(!vwt(e,function(y,m){if(!y9(h,m)&&(p===y||i(p,y,n,r,o)))return h.push(m)})){d=!1;break}}else if(!(p===v||i(p,v,n,r,o))){d=!1;break}}return o.delete(t),o.delete(e),d}function mwt(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function G_(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var bwt=1,xwt=2,wwt="[object Boolean]",Owt="[object Date]",_wt="[object Error]",Swt="[object Map]",Ewt="[object Number]",Mwt="[object RegExp]",Pwt="[object Set]",Awt="[object String]",Cwt="[object Symbol]",Twt="[object ArrayBuffer]",kwt="[object DataView]",b9=ti?ti.prototype:void 0,H_=b9?b9.valueOf:void 0;function Lwt(t,e,n,r,i,o,a){switch(n){case kwt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Twt:return!(t.byteLength!=e.byteLength||!o(new cy(t),new cy(e)));case wwt:case Owt:case Ewt:return qd(+t,+e);case _wt:return t.name==e.name&&t.message==e.message;case Mwt:case Awt:return t==e+"";case Swt:var s=mwt;case Pwt:var l=r&bwt;if(s||(s=G_),t.size!=e.size&&!l)return!1;var c=a.get(t);if(c)return c==e;r|=xwt,a.set(t,e);var u=m9(s(t),s(e),r,i,o,a);return a.delete(t),u;case Cwt:if(H_)return H_.call(t)==H_.call(e)}return!1}var Nwt=1,Iwt=Object.prototype,jwt=Iwt.hasOwnProperty;function $wt(t,e,n,r,i,o){var a=n&Nwt,s=B_(t),l=s.length,c=B_(e),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in e:jwt.call(e,d)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var v=!0;o.set(t,e),o.set(e,t);for(var g=a;++f<l;){d=s[f];var y=t[d],m=e[d];if(r)var b=a?r(m,y,d,e,t,o):r(y,m,d,t,e,o);if(!(b===void 0?y===m||i(y,m,n,r,o):b)){v=!1;break}g||(g=d=="constructor")}if(v&&!g){var x=t.constructor,w=e.constructor;x!=w&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof w=="function"&&w instanceof w)&&(v=!1)}return o.delete(t),o.delete(e),v}var Dwt=1,x9="[object Arguments]",w9="[object Array]",uy="[object Object]",Fwt=Object.prototype,O9=Fwt.hasOwnProperty;function Rwt(t,e,n,r,i,o){var a=Vt(t),s=Vt(e),l=a?w9:nh(t),c=s?w9:nh(e);l=l==x9?uy:l,c=c==x9?uy:c;var u=l==uy,f=c==uy,d=l==c;if(d&&Zd(t)){if(!Zd(e))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new Oi),a||k_(t)?m9(t,e,n,r,i,o):Lwt(t,e,l,n,r,i,o);if(!(n&Dwt)){var h=u&&O9.call(t,"__wrapped__"),p=f&&O9.call(e,"__wrapped__");if(h||p){var v=h?t.value():t,g=p?e.value():e;return o||(o=new Oi),i(v,g,n,r,o)}}return d?(o||(o=new Oi),$wt(t,e,n,r,i,o)):!1}function fy(t,e,n,r,i){return t===e?!0:t==null||e==null||!sr(t)&&!sr(e)?t!==t&&e!==e:Rwt(t,e,n,r,fy,i)}var Bwt=1,zwt=2;function Ywt(t,e,n,r){var i=n.length,o=i,a=!r;if(t==null)return!o;for(t=Object(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){s=n[i];var l=s[0],c=t[l],u=s[1];if(a&&s[2]){if(c===void 0&&!(l in t))return!1}else{var f=new Oi;if(r)var d=r(c,u,l,t,e,f);if(!(d===void 0?fy(u,c,Bwt|zwt,r,f):d))return!1}}return!0}function _9(t){return t===t&&!Gn(t)}function Wwt(t){for(var e=Vs(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,_9(i)]}return e}function S9(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function Gwt(t){var e=Wwt(t);return e.length==1&&e[0][2]?S9(e[0][0],e[0][1]):function(n){return n===t||Ywt(n,t,e)}}function Hwt(t,e){return t!=null&&e in Object(t)}function Uwt(t,e,n){e=qc(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var a=Kc(e[r]);if(!(o=t!=null&&n(t,a)))break;t=t[a]}return o||++r!=i?o:(i=t==null?0:t.length,!!i&&A_(i)&&ny(a,i)&&(Vt(t)||Kd(t)))}function E9(t,e){return t!=null&&Uwt(t,e,Hwt)}var Vwt=1,Xwt=2;function qwt(t,e){return L_(t)&&_9(e)?S9(Kc(t),e):function(n){var r=ve(n,t);return r===void 0&&r===e?E9(n,t):fy(e,r,Vwt|Xwt)}}function Kwt(t){return function(e){return e==null?void 0:e[t]}}function Zwt(t){return function(e){return ly(e,t)}}function Qwt(t){return L_(t)?Kwt(Kc(t)):Zwt(t)}function U_(t){return typeof t=="function"?t:t==null?__:typeof t=="object"?Vt(t)?qwt(t[0],t[1]):Gwt(t):Qwt(t)}function Jwt(t,e,n,r){for(var i=-1,o=t==null?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function tOt(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var eOt=tOt();const M9=eOt;function nOt(t,e){return t&&M9(t,e,Vs)}function rOt(t,e){return function(n,r){if(n==null)return n;if(!Fa(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var iOt=rOt(nOt);const P9=iOt;function oOt(t,e,n,r){return P9(t,function(i,o,a){e(r,i,n(i),a)}),r}function aOt(t,e){return function(n,r){var i=Vt(n)?Jwt:oOt,o=e?e():{};return i(n,t,U_(r),o)}}function V_(t,e,n){(n!==void 0&&!qd(t[e],n)||n===void 0&&!(e in t))&&ry(t,e,n)}function sOt(t){return sr(t)&&Fa(t)}function X_(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function lOt(t){return Us(t,Jd(t))}function cOt(t,e,n,r,i,o,a){var s=X_(t,n),l=X_(e,n),c=a.get(l);if(c){V_(t,n,c);return}var u=o?o(s,l,n+"",t,e,a):void 0,f=u===void 0;if(f){var d=Vt(l),h=!d&&Zd(l),p=!d&&!h&&k_(l);u=l,d||h||p?Vt(s)?u=s:sOt(s)?u=P_(s):h?(f=!1,u=KR(l,!0)):p?(f=!1,u=c9(l,!0)):u=[]:F_(l)||Kd(l)?(u=s,Kd(s)?u=lOt(s):(!Gn(s)||Uc(s))&&(u=u9(l))):f=!1}f&&(a.set(l,u),i(u,l,r,o,a),a.delete(l)),V_(t,n,u)}function A9(t,e,n,r,i){t!==e&&M9(e,function(o,a){if(i||(i=new Oi),Gn(o))cOt(t,e,a,n,A9,r,i);else{var s=r?r(X_(t,a),o,a+"",t,e,i):void 0;s===void 0&&(s=o),V_(t,a,s)}},Jd)}var uOt=LR(function(t,e,n,r){A9(t,e,n,r)});const fOt=uOt;function dOt(t,e,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function hOt(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var pOt=Tmt(function(t,e){return t/e},1);const vOt=pOt;function gOt(t,e){var n=-1,r=Fa(t)?Array(t.length):[];return P9(t,function(i,o,a){r[++n]=e(i,o,a)}),r}function Qc(t,e){var n=Vt(t)?Zg:gOt;return n(t,U_(e))}var yOt="Expected a function",mOt=8,bOt=32,xOt=128,wOt=256;function OOt(t){return $_(function(e){var n=e.length,r=n,i=Da.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new TypeError(yOt);if(i&&!a&&Jg(o)=="wrapper")var a=new Da([],!0)}for(r=a?r:n;++r<n;){o=e[r];var s=Jg(o),l=s=="wrapper"?ER(o):void 0;l&&PR(l[0])&&l[1]==(xOt|mOt|bOt|wOt)&&!l[4].length&&l[9]==1?a=a[Jg(l[0])].apply(a,l[3]):a=o.length==1&&PR(o)?a[s]():a.thru(o)}return function(){var c=arguments,u=c[0];if(a&&c.length==1&&Vt(u))return a.plant(u).value();for(var f=0,d=n?e[f].apply(this,c):u;++f<n;)d=e[f].call(this,d);return d}})}var _Ot=OOt();const zt=_Ot;var SOt=Object.prototype,EOt=SOt.hasOwnProperty,MOt=aOt(function(t,e,n){EOt.call(t,n)?t[n].push(e):ry(t,n,[e])});const C9=MOt;var POt="[object String]";function T9(t){return typeof t=="string"||!Vt(t)&&sr(t)&&Qi(t)==POt}function AOt(t,e){return Zg(e,function(n){return t[n]})}function COt(t){return t==null?[]:AOt(t,Vs(t))}var TOt=Math.max;function kOt(t,e,n,r){t=Fa(t)?t:COt(t),n=n&&!r?xR(n):0;var i=t.length;return n<0&&(n=TOt(i+n,0)),T9(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&CR(t,e,n)>-1}function LOt(t,e){return e.length<2?t:ly(t,Sxt(e,0,-1))}var NOt="[object Boolean]";function q_(t){return t===!0||t===!1||sr(t)&&Qi(t)==NOt}function k9(t,e){return fy(t,e)}var IOt="[object Number]";function Jc(t){return typeof t=="number"||sr(t)&&Qi(t)==IOt}function jOt(t){return t==null}function $Ot(t){return t===void 0}function DOt(t,e){return e=qc(e,t),t=LOt(t,e),t==null||delete t[Kc(hOt(e))]}function FOt(t){return F_(t)?void 0:t}var ROt=1,BOt=2,zOt=4,YOt=$_(function(t,e){var n={};if(t==null)return n;var r=!1;e=Zg(e,function(o){return o=qc(o,t),r||(r=o.length>1),o}),Us(t,e9(t),n),r&&(n=rh(n,ROt|BOt|zOt,FOt));for(var i=e.length;i--;)DOt(n,e[i]);return n});const K_=YOt;function L9(t,e,n,r){if(!Gn(t))return t;e=qc(e,t);for(var i=-1,o=e.length,a=o-1,s=t;s!=null&&++i<o;){var l=Kc(e[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var u=s[l];c=r?r(u,l,s):void 0,c===void 0&&(c=Gn(u)?u:ny(e[i+1])?[]:{})}iy(s,l,c),s=s[l]}return t}function WOt(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=ly(t,a);n(s,a)&&L9(o,qc(a,t),s)}return o}function GOt(t,e){return WOt(t,e,function(n,r){return E9(t,r)})}var HOt=$_(function(t,e){return t==null?{}:GOt(t,e)});const N9=HOt;function dt(t,e,n){return t==null?t:L9(t,e,n)}var UOt=1/0,VOt=Zc&&1/G_(new Zc([,-0]))[1]==UOt?function(t){return new Zc(t)}:SR;const XOt=VOt;var qOt=200;function KOt(t,e,n){var r=-1,i=A1t,o=t.length,a=!0,s=[],l=s;if(n)a=!1,i=dOt;else if(o>=qOt){var c=e?null:XOt(t);if(c)return G_(c);a=!1,i=y9,l=new ih}else l=e?[]:s;t:for(;++r<o;){var u=t[r],f=e?e(u):u;if(u=n||u!==0?u:0,a&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue t;e&&l.push(f),s.push(u)}else i(l,f,n)||(l!==s&&l.push(f),s.push(u))}return s}function Z_(t,e){return t&&t.length?KOt(t,U_(e)):[]}var ZOt=function(t){var e=/react|\.jsx|children:\[\(|return\s+[A-Za-z0-9].createElement\((?!['"][g|circle|ellipse|image|rect|line|polyline|polygon|text|path|html|mesh]['"])([^\)])*,/i;return e.test(t)},Q_=function(){return Q_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Q_.apply(this,arguments)},I9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function QOt(t,e){var n=q.useRef(),r=q.useRef(),i=q.useRef(null),o=e.onReady,a=e.onEvent,s=function(u,f){var d;u===void 0&&(u="image/png");var h=(d=i.current)===null||d===void 0?void 0:d.getElementsByTagName("canvas")[0];return h==null?void 0:h.toDataURL(u,f)},l=function(u,f,d){u===void 0&&(u="download"),f===void 0&&(f="image/png");var h=u;u.indexOf(".")===-1&&(h="".concat(u,".").concat(f.split("/")[1]));var p=s(f,d),v=document.createElement("a");return v.href=p,v.download=h,document.body.appendChild(v),v.click(),document.body.removeChild(v),v=null,h},c=function(u,f){f===void 0&&(f=!1);var d=Object.keys(u),h=f;d.forEach(function(p){var v=u[p];p==="tooltip"&&(h=!0),Uc(v)&&ZOt("".concat(v))?u[p]=function(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];return cmt(v.apply(void 0,g),h)}:Vt(v)?v.forEach(function(g){c(g,h)}):Gn(v)?c(v,h):h=f})};return q.useEffect(function(){if(n.current&&!k9(r.current,e)){var u=!1;if(r.current){var f=r.current;f.data;var d=I9(f,["data"]);e.data;var h=I9(e,["data"]);u=k9(d,h)}r.current=g9(e),u?n.current.changeData(ve(e,"data")):(c(e),n.current.update(e),n.current.render())}},[e]),q.useEffect(function(){if(!i.current)return function(){return null};r.current||(r.current=g9(e)),c(e);var u=new t(i.current,Q_({},e));u.toDataURL=s,u.downloadImage=l,u.render(),n.current=u,o&&o(u);var f=function(d){a&&a(u,d)};return u.on("*",f),function(){n.current&&(n.current.destroy(),n.current.off("*",f),n.current=void 0)}},[]),{chart:n,container:i}}var JOt=function(t){return t!==null&&typeof t!="function"&&isFinite(t.length)};const j9=JOt;var t_t=function(t,e){if(!j9(t))return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];e(i,r)&&n.push(i)}return n};const e_t=t_t,n_t=function(t){return typeof t=="function"};var r_t=function(t){return t==null};const i_t=r_t;var o_t={}.toString,a_t=function(t,e){return o_t.call(t)==="[object "+e+"]"};const J_=a_t,tu=function(t){return Array.isArray?Array.isArray(t):J_(t,"Array")},s_t=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function tS(t,e){if(t){var n;if(tu(t))for(var r=0,i=t.length;r<i&&(n=e(t[r],r),n!==!1);r++);else if(s_t(t)){for(var o in t)if(t.hasOwnProperty(o)&&(n=e(t[o],o),n===!1))break}}}var l_t=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return tS(t,function(n,r){n_t(t)&&r==="prototype"||e.push(r)}),e};const c_t=l_t;var u_t=function(t){return typeof t=="object"&&t!==null};const f_t=u_t;var d_t=function(t){if(!f_t(t)||!J_(t,"Object"))return!1;if(Object.getPrototypeOf(t)===null)return!0;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};const dy=d_t;var h_t=function(t,e,n){if(!tu(t)&&!dy(t))return t;var r=n;return tS(t,function(i,o){r=e(r,i,o)}),r};const p_t=h_t,eS=function(t){return J_(t,"String")};function nS(t,e){for(var n in e)e.hasOwnProperty(n)&&n!=="constructor"&&e[n]!==void 0&&(t[n]=e[n])}function v_t(t,e,n,r){return e&&nS(t,e),n&&nS(t,n),r&&nS(t,r),t}var g_t=5;function y_t(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(t==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function $9(t,e,n,r){n=n||0,r=r||g_t;for(var i in e)if(y_t(e,i)){var o=e[i];o!==null&&dy(o)?(dy(t[i])||(t[i]={}),n<r?$9(t[i],o,n+1,r):t[i]=e[i]):tu(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var m_t=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)$9(t,e[r]);return t};const hy=m_t,Ji=function(t,e,n){for(var r=0,i=eS(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return t===void 0||r<i.length?n:t};var b_t=Object.prototype.hasOwnProperty;const D9=function(t,e){if(t===null||!dy(t))return{};var n={};return tS(e,function(r){b_t.call(t,r)&&(n[r]=t[r])}),n};function x_t(t){return i_t(t)?0:j9(t)?t.length:Object.keys(t).length}const w_t={field:"value",size:[1,1],round:!1,padding:0,sort:(t,e)=>e.value-t.value,as:["x","y"],ignoreParentValue:!0},O_t="nodeIndex",oh="childNodeCount",__t="nodeAncestor",rS="Invalid field: it must be a string!";function S_t(t,e){const{field:n,fields:r}=t;if(eS(n))return n;if(tu(n))return console.warn(rS),n[0];if(console.warn(`${rS} will try to get fields instead.`),eS(r))return r;if(tu(r)&&r.length)return r[0];if(e)return e;throw new TypeError(rS)}function E_t(t){const e=[];if(t&&t.each){let n,r;t.each(i=>{var o,a;i.parent!==n?(n=i.parent,r=0):r+=1;const s=e_t((((o=i.ancestors)===null||o===void 0?void 0:o.call(i))||[]).map(l=>e.find(c=>c.name===l.name)||l),({depth:l})=>l>0&&l<i.depth);i[__t]=s,i[oh]=((a=i.children)===null||a===void 0?void 0:a.length)||0,i[O_t]=r,e.push(i)})}else t&&t.eachNode&&t.eachNode(n=>{e.push(n)});return e}function M_t(t,e){e=v_t({},w_t,e);const n=e.as;if(!tu(n)||n.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');let r;try{r=S_t(e)}catch(l){console.warn(l)}const o=(l=>urt().size(e.size).round(e.round).padding(e.padding)(Yl(l).sum(c=>x_t(c.children)?e.ignoreParentValue?0:c[r]-p_t(c.children,(u,f)=>u+f[r],0):c[r]).sort(e.sort)))(t),a=n[0],s=n[1];return o.each(l=>{var c,u;l[a]=[l.x0,l.x1,l.x1,l.x0],l[s]=[l.y1,l.y1,l.y0,l.y0],l.name=l.name||((c=l.data)===null||c===void 0?void 0:c.name)||((u=l.data)===null||u===void 0?void 0:u.label),l.data.name=l.name,["x0","x1","y0","y1"].forEach(f=>{n.indexOf(f)===-1&&delete l[f]})}),E_t(o)}var P_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const eu="sunburst",iS="markType",F9="path",py="ancestor-node";function A_t(t){const{data:e,encode:n}=t,{color:r,value:i}=n,a=M_t(e,{field:i,type:"hierarchy.partition",as:["x","y"]}),s=[];return a.forEach(l=>{var c,u,f,d;if(l.depth===0)return null;let h=l.data.name;const p=[h];let v=Object.assign({},l);for(;v.depth>1;)h=`${(c=v.parent.data)===null||c===void 0?void 0:c.name} / ${h}`,p.unshift((u=v.parent.data)===null||u===void 0?void 0:u.name),v=v.parent;const g=Object.assign(Object.assign(Object.assign({},D9(l.data,[i])),{[F9]:h,[py]:v.data.name}),l);r&&r!==py&&(g[r]=l.data[r]||((d=(f=l.parent)===null||f===void 0?void 0:f.data)===null||d===void 0?void 0:d[r])),s.push(g)}),s.map(l=>Object.assign(Object.assign({},l),{x:l.x.slice(0,2),y:[l.y[2],l.y[0]],fillOpacity:Math.pow(.85,l.depth)}))}const R9={id:eu,encode:{x:"x",y:"y",key:F9,color:py,value:"value"},axis:{x:!1,y:!1},style:{[iS]:eu,stroke:"#fff",lineWidth:.5,fillOpacity:"fillOpacity",[oh]:oh,depth:"depth"},state:{active:{zIndex:2,stroke:"#000"},inactive:{zIndex:1,stroke:"#fff"}},legend:!1,interaction:{drillDown:!0},coordinate:{type:"polar",innerRadius:.2}},B9=t=>{const{encode:e,data:n=[],legend:r}=t,i=P_t(t,["encode","data","legend"]),o=Object.assign(Object.assign({},i.coordinate),{innerRadius:Math.max(Ji(i,["coordinate","innerRadius"],.2),1e-5)}),a=Object.assign(Object.assign({},R9.encode),e),{value:s}=a,l=A_t({encode:a,data:n});return[hy({},R9,Object.assign(Object.assign({type:"rect",data:l,encode:a,tooltip:{title:"path",items:[c=>({name:s,value:c[s]})]}},i),{coordinate:o}))]};B9.props={};var C_t=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};const T_t=t=>t.querySelectorAll(".element").filter(e=>Ji(e,["style",iS])===eu);function k_t(t){return pt(t).select(`.${Lf}`).node()}const L_t={rootText:"root",style:{fill:"rgba(0, 0, 0, 0.85)",fontSize:12,y:1},active:{fill:"rgba(0, 0, 0, 0.5)"}};function N_t(t={}){const{breadCrumb:e={},fixedColor:n=!0}=t,r=hy({},L_t,e);return i=>{const{update:o,setState:a,container:s,view:l,options:c}=i,u=k_t(s),f=c.marks.find(({id:m})=>m===eu),{state:d}=f,h=new an;u.appendChild(h);const p=(m,b)=>C_t(this,void 0,void 0,function*(){if(h.removeChildren(),m){const x=new jr({style:Object.assign({x:0,text:r.rootText,depth:0},r.style)});h.appendChild(x);let w="";const O=m==null?void 0:m.split(" / ");let _=r.style.y,S=h.getBBox().width;const E=u.getBBox().width,M=O.map((P,C)=>{const A=new jr({style:Object.assign(Object.assign({x:S,text:" / "},r.style),{y:_})});h.appendChild(A),S+=A.getBBox().width,w=`${w}${P} / `;const T=new jr({name:w.replace(/\s\/\s$/,""),style:Object.assign(Object.assign({text:P,x:S,depth:C+1},r.style),{y:_})});return h.appendChild(T),S+=T.getBBox().width,S>E&&(_=h.getBBox().height,S=0,A.attr({x:S,y:_}),S+=A.getBBox().width,T.attr({x:S,y:_}),S+=T.getBBox().width),T});[x,...M].forEach((P,C)=>{if(C===M.length)return;const A=Object.assign({},P.attributes);P.attr("cursor","pointer"),P.addEventListener("mouseenter",()=>{P.attr(r.active)}),P.addEventListener("mouseleave",()=>{P.attr(A)}),P.addEventListener("click",()=>{p(P.name,Ji(P,["style","depth"]))})})}a("drillDown",x=>{const{marks:w}=x,O=w.map(_=>{if(_.id!==eu&&_.type!=="rect")return _;const{data:S}=_,E=Object.fromEntries(["color"].map(P=>[P,{domain:l.scale[P].getOptions().domain}])),M=S.filter(P=>{const C=P.path;return n&&(P[py]=C.split(" / ")[b]),m?new RegExp(`^${m}.+`).test(C):!0});return hy({},_,n?{data:M}:{data:M,scale:E})});return Object.assign(Object.assign({},x),{marks:O})}),yield o()}),v=m=>{const b=m.target;if(Ji(b,["style",iS])!==eu||Ji(b,["markType"])!=="rect"||!Ji(b,["style",oh]))return;const x=Ji(b,["__data__","key"]),w=Ji(b,["style","depth"]);b.style.cursor="pointer",p(x,w)};u.addEventListener("click",v);const g=c_t(Object.assign(Object.assign({},d.active),d.inactive)),y=()=>{T_t(u).forEach(b=>{const x=Ji(b,["style",oh]);if(Ji(b,["style","cursor"])!=="pointer"&&x){b.style.cursor="pointer";const O=D9(b.attributes,g);b.addEventListener("mouseenter",()=>{b.attr(d.active)}),b.addEventListener("mouseleave",()=>{b.attr(hy(O,d.inactive))})}})};return u.addEventListener("mousemove",y),()=>{h.remove(),u.removeEventListener("click",v),u.removeEventListener("mousemove",y)}}}U.enableCSSParsing=!1;function I_t(){return{"interaction.drillDown":N_t,"mark.sunburst":B9}}var vy=function(){return vy=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},vy.apply(this,arguments)},j_t=Svt(Qvt,vy(vy({},WD()),I_t())),Xt=function(t){var e=D_t(t),n=e.children,r=n===void 0?[]:n,i=K_(e,[].concat(W9,gy.map(function(c){return c.key}))),o=function(c){var u;return(u=Y_t.find(function(f){return f.key===c}))===null||u===void 0?void 0:u.callback},a=function(c,u,f){var d=o(u);d?d(c,u,f):c[u]=Ra({},c[u],f)},s=function(c){Object.keys(c).forEach(function(u){var f=gy.find(function(p){return p.key===u});if(f){var d=f.type,h=f.extend_keys;d?r.push(l(Ra({},N9(c,h),{type:d},c[u]))):Vt(c[u])&&c[u].forEach(function(p){r.push(l(p))})}})},l=function(c){return s(c),Object.keys(aS).forEach(function(u){var f=aS[u];if(!$Ot(c[u]))if(Gn(f)){var d=f.value,h=f.target,p=d(c[u]);a(c,h,p)}else dt(c,f,c[u])}),c};return r.forEach(function(c){var u=Ra({},i,c);l(Ra(c,u))}),s(e),$_t(e),t},z9=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},$_t=function(t){var e=t.children,n=e===void 0?[]:e,r=Object.keys(aS).concat(gy.map(function(i){return i.key}));return r.forEach(function(i){delete t[i]}),n.forEach(function(i){Object.keys(i).forEach(function(o){r.includes(o)&&delete i[o]})}),Object.keys(t).forEach(function(i){z9(z9([],W9,!0),lS.map(function(o){return o.key}),!0).includes(i)||delete t[i]}),t},D_t=function(t){var e=t.options,n=e.children,r=n===void 0?[]:n;return r.forEach(function(i){Object.keys(i).forEach(function(o){Vt(i[o])&&o!=="data"&&(i[o]=i[o].filter(function(a){return!a[oS]}))})}),e},Y9=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},F_t=function(t,e){if(Vt(e))return e},Ra=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return fOt.apply(void 0,Y9(Y9([],t,!1),[F_t],!1))},ah=function(){return ah=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ah.apply(this,arguments)},R_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},B_t=["renderer"],W9=["width","height","autoFit","theme","inset","insetLeft","insetRight","insetTop","insetBottom","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","depth","title","clip","children","type","data","direction"],oS="__transform__",z_t="__skipDelCustomKeys__",Ks=function(t,e){return q_(e)?{type:t,available:e}:ah({type:t},e)},aS={xField:"encode.x",yField:"encode.y",colorField:"encode.color",angleField:"encode.y",keyField:"encode.key",sizeField:"encode.size",shapeField:"encode.shape",seriesField:"encode.series",positionField:"encode.position",textField:"encode.text",valueField:"encode.value",binField:"encode.x",srcField:"encode.src",linkColorField:"encode.linkColor",radius:"coordinate.outerRadius",innerRadius:"coordinate.innerRadius",startAngle:"coordinate.startAngle",endAngle:"coordinate.endAngle",focusX:"coordinate.focusX",focusY:"coordinate.focusY",distortionX:"coordinate.distortionX",distortionY:"coordinate.distortionY",visual:"coordinate.visual",stack:{target:"transform",value:function(t){return Ks("stackY",t)}},normalize:{target:"transform",value:function(t){return Ks("normalizeY",t)}},percent:{target:"transform",value:function(t){return Ks("normalizeY",t)}},group:{target:"transform",value:function(t){return Ks("dodgeX",t)}},sort:{target:"transform",value:function(t){return Ks("sortX",t)}},symmetry:{target:"transform",value:function(t){return Ks("symmetryY",t)}},diff:{target:"transform",value:function(t){return Ks("diffY",t)}},meta:{target:"scale",value:function(t){return t}},label:{target:"labels",value:function(t){return t}},shape:"style.shape",connectNulls:{target:"style",value:function(t){return q_(t)?{connect:t}:t}}},sS=["xField","yField","seriesField","colorField","keyField","positionField","meta","tooltip","animate","stack","normalize","percent","group","sort","symmetry","diff"],gy=[{key:"annotations",extend_keys:[]},{key:"line",type:"line",extend_keys:sS},{key:"point",type:"point",extend_keys:sS},{key:"area",type:"area",extend_keys:sS}],Y_t=[{key:"transform",callback:function(t,e,n){var r;t[e]=t[e]||[];var i=n.available,o=i===void 0?!0:i,a=R_t(n,["available"]);o?t[e].push(ah((r={},r[oS]=!0,r),a)):t[e].splice(t[e].indexOf(function(s){return s.type===n.type}),1)}},{key:"labels",callback:function(t,e,n){var r;if(!n||Vt(n)){t[e]=n||[];return}n.text||(n.text=t.yField),t[e]=t[e]||[],t[e].push(ah((r={},r[oS]=!0,r),n))}}],lS=[{key:"conversionTag",shape:"ConversionTag"},{key:"axisText",shape:"BidirectionalBarAxisText"}],W_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),yy=function(){return yy=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},yy.apply(this,arguments)},G_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},G9=function(t){W_t(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=G_t(n,["style"]);return t.call(this,yy({style:yy({text:"",fontSize:12,textBaseline:"middle",textAlign:"center",fill:"#000",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1},r)},i))||this}return e}(jr),H_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),my=function(){return my=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},my.apply(this,arguments)},U_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},V_t=function(t){H_t(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=U_t(n,["style"]);return t.call(this,my({style:my({fill:"#eee"},r)},i))||this}return e}(rf),X_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),H9=function(t){X_t(e,t);function e(n,r,i){var o=t.call(this,{style:Ra(i,r)})||this;return o.chart=n,o}return e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this)},e.prototype.disconnectedCallback=function(){},e.prototype.attributeChangedCallback=function(n){},e.prototype.update=function(n,r){var i;return this.attr(Ra({},this.attributes,n||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,r)},e.prototype.clear=function(){this.removeChildren()},e.prototype.getElementsLayout=function(){var n=this.chart.getContext().canvas,r=n.document.getElementsByClassName("element"),i=[];return r.forEach(function(o){var a=o.getBBox(),s=a.x,l=a.y,c=a.width,u=a.height,f=o.__data__;i.push({bbox:a,x:s,y:l,width:c,height:u,key:f.key,data:f})}),i},e.prototype.bindEvents=function(n,r){},e}(wp),q_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),by=function(){return by=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},by.apply(this,arguments)},K_t=function(t){q_t(e,t);function e(n,r){return t.call(this,n,r,{type:e.tag})||this}return e.prototype.getConversionTagLayout=function(){var n=this.direction==="vertical",r=this.getElementsLayout(),i=r[0],o=i.x,a=i.y,s=i.height,l=i.width,c=i.data,u=["items",0,"value"],f=ve(c,u),d=n?r[1].y-a-s:r[1].x-o-l,h=[],p=this.attributes,v=p.size,g=v===void 0?40:v,y=p.arrowSize,m=y===void 0?20:y,b=p.spacing,x=b===void 0?4:b;return r.forEach(function(w,O){if(O>0){var _=w.x,S=w.y,E=w.height,M=w.width,P=w.data,C=w.key,A=ve(P,u),T=g/2;if(n){var k=_+M/2,N=S;h.push({points:[[k+T,N-d+x],[k+T,N-m-x],[k,N-x],[k-T,N-m-x],[k-T,N-d+x]],center:[k,N-d/2-x],width:d,value:[f,A],key:C})}else{var k=_,N=S+E/2;h.push({points:[[_-d+x,N-T],[_-m-x,N-T],[k-x,N],[_-m-x,N+T],[_-d+x,N+T]],center:[k-d/2-x,N],width:d,value:[f,A],key:C})}f=A}}),h},e.prototype.render=function(){this.setDirection(),this.drawConversionTag()},e.prototype.setDirection=function(){var n=this.chart.getCoordinate(),r=ve(n,"options.transformations"),i="horizontal";r.forEach(function(o){o.includes("transpose")&&(i="vertical")}),this.direction=i},e.prototype.drawConversionTag=function(){var n=this,r=this.getConversionTagLayout(),i=this.attributes,o=i.style,a=i.text,s=a.style,l=a.formatter;r.forEach(function(c){var u=c.points,f=c.center,d=c.value,h=c.key,p=d[0],v=d[1],g=f[0],y=f[1],m=new V_t({style:by({points:u,fill:"#eee"},o),id:"polygon-".concat(h)}),b=new G9({style:by({x:g,y,text:Uc(l)?l(p,v):(v/p*100).toFixed(2)+"%"},s),id:"text-".concat(h)});n.appendChild(m),n.appendChild(b)})},e.prototype.update=function(){var n=this,r=this.getConversionTagLayout();r.forEach(function(i){var o=i.points,a=i.center,s=i.key,l=a[0],c=a[1],u=n.getElementById("polygon-".concat(s)),f=n.getElementById("text-".concat(s));u.setAttribute("points",o),f.setAttribute("x",l),f.setAttribute("y",c)})},e.tag="ConversionTag",e}(H9),cS=32,U9=16,V9=48,Z_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sh=function(){return sh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},sh.apply(this,arguments)},Q_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},J_t=function(t){Z_t(e,t);function e(n,r){return t.call(this,n,r,{type:e.tag})||this}return e.prototype.render=function(){this.drawText()},e.prototype.getBidirectionalBarAxisTextLayout=function(){var n=this.attributes.layout,r=n==="vertical",i=this.getElementsLayout(),o=r?Z_(i,"x"):Z_(i,"y"),a=["title"],s=[],l=this.chart.getContext().views,c=ve(l,[0,"layout"]),u=c.width,f=c.height;return o.forEach(function(d){var h=d.x,p=d.y,v=d.height,g=d.width,y=d.data,m=d.key,b=ve(y,a);r?s.push({x:h+g/2,y:f,text:b,key:m}):s.push({x:u,y:p+v/2,text:b,key:m})}),Z_(s,"text").length!==s.length&&(s=Object.values(C9(s,"text")).map(function(d){var h,p=d.reduce(function(v,g){return v+(r?g.x:g.y)},0);return sh(sh({},d[0]),(h={},h[r?"x":"y"]=p/d.length,h))})),s},e.prototype.transformLabelStyle=function(n){var r={},i=/^label[A-Z]/;return Object.keys(n).forEach(function(o){i.test(o)&&(r[o.replace("label","").replace(/^[A-Z]/,function(a){return a.toLowerCase()})]=n[o])}),r},e.prototype.drawText=function(){var n=this,r=this.getBidirectionalBarAxisTextLayout(),i=this.attributes,o=i.layout,a=i.labelFormatter,s=Q_t(i,["layout","labelFormatter"]);r.forEach(function(l){var c=l.x,u=l.y,f=l.text,d=l.key,h=new G9({style:sh({x:c,y:u,text:Uc(a)?a(f):f,wordWrap:!0,wordWrapWidth:o==="horizontal"?cS*2:120,maxLines:2,textOverflow:"ellipsis"},n.transformLabelStyle(s)),id:"text-".concat(d)});n.appendChild(h)})},e.prototype.update=function(){var n=this,r=this.getBidirectionalBarAxisTextLayout();r.forEach(function(i){var o=i.x,a=i.y,s=i.key,l=n.getElementById("text-".concat(s));l.setAttribute("x",o),l.setAttribute("y",a)})},e.tag="BidirectionalBarAxisText",e}(H9),tSt={ConversionTag:K_t,BidirectionalBarAxisText:J_t},eSt=function(){function t(e,n){this.container=new Map,this.chart=e,this.config=n,this.init()}return t.prototype.init=function(){var e=this;lS.forEach(function(n){var r,i=n.key,o=n.shape,a=e.config[i];if(a){var s=new tSt[o](e.chart,a),l=e.chart.getContext().canvas;l.appendChild(s),e.container.set(i,s)}else(r=e.container.get(i))===null||r===void 0||r.clear()})},t.prototype.update=function(){var e=this;this.container.size&&lS.forEach(function(n){var r=n.key,i=e.container.get(r);i==null||i.update()})},t}(),nSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),nu=function(){return nu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},nu.apply(this,arguments)},X9="data-chart-source-type",Rt=function(t){nSt(e,t);function e(n,r){var i=t.call(this)||this;return i.container=typeof n=="string"?document.getElementById(n):n,i.options=i.mergeOption(r),i.createG2(),i.bindEvents(),i}return e.prototype.getChartOptions=function(){return nu(nu({},N9(this.options,B_t)),{container:this.container})},e.prototype.getSpecOptions=function(){return this.type==="base"||this[z_t]?nu(nu({},this.options),this.getChartOptions()):this.options},e.prototype.createG2=function(){if(!this.container)throw Error("The container is not initialized!");this.chart=new j_t(this.getChartOptions()),this.container.setAttribute(X9,"Ant Design Charts")},e.prototype.bindEvents=function(){var n=this;this.chart&&this.chart.on("*",function(r){r!=null&&r.type&&n.emit(r.type,r)})},e.prototype.getBaseOptions=function(){return{type:"view",autoFit:!0}},e.prototype.getDefaultOptions=function(){},e.prototype.render=function(){var n=this;this.type!=="base"&&this.execAdaptor(),this.chart.options(this.getSpecOptions()),this.chart.render().then(function(){n.annotation=new eSt(n.chart,n.options)}),this.bindSizeSensor()},e.prototype.update=function(n){this.options=this.mergeOption(n)},e.prototype.mergeOption=function(n){return Ra({},this.getBaseOptions(),this.getDefaultOptions(),n)},e.prototype.changeData=function(n){this.chart.changeData(n)},e.prototype.changeSize=function(n,r){this.chart.changeSize(n,r)},e.prototype.destroy=function(){this.chart.destroy(),this.off(),this.container.removeAttribute(X9)},e.prototype.execAdaptor=function(){var n=this.getSchemaAdaptor();n({chart:this.chart,options:this.options})},e.prototype.triggerResize=function(){this.chart.forceFit()},e.prototype.bindSizeSensor=function(){var n=this,r=this.options.autoFit,i=r===void 0?!0:r;i&&this.chart.on(Ut.AFTER_CHANGE_SIZE,function(){n.annotation.update()})},e}(Ax),rSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),iSt=function(t){rSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="base",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"line"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return function(n){return n}},e}(Rt),uS=function(){return uS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},uS.apply(this,arguments)};function oSt(t){var e=t.options,n=e.stack,r=e.tooltip,i=e.xField;if(!n)return t;var o=gy.map(function(s){return s.type}).filter(function(s){return!!s}),a=!1;return o.forEach(function(s){e[s]&&(a=!0,dt(e,[s,"stack"],uS({y1:"y"},typeof n=="object"?n:{})))}),a&&!q_(r)&&!r&&dt(e,"tooltip",{title:i,items:[{channel:"y"}]}),t}function Fe(t){return zt(oSt)(t)}function aSt(t){var e=t.options.layout,n=e===void 0?"horizontal":e;return t.options.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}],t}function sSt(t){aSt(t);var e=t.options.layout,n=e===void 0?"horizontal":e;return t.options.children.forEach(function(r){var i;!((i=r==null?void 0:r.coordinate)===null||i===void 0)&&i.transform&&(r.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}])}),t}function lSt(t){return zt(Fe,Xt)(t)}var cSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),uSt=function(t){cSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="area",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"area"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return lSt},e}(Rt),ru=function(){return ru=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ru.apply(this,arguments)};function q9(t){var e=function(n){var r=n.options;ve(r,"children.length")>1&&dt(r,"children",[{type:"interval"}]);var i=r.scale,o=r.markBackground,a=r.data,s=r.children,l=r.yField,c=ve(i,"y.domain",[]);if(o&&c.length&&Vt(a)){var u="domainMax",f=a.map(function(d){var h;return ru(ru({originData:ru({},d)},K_(d,l)),(h={},h[u]=c[c.length-1],h))});s.unshift(ru({type:"interval",data:f,yField:u,tooltip:!1,style:{fill:"#eee"},label:!1},o))}return n};return zt(e,Fe,Xt)(t)}var fSt=function(){var t=function(e,n){return function(r){var i=e.fill,o=i===void 0?"#2888FF":i,a=e.stroke,s=e.fillOpacity,l=s===void 0?1:s,c=e.strokeOpacity,u=c===void 0?.2:c,f=e.pitch,d=f===void 0?8:f,h=r[0],p=r[1],v=r[2],g=r[3],y=(p[1]-h[1])/2,m=n.document,b=m.createElement("g",{}),x=m.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+y],[v[0]-d,h[1]+y],g],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u,inset:30}}),w=m.createElement("polygon",{style:{points:[[h[0]-d,h[1]+y],p,v,[v[0]-d,h[1]+y]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u}}),O=m.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+y],p,[h[0]+d,h[1]+y]],fill:o,fillOpacity:l-.2}});return b.appendChild(x),b.appendChild(w),b.appendChild(O),b}};HD("shape.interval.bar25D",t)},dSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();fSt();var hSt=function(t){dSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Bar",n}return e.getDefaultOptions=function(){return{type:"view",coordinate:{transform:[{type:"transpose"}]},children:[{type:"interval"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0},elementHighlightByColor:{background:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return q9},e}(Rt),pSt=function(){var t=function(e,n){return function(r){var i=e.fill,o=i===void 0?"#2888FF":i,a=e.stroke,s=e.fillOpacity,l=s===void 0?1:s,c=e.strokeOpacity,u=c===void 0?.2:c,f=e.pitch,d=f===void 0?8:f,h=r[1][0]-r[0][0],p=h/2+r[0][0],v=n.document,g=v.createElement("g",{}),y=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]+d],[p,r[3][1]+d],[r[3][0],r[3][1]]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u,inset:30}}),m=v.createElement("polygon",{style:{points:[[p,r[1][1]+d],[r[1][0],r[1][1]],[r[2][0],r[2][1]],[p,r[2][1]+d]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u}}),b=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]-d],[r[1][0],r[1][1]],[p,r[1][1]+d]],fill:o,fillOpacity:l-.2}});return g.appendChild(m),g.appendChild(y),g.appendChild(b),g}};HD("shape.interval.column25D",t)},vSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();pSt();var gSt=function(t){vSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="column",n}return e.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0},elementHighlightByColor:{background:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return q9},e}(Rt);function ySt(t){var e=function(r){var i=r.options,o=i.children,a=o===void 0?[]:o,s=i.legend;return s&&a.forEach(function(l){if(!ve(l,"colorField")){var c=ve(l,"yField");dt(l,"colorField",function(){return c})}}),r},n=function(r){var i=r.options,o=i.annotations,a=o===void 0?[]:o,s=i.children,l=s===void 0?[]:s,c=i.scale,u=!1;return ve(c,"y.key")||l.forEach(function(f,d){if(!ve(f,"scale.y.key")){var h="child".concat(d,"Scale");dt(f,"scale.y.key",h);var p=f.annotations,v=p===void 0?[]:p;v.length>0&&(dt(f,"scale.y.independent",!1),v.forEach(function(g){dt(g,"scale.y.key",h)})),!u&&a.length>0&&ve(f,"scale.y.independent")===void 0&&(u=!0,dt(f,"scale.y.independent",!1),a.forEach(function(g){dt(g,"scale.y.key",h)}))}}),r};return zt(e,n,Fe,Xt)(t)}var mSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),K9=function(t){mSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="DualAxes",n}return e.getDefaultOptions=function(){return{type:"view",axis:{y:{title:!1,tick:!1},x:{title:!1}},scale:{y:{independent:!0,nice:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return ySt},e}(Rt);function bSt(t){var e=function(o){var a=o.options,s=a.xField,l=a.colorField;return l||dt(a,"colorField",s),o},n=function(o){var a=o.options,s=a.compareField,l=a.transform,c=a.isTransposed,u=c===void 0?!0:c,f=a.coordinate;return l||(s?dt(a,"transform",[]):dt(a,"transform",[{type:"symmetryY"}])),!f&&u&&dt(a,"coordinate",{transform:[{type:"transpose"}]}),o},r=function(o){var a=o.options,s=a.compareField,l=a.seriesField,c=a.data,u=a.children,f=a.yField,d=a.isTransposed,h=d===void 0?!0:d;if(s||l){var p=Object.values(C9(c,function(v){return v[s||l]}));u[0].data=p[0],u.push({type:"interval",data:p[1],yField:function(v){return-v[f]}}),delete a.compareField,delete a.data}return l&&(dt(a,"type","spaceFlex"),dt(a,"ratio",[1,1]),dt(a,"direction",h?"row":"col"),delete a.seriesField),o},i=function(o){var a=o.options,s=a.tooltip,l=a.xField,c=a.yField;return s||dt(a,"tooltip",{title:!1,items:[function(u){return{name:u[l],value:u[c]}}]}),o};return zt(e,n,r,i,Fe,Xt)(t)}var xSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wSt=function(t){xSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="column",n}return e.getDefaultOptions=function(){return{type:"view",scale:{x:{padding:0}},animate:{enter:{type:"fadeIn"}},axis:!1,shapeField:"funnel",label:{position:"inside",transform:[{type:"contrastReverse"}]},children:[{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return bSt},e}(Rt);function OSt(t){return zt(Fe,Xt)(t)}var _St=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),SSt=function(t){_St(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="line",n}return e.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"line"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return OSt},e}(Rt),Ba=function(){return Ba=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ba.apply(this,arguments)};function ESt(t){var e=function(n){var r=n.options,i=r.angleField,o=r.data,a=r.label,s=r.tooltip,l=r.colorField;if(Vt(o)){var c=o.reduce(function(f,d){return f+d[i]},0);if(c===0){var u=o.map(function(f){var d;return Ba(Ba({},f),(d={},d[i]=1,d))});dt(r,"data",u),a&&dt(r,"label",Ba(Ba({},a),{formatter:function(){return 0}})),s!==!1&&dt(r,"tooltip",Ba(Ba({},s),{items:[function(f){return{name:f[l],value:0}}]}))}}return n};return zt(e,Xt)(t)}var MSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),PSt=function(t){MSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="pie",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"theta"},transform:[{type:"stackY",reverse:!0}],animate:{enter:{type:"waveIn"}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return ESt},e}(Rt);function ASt(t){return zt(Fe,Xt)(t)}var CSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),TSt=function(t){CSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="scatter",n}return e.getDefaultOptions=function(){return{axis:{y:{title:!1},x:{title:!1}},legend:{size:!1},children:[{type:"point"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return ASt},e}(Rt);function kSt(t){var e=function(n){return dt(n,"options.coordinate",{type:ve(n,"options.coordinateType","polar")}),n};return zt(e,Xt)(t)}var LSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),NSt=function(t){LSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="radar",n}return e.getDefaultOptions=function(){return{axis:{x:{grid:!0,line:!0},y:{zIndex:1,title:!1,line:!0,nice:!0}},meta:{x:{padding:.5,align:0}},interaction:{tooltip:{style:{crosshairsLineDash:[4,4]}}},children:[{type:"line"}],coordinateType:"polar"}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return kSt},e}(Rt),$o=function(){return $o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},$o.apply(this,arguments)},ISt="__stock-range__",jSt="trend",$St="up",DSt="down";function FSt(t){var e=function(r){var i=r.options,o=i.data,a=i.yField;return r.options.data=Qc(o,function(s){var l=s&&$o({},s);if(Array.isArray(a)&&l){var c=a[0],u=a[1],f=a[2],d=a[3];l[jSt]=l[c]<=l[u]?$St:DSt,l[ISt]=[l[c],l[u],l[f],l[d]]}return l}),r},n=function(r){var i=r.options,o=i.xField,a=i.yField,s=i.fallingFill,l=i.risingFill,c=a[0],u=a[1],f=a[2],d=a[3];return r.options.children=Qc(r.options.children,function(h,p){var v=p===0;return $o($o({},h),{tooltip:{title:function(g){return g[o]instanceof Date?g[o].toLocaleString():g[o]},items:[{field:f},{field:d},{field:c},{field:u}]},encode:$o($o({},h.encode||{}),{y:v?[f,d]:[c,u],color:function(g){return Math.sign(g[u]-g[c])}}),style:$o($o({},h.style||{}),{lineWidth:v?1:10})})}),delete i.yField,r.options.legend={color:!1},s&&dt(r,"options.scale.color.range[0]",s),l&&dt(r,"options.scale.color.range[2]",l),r};return zt(e,n,Xt)(t)}var RSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),BSt=["#26a69a","#999999","#ef5350"],zSt=function(t){RSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="stock",n}return e.getDefaultOptions=function(){return{type:"view",scale:{color:{domain:[-1,0,1],range:BSt},y:{nice:!0}},children:[{type:"link"},{type:"link"}],axis:{x:{title:!1,grid:!1},y:{title:!1,grid:!0,gridLineDash:null}},animate:{enter:{type:"scaleInY"}},interaction:{tooltip:{shared:!0,marker:!1,groupName:!1,crosshairs:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return FSt},e}(Rt);function YSt(t){return zt(Fe,Xt)(t)}var WSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),GSt=function(t){WSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyLine",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"line",axis:!1}],autoFit:!1,animate:{enter:{type:"growInX",duration:500}},padding:0,margin:0,tooltip:!1}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return YSt},e}(Rt);function HSt(t){return zt(Fe,Xt)(t)}var USt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),VSt=function(t){USt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyArea",n}return e.getDefaultOptions=function(){return{type:"view",animate:{enter:{type:"growInX",duration:500}},children:[{type:"area",axis:!1}],autoFit:!1,padding:0,margin:0,tooltip:!1}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return HSt},e}(Rt);function XSt(t){return zt(Fe,Xt)(t)}var qSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),KSt=function(t){qSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyColumn",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval",axis:!1}],autoFit:!1,padding:0,margin:0,tooltip:!1}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return XSt},e}(Rt),fS=function(){return fS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},fS.apply(this,arguments)};function ZSt(t){var e=function(n){var r=n.options,i=r.percent,o=r.color,a=o===void 0?[]:o;if(!i)return n;var s={scale:{color:{range:a.length?a:[]}},data:[1,i]};return Object.assign(r,fS({},s)),n};return zt(e,Fe,Xt)(t)}var QSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),JSt=function(t){QSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyProgress",n}return e.getDefaultOptions=function(){return{type:"view",data:[],autoFit:!1,margin:0,padding:0,tooltip:!1,children:[{interaction:{tooltip:!1},coordinate:{transform:[{type:"transpose"}]},type:"interval",axis:!1,legend:!1,encode:{y:function(n){return n},color:function(n,r){return r}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return ZSt},e}(Rt),dS=function(){return dS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},dS.apply(this,arguments)};function tEt(t){var e=function(r){var i=r.options,o=i.radius,a=o===void 0?.8:o;return dt(r,"options.coordinate.innerRadius",a),r},n=function(r){var i=r.options,o=i.percent,a=i.color,s=a===void 0?[]:a;if(!o)return r;var l={scale:{color:{range:s.length?s:[]}},data:[1,o]};return Object.assign(i,dS({},l)),r};return zt(e,n,Fe,Xt)(t)}var eEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),nEt=function(t){eEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyRing",n}return e.getDefaultOptions=function(){return{type:"view",data:[],autoFit:!1,margin:0,padding:0,coordinate:{type:"theta"},animate:{enter:{type:"waveIn"}},interaction:{tooltip:!1},tooltip:!1,children:[{type:"interval",axis:!1,legend:!1,encode:{y:function(n){return n},color:function(n,r){return r}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return tEt},e}(Rt);function rEt(t){return zt(Xt)(t)}var iEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),oEt=function(t){iEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="rose",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"polar"},animate:{enter:{type:"waveIn"}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return rEt},e}(Rt),hS="__start__",iu="__end__",pS="__waterfall_value__",vS=function(){return vS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},vS.apply(this,arguments)},aEt=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function sEt(t){var e=function(r){var i=r.options,o=i.data,a=o===void 0?[]:o,s=i.yField;return a.length&&(a.reduce(function(l,c,u){var f;if(u===0||c.isTotal)c[hS]=0,c[iu]=c[s],c[pS]=c[s];else{var d=(f=l[iu])!==null&&f!==void 0?f:l[s];c[hS]=d,c[iu]=d+c[s],c[pS]=l[iu]}return c},[]),Object.assign(i,{yField:[hS,iu]})),r},n=function(r){var i=r.options,o=i.data,a=o===void 0?[]:o,s=i.xField,l=i.children,c=i.linkStyle,u=aEt([],a,!0);return u.reduce(function(f,d,h){return h>0&&(d.x1=f[s],d.x2=d[s],d.y1=f[iu]),d},[]),u.shift(),l.push({type:"link",xField:["x1","x2"],yField:"y1",zIndex:-1,data:u,style:vS({stroke:"#697474"},c),label:!1,tooltip:!1}),r};return zt(e,n,Fe,Xt)(t)}var lEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cEt=function(t){lEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="waterfall",n}return e.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{field:pS,valueFormatter:"~s",name:"value"},axis:{y:{title:null,labelFormatter:"~s"},x:{title:null}},children:[{type:"interval",interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return sEt},e}(Rt);function uEt(t){var e=function(n){var r=n.options,i=r.data,o=r.binNumber,a=r.binWidth,s=r.children,l=r.channel,c=l===void 0?"count":l,u=ve(s,"[0].transform[0]",{});return Jc(a)?(YR(u,{thresholds:Cxt(vOt(i.length,a)),y:c}),n):(Jc(o)&&YR(u,{thresholds:o,y:c}),n)};return zt(e,Fe,Xt)(t)}var fEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dEt=function(t){fEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Histogram",n}return e.getDefaultOptions=function(){return{type:"view",autoFit:!0,axis:{y:{title:!1},x:{title:!1}},children:[{type:"rect",transform:[{type:"binX",y:"count"}],interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return uEt},e}(Rt);function hEt(t){var e=function(r){var i=r.options,o=i.tooltip,a=i.colorField,s=i.sizeField;return o&&!o.field&&(o.field=a||s),r},n=function(r){var i=r.options,o=i.mark,a=i.children;return o&&(a[0].type=o),r};return zt(e,n,Fe,Xt)(t)}var pEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),vEt=function(t){pEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="heatmap",n}return e.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{valueFormatter:"~s"},axis:{y:{title:null,grid:!0},x:{title:null,grid:!0}},children:[{type:"point",interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return hEt},e}(Rt);function gEt(t){var e=function(n){var r=n.options.boxType,i=r===void 0?"box":r;return n.options.children[0].type=i,n};return zt(e,Fe,Xt)(t)}var yEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mEt=function(t){yEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="box",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"box"}],axis:{y:{title:!1},x:{title:!1}},tooltip:{items:[{name:"min",channel:"y"},{name:"q1",channel:"y1"},{name:"q2",channel:"y2"},{name:"q3",channel:"y3"},{name:"max",channel:"y4"}]}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return gEt},e}(Rt);function bEt(t){var e=function(n){var r=n.options,i=r.data,o=[{type:"custom",callback:function(s){return{links:s}}}];if(Vt(i))i.length>0?dt(r,"data",{value:i,transform:o}):delete r.children;else if(ve(i,"type")==="fetch"&&ve(i,"value")){var a=ve(i,"transform");Vt(a)?dt(i,"transform",a.concat(o)):dt(i,"transform",o)}return n};return zt(e,Fe,Xt)(t)}var xEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wEt=function(t){xEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="sankey",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"sankey"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return bEt},e}(Rt),_i=function(){return _i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_i.apply(this,arguments)},xy=["#f0efff","#5B8FF9","#3D76DD"];function gS(t,e,n,r){r===void 0&&(r=!0);var i=0,o=!1,a=Qc(t,function(s){var l,c,u=ve(s,[e]);if(jOt(u))return[];if(T9(u)){var f=Number(u);return isNaN(f)?[]:(l={},l[n]=s[n],l[e]=f,l)}return Vt(u)?(o=!0,i=Math.max(i,u.length),Qc(r?u.sort(function(d,h){return h-d}):u,function(d,h){var p;return p={},p[n]=s[n],p[e]=d,p.index=h,p})):(i=Math.max(1,i),c={},c[n]=s[n],c[e]=u,c)}).flat();return o?[a.map(function(s){return _i({index:0},s)}),i]:[a,i]}function yS(t,e){return new Array(t).fill("").map(function(n,r){return Vt(e)?e[r%e.length]:e})}function OEt(t){var e=function(i){var o=i.options,a=o.color,s=o.rangeField,l=s===void 0?"ranges":s,c=o.measureField,u=c===void 0?"measures":c,f=o.targetField,d=f===void 0?"targets":f,h=o.xField,p=h===void 0?"title":h,v=o.mapField,g=o.data,y=gS(g,l,p),m=y[0],b=y[1],x=gS(g,u,p,!1),w=x[0],O=x[1],_=gS(g,d,p,!1),S=_[0],E=_[1],M=ve(a,[l],xy[0]),P=ve(a,[u],xy[1]),C=ve(a,[d],xy[2]),A=[yS(b,M),yS(O,P),yS(E,C)].flat();return i.options.children=Qc(i.options.children,function(T,k){var N=[m,w,S][k],j=[l,u,d][k];return _i(_i({},T),{data:N,encode:_i(_i({},T.encode||{}),{x:p,y:j,color:function(L){var I=L.index,D=Jc(I)?"".concat(j,"_").concat(I):j;return v?ve(v,[j,I],D):D}}),style:_i(_i({},T.style||{}),{zIndex:function(L){return-L[j]}}),labels:k!==0?Qc(T.labels,function(L){return _i(_i({},L),{text:j})}):void 0})}),i.options.scale.color.range=A,i.options.legend.color.itemMarker=function(T){return v&&kOt(v==null?void 0:v[d],T)||(T==null?void 0:T.replace(/\_\d$/,""))===d?"line":"square"},i},n=function(i){var o=i.options.layout,a=o===void 0?"horizontal":o;return a!=="horizontal"&&dt(i,"options.children[2].shapeField","hyphen"),i},r=function(i){var o=i.options,a=o.range,s=a===void 0?{}:a,l=o.measure,c=l===void 0?{}:l,u=o.target,f=u===void 0?{}:u,d=o.children;return i.options.children=[s,c,f].map(function(h,p){return Ra(d[p],h)}),i};return zt(e,n,r,sSt,Xt)(t)}var _Et=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),SEt=function(t){_Et(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="bullet",n}return e.getDefaultOptions=function(){return{type:"view",scale:{color:{range:xy}},legend:{color:{itemMarker:function(n){return n==="target"?"line":"square"}}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval",style:{maxWidth:30},axis:{y:{grid:!0,gridLineWidth:2}}},{type:"interval",style:{maxWidth:20},transform:[{type:"stackY"}]},{type:"point",encode:{size:8,shape:"line"}}],interaction:{tooltip:{shared:!0}},coordinate:{transform:[{type:"transpose"}]}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return OEt},e}(Rt);function EEt(t){var e=function(n){var r=n.options.data;return n.options.data={value:r},n};return zt(e,Fe,Xt)(t)}var MEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),PEt=function(t){MEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Gauge",n}return e.getDefaultOptions=function(){return{type:"view",legend:!1,children:[{type:"gauge"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return EEt},e}(Rt);function AEt(t){var e=function(n){var r=n.options.percent;return Jc(r)&&dt(n,"options.data",r),n};return zt(e,Fe,Xt)(t)}var CEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),TEt=function(t){CEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Liquid",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"liquid"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return AEt},e}(Rt);function kEt(t){return zt(Fe,Xt)(t)}var LEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),NEt=function(t){LEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="WordCloud",n}return e.getDefaultOptions=function(){return{type:"view",legend:!1,children:[{type:"wordCloud"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return kEt},e}(Rt);function IEt(t){var e=function(n){var r=n.options,i=r.data;return i&&dt(r,"data",{value:i}),n};return zt(e,Fe,Xt)(t)}var jEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$Et=function(t){jEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="treemap",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"treemap"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return IEt},e}(Rt),Zs=function(){return Zs=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Zs.apply(this,arguments)};function DEt(t){var e=function(i){var o=i.options,a=o.startAngle,s=o.maxAngle,l=o.coordinate,c=Jc(a)?a/(2*Math.PI)*360:-90,u=Jc(s)?(Number(s)+c)/180*Math.PI:Math.PI;return dt(i,["options","coordinate"],Zs(Zs({},l),{endAngle:u,startAngle:a!=null?a:-Math.PI/2})),i},n=function(i){var o=i.options,a=o.tooltip,s=o.xField,l=o.yField;return a||dt(o,"tooltip",{title:!1,items:[function(c){return{name:c[s],value:c[l]}}]}),i},r=function(i){var o=i.options,a=o.markBackground,s=o.children,l=o.scale,c=o.coordinate,u=o.xField,f=ve(l,"y.domain",[]);return a&&s.unshift(Zs({type:"interval",xField:u,yField:f[f.length-1],colorField:a.color,scale:{color:{type:"identity"}},style:{fillOpacity:a.opacity,fill:a.color?void 0:"#e0e4ee"},coordinate:Zs(Zs({},c),{startAngle:-Math.PI/2,endAngle:1.5*Math.PI}),animate:!1},a)),i};return zt(e,n,r,Fe,Xt)(t)}var FEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),REt=function(t){FEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="radial",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"radial",innerRadius:.1,outerRadius:1,endAngle:Math.PI},animate:{enter:{type:"waveIn",duration:800}},axis:{y:{nice:!0,labelAutoHide:!0,labelAutoRotate:!1},x:{title:!1,nice:!0,labelAutoRotate:!1,labelAutoHide:{type:"equidistance",cfg:{minGap:6}}}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return DEt},e}(Rt);function BEt(t){return zt(Xt)(t)}var zEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),YEt=function(t){zEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="CirclePacking",n}return e.getDefaultOptions=function(){return{legend:!1,type:"view",children:[{type:"pack"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return BEt},e}(Rt),wy=function(){return wy=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},wy.apply(this,arguments)};function WEt(t){var e=function(n){var r=n.options,i=r.xField,o=r.yField,a=r.seriesField,s=r.children,l=s==null?void 0:s.map(function(c){return wy(wy({},c),{xField:i,yField:o,seriesField:a,colorField:a,data:c.type==="density"?{transform:[{type:"kde",field:o,groupBy:[i,a]}]}:c.data})}).filter(function(c){return r.violinType!=="density"||c.type==="density"});return dt(r,"children",l),r.violinType==="polar"&&dt(r,"coordinate",{type:"polar"}),dt(r,"violinType",void 0),n};return zt(e,Fe,Xt)(t)}var GEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),HEt=function(t){GEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="violin",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"density",sizeField:"size",tooltip:!1},{type:"boxplot",shapeField:"violin",style:{opacity:.5,point:!1}}],animate:{enter:{type:"fadeIn"}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return WEt},e}(Rt),lh=function(){return lh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},lh.apply(this,arguments)},UEt=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function VEt(t){var e=function(o){var a=o.options,s=a.yField,l=a.children;return l.forEach(function(c,u){dt(c,"yField",s[u])}),o},n=function(o){var a=o.options,s=a.yField,l=a.children,c=a.data;if(F_(c))return o;var u=Vt(ve(c,[0]))?c:[c,c];return l.forEach(function(f,d){dt(f,"data",UEt([],u[d].map(function(h){return lh({groupKey:s[d]},h)}),!0))}),o},r=function(o){var a=o.options,s=a.yField,l=s[0],c=s[1],u=a.tooltip;return u||dt(a,"tooltip",{items:[{field:l,value:l},{field:c,value:c}]}),o},i=function(o){var a=o.options,s=a.children,l=a.layout,c=a.coordinate.transform,u=a.paddingBottom,f=u===void 0?V9:u,d=a.paddingLeft,h=d===void 0?V9:d,p=a.axis;dt(a,"axisText",lh(lh({},(p==null?void 0:p.x)||{}),{layout:l}));var v=s[0],g=s[1];if(l==="vertical")dt(a,"direction","col"),dt(a,"paddingLeft",h),dt(a,"coordinate.transform",c.filter(function(w){return w.type!=="transpose"})),dt(v,"paddingBottom",U9),dt(g,"paddingTop",U9),dt(g,"axis",{x:{position:"top"}}),dt(g,"scale",{y:{range:[0,1]}});else{dt(a,"paddingBottom",f),dt(v,"scale",{y:{range:[0,1]}});var y=v.paddingRight,m=y===void 0?cS:y,b=g.paddingLeft,x=b===void 0?cS:b;dt(v,"paddingRight",m),dt(v,"axis",{x:{position:"right"}}),dt(g,"paddingLeft",x)}return o};return zt(e,n,r,i,Fe,Xt)(t)}var XEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qEt=function(t){XEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="BidirectionalBar",n}return e.getDefaultOptions=function(){return{type:"spaceFlex",coordinate:{transform:[{type:"transpose"}]},scale:{y:{nice:!0}},direction:"row",layout:"horizontal",legend:!1,axis:{y:{title:!1},x:{title:!1,label:!1}},children:[{type:"interval"},{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return VEt},e}(Rt),Qs;(function(t){t.color="key",t.d="path"})(Qs||(Qs={}));function KEt(t){var e=function(n){var r=n.options,i=r.data,o=r.setsField,a=r.sizeField;return Vt(i)&&(dt(r,"data",{type:"inline",value:i,transform:[{type:"venn",sets:o,size:a,as:[Qs.color,Qs.d]}]}),dt(r,"colorField",o),dt(r,["children","0","encode","d"],Qs.d)),dt(n,"options",K_(r,["sizeField","setsField"])),n};return zt(e,Xt)(t)}var ZEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),QEt=function(t){ZEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="venn",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"path"}],legend:{color:{itemMarker:"circle"}},encode:{color:Qs.color,d:Qs.d}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return KEt},e}(Rt);function JEt(t){var e=function(n){return n};return zt(e,Xt)(t)}var tMt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),eMt=function(t){tMt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Sunburst",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"sunburst"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return JEt},e}(Rt),nMt={Base:iSt,Line:SSt,Column:gSt,Pie:PSt,Area:uSt,Bar:hSt,DualAxes:K9,Funnel:wSt,Scatter:TSt,Radar:NSt,Rose:oEt,Stock:zSt,TinyLine:GSt,TinyArea:VSt,TinyColumn:KSt,TinyProgress:JSt,TinyRing:nEt,Waterfall:cEt,Histogram:dEt,Heatmap:vEt,Box:mEt,Sankey:wEt,Bullet:SEt,Gauge:PEt,Liquid:TEt,WordCloud:NEt,Treemap:$Et,RadialBar:REt,CirclePacking:YEt,Violin:HEt,BidirectionalBar:qEt,Venn:QEt,Mix:K9,Sunburst:eMt},mS=function(){return mS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},mS.apply(this,arguments)},Z9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Js=q.forwardRef(function(t,e){var n=t.chartType,r=n===void 0?"Base":n,i=Z9(t,["chartType"]),o=i.containerStyle,a=o===void 0?{height:"inherit"}:o,s=i.containerAttributes,l=s===void 0?{}:s,c=i.className,u=i.loading,f=i.loadingTemplate,d=i.errorTemplate,h=Z9(i,["containerStyle","containerAttributes","className","loading","loadingTemplate","errorTemplate"]),p=QOt(nMt[r],h),v=p.chart,g=p.container;return q.useImperativeHandle(e,function(){return v.current}),q.createElement(hmt,{errorTemplate:d},u&&q.createElement(fmt,{loadingTemplate:f}),q.createElement("div",mS({className:c,style:a,ref:g},l)))}),bS=function(){return bS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},bS.apply(this,arguments)},rMt=function(t){return q.createElement(Js,bS({},t,{chartType:"Area"}))};const iMt=rMt;var xS=function(){return xS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xS.apply(this,arguments)},oMt=function(t){return q.createElement(Js,xS({},t,{chartType:"Bar"}))};const aMt=oMt;var wS=function(){return wS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},wS.apply(this,arguments)},sMt=function(t){return q.createElement(Js,wS({},t,{chartType:"Column"}))};const lMt=sMt;var OS=function(){return OS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},OS.apply(this,arguments)},cMt=function(t){return q.createElement(Js,OS({},t,{chartType:"DualAxes"}))};const uMt=cMt;var _S=function(){return _S=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_S.apply(this,arguments)},fMt=function(t){return q.createElement(Js,_S({},t,{chartType:"Line"}))};const dMt=fMt;var SS=function(){return SS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},SS.apply(this,arguments)},hMt=function(t){return q.createElement(Js,SS({},t,{chartType:"Pie"}))};const pMt=hMt;var ES=function(){return ES=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ES.apply(this,arguments)},vMt=function(t){return q.createElement(Js,ES({},t,{chartType:"Scatter"}))};const gMt=vMt,{booleanField:Oy}=nE,yMt={isStack:t=>Oy(rt({name:"isStack",title:"isStack"},t)),smooth:t=>Oy(rt({name:"smooth",title:"smooth"},t)),isPercent:t=>Oy(rt({name:"isPercent",title:"isPercent"},t)),isGroup:t=>Oy(rt({name:"isGroup",title:"isGroup"},t))},mMt=t=>e=>{const{service:n}=q.useContext(ri),r=q.useRef(null),[i,o]=q.useState(0);return q.useEffect(()=>{const a=r.current;if(!a||n.loading===!0)return;const s=new ResizeObserver(l=>{l.forEach(c=>{o(c.contentRect.height)})});return s.observe(a),()=>s.disconnect()},[n.loading]),Y.jsx("div",{ref:r,style:i?{height:`${i}px`}:{},children:Y.jsx(t,rt(rt({},e),i?{height:i}:{}))})};class tl extends jy{constructor({name:n,title:r,Component:i,config:o}){super({name:n,title:r,Component:mMt(i),config:["xField","yField","seriesField",...o||[]]});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{xField:o,yField:a,seriesField:s}=this.infer(n,{measures:r,dimensions:i});return{general:{xField:o==null?void 0:o.value,yField:a==null?void 0:a.value,seriesField:s==null?void 0:s.value}}});this.addConfigs(yMt)}getProps({data:n,general:r,advanced:i,fieldProps:o}){return rt(bt(rt(rt({legend:{color:{itemLabelText:s=>{const l=o[r.seriesField],c=l==null?void 0:l.transformer;return c?c(s.label):s.label}}},tooltip:(s,l,c,u)=>{var g,y;const f=(g=u.y)==null?void 0:g.field,d=o[f],h=(d==null?void 0:d.label)||f,p=d==null?void 0:d.transformer,v=(y=u.y)==null?void 0:y.value[l];return{name:h,value:p?p(v):v}},axis:{x:{labelFormatter:s=>{const l=o[r.xField],c=l==null?void 0:l.transformer;return c?c(s):s}},y:{labelFormatter:s=>{const l=o[r.yField],c=l==null?void 0:l.transformer;return c?c(s):s}}},data:n,theme:"classic",animate:{enter:{type:!1},update:{type:!1},exit:{type:!1}},colorField:r.seriesField,stack:r.isStack,percent:r.isPercent?!0:void 0},r.smooth?{shapeField:"smooth"}:{}),r),{seriesField:r.isGroup?r.seriesField:void 0}),i)}getReference(){return{title:this.title,link:`https://ant-design-charts-next.antgroup.com/examples#statistics-${this.name}`}}}class bMt extends tl{constructor(){super({name:"pie",title:"Pie Chart",Component:pMt});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{xField:o,yField:a}=this.infer(n,{measures:r,dimensions:i});return{general:{colorField:o==null?void 0:o.value,angleField:a==null?void 0:a.value}}});this.config=[{property:"field",name:"angleField",title:"angleField",required:!0},{property:"field",name:"colorField",title:"colorField",required:!0}]}getProps({data:n,general:r,advanced:i,fieldProps:o}){const a=super.getProps({data:n,general:r,advanced:i,fieldProps:o});return bt(rt({},a),{tooltip:(s,l,c,u)=>{const f=u.y0.field,d=o[f],h=(d==null?void 0:d.label)||f,p=d==null?void 0:d.transformer,v=u.y0.value[l];return{name:h,value:p?p(v):v}}})}}class xMt extends tl{constructor(){super({name:"dualAxes",title:"Dual Axes Chart",Component:uMt});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{xField:o,yFields:a}=this.infer(n,{measures:r,dimensions:i});return{general:{xField:o==null?void 0:o.value,yField:(a==null?void 0:a.map(s=>s.value))||[]}}});this.config=["xField",{yField:{title:'{{t("yField")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"void","x-component":"Space",properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},input:{type:"string","x-decorator":"FormItem","x-component":"Select","x-reactions":"{{ useChartFields }}","x-component-props":{style:{minWidth:"200px"}},required:!0},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}},properties:{add:{type:"void",title:'{{t("Add")}}',"x-component":"ArrayItems.Addition"}}}}]}getProps({data:n,general:r,advanced:i,fieldProps:o}){var s;const a=super.getProps({data:n,general:r,advanced:i,fieldProps:o});return bt(rt({},nn.omit(a,["legend","tooltip","yField"])),{children:((s=a.yField)==null?void 0:s.map((l,c)=>{var u;return{type:"line",yField:l,colorField:()=>{const f=o[l];return(f==null?void 0:f.label)||l},axis:{y:{title:((u=o[l])==null?void 0:u.label)||l,position:c===0?"left":"right",labelFormatter:f=>{const d=o[l],h=d==null?void 0:d.transformer;return h?h(f):f}}}}}))||[]})}}const wMt=[new tl({name:"line",title:"Line Chart",Component:dMt,config:["smooth","isStack"]}),new tl({name:"area",title:"Area Chart",Component:iMt,config:["smooth",{property:"isStack",defaultValue:!0},"isPercent"]}),new tl({name:"column",title:"Column Chart",Component:lMt,config:["isGroup","isStack","isPercent"]}),new tl({name:"bar",title:"Bar Chart",Component:aMt,config:["isGroup","isStack","isPercent"]}),new bMt,new xMt,new tl({name:"scatter",title:"Scatter Chart",Component:gMt})];class _y extends z.Plugin{constructor(){super(...arguments);ni(this,"charts",new TB)}load(){return Cr(this,null,function*(){this.charts.setGroup("Built-in",[...wMt,...Z7]),this.app.addComponents({ChartV2BlockInitializer:X7,ChartV2BlockDesigner:U7,ChartV2Block:H7}),this.app.schemaInitializerManager.add(eE),this.app.schemaInitializerManager.add(V7),this.app.schemaInitializerManager.add(XS),this.app.schemaInitializerManager.add(M7),this.app.schemaInitializerManager.add(QS),this.app.schemaInitializerManager.add(L7);const n=this.app.schemaInitializerManager.get("page:addBlock");n==null||n.add("dataBlocks.chartV2",{title:It("Charts"),Component:"ChartV2BlockInitializer"})})}}ct.Chart=jy,ct.ChartConfigContext=Mi,ct.default=_y,Object.defineProperties(ct,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
154
+ `,n.classList.add("loading"),n.innerHTML="<div></div><div></div><div></div><div></div>",e.appendChild(r),e.appendChild(n)},fmt=function(t){var e=t.loadingTemplate,n=t.theme,r=n===void 0?"light":n,i=q.useRef(null);q.useEffect(function(){!e&&i.current&&umt(i.current)},[]);var o=function(){return e||q.createElement("div",{ref:i})};return q.createElement("div",{className:"charts-loading-container",style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",left:0,top:0,zIndex:99,backgroundColor:r==="dark"?"rgb(20, 20, 20)":"rgb(255, 255, 255)"}},o())},dmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hmt=function(t){dmt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={hasError:!1},n.renderError=function(r){var i=n.props.errorTemplate;switch(r){default:return typeof i=="function"?i(r):i||q.createElement("h5",null,"组件出错了,请核查后重试: ",r.message)}},n}return e.getDerivedStateFromError=function(n){return{hasError:!0,error:n}},e.getDerivedStateFromProps=function(n,r){return r.children!==n.children?{children:n.children,hasError:!1,error:void 0}:null},e.prototype.render=function(){return this.state.hasError?this.renderError(this.state.error):q.createElement(q.Fragment,null,this.props.children)},e}(q.Component),pmt=typeof global=="object"&&global&&global.Object===Object&&global;const fR=pmt;var vmt=typeof self=="object"&&self&&self.Object===Object&&self,gmt=fR||vmt||Function("return this")();const wi=gmt;var ymt=wi.Symbol;const ti=ymt;var dR=Object.prototype,mmt=dR.hasOwnProperty,bmt=dR.toString,Ud=ti?ti.toStringTag:void 0;function xmt(t){var e=mmt.call(t,Ud),n=t[Ud];try{t[Ud]=void 0;var r=!0}catch(o){}var i=bmt.call(t);return r&&(e?t[Ud]=n:delete t[Ud]),i}var wmt=Object.prototype,Omt=wmt.toString;function _mt(t){return Omt.call(t)}var Smt="[object Null]",Emt="[object Undefined]",hR=ti?ti.toStringTag:void 0;function Qi(t){return t==null?t===void 0?Emt:Smt:hR&&hR in Object(t)?xmt(t):_mt(t)}function sr(t){return t!=null&&typeof t=="object"}var Mmt="[object Symbol]";function Vd(t){return typeof t=="symbol"||sr(t)&&Qi(t)==Mmt}var Pmt=NaN;function pR(t){return typeof t=="number"?t:Vd(t)?Pmt:+t}function Zg(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Amt=Array.isArray;const Vt=Amt;var Cmt=1/0,vR=ti?ti.prototype:void 0,gR=vR?vR.toString:void 0;function Qg(t){if(typeof t=="string")return t;if(Vt(t))return Zg(t,Qg)+"";if(Vd(t))return gR?gR.call(t):"";var e=t+"";return e=="0"&&1/t==-Cmt?"-0":e}function Tmt(t,e){return function(n,r){var i;if(n===void 0&&r===void 0)return e;if(n!==void 0&&(i=n),r!==void 0){if(i===void 0)return r;typeof n=="string"||typeof r=="string"?(n=Qg(n),r=Qg(r)):(n=pR(n),r=pR(r)),i=t(n,r)}return i}}var kmt=/\s/;function Lmt(t){for(var e=t.length;e--&&kmt.test(t.charAt(e)););return e}var Nmt=/^\s+/;function Imt(t){return t&&t.slice(0,Lmt(t)+1).replace(Nmt,"")}function Gn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var yR=NaN,jmt=/^[-+]0x[0-9a-f]+$/i,$mt=/^0b[01]+$/i,Dmt=/^0o[0-7]+$/i,Fmt=parseInt;function mR(t){if(typeof t=="number")return t;if(Vd(t))return yR;if(Gn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Gn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Imt(t);var n=$mt.test(t);return n||Dmt.test(t)?Fmt(t.slice(2),n?2:8):jmt.test(t)?yR:+t}var bR=1/0,Rmt=17976931348623157e292;function Bmt(t){if(!t)return t===0?t:0;if(t=mR(t),t===bR||t===-bR){var e=t<0?-1:1;return e*Rmt}return t===t?t:0}function xR(t){var e=Bmt(t),n=e%1;return e===e?n?e-n:e:0}function __(t){return t}var zmt="[object AsyncFunction]",Ymt="[object Function]",Wmt="[object GeneratorFunction]",Gmt="[object Proxy]";function Uc(t){if(!Gn(t))return!1;var e=Qi(t);return e==Ymt||e==Wmt||e==zmt||e==Gmt}var Hmt=wi["__core-js_shared__"];const S_=Hmt;var wR=function(){var t=/[^.]+$/.exec(S_&&S_.keys&&S_.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Umt(t){return!!wR&&wR in t}var Vmt=Function.prototype,Xmt=Vmt.toString;function Gs(t){if(t!=null){try{return Xmt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var qmt=/[\\^$.*+?()[\]{}|]/g,Kmt=/^\[object .+?Constructor\]$/,Zmt=Function.prototype,Qmt=Object.prototype,Jmt=Zmt.toString,t1t=Qmt.hasOwnProperty,e1t=RegExp("^"+Jmt.call(t1t).replace(qmt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function n1t(t){if(!Gn(t)||Umt(t))return!1;var e=Uc(t)?e1t:Kmt;return e.test(Gs(t))}function r1t(t,e){return t==null?void 0:t[e]}function Hs(t,e){var n=r1t(t,e);return n1t(n)?n:void 0}var i1t=Hs(wi,"WeakMap");const Xd=i1t;var o1t=Xd&&new Xd;const OR=o1t;var _R=Object.create,a1t=function(){function t(){}return function(e){if(!Gn(e))return{};if(_R)return _R(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();const E_=a1t;function s1t(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function M_(){}var l1t=4294967295;function Vc(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=l1t,this.__views__=[]}Vc.prototype=E_(M_.prototype),Vc.prototype.constructor=Vc;function SR(){}var c1t=OR?function(t){return OR.get(t)}:SR;const ER=c1t;var u1t={};const MR=u1t;var f1t=Object.prototype,d1t=f1t.hasOwnProperty;function Jg(t){for(var e=t.name+"",n=MR[e],r=d1t.call(MR,e)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==t)return i.name}return e}function Da(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Da.prototype=E_(M_.prototype),Da.prototype.constructor=Da;function P_(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function h1t(t){if(t instanceof Vc)return t.clone();var e=new Da(t.__wrapped__,t.__chain__);return e.__actions__=P_(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var p1t=Object.prototype,v1t=p1t.hasOwnProperty;function ty(t){if(sr(t)&&!Vt(t)&&!(t instanceof Vc)){if(t instanceof Da)return t;if(v1t.call(t,"__wrapped__"))return h1t(t)}return new Da(t)}ty.prototype=M_.prototype,ty.prototype.constructor=ty;function PR(t){var e=Jg(t),n=ty[e];if(typeof n!="function"||!(e in Vc.prototype))return!1;if(t===n)return!0;var r=ER(n);return!!r&&t===r[0]}var g1t=800,y1t=16,m1t=Date.now;function b1t(t){var e=0,n=0;return function(){var r=m1t(),i=y1t-(r-n);if(n=r,i>0){if(++e>=g1t)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function x1t(t){return function(){return t}}var w1t=function(){try{var t=Hs(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();const ey=w1t;var O1t=ey?function(t,e){return ey(t,"toString",{configurable:!0,enumerable:!1,value:x1t(e),writable:!0})}:__,_1t=b1t(O1t);const AR=_1t;function S1t(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function E1t(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function M1t(t){return t!==t}function P1t(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function CR(t,e,n){return e===e?P1t(t,e,n):E1t(t,M1t,n)}function A1t(t,e){var n=t==null?0:t.length;return!!n&&CR(t,e,0)>-1}var C1t=9007199254740991,T1t=/^(?:0|[1-9]\d*)$/;function ny(t,e){var n=typeof t;return e=e==null?C1t:e,!!e&&(n=="number"||n!="symbol"&&T1t.test(t))&&t>-1&&t%1==0&&t<e}function ry(t,e,n){e=="__proto__"&&ey?ey(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function qd(t,e){return t===e||t!==t&&e!==e}var k1t=Object.prototype,L1t=k1t.hasOwnProperty;function iy(t,e,n){var r=t[e];(!(L1t.call(t,e)&&qd(r,n))||n===void 0&&!(e in t))&&ry(t,e,n)}function Us(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=r?r(n[s],t[s],s,n,t):void 0;l===void 0&&(l=t[s]),i?ry(n,s,l):iy(n,s,l)}return n}var TR=Math.max;function kR(t,e,n){return e=TR(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=TR(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=n(a),s1t(t,this,s)}}function N1t(t,e){return AR(kR(t,e,__),t+"")}var I1t=9007199254740991;function A_(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=I1t}function Fa(t){return t!=null&&A_(t.length)&&!Uc(t)}function j1t(t,e,n){if(!Gn(n))return!1;var r=typeof e;return(r=="number"?Fa(n)&&ny(e,n.length):r=="string"&&e in n)?qd(n[e],t):!1}function LR(t){return N1t(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,a&&j1t(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var s=n[r];s&&t(e,s,r,o)}return e})}var $1t=Object.prototype;function oy(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||$1t;return t===n}function D1t(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var F1t="[object Arguments]";function NR(t){return sr(t)&&Qi(t)==F1t}var IR=Object.prototype,R1t=IR.hasOwnProperty,B1t=IR.propertyIsEnumerable,z1t=NR(function(){return arguments}())?NR:function(t){return sr(t)&&R1t.call(t,"callee")&&!B1t.call(t,"callee")};const Kd=z1t;function Y1t(){return!1}var jR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,$R=jR&&typeof module=="object"&&module&&!module.nodeType&&module,W1t=$R&&$R.exports===jR,DR=W1t?wi.Buffer:void 0,G1t=DR?DR.isBuffer:void 0,H1t=G1t||Y1t;const Zd=H1t;var U1t="[object Arguments]",V1t="[object Array]",X1t="[object Boolean]",q1t="[object Date]",K1t="[object Error]",Z1t="[object Function]",Q1t="[object Map]",J1t="[object Number]",tbt="[object Object]",ebt="[object RegExp]",nbt="[object Set]",rbt="[object String]",ibt="[object WeakMap]",obt="[object ArrayBuffer]",abt="[object DataView]",sbt="[object Float32Array]",lbt="[object Float64Array]",cbt="[object Int8Array]",ubt="[object Int16Array]",fbt="[object Int32Array]",dbt="[object Uint8Array]",hbt="[object Uint8ClampedArray]",pbt="[object Uint16Array]",vbt="[object Uint32Array]",Ee={};Ee[sbt]=Ee[lbt]=Ee[cbt]=Ee[ubt]=Ee[fbt]=Ee[dbt]=Ee[hbt]=Ee[pbt]=Ee[vbt]=!0,Ee[U1t]=Ee[V1t]=Ee[obt]=Ee[X1t]=Ee[abt]=Ee[q1t]=Ee[K1t]=Ee[Z1t]=Ee[Q1t]=Ee[J1t]=Ee[tbt]=Ee[ebt]=Ee[nbt]=Ee[rbt]=Ee[ibt]=!1;function gbt(t){return sr(t)&&A_(t.length)&&!!Ee[Qi(t)]}function C_(t){return function(e){return t(e)}}var FR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,Qd=FR&&typeof module=="object"&&module&&!module.nodeType&&module,ybt=Qd&&Qd.exports===FR,T_=ybt&&fR.process,mbt=function(){try{var t=Qd&&Qd.require&&Qd.require("util").types;return t||T_&&T_.binding&&T_.binding("util")}catch(e){}}();const Xc=mbt;var RR=Xc&&Xc.isTypedArray,bbt=RR?C_(RR):gbt;const k_=bbt;var xbt=Object.prototype,wbt=xbt.hasOwnProperty;function BR(t,e){var n=Vt(t),r=!n&&Kd(t),i=!n&&!r&&Zd(t),o=!n&&!r&&!i&&k_(t),a=n||r||i||o,s=a?D1t(t.length,String):[],l=s.length;for(var c in t)(e||wbt.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ny(c,l)))&&s.push(c);return s}function zR(t,e){return function(n){return t(e(n))}}var Obt=zR(Object.keys,Object);const _bt=Obt;var Sbt=Object.prototype,Ebt=Sbt.hasOwnProperty;function Mbt(t){if(!oy(t))return _bt(t);var e=[];for(var n in Object(t))Ebt.call(t,n)&&n!="constructor"&&e.push(n);return e}function Vs(t){return Fa(t)?BR(t):Mbt(t)}var Pbt=Object.prototype,Abt=Pbt.hasOwnProperty,Cbt=LR(function(t,e){if(oy(e)||Fa(e)){Us(e,Vs(e),t);return}for(var n in e)Abt.call(e,n)&&iy(t,n,e[n])});const YR=Cbt;function Tbt(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var kbt=Object.prototype,Lbt=kbt.hasOwnProperty;function Nbt(t){if(!Gn(t))return Tbt(t);var e=oy(t),n=[];for(var r in t)r=="constructor"&&(e||!Lbt.call(t,r))||n.push(r);return n}function Jd(t){return Fa(t)?BR(t,!0):Nbt(t)}var Ibt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jbt=/^\w*$/;function L_(t,e){if(Vt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Vd(t)?!0:jbt.test(t)||!Ibt.test(t)||e!=null&&t in Object(e)}var $bt=Hs(Object,"create");const th=$bt;function Dbt(){this.__data__=th?th(null):{},this.size=0}function Fbt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Rbt="__lodash_hash_undefined__",Bbt=Object.prototype,zbt=Bbt.hasOwnProperty;function Ybt(t){var e=this.__data__;if(th){var n=e[t];return n===Rbt?void 0:n}return zbt.call(e,t)?e[t]:void 0}var Wbt=Object.prototype,Gbt=Wbt.hasOwnProperty;function Hbt(t){var e=this.__data__;return th?e[t]!==void 0:Gbt.call(e,t)}var Ubt="__lodash_hash_undefined__";function Vbt(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=th&&e===void 0?Ubt:e,this}function Xs(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Xs.prototype.clear=Dbt,Xs.prototype.delete=Fbt,Xs.prototype.get=Ybt,Xs.prototype.has=Hbt,Xs.prototype.set=Vbt;function Xbt(){this.__data__=[],this.size=0}function ay(t,e){for(var n=t.length;n--;)if(qd(t[n][0],e))return n;return-1}var qbt=Array.prototype,Kbt=qbt.splice;function Zbt(t){var e=this.__data__,n=ay(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():Kbt.call(e,n,1),--this.size,!0}function Qbt(t){var e=this.__data__,n=ay(e,t);return n<0?void 0:e[n][1]}function Jbt(t){return ay(this.__data__,t)>-1}function txt(t,e){var n=this.__data__,r=ay(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Io(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Io.prototype.clear=Xbt,Io.prototype.delete=Zbt,Io.prototype.get=Qbt,Io.prototype.has=Jbt,Io.prototype.set=txt;var ext=Hs(wi,"Map");const eh=ext;function nxt(){this.size=0,this.__data__={hash:new Xs,map:new(eh||Io),string:new Xs}}function rxt(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function sy(t,e){var n=t.__data__;return rxt(e)?n[typeof e=="string"?"string":"hash"]:n.map}function ixt(t){var e=sy(this,t).delete(t);return this.size-=e?1:0,e}function oxt(t){return sy(this,t).get(t)}function axt(t){return sy(this,t).has(t)}function sxt(t,e){var n=sy(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function jo(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}jo.prototype.clear=nxt,jo.prototype.delete=ixt,jo.prototype.get=oxt,jo.prototype.has=axt,jo.prototype.set=sxt;var lxt="Expected a function";function N_(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(lxt);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(N_.Cache||jo),n}N_.Cache=jo;var cxt=500;function uxt(t){var e=N_(t,function(r){return n.size===cxt&&n.clear(),r}),n=e.cache;return e}var fxt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,dxt=/\\(\\)?/g,hxt=uxt(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(fxt,function(n,r,i,o){e.push(i?o.replace(dxt,"$1"):r||n)}),e});const pxt=hxt;function I_(t){return t==null?"":Qg(t)}function qc(t,e){return Vt(t)?t:L_(t,e)?[t]:pxt(I_(t))}var vxt=1/0;function Kc(t){if(typeof t=="string"||Vd(t))return t;var e=t+"";return e=="0"&&1/t==-vxt?"-0":e}function ly(t,e){e=qc(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Kc(e[n++])];return n&&n==r?t:void 0}function ve(t,e,n){var r=t==null?void 0:ly(t,e);return r===void 0?n:r}function j_(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var WR=ti?ti.isConcatSpreadable:void 0;function gxt(t){return Vt(t)||Kd(t)||!!(WR&&t&&t[WR])}function GR(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=gxt),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?GR(s,e-1,n,r,i):j_(i,s):r||(i[i.length]=s)}return i}function yxt(t){var e=t==null?0:t.length;return e?GR(t,1):[]}function $_(t){return AR(kR(t,void 0,yxt),t+"")}var mxt=zR(Object.getPrototypeOf,Object);const D_=mxt;var bxt="[object Object]",xxt=Function.prototype,wxt=Object.prototype,HR=xxt.toString,Oxt=wxt.hasOwnProperty,_xt=HR.call(Object);function F_(t){if(!sr(t)||Qi(t)!=bxt)return!1;var e=D_(t);if(e===null)return!0;var n=Oxt.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&HR.call(n)==_xt}function Sxt(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}var Ext=wi.isFinite,Mxt=Math.min;function Pxt(t){var e=Math[t];return function(n,r){if(n=mR(n),r=r==null?0:Mxt(xR(r),292),r&&Ext(n)){var i=(I_(n)+"e").split("e"),o=e(i[0]+"e"+(+i[1]+r));return i=(I_(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return e(n)}}var Axt=Pxt("ceil");const Cxt=Axt;function Txt(){this.__data__=new Io,this.size=0}function kxt(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Lxt(t){return this.__data__.get(t)}function Nxt(t){return this.__data__.has(t)}var Ixt=200;function jxt(t,e){var n=this.__data__;if(n instanceof Io){var r=n.__data__;if(!eh||r.length<Ixt-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new jo(r)}return n.set(t,e),this.size=n.size,this}function Oi(t){var e=this.__data__=new Io(t);this.size=e.size}Oi.prototype.clear=Txt,Oi.prototype.delete=kxt,Oi.prototype.get=Lxt,Oi.prototype.has=Nxt,Oi.prototype.set=jxt;function $xt(t,e){return t&&Us(e,Vs(e),t)}function Dxt(t,e){return t&&Us(e,Jd(e),t)}var UR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,VR=UR&&typeof module=="object"&&module&&!module.nodeType&&module,Fxt=VR&&VR.exports===UR,XR=Fxt?wi.Buffer:void 0,qR=XR?XR.allocUnsafe:void 0;function KR(t,e){if(e)return t.slice();var n=t.length,r=qR?qR(n):new t.constructor(n);return t.copy(r),r}function Rxt(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function ZR(){return[]}var Bxt=Object.prototype,zxt=Bxt.propertyIsEnumerable,QR=Object.getOwnPropertySymbols,Yxt=QR?function(t){return t==null?[]:(t=Object(t),Rxt(QR(t),function(e){return zxt.call(t,e)}))}:ZR;const R_=Yxt;function Wxt(t,e){return Us(t,R_(t),e)}var Gxt=Object.getOwnPropertySymbols,Hxt=Gxt?function(t){for(var e=[];t;)j_(e,R_(t)),t=D_(t);return e}:ZR;const JR=Hxt;function Uxt(t,e){return Us(t,JR(t),e)}function t9(t,e,n){var r=e(t);return Vt(t)?r:j_(r,n(t))}function B_(t){return t9(t,Vs,R_)}function e9(t){return t9(t,Jd,JR)}var Vxt=Hs(wi,"DataView");const z_=Vxt;var Xxt=Hs(wi,"Promise");const Y_=Xxt;var qxt=Hs(wi,"Set");const Zc=qxt;var n9="[object Map]",Kxt="[object Object]",r9="[object Promise]",i9="[object Set]",o9="[object WeakMap]",a9="[object DataView]",Zxt=Gs(z_),Qxt=Gs(eh),Jxt=Gs(Y_),t2t=Gs(Zc),e2t=Gs(Xd),qs=Qi;(z_&&qs(new z_(new ArrayBuffer(1)))!=a9||eh&&qs(new eh)!=n9||Y_&&qs(Y_.resolve())!=r9||Zc&&qs(new Zc)!=i9||Xd&&qs(new Xd)!=o9)&&(qs=function(t){var e=Qi(t),n=e==Kxt?t.constructor:void 0,r=n?Gs(n):"";if(r)switch(r){case Zxt:return a9;case Qxt:return n9;case Jxt:return r9;case t2t:return i9;case e2t:return o9}return e});const nh=qs;var n2t=Object.prototype,r2t=n2t.hasOwnProperty;function i2t(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&r2t.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var o2t=wi.Uint8Array;const cy=o2t;function W_(t){var e=new t.constructor(t.byteLength);return new cy(e).set(new cy(t)),e}function a2t(t,e){var n=e?W_(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var s2t=/\w*$/;function l2t(t){var e=new t.constructor(t.source,s2t.exec(t));return e.lastIndex=t.lastIndex,e}var s9=ti?ti.prototype:void 0,l9=s9?s9.valueOf:void 0;function c2t(t){return l9?Object(l9.call(t)):{}}function c9(t,e){var n=e?W_(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var u2t="[object Boolean]",f2t="[object Date]",d2t="[object Map]",h2t="[object Number]",p2t="[object RegExp]",v2t="[object Set]",g2t="[object String]",y2t="[object Symbol]",m2t="[object ArrayBuffer]",b2t="[object DataView]",x2t="[object Float32Array]",w2t="[object Float64Array]",O2t="[object Int8Array]",_2t="[object Int16Array]",S2t="[object Int32Array]",E2t="[object Uint8Array]",M2t="[object Uint8ClampedArray]",P2t="[object Uint16Array]",A2t="[object Uint32Array]";function C2t(t,e,n){var r=t.constructor;switch(e){case m2t:return W_(t);case u2t:case f2t:return new r(+t);case b2t:return a2t(t,n);case x2t:case w2t:case O2t:case _2t:case S2t:case E2t:case M2t:case P2t:case A2t:return c9(t,n);case d2t:return new r;case h2t:case g2t:return new r(t);case p2t:return l2t(t);case v2t:return new r;case y2t:return c2t(t)}}function u9(t){return typeof t.constructor=="function"&&!oy(t)?E_(D_(t)):{}}var T2t="[object Map]";function k2t(t){return sr(t)&&nh(t)==T2t}var f9=Xc&&Xc.isMap,L2t=f9?C_(f9):k2t;const N2t=L2t;var I2t="[object Set]";function j2t(t){return sr(t)&&nh(t)==I2t}var d9=Xc&&Xc.isSet,$2t=d9?C_(d9):j2t;const D2t=$2t;var F2t=1,R2t=2,B2t=4,h9="[object Arguments]",z2t="[object Array]",Y2t="[object Boolean]",W2t="[object Date]",G2t="[object Error]",p9="[object Function]",H2t="[object GeneratorFunction]",U2t="[object Map]",V2t="[object Number]",v9="[object Object]",X2t="[object RegExp]",q2t="[object Set]",K2t="[object String]",Z2t="[object Symbol]",Q2t="[object WeakMap]",J2t="[object ArrayBuffer]",twt="[object DataView]",ewt="[object Float32Array]",nwt="[object Float64Array]",rwt="[object Int8Array]",iwt="[object Int16Array]",owt="[object Int32Array]",awt="[object Uint8Array]",swt="[object Uint8ClampedArray]",lwt="[object Uint16Array]",cwt="[object Uint32Array]",ge={};ge[h9]=ge[z2t]=ge[J2t]=ge[twt]=ge[Y2t]=ge[W2t]=ge[ewt]=ge[nwt]=ge[rwt]=ge[iwt]=ge[owt]=ge[U2t]=ge[V2t]=ge[v9]=ge[X2t]=ge[q2t]=ge[K2t]=ge[Z2t]=ge[awt]=ge[swt]=ge[lwt]=ge[cwt]=!0,ge[G2t]=ge[p9]=ge[Q2t]=!1;function rh(t,e,n,r,i,o){var a,s=e&F2t,l=e&R2t,c=e&B2t;if(n&&(a=i?n(t,r,i,o):n(t)),a!==void 0)return a;if(!Gn(t))return t;var u=Vt(t);if(u){if(a=i2t(t),!s)return P_(t,a)}else{var f=nh(t),d=f==p9||f==H2t;if(Zd(t))return KR(t,s);if(f==v9||f==h9||d&&!i){if(a=l||d?{}:u9(t),!s)return l?Uxt(t,Dxt(a,t)):Wxt(t,$xt(a,t))}else{if(!ge[f])return i?t:{};a=C2t(t,f,s)}}o||(o=new Oi);var h=o.get(t);if(h)return h;o.set(t,a),D2t(t)?t.forEach(function(g){a.add(rh(g,e,n,g,t,o))}):N2t(t)&&t.forEach(function(g,y){a.set(y,rh(g,e,n,y,t,o))});var p=c?l?e9:B_:l?Jd:Vs,v=u?void 0:p(t);return S1t(v||t,function(g,y){v&&(y=g,g=t[y]),iy(a,y,rh(g,e,n,y,t,o))}),a}var uwt=1,fwt=4;function g9(t){return rh(t,uwt|fwt)}var dwt="__lodash_hash_undefined__";function hwt(t){return this.__data__.set(t,dwt),this}function pwt(t){return this.__data__.has(t)}function ih(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new jo;++e<n;)this.add(t[e])}ih.prototype.add=ih.prototype.push=hwt,ih.prototype.has=pwt;function vwt(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function y9(t,e){return t.has(e)}var gwt=1,ywt=2;function m9(t,e,n,r,i,o){var a=n&gwt,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=n&ywt?new ih:void 0;for(o.set(t,e),o.set(e,t);++f<s;){var p=t[f],v=e[f];if(r)var g=a?r(v,p,f,e,t,o):r(p,v,f,t,e,o);if(g!==void 0){if(g)continue;d=!1;break}if(h){if(!vwt(e,function(y,m){if(!y9(h,m)&&(p===y||i(p,y,n,r,o)))return h.push(m)})){d=!1;break}}else if(!(p===v||i(p,v,n,r,o))){d=!1;break}}return o.delete(t),o.delete(e),d}function mwt(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function G_(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var bwt=1,xwt=2,wwt="[object Boolean]",Owt="[object Date]",_wt="[object Error]",Swt="[object Map]",Ewt="[object Number]",Mwt="[object RegExp]",Pwt="[object Set]",Awt="[object String]",Cwt="[object Symbol]",Twt="[object ArrayBuffer]",kwt="[object DataView]",b9=ti?ti.prototype:void 0,H_=b9?b9.valueOf:void 0;function Lwt(t,e,n,r,i,o,a){switch(n){case kwt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Twt:return!(t.byteLength!=e.byteLength||!o(new cy(t),new cy(e)));case wwt:case Owt:case Ewt:return qd(+t,+e);case _wt:return t.name==e.name&&t.message==e.message;case Mwt:case Awt:return t==e+"";case Swt:var s=mwt;case Pwt:var l=r&bwt;if(s||(s=G_),t.size!=e.size&&!l)return!1;var c=a.get(t);if(c)return c==e;r|=xwt,a.set(t,e);var u=m9(s(t),s(e),r,i,o,a);return a.delete(t),u;case Cwt:if(H_)return H_.call(t)==H_.call(e)}return!1}var Nwt=1,Iwt=Object.prototype,jwt=Iwt.hasOwnProperty;function $wt(t,e,n,r,i,o){var a=n&Nwt,s=B_(t),l=s.length,c=B_(e),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in e:jwt.call(e,d)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var v=!0;o.set(t,e),o.set(e,t);for(var g=a;++f<l;){d=s[f];var y=t[d],m=e[d];if(r)var b=a?r(m,y,d,e,t,o):r(y,m,d,t,e,o);if(!(b===void 0?y===m||i(y,m,n,r,o):b)){v=!1;break}g||(g=d=="constructor")}if(v&&!g){var x=t.constructor,w=e.constructor;x!=w&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof w=="function"&&w instanceof w)&&(v=!1)}return o.delete(t),o.delete(e),v}var Dwt=1,x9="[object Arguments]",w9="[object Array]",uy="[object Object]",Fwt=Object.prototype,O9=Fwt.hasOwnProperty;function Rwt(t,e,n,r,i,o){var a=Vt(t),s=Vt(e),l=a?w9:nh(t),c=s?w9:nh(e);l=l==x9?uy:l,c=c==x9?uy:c;var u=l==uy,f=c==uy,d=l==c;if(d&&Zd(t)){if(!Zd(e))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new Oi),a||k_(t)?m9(t,e,n,r,i,o):Lwt(t,e,l,n,r,i,o);if(!(n&Dwt)){var h=u&&O9.call(t,"__wrapped__"),p=f&&O9.call(e,"__wrapped__");if(h||p){var v=h?t.value():t,g=p?e.value():e;return o||(o=new Oi),i(v,g,n,r,o)}}return d?(o||(o=new Oi),$wt(t,e,n,r,i,o)):!1}function fy(t,e,n,r,i){return t===e?!0:t==null||e==null||!sr(t)&&!sr(e)?t!==t&&e!==e:Rwt(t,e,n,r,fy,i)}var Bwt=1,zwt=2;function Ywt(t,e,n,r){var i=n.length,o=i,a=!r;if(t==null)return!o;for(t=Object(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){s=n[i];var l=s[0],c=t[l],u=s[1];if(a&&s[2]){if(c===void 0&&!(l in t))return!1}else{var f=new Oi;if(r)var d=r(c,u,l,t,e,f);if(!(d===void 0?fy(u,c,Bwt|zwt,r,f):d))return!1}}return!0}function _9(t){return t===t&&!Gn(t)}function Wwt(t){for(var e=Vs(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,_9(i)]}return e}function S9(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function Gwt(t){var e=Wwt(t);return e.length==1&&e[0][2]?S9(e[0][0],e[0][1]):function(n){return n===t||Ywt(n,t,e)}}function Hwt(t,e){return t!=null&&e in Object(t)}function Uwt(t,e,n){e=qc(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var a=Kc(e[r]);if(!(o=t!=null&&n(t,a)))break;t=t[a]}return o||++r!=i?o:(i=t==null?0:t.length,!!i&&A_(i)&&ny(a,i)&&(Vt(t)||Kd(t)))}function E9(t,e){return t!=null&&Uwt(t,e,Hwt)}var Vwt=1,Xwt=2;function qwt(t,e){return L_(t)&&_9(e)?S9(Kc(t),e):function(n){var r=ve(n,t);return r===void 0&&r===e?E9(n,t):fy(e,r,Vwt|Xwt)}}function Kwt(t){return function(e){return e==null?void 0:e[t]}}function Zwt(t){return function(e){return ly(e,t)}}function Qwt(t){return L_(t)?Kwt(Kc(t)):Zwt(t)}function U_(t){return typeof t=="function"?t:t==null?__:typeof t=="object"?Vt(t)?qwt(t[0],t[1]):Gwt(t):Qwt(t)}function Jwt(t,e,n,r){for(var i=-1,o=t==null?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function tOt(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var eOt=tOt();const M9=eOt;function nOt(t,e){return t&&M9(t,e,Vs)}function rOt(t,e){return function(n,r){if(n==null)return n;if(!Fa(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var iOt=rOt(nOt);const P9=iOt;function oOt(t,e,n,r){return P9(t,function(i,o,a){e(r,i,n(i),a)}),r}function aOt(t,e){return function(n,r){var i=Vt(n)?Jwt:oOt,o=e?e():{};return i(n,t,U_(r),o)}}function V_(t,e,n){(n!==void 0&&!qd(t[e],n)||n===void 0&&!(e in t))&&ry(t,e,n)}function sOt(t){return sr(t)&&Fa(t)}function X_(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function lOt(t){return Us(t,Jd(t))}function cOt(t,e,n,r,i,o,a){var s=X_(t,n),l=X_(e,n),c=a.get(l);if(c){V_(t,n,c);return}var u=o?o(s,l,n+"",t,e,a):void 0,f=u===void 0;if(f){var d=Vt(l),h=!d&&Zd(l),p=!d&&!h&&k_(l);u=l,d||h||p?Vt(s)?u=s:sOt(s)?u=P_(s):h?(f=!1,u=KR(l,!0)):p?(f=!1,u=c9(l,!0)):u=[]:F_(l)||Kd(l)?(u=s,Kd(s)?u=lOt(s):(!Gn(s)||Uc(s))&&(u=u9(l))):f=!1}f&&(a.set(l,u),i(u,l,r,o,a),a.delete(l)),V_(t,n,u)}function A9(t,e,n,r,i){t!==e&&M9(e,function(o,a){if(i||(i=new Oi),Gn(o))cOt(t,e,a,n,A9,r,i);else{var s=r?r(X_(t,a),o,a+"",t,e,i):void 0;s===void 0&&(s=o),V_(t,a,s)}},Jd)}var uOt=LR(function(t,e,n,r){A9(t,e,n,r)});const fOt=uOt;function dOt(t,e,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function hOt(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var pOt=Tmt(function(t,e){return t/e},1);const vOt=pOt;function gOt(t,e){var n=-1,r=Fa(t)?Array(t.length):[];return P9(t,function(i,o,a){r[++n]=e(i,o,a)}),r}function Qc(t,e){var n=Vt(t)?Zg:gOt;return n(t,U_(e))}var yOt="Expected a function",mOt=8,bOt=32,xOt=128,wOt=256;function OOt(t){return $_(function(e){var n=e.length,r=n,i=Da.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new TypeError(yOt);if(i&&!a&&Jg(o)=="wrapper")var a=new Da([],!0)}for(r=a?r:n;++r<n;){o=e[r];var s=Jg(o),l=s=="wrapper"?ER(o):void 0;l&&PR(l[0])&&l[1]==(xOt|mOt|bOt|wOt)&&!l[4].length&&l[9]==1?a=a[Jg(l[0])].apply(a,l[3]):a=o.length==1&&PR(o)?a[s]():a.thru(o)}return function(){var c=arguments,u=c[0];if(a&&c.length==1&&Vt(u))return a.plant(u).value();for(var f=0,d=n?e[f].apply(this,c):u;++f<n;)d=e[f].call(this,d);return d}})}var _Ot=OOt();const zt=_Ot;var SOt=Object.prototype,EOt=SOt.hasOwnProperty,MOt=aOt(function(t,e,n){EOt.call(t,n)?t[n].push(e):ry(t,n,[e])});const C9=MOt;var POt="[object String]";function T9(t){return typeof t=="string"||!Vt(t)&&sr(t)&&Qi(t)==POt}function AOt(t,e){return Zg(e,function(n){return t[n]})}function COt(t){return t==null?[]:AOt(t,Vs(t))}var TOt=Math.max;function kOt(t,e,n,r){t=Fa(t)?t:COt(t),n=n&&!r?xR(n):0;var i=t.length;return n<0&&(n=TOt(i+n,0)),T9(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&CR(t,e,n)>-1}function LOt(t,e){return e.length<2?t:ly(t,Sxt(e,0,-1))}var NOt="[object Boolean]";function q_(t){return t===!0||t===!1||sr(t)&&Qi(t)==NOt}function k9(t,e){return fy(t,e)}var IOt="[object Number]";function Jc(t){return typeof t=="number"||sr(t)&&Qi(t)==IOt}function jOt(t){return t==null}function $Ot(t){return t===void 0}function DOt(t,e){return e=qc(e,t),t=LOt(t,e),t==null||delete t[Kc(hOt(e))]}function FOt(t){return F_(t)?void 0:t}var ROt=1,BOt=2,zOt=4,YOt=$_(function(t,e){var n={};if(t==null)return n;var r=!1;e=Zg(e,function(o){return o=qc(o,t),r||(r=o.length>1),o}),Us(t,e9(t),n),r&&(n=rh(n,ROt|BOt|zOt,FOt));for(var i=e.length;i--;)DOt(n,e[i]);return n});const K_=YOt;function L9(t,e,n,r){if(!Gn(t))return t;e=qc(e,t);for(var i=-1,o=e.length,a=o-1,s=t;s!=null&&++i<o;){var l=Kc(e[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var u=s[l];c=r?r(u,l,s):void 0,c===void 0&&(c=Gn(u)?u:ny(e[i+1])?[]:{})}iy(s,l,c),s=s[l]}return t}function WOt(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=ly(t,a);n(s,a)&&L9(o,qc(a,t),s)}return o}function GOt(t,e){return WOt(t,e,function(n,r){return E9(t,r)})}var HOt=$_(function(t,e){return t==null?{}:GOt(t,e)});const N9=HOt;function dt(t,e,n){return t==null?t:L9(t,e,n)}var UOt=1/0,VOt=Zc&&1/G_(new Zc([,-0]))[1]==UOt?function(t){return new Zc(t)}:SR;const XOt=VOt;var qOt=200;function KOt(t,e,n){var r=-1,i=A1t,o=t.length,a=!0,s=[],l=s;if(n)a=!1,i=dOt;else if(o>=qOt){var c=e?null:XOt(t);if(c)return G_(c);a=!1,i=y9,l=new ih}else l=e?[]:s;t:for(;++r<o;){var u=t[r],f=e?e(u):u;if(u=n||u!==0?u:0,a&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue t;e&&l.push(f),s.push(u)}else i(l,f,n)||(l!==s&&l.push(f),s.push(u))}return s}function Z_(t,e){return t&&t.length?KOt(t,U_(e)):[]}var ZOt=function(t){var e=/react|\.jsx|children:\[\(|return\s+[A-Za-z0-9].createElement\((?!['"][g|circle|ellipse|image|rect|line|polyline|polygon|text|path|html|mesh]['"])([^\)])*,/i;return e.test(t)},Q_=function(){return Q_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Q_.apply(this,arguments)},I9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function QOt(t,e){var n=q.useRef(),r=q.useRef(),i=q.useRef(null),o=e.onReady,a=e.onEvent,s=function(u,f){var d;u===void 0&&(u="image/png");var h=(d=i.current)===null||d===void 0?void 0:d.getElementsByTagName("canvas")[0];return h==null?void 0:h.toDataURL(u,f)},l=function(u,f,d){u===void 0&&(u="download"),f===void 0&&(f="image/png");var h=u;u.indexOf(".")===-1&&(h="".concat(u,".").concat(f.split("/")[1]));var p=s(f,d),v=document.createElement("a");return v.href=p,v.download=h,document.body.appendChild(v),v.click(),document.body.removeChild(v),v=null,h},c=function(u,f){f===void 0&&(f=!1);var d=Object.keys(u),h=f;d.forEach(function(p){var v=u[p];p==="tooltip"&&(h=!0),Uc(v)&&ZOt("".concat(v))?u[p]=function(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];return cmt(v.apply(void 0,g),h)}:Vt(v)?v.forEach(function(g){c(g,h)}):Gn(v)?c(v,h):h=f})};return q.useEffect(function(){if(n.current&&!k9(r.current,e)){var u=!1;if(r.current){var f=r.current;f.data;var d=I9(f,["data"]);e.data;var h=I9(e,["data"]);u=k9(d,h)}r.current=g9(e),u?n.current.changeData(ve(e,"data")):(c(e),n.current.update(e),n.current.render())}},[e]),q.useEffect(function(){if(!i.current)return function(){return null};r.current||(r.current=g9(e)),c(e);var u=new t(i.current,Q_({},e));u.toDataURL=s,u.downloadImage=l,u.render(),n.current=u,o&&o(u);var f=function(d){a&&a(u,d)};return u.on("*",f),function(){n.current&&(n.current.destroy(),n.current.off("*",f),n.current=void 0)}},[]),{chart:n,container:i}}var JOt=function(t){return t!==null&&typeof t!="function"&&isFinite(t.length)};const j9=JOt;var t_t=function(t,e){if(!j9(t))return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];e(i,r)&&n.push(i)}return n};const e_t=t_t,n_t=function(t){return typeof t=="function"};var r_t=function(t){return t==null};const i_t=r_t;var o_t={}.toString,a_t=function(t,e){return o_t.call(t)==="[object "+e+"]"};const J_=a_t,tu=function(t){return Array.isArray?Array.isArray(t):J_(t,"Array")},s_t=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function tS(t,e){if(t){var n;if(tu(t))for(var r=0,i=t.length;r<i&&(n=e(t[r],r),n!==!1);r++);else if(s_t(t)){for(var o in t)if(t.hasOwnProperty(o)&&(n=e(t[o],o),n===!1))break}}}var l_t=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return tS(t,function(n,r){n_t(t)&&r==="prototype"||e.push(r)}),e};const c_t=l_t;var u_t=function(t){return typeof t=="object"&&t!==null};const f_t=u_t;var d_t=function(t){if(!f_t(t)||!J_(t,"Object"))return!1;if(Object.getPrototypeOf(t)===null)return!0;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};const dy=d_t;var h_t=function(t,e,n){if(!tu(t)&&!dy(t))return t;var r=n;return tS(t,function(i,o){r=e(r,i,o)}),r};const p_t=h_t,eS=function(t){return J_(t,"String")};function nS(t,e){for(var n in e)e.hasOwnProperty(n)&&n!=="constructor"&&e[n]!==void 0&&(t[n]=e[n])}function v_t(t,e,n,r){return e&&nS(t,e),n&&nS(t,n),r&&nS(t,r),t}var g_t=5;function y_t(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(t==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function $9(t,e,n,r){n=n||0,r=r||g_t;for(var i in e)if(y_t(e,i)){var o=e[i];o!==null&&dy(o)?(dy(t[i])||(t[i]={}),n<r?$9(t[i],o,n+1,r):t[i]=e[i]):tu(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var m_t=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)$9(t,e[r]);return t};const hy=m_t,Ji=function(t,e,n){for(var r=0,i=eS(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return t===void 0||r<i.length?n:t};var b_t=Object.prototype.hasOwnProperty;const D9=function(t,e){if(t===null||!dy(t))return{};var n={};return tS(e,function(r){b_t.call(t,r)&&(n[r]=t[r])}),n};function x_t(t){return i_t(t)?0:j9(t)?t.length:Object.keys(t).length}const w_t={field:"value",size:[1,1],round:!1,padding:0,sort:(t,e)=>e.value-t.value,as:["x","y"],ignoreParentValue:!0},O_t="nodeIndex",oh="childNodeCount",__t="nodeAncestor",rS="Invalid field: it must be a string!";function S_t(t,e){const{field:n,fields:r}=t;if(eS(n))return n;if(tu(n))return console.warn(rS),n[0];if(console.warn(`${rS} will try to get fields instead.`),eS(r))return r;if(tu(r)&&r.length)return r[0];if(e)return e;throw new TypeError(rS)}function E_t(t){const e=[];if(t&&t.each){let n,r;t.each(i=>{var o,a;i.parent!==n?(n=i.parent,r=0):r+=1;const s=e_t((((o=i.ancestors)===null||o===void 0?void 0:o.call(i))||[]).map(l=>e.find(c=>c.name===l.name)||l),({depth:l})=>l>0&&l<i.depth);i[__t]=s,i[oh]=((a=i.children)===null||a===void 0?void 0:a.length)||0,i[O_t]=r,e.push(i)})}else t&&t.eachNode&&t.eachNode(n=>{e.push(n)});return e}function M_t(t,e){e=v_t({},w_t,e);const n=e.as;if(!tu(n)||n.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');let r;try{r=S_t(e)}catch(l){console.warn(l)}const o=(l=>urt().size(e.size).round(e.round).padding(e.padding)(Yl(l).sum(c=>x_t(c.children)?e.ignoreParentValue?0:c[r]-p_t(c.children,(u,f)=>u+f[r],0):c[r]).sort(e.sort)))(t),a=n[0],s=n[1];return o.each(l=>{var c,u;l[a]=[l.x0,l.x1,l.x1,l.x0],l[s]=[l.y1,l.y1,l.y0,l.y0],l.name=l.name||((c=l.data)===null||c===void 0?void 0:c.name)||((u=l.data)===null||u===void 0?void 0:u.label),l.data.name=l.name,["x0","x1","y0","y1"].forEach(f=>{n.indexOf(f)===-1&&delete l[f]})}),E_t(o)}var P_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const eu="sunburst",iS="markType",F9="path",py="ancestor-node";function A_t(t){const{data:e,encode:n}=t,{color:r,value:i}=n,a=M_t(e,{field:i,type:"hierarchy.partition",as:["x","y"]}),s=[];return a.forEach(l=>{var c,u,f,d;if(l.depth===0)return null;let h=l.data.name;const p=[h];let v=Object.assign({},l);for(;v.depth>1;)h=`${(c=v.parent.data)===null||c===void 0?void 0:c.name} / ${h}`,p.unshift((u=v.parent.data)===null||u===void 0?void 0:u.name),v=v.parent;const g=Object.assign(Object.assign(Object.assign({},D9(l.data,[i])),{[F9]:h,[py]:v.data.name}),l);r&&r!==py&&(g[r]=l.data[r]||((d=(f=l.parent)===null||f===void 0?void 0:f.data)===null||d===void 0?void 0:d[r])),s.push(g)}),s.map(l=>Object.assign(Object.assign({},l),{x:l.x.slice(0,2),y:[l.y[2],l.y[0]],fillOpacity:Math.pow(.85,l.depth)}))}const R9={id:eu,encode:{x:"x",y:"y",key:F9,color:py,value:"value"},axis:{x:!1,y:!1},style:{[iS]:eu,stroke:"#fff",lineWidth:.5,fillOpacity:"fillOpacity",[oh]:oh,depth:"depth"},state:{active:{zIndex:2,stroke:"#000"},inactive:{zIndex:1,stroke:"#fff"}},legend:!1,interaction:{drillDown:!0},coordinate:{type:"polar",innerRadius:.2}},B9=t=>{const{encode:e,data:n=[],legend:r}=t,i=P_t(t,["encode","data","legend"]),o=Object.assign(Object.assign({},i.coordinate),{innerRadius:Math.max(Ji(i,["coordinate","innerRadius"],.2),1e-5)}),a=Object.assign(Object.assign({},R9.encode),e),{value:s}=a,l=A_t({encode:a,data:n});return[hy({},R9,Object.assign(Object.assign({type:"rect",data:l,encode:a,tooltip:{title:"path",items:[c=>({name:s,value:c[s]})]}},i),{coordinate:o}))]};B9.props={};var C_t=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};const T_t=t=>t.querySelectorAll(".element").filter(e=>Ji(e,["style",iS])===eu);function k_t(t){return pt(t).select(`.${Lf}`).node()}const L_t={rootText:"root",style:{fill:"rgba(0, 0, 0, 0.85)",fontSize:12,y:1},active:{fill:"rgba(0, 0, 0, 0.5)"}};function N_t(t={}){const{breadCrumb:e={},fixedColor:n=!0}=t,r=hy({},L_t,e);return i=>{const{update:o,setState:a,container:s,view:l,options:c}=i,u=k_t(s),f=c.marks.find(({id:m})=>m===eu),{state:d}=f,h=new an;u.appendChild(h);const p=(m,b)=>C_t(this,void 0,void 0,function*(){if(h.removeChildren(),m){const x=new jr({style:Object.assign({x:0,text:r.rootText,depth:0},r.style)});h.appendChild(x);let w="";const O=m==null?void 0:m.split(" / ");let _=r.style.y,S=h.getBBox().width;const E=u.getBBox().width,M=O.map((P,C)=>{const A=new jr({style:Object.assign(Object.assign({x:S,text:" / "},r.style),{y:_})});h.appendChild(A),S+=A.getBBox().width,w=`${w}${P} / `;const T=new jr({name:w.replace(/\s\/\s$/,""),style:Object.assign(Object.assign({text:P,x:S,depth:C+1},r.style),{y:_})});return h.appendChild(T),S+=T.getBBox().width,S>E&&(_=h.getBBox().height,S=0,A.attr({x:S,y:_}),S+=A.getBBox().width,T.attr({x:S,y:_}),S+=T.getBBox().width),T});[x,...M].forEach((P,C)=>{if(C===M.length)return;const A=Object.assign({},P.attributes);P.attr("cursor","pointer"),P.addEventListener("mouseenter",()=>{P.attr(r.active)}),P.addEventListener("mouseleave",()=>{P.attr(A)}),P.addEventListener("click",()=>{p(P.name,Ji(P,["style","depth"]))})})}a("drillDown",x=>{const{marks:w}=x,O=w.map(_=>{if(_.id!==eu&&_.type!=="rect")return _;const{data:S}=_,E=Object.fromEntries(["color"].map(P=>[P,{domain:l.scale[P].getOptions().domain}])),M=S.filter(P=>{const C=P.path;return n&&(P[py]=C.split(" / ")[b]),m?new RegExp(`^${m}.+`).test(C):!0});return hy({},_,n?{data:M}:{data:M,scale:E})});return Object.assign(Object.assign({},x),{marks:O})}),yield o()}),v=m=>{const b=m.target;if(Ji(b,["style",iS])!==eu||Ji(b,["markType"])!=="rect"||!Ji(b,["style",oh]))return;const x=Ji(b,["__data__","key"]),w=Ji(b,["style","depth"]);b.style.cursor="pointer",p(x,w)};u.addEventListener("click",v);const g=c_t(Object.assign(Object.assign({},d.active),d.inactive)),y=()=>{T_t(u).forEach(b=>{const x=Ji(b,["style",oh]);if(Ji(b,["style","cursor"])!=="pointer"&&x){b.style.cursor="pointer";const O=D9(b.attributes,g);b.addEventListener("mouseenter",()=>{b.attr(d.active)}),b.addEventListener("mouseleave",()=>{b.attr(hy(O,d.inactive))})}})};return u.addEventListener("mousemove",y),()=>{h.remove(),u.removeEventListener("click",v),u.removeEventListener("mousemove",y)}}}U.enableCSSParsing=!1;function I_t(){return{"interaction.drillDown":N_t,"mark.sunburst":B9}}var vy=function(){return vy=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},vy.apply(this,arguments)},j_t=Svt(Qvt,vy(vy({},WD()),I_t())),Xt=function(t){var e=D_t(t),n=e.children,r=n===void 0?[]:n,i=K_(e,[].concat(W9,gy.map(function(c){return c.key}))),o=function(c){var u;return(u=Y_t.find(function(f){return f.key===c}))===null||u===void 0?void 0:u.callback},a=function(c,u,f){var d=o(u);d?d(c,u,f):c[u]=Ra({},c[u],f)},s=function(c){Object.keys(c).forEach(function(u){var f=gy.find(function(p){return p.key===u});if(f){var d=f.type,h=f.extend_keys;d?r.push(l(Ra({},N9(c,h),{type:d},c[u]))):Vt(c[u])&&c[u].forEach(function(p){r.push(l(p))})}})},l=function(c){return s(c),Object.keys(aS).forEach(function(u){var f=aS[u];if(!$Ot(c[u]))if(Gn(f)){var d=f.value,h=f.target,p=d(c[u]);a(c,h,p)}else dt(c,f,c[u])}),c};return r.forEach(function(c){var u=Ra({},i,c);l(Ra(c,u))}),s(e),$_t(e),t},z9=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},$_t=function(t){var e=t.children,n=e===void 0?[]:e,r=Object.keys(aS).concat(gy.map(function(i){return i.key}));return r.forEach(function(i){delete t[i]}),n.forEach(function(i){Object.keys(i).forEach(function(o){r.includes(o)&&delete i[o]})}),Object.keys(t).forEach(function(i){z9(z9([],W9,!0),lS.map(function(o){return o.key}),!0).includes(i)||delete t[i]}),t},D_t=function(t){var e=t.options,n=e.children,r=n===void 0?[]:n;return r.forEach(function(i){Object.keys(i).forEach(function(o){Vt(i[o])&&o!=="data"&&(i[o]=i[o].filter(function(a){return!a[oS]}))})}),e},Y9=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},F_t=function(t,e){if(Vt(e))return e},Ra=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return fOt.apply(void 0,Y9(Y9([],t,!1),[F_t],!1))},ah=function(){return ah=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ah.apply(this,arguments)},R_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},B_t=["renderer"],W9=["width","height","autoFit","theme","inset","insetLeft","insetRight","insetTop","insetBottom","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","depth","title","clip","children","type","data","direction"],oS="__transform__",z_t="__skipDelCustomKeys__",Ks=function(t,e){return q_(e)?{type:t,available:e}:ah({type:t},e)},aS={xField:"encode.x",yField:"encode.y",colorField:"encode.color",angleField:"encode.y",keyField:"encode.key",sizeField:"encode.size",shapeField:"encode.shape",seriesField:"encode.series",positionField:"encode.position",textField:"encode.text",valueField:"encode.value",binField:"encode.x",srcField:"encode.src",linkColorField:"encode.linkColor",radius:"coordinate.outerRadius",innerRadius:"coordinate.innerRadius",startAngle:"coordinate.startAngle",endAngle:"coordinate.endAngle",focusX:"coordinate.focusX",focusY:"coordinate.focusY",distortionX:"coordinate.distortionX",distortionY:"coordinate.distortionY",visual:"coordinate.visual",stack:{target:"transform",value:function(t){return Ks("stackY",t)}},normalize:{target:"transform",value:function(t){return Ks("normalizeY",t)}},percent:{target:"transform",value:function(t){return Ks("normalizeY",t)}},group:{target:"transform",value:function(t){return Ks("dodgeX",t)}},sort:{target:"transform",value:function(t){return Ks("sortX",t)}},symmetry:{target:"transform",value:function(t){return Ks("symmetryY",t)}},diff:{target:"transform",value:function(t){return Ks("diffY",t)}},meta:{target:"scale",value:function(t){return t}},label:{target:"labels",value:function(t){return t}},shape:"style.shape",connectNulls:{target:"style",value:function(t){return q_(t)?{connect:t}:t}}},sS=["xField","yField","seriesField","colorField","keyField","positionField","meta","tooltip","animate","stack","normalize","percent","group","sort","symmetry","diff"],gy=[{key:"annotations",extend_keys:[]},{key:"line",type:"line",extend_keys:sS},{key:"point",type:"point",extend_keys:sS},{key:"area",type:"area",extend_keys:sS}],Y_t=[{key:"transform",callback:function(t,e,n){var r;t[e]=t[e]||[];var i=n.available,o=i===void 0?!0:i,a=R_t(n,["available"]);o?t[e].push(ah((r={},r[oS]=!0,r),a)):t[e].splice(t[e].indexOf(function(s){return s.type===n.type}),1)}},{key:"labels",callback:function(t,e,n){var r;if(!n||Vt(n)){t[e]=n||[];return}n.text||(n.text=t.yField),t[e]=t[e]||[],t[e].push(ah((r={},r[oS]=!0,r),n))}}],lS=[{key:"conversionTag",shape:"ConversionTag"},{key:"axisText",shape:"BidirectionalBarAxisText"}],W_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),yy=function(){return yy=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},yy.apply(this,arguments)},G_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},G9=function(t){W_t(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=G_t(n,["style"]);return t.call(this,yy({style:yy({text:"",fontSize:12,textBaseline:"middle",textAlign:"center",fill:"#000",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1},r)},i))||this}return e}(jr),H_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),my=function(){return my=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},my.apply(this,arguments)},U_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},V_t=function(t){H_t(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=U_t(n,["style"]);return t.call(this,my({style:my({fill:"#eee"},r)},i))||this}return e}(rf),X_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),H9=function(t){X_t(e,t);function e(n,r,i){var o=t.call(this,{style:Ra(i,r)})||this;return o.chart=n,o}return e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this)},e.prototype.disconnectedCallback=function(){},e.prototype.attributeChangedCallback=function(n){},e.prototype.update=function(n,r){var i;return this.attr(Ra({},this.attributes,n||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,r)},e.prototype.clear=function(){this.removeChildren()},e.prototype.getElementsLayout=function(){var n=this.chart.getContext().canvas,r=n.document.getElementsByClassName("element"),i=[];return r.forEach(function(o){var a=o.getBBox(),s=a.x,l=a.y,c=a.width,u=a.height,f=o.__data__;i.push({bbox:a,x:s,y:l,width:c,height:u,key:f.key,data:f})}),i},e.prototype.bindEvents=function(n,r){},e}(wp),q_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),by=function(){return by=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},by.apply(this,arguments)},K_t=function(t){q_t(e,t);function e(n,r){return t.call(this,n,r,{type:e.tag})||this}return e.prototype.getConversionTagLayout=function(){var n=this.direction==="vertical",r=this.getElementsLayout(),i=r[0],o=i.x,a=i.y,s=i.height,l=i.width,c=i.data,u=["items",0,"value"],f=ve(c,u),d=n?r[1].y-a-s:r[1].x-o-l,h=[],p=this.attributes,v=p.size,g=v===void 0?40:v,y=p.arrowSize,m=y===void 0?20:y,b=p.spacing,x=b===void 0?4:b;return r.forEach(function(w,O){if(O>0){var _=w.x,S=w.y,E=w.height,M=w.width,P=w.data,C=w.key,A=ve(P,u),T=g/2;if(n){var k=_+M/2,N=S;h.push({points:[[k+T,N-d+x],[k+T,N-m-x],[k,N-x],[k-T,N-m-x],[k-T,N-d+x]],center:[k,N-d/2-x],width:d,value:[f,A],key:C})}else{var k=_,N=S+E/2;h.push({points:[[_-d+x,N-T],[_-m-x,N-T],[k-x,N],[_-m-x,N+T],[_-d+x,N+T]],center:[k-d/2-x,N],width:d,value:[f,A],key:C})}f=A}}),h},e.prototype.render=function(){this.setDirection(),this.drawConversionTag()},e.prototype.setDirection=function(){var n=this.chart.getCoordinate(),r=ve(n,"options.transformations"),i="horizontal";r.forEach(function(o){o.includes("transpose")&&(i="vertical")}),this.direction=i},e.prototype.drawConversionTag=function(){var n=this,r=this.getConversionTagLayout(),i=this.attributes,o=i.style,a=i.text,s=a.style,l=a.formatter;r.forEach(function(c){var u=c.points,f=c.center,d=c.value,h=c.key,p=d[0],v=d[1],g=f[0],y=f[1],m=new V_t({style:by({points:u,fill:"#eee"},o),id:"polygon-".concat(h)}),b=new G9({style:by({x:g,y,text:Uc(l)?l(p,v):(v/p*100).toFixed(2)+"%"},s),id:"text-".concat(h)});n.appendChild(m),n.appendChild(b)})},e.prototype.update=function(){var n=this,r=this.getConversionTagLayout();r.forEach(function(i){var o=i.points,a=i.center,s=i.key,l=a[0],c=a[1],u=n.getElementById("polygon-".concat(s)),f=n.getElementById("text-".concat(s));u.setAttribute("points",o),f.setAttribute("x",l),f.setAttribute("y",c)})},e.tag="ConversionTag",e}(H9),cS=32,U9=16,V9=48,Z_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sh=function(){return sh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},sh.apply(this,arguments)},Q_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},J_t=function(t){Z_t(e,t);function e(n,r){return t.call(this,n,r,{type:e.tag})||this}return e.prototype.render=function(){this.drawText()},e.prototype.getBidirectionalBarAxisTextLayout=function(){var n=this.attributes.layout,r=n==="vertical",i=this.getElementsLayout(),o=r?Z_(i,"x"):Z_(i,"y"),a=["title"],s=[],l=this.chart.getContext().views,c=ve(l,[0,"layout"]),u=c.width,f=c.height;return o.forEach(function(d){var h=d.x,p=d.y,v=d.height,g=d.width,y=d.data,m=d.key,b=ve(y,a);r?s.push({x:h+g/2,y:f,text:b,key:m}):s.push({x:u,y:p+v/2,text:b,key:m})}),Z_(s,"text").length!==s.length&&(s=Object.values(C9(s,"text")).map(function(d){var h,p=d.reduce(function(v,g){return v+(r?g.x:g.y)},0);return sh(sh({},d[0]),(h={},h[r?"x":"y"]=p/d.length,h))})),s},e.prototype.transformLabelStyle=function(n){var r={},i=/^label[A-Z]/;return Object.keys(n).forEach(function(o){i.test(o)&&(r[o.replace("label","").replace(/^[A-Z]/,function(a){return a.toLowerCase()})]=n[o])}),r},e.prototype.drawText=function(){var n=this,r=this.getBidirectionalBarAxisTextLayout(),i=this.attributes,o=i.layout,a=i.labelFormatter,s=Q_t(i,["layout","labelFormatter"]);r.forEach(function(l){var c=l.x,u=l.y,f=l.text,d=l.key,h=new G9({style:sh({x:c,y:u,text:Uc(a)?a(f):f,wordWrap:!0,wordWrapWidth:o==="horizontal"?cS*2:120,maxLines:2,textOverflow:"ellipsis"},n.transformLabelStyle(s)),id:"text-".concat(d)});n.appendChild(h)})},e.prototype.update=function(){var n=this,r=this.getBidirectionalBarAxisTextLayout();r.forEach(function(i){var o=i.x,a=i.y,s=i.key,l=n.getElementById("text-".concat(s));l.setAttribute("x",o),l.setAttribute("y",a)})},e.tag="BidirectionalBarAxisText",e}(H9),tSt={ConversionTag:K_t,BidirectionalBarAxisText:J_t},eSt=function(){function t(e,n){this.container=new Map,this.chart=e,this.config=n,this.init()}return t.prototype.init=function(){var e=this;lS.forEach(function(n){var r,i=n.key,o=n.shape,a=e.config[i];if(a){var s=new tSt[o](e.chart,a),l=e.chart.getContext().canvas;l.appendChild(s),e.container.set(i,s)}else(r=e.container.get(i))===null||r===void 0||r.clear()})},t.prototype.update=function(){var e=this;this.container.size&&lS.forEach(function(n){var r=n.key,i=e.container.get(r);i==null||i.update()})},t}(),nSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),nu=function(){return nu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},nu.apply(this,arguments)},X9="data-chart-source-type",Rt=function(t){nSt(e,t);function e(n,r){var i=t.call(this)||this;return i.container=typeof n=="string"?document.getElementById(n):n,i.options=i.mergeOption(r),i.createG2(),i.bindEvents(),i}return e.prototype.getChartOptions=function(){return nu(nu({},N9(this.options,B_t)),{container:this.container})},e.prototype.getSpecOptions=function(){return this.type==="base"||this[z_t]?nu(nu({},this.options),this.getChartOptions()):this.options},e.prototype.createG2=function(){if(!this.container)throw Error("The container is not initialized!");this.chart=new j_t(this.getChartOptions()),this.container.setAttribute(X9,"Ant Design Charts")},e.prototype.bindEvents=function(){var n=this;this.chart&&this.chart.on("*",function(r){r!=null&&r.type&&n.emit(r.type,r)})},e.prototype.getBaseOptions=function(){return{type:"view",autoFit:!0}},e.prototype.getDefaultOptions=function(){},e.prototype.render=function(){var n=this;this.type!=="base"&&this.execAdaptor(),this.chart.options(this.getSpecOptions()),this.chart.render().then(function(){n.annotation=new eSt(n.chart,n.options)}),this.bindSizeSensor()},e.prototype.update=function(n){this.options=this.mergeOption(n)},e.prototype.mergeOption=function(n){return Ra({},this.getBaseOptions(),this.getDefaultOptions(),n)},e.prototype.changeData=function(n){this.chart.changeData(n)},e.prototype.changeSize=function(n,r){this.chart.changeSize(n,r)},e.prototype.destroy=function(){this.chart.destroy(),this.off(),this.container.removeAttribute(X9)},e.prototype.execAdaptor=function(){var n=this.getSchemaAdaptor();n({chart:this.chart,options:this.options})},e.prototype.triggerResize=function(){this.chart.forceFit()},e.prototype.bindSizeSensor=function(){var n=this,r=this.options.autoFit,i=r===void 0?!0:r;i&&this.chart.on(Ut.AFTER_CHANGE_SIZE,function(){n.annotation.update()})},e}(Ax),rSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),iSt=function(t){rSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="base",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"line"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return function(n){return n}},e}(Rt),uS=function(){return uS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},uS.apply(this,arguments)};function oSt(t){var e=t.options,n=e.stack,r=e.tooltip,i=e.xField;if(!n)return t;var o=gy.map(function(s){return s.type}).filter(function(s){return!!s}),a=!1;return o.forEach(function(s){e[s]&&(a=!0,dt(e,[s,"stack"],uS({y1:"y"},typeof n=="object"?n:{})))}),a&&!q_(r)&&!r&&dt(e,"tooltip",{title:i,items:[{channel:"y"}]}),t}function Fe(t){return zt(oSt)(t)}function aSt(t){var e=t.options.layout,n=e===void 0?"horizontal":e;return t.options.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}],t}function sSt(t){aSt(t);var e=t.options.layout,n=e===void 0?"horizontal":e;return t.options.children.forEach(function(r){var i;!((i=r==null?void 0:r.coordinate)===null||i===void 0)&&i.transform&&(r.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}])}),t}function lSt(t){return zt(Fe,Xt)(t)}var cSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),uSt=function(t){cSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="area",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"area"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return lSt},e}(Rt),ru=function(){return ru=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ru.apply(this,arguments)};function q9(t){var e=function(n){var r=n.options;ve(r,"children.length")>1&&dt(r,"children",[{type:"interval"}]);var i=r.scale,o=r.markBackground,a=r.data,s=r.children,l=r.yField,c=ve(i,"y.domain",[]);if(o&&c.length&&Vt(a)){var u="domainMax",f=a.map(function(d){var h;return ru(ru({originData:ru({},d)},K_(d,l)),(h={},h[u]=c[c.length-1],h))});s.unshift(ru({type:"interval",data:f,yField:u,tooltip:!1,style:{fill:"#eee"},label:!1},o))}return n};return zt(e,Fe,Xt)(t)}var fSt=function(){var t=function(e,n){return function(r){var i=e.fill,o=i===void 0?"#2888FF":i,a=e.stroke,s=e.fillOpacity,l=s===void 0?1:s,c=e.strokeOpacity,u=c===void 0?.2:c,f=e.pitch,d=f===void 0?8:f,h=r[0],p=r[1],v=r[2],g=r[3],y=(p[1]-h[1])/2,m=n.document,b=m.createElement("g",{}),x=m.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+y],[v[0]-d,h[1]+y],g],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u,inset:30}}),w=m.createElement("polygon",{style:{points:[[h[0]-d,h[1]+y],p,v,[v[0]-d,h[1]+y]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u}}),O=m.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+y],p,[h[0]+d,h[1]+y]],fill:o,fillOpacity:l-.2}});return b.appendChild(x),b.appendChild(w),b.appendChild(O),b}};HD("shape.interval.bar25D",t)},dSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();fSt();var hSt=function(t){dSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Bar",n}return e.getDefaultOptions=function(){return{type:"view",coordinate:{transform:[{type:"transpose"}]},children:[{type:"interval"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0},elementHighlightByColor:{background:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return q9},e}(Rt),pSt=function(){var t=function(e,n){return function(r){var i=e.fill,o=i===void 0?"#2888FF":i,a=e.stroke,s=e.fillOpacity,l=s===void 0?1:s,c=e.strokeOpacity,u=c===void 0?.2:c,f=e.pitch,d=f===void 0?8:f,h=r[1][0]-r[0][0],p=h/2+r[0][0],v=n.document,g=v.createElement("g",{}),y=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]+d],[p,r[3][1]+d],[r[3][0],r[3][1]]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u,inset:30}}),m=v.createElement("polygon",{style:{points:[[p,r[1][1]+d],[r[1][0],r[1][1]],[r[2][0],r[2][1]],[p,r[2][1]+d]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u}}),b=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]-d],[r[1][0],r[1][1]],[p,r[1][1]+d]],fill:o,fillOpacity:l-.2}});return g.appendChild(m),g.appendChild(y),g.appendChild(b),g}};HD("shape.interval.column25D",t)},vSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();pSt();var gSt=function(t){vSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="column",n}return e.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0},elementHighlightByColor:{background:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return q9},e}(Rt);function ySt(t){var e=function(r){var i=r.options,o=i.children,a=o===void 0?[]:o,s=i.legend;return s&&a.forEach(function(l){if(!ve(l,"colorField")){var c=ve(l,"yField");dt(l,"colorField",function(){return c})}}),r},n=function(r){var i=r.options,o=i.annotations,a=o===void 0?[]:o,s=i.children,l=s===void 0?[]:s,c=i.scale,u=!1;return ve(c,"y.key")||l.forEach(function(f,d){if(!ve(f,"scale.y.key")){var h="child".concat(d,"Scale");dt(f,"scale.y.key",h);var p=f.annotations,v=p===void 0?[]:p;v.length>0&&(dt(f,"scale.y.independent",!1),v.forEach(function(g){dt(g,"scale.y.key",h)})),!u&&a.length>0&&ve(f,"scale.y.independent")===void 0&&(u=!0,dt(f,"scale.y.independent",!1),a.forEach(function(g){dt(g,"scale.y.key",h)}))}}),r};return zt(e,n,Fe,Xt)(t)}var mSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),K9=function(t){mSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="DualAxes",n}return e.getDefaultOptions=function(){return{type:"view",axis:{y:{title:!1,tick:!1},x:{title:!1}},scale:{y:{independent:!0,nice:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return ySt},e}(Rt);function bSt(t){var e=function(o){var a=o.options,s=a.xField,l=a.colorField;return l||dt(a,"colorField",s),o},n=function(o){var a=o.options,s=a.compareField,l=a.transform,c=a.isTransposed,u=c===void 0?!0:c,f=a.coordinate;return l||(s?dt(a,"transform",[]):dt(a,"transform",[{type:"symmetryY"}])),!f&&u&&dt(a,"coordinate",{transform:[{type:"transpose"}]}),o},r=function(o){var a=o.options,s=a.compareField,l=a.seriesField,c=a.data,u=a.children,f=a.yField,d=a.isTransposed,h=d===void 0?!0:d;if(s||l){var p=Object.values(C9(c,function(v){return v[s||l]}));u[0].data=p[0],u.push({type:"interval",data:p[1],yField:function(v){return-v[f]}}),delete a.compareField,delete a.data}return l&&(dt(a,"type","spaceFlex"),dt(a,"ratio",[1,1]),dt(a,"direction",h?"row":"col"),delete a.seriesField),o},i=function(o){var a=o.options,s=a.tooltip,l=a.xField,c=a.yField;return s||dt(a,"tooltip",{title:!1,items:[function(u){return{name:u[l],value:u[c]}}]}),o};return zt(e,n,r,i,Fe,Xt)(t)}var xSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wSt=function(t){xSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="column",n}return e.getDefaultOptions=function(){return{type:"view",scale:{x:{padding:0}},animate:{enter:{type:"fadeIn"}},axis:!1,shapeField:"funnel",label:{position:"inside",transform:[{type:"contrastReverse"}]},children:[{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return bSt},e}(Rt);function OSt(t){return zt(Fe,Xt)(t)}var _St=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),SSt=function(t){_St(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="line",n}return e.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"line"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return OSt},e}(Rt),Ba=function(){return Ba=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ba.apply(this,arguments)};function ESt(t){var e=function(n){var r=n.options,i=r.angleField,o=r.data,a=r.label,s=r.tooltip,l=r.colorField;if(Vt(o)){var c=o.reduce(function(f,d){return f+d[i]},0);if(c===0){var u=o.map(function(f){var d;return Ba(Ba({},f),(d={},d[i]=1,d))});dt(r,"data",u),a&&dt(r,"label",Ba(Ba({},a),{formatter:function(){return 0}})),s!==!1&&dt(r,"tooltip",Ba(Ba({},s),{items:[function(f){return{name:f[l],value:0}}]}))}}return n};return zt(e,Xt)(t)}var MSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),PSt=function(t){MSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="pie",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"theta"},transform:[{type:"stackY",reverse:!0}],animate:{enter:{type:"waveIn"}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return ESt},e}(Rt);function ASt(t){return zt(Fe,Xt)(t)}var CSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),TSt=function(t){CSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="scatter",n}return e.getDefaultOptions=function(){return{axis:{y:{title:!1},x:{title:!1}},legend:{size:!1},children:[{type:"point"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return ASt},e}(Rt);function kSt(t){var e=function(n){return dt(n,"options.coordinate",{type:ve(n,"options.coordinateType","polar")}),n};return zt(e,Xt)(t)}var LSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),NSt=function(t){LSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="radar",n}return e.getDefaultOptions=function(){return{axis:{x:{grid:!0,line:!0},y:{zIndex:1,title:!1,line:!0,nice:!0}},meta:{x:{padding:.5,align:0}},interaction:{tooltip:{style:{crosshairsLineDash:[4,4]}}},children:[{type:"line"}],coordinateType:"polar"}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return kSt},e}(Rt),$o=function(){return $o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},$o.apply(this,arguments)},ISt="__stock-range__",jSt="trend",$St="up",DSt="down";function FSt(t){var e=function(r){var i=r.options,o=i.data,a=i.yField;return r.options.data=Qc(o,function(s){var l=s&&$o({},s);if(Array.isArray(a)&&l){var c=a[0],u=a[1],f=a[2],d=a[3];l[jSt]=l[c]<=l[u]?$St:DSt,l[ISt]=[l[c],l[u],l[f],l[d]]}return l}),r},n=function(r){var i=r.options,o=i.xField,a=i.yField,s=i.fallingFill,l=i.risingFill,c=a[0],u=a[1],f=a[2],d=a[3];return r.options.children=Qc(r.options.children,function(h,p){var v=p===0;return $o($o({},h),{tooltip:{title:function(g){return g[o]instanceof Date?g[o].toLocaleString():g[o]},items:[{field:f},{field:d},{field:c},{field:u}]},encode:$o($o({},h.encode||{}),{y:v?[f,d]:[c,u],color:function(g){return Math.sign(g[u]-g[c])}}),style:$o($o({},h.style||{}),{lineWidth:v?1:10})})}),delete i.yField,r.options.legend={color:!1},s&&dt(r,"options.scale.color.range[0]",s),l&&dt(r,"options.scale.color.range[2]",l),r};return zt(e,n,Xt)(t)}var RSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),BSt=["#26a69a","#999999","#ef5350"],zSt=function(t){RSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="stock",n}return e.getDefaultOptions=function(){return{type:"view",scale:{color:{domain:[-1,0,1],range:BSt},y:{nice:!0}},children:[{type:"link"},{type:"link"}],axis:{x:{title:!1,grid:!1},y:{title:!1,grid:!0,gridLineDash:null}},animate:{enter:{type:"scaleInY"}},interaction:{tooltip:{shared:!0,marker:!1,groupName:!1,crosshairs:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return FSt},e}(Rt);function YSt(t){return zt(Fe,Xt)(t)}var WSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),GSt=function(t){WSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyLine",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"line",axis:!1}],autoFit:!1,animate:{enter:{type:"growInX",duration:500}},padding:0,margin:0,tooltip:!1}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return YSt},e}(Rt);function HSt(t){return zt(Fe,Xt)(t)}var USt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),VSt=function(t){USt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyArea",n}return e.getDefaultOptions=function(){return{type:"view",animate:{enter:{type:"growInX",duration:500}},children:[{type:"area",axis:!1}],autoFit:!1,padding:0,margin:0,tooltip:!1}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return HSt},e}(Rt);function XSt(t){return zt(Fe,Xt)(t)}var qSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),KSt=function(t){qSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyColumn",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval",axis:!1}],autoFit:!1,padding:0,margin:0,tooltip:!1}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return XSt},e}(Rt),fS=function(){return fS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},fS.apply(this,arguments)};function ZSt(t){var e=function(n){var r=n.options,i=r.percent,o=r.color,a=o===void 0?[]:o;if(!i)return n;var s={scale:{color:{range:a.length?a:[]}},data:[1,i]};return Object.assign(r,fS({},s)),n};return zt(e,Fe,Xt)(t)}var QSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),JSt=function(t){QSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyProgress",n}return e.getDefaultOptions=function(){return{type:"view",data:[],autoFit:!1,margin:0,padding:0,tooltip:!1,children:[{interaction:{tooltip:!1},coordinate:{transform:[{type:"transpose"}]},type:"interval",axis:!1,legend:!1,encode:{y:function(n){return n},color:function(n,r){return r}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return ZSt},e}(Rt),dS=function(){return dS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},dS.apply(this,arguments)};function tEt(t){var e=function(r){var i=r.options,o=i.radius,a=o===void 0?.8:o;return dt(r,"options.coordinate.innerRadius",a),r},n=function(r){var i=r.options,o=i.percent,a=i.color,s=a===void 0?[]:a;if(!o)return r;var l={scale:{color:{range:s.length?s:[]}},data:[1,o]};return Object.assign(i,dS({},l)),r};return zt(e,n,Fe,Xt)(t)}var eEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),nEt=function(t){eEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyRing",n}return e.getDefaultOptions=function(){return{type:"view",data:[],autoFit:!1,margin:0,padding:0,coordinate:{type:"theta"},animate:{enter:{type:"waveIn"}},interaction:{tooltip:!1},tooltip:!1,children:[{type:"interval",axis:!1,legend:!1,encode:{y:function(n){return n},color:function(n,r){return r}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return tEt},e}(Rt);function rEt(t){return zt(Xt)(t)}var iEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),oEt=function(t){iEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="rose",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"polar"},animate:{enter:{type:"waveIn"}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return rEt},e}(Rt),hS="__start__",iu="__end__",pS="__waterfall_value__",vS=function(){return vS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},vS.apply(this,arguments)},aEt=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function sEt(t){var e=function(r){var i=r.options,o=i.data,a=o===void 0?[]:o,s=i.yField;return a.length&&(a.reduce(function(l,c,u){var f;if(u===0||c.isTotal)c[hS]=0,c[iu]=c[s],c[pS]=c[s];else{var d=(f=l[iu])!==null&&f!==void 0?f:l[s];c[hS]=d,c[iu]=d+c[s],c[pS]=l[iu]}return c},[]),Object.assign(i,{yField:[hS,iu]})),r},n=function(r){var i=r.options,o=i.data,a=o===void 0?[]:o,s=i.xField,l=i.children,c=i.linkStyle,u=aEt([],a,!0);return u.reduce(function(f,d,h){return h>0&&(d.x1=f[s],d.x2=d[s],d.y1=f[iu]),d},[]),u.shift(),l.push({type:"link",xField:["x1","x2"],yField:"y1",zIndex:-1,data:u,style:vS({stroke:"#697474"},c),label:!1,tooltip:!1}),r};return zt(e,n,Fe,Xt)(t)}var lEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cEt=function(t){lEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="waterfall",n}return e.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{field:pS,valueFormatter:"~s",name:"value"},axis:{y:{title:null,labelFormatter:"~s"},x:{title:null}},children:[{type:"interval",interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return sEt},e}(Rt);function uEt(t){var e=function(n){var r=n.options,i=r.data,o=r.binNumber,a=r.binWidth,s=r.children,l=r.channel,c=l===void 0?"count":l,u=ve(s,"[0].transform[0]",{});return Jc(a)?(YR(u,{thresholds:Cxt(vOt(i.length,a)),y:c}),n):(Jc(o)&&YR(u,{thresholds:o,y:c}),n)};return zt(e,Fe,Xt)(t)}var fEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dEt=function(t){fEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Histogram",n}return e.getDefaultOptions=function(){return{type:"view",autoFit:!0,axis:{y:{title:!1},x:{title:!1}},children:[{type:"rect",transform:[{type:"binX",y:"count"}],interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return uEt},e}(Rt);function hEt(t){var e=function(r){var i=r.options,o=i.tooltip,a=i.colorField,s=i.sizeField;return o&&!o.field&&(o.field=a||s),r},n=function(r){var i=r.options,o=i.mark,a=i.children;return o&&(a[0].type=o),r};return zt(e,n,Fe,Xt)(t)}var pEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),vEt=function(t){pEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="heatmap",n}return e.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{valueFormatter:"~s"},axis:{y:{title:null,grid:!0},x:{title:null,grid:!0}},children:[{type:"point",interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return hEt},e}(Rt);function gEt(t){var e=function(n){var r=n.options.boxType,i=r===void 0?"box":r;return n.options.children[0].type=i,n};return zt(e,Fe,Xt)(t)}var yEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mEt=function(t){yEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="box",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"box"}],axis:{y:{title:!1},x:{title:!1}},tooltip:{items:[{name:"min",channel:"y"},{name:"q1",channel:"y1"},{name:"q2",channel:"y2"},{name:"q3",channel:"y3"},{name:"max",channel:"y4"}]}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return gEt},e}(Rt);function bEt(t){var e=function(n){var r=n.options,i=r.data,o=[{type:"custom",callback:function(s){return{links:s}}}];if(Vt(i))i.length>0?dt(r,"data",{value:i,transform:o}):delete r.children;else if(ve(i,"type")==="fetch"&&ve(i,"value")){var a=ve(i,"transform");Vt(a)?dt(i,"transform",a.concat(o)):dt(i,"transform",o)}return n};return zt(e,Fe,Xt)(t)}var xEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wEt=function(t){xEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="sankey",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"sankey"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return bEt},e}(Rt),_i=function(){return _i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_i.apply(this,arguments)},xy=["#f0efff","#5B8FF9","#3D76DD"];function gS(t,e,n,r){r===void 0&&(r=!0);var i=0,o=!1,a=Qc(t,function(s){var l,c,u=ve(s,[e]);if(jOt(u))return[];if(T9(u)){var f=Number(u);return isNaN(f)?[]:(l={},l[n]=s[n],l[e]=f,l)}return Vt(u)?(o=!0,i=Math.max(i,u.length),Qc(r?u.sort(function(d,h){return h-d}):u,function(d,h){var p;return p={},p[n]=s[n],p[e]=d,p.index=h,p})):(i=Math.max(1,i),c={},c[n]=s[n],c[e]=u,c)}).flat();return o?[a.map(function(s){return _i({index:0},s)}),i]:[a,i]}function yS(t,e){return new Array(t).fill("").map(function(n,r){return Vt(e)?e[r%e.length]:e})}function OEt(t){var e=function(i){var o=i.options,a=o.color,s=o.rangeField,l=s===void 0?"ranges":s,c=o.measureField,u=c===void 0?"measures":c,f=o.targetField,d=f===void 0?"targets":f,h=o.xField,p=h===void 0?"title":h,v=o.mapField,g=o.data,y=gS(g,l,p),m=y[0],b=y[1],x=gS(g,u,p,!1),w=x[0],O=x[1],_=gS(g,d,p,!1),S=_[0],E=_[1],M=ve(a,[l],xy[0]),P=ve(a,[u],xy[1]),C=ve(a,[d],xy[2]),A=[yS(b,M),yS(O,P),yS(E,C)].flat();return i.options.children=Qc(i.options.children,function(T,k){var N=[m,w,S][k],j=[l,u,d][k];return _i(_i({},T),{data:N,encode:_i(_i({},T.encode||{}),{x:p,y:j,color:function(L){var I=L.index,D=Jc(I)?"".concat(j,"_").concat(I):j;return v?ve(v,[j,I],D):D}}),style:_i(_i({},T.style||{}),{zIndex:function(L){return-L[j]}}),labels:k!==0?Qc(T.labels,function(L){return _i(_i({},L),{text:j})}):void 0})}),i.options.scale.color.range=A,i.options.legend.color.itemMarker=function(T){return v&&kOt(v==null?void 0:v[d],T)||(T==null?void 0:T.replace(/\_\d$/,""))===d?"line":"square"},i},n=function(i){var o=i.options.layout,a=o===void 0?"horizontal":o;return a!=="horizontal"&&dt(i,"options.children[2].shapeField","hyphen"),i},r=function(i){var o=i.options,a=o.range,s=a===void 0?{}:a,l=o.measure,c=l===void 0?{}:l,u=o.target,f=u===void 0?{}:u,d=o.children;return i.options.children=[s,c,f].map(function(h,p){return Ra(d[p],h)}),i};return zt(e,n,r,sSt,Xt)(t)}var _Et=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),SEt=function(t){_Et(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="bullet",n}return e.getDefaultOptions=function(){return{type:"view",scale:{color:{range:xy}},legend:{color:{itemMarker:function(n){return n==="target"?"line":"square"}}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval",style:{maxWidth:30},axis:{y:{grid:!0,gridLineWidth:2}}},{type:"interval",style:{maxWidth:20},transform:[{type:"stackY"}]},{type:"point",encode:{size:8,shape:"line"}}],interaction:{tooltip:{shared:!0}},coordinate:{transform:[{type:"transpose"}]}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return OEt},e}(Rt);function EEt(t){var e=function(n){var r=n.options.data;return n.options.data={value:r},n};return zt(e,Fe,Xt)(t)}var MEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),PEt=function(t){MEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Gauge",n}return e.getDefaultOptions=function(){return{type:"view",legend:!1,children:[{type:"gauge"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return EEt},e}(Rt);function AEt(t){var e=function(n){var r=n.options.percent;return Jc(r)&&dt(n,"options.data",r),n};return zt(e,Fe,Xt)(t)}var CEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),TEt=function(t){CEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Liquid",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"liquid"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return AEt},e}(Rt);function kEt(t){return zt(Fe,Xt)(t)}var LEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),NEt=function(t){LEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="WordCloud",n}return e.getDefaultOptions=function(){return{type:"view",legend:!1,children:[{type:"wordCloud"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return kEt},e}(Rt);function IEt(t){var e=function(n){var r=n.options,i=r.data;return i&&dt(r,"data",{value:i}),n};return zt(e,Fe,Xt)(t)}var jEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$Et=function(t){jEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="treemap",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"treemap"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return IEt},e}(Rt),Zs=function(){return Zs=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Zs.apply(this,arguments)};function DEt(t){var e=function(i){var o=i.options,a=o.startAngle,s=o.maxAngle,l=o.coordinate,c=Jc(a)?a/(2*Math.PI)*360:-90,u=Jc(s)?(Number(s)+c)/180*Math.PI:Math.PI;return dt(i,["options","coordinate"],Zs(Zs({},l),{endAngle:u,startAngle:a!=null?a:-Math.PI/2})),i},n=function(i){var o=i.options,a=o.tooltip,s=o.xField,l=o.yField;return a||dt(o,"tooltip",{title:!1,items:[function(c){return{name:c[s],value:c[l]}}]}),i},r=function(i){var o=i.options,a=o.markBackground,s=o.children,l=o.scale,c=o.coordinate,u=o.xField,f=ve(l,"y.domain",[]);return a&&s.unshift(Zs({type:"interval",xField:u,yField:f[f.length-1],colorField:a.color,scale:{color:{type:"identity"}},style:{fillOpacity:a.opacity,fill:a.color?void 0:"#e0e4ee"},coordinate:Zs(Zs({},c),{startAngle:-Math.PI/2,endAngle:1.5*Math.PI}),animate:!1},a)),i};return zt(e,n,r,Fe,Xt)(t)}var FEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),REt=function(t){FEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="radial",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"radial",innerRadius:.1,outerRadius:1,endAngle:Math.PI},animate:{enter:{type:"waveIn",duration:800}},axis:{y:{nice:!0,labelAutoHide:!0,labelAutoRotate:!1},x:{title:!1,nice:!0,labelAutoRotate:!1,labelAutoHide:{type:"equidistance",cfg:{minGap:6}}}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return DEt},e}(Rt);function BEt(t){return zt(Xt)(t)}var zEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),YEt=function(t){zEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="CirclePacking",n}return e.getDefaultOptions=function(){return{legend:!1,type:"view",children:[{type:"pack"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return BEt},e}(Rt),wy=function(){return wy=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},wy.apply(this,arguments)};function WEt(t){var e=function(n){var r=n.options,i=r.xField,o=r.yField,a=r.seriesField,s=r.children,l=s==null?void 0:s.map(function(c){return wy(wy({},c),{xField:i,yField:o,seriesField:a,colorField:a,data:c.type==="density"?{transform:[{type:"kde",field:o,groupBy:[i,a]}]}:c.data})}).filter(function(c){return r.violinType!=="density"||c.type==="density"});return dt(r,"children",l),r.violinType==="polar"&&dt(r,"coordinate",{type:"polar"}),dt(r,"violinType",void 0),n};return zt(e,Fe,Xt)(t)}var GEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),HEt=function(t){GEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="violin",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"density",sizeField:"size",tooltip:!1},{type:"boxplot",shapeField:"violin",style:{opacity:.5,point:!1}}],animate:{enter:{type:"fadeIn"}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return WEt},e}(Rt),lh=function(){return lh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},lh.apply(this,arguments)},UEt=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function VEt(t){var e=function(o){var a=o.options,s=a.yField,l=a.children;return l.forEach(function(c,u){dt(c,"yField",s[u])}),o},n=function(o){var a=o.options,s=a.yField,l=a.children,c=a.data;if(F_(c))return o;var u=Vt(ve(c,[0]))?c:[c,c];return l.forEach(function(f,d){dt(f,"data",UEt([],u[d].map(function(h){return lh({groupKey:s[d]},h)}),!0))}),o},r=function(o){var a=o.options,s=a.yField,l=s[0],c=s[1],u=a.tooltip;return u||dt(a,"tooltip",{items:[{field:l,value:l},{field:c,value:c}]}),o},i=function(o){var a=o.options,s=a.children,l=a.layout,c=a.coordinate.transform,u=a.paddingBottom,f=u===void 0?V9:u,d=a.paddingLeft,h=d===void 0?V9:d,p=a.axis;dt(a,"axisText",lh(lh({},(p==null?void 0:p.x)||{}),{layout:l}));var v=s[0],g=s[1];if(l==="vertical")dt(a,"direction","col"),dt(a,"paddingLeft",h),dt(a,"coordinate.transform",c.filter(function(w){return w.type!=="transpose"})),dt(v,"paddingBottom",U9),dt(g,"paddingTop",U9),dt(g,"axis",{x:{position:"top"}}),dt(g,"scale",{y:{range:[0,1]}});else{dt(a,"paddingBottom",f),dt(v,"scale",{y:{range:[0,1]}});var y=v.paddingRight,m=y===void 0?cS:y,b=g.paddingLeft,x=b===void 0?cS:b;dt(v,"paddingRight",m),dt(v,"axis",{x:{position:"right"}}),dt(g,"paddingLeft",x)}return o};return zt(e,n,r,i,Fe,Xt)(t)}var XEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qEt=function(t){XEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="BidirectionalBar",n}return e.getDefaultOptions=function(){return{type:"spaceFlex",coordinate:{transform:[{type:"transpose"}]},scale:{y:{nice:!0}},direction:"row",layout:"horizontal",legend:!1,axis:{y:{title:!1},x:{title:!1,label:!1}},children:[{type:"interval"},{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return VEt},e}(Rt),Qs;(function(t){t.color="key",t.d="path"})(Qs||(Qs={}));function KEt(t){var e=function(n){var r=n.options,i=r.data,o=r.setsField,a=r.sizeField;return Vt(i)&&(dt(r,"data",{type:"inline",value:i,transform:[{type:"venn",sets:o,size:a,as:[Qs.color,Qs.d]}]}),dt(r,"colorField",o),dt(r,["children","0","encode","d"],Qs.d)),dt(n,"options",K_(r,["sizeField","setsField"])),n};return zt(e,Xt)(t)}var ZEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),QEt=function(t){ZEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="venn",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"path"}],legend:{color:{itemMarker:"circle"}},encode:{color:Qs.color,d:Qs.d}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return KEt},e}(Rt);function JEt(t){var e=function(n){return n};return zt(e,Xt)(t)}var tMt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),eMt=function(t){tMt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Sunburst",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"sunburst"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return JEt},e}(Rt),nMt={Base:iSt,Line:SSt,Column:gSt,Pie:PSt,Area:uSt,Bar:hSt,DualAxes:K9,Funnel:wSt,Scatter:TSt,Radar:NSt,Rose:oEt,Stock:zSt,TinyLine:GSt,TinyArea:VSt,TinyColumn:KSt,TinyProgress:JSt,TinyRing:nEt,Waterfall:cEt,Histogram:dEt,Heatmap:vEt,Box:mEt,Sankey:wEt,Bullet:SEt,Gauge:PEt,Liquid:TEt,WordCloud:NEt,Treemap:$Et,RadialBar:REt,CirclePacking:YEt,Violin:HEt,BidirectionalBar:qEt,Venn:QEt,Mix:K9,Sunburst:eMt},mS=function(){return mS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},mS.apply(this,arguments)},Z9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Js=q.forwardRef(function(t,e){var n=t.chartType,r=n===void 0?"Base":n,i=Z9(t,["chartType"]),o=i.containerStyle,a=o===void 0?{height:"inherit"}:o,s=i.containerAttributes,l=s===void 0?{}:s,c=i.className,u=i.loading,f=i.loadingTemplate,d=i.errorTemplate,h=Z9(i,["containerStyle","containerAttributes","className","loading","loadingTemplate","errorTemplate"]),p=QOt(nMt[r],h),v=p.chart,g=p.container;return q.useImperativeHandle(e,function(){return v.current}),q.createElement(hmt,{errorTemplate:d},u&&q.createElement(fmt,{loadingTemplate:f}),q.createElement("div",mS({className:c,style:a,ref:g},l)))}),bS=function(){return bS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},bS.apply(this,arguments)},rMt=function(t){return q.createElement(Js,bS({},t,{chartType:"Area"}))};const iMt=rMt;var xS=function(){return xS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xS.apply(this,arguments)},oMt=function(t){return q.createElement(Js,xS({},t,{chartType:"Bar"}))};const aMt=oMt;var wS=function(){return wS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},wS.apply(this,arguments)},sMt=function(t){return q.createElement(Js,wS({},t,{chartType:"Column"}))};const lMt=sMt;var OS=function(){return OS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},OS.apply(this,arguments)},cMt=function(t){return q.createElement(Js,OS({},t,{chartType:"DualAxes"}))};const uMt=cMt;var _S=function(){return _S=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_S.apply(this,arguments)},fMt=function(t){return q.createElement(Js,_S({},t,{chartType:"Line"}))};const dMt=fMt;var SS=function(){return SS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},SS.apply(this,arguments)},hMt=function(t){return q.createElement(Js,SS({},t,{chartType:"Pie"}))};const pMt=hMt;var ES=function(){return ES=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ES.apply(this,arguments)},vMt=function(t){return q.createElement(Js,ES({},t,{chartType:"Scatter"}))};const gMt=vMt,{booleanField:Oy}=nE,yMt={isStack:t=>Oy(rt({name:"isStack",title:"isStack"},t)),smooth:t=>Oy(rt({name:"smooth",title:"smooth"},t)),isPercent:t=>Oy(rt({name:"isPercent",title:"isPercent"},t)),isGroup:t=>Oy(rt({name:"isGroup",title:"isGroup"},t))},mMt=t=>e=>{const{service:n}=q.useContext(ri),r=q.useRef(null),[i,o]=q.useState(0);return q.useEffect(()=>{const a=r.current;if(!a||n.loading===!0||e.height)return;const s=new ResizeObserver(l=>{l.forEach(c=>{o(c.contentRect.height)})});return s.observe(a),()=>s.disconnect()},[n.loading,e.height]),Y.jsx("div",{ref:r,style:i?{height:`${e.height||i}px`}:{},children:Y.jsx(t,rt(rt({},e),i?{height:e.height||i}:{}))})};class tl extends jy{constructor({name:n,title:r,Component:i,config:o}){super({name:n,title:r,Component:mMt(i),config:["xField","yField","seriesField",...o||[]]});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{xField:o,yField:a,seriesField:s}=this.infer(n,{measures:r,dimensions:i});return{general:{xField:o==null?void 0:o.value,yField:a==null?void 0:a.value,seriesField:s==null?void 0:s.value}}});this.addConfigs(yMt)}getProps({data:n,general:r,advanced:i,fieldProps:o}){return rt(bt(rt(rt({legend:{color:{itemLabelText:s=>{const l=o[r.seriesField],c=l==null?void 0:l.transformer;return c?c(s.label):s.label}}},tooltip:(s,l,c,u)=>{var g,y;const f=(g=u.y)==null?void 0:g.field,d=o[f],h=(d==null?void 0:d.label)||f,p=d==null?void 0:d.transformer,v=(y=u.y)==null?void 0:y.value[l];return{name:h,value:p?p(v):v}},axis:{x:{labelFormatter:s=>{const l=o[r.xField],c=l==null?void 0:l.transformer;return c?c(s):s}},y:{labelFormatter:s=>{const l=o[r.yField],c=l==null?void 0:l.transformer;return c?c(s):s}}},data:n,theme:"classic",animate:{enter:{type:!1},update:{type:!1},exit:{type:!1}},colorField:r.seriesField,stack:r.isStack,percent:r.isPercent?!0:void 0},r.smooth?{shapeField:"smooth"}:{}),r),{seriesField:r.isGroup?r.seriesField:void 0}),i)}getReference(){return{title:this.title,link:`https://ant-design-charts-next.antgroup.com/examples#statistics-${this.name}`}}}class bMt extends tl{constructor(){super({name:"pie",title:"Pie Chart",Component:pMt});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{xField:o,yField:a}=this.infer(n,{measures:r,dimensions:i});return{general:{colorField:o==null?void 0:o.value,angleField:a==null?void 0:a.value}}});this.config=[{property:"field",name:"angleField",title:"angleField",required:!0},{property:"field",name:"colorField",title:"colorField",required:!0}]}getProps({data:n,general:r,advanced:i,fieldProps:o}){const a=super.getProps({data:n,general:r,advanced:i,fieldProps:o});return bt(rt({},a),{tooltip:(s,l,c,u)=>{const f=u.y0.field,d=o[f],h=(d==null?void 0:d.label)||f,p=d==null?void 0:d.transformer,v=u.y0.value[l];return{name:h,value:p?p(v):v}}})}}class xMt extends tl{constructor(){super({name:"dualAxes",title:"Dual Axes Chart",Component:uMt});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{xField:o,yFields:a}=this.infer(n,{measures:r,dimensions:i});return{general:{xField:o==null?void 0:o.value,yField:(a==null?void 0:a.map(s=>s.value))||[]}}});this.config=["xField",{yField:{title:'{{t("yField")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"void","x-component":"Space",properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},input:{type:"string","x-decorator":"FormItem","x-component":"Select","x-reactions":"{{ useChartFields }}","x-component-props":{style:{minWidth:"200px"}},required:!0},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}},properties:{add:{type:"void",title:'{{t("Add")}}',"x-component":"ArrayItems.Addition"}}}}]}getProps({data:n,general:r,advanced:i,fieldProps:o}){var s;const a=super.getProps({data:n,general:r,advanced:i,fieldProps:o});return bt(rt({},nn.omit(a,["legend","tooltip","yField"])),{children:((s=a.yField)==null?void 0:s.map((l,c)=>{var u;return{type:"line",yField:l,colorField:()=>{const f=o[l];return(f==null?void 0:f.label)||l},axis:{y:{title:((u=o[l])==null?void 0:u.label)||l,position:c===0?"left":"right",labelFormatter:f=>{const d=o[l],h=d==null?void 0:d.transformer;return h?h(f):f}}}}}))||[]})}}const wMt=[new tl({name:"line",title:"Line Chart",Component:dMt,config:["smooth","isStack"]}),new tl({name:"area",title:"Area Chart",Component:iMt,config:["smooth",{property:"isStack",defaultValue:!0},"isPercent"]}),new tl({name:"column",title:"Column Chart",Component:lMt,config:["isGroup","isStack","isPercent"]}),new tl({name:"bar",title:"Bar Chart",Component:aMt,config:["isGroup","isStack","isPercent"]}),new bMt,new xMt,new tl({name:"scatter",title:"Scatter Chart",Component:gMt})];class _y extends z.Plugin{constructor(){super(...arguments);ni(this,"charts",new TB)}load(){return Cr(this,null,function*(){this.charts.setGroup("Built-in",[...wMt,...Z7]),this.app.addComponents({ChartV2BlockInitializer:X7,ChartV2BlockDesigner:U7,ChartV2Block:H7}),this.app.schemaInitializerManager.add(eE),this.app.schemaInitializerManager.add(V7),this.app.schemaInitializerManager.add(XS),this.app.schemaInitializerManager.add(M7),this.app.schemaInitializerManager.add(QS),this.app.schemaInitializerManager.add(L7);const n=this.app.schemaInitializerManager.get("page:addBlock");n==null||n.add("dataBlocks.chartV2",{title:It("Charts"),Component:"ChartV2BlockInitializer"})})}}ct.Chart=jy,ct.ChartConfigContext=Mi,ct.default=_y,Object.defineProperties(ct,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,10 +1,10 @@
1
1
  module.exports = {
2
- "@nocobase/client": "0.21.0-alpha.2",
2
+ "@nocobase/client": "0.21.0-alpha.4",
3
3
  "@formily/react": "2.3.0",
4
4
  "@formily/shared": "2.3.0",
5
5
  "lodash": "4.17.21",
6
- "@nocobase/cache": "0.21.0-alpha.2",
7
- "@nocobase/server": "0.21.0-alpha.2",
6
+ "@nocobase/cache": "0.21.0-alpha.4",
7
+ "@nocobase/server": "0.21.0-alpha.4",
8
8
  "react": "18.2.0",
9
9
  "@ant-design/icons": "5.2.6",
10
10
  "ahooks": "3.7.8",
@@ -13,8 +13,8 @@ module.exports = {
13
13
  "antd": "5.12.8",
14
14
  "@formily/antd-v5": "1.1.9",
15
15
  "@formily/core": "2.3.0",
16
- "@nocobase/utils": "0.21.0-alpha.2",
16
+ "@nocobase/utils": "0.21.0-alpha.4",
17
17
  "react-i18next": "11.18.6",
18
- "@nocobase/actions": "0.21.0-alpha.2",
19
- "@nocobase/database": "0.21.0-alpha.2"
18
+ "@nocobase/actions": "0.21.0-alpha.4",
19
+ "@nocobase/database": "0.21.0-alpha.4"
20
20
  };
@@ -1 +1 @@
1
- {"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2024-04-03T15:40:14.050Z"}
1
+ {"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2024-04-07T00:41:13.027Z"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-data-visualization",
3
- "version": "0.21.0-alpha.2",
3
+ "version": "0.21.0-alpha.4",
4
4
  "displayName": "Data visualization",
5
5
  "displayName.zh-CN": "数据可视化",
6
6
  "description": "Provides data visualization feature, including chart block and chart filter block, support line charts, area charts, bar charts and more than a dozen kinds of charts, you can also extend more chart types.",
@@ -33,7 +33,7 @@
33
33
  "@nocobase/test": "0.x",
34
34
  "@nocobase/utils": "0.x"
35
35
  },
36
- "gitHead": "90628f2e2da846208fb2d7966ddb4e467d187ffb",
36
+ "gitHead": "1ea598dce7d388e5e891753c8341dbfdbe220f34",
37
37
  "keywords": [
38
38
  "Blocks"
39
39
  ]