@nocobase/plugin-data-visualization 1.3.0-alpha.20240819011229 → 1.3.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
(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,K,In,ae,wn,dt,Ot,rn,My,Ve,Bo,Mi,au,zo){"use strict";var kSt=Object.defineProperty,TSt=Object.defineProperties;var LSt=Object.getOwnPropertyDescriptors;var Ey=Object.getOwnPropertySymbols;var X9=Object.prototype.hasOwnProperty,q9=Object.prototype.propertyIsEnumerable;var MS=(ct,z)=>(z=Symbol[ct])?z:Symbol.for("Symbol."+ct),Ce=Math.pow,PS=(ct,z,Y)=>z in ct?kSt(ct,z,{enumerable:!0,configurable:!0,writable:!0,value:Y}):ct[z]=Y,tt=(ct,z)=>{for(var Y in z||(z={}))X9.call(z,Y)&&PS(ct,Y,z[Y]);if(Ey)for(var Y of Ey(z))q9.call(z,Y)&&PS(ct,Y,z[Y]);return ct},ht=(ct,z)=>TSt(ct,LSt(z));var AS=(ct,z)=>{var Y={};for(var K in ct)X9.call(ct,K)&&z.indexOf(K)<0&&(Y[K]=ct[K]);if(ct!=null&&Ey)for(var K of Ey(ct))z.indexOf(K)<0&&q9.call(ct,K)&&(Y[K]=ct[K]);return Y};var ri=(ct,z,Y)=>(PS(ct,typeof z!="symbol"?z+"":z,Y),Y);var Nn=(ct,z,Y)=>new Promise((K,In)=>{var ae=Ot=>{try{dt(Y.next(Ot))}catch(rn){In(rn)}},wn=Ot=>{try{dt(Y.throw(Ot))}catch(rn){In(rn)}},dt=Ot=>Ot.done?K(Ot.value):Promise.resolve(Ot.value).then(ae,wn);dt((Y=Y.apply(ct,z)).next())}),NSt=function(ct,z){this[0]=ct,this[1]=z};var K9=ct=>{var z=ct[MS("asyncIterator")],Y=!1,K,In={};return z==null?(z=ct[MS("iterator")](),K=ae=>In[ae]=wn=>z[ae](wn)):(z=z.call(ct),K=ae=>In[ae]=wn=>{if(Y){if(Y=!1,ae==="throw")throw wn;return wn}return Y=!0,{done:!1,value:new NSt(new Promise(dt=>{var Ot=z[ae](wn);if(!(Ot instanceof Object))throw TypeError("Object expected");dt(Ot)}),1)}}),In[MS("iterator")]=()=>In,K("next"),"throw"in z?K("throw"):In.throw=ae=>{throw ae},"return"in z&&K("return"),In};function hB(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 CS="data-visualization";function St(t){return z.i18n.t(t,{ns:[CS,"client"]})}function se(){return My.useTranslation([CS,"client"],{nsMode:"fallback"})}const Py={datetime:[{label:St("YYYY"),value:"YYYY"},{label:St("MM"),value:"MM"},{label:St("DD"),value:"DD"},{label:St("YYYY-MM"),value:"YYYY-MM"},{label:St("YYYY-MM-DD"),value:"YYYY-MM-DD"},{label:St("YYYY-MM-DD hh:mm"),value:"YYYY-MM-DD hh:mm"},{label:St("YYYY-MM-DD hh:mm:ss"),value:"YYYY-MM-DD hh:mm:ss"}],date:[{label:St("YYYY"),value:"YYYY"},{label:St("MM"),value:"MM"},{label:St("DD"),value:"DD"},{label:St("YYYY-MM"),value:"YYYY-MM"},{label:St("YYYY-MM-DD"),value:"YYYY-MM-DD"}],time:[{label:St("hh:mm:ss"),value:"hh:mm:ss"},{label:St("hh:mm"),value:"hh:mm"},{label:St("hh"),value:"hh"}]},pB=K.createContext(null),Ay={didCatch:!1,error:null};let kS=class extends K.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&&vB(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(K.isValidElement(i))s=i;else if(typeof n=="function")s=n(l);else if(r)s=K.createElement(r,l);else throw a}return K.createElement(pB.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}};function vB(){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 TS=(t,e={})=>{const{collection:n,config:r}=t,{title:i,bordered:o}=r||{};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",title:i,bordered:o},"x-initializer":"charts:addBlock",properties:{[Bo.uid()]:{type:"void","x-component":"ChartRenderer","x-component-props":e}}}},su=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}},ph=(t,e)=>{var o,a;const{target:n,name:r}=su(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)},il=(t,e)=>{const n=s=>s.map(l=>{const c=ph(t,l.field);return ht(tt({},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()]},gB=(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;if(Array.isArray(o))return o.map(c=>r(i,c));const s=a.find(c=>c.value===o);return dt.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":case"multipleSelect":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},yB=(t,e)=>{const n=e.split(".");let r=rn.get(t,n.slice(0,-1).join("."));return Array.isArray(r)?r=r.map(i=>rn.get(i,n.slice(-1)[0])):r=rn.get(r,n.slice(-1)[0]),r},mB=t=>({boolean:"Checkbox",integer:"InputNumber",bigInt:"InputNumber",double:"InputNumber",decimal:"InputNumber",date:"DatePicker",string:"Input"})[t],bB=t=>({boolean:"boolean",integer:"integer",bigInt:"integer",double:"number",decimal:"number",date:"datetime",string:"input"})[t],ol=K.createContext({});ol.displayName="ChartDataContext";const xB=t=>{const[e,n]=K.useState({}),r=Mi.useMemoizedFn((o,{dataSource:a,collection:s,service:l,query:c})=>{n(u=>ht(tt({},u),{[o]:{dataSource:a,collection:s,service:l,query:c}}))}),i=Mi.useMemoizedFn(o=>{n(a=>ht(tt({},a),{[o]:void 0}))});return Y.jsx(ol.Provider,{value:{charts:e,addChart:r,removeChart:i},children:t.children})},kr=K.createContext({});kr.displayName="ChartFilterContext";const wB=t=>{const[e,n]=K.useState(!1),[r,i]=K.useState(!1),[o,a]=K.useState({}),[s,l]=K.useState({collapsed:!1,row:1}),[c,u]=K.useState(),f=Mi.useMemoizedFn((g,y)=>{a(m=>ht(tt({},m),{[g]:tt(tt({},m[g]||{}),y)}))}),d=Mi.useMemoizedFn(g=>{a(y=>{const m=tt({},y);return m[g]=void 0,m})}),h=Mi.useMemoizedFn(u),p=Mi.useMemoizedFn(i),v=({collapsed:g,row:y})=>{l(m=>({collapsed:g!==void 0?g:m.collapsed,row:y!==void 0?y:m.row}))};return K.useEffect(()=>n(!0),[]),Y.jsx(kr.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})},ii=K.createContext({});ii.displayName="ChartRendererContext";const LS=t=>{const{query:e,config:n,collection:r,transform:i,dataSource:o=z.DEFAULT_DATA_SOURCE_KEY}=t,{addChart:a}=K.useContext(ol),{ready:s,form:l,enabled:c}=K.useContext(kr),{getFilter:u,hasFilter:f,appendFilter:d,parseFilter:h}=sl(),p=dt.useFieldSchema(),v=z.useAPIClient(),g=z.useRequest((y,m,b,x)=>Nn(this,null,function*(){var M,P;if(!(m&&((M=b==null?void 0:b.measures)!=null&&M.length))||c&&!l)return;const w=u(),O=yield h(b.filter),_=ht(tt({},b),{filter:O}),S={dataSource:y,collection:m,query:_},E=!x&&f(S,w)?d(S,w):_;try{const k=yield v.request({url:"charts:query",method:"POST",data:ht(tt({uid:p==null?void 0:p["x-uid"],dataSource:y,collection:m},E),{filter:Cy(E.filter),dimensions:((b==null?void 0:b.dimensions)||[]).map(A=>{const C=tt({},A);if(A.format&&!A.alias){const{alias:T}=su(A.field);C.alias=T}return C}),measures:((b==null?void 0:b.measures)||[]).map(A=>{const C=tt({},A);if(A.aggregation&&!A.alias){const{alias:T}=su(A.field);C.alias=T}return C})})});return(P=k==null?void 0:k.data)==null?void 0:P.data}catch(k){throw console.error(k),k}finally{!x&&(p!=null&&p["x-uid"])&&a(p==null?void 0:p["x-uid"],{dataSource:y,collection:m,service:g,query:b})}}),{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(ii.Provider,{value:{dataSource:o,collection:r,config:n,transform:i,service:g,query:e},children:t.children})})})};class OB{constructor(){ri(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:St(a.title),value:`${i}.${a.name}`}));e.push({label:St(i),children:o})});const n=e.findIndex(r=>r.label===St("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 NS=()=>z.usePlugin(Sy).charts.getChartTypes(),_B=()=>{var e,n,r;return(r=(n=(e=NS()[0])==null?void 0:e.children)==null?void 0:n[0])==null?void 0:r.value},IS=()=>z.usePlugin(Sy).charts.getCharts(),SB=t=>z.usePlugin(Sy).charts.getChart(t),{Paragraph:EB,Text:MB}=Ot.Typography,ky=t=>{const{t:e}=se(),n=K.useContext(ii),{config:r,transform:i,dataSource:o,collection:a,service:s,data:l}=n,c=Ua(o,a),u=DS(l,o,a),f=(r==null?void 0:r.general)||{},d=(r==null?void 0:r.advanced)||{},h=z.useAPIClient(),p=SB(r==null?void 0:r.chartType),v=h.auth.getLocale(),g=BB(i,v),y=p==null?void 0:p.getProps({data:u,general:f,advanced:d,fieldProps:Object.keys(u[0]||{}).reduce((x,w)=>{if(!x[w]){const O=ph(c,w.split(".")),_=g[w];x[w]={label:(O==null?void 0:O.label)||w,transformer:_,interface:O==null?void 0:O.interface}}return x},{})}),m=dt.Schema.compile(y),b=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(kS,{onError:x=>{console.error(x)},FallbackComponent:PB,children:Y.jsx(b,tt({},m))})}):Y.jsx(Ot.Empty,{image:Ot.Empty.PRESENTED_IMAGE_SIMPLE,description:e("Please configure chart")})};ky.Designer=function(){const{t:e}=se(),{setVisible:n,setCurrent:r}=K.useContext(Pi),{removeChart:i}=K.useContext(ol),{service:o}=K.useContext(ii),a=dt.useField(),s=dt.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:()=>Nn(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(TS(s==null?void 0:s["x-decorator-props"]))),children:e("Duplicate")},"duplicate"),Y.jsx(z.SchemaSettingsDivider,{}),Y.jsx(z.SchemaSettingsRemove,{breakRemoveOn:{"x-component":"ChartV2Block"},confirm:{onOk:()=>{i(s["x-uid"])}}})]})};const PB=({error:t})=>{const{t:e}=se();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(EB,{copyable:!0,children:Y.jsx(MB,{type:"danger",style:{whiteSpace:"pre-line",textAlign:"center"},children:t.message})})})})},lu=t=>{const{current:e}=K.useContext(Pi),{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}},AB=t=>(t||[]).filter(n=>n.interface).map(n=>{var r;return ht(tt({},n),{key:n.name,label:((r=n.uiSchema)==null?void 0:r.title)||n.name,value:n.name})}),Ua=(t,e)=>{const{t:n}=My.useTranslation(),{cm:r,fim:i,collection:o}=lu(t),a=r.getCollectionFields(e||o),s=AB(a);return K.useMemo(()=>s.map(l=>{var d,h,p,v;const c=(d=i.getFieldInterface(l.interface))==null?void 0:d.filterable,u=dt.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 ht(tt({},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 ht(tt({},y),{key:`${l.name}.${y.name}`,label:`${u} / ${dt.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 ht(tt({},y),{key:`${l.name}.${y.name}`,label:`${u} / ${dt.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 ht(tt({},l),{label:u,targetFields:f})}),[s])},jS=t=>e=>{const n=e.query("query").get("value")||{},r=il(t,n);e.dataSource=r},CB=t=>e=>{var o;const n=e.query(".field").get("value");if(!n){e.dataSource=[];return}let r=[];switch((o=ph(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},kB=()=>{const{t}=My.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 K.useMemo(()=>dt.Schema.compile(i,{t}),[i])},TB=(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=il(e,r);n.componentProps.fieldNames={},n.dataSource=a},LB=(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=il(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}=su(f.field);return(!f.field||s.includes(d))&&u.push(f),u},[]);n.setValue(c)},DS=(t,e,n)=>{var c;const{t:r}=se(),{service:i,query:o}=K.useContext(ii),a=Ua(e,n),s=dt.useForm(),l=il(a,((c=s==null?void 0:s.values)==null?void 0:c.query)||o);return gB(l,(i==null?void 0:i.data)||t||[],{t:r})},NB=(t,e,n=2,r=[])=>{const{cm:i,fim:o,collection:a}=lu(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=ht(tt({},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=>ht(tt({},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)},IB=(t,e)=>{const{cm:n,fim:r,collection:i}=lu(t);return K.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])},Yo={general:{Prefix:{schema:{"x-component":"Input"},fn:(t,e)=>e?`${e}${t}`:t},Suffix:{schema:{"x-component":"Input"},fn:(t,e)=>e?`${t}${e}`:t}},datetime:{Format:{schema:{"x-component":"AutoComplete","x-component-props":{allowClear:!0,style:{minWidth:200}},enum:[{label:"YYYY",value:"YYYY"},{label:"YYYY-MM",value:"YYYY-MM"},{label:"YYYY-MM-DD",value:"YYYY-MM-DD"},{label:"YYYY-MM-DD hh:mm",value:"YYYY-MM-DD hh:mm"},{label:"YYYY-MM-DD hh:mm:ss",value:"YYYY-MM-DD hh:mm:ss"}]},fn:(t,e)=>Ve(t).format(e)},YYYY:{label:"YYYY (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY")},MM:{label:"MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("MM")},DD:{label:"DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("DD")},"YYYY-MM":{label:"YYYY-MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM")},"YYYY-MM-DD":{label:"YYYY-MM-DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD")},"YYYY-MM-DD hh:mm":{label:"YYYY-MM-DD hh:mm (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD hh:mm")},"YYYY-MM-DD hh:mm:ss":{label:"YYYY-MM-DD hh:mm:ss (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD hh:mm:ss")}},date:{Format:{schema:{"x-component":"AutoComplete","x-component-props":{allowClear:!0,style:{minWidth:200}},enum:[{label:"YYYY",value:"YYYY"},{label:"MM",value:"MM"},{label:"DD",value:"DD"},{label:"YYYY-MM",value:"YYYY-MM"},{label:"YYYY-MM-DD",value:"YYYY-MM-DD"}]},fn:(t,e)=>Ve(t).format(e)},YYYY:{label:"YYYY (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY")},MM:{label:"MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("MM")},DD:{label:"DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("DD")},"YYYY-MM":{label:"YYYY-MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM")},"YYYY-MM-DD":{label:"YYYY-MM-DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD")}},time:{Format:{schema:{"x-component":"AutoComplete","x-component-props":{allowClear:!0,style:{minWidth:200}},enum:[{label:"hh:mm:ss",value:"hh:mm:ss"},{label:"hh:mm",value:"hh:mm"},{label:"hh",value:"hh"}]},fn:(t,e)=>Ve(t).format(e)},"hh:mm:ss":{label:"hh:mm:ss (Deprecated, use Format instead)",fn:t=>Ve(t).format("hh:mm:ss")},"hh:mm":{label:"hh:mm (Deprecated, use Format instead)",fn:t=>Ve(t).format("hh:mm")},hh:{label:"hh (Deprecated, use Format instead)",fn:t=>Ve(t).format("hh")}},number:{Precision:{schema:{"x-component":"Select",enum:[{label:"1",value:0},{label:"1.0",value:1},{label:"1.00",value:2},{label:"1.000",value:3}]},fn:(t,e)=>Number(t.toFixed(e))},Separator:{schema:{"x-component":"Select",enum:[{label:"100,000.00",value:"en-US"},{label:"100.000,00",value:"de-DE"},{label:"100 000.00",value:"ru-RU"}]},fn:(t,e)=>{switch(e){case"en-US":return t.toLocaleString("en-US",{minimumFractionDigits:2});case"de-DE":return t.toLocaleString("de-DE",{minimumFractionDigits:2});case"ru-RU":return t.toLocaleString("ru-RU",{minimumFractionDigits:2});default:return t}}},Percent:t=>new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(t),Currency:{label:"Currency (Deprecated, use Separator & Prefix instead)",fn:(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]||"USD";return new Intl.NumberFormat(e,{style:"currency",currency:n}).format(t)}},Exponential:t=>(+t).toExponential(),Abbreviation:{schema:{"x-component":"Select",enum:[{label:"en-US",value:"en-US"},{label:"zh-CN",value:"zh-CN"}]},fn:(t,e="en-US")=>new Intl.NumberFormat(e,{notation:"compact"}).format(t)}},string:{"Type conversion":{schema:{"x-component":"Select",enum:[{label:"Number",value:"Number"},{label:"Date",value:"Date"}]},fn:(t,e)=>{try{return new Function(`return ${e}(${t})`)()}catch(n){return console.log(n),t}}}}},jB=t=>function(){const n=dt.useField(),r=n.query("query").get("value")||{},i=il(t,r),o=Object.keys(Yo).filter(a=>a!=="general");return{onChange:a=>{n.value=a;const s=n.query(".type").take();a||s.setState({value:null});const l=i.find(h=>h.value===a);s.dataSource=o.map(h=>({label:St(h),value:h}));const c={createdAt:"datetime",updatedAt:"datetime",double:"number",integer:"number",percent:"number"},u=l==null?void 0:l.interface,f=l==null?void 0:l.type,d=c[u]||c[f]||f;if(o.includes(d)){s.setState({value:d});return}s.setState({value:null})}}},DB=()=>{const t=dt.useField();return{options:Object.keys(Yo).filter(r=>r!=="general").map(r=>({label:St(r),value:r})),onChange:r=>{t.value=r,t.query(".format").take().setValue(null)}}},FB=()=>{const t=dt.useField();return{onChange:e=>{t.value=e,t.query(".argument").take().setValue(null)}}},$B=t=>{const e=t.query(".type").get("value");if(!e){t.dataSource=[];return}const n=Object.entries(tt(tt({},Yo.general),Yo[e]||{})).map(([r,i])=>{const o=typeof i=="function"?r:i.label||r;return{label:St(o),value:r}});t.dataSource=n},RB=t=>{const e=t.query(".type").get("value"),n=t.query(".format").get("value");if(!n||!e){t.setComponentProps({schema:null});return}const r=Yo[e][n]||Yo.general[n];if(!r||typeof r=="function"){t.setComponentProps({schema:null});return}const i=Bo.uid();t.setComponentProps({schema:tt({name:i},r.schema)})},BB=(t,e="en-US")=>{const n=(t||[]).filter(i=>i.field&&i.type&&i.format).reduce((i,o)=>{const a=Yo[o.type][o.format]||Yo.general[o.format];return a&&(i[o.field]=[...i[o.field]||[],{transformer:a,argument:o.argument}]),i},{}),r={};return Object.entries(n).forEach(([i,o])=>{r[i]=o.reduce((a,s)=>{const{transformer:l}=s;let{argument:c}=s;return u=>{try{return typeof l=="function"?l(a(u),c):(!c&&!l.schema&&(c=e),l.fn(a(u),c))}catch(f){return console.log(f),u}}},a=>a)}),r};function cu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var zB=function(e){return YB(e)&&!WB(e)};function YB(t){return!!t&&typeof t=="object"}function WB(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||UB(t)}var GB=typeof Symbol=="function"&&Symbol.for,HB=GB?Symbol.for("react.element"):60103;function UB(t){return t.$$typeof===HB}function VB(t){return Array.isArray(t)?[]:{}}function uu(t,e){return e.clone!==!1&&e.isMergeableObject(t)?al(VB(t),t,e):t}function XB(t,e,n){return t.concat(e).map(function(r){return uu(r,n)})}function qB(t,e){if(!e.customMerge)return al;var n=e.customMerge(t);return typeof n=="function"?n:al}function KB(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function FS(t){return Object.keys(t).concat(KB(t))}function $S(t,e){try{return e in t}catch(n){return!1}}function ZB(t,e){return $S(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function QB(t,e,n){var r={};return n.isMergeableObject(t)&&FS(t).forEach(function(i){r[i]=uu(t[i],n)}),FS(e).forEach(function(i){ZB(t,i)||($S(t,i)&&n.isMergeableObject(e[i])?r[i]=qB(i,n)(t[i],e[i],n):r[i]=uu(e[i],n))}),r}function al(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||XB,n.isMergeableObject=n.isMergeableObject||zB,n.cloneUnlessOtherwiseSpecified=uu;var r=Array.isArray(e),i=Array.isArray(t),o=r===i;return o?r?n.arrayMerge(t,e,n):QB(t,e,n):uu(e,n)}al.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,i){return al(r,i,n)},{})};var JB=al,tz=JB;const ez=cu(tz),nz=()=>({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"}}}),Ty=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=nz();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]},rz=(t,e)=>{if(!t)return t;if(Ve.isDayjs(t))return e.showTime||(t=t.startOf("day")),au.moment2str(t,e);if(Array.isArray(t)&&t.length&&Ve.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},RS=(t,e)=>Nn(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=rz(i,t.componentProps);t.setValue(o),t.setInitialValue(o),t.loading=!1}}),vh="-",fu=(t,e)=>t?`${t}${vh}${e}`:e,BS=t=>{const[e,n]=t.split(vh);return n?{dataSource:e,fieldName:n}:{dataSource:z.DEFAULT_DATA_SOURCE_KEY,fieldName:e}},Ly=(t,e,n)=>dt.Schema.isSchemaInstance(t)?t.reduceProperties((r,i)=>{let o=i[e];if(o.includes(vh)||(o=`${z.DEFAULT_DATA_SOURCE_KEY}${vh}${o}`),o===n)return i;if(i["x-component"]!=="Action.Container"&&i["x-component"]!=="AssociationField.Viewer"){const a=Ly(i,e,n);if(a)return a}return r}):null,Ny=()=>{const{charts:t}=K.useContext(ol),e=K.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=K.useMemo(()=>Object.keys(e).length>1,[e]),r=K.useCallback((i,o)=>{var a;return((a=e[i])==null?void 0:a.includes(o))||!1},[e]);return{chartCollections:e,showDataSource:n,getIsChartCollectionExists:r}},sl=()=>{const t=z.useDataSourceManager(),{charts:e}=K.useContext(ol),{fieldSchema:n}=z.useActionContext(),r=n==null?void 0:n["x-action"],{fields:i,form:o}=K.useContext(kr),a=z.useVariables(),s=({dataSource:v,collection:g,cm:y,fim:m})=>{const b=y.getCollectionFields(g.name),x=(E,M,P,k)=>{var I,F,$,R,B;const A=((I=E.uiSchema)==null?void 0:I.title)||E.name,C=m.getFieldInterface(E.interface),T=($=(F=C==null?void 0:C.filterable)==null?void 0:F.operators)==null?void 0:$[0],N=y.getCollection(E.target);M=M?`${M} / ${A}`:A;let j={type:"string",title:M,name:`${P}.${E.name}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-component":"CollectionField","x-decorator":"ChartFilterFormItem","x-data-source":v,"x-collection-field":`${k}.${E.name}`,"x-component-props":ht(tt({},(R=E.uiSchema)==null?void 0:R["x-component-props"]),{"filter-operator":T})};if(E.interface==="formula"){const W=mB(E.dataType)||"Input";j=ht(tt({},j),{"x-component":W})}return["oho","o2m"].includes(E.interface)&&rn.set(j,"x-component-props.useOriginalFilter",!0),{key:`${P}.${E.name}`,name:E.name,type:"item",title:((B=E==null?void 0:E.uiSchema)==null?void 0:B.title)||E.name,Component:"CollectionFieldInitializer",find:Ly,remove:(W,q)=>{q(W,{breakRemoveOn:{"x-component":"Grid"}})},schemaInitialize:W=>{var q;(q=C==null?void 0:C.schemaInitialize)==null||q.call(C,W,{field:E,block:"FilterForm",readPretty:o.readPretty,action:r,targetCollection:N})},schema:j}},w=(E,M,P,k)=>{var j;const A=((j=E.uiSchema)==null?void 0:j.title)||E.name;M=M?`${M} / ${A}`:A;const C=E.operators[0];let T=ht(tt({type:"string",name:`${P}.${E.name}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-decorator":"ChartFilterFormItem","x-data-source":v,"x-collection-field":`${k}.${E.name}`},E.schema),{title:M,"x-component-props":{"filter-operator":C}});return C!=null&&C.noValue&&(T=ht(tt({},T),{"x-component":"ChartFilterCheckbox","x-component-props":ht(tt({},T["x-component-props"]),{content:dt.Schema.compile(C.label,{t:z.i18n.t})})})),{key:`${P}.${E.name}`,name:E.name,type:"item",title:E.title||E.name,Component:"CollectionFieldInitializer",find:Ly,remove:(L,I)=>{I(L,{breakRemoveOn:{"x-component":"Grid"}})},schema:T}},O=(E,M,P,k,A)=>{var I,F,$;if(!E.interface||E.isForeignKey)return;const C=m.getFieldInterface(E.interface);if(!(C!=null&&C.filterable))return;const{nested:T,children:N}=C.filterable,j=((I=E.uiSchema)==null?void 0:I.title)||E.name,L=x(E,P,k,A);if(!(E.target&&M>2)){if(P=P?`${P} / ${j}`:j,N!=null&&N.length&&!["chinaRegion","createdBy","updatedBy","attachment"].includes(E.interface)){const R=N.map(B=>w(B,P,`${k}.${E.name}`,`${A}.${E.name}`));return{key:`${k}.${E.name}`,name:E.name,type:"subMenu",title:((F=E==null?void 0:E.uiSchema)==null?void 0:F.title)||E.name,children:R}}if(!M||M>2)return L;if(T){const B=y.getCollectionFields(E.target).map(W=>O(W,M+1,"",`${k}.${E.name}`,`${A}.${E.name}`));return{key:`${k}.${E.name}`,name:E.name,type:"subMenu",title:(($=E==null?void 0:E.uiSchema)==null?void 0:$.title)||E.name,children:B.filter(Boolean)}}return L}},_=[],S=[];return b.forEach(E=>{const M=E.interface,P=O(E,0,"",fu(v,g.name),g.name);if(P&&_.push(P),["m2o"].includes(M)){const k=O(E,1,"",fu(v,g.name),g.name);k&&S.push(k)}}),S.length&&_.push({name:"divider",type:"divider"},{name:"displayAssociationFields",type:"itemGroup",title:z.i18n.t("Display association fields"),children:S}),_},l=()=>{const v=(o==null?void 0:o.values)||{},g={};return Object.entries(i).filter(([y,m])=>m).forEach(([y,m])=>{const{operator:b}=m||{},{dataSource:x,fieldName:w}=BS(y);let O=w;const E=t.getDataSource(x).collectionManager.getCollectionField(O);if(E!=null&&E.target){const C=E.targetKey||"id";O=`${O}.${C}`,y=`${y}.${C}`}const[M,...P]=O.split("."),k=yB(v,y),A=(b==null?void 0:b.value)||"$eq";if(M!=="custom"){const C=fu(x,M);g[C]=g[C]||{$and:[]};const T={};rn.set(T,P.join("."),{[A]:k}),g[C].$and.push(T)}else g[M]=g[M]||{},g[M][`$nFilter.${P.join(".")}`]=k}),g},c=(v,g)=>{if(!v)return!1;const{dataSource:y,collection:m,query:b}=v,{parameters:x}=au.parse(b.filter||"");return g[fu(y,m)]||g.custom&&(x==null?void 0:x.find(({key:w})=>rn.has(g.custom,w)))},u=(v,g)=>{const{dataSource:y,collection:m,query:b}=v;let x=tt({},b);const w=tt({},x.filter||{});let O={};const _=au.parse(w),{parameters:S}=_;return g.custom&&(S!=null&&S.find(E=>g.custom[E.key]))&&(O=_(g.custom)),O=ez(w,O),x=ht(tt({},x),{filter:{$and:[O,g[fu(y,m)]]}}),x},f=()=>Nn(this,null,function*(){const v=l(),g=Object.values(e).filter(y=>c(y,v)).map(y=>()=>Nn(this,null,function*(){const{dataSource:m,service:b,collection:x}=y;yield b.runAsync(m,x,u(y,v),!0)}));yield Promise.all(g.map(y=>y()))}),d=()=>Nn(this,null,function*(){const v=Object.values(e).filter(g=>g).map(g=>()=>Nn(this,null,function*(){const{service:y,dataSource:m,collection:b,query:x}=g;yield y.runAsync(m,b,x,!0)}));yield Promise.all(v.map(g=>g()))}),h=Mi.useMemoizedFn(v=>v.split(" / ").map(g=>z.i18n.t(dt.Schema.compile(g,{t:z.i18n.t}))).join(" / ")),p=K.useCallback(v=>Nn(this,null,function*(){const g=au.flatten(v,{breakOn({key:m}){return m.startsWith("$")&&m!=="$and"&&m!=="$or"},transformValue(m){return!(typeof m=="string"&&m.startsWith("{{$")&&(m!=null&&m.endsWith("}}")))||["$user","$date","$nDate","$nRole","$nFilter"].some(x=>m.includes(x))?m:a==null?void 0:a.parseVariable(m)}});return yield Promise.all(Object.keys(g).map(m=>Nn(this,null,function*(){return g[m]=yield g[m],g[m]===void 0&&delete g[m],g[m]}))),au.unflatten(g)}),[a]);return{filter:f,refresh:d,getChartFilterFields:s,getFilter:l,hasFilter:c,appendFilter:u,getTranslatedTitle:h,parseFilter:p}},iz=()=>{const{t}=se(),e=Mi.useMemoizedFn(t),{enabled:n,fields:r}=K.useContext(kr),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=K.useMemo(()=>({label:e("Current filter"),value:"$nFilter",key:"$nFilter",children:i}),[i,e]);return!n||!i.length?null:o},zS=()=>{const{t}=se(),{chartCollections:e}=Ny(),n=z.useDataSourceManager(),r=n.collectionFieldInterfaceManager,{values:i}=YS(),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 K.useMemo(()=>Object.entries(e).map(([s,l])=>{const c=n.getDataSource(s);return{value:s,label:dt.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:dt.Schema.compile(d.title,{t}),children:p}})}}),[e])},YS=()=>{const{t}=se(),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)}},oz=(t,e)=>{const{t:n}=se(),r=z.useDataSourceManager(),{showDataSource:i}=Ny();return K.useMemo(()=>{var p;const o=r.getDataSource(t);if(!o)return;const a=o.collectionManager;if(!e)return;const{fieldName:s}=BS(e),[l,...c]=s.split(".");if(!(c!=null&&c.length))return;const u=a.getCollection(l);let f=l,d,h=dt.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+=` / ${dt.Schema.compile(g,{t:n})}`),d!=null&&d.target?f=d.target:f=null}return i?`${dt.Schema.compile(o.displayName,{t:n})} > ${h}`:h},[e,t,i])},WS=(t,e)=>{const{currentUserSettings:n}=z.useCurrentUserVariable({collectionField:{uiSchema:t},uiSchema:t}),{currentRoleSettings:r}=z.useCurrentRoleVariable({uiSchema:t}),{apiTokenSettings:i}=z.useAPITokenVariable({noDisabled:!0}),{datetimeSettings:o}=z.useDatetimeVariable({operator:e,schema:t,noDisabled:!0}),{urlSearchParamsSettings:a}=z.useURLSearchParamsVariable(),s=K.useMemo(()=>[n,r,i,o,a].filter(Boolean),[o,n,r,a,i]);return t?s:[]},az=()=>{const t=dt.useField(),{operator:e,schema:n}=t.data||{},r=iz(),i=WS(n,e),o=K.useMemo(()=>[...i,r].filter(Boolean),[i,r]);return!e||!n?[]:o},Iy=(t={},e={})=>ht(tt({type:"array","x-decorator":"FormItem","x-component":"ArrayItems"},e),{items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:ht(tt({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"}}}),sz=t=>({type:"void",properties:{config:{type:"object",properties:{collapse:{type:"void","x-component":"FormCollapse","x-component-props":{formCollapse:"{{formCollapse}}",size:"small",style:{border:"none",boxShadow:"none"}},properties:{pane1:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:St("Container"),key:"card"},properties:{title:{type:"string",title:'{{t("Title")}}',"x-decorator":"FormItem","x-component":"Input"},bordered:{type:"boolean","x-content":St("Show border"),"x-decorator":"FormItem","x-component":"Checkbox",default:!1}}},pane2:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:St("Chart"),key:"basic",style:{border:"none"}},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 }}"},[Bo.uid()]:{type:"void",properties:{general:t}},[Bo.uid()]:{type:"void",properties:{advanced:{type:"json",title:'{{t("JSON config")}}',"x-decorator":"FormItem","x-decorator-props":{extra:St("Same properties set in the form above will be overwritten by this JSON config.")},"x-component":"Input.JSON","x-component-props":{autoSize:{minRows:3},json5:!0}}}},reference:{type:"string","x-reactions":{dependencies:[".chartType"],fulfill:{schema:{"x-content":"{{ getReference($deps[0]) }}"}}}}}}}}}}}}),lz={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}}",size:"small",style:{border:"none",boxShadow:"none"}},properties:{pane1:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:St("Measures"),key:"measures"},properties:{measures:Iy({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:St("Dimensions"),key:"dimensions"},properties:{dimensions:Iy({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:St("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:St("Sort"),key:"sort",style:{border:"none"}},properties:{orders:Iy({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"}}}}}}}}},cz={type:"void",properties:{transform:{type:"array","x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{wrap:!0},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},field:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Field")}}'},"x-use-component-props":"useFieldSelectProps","x-reactions":"{{ useChartFields }}"},type:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Type")}}'},"x-use-component-props":"useFieldTypeSelectProps"},format:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Transformer")}}',style:{maxWidth:"200px"}},"x-use-component-props":"useTransformerSelectProps","x-reactions":"{{ useTransformers }}","x-visible":"{{ $self.dataSource && $self.dataSource.length }}"},argument:{type:"string","x-decorator":"FormItem","x-component":"TransformerDynamicComponent","x-reactions":"{{ useArgument }}"},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{t("Add transformation")}}',"x-component":"ArrayItems.Addition"}}}}};function uz(t){const{value:e,onChange:n,renderSchemaComponent:r}=t,i=az();return Y.jsx(z.Variable.Input,{value:e,onChange:n,scope:i,children:r()})}const Pi=K.createContext({visible:!0});Pi.displayName="ChartConfigContext";const fz=t=>{var a;const{insertAdjacent:e}=z.useDesignable(),[n,r]=K.useState(!1),[i,o]=K.useState({});return Y.jsxs(Pi.Provider,{value:{visible:n,setVisible:r,current:i,setCurrent:o},children:[t.children,Y.jsx(LS,ht(tt({},(a=i.field)==null?void 0:a.decoratorProps),{children:Y.jsx(oi,{insert:(s,l)=>e("beforeEnd",s,l)})}))]})},dz=t=>{const{schema:e}=t,n=dt.useField();return e?Y.jsx(z.SchemaComponent,{schema:{type:"void",properties:{[e.name]:ht(tt({type:"void"},e),{value:n.value,"x-component-props":ht(tt({},e["x-component-props"]),{defaultValue:n.value,onChange:r=>{if(typeof r=="object"&&(r!=null&&r.target)){n.value=r.target.value;return}n.value=r}})})}}}):null},{Paragraph:ISt,Text:hz}=Ot.Typography,oi=t=>{const{t:e}=se(),{service:n}=K.useContext(ii),{visible:r,setVisible:i,current:o}=K.useContext(Pi),{schema:a,field:s,dataSource:l,collection:c,initialValues:u}=o||{},{dn:f}=z.useDesignable(),{modal:d}=Ot.App.useApp(),{insert:h}=t,p=IS(),v=Ua(l,c),g=(P=!1)=>{var I;if(!_.modified)return;const k=(I=_.values.config)==null?void 0:I.chartType;if(!k)return;const A=p[k];if(!(A==null?void 0:A.init)){P&&(_.values.config.general={},_.values.config.advanced={});return}const T=_.values.query,N=il(v,T),{general:j,advanced:L}=A.init(N,T);(j||P)&&(_.values.config.general=j),(L||P)&&(_.values.config.advanced=L||{})},[y,m]=K.useState([]),[b,x]=K.useState([]),w=(P,k)=>{var T,N;const A=((T=P.values.query)==null?void 0:T.measures.filter(j=>j.field))||[],C=((N=P.values.query)==null?void 0:N.dimensions.filter(j=>j.field))||[];rn.isEqual(A,y)&&rn.isEqual(C,b)||(k==null||k(),m(rn.cloneDeep(A)),x(rn.cloneDeep(C)))},O=_B(),_=K.useMemo(()=>{var A;const P=u||(a==null?void 0:a["x-decorator-props"]),k=(P==null?void 0:P.config)||{};return wn.createForm({values:ht(tt({},P),{config:ht(tt({chartType:O},k),{title:k.title||((A=s==null?void 0:s.componentProps)==null?void 0:A.title)}),collection:[l,c]}),effects:C=>{wn.onFieldChange("config.chartType",()=>g(!0)),wn.onFormInit(()=>w(C))}})},[s,r,l,c]),S=()=>Y.jsx(Ot.Button,{type:"link",loading:n==null?void 0:n.loading,icon:Y.jsx(In.RightSquareOutlined,{}),onClick:()=>Nn(this,null,function*(){const P=_.query("query").take();try{yield P==null?void 0:P.validate()}catch(k){return}try{yield n.runAsync(l,c,_.values.query,!0)}catch(k){console.log(k)}w(_,g)}),children:e("Run query")}),E=K.useRef(null),M=K.useRef(null);return K.useEffect(()=>{var P;r&&n.run(c,(P=s==null?void 0:s.decoratorProps)==null?void 0:P.query,"configure")},[r]),Y.jsx(Ot.Modal,{title:e("Configure chart"),open:r,onOk:()=>{const{query:P,config:k,transform:A,mode:C}=_.values,{title:T,bordered:N}=k||{},j=()=>{var I;i(!1),(I=o.service)==null||I.run(l,c,P),E.current.scrollTop=0,M.current.scrollTop=0,n.mutate(void 0)},L={query:P,config:k,dataSource:l,collection:c,transform:A,mode:C||"builder"};if(a&&a["x-uid"]){a["x-component-props"]=ht(tt({},a["x-component-props"]),{title:T,bordered:N}),a["x-decorator-props"]=L,s.decoratorProps=L,s.componentProps=ht(tt({},s.componentProps),{title:T,bordered:N}),s["x-acl-action"]=`${c}:list`,f.emit("patch",{schema:a}),j();return}h(z.gridRowColWrap(TS(L)),{onSuccess:j})},onCancel:()=>{d.confirm({title:e("Are you sure to cancel?"),content:e("You changes are not saved. If you click OK, your changes will be lost."),okButtonProps:{danger:!0},onOk:()=>{i(!1),E.current.scrollTop=0,M.current.scrollTop=0,n.mutate(void 0)}})},width:"95%",className:zo.css`
|
|
10
|
+
(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,K,In,ae,wn,dt,Ot,rn,My,Ve,Bo,Mi,au,zo){"use strict";var kSt=Object.defineProperty,TSt=Object.defineProperties;var LSt=Object.getOwnPropertyDescriptors;var Ey=Object.getOwnPropertySymbols;var X9=Object.prototype.hasOwnProperty,q9=Object.prototype.propertyIsEnumerable;var MS=(ct,z)=>(z=Symbol[ct])?z:Symbol.for("Symbol."+ct),Ce=Math.pow,PS=(ct,z,Y)=>z in ct?kSt(ct,z,{enumerable:!0,configurable:!0,writable:!0,value:Y}):ct[z]=Y,tt=(ct,z)=>{for(var Y in z||(z={}))X9.call(z,Y)&&PS(ct,Y,z[Y]);if(Ey)for(var Y of Ey(z))q9.call(z,Y)&&PS(ct,Y,z[Y]);return ct},ht=(ct,z)=>TSt(ct,LSt(z));var AS=(ct,z)=>{var Y={};for(var K in ct)X9.call(ct,K)&&z.indexOf(K)<0&&(Y[K]=ct[K]);if(ct!=null&&Ey)for(var K of Ey(ct))z.indexOf(K)<0&&q9.call(ct,K)&&(Y[K]=ct[K]);return Y};var ri=(ct,z,Y)=>(PS(ct,typeof z!="symbol"?z+"":z,Y),Y);var Nn=(ct,z,Y)=>new Promise((K,In)=>{var ae=Ot=>{try{dt(Y.next(Ot))}catch(rn){In(rn)}},wn=Ot=>{try{dt(Y.throw(Ot))}catch(rn){In(rn)}},dt=Ot=>Ot.done?K(Ot.value):Promise.resolve(Ot.value).then(ae,wn);dt((Y=Y.apply(ct,z)).next())}),NSt=function(ct,z){this[0]=ct,this[1]=z};var K9=ct=>{var z=ct[MS("asyncIterator")],Y=!1,K,In={};return z==null?(z=ct[MS("iterator")](),K=ae=>In[ae]=wn=>z[ae](wn)):(z=z.call(ct),K=ae=>In[ae]=wn=>{if(Y){if(Y=!1,ae==="throw")throw wn;return wn}return Y=!0,{done:!1,value:new NSt(new Promise(dt=>{var Ot=z[ae](wn);if(!(Ot instanceof Object))throw TypeError("Object expected");dt(Ot)}),1)}}),In[MS("iterator")]=()=>In,K("next"),"throw"in z?K("throw"):In.throw=ae=>{throw ae},"return"in z&&K("return"),In};function hB(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 CS="data-visualization";function St(t){return z.i18n.t(t,{ns:[CS,"client"]})}function se(){return My.useTranslation([CS,"client"],{nsMode:"fallback"})}const Py={datetime:[{label:St("YYYY"),value:"YYYY"},{label:St("MM"),value:"MM"},{label:St("DD"),value:"DD"},{label:St("YYYY-MM"),value:"YYYY-MM"},{label:St("YYYY-MM-DD"),value:"YYYY-MM-DD"},{label:St("YYYY-MM-DD hh:mm"),value:"YYYY-MM-DD hh:mm"},{label:St("YYYY-MM-DD hh:mm:ss"),value:"YYYY-MM-DD hh:mm:ss"}],date:[{label:St("YYYY"),value:"YYYY"},{label:St("MM"),value:"MM"},{label:St("DD"),value:"DD"},{label:St("YYYY-MM"),value:"YYYY-MM"},{label:St("YYYY-MM-DD"),value:"YYYY-MM-DD"}],time:[{label:St("hh:mm:ss"),value:"hh:mm:ss"},{label:St("hh:mm"),value:"hh:mm"},{label:St("hh"),value:"hh"}]},pB=K.createContext(null),Ay={didCatch:!1,error:null};let kS=class extends K.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&&vB(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(K.isValidElement(i))s=i;else if(typeof n=="function")s=n(l);else if(r)s=K.createElement(r,l);else throw a}return K.createElement(pB.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}};function vB(){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 TS=(t,e={})=>{const{collection:n,config:r}=t,{title:i,bordered:o}=r||{};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",title:i,bordered:o},"x-initializer":"charts:addBlock",properties:{[Bo.uid()]:{type:"void","x-component":"ChartRenderer","x-component-props":e}}}},su=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}},ph=(t,e)=>{var o,a;const{target:n,name:r}=su(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)},il=(t,e)=>{const n=s=>s.map(l=>{const c=ph(t,l.field);return ht(tt({},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()]},gB=(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;if(Array.isArray(o))return o.map(c=>r(i,c));const s=a.find(c=>{var u;return c.value===(((u=o==null?void 0:o.toString)==null?void 0:u.call(o))||o)});return dt.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":case"multipleSelect":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},yB=(t,e)=>{const n=e.split(".");let r=rn.get(t,n.slice(0,-1).join("."));return Array.isArray(r)?r=r.map(i=>rn.get(i,n.slice(-1)[0])):r=rn.get(r,n.slice(-1)[0]),r},mB=t=>({boolean:"Checkbox",integer:"InputNumber",bigInt:"InputNumber",double:"InputNumber",decimal:"InputNumber",date:"DatePicker",string:"Input"})[t],bB=t=>({boolean:"boolean",integer:"integer",bigInt:"integer",double:"number",decimal:"number",date:"datetime",string:"input"})[t],ol=K.createContext({});ol.displayName="ChartDataContext";const xB=t=>{const[e,n]=K.useState({}),r=Mi.useMemoizedFn((o,{dataSource:a,collection:s,service:l,query:c})=>{n(u=>ht(tt({},u),{[o]:{dataSource:a,collection:s,service:l,query:c}}))}),i=Mi.useMemoizedFn(o=>{n(a=>ht(tt({},a),{[o]:void 0}))});return Y.jsx(ol.Provider,{value:{charts:e,addChart:r,removeChart:i},children:t.children})},kr=K.createContext({});kr.displayName="ChartFilterContext";const wB=t=>{const[e,n]=K.useState(!1),[r,i]=K.useState(!1),[o,a]=K.useState({}),[s,l]=K.useState({collapsed:!1,row:1}),[c,u]=K.useState(),f=Mi.useMemoizedFn((g,y)=>{a(m=>ht(tt({},m),{[g]:tt(tt({},m[g]||{}),y)}))}),d=Mi.useMemoizedFn(g=>{a(y=>{const m=tt({},y);return m[g]=void 0,m})}),h=Mi.useMemoizedFn(u),p=Mi.useMemoizedFn(i),v=({collapsed:g,row:y})=>{l(m=>({collapsed:g!==void 0?g:m.collapsed,row:y!==void 0?y:m.row}))};return K.useEffect(()=>n(!0),[]),Y.jsx(kr.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})},ii=K.createContext({});ii.displayName="ChartRendererContext";const LS=t=>{const{query:e,config:n,collection:r,transform:i,dataSource:o=z.DEFAULT_DATA_SOURCE_KEY}=t,{addChart:a}=K.useContext(ol),{ready:s,form:l,enabled:c}=K.useContext(kr),{getFilter:u,hasFilter:f,appendFilter:d,parseFilter:h}=sl(),p=dt.useFieldSchema(),v=z.useAPIClient(),g=z.useRequest((y,m,b,x)=>Nn(this,null,function*(){var M,P;if(!(m&&((M=b==null?void 0:b.measures)!=null&&M.length))||c&&!l)return;const w=u(),O=yield h(b.filter),_=ht(tt({},b),{filter:O}),S={dataSource:y,collection:m,query:_},E=!x&&f(S,w)?d(S,w):_;try{const k=yield v.request({url:"charts:query",method:"POST",data:ht(tt({uid:p==null?void 0:p["x-uid"],dataSource:y,collection:m},E),{filter:Cy(E.filter),dimensions:((b==null?void 0:b.dimensions)||[]).map(A=>{const C=tt({},A);if(A.format&&!A.alias){const{alias:T}=su(A.field);C.alias=T}return C}),measures:((b==null?void 0:b.measures)||[]).map(A=>{const C=tt({},A);if(A.aggregation&&!A.alias){const{alias:T}=su(A.field);C.alias=T}return C})})});return(P=k==null?void 0:k.data)==null?void 0:P.data}catch(k){throw console.error(k),k}finally{!x&&(p!=null&&p["x-uid"])&&a(p==null?void 0:p["x-uid"],{dataSource:y,collection:m,service:g,query:b})}}),{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(ii.Provider,{value:{dataSource:o,collection:r,config:n,transform:i,service:g,query:e},children:t.children})})})};class OB{constructor(){ri(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:St(a.title),value:`${i}.${a.name}`}));e.push({label:St(i),children:o})});const n=e.findIndex(r=>r.label===St("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 NS=()=>z.usePlugin(Sy).charts.getChartTypes(),_B=()=>{var e,n,r;return(r=(n=(e=NS()[0])==null?void 0:e.children)==null?void 0:n[0])==null?void 0:r.value},IS=()=>z.usePlugin(Sy).charts.getCharts(),SB=t=>z.usePlugin(Sy).charts.getChart(t),{Paragraph:EB,Text:MB}=Ot.Typography,ky=t=>{const{t:e}=se(),n=K.useContext(ii),{config:r,transform:i,dataSource:o,collection:a,service:s,data:l}=n,c=Ua(o,a),u=DS(l,o,a),f=(r==null?void 0:r.general)||{},d=(r==null?void 0:r.advanced)||{},h=z.useAPIClient(),p=SB(r==null?void 0:r.chartType),v=h.auth.getLocale(),g=BB(i,v),y=p==null?void 0:p.getProps({data:u,general:f,advanced:d,fieldProps:Object.keys(u[0]||{}).reduce((x,w)=>{if(!x[w]){const O=ph(c,w.split(".")),_=g[w];x[w]={label:(O==null?void 0:O.label)||w,transformer:_,interface:O==null?void 0:O.interface}}return x},{})}),m=dt.Schema.compile(y),b=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(kS,{onError:x=>{console.error(x)},FallbackComponent:PB,children:Y.jsx(b,tt({},m))})}):Y.jsx(Ot.Empty,{image:Ot.Empty.PRESENTED_IMAGE_SIMPLE,description:e("Please configure chart")})};ky.Designer=function(){const{t:e}=se(),{setVisible:n,setCurrent:r}=K.useContext(Pi),{removeChart:i}=K.useContext(ol),{service:o}=K.useContext(ii),a=dt.useField(),s=dt.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:()=>Nn(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(TS(s==null?void 0:s["x-decorator-props"]))),children:e("Duplicate")},"duplicate"),Y.jsx(z.SchemaSettingsDivider,{}),Y.jsx(z.SchemaSettingsRemove,{breakRemoveOn:{"x-component":"ChartV2Block"},confirm:{onOk:()=>{i(s["x-uid"])}}})]})};const PB=({error:t})=>{const{t:e}=se();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(EB,{copyable:!0,children:Y.jsx(MB,{type:"danger",style:{whiteSpace:"pre-line",textAlign:"center"},children:t.message})})})})},lu=t=>{const{current:e}=K.useContext(Pi),{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}},AB=t=>(t||[]).filter(n=>n.interface).map(n=>{var r;return ht(tt({},n),{key:n.name,label:((r=n.uiSchema)==null?void 0:r.title)||n.name,value:n.name})}),Ua=(t,e)=>{const{t:n}=My.useTranslation(),{cm:r,fim:i,collection:o}=lu(t),a=r.getCollectionFields(e||o),s=AB(a);return K.useMemo(()=>s.map(l=>{var d,h,p,v;const c=(d=i.getFieldInterface(l.interface))==null?void 0:d.filterable,u=dt.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 ht(tt({},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 ht(tt({},y),{key:`${l.name}.${y.name}`,label:`${u} / ${dt.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 ht(tt({},y),{key:`${l.name}.${y.name}`,label:`${u} / ${dt.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 ht(tt({},l),{label:u,targetFields:f})}),[s])},jS=t=>e=>{const n=e.query("query").get("value")||{},r=il(t,n);e.dataSource=r},CB=t=>e=>{var o;const n=e.query(".field").get("value");if(!n){e.dataSource=[];return}let r=[];switch((o=ph(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},kB=()=>{const{t}=My.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 K.useMemo(()=>dt.Schema.compile(i,{t}),[i])},TB=(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=il(e,r);n.componentProps.fieldNames={},n.dataSource=a},LB=(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=il(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}=su(f.field);return(!f.field||s.includes(d))&&u.push(f),u},[]);n.setValue(c)},DS=(t,e,n)=>{var c;const{t:r}=se(),{service:i,query:o}=K.useContext(ii),a=Ua(e,n),s=dt.useForm(),l=il(a,((c=s==null?void 0:s.values)==null?void 0:c.query)||o);return gB(l,(i==null?void 0:i.data)||t||[],{t:r})},NB=(t,e,n=2,r=[])=>{const{cm:i,fim:o,collection:a}=lu(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=ht(tt({},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=>ht(tt({},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)},IB=(t,e)=>{const{cm:n,fim:r,collection:i}=lu(t);return K.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])},Yo={general:{Prefix:{schema:{"x-component":"Input"},fn:(t,e)=>e?`${e}${t}`:t},Suffix:{schema:{"x-component":"Input"},fn:(t,e)=>e?`${t}${e}`:t}},datetime:{Format:{schema:{"x-component":"AutoComplete","x-component-props":{allowClear:!0,style:{minWidth:200}},enum:[{label:"YYYY",value:"YYYY"},{label:"YYYY-MM",value:"YYYY-MM"},{label:"YYYY-MM-DD",value:"YYYY-MM-DD"},{label:"YYYY-MM-DD hh:mm",value:"YYYY-MM-DD hh:mm"},{label:"YYYY-MM-DD hh:mm:ss",value:"YYYY-MM-DD hh:mm:ss"}]},fn:(t,e)=>Ve(t).format(e)},YYYY:{label:"YYYY (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY")},MM:{label:"MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("MM")},DD:{label:"DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("DD")},"YYYY-MM":{label:"YYYY-MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM")},"YYYY-MM-DD":{label:"YYYY-MM-DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD")},"YYYY-MM-DD hh:mm":{label:"YYYY-MM-DD hh:mm (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD hh:mm")},"YYYY-MM-DD hh:mm:ss":{label:"YYYY-MM-DD hh:mm:ss (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD hh:mm:ss")}},date:{Format:{schema:{"x-component":"AutoComplete","x-component-props":{allowClear:!0,style:{minWidth:200}},enum:[{label:"YYYY",value:"YYYY"},{label:"MM",value:"MM"},{label:"DD",value:"DD"},{label:"YYYY-MM",value:"YYYY-MM"},{label:"YYYY-MM-DD",value:"YYYY-MM-DD"}]},fn:(t,e)=>Ve(t).format(e)},YYYY:{label:"YYYY (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY")},MM:{label:"MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("MM")},DD:{label:"DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("DD")},"YYYY-MM":{label:"YYYY-MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM")},"YYYY-MM-DD":{label:"YYYY-MM-DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD")}},time:{Format:{schema:{"x-component":"AutoComplete","x-component-props":{allowClear:!0,style:{minWidth:200}},enum:[{label:"hh:mm:ss",value:"hh:mm:ss"},{label:"hh:mm",value:"hh:mm"},{label:"hh",value:"hh"}]},fn:(t,e)=>Ve(t).format(e)},"hh:mm:ss":{label:"hh:mm:ss (Deprecated, use Format instead)",fn:t=>Ve(t).format("hh:mm:ss")},"hh:mm":{label:"hh:mm (Deprecated, use Format instead)",fn:t=>Ve(t).format("hh:mm")},hh:{label:"hh (Deprecated, use Format instead)",fn:t=>Ve(t).format("hh")}},number:{Precision:{schema:{"x-component":"Select",enum:[{label:"1",value:0},{label:"1.0",value:1},{label:"1.00",value:2},{label:"1.000",value:3}]},fn:(t,e)=>Number(t.toFixed(e))},Separator:{schema:{"x-component":"Select",enum:[{label:"100,000.00",value:"en-US"},{label:"100.000,00",value:"de-DE"},{label:"100 000.00",value:"ru-RU"}]},fn:(t,e)=>{switch(e){case"en-US":return t.toLocaleString("en-US",{minimumFractionDigits:2});case"de-DE":return t.toLocaleString("de-DE",{minimumFractionDigits:2});case"ru-RU":return t.toLocaleString("ru-RU",{minimumFractionDigits:2});default:return t}}},Percent:t=>new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(t),Currency:{label:"Currency (Deprecated, use Separator & Prefix instead)",fn:(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]||"USD";return new Intl.NumberFormat(e,{style:"currency",currency:n}).format(t)}},Exponential:t=>(+t).toExponential(),Abbreviation:{schema:{"x-component":"Select",enum:[{label:"en-US",value:"en-US"},{label:"zh-CN",value:"zh-CN"}]},fn:(t,e="en-US")=>new Intl.NumberFormat(e,{notation:"compact"}).format(t)}},string:{"Type conversion":{schema:{"x-component":"Select",enum:[{label:"Number",value:"Number"},{label:"Date",value:"Date"}]},fn:(t,e)=>{try{return new Function(`return ${e}(${t})`)()}catch(n){return console.log(n),t}}}}},jB=t=>function(){const n=dt.useField(),r=n.query("query").get("value")||{},i=il(t,r),o=Object.keys(Yo).filter(a=>a!=="general");return{onChange:a=>{n.value=a;const s=n.query(".type").take();a||s.setState({value:null});const l=i.find(h=>h.value===a);s.dataSource=o.map(h=>({label:St(h),value:h}));const c={createdAt:"datetime",updatedAt:"datetime",double:"number",integer:"number",percent:"number"},u=l==null?void 0:l.interface,f=l==null?void 0:l.type,d=c[u]||c[f]||f;if(o.includes(d)){s.setState({value:d});return}s.setState({value:null})}}},DB=()=>{const t=dt.useField();return{options:Object.keys(Yo).filter(r=>r!=="general").map(r=>({label:St(r),value:r})),onChange:r=>{t.value=r,t.query(".format").take().setValue(null)}}},FB=()=>{const t=dt.useField();return{onChange:e=>{t.value=e,t.query(".argument").take().setValue(null)}}},$B=t=>{const e=t.query(".type").get("value");if(!e){t.dataSource=[];return}const n=Object.entries(tt(tt({},Yo.general),Yo[e]||{})).map(([r,i])=>{const o=typeof i=="function"?r:i.label||r;return{label:St(o),value:r}});t.dataSource=n},RB=t=>{const e=t.query(".type").get("value"),n=t.query(".format").get("value");if(!n||!e){t.setComponentProps({schema:null});return}const r=Yo[e][n]||Yo.general[n];if(!r||typeof r=="function"){t.setComponentProps({schema:null});return}const i=Bo.uid();t.setComponentProps({schema:tt({name:i},r.schema)})},BB=(t,e="en-US")=>{const n=(t||[]).filter(i=>i.field&&i.type&&i.format).reduce((i,o)=>{const a=Yo[o.type][o.format]||Yo.general[o.format];return a&&(i[o.field]=[...i[o.field]||[],{transformer:a,argument:o.argument}]),i},{}),r={};return Object.entries(n).forEach(([i,o])=>{r[i]=o.reduce((a,s)=>{const{transformer:l}=s;let{argument:c}=s;return u=>{try{return typeof l=="function"?l(a(u),c):(!c&&!l.schema&&(c=e),l.fn(a(u),c))}catch(f){return console.log(f),u}}},a=>a)}),r};function cu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var zB=function(e){return YB(e)&&!WB(e)};function YB(t){return!!t&&typeof t=="object"}function WB(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||UB(t)}var GB=typeof Symbol=="function"&&Symbol.for,HB=GB?Symbol.for("react.element"):60103;function UB(t){return t.$$typeof===HB}function VB(t){return Array.isArray(t)?[]:{}}function uu(t,e){return e.clone!==!1&&e.isMergeableObject(t)?al(VB(t),t,e):t}function XB(t,e,n){return t.concat(e).map(function(r){return uu(r,n)})}function qB(t,e){if(!e.customMerge)return al;var n=e.customMerge(t);return typeof n=="function"?n:al}function KB(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function FS(t){return Object.keys(t).concat(KB(t))}function $S(t,e){try{return e in t}catch(n){return!1}}function ZB(t,e){return $S(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function QB(t,e,n){var r={};return n.isMergeableObject(t)&&FS(t).forEach(function(i){r[i]=uu(t[i],n)}),FS(e).forEach(function(i){ZB(t,i)||($S(t,i)&&n.isMergeableObject(e[i])?r[i]=qB(i,n)(t[i],e[i],n):r[i]=uu(e[i],n))}),r}function al(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||XB,n.isMergeableObject=n.isMergeableObject||zB,n.cloneUnlessOtherwiseSpecified=uu;var r=Array.isArray(e),i=Array.isArray(t),o=r===i;return o?r?n.arrayMerge(t,e,n):QB(t,e,n):uu(e,n)}al.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,i){return al(r,i,n)},{})};var JB=al,tz=JB;const ez=cu(tz),nz=()=>({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"}}}),Ty=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=nz();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]},rz=(t,e)=>{if(!t)return t;if(Ve.isDayjs(t))return e.showTime||(t=t.startOf("day")),au.moment2str(t,e);if(Array.isArray(t)&&t.length&&Ve.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},RS=(t,e)=>Nn(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=rz(i,t.componentProps);t.setValue(o),t.setInitialValue(o),t.loading=!1}}),vh="-",fu=(t,e)=>t?`${t}${vh}${e}`:e,BS=t=>{const[e,n]=t.split(vh);return n?{dataSource:e,fieldName:n}:{dataSource:z.DEFAULT_DATA_SOURCE_KEY,fieldName:e}},Ly=(t,e,n)=>dt.Schema.isSchemaInstance(t)?t.reduceProperties((r,i)=>{let o=i[e];if(o.includes(vh)||(o=`${z.DEFAULT_DATA_SOURCE_KEY}${vh}${o}`),o===n)return i;if(i["x-component"]!=="Action.Container"&&i["x-component"]!=="AssociationField.Viewer"){const a=Ly(i,e,n);if(a)return a}return r}):null,Ny=()=>{const{charts:t}=K.useContext(ol),e=K.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=K.useMemo(()=>Object.keys(e).length>1,[e]),r=K.useCallback((i,o)=>{var a;return((a=e[i])==null?void 0:a.includes(o))||!1},[e]);return{chartCollections:e,showDataSource:n,getIsChartCollectionExists:r}},sl=()=>{const t=z.useDataSourceManager(),{charts:e}=K.useContext(ol),{fieldSchema:n}=z.useActionContext(),r=n==null?void 0:n["x-action"],{fields:i,form:o}=K.useContext(kr),a=z.useVariables(),s=({dataSource:v,collection:g,cm:y,fim:m})=>{const b=y.getCollectionFields(g.name),x=(E,M,P,k)=>{var I,F,$,R,B;const A=((I=E.uiSchema)==null?void 0:I.title)||E.name,C=m.getFieldInterface(E.interface),T=($=(F=C==null?void 0:C.filterable)==null?void 0:F.operators)==null?void 0:$[0],N=y.getCollection(E.target);M=M?`${M} / ${A}`:A;let j={type:"string",title:M,name:`${P}.${E.name}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-component":"CollectionField","x-decorator":"ChartFilterFormItem","x-data-source":v,"x-collection-field":`${k}.${E.name}`,"x-component-props":ht(tt({},(R=E.uiSchema)==null?void 0:R["x-component-props"]),{"filter-operator":T})};if(E.interface==="formula"){const W=mB(E.dataType)||"Input";j=ht(tt({},j),{"x-component":W})}return["oho","o2m"].includes(E.interface)&&rn.set(j,"x-component-props.useOriginalFilter",!0),{key:`${P}.${E.name}`,name:E.name,type:"item",title:((B=E==null?void 0:E.uiSchema)==null?void 0:B.title)||E.name,Component:"CollectionFieldInitializer",find:Ly,remove:(W,q)=>{q(W,{breakRemoveOn:{"x-component":"Grid"}})},schemaInitialize:W=>{var q;(q=C==null?void 0:C.schemaInitialize)==null||q.call(C,W,{field:E,block:"FilterForm",readPretty:o.readPretty,action:r,targetCollection:N})},schema:j}},w=(E,M,P,k)=>{var j;const A=((j=E.uiSchema)==null?void 0:j.title)||E.name;M=M?`${M} / ${A}`:A;const C=E.operators[0];let T=ht(tt({type:"string",name:`${P}.${E.name}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-decorator":"ChartFilterFormItem","x-data-source":v,"x-collection-field":`${k}.${E.name}`},E.schema),{title:M,"x-component-props":{"filter-operator":C}});return C!=null&&C.noValue&&(T=ht(tt({},T),{"x-component":"ChartFilterCheckbox","x-component-props":ht(tt({},T["x-component-props"]),{content:dt.Schema.compile(C.label,{t:z.i18n.t})})})),{key:`${P}.${E.name}`,name:E.name,type:"item",title:E.title||E.name,Component:"CollectionFieldInitializer",find:Ly,remove:(L,I)=>{I(L,{breakRemoveOn:{"x-component":"Grid"}})},schema:T}},O=(E,M,P,k,A)=>{var I,F,$;if(!E.interface||E.isForeignKey)return;const C=m.getFieldInterface(E.interface);if(!(C!=null&&C.filterable))return;const{nested:T,children:N}=C.filterable,j=((I=E.uiSchema)==null?void 0:I.title)||E.name,L=x(E,P,k,A);if(!(E.target&&M>2)){if(P=P?`${P} / ${j}`:j,N!=null&&N.length&&!["chinaRegion","createdBy","updatedBy","attachment"].includes(E.interface)){const R=N.map(B=>w(B,P,`${k}.${E.name}`,`${A}.${E.name}`));return{key:`${k}.${E.name}`,name:E.name,type:"subMenu",title:((F=E==null?void 0:E.uiSchema)==null?void 0:F.title)||E.name,children:R}}if(!M||M>2)return L;if(T){const B=y.getCollectionFields(E.target).map(W=>O(W,M+1,"",`${k}.${E.name}`,`${A}.${E.name}`));return{key:`${k}.${E.name}`,name:E.name,type:"subMenu",title:(($=E==null?void 0:E.uiSchema)==null?void 0:$.title)||E.name,children:B.filter(Boolean)}}return L}},_=[],S=[];return b.forEach(E=>{const M=E.interface,P=O(E,0,"",fu(v,g.name),g.name);if(P&&_.push(P),["m2o"].includes(M)){const k=O(E,1,"",fu(v,g.name),g.name);k&&S.push(k)}}),S.length&&_.push({name:"divider",type:"divider"},{name:"displayAssociationFields",type:"itemGroup",title:z.i18n.t("Display association fields"),children:S}),_},l=()=>{const v=(o==null?void 0:o.values)||{},g={};return Object.entries(i).filter(([y,m])=>m).forEach(([y,m])=>{const{operator:b}=m||{},{dataSource:x,fieldName:w}=BS(y);let O=w;const E=t.getDataSource(x).collectionManager.getCollectionField(O);if(E!=null&&E.target){const C=E.targetKey||"id";O=`${O}.${C}`,y=`${y}.${C}`}const[M,...P]=O.split("."),k=yB(v,y),A=(b==null?void 0:b.value)||"$eq";if(M!=="custom"){const C=fu(x,M);g[C]=g[C]||{$and:[]};const T={};rn.set(T,P.join("."),{[A]:k}),g[C].$and.push(T)}else g[M]=g[M]||{},g[M][`$nFilter.${P.join(".")}`]=k}),g},c=(v,g)=>{if(!v)return!1;const{dataSource:y,collection:m,query:b}=v,{parameters:x}=au.parse(b.filter||"");return g[fu(y,m)]||g.custom&&(x==null?void 0:x.find(({key:w})=>rn.has(g.custom,w)))},u=(v,g)=>{const{dataSource:y,collection:m,query:b}=v;let x=tt({},b);const w=tt({},x.filter||{});let O={};const _=au.parse(w),{parameters:S}=_;return g.custom&&(S!=null&&S.find(E=>g.custom[E.key]))&&(O=_(g.custom)),O=ez(w,O),x=ht(tt({},x),{filter:{$and:[O,g[fu(y,m)]]}}),x},f=()=>Nn(this,null,function*(){const v=l(),g=Object.values(e).filter(y=>c(y,v)).map(y=>()=>Nn(this,null,function*(){const{dataSource:m,service:b,collection:x}=y;yield b.runAsync(m,x,u(y,v),!0)}));yield Promise.all(g.map(y=>y()))}),d=()=>Nn(this,null,function*(){const v=Object.values(e).filter(g=>g).map(g=>()=>Nn(this,null,function*(){const{service:y,dataSource:m,collection:b,query:x}=g;yield y.runAsync(m,b,x,!0)}));yield Promise.all(v.map(g=>g()))}),h=Mi.useMemoizedFn(v=>v.split(" / ").map(g=>z.i18n.t(dt.Schema.compile(g,{t:z.i18n.t}))).join(" / ")),p=K.useCallback(v=>Nn(this,null,function*(){const g=au.flatten(v,{breakOn({key:m}){return m.startsWith("$")&&m!=="$and"&&m!=="$or"},transformValue(m){return!(typeof m=="string"&&m.startsWith("{{$")&&(m!=null&&m.endsWith("}}")))||["$user","$date","$nDate","$nRole","$nFilter"].some(x=>m.includes(x))?m:a==null?void 0:a.parseVariable(m)}});return yield Promise.all(Object.keys(g).map(m=>Nn(this,null,function*(){return g[m]=yield g[m],g[m]===void 0&&delete g[m],g[m]}))),au.unflatten(g)}),[a]);return{filter:f,refresh:d,getChartFilterFields:s,getFilter:l,hasFilter:c,appendFilter:u,getTranslatedTitle:h,parseFilter:p}},iz=()=>{const{t}=se(),e=Mi.useMemoizedFn(t),{enabled:n,fields:r}=K.useContext(kr),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=K.useMemo(()=>({label:e("Current filter"),value:"$nFilter",key:"$nFilter",children:i}),[i,e]);return!n||!i.length?null:o},zS=()=>{const{t}=se(),{chartCollections:e}=Ny(),n=z.useDataSourceManager(),r=n.collectionFieldInterfaceManager,{values:i}=YS(),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 K.useMemo(()=>Object.entries(e).map(([s,l])=>{const c=n.getDataSource(s);return{value:s,label:dt.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:dt.Schema.compile(d.title,{t}),children:p}})}}),[e])},YS=()=>{const{t}=se(),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)}},oz=(t,e)=>{const{t:n}=se(),r=z.useDataSourceManager(),{showDataSource:i}=Ny();return K.useMemo(()=>{var p;const o=r.getDataSource(t);if(!o)return;const a=o.collectionManager;if(!e)return;const{fieldName:s}=BS(e),[l,...c]=s.split(".");if(!(c!=null&&c.length))return;const u=a.getCollection(l);let f=l,d,h=dt.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+=` / ${dt.Schema.compile(g,{t:n})}`),d!=null&&d.target?f=d.target:f=null}return i?`${dt.Schema.compile(o.displayName,{t:n})} > ${h}`:h},[e,t,i])},WS=(t,e)=>{const{currentUserSettings:n}=z.useCurrentUserVariable({collectionField:{uiSchema:t},uiSchema:t}),{currentRoleSettings:r}=z.useCurrentRoleVariable({uiSchema:t}),{apiTokenSettings:i}=z.useAPITokenVariable({noDisabled:!0}),{datetimeSettings:o}=z.useDatetimeVariable({operator:e,schema:t,noDisabled:!0}),{urlSearchParamsSettings:a}=z.useURLSearchParamsVariable(),s=K.useMemo(()=>[n,r,i,o,a].filter(Boolean),[o,n,r,a,i]);return t?s:[]},az=()=>{const t=dt.useField(),{operator:e,schema:n}=t.data||{},r=iz(),i=WS(n,e),o=K.useMemo(()=>[...i,r].filter(Boolean),[i,r]);return!e||!n?[]:o},Iy=(t={},e={})=>ht(tt({type:"array","x-decorator":"FormItem","x-component":"ArrayItems"},e),{items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:ht(tt({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"}}}),sz=t=>({type:"void",properties:{config:{type:"object",properties:{collapse:{type:"void","x-component":"FormCollapse","x-component-props":{formCollapse:"{{formCollapse}}",size:"small",style:{border:"none",boxShadow:"none"}},properties:{pane1:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:St("Container"),key:"card"},properties:{title:{type:"string",title:'{{t("Title")}}',"x-decorator":"FormItem","x-component":"Input"},bordered:{type:"boolean","x-content":St("Show border"),"x-decorator":"FormItem","x-component":"Checkbox",default:!1}}},pane2:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:St("Chart"),key:"basic",style:{border:"none"}},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 }}"},[Bo.uid()]:{type:"void",properties:{general:t}},[Bo.uid()]:{type:"void",properties:{advanced:{type:"json",title:'{{t("JSON config")}}',"x-decorator":"FormItem","x-decorator-props":{extra:St("Same properties set in the form above will be overwritten by this JSON config.")},"x-component":"Input.JSON","x-component-props":{autoSize:{minRows:3},json5:!0}}}},reference:{type:"string","x-reactions":{dependencies:[".chartType"],fulfill:{schema:{"x-content":"{{ getReference($deps[0]) }}"}}}}}}}}}}}}),lz={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}}",size:"small",style:{border:"none",boxShadow:"none"}},properties:{pane1:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:St("Measures"),key:"measures"},properties:{measures:Iy({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"}}},distinct:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Distinct")}}'}},{required:!0,"x-component-props":{style:{overflow:"auto"}}})}},pane2:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:St("Dimensions"),key:"dimensions"},properties:{dimensions:Iy({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:St("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:St("Sort"),key:"sort",style:{border:"none"}},properties:{orders:Iy({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"}}}}}}}}},cz={type:"void",properties:{transform:{type:"array","x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{wrap:!0},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},field:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Field")}}'},"x-use-component-props":"useFieldSelectProps","x-reactions":"{{ useChartFields }}"},type:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Type")}}'},"x-use-component-props":"useFieldTypeSelectProps"},format:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Transformer")}}',style:{maxWidth:"200px"}},"x-use-component-props":"useTransformerSelectProps","x-reactions":"{{ useTransformers }}","x-visible":"{{ $self.dataSource && $self.dataSource.length }}"},argument:{type:"string","x-decorator":"FormItem","x-component":"TransformerDynamicComponent","x-reactions":"{{ useArgument }}"},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{t("Add transformation")}}',"x-component":"ArrayItems.Addition"}}}}};function uz(t){const{value:e,onChange:n,renderSchemaComponent:r}=t,i=az();return Y.jsx(z.Variable.Input,{value:e,onChange:n,scope:i,children:r()})}const Pi=K.createContext({visible:!0});Pi.displayName="ChartConfigContext";const fz=t=>{var a;const{insertAdjacent:e}=z.useDesignable(),[n,r]=K.useState(!1),[i,o]=K.useState({});return Y.jsxs(Pi.Provider,{value:{visible:n,setVisible:r,current:i,setCurrent:o},children:[t.children,Y.jsx(LS,ht(tt({},(a=i.field)==null?void 0:a.decoratorProps),{children:Y.jsx(oi,{insert:(s,l)=>e("beforeEnd",s,l)})}))]})},dz=t=>{const{schema:e}=t,n=dt.useField();return e?Y.jsx(z.SchemaComponent,{schema:{type:"void",properties:{[e.name]:ht(tt({type:"void"},e),{value:n.value,"x-component-props":ht(tt({},e["x-component-props"]),{defaultValue:n.value,onChange:r=>{if(typeof r=="object"&&(r!=null&&r.target)){n.value=r.target.value;return}n.value=r}})})}}}):null},{Paragraph:ISt,Text:hz}=Ot.Typography,oi=t=>{const{t:e}=se(),{service:n}=K.useContext(ii),{visible:r,setVisible:i,current:o}=K.useContext(Pi),{schema:a,field:s,dataSource:l,collection:c,initialValues:u}=o||{},{dn:f}=z.useDesignable(),{modal:d}=Ot.App.useApp(),{insert:h}=t,p=IS(),v=Ua(l,c),g=(P=!1)=>{var I;if(!_.modified)return;const k=(I=_.values.config)==null?void 0:I.chartType;if(!k)return;const A=p[k];if(!(A==null?void 0:A.init)){P&&(_.values.config.general={},_.values.config.advanced={});return}const T=_.values.query,N=il(v,T),{general:j,advanced:L}=A.init(N,T);(j||P)&&(_.values.config.general=j),(L||P)&&(_.values.config.advanced=L||{})},[y,m]=K.useState([]),[b,x]=K.useState([]),w=(P,k)=>{var T,N;const A=((T=P.values.query)==null?void 0:T.measures.filter(j=>j.field))||[],C=((N=P.values.query)==null?void 0:N.dimensions.filter(j=>j.field))||[];rn.isEqual(A,y)&&rn.isEqual(C,b)||(k==null||k(),m(rn.cloneDeep(A)),x(rn.cloneDeep(C)))},O=_B(),_=K.useMemo(()=>{var A;const P=u||(a==null?void 0:a["x-decorator-props"]),k=(P==null?void 0:P.config)||{};return wn.createForm({values:ht(tt({},P),{config:ht(tt({chartType:O},k),{title:k.title||((A=s==null?void 0:s.componentProps)==null?void 0:A.title)}),collection:[l,c]}),effects:C=>{wn.onFieldChange("config.chartType",()=>g(!0)),wn.onFormInit(()=>w(C))}})},[s,r,l,c]),S=()=>Y.jsx(Ot.Button,{type:"link",loading:n==null?void 0:n.loading,icon:Y.jsx(In.RightSquareOutlined,{}),onClick:()=>Nn(this,null,function*(){const P=_.query("query").take();try{yield P==null?void 0:P.validate()}catch(k){return}try{yield n.runAsync(l,c,_.values.query,!0)}catch(k){console.log(k)}w(_,g)}),children:e("Run query")}),E=K.useRef(null),M=K.useRef(null);return K.useEffect(()=>{var P;r&&n.run(c,(P=s==null?void 0:s.decoratorProps)==null?void 0:P.query,"configure")},[r]),Y.jsx(Ot.Modal,{title:e("Configure chart"),open:r,onOk:()=>{const{query:P,config:k,transform:A,mode:C}=_.values,{title:T,bordered:N}=k||{},j=()=>{var I;i(!1),(I=o.service)==null||I.run(l,c,P),E.current.scrollTop=0,M.current.scrollTop=0,n.mutate(void 0)},L={query:P,config:k,dataSource:l,collection:c,transform:A,mode:C||"builder"};if(a&&a["x-uid"]){a["x-component-props"]=ht(tt({},a["x-component-props"]),{title:T,bordered:N}),a["x-decorator-props"]=L,s.decoratorProps=L,s.componentProps=ht(tt({},s.componentProps),{title:T,bordered:N}),s["x-acl-action"]=`${c}:list`,f.emit("patch",{schema:a}),j();return}h(z.gridRowColWrap(TS(L)),{onSuccess:j})},onCancel:()=>{d.confirm({title:e("Are you sure to cancel?"),content:e("You changes are not saved. If you click OK, your changes will be lost."),okButtonProps:{danger:!0},onOk:()=>{i(!1),E.current.scrollTop=0,M.current.scrollTop=0,n.mutate(void 0)}})},width:"95%",className:zo.css`
|
|
11
11
|
.ant-modal-content {
|
|
12
12
|
padding: 0;
|
|
13
13
|
}
|
|
@@ -176,4 +176,4 @@ Error generating stack: `+o.message+`
|
|
|
176
176
|
transform: translate(24px, 0);
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
`,n.classList.add("loading"),n.innerHTML="<div></div><div></div><div></div><div></div>",e.appendChild(r),e.appendChild(n)},yyt=function(t){var e=t.loadingTemplate,n=t.theme,r=n===void 0?"light":n,i=K.useRef(null);K.useEffect(function(){!e&&i.current&&gyt(i.current)},[]);var o=function(){return e||K.createElement("div",{ref:i})};return K.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())},myt=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)}}(),byt=function(t){myt(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||K.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):K.createElement(K.Fragment,null,this.props.children)},e}(K.Component),iR=typeof global=="object"&&global&&global.Object===Object&&global,xyt=typeof self=="object"&&self&&self.Object===Object&&self,wi=iR||xyt||Function("return this")(),ei=wi.Symbol,oR=Object.prototype,wyt=oR.hasOwnProperty,Oyt=oR.toString,Kd=ei?ei.toStringTag:void 0;function _yt(t){var e=wyt.call(t,Kd),n=t[Kd];try{t[Kd]=void 0;var r=!0}catch(o){}var i=Oyt.call(t);return r&&(e?t[Kd]=n:delete t[Kd]),i}var Syt=Object.prototype,Eyt=Syt.toString;function Myt(t){return Eyt.call(t)}var Pyt="[object Null]",Ayt="[object Undefined]",aR=ei?ei.toStringTag:void 0;function Ji(t){return t==null?t===void 0?Ayt:Pyt:aR&&aR in Object(t)?_yt(t):Myt(t)}function lr(t){return t!=null&&typeof t=="object"}var Cyt="[object Symbol]";function Zd(t){return typeof t=="symbol"||lr(t)&&Ji(t)==Cyt}var kyt=NaN;function sR(t){return typeof t=="number"?t:Zd(t)?kyt:+t}function Qg(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 Vt=Array.isArray,Tyt=1/0,lR=ei?ei.prototype:void 0,cR=lR?lR.toString:void 0;function Jg(t){if(typeof t=="string")return t;if(Vt(t))return Qg(t,Jg)+"";if(Zd(t))return cR?cR.call(t):"";var e=t+"";return e=="0"&&1/t==-Tyt?"-0":e}function Lyt(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=Jg(n),r=Jg(r)):(n=sR(n),r=sR(r)),i=t(n,r)}return i}}var Nyt=/\s/;function Iyt(t){for(var e=t.length;e--&&Nyt.test(t.charAt(e)););return e}var jyt=/^\s+/;function Dyt(t){return t&&t.slice(0,Iyt(t)+1).replace(jyt,"")}function Hn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var uR=NaN,Fyt=/^[-+]0x[0-9a-f]+$/i,$yt=/^0b[01]+$/i,Ryt=/^0o[0-7]+$/i,Byt=parseInt;function fR(t){if(typeof t=="number")return t;if(Zd(t))return uR;if(Hn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Hn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Dyt(t);var n=$yt.test(t);return n||Ryt.test(t)?Byt(t.slice(2),n?2:8):Fyt.test(t)?uR:+t}var dR=1/0,zyt=17976931348623157e292;function Yyt(t){if(!t)return t===0?t:0;if(t=fR(t),t===dR||t===-dR){var e=t<0?-1:1;return e*zyt}return t===t?t:0}function hR(t){var e=Yyt(t),n=e%1;return e===e?n?e-n:e:0}function w_(t){return t}var Wyt="[object AsyncFunction]",Gyt="[object Function]",Hyt="[object GeneratorFunction]",Uyt="[object Proxy]";function Vc(t){if(!Hn(t))return!1;var e=Ji(t);return e==Gyt||e==Hyt||e==Wyt||e==Uyt}var O_=wi["__core-js_shared__"],pR=function(){var t=/[^.]+$/.exec(O_&&O_.keys&&O_.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Vyt(t){return!!pR&&pR in t}var Xyt=Function.prototype,qyt=Xyt.toString;function Vs(t){if(t!=null){try{return qyt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var Kyt=/[\\^$.*+?()[\]{}|]/g,Zyt=/^\[object .+?Constructor\]$/,Qyt=Function.prototype,Jyt=Object.prototype,tmt=Qyt.toString,emt=Jyt.hasOwnProperty,nmt=RegExp("^"+tmt.call(emt).replace(Kyt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rmt(t){if(!Hn(t)||Vyt(t))return!1;var e=Vc(t)?nmt:Zyt;return e.test(Vs(t))}function imt(t,e){return t==null?void 0:t[e]}function Xs(t,e){var n=imt(t,e);return rmt(n)?n:void 0}var Qd=Xs(wi,"WeakMap"),vR=Qd&&new Qd,gR=Object.create,__=function(){function t(){}return function(e){if(!Hn(e))return{};if(gR)return gR(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function omt(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 S_(){}var amt=4294967295;function Xc(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=amt,this.__views__=[]}Xc.prototype=__(S_.prototype),Xc.prototype.constructor=Xc;function yR(){}var mR=vR?function(t){return vR.get(t)}:yR,bR={},smt=Object.prototype,lmt=smt.hasOwnProperty;function ty(t){for(var e=t.name+"",n=bR[e],r=lmt.call(bR,e)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==t)return i.name}return e}function za(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}za.prototype=__(S_.prototype),za.prototype.constructor=za;function E_(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function cmt(t){if(t instanceof Xc)return t.clone();var e=new za(t.__wrapped__,t.__chain__);return e.__actions__=E_(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var umt=Object.prototype,fmt=umt.hasOwnProperty;function ey(t){if(lr(t)&&!Vt(t)&&!(t instanceof Xc)){if(t instanceof za)return t;if(fmt.call(t,"__wrapped__"))return cmt(t)}return new za(t)}ey.prototype=S_.prototype,ey.prototype.constructor=ey;function xR(t){var e=ty(t),n=ey[e];if(typeof n!="function"||!(e in Xc.prototype))return!1;if(t===n)return!0;var r=mR(n);return!!r&&t===r[0]}var dmt=800,hmt=16,pmt=Date.now;function vmt(t){var e=0,n=0;return function(){var r=pmt(),i=hmt-(r-n);if(n=r,i>0){if(++e>=dmt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function gmt(t){return function(){return t}}var ny=function(){try{var t=Xs(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),ymt=ny?function(t,e){return ny(t,"toString",{configurable:!0,enumerable:!1,value:gmt(e),writable:!0})}:w_,wR=vmt(ymt);function mmt(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function bmt(t,e,n,r){for(var i=t.length,o=n+-1;++o<i;)if(e(t[o],o,t))return o;return-1}function xmt(t){return t!==t}function wmt(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function OR(t,e,n){return e===e?wmt(t,e,n):bmt(t,xmt,n)}function Omt(t,e){var n=t==null?0:t.length;return!!n&&OR(t,e,0)>-1}var _mt=9007199254740991,Smt=/^(?:0|[1-9]\d*)$/;function ry(t,e){var n=typeof t;return e=e==null?_mt:e,!!e&&(n=="number"||n!="symbol"&&Smt.test(t))&&t>-1&&t%1==0&&t<e}function iy(t,e,n){e=="__proto__"&&ny?ny(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Jd(t,e){return t===e||t!==t&&e!==e}var Emt=Object.prototype,Mmt=Emt.hasOwnProperty;function oy(t,e,n){var r=t[e];(!(Mmt.call(t,e)&&Jd(r,n))||n===void 0&&!(e in t))&&iy(t,e,n)}function qs(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=void 0;l===void 0&&(l=t[s]),i?iy(n,s,l):oy(n,s,l)}return n}var _R=Math.max;function SR(t,e,n){return e=_R(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=_R(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),omt(t,this,s)}}function Pmt(t,e){return wR(SR(t,e,w_),t+"")}var Amt=9007199254740991;function M_(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Amt}function Ya(t){return t!=null&&M_(t.length)&&!Vc(t)}function Cmt(t,e,n){if(!Hn(n))return!1;var r=typeof e;return(r=="number"?Ya(n)&&ry(e,n.length):r=="string"&&e in n)?Jd(n[e],t):!1}function ER(t){return Pmt(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&&Cmt(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 kmt=Object.prototype;function ay(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||kmt;return t===n}function Tmt(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Lmt="[object Arguments]";function MR(t){return lr(t)&&Ji(t)==Lmt}var PR=Object.prototype,Nmt=PR.hasOwnProperty,Imt=PR.propertyIsEnumerable,th=MR(function(){return arguments}())?MR:function(t){return lr(t)&&Nmt.call(t,"callee")&&!Imt.call(t,"callee")};function jmt(){return!1}var AR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,CR=AR&&typeof module=="object"&&module&&!module.nodeType&&module,Dmt=CR&&CR.exports===AR,kR=Dmt?wi.Buffer:void 0,Fmt=kR?kR.isBuffer:void 0,eh=Fmt||jmt,$mt="[object Arguments]",Rmt="[object Array]",Bmt="[object Boolean]",zmt="[object Date]",Ymt="[object Error]",Wmt="[object Function]",Gmt="[object Map]",Hmt="[object Number]",Umt="[object Object]",Vmt="[object RegExp]",Xmt="[object Set]",qmt="[object String]",Kmt="[object WeakMap]",Zmt="[object ArrayBuffer]",Qmt="[object DataView]",Jmt="[object Float32Array]",t1t="[object Float64Array]",e1t="[object Int8Array]",n1t="[object Int16Array]",r1t="[object Int32Array]",i1t="[object Uint8Array]",o1t="[object Uint8ClampedArray]",a1t="[object Uint16Array]",s1t="[object Uint32Array]",Ee={};Ee[Jmt]=Ee[t1t]=Ee[e1t]=Ee[n1t]=Ee[r1t]=Ee[i1t]=Ee[o1t]=Ee[a1t]=Ee[s1t]=!0,Ee[$mt]=Ee[Rmt]=Ee[Zmt]=Ee[Bmt]=Ee[Qmt]=Ee[zmt]=Ee[Ymt]=Ee[Wmt]=Ee[Gmt]=Ee[Hmt]=Ee[Umt]=Ee[Vmt]=Ee[Xmt]=Ee[qmt]=Ee[Kmt]=!1;function l1t(t){return lr(t)&&M_(t.length)&&!!Ee[Ji(t)]}function P_(t){return function(e){return t(e)}}var TR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,nh=TR&&typeof module=="object"&&module&&!module.nodeType&&module,c1t=nh&&nh.exports===TR,A_=c1t&&iR.process,qc=function(){try{var t=nh&&nh.require&&nh.require("util").types;return t||A_&&A_.binding&&A_.binding("util")}catch(e){}}(),LR=qc&&qc.isTypedArray,C_=LR?P_(LR):l1t,u1t=Object.prototype,f1t=u1t.hasOwnProperty;function NR(t,e){var n=Vt(t),r=!n&&th(t),i=!n&&!r&&eh(t),o=!n&&!r&&!i&&C_(t),a=n||r||i||o,s=a?Tmt(t.length,String):[],l=s.length;for(var c in t)(e||f1t.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ry(c,l)))&&s.push(c);return s}function IR(t,e){return function(n){return t(e(n))}}var d1t=IR(Object.keys,Object),h1t=Object.prototype,p1t=h1t.hasOwnProperty;function v1t(t){if(!ay(t))return d1t(t);var e=[];for(var n in Object(t))p1t.call(t,n)&&n!="constructor"&&e.push(n);return e}function Ks(t){return Ya(t)?NR(t):v1t(t)}var g1t=Object.prototype,y1t=g1t.hasOwnProperty,jR=ER(function(t,e){if(ay(e)||Ya(e)){qs(e,Ks(e),t);return}for(var n in e)y1t.call(e,n)&&oy(t,n,e[n])});function m1t(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var b1t=Object.prototype,x1t=b1t.hasOwnProperty;function w1t(t){if(!Hn(t))return m1t(t);var e=ay(t),n=[];for(var r in t)r=="constructor"&&(e||!x1t.call(t,r))||n.push(r);return n}function rh(t){return Ya(t)?NR(t,!0):w1t(t)}var O1t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_1t=/^\w*$/;function k_(t,e){if(Vt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Zd(t)?!0:_1t.test(t)||!O1t.test(t)||e!=null&&t in Object(e)}var ih=Xs(Object,"create");function S1t(){this.__data__=ih?ih(null):{},this.size=0}function E1t(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var M1t="__lodash_hash_undefined__",P1t=Object.prototype,A1t=P1t.hasOwnProperty;function C1t(t){var e=this.__data__;if(ih){var n=e[t];return n===M1t?void 0:n}return A1t.call(e,t)?e[t]:void 0}var k1t=Object.prototype,T1t=k1t.hasOwnProperty;function L1t(t){var e=this.__data__;return ih?e[t]!==void 0:T1t.call(e,t)}var N1t="__lodash_hash_undefined__";function I1t(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ih&&e===void 0?N1t:e,this}function Zs(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])}}Zs.prototype.clear=S1t,Zs.prototype.delete=E1t,Zs.prototype.get=C1t,Zs.prototype.has=L1t,Zs.prototype.set=I1t;function j1t(){this.__data__=[],this.size=0}function sy(t,e){for(var n=t.length;n--;)if(Jd(t[n][0],e))return n;return-1}var D1t=Array.prototype,F1t=D1t.splice;function $1t(t){var e=this.__data__,n=sy(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():F1t.call(e,n,1),--this.size,!0}function R1t(t){var e=this.__data__,n=sy(e,t);return n<0?void 0:e[n][1]}function B1t(t){return sy(this.__data__,t)>-1}function z1t(t,e){var n=this.__data__,r=sy(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Do(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])}}Do.prototype.clear=j1t,Do.prototype.delete=$1t,Do.prototype.get=R1t,Do.prototype.has=B1t,Do.prototype.set=z1t;var oh=Xs(wi,"Map");function Y1t(){this.size=0,this.__data__={hash:new Zs,map:new(oh||Do),string:new Zs}}function W1t(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ly(t,e){var n=t.__data__;return W1t(e)?n[typeof e=="string"?"string":"hash"]:n.map}function G1t(t){var e=ly(this,t).delete(t);return this.size-=e?1:0,e}function H1t(t){return ly(this,t).get(t)}function U1t(t){return ly(this,t).has(t)}function V1t(t,e){var n=ly(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Fo(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])}}Fo.prototype.clear=Y1t,Fo.prototype.delete=G1t,Fo.prototype.get=H1t,Fo.prototype.has=U1t,Fo.prototype.set=V1t;var X1t="Expected a function";function T_(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(X1t);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(T_.Cache||Fo),n}T_.Cache=Fo;var q1t=500;function K1t(t){var e=T_(t,function(r){return n.size===q1t&&n.clear(),r}),n=e.cache;return e}var Z1t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q1t=/\\(\\)?/g,J1t=K1t(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Z1t,function(n,r,i,o){e.push(i?o.replace(Q1t,"$1"):r||n)}),e});function L_(t){return t==null?"":Jg(t)}function Kc(t,e){return Vt(t)?t:k_(t,e)?[t]:J1t(L_(t))}var tbt=1/0;function Zc(t){if(typeof t=="string"||Zd(t))return t;var e=t+"";return e=="0"&&1/t==-tbt?"-0":e}function cy(t,e){e=Kc(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Zc(e[n++])];return n&&n==r?t:void 0}function ge(t,e,n){var r=t==null?void 0:cy(t,e);return r===void 0?n:r}function N_(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var DR=ei?ei.isConcatSpreadable:void 0;function ebt(t){return Vt(t)||th(t)||!!(DR&&t&&t[DR])}function nbt(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=ebt),i||(i=[]);++o<a;){var s=t[o];n(s)?N_(i,s):i[i.length]=s}return i}function rbt(t){var e=t==null?0:t.length;return e?nbt(t):[]}function I_(t){return wR(SR(t,void 0,rbt),t+"")}var j_=IR(Object.getPrototypeOf,Object),ibt="[object Object]",obt=Function.prototype,abt=Object.prototype,FR=obt.toString,sbt=abt.hasOwnProperty,lbt=FR.call(Object);function D_(t){if(!lr(t)||Ji(t)!=ibt)return!1;var e=j_(t);if(e===null)return!0;var n=sbt.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&FR.call(n)==lbt}function cbt(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 ubt=wi.isFinite,fbt=Math.min;function dbt(t){var e=Math[t];return function(n,r){if(n=fR(n),r=r==null?0:fbt(hR(r),292),r&&ubt(n)){var i=(L_(n)+"e").split("e"),o=e(i[0]+"e"+(+i[1]+r));return i=(L_(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return e(n)}}var hbt=dbt("ceil");function pbt(){this.__data__=new Do,this.size=0}function vbt(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function gbt(t){return this.__data__.get(t)}function ybt(t){return this.__data__.has(t)}var mbt=200;function bbt(t,e){var n=this.__data__;if(n instanceof Do){var r=n.__data__;if(!oh||r.length<mbt-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Fo(r)}return n.set(t,e),this.size=n.size,this}function Oi(t){var e=this.__data__=new Do(t);this.size=e.size}Oi.prototype.clear=pbt,Oi.prototype.delete=vbt,Oi.prototype.get=gbt,Oi.prototype.has=ybt,Oi.prototype.set=bbt;function xbt(t,e){return t&&qs(e,Ks(e),t)}function wbt(t,e){return t&&qs(e,rh(e),t)}var $R=typeof ct=="object"&&ct&&!ct.nodeType&&ct,RR=$R&&typeof module=="object"&&module&&!module.nodeType&&module,Obt=RR&&RR.exports===$R,BR=Obt?wi.Buffer:void 0,zR=BR?BR.allocUnsafe:void 0;function YR(t,e){if(e)return t.slice();var n=t.length,r=zR?zR(n):new t.constructor(n);return t.copy(r),r}function _bt(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 WR(){return[]}var Sbt=Object.prototype,Ebt=Sbt.propertyIsEnumerable,GR=Object.getOwnPropertySymbols,F_=GR?function(t){return t==null?[]:(t=Object(t),_bt(GR(t),function(e){return Ebt.call(t,e)}))}:WR;function Mbt(t,e){return qs(t,F_(t),e)}var Pbt=Object.getOwnPropertySymbols,HR=Pbt?function(t){for(var e=[];t;)N_(e,F_(t)),t=j_(t);return e}:WR;function Abt(t,e){return qs(t,HR(t),e)}function UR(t,e,n){var r=e(t);return Vt(t)?r:N_(r,n(t))}function $_(t){return UR(t,Ks,F_)}function VR(t){return UR(t,rh,HR)}var R_=Xs(wi,"DataView"),B_=Xs(wi,"Promise"),Qc=Xs(wi,"Set"),XR="[object Map]",Cbt="[object Object]",qR="[object Promise]",KR="[object Set]",ZR="[object WeakMap]",QR="[object DataView]",kbt=Vs(R_),Tbt=Vs(oh),Lbt=Vs(B_),Nbt=Vs(Qc),Ibt=Vs(Qd),_i=Ji;(R_&&_i(new R_(new ArrayBuffer(1)))!=QR||oh&&_i(new oh)!=XR||B_&&_i(B_.resolve())!=qR||Qc&&_i(new Qc)!=KR||Qd&&_i(new Qd)!=ZR)&&(_i=function(t){var e=Ji(t),n=e==Cbt?t.constructor:void 0,r=n?Vs(n):"";if(r)switch(r){case kbt:return QR;case Tbt:return XR;case Lbt:return qR;case Nbt:return KR;case Ibt:return ZR}return e});var jbt=Object.prototype,Dbt=jbt.hasOwnProperty;function Fbt(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&Dbt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var uy=wi.Uint8Array;function z_(t){var e=new t.constructor(t.byteLength);return new uy(e).set(new uy(t)),e}function $bt(t,e){var n=e?z_(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var Rbt=/\w*$/;function Bbt(t){var e=new t.constructor(t.source,Rbt.exec(t));return e.lastIndex=t.lastIndex,e}var JR=ei?ei.prototype:void 0,t9=JR?JR.valueOf:void 0;function zbt(t){return t9?Object(t9.call(t)):{}}function e9(t,e){var n=e?z_(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var Ybt="[object Boolean]",Wbt="[object Date]",Gbt="[object Map]",Hbt="[object Number]",Ubt="[object RegExp]",Vbt="[object Set]",Xbt="[object String]",qbt="[object Symbol]",Kbt="[object ArrayBuffer]",Zbt="[object DataView]",Qbt="[object Float32Array]",Jbt="[object Float64Array]",txt="[object Int8Array]",ext="[object Int16Array]",nxt="[object Int32Array]",rxt="[object Uint8Array]",ixt="[object Uint8ClampedArray]",oxt="[object Uint16Array]",axt="[object Uint32Array]";function sxt(t,e,n){var r=t.constructor;switch(e){case Kbt:return z_(t);case Ybt:case Wbt:return new r(+t);case Zbt:return $bt(t,n);case Qbt:case Jbt:case txt:case ext:case nxt:case rxt:case ixt:case oxt:case axt:return e9(t,n);case Gbt:return new r;case Hbt:case Xbt:return new r(t);case Ubt:return Bbt(t);case Vbt:return new r;case qbt:return zbt(t)}}function n9(t){return typeof t.constructor=="function"&&!ay(t)?__(j_(t)):{}}var lxt="[object Map]";function cxt(t){return lr(t)&&_i(t)==lxt}var r9=qc&&qc.isMap,uxt=r9?P_(r9):cxt,fxt="[object Set]";function dxt(t){return lr(t)&&_i(t)==fxt}var i9=qc&&qc.isSet,hxt=i9?P_(i9):dxt,pxt=1,vxt=2,gxt=4,o9="[object Arguments]",yxt="[object Array]",mxt="[object Boolean]",bxt="[object Date]",xxt="[object Error]",a9="[object Function]",wxt="[object GeneratorFunction]",Oxt="[object Map]",_xt="[object Number]",s9="[object Object]",Sxt="[object RegExp]",Ext="[object Set]",Mxt="[object String]",Pxt="[object Symbol]",Axt="[object WeakMap]",Cxt="[object ArrayBuffer]",kxt="[object DataView]",Txt="[object Float32Array]",Lxt="[object Float64Array]",Nxt="[object Int8Array]",Ixt="[object Int16Array]",jxt="[object Int32Array]",Dxt="[object Uint8Array]",Fxt="[object Uint8ClampedArray]",$xt="[object Uint16Array]",Rxt="[object Uint32Array]",ye={};ye[o9]=ye[yxt]=ye[Cxt]=ye[kxt]=ye[mxt]=ye[bxt]=ye[Txt]=ye[Lxt]=ye[Nxt]=ye[Ixt]=ye[jxt]=ye[Oxt]=ye[_xt]=ye[s9]=ye[Sxt]=ye[Ext]=ye[Mxt]=ye[Pxt]=ye[Dxt]=ye[Fxt]=ye[$xt]=ye[Rxt]=!0,ye[xxt]=ye[a9]=ye[Axt]=!1;function ah(t,e,n,r,i,o){var a,s=e&pxt,l=e&vxt,c=e&gxt;if(n&&(a=i?n(t,r,i,o):n(t)),a!==void 0)return a;if(!Hn(t))return t;var u=Vt(t);if(u){if(a=Fbt(t),!s)return E_(t,a)}else{var f=_i(t),d=f==a9||f==wxt;if(eh(t))return YR(t,s);if(f==s9||f==o9||d&&!i){if(a=l||d?{}:n9(t),!s)return l?Abt(t,wbt(a,t)):Mbt(t,xbt(a,t))}else{if(!ye[f])return i?t:{};a=sxt(t,f,s)}}o||(o=new Oi);var h=o.get(t);if(h)return h;o.set(t,a),hxt(t)?t.forEach(function(g){a.add(ah(g,e,n,g,t,o))}):uxt(t)&&t.forEach(function(g,y){a.set(y,ah(g,e,n,y,t,o))});var p=c?l?VR:$_:l?rh:Ks,v=u?void 0:p(t);return mmt(v||t,function(g,y){v&&(y=g,g=t[y]),oy(a,y,ah(g,e,n,y,t,o))}),a}var Bxt=1,zxt=4;function l9(t){return ah(t,Bxt|zxt)}var Yxt="__lodash_hash_undefined__";function Wxt(t){return this.__data__.set(t,Yxt),this}function Gxt(t){return this.__data__.has(t)}function sh(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Fo;++e<n;)this.add(t[e])}sh.prototype.add=sh.prototype.push=Wxt,sh.prototype.has=Gxt;function Hxt(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 c9(t,e){return t.has(e)}var Uxt=1,Vxt=2;function u9(t,e,n,r,i,o){var a=n&Uxt,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&Vxt?new sh: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(!Hxt(e,function(y,m){if(!c9(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 Xxt(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Y_(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var qxt=1,Kxt=2,Zxt="[object Boolean]",Qxt="[object Date]",Jxt="[object Error]",t2t="[object Map]",e2t="[object Number]",n2t="[object RegExp]",r2t="[object Set]",i2t="[object String]",o2t="[object Symbol]",a2t="[object ArrayBuffer]",s2t="[object DataView]",f9=ei?ei.prototype:void 0,W_=f9?f9.valueOf:void 0;function l2t(t,e,n,r,i,o,a){switch(n){case s2t:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case a2t:return!(t.byteLength!=e.byteLength||!o(new uy(t),new uy(e)));case Zxt:case Qxt:case e2t:return Jd(+t,+e);case Jxt:return t.name==e.name&&t.message==e.message;case n2t:case i2t:return t==e+"";case t2t:var s=Xxt;case r2t:var l=r&qxt;if(s||(s=Y_),t.size!=e.size&&!l)return!1;var c=a.get(t);if(c)return c==e;r|=Kxt,a.set(t,e);var u=u9(s(t),s(e),r,i,o,a);return a.delete(t),u;case o2t:if(W_)return W_.call(t)==W_.call(e)}return!1}var c2t=1,u2t=Object.prototype,f2t=u2t.hasOwnProperty;function d2t(t,e,n,r,i,o){var a=n&c2t,s=$_(t),l=s.length,c=$_(e),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in e:f2t.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 h2t=1,d9="[object Arguments]",h9="[object Array]",fy="[object Object]",p2t=Object.prototype,p9=p2t.hasOwnProperty;function v2t(t,e,n,r,i,o){var a=Vt(t),s=Vt(e),l=a?h9:_i(t),c=s?h9:_i(e);l=l==d9?fy:l,c=c==d9?fy:c;var u=l==fy,f=c==fy,d=l==c;if(d&&eh(t)){if(!eh(e))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new Oi),a||C_(t)?u9(t,e,n,r,i,o):l2t(t,e,l,n,r,i,o);if(!(n&h2t)){var h=u&&p9.call(t,"__wrapped__"),p=f&&p9.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),d2t(t,e,n,r,i,o)):!1}function dy(t,e,n,r,i){return t===e?!0:t==null||e==null||!lr(t)&&!lr(e)?t!==t&&e!==e:v2t(t,e,n,r,dy,i)}var g2t=1,y2t=2;function m2t(t,e,n,r){var i=n.length,o=i;if(t==null)return!o;for(t=Object(t);i--;){var a=n[i];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=n[i];var s=a[0],l=t[s],c=a[1];if(a[2]){if(l===void 0&&!(s in t))return!1}else{var u=new Oi,f;if(!(f===void 0?dy(c,l,g2t|y2t,r,u):f))return!1}}return!0}function v9(t){return t===t&&!Hn(t)}function b2t(t){for(var e=Ks(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,v9(i)]}return e}function g9(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function x2t(t){var e=b2t(t);return e.length==1&&e[0][2]?g9(e[0][0],e[0][1]):function(n){return n===t||m2t(n,t,e)}}function w2t(t,e){return t!=null&&e in Object(t)}function O2t(t,e,n){e=Kc(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var a=Zc(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&&M_(i)&&ry(a,i)&&(Vt(t)||th(t)))}function y9(t,e){return t!=null&&O2t(t,e,w2t)}var _2t=1,S2t=2;function E2t(t,e){return k_(t)&&v9(e)?g9(Zc(t),e):function(n){var r=ge(n,t);return r===void 0&&r===e?y9(n,t):dy(e,r,_2t|S2t)}}function M2t(t){return function(e){return e==null?void 0:e[t]}}function P2t(t){return function(e){return cy(e,t)}}function A2t(t){return k_(t)?M2t(Zc(t)):P2t(t)}function G_(t){return typeof t=="function"?t:t==null?w_:typeof t=="object"?Vt(t)?E2t(t[0],t[1]):x2t(t):A2t(t)}function C2t(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 k2t(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[++i];if(n(o[l],l,o)===!1)break}return e}}var m9=k2t();function T2t(t,e){return t&&m9(t,e,Ks)}function L2t(t,e){return function(n,r){if(n==null)return n;if(!Ya(n))return t(n,r);for(var i=n.length,o=-1,a=Object(n);++o<i&&r(a[o],o,a)!==!1;);return n}}var b9=L2t(T2t);function N2t(t,e,n,r){return b9(t,function(i,o,a){e(r,i,n(i),a)}),r}function I2t(t,e){return function(n,r){var i=Vt(n)?C2t:N2t,o=e?e():{};return i(n,t,G_(r),o)}}function H_(t,e,n){(n!==void 0&&!Jd(t[e],n)||n===void 0&&!(e in t))&&iy(t,e,n)}function j2t(t){return lr(t)&&Ya(t)}function U_(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function D2t(t){return qs(t,rh(t))}function F2t(t,e,n,r,i,o,a){var s=U_(t,n),l=U_(e,n),c=a.get(l);if(c){H_(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&&eh(l),p=!d&&!h&&C_(l);u=l,d||h||p?Vt(s)?u=s:j2t(s)?u=E_(s):h?(f=!1,u=YR(l,!0)):p?(f=!1,u=e9(l,!0)):u=[]:D_(l)||th(l)?(u=s,th(s)?u=D2t(s):(!Hn(s)||Vc(s))&&(u=n9(l))):f=!1}f&&(a.set(l,u),i(u,l,r,o,a),a.delete(l)),H_(t,n,u)}function x9(t,e,n,r,i){t!==e&&m9(e,function(o,a){if(i||(i=new Oi),Hn(o))F2t(t,e,a,n,x9,r,i);else{var s=r?r(U_(t,a),o,a+"",t,e,i):void 0;s===void 0&&(s=o),H_(t,a,s)}},rh)}var $2t=ER(function(t,e,n,r){x9(t,e,n,r)});function R2t(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var B2t=Lyt(function(t,e){return t/e},1);function z2t(t,e){var n=-1,r=Ya(t)?Array(t.length):[];return b9(t,function(i,o,a){r[++n]=e(i,o,a)}),r}function Jc(t,e){var n=Vt(t)?Qg:z2t;return n(t,G_(e))}var Y2t="Expected a function",W2t=8,G2t=32,H2t=128,U2t=256;function V2t(t){return I_(function(e){for(var n=e.length,r=n,i=za.prototype.thru;r--;){var o=e[r];if(typeof o!="function")throw new TypeError(Y2t);if(i&&!a&&ty(o)=="wrapper")var a=new za([],!0)}for(r=a?r:n;++r<n;){o=e[r];var s=ty(o),l=s=="wrapper"?mR(o):void 0;l&&xR(l[0])&&l[1]==(H2t|W2t|G2t|U2t)&&!l[4].length&&l[9]==1?a=a[ty(l[0])].apply(a,l[3]):a=o.length==1&&xR(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 zt=V2t(),X2t=Object.prototype,q2t=X2t.hasOwnProperty,w9=I2t(function(t,e,n){q2t.call(t,n)?t[n].push(e):iy(t,n,[e])}),K2t="[object String]";function O9(t){return typeof t=="string"||!Vt(t)&&lr(t)&&Ji(t)==K2t}function Z2t(t,e){return Qg(e,function(n){return t[n]})}function Q2t(t){return t==null?[]:Z2t(t,Ks(t))}var J2t=Math.max;function twt(t,e,n,r){t=Ya(t)?t:Q2t(t),n=n&&!r?hR(n):0;var i=t.length;return n<0&&(n=J2t(i+n,0)),O9(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&OR(t,e,n)>-1}function ewt(t,e){return e.length<2?t:cy(t,cbt(e,0,-1))}var nwt="[object Boolean]";function V_(t){return t===!0||t===!1||lr(t)&&Ji(t)==nwt}function _9(t,e){return dy(t,e)}var rwt="[object Number]";function tu(t){return typeof t=="number"||lr(t)&&Ji(t)==rwt}function iwt(t){return t==null}function owt(t){return t===void 0}function awt(t,e){return e=Kc(e,t),t=ewt(t,e),t==null||delete t[Zc(R2t(e))]}function swt(t){return D_(t)?void 0:t}var lwt=1,cwt=2,uwt=4,X_=I_(function(t,e){var n={};if(t==null)return n;var r=!1;e=Qg(e,function(o){return o=Kc(o,t),r||(r=o.length>1),o}),qs(t,VR(t),n),r&&(n=ah(n,lwt|cwt|uwt,swt));for(var i=e.length;i--;)awt(n,e[i]);return n});function S9(t,e,n,r){if(!Hn(t))return t;e=Kc(e,t);for(var i=-1,o=e.length,a=o-1,s=t;s!=null&&++i<o;){var l=Zc(e[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var u=s[l];c=void 0,c===void 0&&(c=Hn(u)?u:ry(e[i+1])?[]:{})}oy(s,l,c),s=s[l]}return t}function fwt(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=cy(t,a);n(s,a)&&S9(o,Kc(a,t),s)}return o}function dwt(t,e){return fwt(t,e,function(n,r){return y9(t,r)})}var E9=I_(function(t,e){return t==null?{}:dwt(t,e)});function pt(t,e,n){return t==null?t:S9(t,e,n)}var hwt=1/0,pwt=Qc&&1/Y_(new Qc([,-0]))[1]==hwt?function(t){return new Qc(t)}:yR,vwt=200;function gwt(t,e,n){var r=-1,i=Omt,o=t.length,a=!0,s=[],l=s;if(o>=vwt){var c=e?null:pwt(t);if(c)return Y_(c);a=!1,i=c9,l=new sh}else l=e?[]:s;t:for(;++r<o;){var u=t[r],f=e?e(u):u;if(u=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 q_(t,e){return t&&t.length?gwt(t,G_(e)):[]}var ywt=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)},K_=function(){return K_=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},K_.apply(this,arguments)},M9=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 mwt(t,e){var n=K.useRef(),r=K.useRef(),i=K.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),Vc(v)&&ywt("".concat(v))?u[p]=function(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];return vyt(v.apply(void 0,g),h)}:Vt(v)?v.forEach(function(g){c(g,h)}):Hn(v)?c(v,h):h=f})};return K.useEffect(function(){if(n.current&&!_9(r.current,e)){var u=!1;if(r.current){var f=r.current;f.data;var d=M9(f,["data"]);e.data;var h=M9(e,["data"]);u=_9(d,h)}r.current=l9(e),u?n.current.changeData(ge(e,"data")):(c(e),n.current.update(e),n.current.render())}},[e]),K.useEffect(function(){if(!i.current)return function(){return null};r.current||(r.current=l9(e)),c(e);var u=new t(i.current,K_({},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 P9=function(t){return t!==null&&typeof t!="function"&&isFinite(t.length)},bwt=function(t,e){if(!P9(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 xwt=function(t){return typeof t=="function"};var wwt=function(t){return t==null},Owt={}.toString,Z_=function(t,e){return Owt.call(t)==="[object "+e+"]"};const eu=function(t){return Array.isArray?Array.isArray(t):Z_(t,"Array")},_wt=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function Q_(t,e){if(t){var n;if(eu(t))for(var r=0,i=t.length;r<i&&(n=e(t[r],r),n!==!1);r++);else if(_wt(t)){for(var o in t)if(t.hasOwnProperty(o)&&(n=e(t[o],o),n===!1))break}}}var Swt=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return Q_(t,function(n,r){xwt(t)&&r==="prototype"||e.push(r)}),e},Ewt=function(t){return typeof t=="object"&&t!==null},hy=function(t){if(!Ewt(t)||!Z_(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},Mwt=function(t,e,n){if(!eu(t)&&!hy(t))return t;var r=n;return Q_(t,function(i,o){r=e(r,i,o)}),r};const J_=function(t){return Z_(t,"String")};function A9(t,e){for(var n in e)e.hasOwnProperty(n)&&n!=="constructor"&&e[n]!==void 0&&(t[n]=e[n])}function Pwt(t,e,n,r){return e&&A9(t,e),n&&A9(t,n),t}var Awt=5;function Cwt(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 C9(t,e,n,r){n=n||0,r=r||Awt;for(var i in e)if(Cwt(e,i)){var o=e[i];o!==null&&hy(o)?(hy(t[i])||(t[i]={}),n<r?C9(t[i],o,n+1,r):t[i]=e[i]):eu(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var py=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)C9(t,e[r]);return t};const to=function(t,e,n){for(var r=0,i=J_(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return t===void 0||r<i.length?n:t};var kwt=Object.prototype.hasOwnProperty;const k9=function(t,e){if(t===null||!hy(t))return{};var n={};return Q_(e,function(r){kwt.call(t,r)&&(n[r]=t[r])}),n};function Twt(t){return wwt(t)?0:P9(t)?t.length:Object.keys(t).length}const Lwt={field:"value",size:[1,1],round:!1,padding:0,sort:(t,e)=>e.value-t.value,as:["x","y"],ignoreParentValue:!0},Nwt="nodeIndex",lh="childNodeCount",Iwt="nodeAncestor",tS="Invalid field: it must be a string!";function jwt(t,e){const{field:n,fields:r}=t;if(J_(n))return n;if(eu(n))return console.warn(tS),n[0];if(console.warn(`${tS} will try to get fields instead.`),J_(r))return r;if(eu(r)&&r.length)return r[0];throw new TypeError(tS)}function Dwt(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=bwt((((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[Iwt]=s,i[lh]=((a=i.children)===null||a===void 0?void 0:a.length)||0,i[Nwt]=r,e.push(i)})}else t&&t.eachNode&&t.eachNode(n=>{e.push(n)});return e}function Fwt(t,e){e=Pwt({},Lwt,e);const n=e.as;if(!eu(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=jwt(e)}catch(l){console.warn(l)}const o=(l=>Mnt().size(e.size).round(e.round).padding(e.padding)(Wl(l).sum(c=>Twt(c.children)?e.ignoreParentValue?0:c[r]-Mwt(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]})}),Dwt(o)}var $wt=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 nu="sunburst",eS="markType",T9="path",vy="ancestor-node";function Rwt(t){const{data:e,encode:n}=t,{color:r,value:i}=n,a=Fwt(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({},k9(l.data,[i])),{[T9]:h,[vy]:v.data.name}),l);r&&r!==vy&&(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 L9={id:nu,encode:{x:"x",y:"y",key:T9,color:vy,value:"value"},axis:{x:!1,y:!1},style:{[eS]:nu,stroke:"#fff",lineWidth:.5,fillOpacity:"fillOpacity",[lh]:lh,depth:"depth"},state:{active:{zIndex:2,stroke:"#000"},inactive:{zIndex:1,stroke:"#fff"}},legend:!1,interaction:{drillDown:!0},coordinate:{type:"polar",innerRadius:.2}},N9=t=>{const{encode:e,data:n=[],legend:r}=t,i=$wt(t,["encode","data","legend"]),o=Object.assign(Object.assign({},i.coordinate),{innerRadius:Math.max(to(i,["coordinate","innerRadius"],.2),1e-5)}),a=Object.assign(Object.assign({},L9.encode),e),{value:s}=a,l=Rwt({encode:a,data:n});return[py({},L9,Object.assign(Object.assign({type:"rect",data:l,encode:a,tooltip:{title:"path",items:[c=>({name:s,value:c[s]})]}},i),{coordinate:o}))]};N9.props={};var Bwt=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 zwt=t=>t.querySelectorAll(".element").filter(e=>to(e,["style",eS])===nu);function Ywt(t){return gt(t).select(`.${jf}`).node()}const Wwt={rootText:"root",style:{fill:"rgba(0, 0, 0, 0.85)",fontSize:12,y:1},active:{fill:"rgba(0, 0, 0, 0.5)"}};function Gwt(t={}){const{breadCrumb:e={},fixedColor:n=!0}=t,r=py({},Wwt,e);return i=>{const{update:o,setState:a,container:s,view:l,options:c}=i,u=Ywt(s),f=c.marks.find(({id:m})=>m===nu),{state:d}=f,h=new sn;u.appendChild(h);const p=(m,b)=>Bwt(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,k)=>{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 C=new jr({name:w.replace(/\s\/\s$/,""),style:Object.assign(Object.assign({text:P,x:S,depth:k+1},r.style),{y:_})});return h.appendChild(C),S+=C.getBBox().width,S>E&&(_=h.getBBox().height,S=0,A.attr({x:S,y:_}),S+=A.getBBox().width,C.attr({x:S,y:_}),S+=C.getBBox().width),C});[x,...M].forEach((P,k)=>{if(k===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,to(P,["style","depth"]))})})}a("drillDown",x=>{const{marks:w}=x,O=w.map(_=>{if(_.id!==nu&&_.type!=="rect")return _;const{data:S}=_,E=Object.fromEntries(["color"].map(P=>[P,{domain:l.scale[P].getOptions().domain}])),M=S.filter(P=>{const k=P.path;return n&&(P[vy]=k.split(" / ")[b]),m?new RegExp(`^${m}.+`).test(k):!0});return py({},_,n?{data:M}:{data:M,scale:E})});return Object.assign(Object.assign({},x),{marks:O})}),yield o()}),v=m=>{const b=m.target;if(to(b,["style",eS])!==nu||to(b,["markType"])!=="rect"||!to(b,["style",lh]))return;const x=to(b,["__data__","key"]),w=to(b,["style","depth"]);b.style.cursor="pointer",p(x,w)};u.addEventListener("click",v);const g=Swt(Object.assign(Object.assign({},d.active),d.inactive)),y=()=>{zwt(u).forEach(b=>{const x=to(b,["style",lh]);if(to(b,["style","cursor"])!=="pointer"&&x){b.style.cursor="pointer";const O=k9(b.attributes,g);b.addEventListener("mouseenter",()=>{b.attr(d.active)}),b.addEventListener("mouseleave",()=>{b.attr(py(O,d.inactive))})}})};return u.addEventListener("mousemove",y),()=>{h.remove(),u.removeEventListener("click",v),u.removeEventListener("mousemove",y)}}}U.enableCSSParsing=!1;function Hwt(){return{"interaction.drillDown":Gwt,"mark.sunburst":N9}}var gy=function(){return gy=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},gy.apply(this,arguments)},Uwt=k0t(ivt,gy(gy({},DF()),Hwt())),Xt=function(t){var e=Xwt(t),n=e.children,r=n===void 0?[]:n,i=X_(e,[].concat(D9,yy.map(function(c){return c.key}))),o=function(c){var u;return(u=Jwt.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]=Wa({},c[u],f)},s=function(c){Object.keys(c).forEach(function(u){var f=yy.find(function(p){return p.key===u});if(f){var d=f.type,h=f.extend_keys;d?r.push(l(Wa({},E9(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(rS).forEach(function(u){var f=rS[u];if(!owt(c[u]))if(Hn(f)){var d=f.value,h=f.target,p=d(c[u]);a(c,h,p)}else pt(c,f,c[u])}),c};return r.forEach(function(c){var u=Wa({},i,c);l(Wa(c,u))}),s(e),Vwt(e),t},I9=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))},Vwt=function(t){var e=t.children,n=e===void 0?[]:e,r=Object.keys(rS).concat(yy.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){I9(I9([],D9,!0),oS.map(function(o){return o.key}),!0).includes(i)||delete t[i]}),t},Xwt=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[nS]}))})}),e},j9=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))},qwt=function(t,e){if(Vt(e))return e},Wa=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return $2t.apply(void 0,j9(j9([],t,!1),[qwt],!1))},ch=function(){return ch=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},ch.apply(this,arguments)},Kwt=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},Zwt=["renderer"],D9=["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"],nS="__transform__",Qwt="__skipDelCustomKeys__",Qs=function(t,e){return V_(e)?{type:t,available:e}:ch({type:t},e)},rS={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 Qs("stackY",t)}},normalize:{target:"transform",value:function(t){return Qs("normalizeY",t)}},percent:{target:"transform",value:function(t){return Qs("normalizeY",t)}},group:{target:"transform",value:function(t){return Qs("dodgeX",t)}},sort:{target:"transform",value:function(t){return Qs("sortX",t)}},symmetry:{target:"transform",value:function(t){return Qs("symmetryY",t)}},diff:{target:"transform",value:function(t){return Qs("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 V_(t)?{connect:t}:t}}},iS=["xField","yField","seriesField","colorField","keyField","positionField","meta","tooltip","animate","stack","normalize","percent","group","sort","symmetry","diff"],yy=[{key:"annotations",extend_keys:[]},{key:"line",type:"line",extend_keys:iS},{key:"point",type:"point",extend_keys:iS},{key:"area",type:"area",extend_keys:iS}],Jwt=[{key:"transform",callback:function(t,e,n){var r;t[e]=t[e]||[];var i=n.available,o=i===void 0?!0:i,a=Kwt(n,["available"]);o?t[e].push(ch((r={},r[nS]=!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(ch((r={},r[nS]=!0,r),n))}}],oS=[{key:"conversionTag",shape:"ConversionTag"},{key:"axisText",shape:"BidirectionalBarAxisText"}],tOt=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)},eOt=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},F9=function(t){tOt(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=eOt(n,["style"]);return t.call(this,my({style:my({text:"",fontSize:12,textBaseline:"middle",textAlign:"center",fill:"#000",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1},r)},i))||this}return e}(jr),nOt=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)},rOt=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},iOt=function(t){nOt(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=rOt(n,["style"]);return t.call(this,by({style:by({fill:"#eee"},r)},i))||this}return e}(af),oOt=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)}}(),$9=function(t){oOt(e,t);function e(n,r,i){var o=t.call(this,{style:Wa(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(Wa({},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}(_p),aOt=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)}}(),xy=function(){return xy=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},xy.apply(this,arguments)},sOt=function(t){aOt(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=ge(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,k=w.key,A=ge(P,u),C=g/2;if(n){var T=_+M/2,N=S;h.push({points:[[T+C,N-d+x],[T+C,N-m-x],[T,N-x],[T-C,N-m-x],[T-C,N-d+x]],center:[T,N-d/2-x],width:d,value:[f,A],key:k})}else{var T=_,N=S+E/2;h.push({points:[[_-d+x,N-C],[_-m-x,N-C],[T-x,N],[_-m-x,N+C],[_-d+x,N+C]],center:[T-d/2-x,N],width:d,value:[f,A],key:k})}f=A}}),h},e.prototype.render=function(){this.setDirection(),this.drawConversionTag()},e.prototype.setDirection=function(){var n=this.chart.getCoordinate(),r=ge(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 iOt({style:xy({points:u,fill:"#eee"},o),id:"polygon-".concat(h)}),b=new F9({style:xy({x:g,y,text:Vc(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}($9),aS=32,R9=16,B9=48,lOt=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)}}(),uh=function(){return uh=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},uh.apply(this,arguments)},cOt=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},uOt=function(t){lOt(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?q_(i,"x"):q_(i,"y"),a=["title"],s=[],l=this.chart.getContext().views,c=ge(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=ge(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})}),q_(s,"text").length!==s.length&&(s=Object.values(w9(s,"text")).map(function(d){var h,p=d.reduce(function(v,g){return v+(r?g.x:g.y)},0);return uh(uh({},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=cOt(i,["layout","labelFormatter"]);r.forEach(function(l){var c=l.x,u=l.y,f=l.text,d=l.key,h=new F9({style:uh({x:c,y:u,text:Vc(a)?a(f):f,wordWrap:!0,wordWrapWidth:o==="horizontal"?aS*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}($9),fOt={ConversionTag:sOt,BidirectionalBarAxisText:uOt},dOt=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;oS.forEach(function(n){var r,i=n.key,o=n.shape,a=e.config[i];if(a){var s=new fOt[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&&oS.forEach(function(n){var r=n.key,i=e.container.get(r);i==null||i.update()})},t}(),hOt=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)}}(),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)},z9="data-chart-source-type",Rt=function(t){hOt(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 ru(ru({},E9(this.options,Zwt)),{container:this.container})},e.prototype.getSpecOptions=function(){return this.type==="base"||this[Qwt]?ru(ru({},this.options),this.getChartOptions()):this.options},e.prototype.createG2=function(){if(!this.container)throw Error("The container is not initialized!");this.chart=new Uwt(this.getChartOptions()),this.container.setAttribute(z9,"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 dOt(n.chart,n.options)}),this.bindSizeSensor()},e.prototype.update=function(n){this.options=this.mergeOption(n)},e.prototype.mergeOption=function(n){return Wa({},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(z9)},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}(Mx),pOt=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)}}(),vOt=function(t){pOt(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),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)};function gOt(t){var e=t.options,n=e.stack,r=e.tooltip,i=e.xField;if(!n)return t;var o=yy.map(function(s){return s.type}).filter(function(s){return!!s}),a=!1;return o.forEach(function(s){e[s]&&(a=!0,pt(e,[s,"stack"],sS({y1:"y"},typeof n=="object"?n:{})))}),a&&!V_(r)&&!r&&pt(e,"tooltip",{title:i,items:[{channel:"y"}]}),t}function $e(t){return zt(gOt)(t)}function yOt(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 mOt(t){yOt(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 bOt(t){return zt($e,Xt)(t)}var xOt=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)}}(),wOt=function(t){xOt(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 bOt},e}(Rt),iu=function(){return iu=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},iu.apply(this,arguments)};function Y9(t){var e=function(n){var r=n.options;ge(r,"children.length")>1&&pt(r,"children",[{type:"interval"}]);var i=r.scale,o=r.markBackground,a=r.data,s=r.children,l=r.yField,c=ge(i,"y.domain",[]);if(o&&c.length&&Vt(a)){var u="domainMax",f=a.map(function(d){var h;return iu(iu({originData:iu({},d)},X_(d,l)),(h={},h[u]=c[c.length-1],h))});s.unshift(iu({type:"interval",data:f,yField:u,tooltip:!1,style:{fill:"#eee"},label:!1},o))}return n};return zt(e,$e,Xt)(t)}var OOt=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}};$F("shape.interval.bar25D",t)},_Ot=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)}}();OOt();var SOt=function(t){_Ot(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 Y9},e}(Rt),EOt=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}};$F("shape.interval.column25D",t)},MOt=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)}}();EOt();var POt=function(t){MOt(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 Y9},e}(Rt);function AOt(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(!ge(l,"colorField")){var c=ge(l,"yField");pt(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 ge(c,"y.key")||l.forEach(function(f,d){if(!ge(f,"scale.y.key")){var h="child".concat(d,"Scale");pt(f,"scale.y.key",h);var p=f.annotations,v=p===void 0?[]:p;v.length>0&&(pt(f,"scale.y.independent",!1),v.forEach(function(g){pt(g,"scale.y.key",h)})),!u&&a.length>0&&ge(f,"scale.y.independent")===void 0&&(u=!0,pt(f,"scale.y.independent",!1),a.forEach(function(g){pt(g,"scale.y.key",h)}))}}),r};return zt(e,n,$e,Xt)(t)}var COt=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)}}(),W9=function(t){COt(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 AOt},e}(Rt);function kOt(t){var e=function(o){var a=o.options,s=a.xField,l=a.colorField;return l||pt(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?pt(a,"transform",[]):pt(a,"transform",[{type:"symmetryY"}])),!f&&u&&pt(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(w9(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&&(pt(a,"type","spaceFlex"),pt(a,"ratio",[1,1]),pt(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||pt(a,"tooltip",{title:!1,items:[function(u){return{name:u[l],value:u[c]}}]}),o};return zt(e,n,r,i,$e,Xt)(t)}var TOt=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)}}(),LOt=function(t){TOt(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 kOt},e}(Rt);function NOt(t){return zt($e,Xt)(t)}var IOt=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)}}(),jOt=function(t){IOt(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 NOt},e}(Rt),Ga=function(){return Ga=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},Ga.apply(this,arguments)};function DOt(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 Ga(Ga({},f),(d={},d[i]=1,d))});pt(r,"data",u),a&&pt(r,"label",Ga(Ga({},a),{formatter:function(){return 0}})),s!==!1&&pt(r,"tooltip",Ga(Ga({},s),{items:[function(f){return{name:f[l],value:0}}]}))}}return n};return zt(e,Xt)(t)}var FOt=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)}}(),$Ot=function(t){FOt(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 DOt},e}(Rt);function ROt(t){return zt($e,Xt)(t)}var BOt=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)}}(),zOt=function(t){BOt(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 ROt},e}(Rt);function YOt(t){var e=function(n){return pt(n,"options.coordinate",{type:ge(n,"options.coordinateType","polar")}),n};return zt(e,Xt)(t)}var WOt=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)}}(),GOt=function(t){WOt(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 YOt},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)},HOt="__stock-range__",UOt="trend",VOt="up",XOt="down";function qOt(t){var e=function(r){var i=r.options,o=i.data,a=i.yField;return r.options.data=Jc(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[UOt]=l[c]<=l[u]?VOt:XOt,l[HOt]=[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=Jc(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&&pt(r,"options.scale.color.range[0]",s),l&&pt(r,"options.scale.color.range[2]",l),r};return zt(e,n,Xt)(t)}var KOt=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)}}(),ZOt=["#26a69a","#999999","#ef5350"],QOt=function(t){KOt(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:ZOt},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 qOt},e}(Rt);function JOt(t){return zt($e,Xt)(t)}var t_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)}}(),e_t=function(t){t_t(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 JOt},e}(Rt);function n_t(t){return zt($e,Xt)(t)}var r_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)}}(),i_t=function(t){r_t(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 n_t},e}(Rt);function o_t(t){return zt($e,Xt)(t)}var a_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)}}(),s_t=function(t){a_t(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 o_t},e}(Rt),lS=function(){return lS=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},lS.apply(this,arguments)};function l_t(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,lS({},s)),n};return zt(e,$e,Xt)(t)}var c_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)}}(),u_t=function(t){c_t(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 l_t},e}(Rt),cS=function(){return cS=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},cS.apply(this,arguments)};function f_t(t){var e=function(r){var i=r.options,o=i.radius,a=o===void 0?.8:o;return pt(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,cS({},l)),r};return zt(e,n,$e,Xt)(t)}var d_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)}}(),h_t=function(t){d_t(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 f_t},e}(Rt);function p_t(t){return zt(Xt)(t)}var v_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)}}(),g_t=function(t){v_t(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 p_t},e}(Rt),uS="__start__",ou="__end__",fS="__waterfall_value__",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)},y_t=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 m_t(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[uS]=0,c[ou]=c[s],c[fS]=c[s];else{var d=(f=l[ou])!==null&&f!==void 0?f:l[s];c[uS]=d,c[ou]=d+c[s],c[fS]=l[ou]}return c},[]),Object.assign(i,{yField:[uS,ou]})),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=y_t([],a,!0);return u.reduce(function(f,d,h){return h>0&&(d.x1=f[s],d.x2=d[s],d.y1=f[ou]),d},[]),u.shift(),l.push({type:"link",xField:["x1","x2"],yField:"y1",zIndex:-1,data:u,style:dS({stroke:"#697474"},c),label:!1,tooltip:!1}),r};return zt(e,n,$e,Xt)(t)}var b_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)}}(),x_t=function(t){b_t(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:fS,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 m_t},e}(Rt);function w_t(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=ge(s,"[0].transform[0]",{});return tu(a)?(jR(u,{thresholds:hbt(B2t(i.length,a)),y:c}),n):(tu(o)&&jR(u,{thresholds:o,y:c}),n)};return zt(e,$e,Xt)(t)}var O_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)}}(),__t=function(t){O_t(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 w_t},e}(Rt);function S_t(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,$e,Xt)(t)}var E_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)}}(),M_t=function(t){E_t(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 S_t},e}(Rt);function P_t(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,$e,Xt)(t)}var A_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)}}(),C_t=function(t){A_t(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 P_t},e}(Rt);function k_t(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?pt(r,"data",{value:i,transform:o}):delete r.children;else if(ge(i,"type")==="fetch"&&ge(i,"value")){var a=ge(i,"transform");Vt(a)?pt(i,"transform",a.concat(o)):pt(i,"transform",o)}return n};return zt(e,$e,Xt)(t)}var T_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)}}(),L_t=function(t){T_t(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 k_t},e}(Rt),Si=function(){return Si=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},Si.apply(this,arguments)},wy=["#f0efff","#5B8FF9","#3D76DD"];function hS(t,e,n,r){r===void 0&&(r=!0);var i=0,o=!1,a=Jc(t,function(s){var l,c,u=ge(s,[e]);if(iwt(u))return[];if(O9(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),Jc(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 Si({index:0},s)}),i]:[a,i]}function pS(t,e){return new Array(t).fill("").map(function(n,r){return Vt(e)?e[r%e.length]:e})}function N_t(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=hS(g,l,p),m=y[0],b=y[1],x=hS(g,u,p,!1),w=x[0],O=x[1],_=hS(g,d,p,!1),S=_[0],E=_[1],M=ge(a,[l],wy[0]),P=ge(a,[u],wy[1]),k=ge(a,[d],wy[2]),A=[pS(b,M),pS(O,P),pS(E,k)].flat();return i.options.children=Jc(i.options.children,function(C,T){var N=[m,w,S][T],j=[l,u,d][T];return Si(Si({},C),{data:N,encode:Si(Si({},C.encode||{}),{x:p,y:j,color:function(L){var I=L.index,F=tu(I)?"".concat(j,"_").concat(I):j;return v?ge(v,[j,I],F):F}}),style:Si(Si({},C.style||{}),{zIndex:function(L){return-L[j]}}),labels:T!==0?Jc(C.labels,function(L){return Si(Si({},L),{text:j})}):void 0})}),i.options.scale.color.range=A,i.options.legend.color.itemMarker=function(C){return v&&twt(v==null?void 0:v[d],C)||(C==null?void 0:C.replace(/\_\d$/,""))===d?"line":"square"},i},n=function(i){var o=i.options.layout,a=o===void 0?"horizontal":o;return a!=="horizontal"&&pt(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 Wa(d[p],h)}),i};return zt(e,n,r,mOt,Xt)(t)}var I_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)}}(),j_t=function(t){I_t(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:wy}},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 N_t},e}(Rt);function D_t(t){var e=function(n){var r=n.options.data;return n.options.data={value:r},n};return zt(e,$e,Xt)(t)}var F_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)}}(),$_t=function(t){F_t(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 D_t},e}(Rt);function R_t(t){var e=function(n){var r=n.options.percent;return tu(r)&&pt(n,"options.data",r),n};return zt(e,$e,Xt)(t)}var B_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)}}(),z_t=function(t){B_t(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 R_t},e}(Rt);function Y_t(t){return zt($e,Xt)(t)}var 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)}}(),G_t=function(t){W_t(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 Y_t},e}(Rt);function H_t(t){var e=function(n){var r=n.options,i=r.data;return i&&pt(r,"data",{value:i}),n};return zt(e,$e,Xt)(t)}var U_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)}}(),V_t=function(t){U_t(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 H_t},e}(Rt),Js=function(){return Js=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},Js.apply(this,arguments)};function X_t(t){var e=function(i){var o=i.options,a=o.startAngle,s=o.maxAngle,l=o.coordinate,c=tu(a)?a/(2*Math.PI)*360:-90,u=tu(s)?(Number(s)+c)/180*Math.PI:Math.PI;return pt(i,["options","coordinate"],Js(Js({},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||pt(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=ge(l,"y.domain",[]);return a&&s.unshift(Js({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:Js(Js({},c),{startAngle:-Math.PI/2,endAngle:1.5*Math.PI}),animate:!1},a)),i};return zt(e,n,r,$e,Xt)(t)}var 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)}}(),K_t=function(t){q_t(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 X_t},e}(Rt);function Z_t(t){return zt(Xt)(t)}var 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)}}(),J_t=function(t){Q_t(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 Z_t},e}(Rt),Oy=function(){return Oy=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},Oy.apply(this,arguments)};function tSt(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 Oy(Oy({},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 pt(r,"children",l),r.violinType==="polar"&&pt(r,"coordinate",{type:"polar"}),pt(r,"violinType",void 0),n};return zt(e,$e,Xt)(t)}var eSt=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){eSt(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 tSt},e}(Rt),fh=function(){return fh=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},fh.apply(this,arguments)},rSt=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 iSt(t){var e=function(o){var a=o.options,s=a.yField,l=a.children;return l.forEach(function(c,u){pt(c,"yField",s[u])}),o},n=function(o){var a=o.options,s=a.yField,l=a.children,c=a.data;if(D_(c))return o;var u=Vt(ge(c,[0]))?c:[c,c];return l.forEach(function(f,d){pt(f,"data",rSt([],u[d].map(function(h){return fh({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||pt(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?B9:u,d=a.paddingLeft,h=d===void 0?B9:d,p=a.axis;pt(a,"axisText",fh(fh({},(p==null?void 0:p.x)||{}),{layout:l}));var v=s[0],g=s[1];if(l==="vertical")pt(a,"direction","col"),pt(a,"paddingLeft",h),pt(a,"coordinate.transform",c.filter(function(w){return w.type!=="transpose"})),pt(v,"paddingBottom",R9),pt(g,"paddingTop",R9),pt(g,"axis",{x:{position:"top"}}),pt(g,"scale",{y:{range:[0,1]}});else{pt(a,"paddingBottom",f),pt(v,"scale",{y:{range:[0,1]}});var y=v.paddingRight,m=y===void 0?aS:y,b=g.paddingLeft,x=b===void 0?aS:b;pt(v,"paddingRight",m),pt(v,"axis",{x:{position:"right"}}),pt(g,"paddingLeft",x)}return o};return zt(e,n,r,i,$e,Xt)(t)}var oSt=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)}}(),aSt=function(t){oSt(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 iSt},e}(Rt),tl;(function(t){t.color="key",t.d="path"})(tl||(tl={}));function sSt(t){var e=function(n){var r=n.options,i=r.data,o=r.setsField,a=r.sizeField;return Vt(i)&&(pt(r,"data",{type:"inline",value:i,transform:[{type:"venn",sets:o,size:a,as:[tl.color,tl.d]}]}),pt(r,"colorField",o),pt(r,["children","0","encode","d"],tl.d)),pt(n,"options",X_(r,["sizeField","setsField"])),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)}}(),cSt=function(t){lSt(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:tl.color,d:tl.d}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return sSt},e}(Rt);function uSt(t){var e=function(n){return n};return zt(e,Xt)(t)}var fSt=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)}}(),dSt=function(t){fSt(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 uSt},e}(Rt),hSt={Base:vOt,Line:jOt,Column:POt,Pie:$Ot,Area:wOt,Bar:SOt,DualAxes:W9,Funnel:LOt,Scatter:zOt,Radar:GOt,Rose:g_t,Stock:QOt,TinyLine:e_t,TinyArea:i_t,TinyColumn:s_t,TinyProgress:u_t,TinyRing:h_t,Waterfall:x_t,Histogram:__t,Heatmap:M_t,Box:C_t,Sankey:L_t,Bullet:j_t,Gauge:$_t,Liquid:z_t,WordCloud:G_t,Treemap:V_t,RadialBar:K_t,CirclePacking:J_t,Violin:nSt,BidirectionalBar:aSt,Venn:cSt,Mix:W9,Sunburst:dSt},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)},G9=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},el=K.forwardRef(function(t,e){var n=t.chartType,r=n===void 0?"Base":n,i=G9(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=G9(i,["containerStyle","containerAttributes","className","loading","loadingTemplate","errorTemplate"]),p=mwt(hSt[r],h),v=p.chart,g=p.container;return K.useImperativeHandle(e,function(){return v.current}),K.createElement(byt,{errorTemplate:d},u&&K.createElement(yyt,{loadingTemplate:f}),K.createElement("div",vS({className:c,style:a,ref:g},l)))}),gS=function(){return gS=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},gS.apply(this,arguments)},pSt=function(t){return K.createElement(el,gS({},t,{chartType:"Area"}))},yS=function(){return yS=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},yS.apply(this,arguments)},vSt=function(t){return K.createElement(el,yS({},t,{chartType:"Bar"}))},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)},gSt=function(t){return K.createElement(el,mS({},t,{chartType:"Column"}))},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)},ySt=function(t){return K.createElement(el,bS({},t,{chartType:"DualAxes"}))},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)},mSt=function(t){return K.createElement(el,xS({},t,{chartType:"Line"}))},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)},bSt=function(t){return K.createElement(el,wS({},t,{chartType:"Pie"}))},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)},xSt=function(t){return K.createElement(el,OS({},t,{chartType:"Scatter"}))};const{booleanField:_y}=QS,wSt={isStack:t=>_y(tt({name:"isStack",title:"isStack"},t)),smooth:t=>_y(tt({name:"smooth",title:"smooth"},t)),isPercent:t=>_y(tt({name:"isPercent",title:"isPercent"},t)),isGroup:t=>_y(tt({name:"isGroup",title:"isGroup"},t)),size:()=>({size:{title:St("Size"),type:"object","x-decorator":"FormItem","x-component":"Space",properties:{type:{"x-component":"Select","x-component-props":{allowClear:!1},default:"ratio",enum:[{label:St("Aspect ratio"),value:"ratio"},{label:St("Fixed height"),value:"fixed"}]},fixed:{type:"number","x-component":"InputNumber","x-component-props":{min:0,addonAfter:"px"},"x-reactions":[{dependencies:[".type"],fulfill:{state:{visible:"{{$deps[0] === 'fixed'}}"}}}]},ratio:{type:"object","x-component":"Space","x-reactions":[{dependencies:[".type"],fulfill:{state:{visible:"{{$deps[0] === 'ratio'}}"}}}],properties:{width:{type:"number","x-component":"InputNumber","x-component-props":{placeholder:St("Width"),min:1}},colon:{type:"void","x-component":"Text","x-component-props":{children:":"}},height:{type:"number","x-component":"InputNumber","x-component-props":{placeholder:St("Height"),min:1}}}}}}})},OSt=t=>e=>{var c,u;const{size:n={}}=e;let{height:r}=e;!r&&n.type==="fixed"&&(r=n.fixed);const{service:i}=K.useContext(ii),o=K.useRef(null),[a,s]=K.useState(0);K.useEffect(()=>{var p,v;const f=o.current;if(!f||i.loading===!0||r)return;let d=0;n.type==="ratio"&&((p=n.ratio)!=null&&p.width)&&((v=n.ratio)!=null&&v.height)&&(d=n.ratio.height/n.ratio.width);const h=new ResizeObserver(g=>{g.forEach(y=>{if(d){s(y.contentRect.width*d);return}s(y.contentRect.height)})});return h.observe(f),()=>h.disconnect()},[i.loading,r,n.type,(c=n.ratio)==null?void 0:c.width,(u=n.ratio)==null?void 0:u.height]);const l=r||a;return Y.jsx("div",{ref:o,style:l?{height:`${l}px`}:{},children:Y.jsx(t,tt(tt({},e),l?{height:l}:{}))})};class nl extends jy{constructor({name:n,title:r,Component:i,config:o}){super({name:n,title:r,Component:OSt(i),config:["xField","yField","seriesField","size",...o||[]]});ri(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(wSt)}getProps({data:n,general:r,advanced:i,fieldProps:o}){const a=o[r.xField],s=o[r.yField],l=o[r.seriesField];return tt(ht(tt(tt({legend:{color:{itemLabelText:u=>{const f=l==null?void 0:l.transformer;return f?f(u.label):u.label}}},tooltip:{title:u=>{const{[r.xField]:f}=u;return a!=null&&a.transformer?a.transformer(f):f},items:[u=>{const{[r.xField]:f,[r.yField]:d,[r.seriesField]:h}=u;let p="";return h?p=l.transformer?l.transformer(h):h:p=(s==null?void 0:s.label)||r.yField,{name:p,value:s!=null&&s.transformer?s.transformer(d):d}}]},axis:{x:{labelFormatter:u=>{const f=a==null?void 0:a.transformer;return f?f(u):u}},y:{labelFormatter:u=>{const f=s==null?void 0:s.transformer;return f?f(u):u}}},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 _St extends nl{constructor(){super({name:"pie",title:"Pie Chart",Component:bSt});ri(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=r.angleField,s=o[a]||{};if(n.some(f=>f[a]<0)){const f=Math.min(...n.map(h=>h[a]));n=n.map(h=>ht(tt({},h),{[a]:h[a]-f}));const d=s.transformer;s.transformer=h=>{const p=h+f;return d?d(p):p}}const c=super.getProps({data:n,general:r,advanced:i,fieldProps:o}),u={items:[f=>{const{[r.colorField]:d,[a]:h}=f,p=d||(s==null?void 0:s.label)||a,v=s==null?void 0:s.transformer;return{name:p,value:v?v(h):h}}]};return ht(tt({},c),{tooltip:i.tooltip||u})}}class SSt extends nl{constructor(){super({name:"dualAxes",title:"Dual Axes Chart",Component:ySt});ri(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 ht(tt({},rn.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 ESt=[new nl({name:"line",title:"Line Chart",Component:mSt,config:["smooth","isStack"]}),new nl({name:"area",title:"Area Chart",Component:pSt,config:["smooth",{property:"isStack",defaultValue:!0},"isPercent"]}),new nl({name:"column",title:"Column Chart",Component:gSt,config:["isGroup","isStack","isPercent"]}),new nl({name:"bar",title:"Bar Chart",Component:vSt,config:["isGroup","isStack","isPercent"]}),new _St,new SSt,new nl({name:"scatter",title:"Scatter Chart",Component:xSt})];class Sy extends z.Plugin{constructor(){super(...arguments);ri(this,"charts",new OB)}load(){return Nn(this,null,function*(){this.charts.setGroup("Built-in",[...ESt,...Kz]),this.app.addComponents({ChartV2BlockInitializer:Uz,ChartV2BlockDesigner:Wz,ChartV2Block:Yz}),this.app.schemaInitializerManager.add(ZS),this.app.schemaInitializerManager.add(Hz),this.app.schemaInitializerManager.add(US),this.app.schemaInitializerManager.add(_z),this.app.schemaInitializerManager.add(XS),this.app.schemaInitializerManager.add(Cz);const n=this.app.schemaInitializerManager.get("page:addBlock");n==null||n.add("dataBlocks.chartV2",{title:St("Charts"),Component:"ChartV2BlockInitializer"}),this.app.schemaInitializerManager.addItem("mobile:addBlock","dataBlocks.chartV2",{title:St("Charts"),Component:"ChartV2BlockInitializer"})})}}ct.Chart=jy,ct.ChartConfigContext=Pi,ct.default=Sy,Object.defineProperties(ct,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
179
|
+
`,n.classList.add("loading"),n.innerHTML="<div></div><div></div><div></div><div></div>",e.appendChild(r),e.appendChild(n)},yyt=function(t){var e=t.loadingTemplate,n=t.theme,r=n===void 0?"light":n,i=K.useRef(null);K.useEffect(function(){!e&&i.current&&gyt(i.current)},[]);var o=function(){return e||K.createElement("div",{ref:i})};return K.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())},myt=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)}}(),byt=function(t){myt(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||K.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):K.createElement(K.Fragment,null,this.props.children)},e}(K.Component),iR=typeof global=="object"&&global&&global.Object===Object&&global,xyt=typeof self=="object"&&self&&self.Object===Object&&self,wi=iR||xyt||Function("return this")(),ei=wi.Symbol,oR=Object.prototype,wyt=oR.hasOwnProperty,Oyt=oR.toString,Kd=ei?ei.toStringTag:void 0;function _yt(t){var e=wyt.call(t,Kd),n=t[Kd];try{t[Kd]=void 0;var r=!0}catch(o){}var i=Oyt.call(t);return r&&(e?t[Kd]=n:delete t[Kd]),i}var Syt=Object.prototype,Eyt=Syt.toString;function Myt(t){return Eyt.call(t)}var Pyt="[object Null]",Ayt="[object Undefined]",aR=ei?ei.toStringTag:void 0;function Ji(t){return t==null?t===void 0?Ayt:Pyt:aR&&aR in Object(t)?_yt(t):Myt(t)}function lr(t){return t!=null&&typeof t=="object"}var Cyt="[object Symbol]";function Zd(t){return typeof t=="symbol"||lr(t)&&Ji(t)==Cyt}var kyt=NaN;function sR(t){return typeof t=="number"?t:Zd(t)?kyt:+t}function Qg(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 Vt=Array.isArray,Tyt=1/0,lR=ei?ei.prototype:void 0,cR=lR?lR.toString:void 0;function Jg(t){if(typeof t=="string")return t;if(Vt(t))return Qg(t,Jg)+"";if(Zd(t))return cR?cR.call(t):"";var e=t+"";return e=="0"&&1/t==-Tyt?"-0":e}function Lyt(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=Jg(n),r=Jg(r)):(n=sR(n),r=sR(r)),i=t(n,r)}return i}}var Nyt=/\s/;function Iyt(t){for(var e=t.length;e--&&Nyt.test(t.charAt(e)););return e}var jyt=/^\s+/;function Dyt(t){return t&&t.slice(0,Iyt(t)+1).replace(jyt,"")}function Hn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var uR=NaN,Fyt=/^[-+]0x[0-9a-f]+$/i,$yt=/^0b[01]+$/i,Ryt=/^0o[0-7]+$/i,Byt=parseInt;function fR(t){if(typeof t=="number")return t;if(Zd(t))return uR;if(Hn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Hn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Dyt(t);var n=$yt.test(t);return n||Ryt.test(t)?Byt(t.slice(2),n?2:8):Fyt.test(t)?uR:+t}var dR=1/0,zyt=17976931348623157e292;function Yyt(t){if(!t)return t===0?t:0;if(t=fR(t),t===dR||t===-dR){var e=t<0?-1:1;return e*zyt}return t===t?t:0}function hR(t){var e=Yyt(t),n=e%1;return e===e?n?e-n:e:0}function w_(t){return t}var Wyt="[object AsyncFunction]",Gyt="[object Function]",Hyt="[object GeneratorFunction]",Uyt="[object Proxy]";function Vc(t){if(!Hn(t))return!1;var e=Ji(t);return e==Gyt||e==Hyt||e==Wyt||e==Uyt}var O_=wi["__core-js_shared__"],pR=function(){var t=/[^.]+$/.exec(O_&&O_.keys&&O_.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Vyt(t){return!!pR&&pR in t}var Xyt=Function.prototype,qyt=Xyt.toString;function Vs(t){if(t!=null){try{return qyt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var Kyt=/[\\^$.*+?()[\]{}|]/g,Zyt=/^\[object .+?Constructor\]$/,Qyt=Function.prototype,Jyt=Object.prototype,tmt=Qyt.toString,emt=Jyt.hasOwnProperty,nmt=RegExp("^"+tmt.call(emt).replace(Kyt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rmt(t){if(!Hn(t)||Vyt(t))return!1;var e=Vc(t)?nmt:Zyt;return e.test(Vs(t))}function imt(t,e){return t==null?void 0:t[e]}function Xs(t,e){var n=imt(t,e);return rmt(n)?n:void 0}var Qd=Xs(wi,"WeakMap"),vR=Qd&&new Qd,gR=Object.create,__=function(){function t(){}return function(e){if(!Hn(e))return{};if(gR)return gR(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function omt(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 S_(){}var amt=4294967295;function Xc(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=amt,this.__views__=[]}Xc.prototype=__(S_.prototype),Xc.prototype.constructor=Xc;function yR(){}var mR=vR?function(t){return vR.get(t)}:yR,bR={},smt=Object.prototype,lmt=smt.hasOwnProperty;function ty(t){for(var e=t.name+"",n=bR[e],r=lmt.call(bR,e)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==t)return i.name}return e}function za(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}za.prototype=__(S_.prototype),za.prototype.constructor=za;function E_(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function cmt(t){if(t instanceof Xc)return t.clone();var e=new za(t.__wrapped__,t.__chain__);return e.__actions__=E_(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var umt=Object.prototype,fmt=umt.hasOwnProperty;function ey(t){if(lr(t)&&!Vt(t)&&!(t instanceof Xc)){if(t instanceof za)return t;if(fmt.call(t,"__wrapped__"))return cmt(t)}return new za(t)}ey.prototype=S_.prototype,ey.prototype.constructor=ey;function xR(t){var e=ty(t),n=ey[e];if(typeof n!="function"||!(e in Xc.prototype))return!1;if(t===n)return!0;var r=mR(n);return!!r&&t===r[0]}var dmt=800,hmt=16,pmt=Date.now;function vmt(t){var e=0,n=0;return function(){var r=pmt(),i=hmt-(r-n);if(n=r,i>0){if(++e>=dmt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function gmt(t){return function(){return t}}var ny=function(){try{var t=Xs(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),ymt=ny?function(t,e){return ny(t,"toString",{configurable:!0,enumerable:!1,value:gmt(e),writable:!0})}:w_,wR=vmt(ymt);function mmt(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function bmt(t,e,n,r){for(var i=t.length,o=n+-1;++o<i;)if(e(t[o],o,t))return o;return-1}function xmt(t){return t!==t}function wmt(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function OR(t,e,n){return e===e?wmt(t,e,n):bmt(t,xmt,n)}function Omt(t,e){var n=t==null?0:t.length;return!!n&&OR(t,e,0)>-1}var _mt=9007199254740991,Smt=/^(?:0|[1-9]\d*)$/;function ry(t,e){var n=typeof t;return e=e==null?_mt:e,!!e&&(n=="number"||n!="symbol"&&Smt.test(t))&&t>-1&&t%1==0&&t<e}function iy(t,e,n){e=="__proto__"&&ny?ny(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Jd(t,e){return t===e||t!==t&&e!==e}var Emt=Object.prototype,Mmt=Emt.hasOwnProperty;function oy(t,e,n){var r=t[e];(!(Mmt.call(t,e)&&Jd(r,n))||n===void 0&&!(e in t))&&iy(t,e,n)}function qs(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=void 0;l===void 0&&(l=t[s]),i?iy(n,s,l):oy(n,s,l)}return n}var _R=Math.max;function SR(t,e,n){return e=_R(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=_R(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),omt(t,this,s)}}function Pmt(t,e){return wR(SR(t,e,w_),t+"")}var Amt=9007199254740991;function M_(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Amt}function Ya(t){return t!=null&&M_(t.length)&&!Vc(t)}function Cmt(t,e,n){if(!Hn(n))return!1;var r=typeof e;return(r=="number"?Ya(n)&&ry(e,n.length):r=="string"&&e in n)?Jd(n[e],t):!1}function ER(t){return Pmt(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&&Cmt(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 kmt=Object.prototype;function ay(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||kmt;return t===n}function Tmt(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Lmt="[object Arguments]";function MR(t){return lr(t)&&Ji(t)==Lmt}var PR=Object.prototype,Nmt=PR.hasOwnProperty,Imt=PR.propertyIsEnumerable,th=MR(function(){return arguments}())?MR:function(t){return lr(t)&&Nmt.call(t,"callee")&&!Imt.call(t,"callee")};function jmt(){return!1}var AR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,CR=AR&&typeof module=="object"&&module&&!module.nodeType&&module,Dmt=CR&&CR.exports===AR,kR=Dmt?wi.Buffer:void 0,Fmt=kR?kR.isBuffer:void 0,eh=Fmt||jmt,$mt="[object Arguments]",Rmt="[object Array]",Bmt="[object Boolean]",zmt="[object Date]",Ymt="[object Error]",Wmt="[object Function]",Gmt="[object Map]",Hmt="[object Number]",Umt="[object Object]",Vmt="[object RegExp]",Xmt="[object Set]",qmt="[object String]",Kmt="[object WeakMap]",Zmt="[object ArrayBuffer]",Qmt="[object DataView]",Jmt="[object Float32Array]",t1t="[object Float64Array]",e1t="[object Int8Array]",n1t="[object Int16Array]",r1t="[object Int32Array]",i1t="[object Uint8Array]",o1t="[object Uint8ClampedArray]",a1t="[object Uint16Array]",s1t="[object Uint32Array]",Ee={};Ee[Jmt]=Ee[t1t]=Ee[e1t]=Ee[n1t]=Ee[r1t]=Ee[i1t]=Ee[o1t]=Ee[a1t]=Ee[s1t]=!0,Ee[$mt]=Ee[Rmt]=Ee[Zmt]=Ee[Bmt]=Ee[Qmt]=Ee[zmt]=Ee[Ymt]=Ee[Wmt]=Ee[Gmt]=Ee[Hmt]=Ee[Umt]=Ee[Vmt]=Ee[Xmt]=Ee[qmt]=Ee[Kmt]=!1;function l1t(t){return lr(t)&&M_(t.length)&&!!Ee[Ji(t)]}function P_(t){return function(e){return t(e)}}var TR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,nh=TR&&typeof module=="object"&&module&&!module.nodeType&&module,c1t=nh&&nh.exports===TR,A_=c1t&&iR.process,qc=function(){try{var t=nh&&nh.require&&nh.require("util").types;return t||A_&&A_.binding&&A_.binding("util")}catch(e){}}(),LR=qc&&qc.isTypedArray,C_=LR?P_(LR):l1t,u1t=Object.prototype,f1t=u1t.hasOwnProperty;function NR(t,e){var n=Vt(t),r=!n&&th(t),i=!n&&!r&&eh(t),o=!n&&!r&&!i&&C_(t),a=n||r||i||o,s=a?Tmt(t.length,String):[],l=s.length;for(var c in t)(e||f1t.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ry(c,l)))&&s.push(c);return s}function IR(t,e){return function(n){return t(e(n))}}var d1t=IR(Object.keys,Object),h1t=Object.prototype,p1t=h1t.hasOwnProperty;function v1t(t){if(!ay(t))return d1t(t);var e=[];for(var n in Object(t))p1t.call(t,n)&&n!="constructor"&&e.push(n);return e}function Ks(t){return Ya(t)?NR(t):v1t(t)}var g1t=Object.prototype,y1t=g1t.hasOwnProperty,jR=ER(function(t,e){if(ay(e)||Ya(e)){qs(e,Ks(e),t);return}for(var n in e)y1t.call(e,n)&&oy(t,n,e[n])});function m1t(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var b1t=Object.prototype,x1t=b1t.hasOwnProperty;function w1t(t){if(!Hn(t))return m1t(t);var e=ay(t),n=[];for(var r in t)r=="constructor"&&(e||!x1t.call(t,r))||n.push(r);return n}function rh(t){return Ya(t)?NR(t,!0):w1t(t)}var O1t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_1t=/^\w*$/;function k_(t,e){if(Vt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Zd(t)?!0:_1t.test(t)||!O1t.test(t)||e!=null&&t in Object(e)}var ih=Xs(Object,"create");function S1t(){this.__data__=ih?ih(null):{},this.size=0}function E1t(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var M1t="__lodash_hash_undefined__",P1t=Object.prototype,A1t=P1t.hasOwnProperty;function C1t(t){var e=this.__data__;if(ih){var n=e[t];return n===M1t?void 0:n}return A1t.call(e,t)?e[t]:void 0}var k1t=Object.prototype,T1t=k1t.hasOwnProperty;function L1t(t){var e=this.__data__;return ih?e[t]!==void 0:T1t.call(e,t)}var N1t="__lodash_hash_undefined__";function I1t(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ih&&e===void 0?N1t:e,this}function Zs(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])}}Zs.prototype.clear=S1t,Zs.prototype.delete=E1t,Zs.prototype.get=C1t,Zs.prototype.has=L1t,Zs.prototype.set=I1t;function j1t(){this.__data__=[],this.size=0}function sy(t,e){for(var n=t.length;n--;)if(Jd(t[n][0],e))return n;return-1}var D1t=Array.prototype,F1t=D1t.splice;function $1t(t){var e=this.__data__,n=sy(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():F1t.call(e,n,1),--this.size,!0}function R1t(t){var e=this.__data__,n=sy(e,t);return n<0?void 0:e[n][1]}function B1t(t){return sy(this.__data__,t)>-1}function z1t(t,e){var n=this.__data__,r=sy(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Do(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])}}Do.prototype.clear=j1t,Do.prototype.delete=$1t,Do.prototype.get=R1t,Do.prototype.has=B1t,Do.prototype.set=z1t;var oh=Xs(wi,"Map");function Y1t(){this.size=0,this.__data__={hash:new Zs,map:new(oh||Do),string:new Zs}}function W1t(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ly(t,e){var n=t.__data__;return W1t(e)?n[typeof e=="string"?"string":"hash"]:n.map}function G1t(t){var e=ly(this,t).delete(t);return this.size-=e?1:0,e}function H1t(t){return ly(this,t).get(t)}function U1t(t){return ly(this,t).has(t)}function V1t(t,e){var n=ly(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Fo(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])}}Fo.prototype.clear=Y1t,Fo.prototype.delete=G1t,Fo.prototype.get=H1t,Fo.prototype.has=U1t,Fo.prototype.set=V1t;var X1t="Expected a function";function T_(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(X1t);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(T_.Cache||Fo),n}T_.Cache=Fo;var q1t=500;function K1t(t){var e=T_(t,function(r){return n.size===q1t&&n.clear(),r}),n=e.cache;return e}var Z1t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q1t=/\\(\\)?/g,J1t=K1t(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Z1t,function(n,r,i,o){e.push(i?o.replace(Q1t,"$1"):r||n)}),e});function L_(t){return t==null?"":Jg(t)}function Kc(t,e){return Vt(t)?t:k_(t,e)?[t]:J1t(L_(t))}var tbt=1/0;function Zc(t){if(typeof t=="string"||Zd(t))return t;var e=t+"";return e=="0"&&1/t==-tbt?"-0":e}function cy(t,e){e=Kc(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Zc(e[n++])];return n&&n==r?t:void 0}function ge(t,e,n){var r=t==null?void 0:cy(t,e);return r===void 0?n:r}function N_(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var DR=ei?ei.isConcatSpreadable:void 0;function ebt(t){return Vt(t)||th(t)||!!(DR&&t&&t[DR])}function nbt(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=ebt),i||(i=[]);++o<a;){var s=t[o];n(s)?N_(i,s):i[i.length]=s}return i}function rbt(t){var e=t==null?0:t.length;return e?nbt(t):[]}function I_(t){return wR(SR(t,void 0,rbt),t+"")}var j_=IR(Object.getPrototypeOf,Object),ibt="[object Object]",obt=Function.prototype,abt=Object.prototype,FR=obt.toString,sbt=abt.hasOwnProperty,lbt=FR.call(Object);function D_(t){if(!lr(t)||Ji(t)!=ibt)return!1;var e=j_(t);if(e===null)return!0;var n=sbt.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&FR.call(n)==lbt}function cbt(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 ubt=wi.isFinite,fbt=Math.min;function dbt(t){var e=Math[t];return function(n,r){if(n=fR(n),r=r==null?0:fbt(hR(r),292),r&&ubt(n)){var i=(L_(n)+"e").split("e"),o=e(i[0]+"e"+(+i[1]+r));return i=(L_(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return e(n)}}var hbt=dbt("ceil");function pbt(){this.__data__=new Do,this.size=0}function vbt(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function gbt(t){return this.__data__.get(t)}function ybt(t){return this.__data__.has(t)}var mbt=200;function bbt(t,e){var n=this.__data__;if(n instanceof Do){var r=n.__data__;if(!oh||r.length<mbt-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Fo(r)}return n.set(t,e),this.size=n.size,this}function Oi(t){var e=this.__data__=new Do(t);this.size=e.size}Oi.prototype.clear=pbt,Oi.prototype.delete=vbt,Oi.prototype.get=gbt,Oi.prototype.has=ybt,Oi.prototype.set=bbt;function xbt(t,e){return t&&qs(e,Ks(e),t)}function wbt(t,e){return t&&qs(e,rh(e),t)}var $R=typeof ct=="object"&&ct&&!ct.nodeType&&ct,RR=$R&&typeof module=="object"&&module&&!module.nodeType&&module,Obt=RR&&RR.exports===$R,BR=Obt?wi.Buffer:void 0,zR=BR?BR.allocUnsafe:void 0;function YR(t,e){if(e)return t.slice();var n=t.length,r=zR?zR(n):new t.constructor(n);return t.copy(r),r}function _bt(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 WR(){return[]}var Sbt=Object.prototype,Ebt=Sbt.propertyIsEnumerable,GR=Object.getOwnPropertySymbols,F_=GR?function(t){return t==null?[]:(t=Object(t),_bt(GR(t),function(e){return Ebt.call(t,e)}))}:WR;function Mbt(t,e){return qs(t,F_(t),e)}var Pbt=Object.getOwnPropertySymbols,HR=Pbt?function(t){for(var e=[];t;)N_(e,F_(t)),t=j_(t);return e}:WR;function Abt(t,e){return qs(t,HR(t),e)}function UR(t,e,n){var r=e(t);return Vt(t)?r:N_(r,n(t))}function $_(t){return UR(t,Ks,F_)}function VR(t){return UR(t,rh,HR)}var R_=Xs(wi,"DataView"),B_=Xs(wi,"Promise"),Qc=Xs(wi,"Set"),XR="[object Map]",Cbt="[object Object]",qR="[object Promise]",KR="[object Set]",ZR="[object WeakMap]",QR="[object DataView]",kbt=Vs(R_),Tbt=Vs(oh),Lbt=Vs(B_),Nbt=Vs(Qc),Ibt=Vs(Qd),_i=Ji;(R_&&_i(new R_(new ArrayBuffer(1)))!=QR||oh&&_i(new oh)!=XR||B_&&_i(B_.resolve())!=qR||Qc&&_i(new Qc)!=KR||Qd&&_i(new Qd)!=ZR)&&(_i=function(t){var e=Ji(t),n=e==Cbt?t.constructor:void 0,r=n?Vs(n):"";if(r)switch(r){case kbt:return QR;case Tbt:return XR;case Lbt:return qR;case Nbt:return KR;case Ibt:return ZR}return e});var jbt=Object.prototype,Dbt=jbt.hasOwnProperty;function Fbt(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&Dbt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var uy=wi.Uint8Array;function z_(t){var e=new t.constructor(t.byteLength);return new uy(e).set(new uy(t)),e}function $bt(t,e){var n=e?z_(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var Rbt=/\w*$/;function Bbt(t){var e=new t.constructor(t.source,Rbt.exec(t));return e.lastIndex=t.lastIndex,e}var JR=ei?ei.prototype:void 0,t9=JR?JR.valueOf:void 0;function zbt(t){return t9?Object(t9.call(t)):{}}function e9(t,e){var n=e?z_(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var Ybt="[object Boolean]",Wbt="[object Date]",Gbt="[object Map]",Hbt="[object Number]",Ubt="[object RegExp]",Vbt="[object Set]",Xbt="[object String]",qbt="[object Symbol]",Kbt="[object ArrayBuffer]",Zbt="[object DataView]",Qbt="[object Float32Array]",Jbt="[object Float64Array]",txt="[object Int8Array]",ext="[object Int16Array]",nxt="[object Int32Array]",rxt="[object Uint8Array]",ixt="[object Uint8ClampedArray]",oxt="[object Uint16Array]",axt="[object Uint32Array]";function sxt(t,e,n){var r=t.constructor;switch(e){case Kbt:return z_(t);case Ybt:case Wbt:return new r(+t);case Zbt:return $bt(t,n);case Qbt:case Jbt:case txt:case ext:case nxt:case rxt:case ixt:case oxt:case axt:return e9(t,n);case Gbt:return new r;case Hbt:case Xbt:return new r(t);case Ubt:return Bbt(t);case Vbt:return new r;case qbt:return zbt(t)}}function n9(t){return typeof t.constructor=="function"&&!ay(t)?__(j_(t)):{}}var lxt="[object Map]";function cxt(t){return lr(t)&&_i(t)==lxt}var r9=qc&&qc.isMap,uxt=r9?P_(r9):cxt,fxt="[object Set]";function dxt(t){return lr(t)&&_i(t)==fxt}var i9=qc&&qc.isSet,hxt=i9?P_(i9):dxt,pxt=1,vxt=2,gxt=4,o9="[object Arguments]",yxt="[object Array]",mxt="[object Boolean]",bxt="[object Date]",xxt="[object Error]",a9="[object Function]",wxt="[object GeneratorFunction]",Oxt="[object Map]",_xt="[object Number]",s9="[object Object]",Sxt="[object RegExp]",Ext="[object Set]",Mxt="[object String]",Pxt="[object Symbol]",Axt="[object WeakMap]",Cxt="[object ArrayBuffer]",kxt="[object DataView]",Txt="[object Float32Array]",Lxt="[object Float64Array]",Nxt="[object Int8Array]",Ixt="[object Int16Array]",jxt="[object Int32Array]",Dxt="[object Uint8Array]",Fxt="[object Uint8ClampedArray]",$xt="[object Uint16Array]",Rxt="[object Uint32Array]",ye={};ye[o9]=ye[yxt]=ye[Cxt]=ye[kxt]=ye[mxt]=ye[bxt]=ye[Txt]=ye[Lxt]=ye[Nxt]=ye[Ixt]=ye[jxt]=ye[Oxt]=ye[_xt]=ye[s9]=ye[Sxt]=ye[Ext]=ye[Mxt]=ye[Pxt]=ye[Dxt]=ye[Fxt]=ye[$xt]=ye[Rxt]=!0,ye[xxt]=ye[a9]=ye[Axt]=!1;function ah(t,e,n,r,i,o){var a,s=e&pxt,l=e&vxt,c=e&gxt;if(n&&(a=i?n(t,r,i,o):n(t)),a!==void 0)return a;if(!Hn(t))return t;var u=Vt(t);if(u){if(a=Fbt(t),!s)return E_(t,a)}else{var f=_i(t),d=f==a9||f==wxt;if(eh(t))return YR(t,s);if(f==s9||f==o9||d&&!i){if(a=l||d?{}:n9(t),!s)return l?Abt(t,wbt(a,t)):Mbt(t,xbt(a,t))}else{if(!ye[f])return i?t:{};a=sxt(t,f,s)}}o||(o=new Oi);var h=o.get(t);if(h)return h;o.set(t,a),hxt(t)?t.forEach(function(g){a.add(ah(g,e,n,g,t,o))}):uxt(t)&&t.forEach(function(g,y){a.set(y,ah(g,e,n,y,t,o))});var p=c?l?VR:$_:l?rh:Ks,v=u?void 0:p(t);return mmt(v||t,function(g,y){v&&(y=g,g=t[y]),oy(a,y,ah(g,e,n,y,t,o))}),a}var Bxt=1,zxt=4;function l9(t){return ah(t,Bxt|zxt)}var Yxt="__lodash_hash_undefined__";function Wxt(t){return this.__data__.set(t,Yxt),this}function Gxt(t){return this.__data__.has(t)}function sh(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Fo;++e<n;)this.add(t[e])}sh.prototype.add=sh.prototype.push=Wxt,sh.prototype.has=Gxt;function Hxt(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 c9(t,e){return t.has(e)}var Uxt=1,Vxt=2;function u9(t,e,n,r,i,o){var a=n&Uxt,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&Vxt?new sh: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(!Hxt(e,function(y,m){if(!c9(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 Xxt(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Y_(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var qxt=1,Kxt=2,Zxt="[object Boolean]",Qxt="[object Date]",Jxt="[object Error]",t2t="[object Map]",e2t="[object Number]",n2t="[object RegExp]",r2t="[object Set]",i2t="[object String]",o2t="[object Symbol]",a2t="[object ArrayBuffer]",s2t="[object DataView]",f9=ei?ei.prototype:void 0,W_=f9?f9.valueOf:void 0;function l2t(t,e,n,r,i,o,a){switch(n){case s2t:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case a2t:return!(t.byteLength!=e.byteLength||!o(new uy(t),new uy(e)));case Zxt:case Qxt:case e2t:return Jd(+t,+e);case Jxt:return t.name==e.name&&t.message==e.message;case n2t:case i2t:return t==e+"";case t2t:var s=Xxt;case r2t:var l=r&qxt;if(s||(s=Y_),t.size!=e.size&&!l)return!1;var c=a.get(t);if(c)return c==e;r|=Kxt,a.set(t,e);var u=u9(s(t),s(e),r,i,o,a);return a.delete(t),u;case o2t:if(W_)return W_.call(t)==W_.call(e)}return!1}var c2t=1,u2t=Object.prototype,f2t=u2t.hasOwnProperty;function d2t(t,e,n,r,i,o){var a=n&c2t,s=$_(t),l=s.length,c=$_(e),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in e:f2t.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 h2t=1,d9="[object Arguments]",h9="[object Array]",fy="[object Object]",p2t=Object.prototype,p9=p2t.hasOwnProperty;function v2t(t,e,n,r,i,o){var a=Vt(t),s=Vt(e),l=a?h9:_i(t),c=s?h9:_i(e);l=l==d9?fy:l,c=c==d9?fy:c;var u=l==fy,f=c==fy,d=l==c;if(d&&eh(t)){if(!eh(e))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new Oi),a||C_(t)?u9(t,e,n,r,i,o):l2t(t,e,l,n,r,i,o);if(!(n&h2t)){var h=u&&p9.call(t,"__wrapped__"),p=f&&p9.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),d2t(t,e,n,r,i,o)):!1}function dy(t,e,n,r,i){return t===e?!0:t==null||e==null||!lr(t)&&!lr(e)?t!==t&&e!==e:v2t(t,e,n,r,dy,i)}var g2t=1,y2t=2;function m2t(t,e,n,r){var i=n.length,o=i;if(t==null)return!o;for(t=Object(t);i--;){var a=n[i];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=n[i];var s=a[0],l=t[s],c=a[1];if(a[2]){if(l===void 0&&!(s in t))return!1}else{var u=new Oi,f;if(!(f===void 0?dy(c,l,g2t|y2t,r,u):f))return!1}}return!0}function v9(t){return t===t&&!Hn(t)}function b2t(t){for(var e=Ks(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,v9(i)]}return e}function g9(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function x2t(t){var e=b2t(t);return e.length==1&&e[0][2]?g9(e[0][0],e[0][1]):function(n){return n===t||m2t(n,t,e)}}function w2t(t,e){return t!=null&&e in Object(t)}function O2t(t,e,n){e=Kc(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var a=Zc(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&&M_(i)&&ry(a,i)&&(Vt(t)||th(t)))}function y9(t,e){return t!=null&&O2t(t,e,w2t)}var _2t=1,S2t=2;function E2t(t,e){return k_(t)&&v9(e)?g9(Zc(t),e):function(n){var r=ge(n,t);return r===void 0&&r===e?y9(n,t):dy(e,r,_2t|S2t)}}function M2t(t){return function(e){return e==null?void 0:e[t]}}function P2t(t){return function(e){return cy(e,t)}}function A2t(t){return k_(t)?M2t(Zc(t)):P2t(t)}function G_(t){return typeof t=="function"?t:t==null?w_:typeof t=="object"?Vt(t)?E2t(t[0],t[1]):x2t(t):A2t(t)}function C2t(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 k2t(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[++i];if(n(o[l],l,o)===!1)break}return e}}var m9=k2t();function T2t(t,e){return t&&m9(t,e,Ks)}function L2t(t,e){return function(n,r){if(n==null)return n;if(!Ya(n))return t(n,r);for(var i=n.length,o=-1,a=Object(n);++o<i&&r(a[o],o,a)!==!1;);return n}}var b9=L2t(T2t);function N2t(t,e,n,r){return b9(t,function(i,o,a){e(r,i,n(i),a)}),r}function I2t(t,e){return function(n,r){var i=Vt(n)?C2t:N2t,o=e?e():{};return i(n,t,G_(r),o)}}function H_(t,e,n){(n!==void 0&&!Jd(t[e],n)||n===void 0&&!(e in t))&&iy(t,e,n)}function j2t(t){return lr(t)&&Ya(t)}function U_(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function D2t(t){return qs(t,rh(t))}function F2t(t,e,n,r,i,o,a){var s=U_(t,n),l=U_(e,n),c=a.get(l);if(c){H_(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&&eh(l),p=!d&&!h&&C_(l);u=l,d||h||p?Vt(s)?u=s:j2t(s)?u=E_(s):h?(f=!1,u=YR(l,!0)):p?(f=!1,u=e9(l,!0)):u=[]:D_(l)||th(l)?(u=s,th(s)?u=D2t(s):(!Hn(s)||Vc(s))&&(u=n9(l))):f=!1}f&&(a.set(l,u),i(u,l,r,o,a),a.delete(l)),H_(t,n,u)}function x9(t,e,n,r,i){t!==e&&m9(e,function(o,a){if(i||(i=new Oi),Hn(o))F2t(t,e,a,n,x9,r,i);else{var s=r?r(U_(t,a),o,a+"",t,e,i):void 0;s===void 0&&(s=o),H_(t,a,s)}},rh)}var $2t=ER(function(t,e,n,r){x9(t,e,n,r)});function R2t(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var B2t=Lyt(function(t,e){return t/e},1);function z2t(t,e){var n=-1,r=Ya(t)?Array(t.length):[];return b9(t,function(i,o,a){r[++n]=e(i,o,a)}),r}function Jc(t,e){var n=Vt(t)?Qg:z2t;return n(t,G_(e))}var Y2t="Expected a function",W2t=8,G2t=32,H2t=128,U2t=256;function V2t(t){return I_(function(e){for(var n=e.length,r=n,i=za.prototype.thru;r--;){var o=e[r];if(typeof o!="function")throw new TypeError(Y2t);if(i&&!a&&ty(o)=="wrapper")var a=new za([],!0)}for(r=a?r:n;++r<n;){o=e[r];var s=ty(o),l=s=="wrapper"?mR(o):void 0;l&&xR(l[0])&&l[1]==(H2t|W2t|G2t|U2t)&&!l[4].length&&l[9]==1?a=a[ty(l[0])].apply(a,l[3]):a=o.length==1&&xR(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 zt=V2t(),X2t=Object.prototype,q2t=X2t.hasOwnProperty,w9=I2t(function(t,e,n){q2t.call(t,n)?t[n].push(e):iy(t,n,[e])}),K2t="[object String]";function O9(t){return typeof t=="string"||!Vt(t)&&lr(t)&&Ji(t)==K2t}function Z2t(t,e){return Qg(e,function(n){return t[n]})}function Q2t(t){return t==null?[]:Z2t(t,Ks(t))}var J2t=Math.max;function twt(t,e,n,r){t=Ya(t)?t:Q2t(t),n=n&&!r?hR(n):0;var i=t.length;return n<0&&(n=J2t(i+n,0)),O9(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&OR(t,e,n)>-1}function ewt(t,e){return e.length<2?t:cy(t,cbt(e,0,-1))}var nwt="[object Boolean]";function V_(t){return t===!0||t===!1||lr(t)&&Ji(t)==nwt}function _9(t,e){return dy(t,e)}var rwt="[object Number]";function tu(t){return typeof t=="number"||lr(t)&&Ji(t)==rwt}function iwt(t){return t==null}function owt(t){return t===void 0}function awt(t,e){return e=Kc(e,t),t=ewt(t,e),t==null||delete t[Zc(R2t(e))]}function swt(t){return D_(t)?void 0:t}var lwt=1,cwt=2,uwt=4,X_=I_(function(t,e){var n={};if(t==null)return n;var r=!1;e=Qg(e,function(o){return o=Kc(o,t),r||(r=o.length>1),o}),qs(t,VR(t),n),r&&(n=ah(n,lwt|cwt|uwt,swt));for(var i=e.length;i--;)awt(n,e[i]);return n});function S9(t,e,n,r){if(!Hn(t))return t;e=Kc(e,t);for(var i=-1,o=e.length,a=o-1,s=t;s!=null&&++i<o;){var l=Zc(e[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var u=s[l];c=void 0,c===void 0&&(c=Hn(u)?u:ry(e[i+1])?[]:{})}oy(s,l,c),s=s[l]}return t}function fwt(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=cy(t,a);n(s,a)&&S9(o,Kc(a,t),s)}return o}function dwt(t,e){return fwt(t,e,function(n,r){return y9(t,r)})}var E9=I_(function(t,e){return t==null?{}:dwt(t,e)});function pt(t,e,n){return t==null?t:S9(t,e,n)}var hwt=1/0,pwt=Qc&&1/Y_(new Qc([,-0]))[1]==hwt?function(t){return new Qc(t)}:yR,vwt=200;function gwt(t,e,n){var r=-1,i=Omt,o=t.length,a=!0,s=[],l=s;if(o>=vwt){var c=e?null:pwt(t);if(c)return Y_(c);a=!1,i=c9,l=new sh}else l=e?[]:s;t:for(;++r<o;){var u=t[r],f=e?e(u):u;if(u=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 q_(t,e){return t&&t.length?gwt(t,G_(e)):[]}var ywt=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)},K_=function(){return K_=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},K_.apply(this,arguments)},M9=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 mwt(t,e){var n=K.useRef(),r=K.useRef(),i=K.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),Vc(v)&&ywt("".concat(v))?u[p]=function(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];return vyt(v.apply(void 0,g),h)}:Vt(v)?v.forEach(function(g){c(g,h)}):Hn(v)?c(v,h):h=f})};return K.useEffect(function(){if(n.current&&!_9(r.current,e)){var u=!1;if(r.current){var f=r.current;f.data;var d=M9(f,["data"]);e.data;var h=M9(e,["data"]);u=_9(d,h)}r.current=l9(e),u?n.current.changeData(ge(e,"data")):(c(e),n.current.update(e),n.current.render())}},[e]),K.useEffect(function(){if(!i.current)return function(){return null};r.current||(r.current=l9(e)),c(e);var u=new t(i.current,K_({},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 P9=function(t){return t!==null&&typeof t!="function"&&isFinite(t.length)},bwt=function(t,e){if(!P9(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 xwt=function(t){return typeof t=="function"};var wwt=function(t){return t==null},Owt={}.toString,Z_=function(t,e){return Owt.call(t)==="[object "+e+"]"};const eu=function(t){return Array.isArray?Array.isArray(t):Z_(t,"Array")},_wt=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function Q_(t,e){if(t){var n;if(eu(t))for(var r=0,i=t.length;r<i&&(n=e(t[r],r),n!==!1);r++);else if(_wt(t)){for(var o in t)if(t.hasOwnProperty(o)&&(n=e(t[o],o),n===!1))break}}}var Swt=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return Q_(t,function(n,r){xwt(t)&&r==="prototype"||e.push(r)}),e},Ewt=function(t){return typeof t=="object"&&t!==null},hy=function(t){if(!Ewt(t)||!Z_(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},Mwt=function(t,e,n){if(!eu(t)&&!hy(t))return t;var r=n;return Q_(t,function(i,o){r=e(r,i,o)}),r};const J_=function(t){return Z_(t,"String")};function A9(t,e){for(var n in e)e.hasOwnProperty(n)&&n!=="constructor"&&e[n]!==void 0&&(t[n]=e[n])}function Pwt(t,e,n,r){return e&&A9(t,e),n&&A9(t,n),t}var Awt=5;function Cwt(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 C9(t,e,n,r){n=n||0,r=r||Awt;for(var i in e)if(Cwt(e,i)){var o=e[i];o!==null&&hy(o)?(hy(t[i])||(t[i]={}),n<r?C9(t[i],o,n+1,r):t[i]=e[i]):eu(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var py=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)C9(t,e[r]);return t};const to=function(t,e,n){for(var r=0,i=J_(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return t===void 0||r<i.length?n:t};var kwt=Object.prototype.hasOwnProperty;const k9=function(t,e){if(t===null||!hy(t))return{};var n={};return Q_(e,function(r){kwt.call(t,r)&&(n[r]=t[r])}),n};function Twt(t){return wwt(t)?0:P9(t)?t.length:Object.keys(t).length}const Lwt={field:"value",size:[1,1],round:!1,padding:0,sort:(t,e)=>e.value-t.value,as:["x","y"],ignoreParentValue:!0},Nwt="nodeIndex",lh="childNodeCount",Iwt="nodeAncestor",tS="Invalid field: it must be a string!";function jwt(t,e){const{field:n,fields:r}=t;if(J_(n))return n;if(eu(n))return console.warn(tS),n[0];if(console.warn(`${tS} will try to get fields instead.`),J_(r))return r;if(eu(r)&&r.length)return r[0];throw new TypeError(tS)}function Dwt(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=bwt((((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[Iwt]=s,i[lh]=((a=i.children)===null||a===void 0?void 0:a.length)||0,i[Nwt]=r,e.push(i)})}else t&&t.eachNode&&t.eachNode(n=>{e.push(n)});return e}function Fwt(t,e){e=Pwt({},Lwt,e);const n=e.as;if(!eu(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=jwt(e)}catch(l){console.warn(l)}const o=(l=>Mnt().size(e.size).round(e.round).padding(e.padding)(Wl(l).sum(c=>Twt(c.children)?e.ignoreParentValue?0:c[r]-Mwt(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]})}),Dwt(o)}var $wt=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 nu="sunburst",eS="markType",T9="path",vy="ancestor-node";function Rwt(t){const{data:e,encode:n}=t,{color:r,value:i}=n,a=Fwt(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({},k9(l.data,[i])),{[T9]:h,[vy]:v.data.name}),l);r&&r!==vy&&(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 L9={id:nu,encode:{x:"x",y:"y",key:T9,color:vy,value:"value"},axis:{x:!1,y:!1},style:{[eS]:nu,stroke:"#fff",lineWidth:.5,fillOpacity:"fillOpacity",[lh]:lh,depth:"depth"},state:{active:{zIndex:2,stroke:"#000"},inactive:{zIndex:1,stroke:"#fff"}},legend:!1,interaction:{drillDown:!0},coordinate:{type:"polar",innerRadius:.2}},N9=t=>{const{encode:e,data:n=[],legend:r}=t,i=$wt(t,["encode","data","legend"]),o=Object.assign(Object.assign({},i.coordinate),{innerRadius:Math.max(to(i,["coordinate","innerRadius"],.2),1e-5)}),a=Object.assign(Object.assign({},L9.encode),e),{value:s}=a,l=Rwt({encode:a,data:n});return[py({},L9,Object.assign(Object.assign({type:"rect",data:l,encode:a,tooltip:{title:"path",items:[c=>({name:s,value:c[s]})]}},i),{coordinate:o}))]};N9.props={};var Bwt=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 zwt=t=>t.querySelectorAll(".element").filter(e=>to(e,["style",eS])===nu);function Ywt(t){return gt(t).select(`.${jf}`).node()}const Wwt={rootText:"root",style:{fill:"rgba(0, 0, 0, 0.85)",fontSize:12,y:1},active:{fill:"rgba(0, 0, 0, 0.5)"}};function Gwt(t={}){const{breadCrumb:e={},fixedColor:n=!0}=t,r=py({},Wwt,e);return i=>{const{update:o,setState:a,container:s,view:l,options:c}=i,u=Ywt(s),f=c.marks.find(({id:m})=>m===nu),{state:d}=f,h=new sn;u.appendChild(h);const p=(m,b)=>Bwt(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,k)=>{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 C=new jr({name:w.replace(/\s\/\s$/,""),style:Object.assign(Object.assign({text:P,x:S,depth:k+1},r.style),{y:_})});return h.appendChild(C),S+=C.getBBox().width,S>E&&(_=h.getBBox().height,S=0,A.attr({x:S,y:_}),S+=A.getBBox().width,C.attr({x:S,y:_}),S+=C.getBBox().width),C});[x,...M].forEach((P,k)=>{if(k===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,to(P,["style","depth"]))})})}a("drillDown",x=>{const{marks:w}=x,O=w.map(_=>{if(_.id!==nu&&_.type!=="rect")return _;const{data:S}=_,E=Object.fromEntries(["color"].map(P=>[P,{domain:l.scale[P].getOptions().domain}])),M=S.filter(P=>{const k=P.path;return n&&(P[vy]=k.split(" / ")[b]),m?new RegExp(`^${m}.+`).test(k):!0});return py({},_,n?{data:M}:{data:M,scale:E})});return Object.assign(Object.assign({},x),{marks:O})}),yield o()}),v=m=>{const b=m.target;if(to(b,["style",eS])!==nu||to(b,["markType"])!=="rect"||!to(b,["style",lh]))return;const x=to(b,["__data__","key"]),w=to(b,["style","depth"]);b.style.cursor="pointer",p(x,w)};u.addEventListener("click",v);const g=Swt(Object.assign(Object.assign({},d.active),d.inactive)),y=()=>{zwt(u).forEach(b=>{const x=to(b,["style",lh]);if(to(b,["style","cursor"])!=="pointer"&&x){b.style.cursor="pointer";const O=k9(b.attributes,g);b.addEventListener("mouseenter",()=>{b.attr(d.active)}),b.addEventListener("mouseleave",()=>{b.attr(py(O,d.inactive))})}})};return u.addEventListener("mousemove",y),()=>{h.remove(),u.removeEventListener("click",v),u.removeEventListener("mousemove",y)}}}U.enableCSSParsing=!1;function Hwt(){return{"interaction.drillDown":Gwt,"mark.sunburst":N9}}var gy=function(){return gy=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},gy.apply(this,arguments)},Uwt=k0t(ivt,gy(gy({},DF()),Hwt())),Xt=function(t){var e=Xwt(t),n=e.children,r=n===void 0?[]:n,i=X_(e,[].concat(D9,yy.map(function(c){return c.key}))),o=function(c){var u;return(u=Jwt.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]=Wa({},c[u],f)},s=function(c){Object.keys(c).forEach(function(u){var f=yy.find(function(p){return p.key===u});if(f){var d=f.type,h=f.extend_keys;d?r.push(l(Wa({},E9(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(rS).forEach(function(u){var f=rS[u];if(!owt(c[u]))if(Hn(f)){var d=f.value,h=f.target,p=d(c[u]);a(c,h,p)}else pt(c,f,c[u])}),c};return r.forEach(function(c){var u=Wa({},i,c);l(Wa(c,u))}),s(e),Vwt(e),t},I9=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))},Vwt=function(t){var e=t.children,n=e===void 0?[]:e,r=Object.keys(rS).concat(yy.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){I9(I9([],D9,!0),oS.map(function(o){return o.key}),!0).includes(i)||delete t[i]}),t},Xwt=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[nS]}))})}),e},j9=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))},qwt=function(t,e){if(Vt(e))return e},Wa=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return $2t.apply(void 0,j9(j9([],t,!1),[qwt],!1))},ch=function(){return ch=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},ch.apply(this,arguments)},Kwt=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},Zwt=["renderer"],D9=["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"],nS="__transform__",Qwt="__skipDelCustomKeys__",Qs=function(t,e){return V_(e)?{type:t,available:e}:ch({type:t},e)},rS={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 Qs("stackY",t)}},normalize:{target:"transform",value:function(t){return Qs("normalizeY",t)}},percent:{target:"transform",value:function(t){return Qs("normalizeY",t)}},group:{target:"transform",value:function(t){return Qs("dodgeX",t)}},sort:{target:"transform",value:function(t){return Qs("sortX",t)}},symmetry:{target:"transform",value:function(t){return Qs("symmetryY",t)}},diff:{target:"transform",value:function(t){return Qs("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 V_(t)?{connect:t}:t}}},iS=["xField","yField","seriesField","colorField","keyField","positionField","meta","tooltip","animate","stack","normalize","percent","group","sort","symmetry","diff"],yy=[{key:"annotations",extend_keys:[]},{key:"line",type:"line",extend_keys:iS},{key:"point",type:"point",extend_keys:iS},{key:"area",type:"area",extend_keys:iS}],Jwt=[{key:"transform",callback:function(t,e,n){var r;t[e]=t[e]||[];var i=n.available,o=i===void 0?!0:i,a=Kwt(n,["available"]);o?t[e].push(ch((r={},r[nS]=!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(ch((r={},r[nS]=!0,r),n))}}],oS=[{key:"conversionTag",shape:"ConversionTag"},{key:"axisText",shape:"BidirectionalBarAxisText"}],tOt=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)},eOt=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},F9=function(t){tOt(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=eOt(n,["style"]);return t.call(this,my({style:my({text:"",fontSize:12,textBaseline:"middle",textAlign:"center",fill:"#000",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1},r)},i))||this}return e}(jr),nOt=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)},rOt=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},iOt=function(t){nOt(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=rOt(n,["style"]);return t.call(this,by({style:by({fill:"#eee"},r)},i))||this}return e}(af),oOt=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)}}(),$9=function(t){oOt(e,t);function e(n,r,i){var o=t.call(this,{style:Wa(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(Wa({},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}(_p),aOt=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)}}(),xy=function(){return xy=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},xy.apply(this,arguments)},sOt=function(t){aOt(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=ge(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,k=w.key,A=ge(P,u),C=g/2;if(n){var T=_+M/2,N=S;h.push({points:[[T+C,N-d+x],[T+C,N-m-x],[T,N-x],[T-C,N-m-x],[T-C,N-d+x]],center:[T,N-d/2-x],width:d,value:[f,A],key:k})}else{var T=_,N=S+E/2;h.push({points:[[_-d+x,N-C],[_-m-x,N-C],[T-x,N],[_-m-x,N+C],[_-d+x,N+C]],center:[T-d/2-x,N],width:d,value:[f,A],key:k})}f=A}}),h},e.prototype.render=function(){this.setDirection(),this.drawConversionTag()},e.prototype.setDirection=function(){var n=this.chart.getCoordinate(),r=ge(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 iOt({style:xy({points:u,fill:"#eee"},o),id:"polygon-".concat(h)}),b=new F9({style:xy({x:g,y,text:Vc(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}($9),aS=32,R9=16,B9=48,lOt=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)}}(),uh=function(){return uh=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},uh.apply(this,arguments)},cOt=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},uOt=function(t){lOt(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?q_(i,"x"):q_(i,"y"),a=["title"],s=[],l=this.chart.getContext().views,c=ge(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=ge(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})}),q_(s,"text").length!==s.length&&(s=Object.values(w9(s,"text")).map(function(d){var h,p=d.reduce(function(v,g){return v+(r?g.x:g.y)},0);return uh(uh({},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=cOt(i,["layout","labelFormatter"]);r.forEach(function(l){var c=l.x,u=l.y,f=l.text,d=l.key,h=new F9({style:uh({x:c,y:u,text:Vc(a)?a(f):f,wordWrap:!0,wordWrapWidth:o==="horizontal"?aS*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}($9),fOt={ConversionTag:sOt,BidirectionalBarAxisText:uOt},dOt=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;oS.forEach(function(n){var r,i=n.key,o=n.shape,a=e.config[i];if(a){var s=new fOt[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&&oS.forEach(function(n){var r=n.key,i=e.container.get(r);i==null||i.update()})},t}(),hOt=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)}}(),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)},z9="data-chart-source-type",Rt=function(t){hOt(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 ru(ru({},E9(this.options,Zwt)),{container:this.container})},e.prototype.getSpecOptions=function(){return this.type==="base"||this[Qwt]?ru(ru({},this.options),this.getChartOptions()):this.options},e.prototype.createG2=function(){if(!this.container)throw Error("The container is not initialized!");this.chart=new Uwt(this.getChartOptions()),this.container.setAttribute(z9,"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 dOt(n.chart,n.options)}),this.bindSizeSensor()},e.prototype.update=function(n){this.options=this.mergeOption(n)},e.prototype.mergeOption=function(n){return Wa({},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(z9)},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}(Mx),pOt=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)}}(),vOt=function(t){pOt(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),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)};function gOt(t){var e=t.options,n=e.stack,r=e.tooltip,i=e.xField;if(!n)return t;var o=yy.map(function(s){return s.type}).filter(function(s){return!!s}),a=!1;return o.forEach(function(s){e[s]&&(a=!0,pt(e,[s,"stack"],sS({y1:"y"},typeof n=="object"?n:{})))}),a&&!V_(r)&&!r&&pt(e,"tooltip",{title:i,items:[{channel:"y"}]}),t}function $e(t){return zt(gOt)(t)}function yOt(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 mOt(t){yOt(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 bOt(t){return zt($e,Xt)(t)}var xOt=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)}}(),wOt=function(t){xOt(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 bOt},e}(Rt),iu=function(){return iu=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},iu.apply(this,arguments)};function Y9(t){var e=function(n){var r=n.options;ge(r,"children.length")>1&&pt(r,"children",[{type:"interval"}]);var i=r.scale,o=r.markBackground,a=r.data,s=r.children,l=r.yField,c=ge(i,"y.domain",[]);if(o&&c.length&&Vt(a)){var u="domainMax",f=a.map(function(d){var h;return iu(iu({originData:iu({},d)},X_(d,l)),(h={},h[u]=c[c.length-1],h))});s.unshift(iu({type:"interval",data:f,yField:u,tooltip:!1,style:{fill:"#eee"},label:!1},o))}return n};return zt(e,$e,Xt)(t)}var OOt=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}};$F("shape.interval.bar25D",t)},_Ot=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)}}();OOt();var SOt=function(t){_Ot(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 Y9},e}(Rt),EOt=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}};$F("shape.interval.column25D",t)},MOt=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)}}();EOt();var POt=function(t){MOt(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 Y9},e}(Rt);function AOt(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(!ge(l,"colorField")){var c=ge(l,"yField");pt(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 ge(c,"y.key")||l.forEach(function(f,d){if(!ge(f,"scale.y.key")){var h="child".concat(d,"Scale");pt(f,"scale.y.key",h);var p=f.annotations,v=p===void 0?[]:p;v.length>0&&(pt(f,"scale.y.independent",!1),v.forEach(function(g){pt(g,"scale.y.key",h)})),!u&&a.length>0&&ge(f,"scale.y.independent")===void 0&&(u=!0,pt(f,"scale.y.independent",!1),a.forEach(function(g){pt(g,"scale.y.key",h)}))}}),r};return zt(e,n,$e,Xt)(t)}var COt=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)}}(),W9=function(t){COt(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 AOt},e}(Rt);function kOt(t){var e=function(o){var a=o.options,s=a.xField,l=a.colorField;return l||pt(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?pt(a,"transform",[]):pt(a,"transform",[{type:"symmetryY"}])),!f&&u&&pt(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(w9(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&&(pt(a,"type","spaceFlex"),pt(a,"ratio",[1,1]),pt(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||pt(a,"tooltip",{title:!1,items:[function(u){return{name:u[l],value:u[c]}}]}),o};return zt(e,n,r,i,$e,Xt)(t)}var TOt=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)}}(),LOt=function(t){TOt(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 kOt},e}(Rt);function NOt(t){return zt($e,Xt)(t)}var IOt=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)}}(),jOt=function(t){IOt(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 NOt},e}(Rt),Ga=function(){return Ga=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},Ga.apply(this,arguments)};function DOt(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 Ga(Ga({},f),(d={},d[i]=1,d))});pt(r,"data",u),a&&pt(r,"label",Ga(Ga({},a),{formatter:function(){return 0}})),s!==!1&&pt(r,"tooltip",Ga(Ga({},s),{items:[function(f){return{name:f[l],value:0}}]}))}}return n};return zt(e,Xt)(t)}var FOt=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)}}(),$Ot=function(t){FOt(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 DOt},e}(Rt);function ROt(t){return zt($e,Xt)(t)}var BOt=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)}}(),zOt=function(t){BOt(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 ROt},e}(Rt);function YOt(t){var e=function(n){return pt(n,"options.coordinate",{type:ge(n,"options.coordinateType","polar")}),n};return zt(e,Xt)(t)}var WOt=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)}}(),GOt=function(t){WOt(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 YOt},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)},HOt="__stock-range__",UOt="trend",VOt="up",XOt="down";function qOt(t){var e=function(r){var i=r.options,o=i.data,a=i.yField;return r.options.data=Jc(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[UOt]=l[c]<=l[u]?VOt:XOt,l[HOt]=[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=Jc(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&&pt(r,"options.scale.color.range[0]",s),l&&pt(r,"options.scale.color.range[2]",l),r};return zt(e,n,Xt)(t)}var KOt=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)}}(),ZOt=["#26a69a","#999999","#ef5350"],QOt=function(t){KOt(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:ZOt},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 qOt},e}(Rt);function JOt(t){return zt($e,Xt)(t)}var t_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)}}(),e_t=function(t){t_t(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 JOt},e}(Rt);function n_t(t){return zt($e,Xt)(t)}var r_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)}}(),i_t=function(t){r_t(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 n_t},e}(Rt);function o_t(t){return zt($e,Xt)(t)}var a_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)}}(),s_t=function(t){a_t(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 o_t},e}(Rt),lS=function(){return lS=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},lS.apply(this,arguments)};function l_t(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,lS({},s)),n};return zt(e,$e,Xt)(t)}var c_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)}}(),u_t=function(t){c_t(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 l_t},e}(Rt),cS=function(){return cS=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},cS.apply(this,arguments)};function f_t(t){var e=function(r){var i=r.options,o=i.radius,a=o===void 0?.8:o;return pt(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,cS({},l)),r};return zt(e,n,$e,Xt)(t)}var d_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)}}(),h_t=function(t){d_t(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 f_t},e}(Rt);function p_t(t){return zt(Xt)(t)}var v_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)}}(),g_t=function(t){v_t(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 p_t},e}(Rt),uS="__start__",ou="__end__",fS="__waterfall_value__",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)},y_t=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 m_t(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[uS]=0,c[ou]=c[s],c[fS]=c[s];else{var d=(f=l[ou])!==null&&f!==void 0?f:l[s];c[uS]=d,c[ou]=d+c[s],c[fS]=l[ou]}return c},[]),Object.assign(i,{yField:[uS,ou]})),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=y_t([],a,!0);return u.reduce(function(f,d,h){return h>0&&(d.x1=f[s],d.x2=d[s],d.y1=f[ou]),d},[]),u.shift(),l.push({type:"link",xField:["x1","x2"],yField:"y1",zIndex:-1,data:u,style:dS({stroke:"#697474"},c),label:!1,tooltip:!1}),r};return zt(e,n,$e,Xt)(t)}var b_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)}}(),x_t=function(t){b_t(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:fS,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 m_t},e}(Rt);function w_t(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=ge(s,"[0].transform[0]",{});return tu(a)?(jR(u,{thresholds:hbt(B2t(i.length,a)),y:c}),n):(tu(o)&&jR(u,{thresholds:o,y:c}),n)};return zt(e,$e,Xt)(t)}var O_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)}}(),__t=function(t){O_t(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 w_t},e}(Rt);function S_t(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,$e,Xt)(t)}var E_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)}}(),M_t=function(t){E_t(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 S_t},e}(Rt);function P_t(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,$e,Xt)(t)}var A_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)}}(),C_t=function(t){A_t(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 P_t},e}(Rt);function k_t(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?pt(r,"data",{value:i,transform:o}):delete r.children;else if(ge(i,"type")==="fetch"&&ge(i,"value")){var a=ge(i,"transform");Vt(a)?pt(i,"transform",a.concat(o)):pt(i,"transform",o)}return n};return zt(e,$e,Xt)(t)}var T_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)}}(),L_t=function(t){T_t(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 k_t},e}(Rt),Si=function(){return Si=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},Si.apply(this,arguments)},wy=["#f0efff","#5B8FF9","#3D76DD"];function hS(t,e,n,r){r===void 0&&(r=!0);var i=0,o=!1,a=Jc(t,function(s){var l,c,u=ge(s,[e]);if(iwt(u))return[];if(O9(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),Jc(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 Si({index:0},s)}),i]:[a,i]}function pS(t,e){return new Array(t).fill("").map(function(n,r){return Vt(e)?e[r%e.length]:e})}function N_t(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=hS(g,l,p),m=y[0],b=y[1],x=hS(g,u,p,!1),w=x[0],O=x[1],_=hS(g,d,p,!1),S=_[0],E=_[1],M=ge(a,[l],wy[0]),P=ge(a,[u],wy[1]),k=ge(a,[d],wy[2]),A=[pS(b,M),pS(O,P),pS(E,k)].flat();return i.options.children=Jc(i.options.children,function(C,T){var N=[m,w,S][T],j=[l,u,d][T];return Si(Si({},C),{data:N,encode:Si(Si({},C.encode||{}),{x:p,y:j,color:function(L){var I=L.index,F=tu(I)?"".concat(j,"_").concat(I):j;return v?ge(v,[j,I],F):F}}),style:Si(Si({},C.style||{}),{zIndex:function(L){return-L[j]}}),labels:T!==0?Jc(C.labels,function(L){return Si(Si({},L),{text:j})}):void 0})}),i.options.scale.color.range=A,i.options.legend.color.itemMarker=function(C){return v&&twt(v==null?void 0:v[d],C)||(C==null?void 0:C.replace(/\_\d$/,""))===d?"line":"square"},i},n=function(i){var o=i.options.layout,a=o===void 0?"horizontal":o;return a!=="horizontal"&&pt(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 Wa(d[p],h)}),i};return zt(e,n,r,mOt,Xt)(t)}var I_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)}}(),j_t=function(t){I_t(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:wy}},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 N_t},e}(Rt);function D_t(t){var e=function(n){var r=n.options.data;return n.options.data={value:r},n};return zt(e,$e,Xt)(t)}var F_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)}}(),$_t=function(t){F_t(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 D_t},e}(Rt);function R_t(t){var e=function(n){var r=n.options.percent;return tu(r)&&pt(n,"options.data",r),n};return zt(e,$e,Xt)(t)}var B_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)}}(),z_t=function(t){B_t(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 R_t},e}(Rt);function Y_t(t){return zt($e,Xt)(t)}var 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)}}(),G_t=function(t){W_t(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 Y_t},e}(Rt);function H_t(t){var e=function(n){var r=n.options,i=r.data;return i&&pt(r,"data",{value:i}),n};return zt(e,$e,Xt)(t)}var U_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)}}(),V_t=function(t){U_t(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 H_t},e}(Rt),Js=function(){return Js=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},Js.apply(this,arguments)};function X_t(t){var e=function(i){var o=i.options,a=o.startAngle,s=o.maxAngle,l=o.coordinate,c=tu(a)?a/(2*Math.PI)*360:-90,u=tu(s)?(Number(s)+c)/180*Math.PI:Math.PI;return pt(i,["options","coordinate"],Js(Js({},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||pt(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=ge(l,"y.domain",[]);return a&&s.unshift(Js({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:Js(Js({},c),{startAngle:-Math.PI/2,endAngle:1.5*Math.PI}),animate:!1},a)),i};return zt(e,n,r,$e,Xt)(t)}var 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)}}(),K_t=function(t){q_t(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 X_t},e}(Rt);function Z_t(t){return zt(Xt)(t)}var 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)}}(),J_t=function(t){Q_t(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 Z_t},e}(Rt),Oy=function(){return Oy=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},Oy.apply(this,arguments)};function tSt(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 Oy(Oy({},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 pt(r,"children",l),r.violinType==="polar"&&pt(r,"coordinate",{type:"polar"}),pt(r,"violinType",void 0),n};return zt(e,$e,Xt)(t)}var eSt=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){eSt(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 tSt},e}(Rt),fh=function(){return fh=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},fh.apply(this,arguments)},rSt=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 iSt(t){var e=function(o){var a=o.options,s=a.yField,l=a.children;return l.forEach(function(c,u){pt(c,"yField",s[u])}),o},n=function(o){var a=o.options,s=a.yField,l=a.children,c=a.data;if(D_(c))return o;var u=Vt(ge(c,[0]))?c:[c,c];return l.forEach(function(f,d){pt(f,"data",rSt([],u[d].map(function(h){return fh({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||pt(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?B9:u,d=a.paddingLeft,h=d===void 0?B9:d,p=a.axis;pt(a,"axisText",fh(fh({},(p==null?void 0:p.x)||{}),{layout:l}));var v=s[0],g=s[1];if(l==="vertical")pt(a,"direction","col"),pt(a,"paddingLeft",h),pt(a,"coordinate.transform",c.filter(function(w){return w.type!=="transpose"})),pt(v,"paddingBottom",R9),pt(g,"paddingTop",R9),pt(g,"axis",{x:{position:"top"}}),pt(g,"scale",{y:{range:[0,1]}});else{pt(a,"paddingBottom",f),pt(v,"scale",{y:{range:[0,1]}});var y=v.paddingRight,m=y===void 0?aS:y,b=g.paddingLeft,x=b===void 0?aS:b;pt(v,"paddingRight",m),pt(v,"axis",{x:{position:"right"}}),pt(g,"paddingLeft",x)}return o};return zt(e,n,r,i,$e,Xt)(t)}var oSt=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)}}(),aSt=function(t){oSt(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 iSt},e}(Rt),tl;(function(t){t.color="key",t.d="path"})(tl||(tl={}));function sSt(t){var e=function(n){var r=n.options,i=r.data,o=r.setsField,a=r.sizeField;return Vt(i)&&(pt(r,"data",{type:"inline",value:i,transform:[{type:"venn",sets:o,size:a,as:[tl.color,tl.d]}]}),pt(r,"colorField",o),pt(r,["children","0","encode","d"],tl.d)),pt(n,"options",X_(r,["sizeField","setsField"])),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)}}(),cSt=function(t){lSt(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:tl.color,d:tl.d}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return sSt},e}(Rt);function uSt(t){var e=function(n){return n};return zt(e,Xt)(t)}var fSt=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)}}(),dSt=function(t){fSt(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 uSt},e}(Rt),hSt={Base:vOt,Line:jOt,Column:POt,Pie:$Ot,Area:wOt,Bar:SOt,DualAxes:W9,Funnel:LOt,Scatter:zOt,Radar:GOt,Rose:g_t,Stock:QOt,TinyLine:e_t,TinyArea:i_t,TinyColumn:s_t,TinyProgress:u_t,TinyRing:h_t,Waterfall:x_t,Histogram:__t,Heatmap:M_t,Box:C_t,Sankey:L_t,Bullet:j_t,Gauge:$_t,Liquid:z_t,WordCloud:G_t,Treemap:V_t,RadialBar:K_t,CirclePacking:J_t,Violin:nSt,BidirectionalBar:aSt,Venn:cSt,Mix:W9,Sunburst:dSt},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)},G9=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},el=K.forwardRef(function(t,e){var n=t.chartType,r=n===void 0?"Base":n,i=G9(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=G9(i,["containerStyle","containerAttributes","className","loading","loadingTemplate","errorTemplate"]),p=mwt(hSt[r],h),v=p.chart,g=p.container;return K.useImperativeHandle(e,function(){return v.current}),K.createElement(byt,{errorTemplate:d},u&&K.createElement(yyt,{loadingTemplate:f}),K.createElement("div",vS({className:c,style:a,ref:g},l)))}),gS=function(){return gS=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},gS.apply(this,arguments)},pSt=function(t){return K.createElement(el,gS({},t,{chartType:"Area"}))},yS=function(){return yS=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},yS.apply(this,arguments)},vSt=function(t){return K.createElement(el,yS({},t,{chartType:"Bar"}))},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)},gSt=function(t){return K.createElement(el,mS({},t,{chartType:"Column"}))},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)},ySt=function(t){return K.createElement(el,bS({},t,{chartType:"DualAxes"}))},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)},mSt=function(t){return K.createElement(el,xS({},t,{chartType:"Line"}))},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)},bSt=function(t){return K.createElement(el,wS({},t,{chartType:"Pie"}))},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)},xSt=function(t){return K.createElement(el,OS({},t,{chartType:"Scatter"}))};const{booleanField:_y}=QS,wSt={isStack:t=>_y(tt({name:"isStack",title:"isStack"},t)),smooth:t=>_y(tt({name:"smooth",title:"smooth"},t)),isPercent:t=>_y(tt({name:"isPercent",title:"isPercent"},t)),isGroup:t=>_y(tt({name:"isGroup",title:"isGroup"},t)),size:()=>({size:{title:St("Size"),type:"object","x-decorator":"FormItem","x-component":"Space",properties:{type:{"x-component":"Select","x-component-props":{allowClear:!1},default:"ratio",enum:[{label:St("Aspect ratio"),value:"ratio"},{label:St("Fixed height"),value:"fixed"}]},fixed:{type:"number","x-component":"InputNumber","x-component-props":{min:0,addonAfter:"px"},"x-reactions":[{dependencies:[".type"],fulfill:{state:{visible:"{{$deps[0] === 'fixed'}}"}}}]},ratio:{type:"object","x-component":"Space","x-reactions":[{dependencies:[".type"],fulfill:{state:{visible:"{{$deps[0] === 'ratio'}}"}}}],properties:{width:{type:"number","x-component":"InputNumber","x-component-props":{placeholder:St("Width"),min:1}},colon:{type:"void","x-component":"Text","x-component-props":{children:":"}},height:{type:"number","x-component":"InputNumber","x-component-props":{placeholder:St("Height"),min:1}}}}}}})},OSt=t=>e=>{var c,u;const{size:n={}}=e;let{height:r}=e;!r&&n.type==="fixed"&&(r=n.fixed);const{service:i}=K.useContext(ii),o=K.useRef(null),[a,s]=K.useState(0);K.useEffect(()=>{var p,v;const f=o.current;if(!f||i.loading===!0||r)return;let d=0;n.type==="ratio"&&((p=n.ratio)!=null&&p.width)&&((v=n.ratio)!=null&&v.height)&&(d=n.ratio.height/n.ratio.width);const h=new ResizeObserver(g=>{g.forEach(y=>{if(d){s(y.contentRect.width*d);return}s(y.contentRect.height)})});return h.observe(f),()=>h.disconnect()},[i.loading,r,n.type,(c=n.ratio)==null?void 0:c.width,(u=n.ratio)==null?void 0:u.height]);const l=r||a;return Y.jsx("div",{ref:o,style:l?{height:`${l}px`}:{},children:Y.jsx(t,tt(tt({},e),l?{height:l}:{}))})};class nl extends jy{constructor({name:n,title:r,Component:i,config:o}){super({name:n,title:r,Component:OSt(i),config:["xField","yField","seriesField","size",...o||[]]});ri(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(wSt)}getProps({data:n,general:r,advanced:i,fieldProps:o}){const a=o[r.xField],s=o[r.yField],l=o[r.seriesField];return tt(ht(tt(tt({legend:{color:{itemLabelText:u=>{const f=l==null?void 0:l.transformer;return f?f(u.label):u.label}}},tooltip:{title:u=>{const{[r.xField]:f}=u;return a!=null&&a.transformer?a.transformer(f):f},items:[u=>{const{[r.xField]:f,[r.yField]:d,[r.seriesField]:h}=u;let p="";return h?p=l.transformer?l.transformer(h):h:p=(s==null?void 0:s.label)||r.yField,{name:p,value:s!=null&&s.transformer?s.transformer(d):d}}]},axis:{x:{labelFormatter:u=>{const f=a==null?void 0:a.transformer;return f?f(u):u}},y:{labelFormatter:u=>{const f=s==null?void 0:s.transformer;return f?f(u):u}}},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 _St extends nl{constructor(){super({name:"pie",title:"Pie Chart",Component:bSt});ri(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},"size"]}getProps({data:n,general:r,advanced:i,fieldProps:o}){const a=r.angleField,s=o[a]||{};if(n.some(f=>f[a]<0)){const f=Math.min(...n.map(h=>h[a]));n=n.map(h=>ht(tt({},h),{[a]:h[a]-f}));const d=s.transformer;s.transformer=h=>{const p=h+f;return d?d(p):p}}const c=super.getProps({data:n,general:r,advanced:i,fieldProps:o}),u={items:[f=>{const{[r.colorField]:d,[a]:h}=f,p=d||(s==null?void 0:s.label)||a,v=s==null?void 0:s.transformer;return{name:p,value:v?v(h):h}}]};return ht(tt({},c),{tooltip:i.tooltip||u})}}class SSt extends nl{constructor(){super({name:"dualAxes",title:"Dual Axes Chart",Component:ySt});ri(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"}}}},"size"]}getProps({data:n,general:r,advanced:i,fieldProps:o}){var s;const a=super.getProps({data:n,general:r,advanced:i,fieldProps:o});return ht(tt({},rn.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 ESt=[new nl({name:"line",title:"Line Chart",Component:mSt,config:["smooth","isStack"]}),new nl({name:"area",title:"Area Chart",Component:pSt,config:["smooth",{property:"isStack",defaultValue:!0},"isPercent"]}),new nl({name:"column",title:"Column Chart",Component:gSt,config:["isGroup","isStack","isPercent"]}),new nl({name:"bar",title:"Bar Chart",Component:vSt,config:["isGroup","isStack","isPercent"]}),new _St,new SSt,new nl({name:"scatter",title:"Scatter Chart",Component:xSt})];class Sy extends z.Plugin{constructor(){super(...arguments);ri(this,"charts",new OB)}load(){return Nn(this,null,function*(){this.charts.setGroup("Built-in",[...ESt,...Kz]),this.app.addComponents({ChartV2BlockInitializer:Uz,ChartV2BlockDesigner:Wz,ChartV2Block:Yz}),this.app.schemaInitializerManager.add(ZS),this.app.schemaInitializerManager.add(Hz),this.app.schemaInitializerManager.add(US),this.app.schemaInitializerManager.add(_z),this.app.schemaInitializerManager.add(XS),this.app.schemaInitializerManager.add(Cz);const n=this.app.schemaInitializerManager.get("page:addBlock");n==null||n.add("dataBlocks.chartV2",{title:St("Charts"),Component:"ChartV2BlockInitializer"}),this.app.schemaInitializerManager.addItem("mobile:addBlock","dataBlocks.chartV2",{title:St("Charts"),Component:"ChartV2BlockInitializer"})})}}ct.Chart=jy,ct.ChartConfigContext=Pi,ct.default=Sy,Object.defineProperties(ct,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.3.0-
|
|
11
|
+
"@nocobase/client": "1.3.0-beta",
|
|
12
12
|
"dayjs": "1.11.10",
|
|
13
13
|
"@formily/react": "2.3.0",
|
|
14
14
|
"@formily/shared": "2.3.0",
|
|
15
15
|
"lodash": "4.17.21",
|
|
16
|
-
"@nocobase/cache": "1.3.0-
|
|
17
|
-
"@nocobase/server": "1.3.0-
|
|
16
|
+
"@nocobase/cache": "1.3.0-beta",
|
|
17
|
+
"@nocobase/server": "1.3.0-beta",
|
|
18
18
|
"react": "18.2.0",
|
|
19
19
|
"@emotion/css": "11.11.2",
|
|
20
20
|
"@ant-design/icons": "5.2.6",
|
|
@@ -22,9 +22,9 @@ module.exports = {
|
|
|
22
22
|
"antd": "5.12.8",
|
|
23
23
|
"@formily/antd-v5": "1.1.9",
|
|
24
24
|
"@formily/core": "2.3.0",
|
|
25
|
-
"@nocobase/utils": "1.3.0-
|
|
25
|
+
"@nocobase/utils": "1.3.0-beta",
|
|
26
26
|
"react-i18next": "11.18.6",
|
|
27
27
|
"sequelize": "6.35.2",
|
|
28
|
-
"@nocobase/actions": "1.3.0-
|
|
29
|
-
"@nocobase/database": "1.3.0-
|
|
28
|
+
"@nocobase/actions": "1.3.0-beta",
|
|
29
|
+
"@nocobase/database": "1.3.0-beta"
|
|
30
30
|
};
|
package/dist/locale/en-US.json
CHANGED
package/dist/locale/zh-CN.json
CHANGED
|
@@ -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-08-
|
|
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-08-25T16:22:12.811Z"}
|
|
@@ -97,7 +97,7 @@ const parseBuilder = async (ctx, next) => {
|
|
|
97
97
|
const fieldMap = {};
|
|
98
98
|
let hasAgg = false;
|
|
99
99
|
measures.forEach((measure) => {
|
|
100
|
-
const { field, aggregation, alias } = measure;
|
|
100
|
+
const { field, aggregation, alias, distinct } = measure;
|
|
101
101
|
const attribute = [];
|
|
102
102
|
const col = sequelize.col(field);
|
|
103
103
|
if (aggregation) {
|
|
@@ -105,7 +105,7 @@ const parseBuilder = async (ctx, next) => {
|
|
|
105
105
|
throw new Error(`Invalid aggregation function: ${aggregation}`);
|
|
106
106
|
}
|
|
107
107
|
hasAgg = true;
|
|
108
|
-
attribute.push(sequelize.fn(aggregation, col));
|
|
108
|
+
attribute.push(sequelize.fn(aggregation, distinct ? sequelize.fn("DISTINCT", col) : col));
|
|
109
109
|
} else {
|
|
110
110
|
attribute.push(col);
|
|
111
111
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-data-visualization",
|
|
3
|
-
"version": "1.3.0-
|
|
3
|
+
"version": "1.3.0-beta",
|
|
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.",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@nocobase/test": "1.x",
|
|
35
35
|
"@nocobase/utils": "1.x"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "175a86dcc41577bff4f94ae614ebe778fd532f3f",
|
|
38
38
|
"keywords": [
|
|
39
39
|
"Blocks"
|
|
40
40
|
]
|