@advt-gpt-chart/package 3.0.16 → 3.0.17

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/index.es.js CHANGED
@@ -181679,7 +181679,7 @@ function XQe() {
181679
181679
  throw new Error("useGPTVisContext must be used within a GPTVisContext.Provider");
181680
181680
  return i;
181681
181681
  }
181682
- const Kxi = "3.0.16", Tce = /* @__PURE__ */ Qy({});
181682
+ const Kxi = "3.0.17", Tce = /* @__PURE__ */ Qy({});
181683
181683
  function KQe(i) {
181684
181684
  var e, t, n = "";
181685
181685
  if (typeof i == "string" || typeof i == "number") n += i;
@@ -183170,7 +183170,7 @@ const lwi = (i) => i ? i.map((e) => {
183170
183170
  metrics: [],
183171
183171
  timeConstraint: {},
183172
183172
  filters: {},
183173
- orders: (u == null ? void 0 : u.orders) || {},
183173
+ orders: {},
183174
183174
  limits: (u == null ? void 0 : u.limits) || {},
183175
183175
  orgId: a,
183176
183176
  queryType: s
@@ -183185,7 +183185,7 @@ const lwi = (i) => i ? i.map((e) => {
183185
183185
  }).filter((g) => g !== null && g.trim() !== "");
183186
183186
  return t == null || t.forEach((g) => {
183187
183187
  const p = (g == null ? void 0 : g.displayName) || (g == null ? void 0 : g.label);
183188
- c.metrics.push(p), c.dimensions[p] = h, c.metricDefinitions[p] = g.metricDefinitions, c.filters[p] = d || [], c.timeConstraint[p] = e || {}, l && l.length > 0 && (c.orders[p] = l);
183188
+ c.metrics.push(p), c.dimensions[p] = h, c.metricDefinitions[p] = g.metricDefinitions, c.filters[p] = d || [], c.timeConstraint[p] = e || {}, c.orders[p] = l || {};
183189
183189
  }), VR.post({ url: "/metricInsight/api/v1/mql/query", data: c }).then((g) => {
183190
183190
  var p;
183191
183191
  return ((p = g == null ? void 0 : g.data) == null ? void 0 : p[0]) || [];
@@ -202943,15 +202943,16 @@ const n9i = Za.div`
202943
202943
  }) => {
202944
202944
  var f, g;
202945
202945
  const [l, u] = Nn(!1), c = (p) => {
202946
- const m = t == null ? void 0 : t.find((v) => v.value === p.key);
202947
- if (m != null && m.englishName || m != null && m.label) {
202948
- const v = {
202949
- [m.englishName || (m == null ? void 0 : m.label)]: {
202946
+ const m = t == null ? void 0 : t.find((b) => b.value === p.key);
202947
+ let v = "";
202948
+ if ((m == null ? void 0 : m.type) === "metric" && (v = m == null ? void 0 : m.label), (m == null ? void 0 : m.type) === "dimension" && (v = (m == null ? void 0 : m.value) || (m == null ? void 0 : m.label)), v) {
202949
+ const b = {
202950
+ [v]: {
202950
202951
  type: m == null ? void 0 : m.type,
202951
202952
  direction: void 0
202952
202953
  }
202953
202954
  };
202954
- o == null || o(v);
202955
+ o == null || o(b);
202955
202956
  }
202956
202957
  u(!1);
202957
202958
  }, h = (p) => {
Binary file
package/dist/index.umd.js CHANGED
@@ -10586,7 +10586,7 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
10586
10586
  `,$T=({loadingText:i})=>_e.jsxs(z3i,{className:"gpt-vis-loading",children:[_e.jsx("div",{className:"gpt-vis-loading-icon",children:_e.jsxs("div",{className:"loading-svg-ele",children:[_e.jsx("svg",{width:"0",height:"0",children:_e.jsx("defs",{children:_e.jsxs("linearGradient",{id:"loadingCircleStrokeGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[_e.jsx("stop",{offset:"0%",stopColor:"#008CD6"}),_e.jsx("stop",{offset:"100%",stopColor:"#00CC66"})]})})}),_e.jsx("svg",{viewBox:"22 22 44 44",children:_e.jsx("circle",{className:"loading-svg-circle",cx:"44",cy:"44",r:"20.2",fill:"none",strokeWidth:"3.6"})})]})}),_e.jsx("p",{children:i})]});var Uae=new Map,NL=new WeakMap,OGe=0,W3i;function V3i(i){return i?(NL.has(i)||(OGe+=1,NL.set(i,OGe.toString())),NL.get(i)):"0"}function j3i(i){return Object.keys(i).sort().filter(e=>i[e]!==void 0).map(e=>`${e}_${e==="root"?V3i(i.root):i[e]}`).toString()}function U3i(i){const e=j3i(i);let t=Uae.get(e);if(!t){const n=new Map;let r;const o=new IntersectionObserver(a=>{a.forEach(s=>{var l;const u=s.isIntersecting&&r.some(c=>s.intersectionRatio>=c);i.trackVisibility&&typeof s.isVisible=="undefined"&&(s.isVisible=u),(l=n.get(s.target))==null||l.forEach(c=>{c(u,s)})})},i);r=o.thresholds||(Array.isArray(i.threshold)?i.threshold:[i.threshold||0]),t={id:e,observer:o,elements:n},Uae.set(e,t)}return t}function G3i(i,e,t={},n=W3i){if(typeof window.IntersectionObserver=="undefined"&&n!==void 0){const l=i.getBoundingClientRect();return e(n,{isIntersecting:n,target:i,intersectionRatio:typeof t.threshold=="number"?t.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:r,observer:o,elements:a}=U3i(t),s=a.get(i)||[];return a.has(i)||a.set(i,s),s.push(e),o.observe(i),function(){s.splice(s.indexOf(e),1),s.length===0&&(a.delete(i),o.unobserve(i)),a.size===0&&(o.disconnect(),Uae.delete(r))}}function q3i({threshold:i,delay:e,trackVisibility:t,rootMargin:n,root:r,triggerOnce:o,skip:a,initialInView:s,fallbackInView:l,onChange:u}={}){var c;const[h,d]=M.useState(null),f=M.useRef(u),g=M.useRef(s),[p,m]=M.useState({inView:!!s,entry:void 0});f.current=u,M.useEffect(()=>{if(g.current===void 0&&(g.current=s),a||!h)return;let _;return _=G3i(h,(S,x)=>{const w=g.current;g.current=S,!(w===void 0&&!S)&&(m({inView:S,entry:x}),f.current&&f.current(S,x),x.isIntersecting&&o&&_&&(_(),_=void 0))},{root:r,rootMargin:n,threshold:i,trackVisibility:t,delay:e},l),()=>{_&&_()}},[Array.isArray(i)?i.toString():i,h,r,n,o,a,t,l,e]);const v=(c=p.entry)==null?void 0:c.target,b=M.useRef(void 0);!h&&v&&!o&&!a&&b.current!==v&&(b.current=v,m({inView:!!s,entry:void 0}),g.current=s);const y=[d,p.inView,p.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}const Y3i=Ya.div`
10587
10587
  height: 100%;
10588
10588
  width: 100%;
10589
- `,Gae=({visible:i,title:e,message:t})=>i?_e.jsx(Y3i,{className:"error-container",children:_e.jsx(JA,{status:"error",title:e,subTitle:t})}):null,IGe=ce.createContext(null);function DGe(){const i=ce.useContext(IGe);if(i===void 0||Object.keys(i).length===0)throw new Error("useGPTVisContext must be used within a GPTVisContext.Provider");return i}const PGe="3.0.16",qae=ce.createContext({});function LGe(i){var e,t,n="";if(typeof i=="string"||typeof i=="number")n+=i;else if(typeof i=="object")if(Array.isArray(i)){var r=i.length;for(e=0;e<r;e++)i[e]&&(t=LGe(i[e]))&&(n&&(n+=" "),n+=t)}else for(t in i)i[t]&&(n&&(n+=" "),n+=t);return n}function Yae(){for(var i,e,t=0,n="",r=arguments.length;t<r;t++)(i=arguments[t])&&(e=LGe(i))&&(n&&(n+=" "),n+=e);return n}const X3i={aliceblue:"9ehhb",antiquewhite:"9sgk7",aqua:"1ekf",aquamarine:"4zsno",azure:"9eiv3",beige:"9lhp8",bisque:"9zg04",black:"0",blanchedalmond:"9zhe5",blue:"73",blueviolet:"5e31e",brown:"6g016",burlywood:"8ouiv",cadetblue:"3qba8",chartreuse:"4zshs",chocolate:"87k0u",coral:"9yvyo",cornflowerblue:"3xael",cornsilk:"9zjz0",crimson:"8l4xo",cyan:"1ekf",darkblue:"3v",darkcyan:"rkb",darkgoldenrod:"776yz",darkgray:"6mbhl",darkgreen:"jr4",darkgrey:"6mbhl",darkkhaki:"7ehkb",darkmagenta:"5f91n",darkolivegreen:"3bzfz",darkorange:"9yygw",darkorchid:"5z6x8",darkred:"5f8xs",darksalmon:"9441m",darkseagreen:"5lwgf",darkslateblue:"2th1n",darkslategray:"1ugcv",darkslategrey:"1ugcv",darkturquoise:"14up",darkviolet:"5rw7n",deeppink:"9yavn",deepskyblue:"11xb",dimgray:"442g9",dimgrey:"442g9",dodgerblue:"16xof",firebrick:"6y7tu",floralwhite:"9zkds",forestgreen:"1cisi",fuchsia:"9y70f",gainsboro:"8m8kc",ghostwhite:"9pq0v",goldenrod:"8j4f4",gold:"9zda8",gray:"50i2o",green:"pa8",greenyellow:"6senj",grey:"50i2o",honeydew:"9eiuo",hotpink:"9yrp0",indianred:"80gnw",indigo:"2xcoy",ivory:"9zldc",khaki:"9edu4",lavenderblush:"9ziet",lavender:"90c8q",lawngreen:"4vk74",lemonchiffon:"9zkct",lightblue:"6s73a",lightcoral:"9dtog",lightcyan:"8s1rz",lightgoldenrodyellow:"9sjiq",lightgray:"89jo3",lightgreen:"5nkwg",lightgrey:"89jo3",lightpink:"9z6wx",lightsalmon:"9z2ii",lightseagreen:"19xgq",lightskyblue:"5arju",lightslategray:"4nwk9",lightslategrey:"4nwk9",lightsteelblue:"6wau6",lightyellow:"9zlcw",lime:"1edc",limegreen:"1zcxe",linen:"9shk6",magenta:"9y70f",maroon:"4zsow",mediumaquamarine:"40eju",mediumblue:"5p",mediumorchid:"79qkz",mediumpurple:"5r3rv",mediumseagreen:"2d9ip",mediumslateblue:"4tcku",mediumspringgreen:"1di2",mediumturquoise:"2uabw",mediumvioletred:"7rn9h",midnightblue:"z980",mintcream:"9ljp6",mistyrose:"9zg0x",moccasin:"9zfzp",navajowhite:"9zest",navy:"3k",oldlace:"9wq92",olive:"50hz4",olivedrab:"472ub",orange:"9z3eo",orangered:"9ykg0",orchid:"8iu3a",palegoldenrod:"9bl4a",palegreen:"5yw0o",paleturquoise:"6v4ku",palevioletred:"8k8lv",papayawhip:"9zi6t",peachpuff:"9ze0p",peru:"80oqn",pink:"9z8wb",plum:"8nba5",powderblue:"6wgdi",purple:"4zssg",rebeccapurple:"3zk49",red:"9y6tc",rosybrown:"7cv4f",royalblue:"2jvtt",saddlebrown:"5fmkz",salmon:"9rvci",sandybrown:"9jn1c",seagreen:"1tdnb",seashell:"9zje6",sienna:"6973h",silver:"7ir40",skyblue:"5arjf",slateblue:"45e4t",slategray:"4e100",slategrey:"4e100",snow:"9zke2",springgreen:"1egv",steelblue:"2r1kk",tan:"87yx8",teal:"pds",thistle:"8ggk8",tomato:"9yqfb",turquoise:"2j4r4",violet:"9b10u",wheat:"9ld4j",white:"9zldr",whitesmoke:"9lhpx",yellow:"9zl6o",yellowgreen:"61fzm"},ou=Math.round;function Xae(i,e){const t=i.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],n=t.map(r=>parseFloat(r));for(let r=0;r<3;r+=1)n[r]=e(n[r]||0,t[r]||"",r);return t[3]?n[3]=t[3].includes("%")?n[3]/100:n[3]:n[3]=1,n}const BGe=(i,e,t)=>t===0?i:i/100;function zT(i,e){const t=e||255;return i>t?t:i<0?0:i}class yS{constructor(e){sc(this,"isValid",!0);sc(this,"r",0);sc(this,"g",0);sc(this,"b",0);sc(this,"a",1);sc(this,"_h");sc(this,"_s");sc(this,"_l");sc(this,"_v");sc(this,"_max");sc(this,"_min");sc(this,"_brightness");function t(n){return n[0]in e&&n[1]in e&&n[2]in e}if(e)if(typeof e=="string"){let r=function(o){return n.startsWith(o)};const n=e.trim();if(/^#?[A-F\d]{3,8}$/i.test(n))this.fromHexString(n);else if(r("rgb"))this.fromRgbString(n);else if(r("hsl"))this.fromHslString(n);else if(r("hsv")||r("hsb"))this.fromHsvString(n);else{const o=X3i[n.toLowerCase()];o&&this.fromHexString(parseInt(o,36).toString(16).padStart(6,"0"))}}else if(e instanceof yS)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(t("rgb"))this.r=zT(e.r),this.g=zT(e.g),this.b=zT(e.b),this.a=typeof e.a=="number"?zT(e.a,1):1;else if(t("hsl"))this.fromHsl(e);else if(t("hsv"))this.fromHsv(e);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e))}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(o){const a=o/255;return a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)}const t=e(this.r),n=e(this.g),r=e(this.b);return .2126*t+.7152*n+.0722*r}getHue(){if(typeof this._h=="undefined"){const e=this.getMax()-this.getMin();e===0?this._h=0:this._h=ou(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){if(typeof this._s=="undefined"){const e=this.getMax()-this.getMin();e===0?this._s=0:this._s=e/this.getMax()}return this._s}getLightness(){return typeof this._l=="undefined"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v=="undefined"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness=="undefined"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){const t=this.getHue(),n=this.getSaturation();let r=this.getLightness()-e/100;return r<0&&(r=0),this._c({h:t,s:n,l:r,a:this.a})}lighten(e=10){const t=this.getHue(),n=this.getSaturation();let r=this.getLightness()+e/100;return r>1&&(r=1),this._c({h:t,s:n,l:r,a:this.a})}mix(e,t=50){const n=this._c(e),r=t/100,o=s=>(n[s]-this[s])*r+this[s],a={r:ou(o("r")),g:ou(o("g")),b:ou(o("b")),a:ou(o("a")*100)/100};return this._c(a)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const t=this._c(e),n=this.a+t.a*(1-this.a),r=o=>ou((this[o]*this.a+t[o]*t.a*(1-this.a))/n);return this._c({r:r("r"),g:r("g"),b:r("b"),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const t=(this.r||0).toString(16);e+=t.length===2?t:"0"+t;const n=(this.g||0).toString(16);e+=n.length===2?n:"0"+n;const r=(this.b||0).toString(16);if(e+=r.length===2?r:"0"+r,typeof this.a=="number"&&this.a>=0&&this.a<1){const o=ou(this.a*255).toString(16);e+=o.length===2?o:"0"+o}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),t=ou(this.getSaturation()*100),n=ou(this.getLightness()*100);return this.a!==1?`hsla(${e},${t}%,${n}%,${this.a})`:`hsl(${e},${t}%,${n}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,t,n){const r=this.clone();return r[e]=zT(t,n),r}_c(e){return new this.constructor(e)}getMax(){return typeof this._max=="undefined"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min=="undefined"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const t=e.replace("#","");function n(r,o){return parseInt(t[r]+t[o||r],16)}t.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=t[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=t[6]?n(6,7)/255:1)}fromHsl({h:e,s:t,l:n,a:r}){if(this._h=e%360,this._s=t,this._l=n,this.a=typeof r=="number"?r:1,t<=0){const d=ou(n*255);this.r=d,this.g=d,this.b=d}let o=0,a=0,s=0;const l=e/60,u=(1-Math.abs(2*n-1))*t,c=u*(1-Math.abs(l%2-1));l>=0&&l<1?(o=u,a=c):l>=1&&l<2?(o=c,a=u):l>=2&&l<3?(a=u,s=c):l>=3&&l<4?(a=c,s=u):l>=4&&l<5?(o=c,s=u):l>=5&&l<6&&(o=u,s=c);const h=n-u/2;this.r=ou((o+h)*255),this.g=ou((a+h)*255),this.b=ou((s+h)*255)}fromHsv({h:e,s:t,v:n,a:r}){this._h=e%360,this._s=t,this._v=n,this.a=typeof r=="number"?r:1;const o=ou(n*255);if(this.r=o,this.g=o,this.b=o,t<=0)return;const a=e/60,s=Math.floor(a),l=a-s,u=ou(n*(1-t)*255),c=ou(n*(1-t*l)*255),h=ou(n*(1-t*(1-l))*255);switch(s){case 0:this.g=h,this.b=u;break;case 1:this.r=c,this.b=u;break;case 2:this.r=u,this.b=h;break;case 3:this.r=u,this.g=c;break;case 4:this.r=h,this.g=u;break;case 5:default:this.g=u,this.b=c;break}}fromHsvString(e){const t=Xae(e,BGe);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){const t=Xae(e,BGe);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){const t=Xae(e,(n,r)=>r.includes("%")?ou(n/100*255):n);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}}const HL=2,FGe=.16,K3i=.05,Z3i=.05,Q3i=.15,NGe=5,HGe=4,J3i=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function $Ge(i,e,t){let n;return Math.round(i.h)>=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-HL*e:Math.round(i.h)+HL*e:n=t?Math.round(i.h)+HL*e:Math.round(i.h)-HL*e,n<0?n+=360:n>=360&&(n-=360),n}function zGe(i,e,t){if(i.h===0&&i.s===0)return i.s;let n;return t?n=i.s-FGe*e:e===HGe?n=i.s+FGe:n=i.s+K3i*e,n>1&&(n=1),t&&e===NGe&&n>.1&&(n=.1),n<.06&&(n=.06),Math.round(n*100)/100}function WGe(i,e,t){let n;return t?n=i.v+Z3i*e:n=i.v-Q3i*e,n=Math.max(0,Math.min(1,n)),Math.round(n*100)/100}function exi(i,e={}){const t=[],n=new yS(i),r=n.toHsv();for(let o=NGe;o>0;o-=1){const a=new yS({h:$Ge(r,o,!0),s:zGe(r,o,!0),v:WGe(r,o,!0)});t.push(a)}t.push(n);for(let o=1;o<=HGe;o+=1){const a=new yS({h:$Ge(r,o),s:zGe(r,o),v:WGe(r,o)});t.push(a)}return e.theme==="dark"?J3i.map(({index:o,amount:a})=>new yS(e.backgroundColor||"#141414").mix(t[o],a).toHexString()):t.map(o=>o.toHexString())}const Kae=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];Kae.primary=Kae[5];function txi(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}function ixi(i,e){if(!i)return!1;if(i.contains)return i.contains(e);let t=e;for(;t;){if(t===i)return!0;t=t.parentNode}return!1}const VGe="data-rc-order",jGe="data-rc-priority",nxi="rc-util-key",Zae=new Map;function UGe({mark:i}={}){return i?i.startsWith("data-")?i:`data-${i}`:nxi}function Qae(i){return i.attachTo?i.attachTo:document.querySelector("head")||document.body}function rxi(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function Jae(i){return Array.from((Zae.get(i)||i).children).filter(e=>e.tagName==="STYLE")}function GGe(i,e={}){if(!txi())return null;const{csp:t,prepend:n,priority:r=0}=e,o=rxi(n),a=o==="prependQueue",s=document.createElement("style");s.setAttribute(VGe,o),a&&r&&s.setAttribute(jGe,`${r}`),t!=null&&t.nonce&&(s.nonce=t==null?void 0:t.nonce),s.innerHTML=i;const l=Qae(e),{firstChild:u}=l;if(n){if(a){const c=(e.styles||Jae(l)).filter(h=>{if(!["prepend","prependQueue"].includes(h.getAttribute(VGe)))return!1;const d=Number(h.getAttribute(jGe)||0);return r>=d});if(c.length)return l.insertBefore(s,c[c.length-1].nextSibling),s}l.insertBefore(s,u)}else l.appendChild(s);return s}function oxi(i,e={}){let{styles:t}=e;return t||(t=Jae(Qae(e))),t.find(n=>n.getAttribute(UGe(e))===i)}function axi(i,e){const t=Zae.get(i);if(!t||!ixi(document,t)){const n=GGe("",e),{parentNode:r}=n;Zae.set(i,r),i.removeChild(n)}}function sxi(i,e,t={}){var l,u,c;const n=Qae(t),r=Jae(n),o=Ii(Me({},t),{styles:r});axi(n,o);const a=oxi(e,o);if(a)return(l=o.csp)!=null&&l.nonce&&a.nonce!==((u=o.csp)==null?void 0:u.nonce)&&(a.nonce=(c=o.csp)==null?void 0:c.nonce),a.innerHTML!==i&&(a.innerHTML=i),a;const s=GGe(i,o);return s.setAttribute(UGe(o),e),s}function qGe(i){var e;return(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i)}function lxi(i){return qGe(i)instanceof ShadowRoot}function uxi(i){return lxi(i)?qGe(i):null}var YGe={};let ese={};const tse=[],cxi=i=>{tse.push(i)};function hxi(i,e){if(YGe.NODE_ENV!=="production"&&!i&&console!==void 0){const t=tse.reduce((n,r)=>r(n!=null?n:"","warning"),e);t&&console.error(`Warning: ${t}`)}}function dxi(i,e){if(YGe.NODE_ENV!=="production"&&!i&&console!==void 0){const t=tse.reduce((n,r)=>r(n!=null?n:"","note"),e);t&&console.warn(`Note: ${t}`)}}function fxi(){ese={}}function XGe(i,e,t){!e&&!ese[t]&&(i(!1,t),ese[t]=!0)}function $L(i,e){XGe(hxi,i,e)}function gxi(i,e){XGe(dxi,i,e)}$L.preMessage=cxi,$L.resetWarned=fxi,$L.noteOnce=gxi;function pxi(i){return i.replace(/-(.)/g,(e,t)=>t.toUpperCase())}function ise(i,e){$L(i,`[@ant-design/icons] ${e}`)}function KGe(i){return typeof i=="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(typeof i.icon=="object"||typeof i.icon=="function")}function ZGe(i={}){return Object.keys(i).reduce((e,t)=>{const n=i[t];switch(t){case"class":e.className=n,delete e.class;break;default:delete e[t],e[pxi(t)]=n}return e},{})}function nse(i,e,t){return t?ce.createElement(i.tag,Me(Me({key:e},ZGe(i.attrs)),t),(i.children||[]).map((n,r)=>nse(n,`${e}-${i.tag}-${r}`))):ce.createElement(i.tag,Me({key:e},ZGe(i.attrs)),(i.children||[]).map((n,r)=>nse(n,`${e}-${i.tag}-${r}`)))}function QGe(i){return exi(i)[0]}function JGe(i){return i?Array.isArray(i)?i:[i]:[]}const mxi={width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"},vxi=`
10589
+ `,Gae=({visible:i,title:e,message:t})=>i?_e.jsx(Y3i,{className:"error-container",children:_e.jsx(JA,{status:"error",title:e,subTitle:t})}):null,IGe=ce.createContext(null);function DGe(){const i=ce.useContext(IGe);if(i===void 0||Object.keys(i).length===0)throw new Error("useGPTVisContext must be used within a GPTVisContext.Provider");return i}const PGe="3.0.17",qae=ce.createContext({});function LGe(i){var e,t,n="";if(typeof i=="string"||typeof i=="number")n+=i;else if(typeof i=="object")if(Array.isArray(i)){var r=i.length;for(e=0;e<r;e++)i[e]&&(t=LGe(i[e]))&&(n&&(n+=" "),n+=t)}else for(t in i)i[t]&&(n&&(n+=" "),n+=t);return n}function Yae(){for(var i,e,t=0,n="",r=arguments.length;t<r;t++)(i=arguments[t])&&(e=LGe(i))&&(n&&(n+=" "),n+=e);return n}const X3i={aliceblue:"9ehhb",antiquewhite:"9sgk7",aqua:"1ekf",aquamarine:"4zsno",azure:"9eiv3",beige:"9lhp8",bisque:"9zg04",black:"0",blanchedalmond:"9zhe5",blue:"73",blueviolet:"5e31e",brown:"6g016",burlywood:"8ouiv",cadetblue:"3qba8",chartreuse:"4zshs",chocolate:"87k0u",coral:"9yvyo",cornflowerblue:"3xael",cornsilk:"9zjz0",crimson:"8l4xo",cyan:"1ekf",darkblue:"3v",darkcyan:"rkb",darkgoldenrod:"776yz",darkgray:"6mbhl",darkgreen:"jr4",darkgrey:"6mbhl",darkkhaki:"7ehkb",darkmagenta:"5f91n",darkolivegreen:"3bzfz",darkorange:"9yygw",darkorchid:"5z6x8",darkred:"5f8xs",darksalmon:"9441m",darkseagreen:"5lwgf",darkslateblue:"2th1n",darkslategray:"1ugcv",darkslategrey:"1ugcv",darkturquoise:"14up",darkviolet:"5rw7n",deeppink:"9yavn",deepskyblue:"11xb",dimgray:"442g9",dimgrey:"442g9",dodgerblue:"16xof",firebrick:"6y7tu",floralwhite:"9zkds",forestgreen:"1cisi",fuchsia:"9y70f",gainsboro:"8m8kc",ghostwhite:"9pq0v",goldenrod:"8j4f4",gold:"9zda8",gray:"50i2o",green:"pa8",greenyellow:"6senj",grey:"50i2o",honeydew:"9eiuo",hotpink:"9yrp0",indianred:"80gnw",indigo:"2xcoy",ivory:"9zldc",khaki:"9edu4",lavenderblush:"9ziet",lavender:"90c8q",lawngreen:"4vk74",lemonchiffon:"9zkct",lightblue:"6s73a",lightcoral:"9dtog",lightcyan:"8s1rz",lightgoldenrodyellow:"9sjiq",lightgray:"89jo3",lightgreen:"5nkwg",lightgrey:"89jo3",lightpink:"9z6wx",lightsalmon:"9z2ii",lightseagreen:"19xgq",lightskyblue:"5arju",lightslategray:"4nwk9",lightslategrey:"4nwk9",lightsteelblue:"6wau6",lightyellow:"9zlcw",lime:"1edc",limegreen:"1zcxe",linen:"9shk6",magenta:"9y70f",maroon:"4zsow",mediumaquamarine:"40eju",mediumblue:"5p",mediumorchid:"79qkz",mediumpurple:"5r3rv",mediumseagreen:"2d9ip",mediumslateblue:"4tcku",mediumspringgreen:"1di2",mediumturquoise:"2uabw",mediumvioletred:"7rn9h",midnightblue:"z980",mintcream:"9ljp6",mistyrose:"9zg0x",moccasin:"9zfzp",navajowhite:"9zest",navy:"3k",oldlace:"9wq92",olive:"50hz4",olivedrab:"472ub",orange:"9z3eo",orangered:"9ykg0",orchid:"8iu3a",palegoldenrod:"9bl4a",palegreen:"5yw0o",paleturquoise:"6v4ku",palevioletred:"8k8lv",papayawhip:"9zi6t",peachpuff:"9ze0p",peru:"80oqn",pink:"9z8wb",plum:"8nba5",powderblue:"6wgdi",purple:"4zssg",rebeccapurple:"3zk49",red:"9y6tc",rosybrown:"7cv4f",royalblue:"2jvtt",saddlebrown:"5fmkz",salmon:"9rvci",sandybrown:"9jn1c",seagreen:"1tdnb",seashell:"9zje6",sienna:"6973h",silver:"7ir40",skyblue:"5arjf",slateblue:"45e4t",slategray:"4e100",slategrey:"4e100",snow:"9zke2",springgreen:"1egv",steelblue:"2r1kk",tan:"87yx8",teal:"pds",thistle:"8ggk8",tomato:"9yqfb",turquoise:"2j4r4",violet:"9b10u",wheat:"9ld4j",white:"9zldr",whitesmoke:"9lhpx",yellow:"9zl6o",yellowgreen:"61fzm"},ou=Math.round;function Xae(i,e){const t=i.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],n=t.map(r=>parseFloat(r));for(let r=0;r<3;r+=1)n[r]=e(n[r]||0,t[r]||"",r);return t[3]?n[3]=t[3].includes("%")?n[3]/100:n[3]:n[3]=1,n}const BGe=(i,e,t)=>t===0?i:i/100;function zT(i,e){const t=e||255;return i>t?t:i<0?0:i}class yS{constructor(e){sc(this,"isValid",!0);sc(this,"r",0);sc(this,"g",0);sc(this,"b",0);sc(this,"a",1);sc(this,"_h");sc(this,"_s");sc(this,"_l");sc(this,"_v");sc(this,"_max");sc(this,"_min");sc(this,"_brightness");function t(n){return n[0]in e&&n[1]in e&&n[2]in e}if(e)if(typeof e=="string"){let r=function(o){return n.startsWith(o)};const n=e.trim();if(/^#?[A-F\d]{3,8}$/i.test(n))this.fromHexString(n);else if(r("rgb"))this.fromRgbString(n);else if(r("hsl"))this.fromHslString(n);else if(r("hsv")||r("hsb"))this.fromHsvString(n);else{const o=X3i[n.toLowerCase()];o&&this.fromHexString(parseInt(o,36).toString(16).padStart(6,"0"))}}else if(e instanceof yS)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(t("rgb"))this.r=zT(e.r),this.g=zT(e.g),this.b=zT(e.b),this.a=typeof e.a=="number"?zT(e.a,1):1;else if(t("hsl"))this.fromHsl(e);else if(t("hsv"))this.fromHsv(e);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e))}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(o){const a=o/255;return a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)}const t=e(this.r),n=e(this.g),r=e(this.b);return .2126*t+.7152*n+.0722*r}getHue(){if(typeof this._h=="undefined"){const e=this.getMax()-this.getMin();e===0?this._h=0:this._h=ou(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){if(typeof this._s=="undefined"){const e=this.getMax()-this.getMin();e===0?this._s=0:this._s=e/this.getMax()}return this._s}getLightness(){return typeof this._l=="undefined"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v=="undefined"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness=="undefined"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){const t=this.getHue(),n=this.getSaturation();let r=this.getLightness()-e/100;return r<0&&(r=0),this._c({h:t,s:n,l:r,a:this.a})}lighten(e=10){const t=this.getHue(),n=this.getSaturation();let r=this.getLightness()+e/100;return r>1&&(r=1),this._c({h:t,s:n,l:r,a:this.a})}mix(e,t=50){const n=this._c(e),r=t/100,o=s=>(n[s]-this[s])*r+this[s],a={r:ou(o("r")),g:ou(o("g")),b:ou(o("b")),a:ou(o("a")*100)/100};return this._c(a)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const t=this._c(e),n=this.a+t.a*(1-this.a),r=o=>ou((this[o]*this.a+t[o]*t.a*(1-this.a))/n);return this._c({r:r("r"),g:r("g"),b:r("b"),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const t=(this.r||0).toString(16);e+=t.length===2?t:"0"+t;const n=(this.g||0).toString(16);e+=n.length===2?n:"0"+n;const r=(this.b||0).toString(16);if(e+=r.length===2?r:"0"+r,typeof this.a=="number"&&this.a>=0&&this.a<1){const o=ou(this.a*255).toString(16);e+=o.length===2?o:"0"+o}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),t=ou(this.getSaturation()*100),n=ou(this.getLightness()*100);return this.a!==1?`hsla(${e},${t}%,${n}%,${this.a})`:`hsl(${e},${t}%,${n}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,t,n){const r=this.clone();return r[e]=zT(t,n),r}_c(e){return new this.constructor(e)}getMax(){return typeof this._max=="undefined"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min=="undefined"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const t=e.replace("#","");function n(r,o){return parseInt(t[r]+t[o||r],16)}t.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=t[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=t[6]?n(6,7)/255:1)}fromHsl({h:e,s:t,l:n,a:r}){if(this._h=e%360,this._s=t,this._l=n,this.a=typeof r=="number"?r:1,t<=0){const d=ou(n*255);this.r=d,this.g=d,this.b=d}let o=0,a=0,s=0;const l=e/60,u=(1-Math.abs(2*n-1))*t,c=u*(1-Math.abs(l%2-1));l>=0&&l<1?(o=u,a=c):l>=1&&l<2?(o=c,a=u):l>=2&&l<3?(a=u,s=c):l>=3&&l<4?(a=c,s=u):l>=4&&l<5?(o=c,s=u):l>=5&&l<6&&(o=u,s=c);const h=n-u/2;this.r=ou((o+h)*255),this.g=ou((a+h)*255),this.b=ou((s+h)*255)}fromHsv({h:e,s:t,v:n,a:r}){this._h=e%360,this._s=t,this._v=n,this.a=typeof r=="number"?r:1;const o=ou(n*255);if(this.r=o,this.g=o,this.b=o,t<=0)return;const a=e/60,s=Math.floor(a),l=a-s,u=ou(n*(1-t)*255),c=ou(n*(1-t*l)*255),h=ou(n*(1-t*(1-l))*255);switch(s){case 0:this.g=h,this.b=u;break;case 1:this.r=c,this.b=u;break;case 2:this.r=u,this.b=h;break;case 3:this.r=u,this.g=c;break;case 4:this.r=h,this.g=u;break;case 5:default:this.g=u,this.b=c;break}}fromHsvString(e){const t=Xae(e,BGe);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){const t=Xae(e,BGe);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){const t=Xae(e,(n,r)=>r.includes("%")?ou(n/100*255):n);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}}const HL=2,FGe=.16,K3i=.05,Z3i=.05,Q3i=.15,NGe=5,HGe=4,J3i=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function $Ge(i,e,t){let n;return Math.round(i.h)>=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-HL*e:Math.round(i.h)+HL*e:n=t?Math.round(i.h)+HL*e:Math.round(i.h)-HL*e,n<0?n+=360:n>=360&&(n-=360),n}function zGe(i,e,t){if(i.h===0&&i.s===0)return i.s;let n;return t?n=i.s-FGe*e:e===HGe?n=i.s+FGe:n=i.s+K3i*e,n>1&&(n=1),t&&e===NGe&&n>.1&&(n=.1),n<.06&&(n=.06),Math.round(n*100)/100}function WGe(i,e,t){let n;return t?n=i.v+Z3i*e:n=i.v-Q3i*e,n=Math.max(0,Math.min(1,n)),Math.round(n*100)/100}function exi(i,e={}){const t=[],n=new yS(i),r=n.toHsv();for(let o=NGe;o>0;o-=1){const a=new yS({h:$Ge(r,o,!0),s:zGe(r,o,!0),v:WGe(r,o,!0)});t.push(a)}t.push(n);for(let o=1;o<=HGe;o+=1){const a=new yS({h:$Ge(r,o),s:zGe(r,o),v:WGe(r,o)});t.push(a)}return e.theme==="dark"?J3i.map(({index:o,amount:a})=>new yS(e.backgroundColor||"#141414").mix(t[o],a).toHexString()):t.map(o=>o.toHexString())}const Kae=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];Kae.primary=Kae[5];function txi(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}function ixi(i,e){if(!i)return!1;if(i.contains)return i.contains(e);let t=e;for(;t;){if(t===i)return!0;t=t.parentNode}return!1}const VGe="data-rc-order",jGe="data-rc-priority",nxi="rc-util-key",Zae=new Map;function UGe({mark:i}={}){return i?i.startsWith("data-")?i:`data-${i}`:nxi}function Qae(i){return i.attachTo?i.attachTo:document.querySelector("head")||document.body}function rxi(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function Jae(i){return Array.from((Zae.get(i)||i).children).filter(e=>e.tagName==="STYLE")}function GGe(i,e={}){if(!txi())return null;const{csp:t,prepend:n,priority:r=0}=e,o=rxi(n),a=o==="prependQueue",s=document.createElement("style");s.setAttribute(VGe,o),a&&r&&s.setAttribute(jGe,`${r}`),t!=null&&t.nonce&&(s.nonce=t==null?void 0:t.nonce),s.innerHTML=i;const l=Qae(e),{firstChild:u}=l;if(n){if(a){const c=(e.styles||Jae(l)).filter(h=>{if(!["prepend","prependQueue"].includes(h.getAttribute(VGe)))return!1;const d=Number(h.getAttribute(jGe)||0);return r>=d});if(c.length)return l.insertBefore(s,c[c.length-1].nextSibling),s}l.insertBefore(s,u)}else l.appendChild(s);return s}function oxi(i,e={}){let{styles:t}=e;return t||(t=Jae(Qae(e))),t.find(n=>n.getAttribute(UGe(e))===i)}function axi(i,e){const t=Zae.get(i);if(!t||!ixi(document,t)){const n=GGe("",e),{parentNode:r}=n;Zae.set(i,r),i.removeChild(n)}}function sxi(i,e,t={}){var l,u,c;const n=Qae(t),r=Jae(n),o=Ii(Me({},t),{styles:r});axi(n,o);const a=oxi(e,o);if(a)return(l=o.csp)!=null&&l.nonce&&a.nonce!==((u=o.csp)==null?void 0:u.nonce)&&(a.nonce=(c=o.csp)==null?void 0:c.nonce),a.innerHTML!==i&&(a.innerHTML=i),a;const s=GGe(i,o);return s.setAttribute(UGe(o),e),s}function qGe(i){var e;return(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i)}function lxi(i){return qGe(i)instanceof ShadowRoot}function uxi(i){return lxi(i)?qGe(i):null}var YGe={};let ese={};const tse=[],cxi=i=>{tse.push(i)};function hxi(i,e){if(YGe.NODE_ENV!=="production"&&!i&&console!==void 0){const t=tse.reduce((n,r)=>r(n!=null?n:"","warning"),e);t&&console.error(`Warning: ${t}`)}}function dxi(i,e){if(YGe.NODE_ENV!=="production"&&!i&&console!==void 0){const t=tse.reduce((n,r)=>r(n!=null?n:"","note"),e);t&&console.warn(`Note: ${t}`)}}function fxi(){ese={}}function XGe(i,e,t){!e&&!ese[t]&&(i(!1,t),ese[t]=!0)}function $L(i,e){XGe(hxi,i,e)}function gxi(i,e){XGe(dxi,i,e)}$L.preMessage=cxi,$L.resetWarned=fxi,$L.noteOnce=gxi;function pxi(i){return i.replace(/-(.)/g,(e,t)=>t.toUpperCase())}function ise(i,e){$L(i,`[@ant-design/icons] ${e}`)}function KGe(i){return typeof i=="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(typeof i.icon=="object"||typeof i.icon=="function")}function ZGe(i={}){return Object.keys(i).reduce((e,t)=>{const n=i[t];switch(t){case"class":e.className=n,delete e.class;break;default:delete e[t],e[pxi(t)]=n}return e},{})}function nse(i,e,t){return t?ce.createElement(i.tag,Me(Me({key:e},ZGe(i.attrs)),t),(i.children||[]).map((n,r)=>nse(n,`${e}-${i.tag}-${r}`))):ce.createElement(i.tag,Me({key:e},ZGe(i.attrs)),(i.children||[]).map((n,r)=>nse(n,`${e}-${i.tag}-${r}`)))}function QGe(i){return exi(i)[0]}function JGe(i){return i?Array.isArray(i)?i:[i]:[]}const mxi={width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"},vxi=`
10590
10590
  .anticon {
10591
10591
  display: inline-flex;
10592
10592
  align-items: center;
@@ -10728,7 +10728,7 @@ ${r}
10728
10728
  }
10729
10729
  }
10730
10730
  `}
10731
- `,Mc=i=>{var l;const s=i,{prefix:e,allowClear:t}=s,n=kh(s,["prefix","allowClear"]),[r,o]=ce.useState((l=i==null?void 0:i.open)!=null?l:!1);ce.useEffect(()=>{(i==null?void 0:i.open)!==void 0&&o(i==null?void 0:i.open)},[i==null?void 0:i.open]);const a=u=>{if(i!=null&&i.onOpenChange){i==null||i.onOpenChange(u);return}o(u)};return _e.jsxs(Yf,{theme:Zxi,children:[_e.jsx(Jxi,{}),_e.jsx(Qxi,{className:r?"open":"",children:_e.jsx(hm,Me({prefix:e?_e.jsx("span",{className:r?"open":"",children:e}):void 0,suffixIcon:_e.jsxs(_e.Fragment,{children:[r&&_e.jsx("div",{className:"suffixIcon",children:_e.jsx(use,{style:{color:"#008CD6",pointerEvents:"none"}})}),!r&&_e.jsx("div",{className:"suffixIcon",children:_e.jsx(zL,{style:{color:"#89898a",pointerEvents:"none"}})})]}),maxTagCount:"responsive",allowClear:t?{clearIcon:_e.jsx(VL,{className:"clear-icon"})}:!1,onOpenChange:a},n))})]})},eSi="http://localhost";class tSi{constructor({baseURL:e=eSi,host:t,protocol:n,timeout:r=6e5,headers:o}={}){var s,l,u;this.host=t||((s=window.location)==null?void 0:s.host),this.protocol=n||(["http:","https:"].includes((l=window==null?void 0:window.location)==null?void 0:l.protocol)?(u=window==null?void 0:window.location)==null?void 0:u.protocol:void 0);const a=new URL(this.host||this.protocol?`${this.protocol||"https:"}//${this.host||"localhost"}`:e,window.location.href);this.baseURL=a.href.replace(/\/+$/,""),this.host=a.host,this.protocol=a.protocol,this.timeout=r,this.headers=o||{"Content-Type":"application/json"},this.instance=Ks.create({baseURL:this.baseURL,timeout:this.timeout,headers:this.headers})}get(e){return ga(this,null,function*(){return this.request(Ii(Me({},e),{method:"GET"}))})}delete(e){return ga(this,null,function*(){return this.request(Ii(Me({},e),{method:"DELETE"}))})}put(e){return ga(this,null,function*(){return this.request(Ii(Me({},e),{method:"PUT"}))})}post(e){return ga(this,null,function*(){return this.request(Ii(Me({},e),{method:"POST"}))})}patch(e){return ga(this,null,function*(){return this.request(Ii(Me({},e),{method:"PATCH"}))})}ping(){return this.request({url:"/api/ping",method:"GET",retry:1})}request(e){return ga(this,null,function*(){return this.instance(e).then(t=>{const{status:n,config:r}=t;return(r==null?void 0:r.method)==="delete"&&(n===200||n===201)?{message:"delete success"}:{data:t.data}}).catch(t=>Promise.reject(t))})}}const VT=new tSi,iSi=i=>bAt({},x$e,i,t=>{if(Array.isArray(t))return t}),nSi=[{key:"basic",label:"Basic",value:"basic"},{key:"customSql",label:"Custom SQL",value:"customSql"}],mse=[{key:"equal",label:"Equal",value:"equal"},{key:"notEqual",label:"Not equal",value:"not equal"},{key:"isNull",label:"Is null",value:"is null"},{key:"isNotNull",label:"Is not null",value:"is not null"},{key:"greaterThan",label:"Greater than",value:"greater than"},{key:"greaterThanOrEqualto",label:"Greater than or equal to",value:"greater than or equal to"},{key:"lessThan",label:"Less than",value:"less than"},{key:"lessThanEqualTo",label:"Less than or equal to",value:"less than or equal to"},{key:"contains",label:"Contains",value:"contains"},{key:"notContains",label:"Not contains",value:"not contains"},{key:"StartsWith",label:"Starts with",value:"starts with"},{key:"doesNotStartWith",label:"Does not start with",value:"does not start with"},{key:"endsWith",label:"Ends with",value:"ends with"},{key:"doesNotEndWith",label:"Does not end with",value:"does not end with"}],rSi={equal:"=",notEqual:"!=",isNull:"IS NULL",isNotNull:"IS NOT NULL",greaterThan:">",greaterThanOrEqualto:">=",lessThan:"<",lessThanEqualTo:"<=",contains:"LIKE",notContains:"NOT LIKE",StartsWith:"LIKE",doesNotStartWith:"NOT LIKE",endsWith:"LIKE",doesNotEndWith:"NOT LIKE"},oSi=[{key:"where",label:"WHERE",value:"WHERE"},{key:"having",label:"HAVING",value:"HAVING"}];function vse(i,e){const t=e==null?void 0:e.find(n=>n.value===i.dimensionId||n.label===i.name);return t?{datasetName:t.datasetName,dimensionColumn:t.dimensionColumn,englishName:t.englishName,dimensionId:t.value}:null}const aSi=i=>i?i.map(e=>{var t;return((t=e==null?void 0:e.subFilter)==null?void 0:t.type)==="basic"&&e.subFilter.basic&&e.subFilter.basic.condition&&(e.subFilter.basic.condition=e.subFilter.basic.condition.toLowerCase()),Me({},e.subFilter)}):[],sSi=(i,e)=>{var r,o;if(!fc(i)||!(e&&(e==null?void 0:e.length)>0))return[];const t=((r=e==null?void 0:e[0])==null?void 0:r.label)||((o=e==null?void 0:e[0])==null?void 0:o.value);return(i==null?void 0:i[t])||[]},lSi=i=>{const e="/metricInsight/api/v1/metric/"+i;return VT.get({url:e}).then(t=>t.data||[])},uSi=i=>{const e="/metricInsight/api/v1/dimension/metric?mode=intersect&metricIds="+i.join(",");return VT.get({url:e}).then(t=>{var n;return((n=t==null?void 0:t.data)==null?void 0:n.items)||[]})},cSi=i=>VT.post({url:"/metricInsight/api/v1/mql/params",data:i}).then(t=>(t==null?void 0:t.data)||[]),hSi=(i,e)=>i!=null&&i.mql?fSi(i,e):dSi(e),dSi=({timeRange:i,metrics:e,dimensions:t,timeGrain:n,filters:r,queryMetricOrgId:o,queryType:a,orders:s})=>{const l=e==null?void 0:e.map(p=>p.value),u=l==null?void 0:l[0],c=t==null?void 0:t.some(p=>p.value==="metricTime");let h=t,d;c&&(h=t==null?void 0:t.filter(p=>p.value!=="metricTime"),d={dimensionName:"metricTime",dimensionUnit:n});const f={orgId:o,metricIds:l,timeRange:i,dimensionIds:h==null?void 0:h.map(p=>p.value),queryType:a};(i==null?void 0:i.type)==="custom"&&(i!=null&&i.custom)&&(f.timeRange.custom={from:Ir(i.custom.from).format(q7),to:Ir(i.custom.to).format(q7)}),d&&(f.timeDimension=d),r&&r.length>0&&(f.filters=r.map(p=>({conjunction:"AND",subFilter:Me({},p)}))),s&&(s==null?void 0:s.length)>0&&u&&(f.orders={[e==null?void 0:e[0].label]:s});const g=`/metricInsight/api/v1/metric/${u}/preview`;return VT.post({url:g,data:f}).then(p=>(p==null?void 0:p.data)||[])},fSi=(i,{timeRange:e,metrics:t,dimensions:n,timeGrain:r,filters:o,queryMetricOrgId:a,queryType:s,orders:l})=>{const u=i==null?void 0:i.mql,c={dimensions:[],metricDefinitions:{},metrics:[],timeConstraint:{},filters:{},orders:(u==null?void 0:u.orders)||{},limits:(u==null?void 0:u.limits)||{},orgId:a,queryType:s},h=n==null?void 0:n.map(g=>{let p=(g==null?void 0:g.englishName)||(g==null?void 0:g.label);return g.value==="metricTime"&&(p="metric_time__"+r),p});c.dimensions={};let d=o==null?void 0:o.map(g=>{var p;return g.type==="basic"?pSi(g==null?void 0:g.basic):g.type==="customSql"?(p=g==null?void 0:g.sql)==null?void 0:p.filterCondition:null}).filter(g=>g!==null&&g.trim()!=="");return t==null||t.forEach(g=>{const p=(g==null?void 0:g.displayName)||(g==null?void 0:g.label);c.metrics.push(p),c.dimensions[p]=h,c.metricDefinitions[p]=g.metricDefinitions,c.filters[p]=d||[],c.timeConstraint[p]=e||{},l&&l.length>0&&(c.orders[p]=l)}),VT.post({url:"/metricInsight/api/v1/mql/query",data:c}).then(g=>{var p;return((p=g==null?void 0:g.data)==null?void 0:p[0])||[]})},gSi=i=>{const{data:e,metricTime:t}=i;if(!e)return[];if(!(e!=null&&e.columns)||!(e!=null&&e.rows))return[];const{columns:n,rows:r}=e;return n.forEach((a,s)=>{a.name}),r.map(a=>{const s={};return n.forEach((l,u)=>{if(a.row[u]!==void 0){let c=l.name;c==="metricTime"&&(c=t),s[c]=a.row[u].v}}),s})},pSi=i=>{var s;const e=(i==null?void 0:i.englishName)||(i==null?void 0:i.dimensionColumn),t=i==null?void 0:i.condition,n=i==null?void 0:i.value,r=(s=mse.find(l=>l.value===t))==null?void 0:s.key,o=rSi[r];if(!e||!o)throw new Error("Invalid filter configuration");if(r==="isNull"||r==="isNotNull")return`${e} ${o}`;if(o==="LIKE"||o==="NOT LIKE"){let l=n;return t==="contains"?l=`%${n}%`:t==="StartsWith"?l=`${n}%`:t==="endsWith"?l=`%${n}`:t==="notContains"?l=`%${n}%`:t==="doesNotStartWith"?l=`${n}%`:t==="doesNotEndWith"&&(l=`%${n}`),`${e} ${o} '${l}'`}const a=typeof n=="string"?`'${n}'`:n;return`${e} ${o} ${a}`},mSi={metricInsight:{queryMql2Params:cSi,queryChartData:hSi,queryMetricId:lSi,queryDimensions:uSi,transformData:gSi},simpleJson:{}},aqe=i=>{const e=ed(),{setError:t,setLoading:n}=Jh();return ce.useMemo(()=>{const o=mSi[i];return{queryMql2Params:o.queryMql2Params?sqe(o.queryMql2Params,t,n,e):()=>Promise.resolve({}),queryMetricId:o.queryMetricId?sqe(o.queryMetricId,t,n,e):()=>Promise.resolve({}),queryDimensions:o.queryDimensions?o.queryDimensions:()=>Promise.resolve({}),queryChartData:o.queryChartData?o.queryChartData:()=>Promise.resolve({}),transformData:a=>o.transformData?o.transformData(a):[]}},[i])};function sqe(i,e,t,n){return((...r)=>ga(null,null,function*(){try{return yield i(...r)}catch(o){let a=o==null?void 0:o.message;throw typeof o=="string"&&(a=o),t(!1),e({visible:!0,title:n.formatMessage({id:"metricError"}),message:a||"error"}),o}}))}const lqe=[{key:"none",label:"None",value:"none"},{key:"number",label:"Number",value:"number"},{key:"percentage_raw",label:"Percentage (raw)",value:"percentage_raw",desc:"1→1%"},{key:"percentage_scaled",label:"Percentage (scaled)",value:"percentage_scaled",desc:"1→100%"}],vSi={none:"",number:"",percentage_raw:"%",percentage_scaled:"%",celsius:"°C",fahrenheit:"°F",CNY:"¥",USD:"$",GBP:"£",EUR:"€"};function uqe(i,e){if(!i&&!e)return"";let t="",n="";return i&&i!=="none"&&(t=i),e&&e!=="none"&&(n=vSi[e]||e),t+(n?" "+n:"")}function bSi(i,e,t){if(!i)return null;const{dimensionDetailList:n,displayName:r,metricId:o,derivationMethod:a}=i,s={value:o,label:r},l=bse(n,a,t),c=((e==null?void 0:e.dimensions)||[(e==null?void 0:e.xField)||(e==null?void 0:e.nameField)]).map(d=>l.find(f=>d===f.label||d===f.value)).filter(Boolean),h=xSi(r,i);return{metrics:[s],dimensions:c,dissionOptions:l,dataFormat:h}}function ySi(i,e){const{metrics:t}=e,n=hqe(i),r=[],o={};return((n==null?void 0:n.metrics)||[]).forEach(s=>{var p,m;const l=(p=n==null?void 0:n.metricDefinitions)==null?void 0:p[s],u=l==null?void 0:l.refMetric,c=l==null?void 0:l.variables;let h;!u&&c?h=Object.values(c).map(v=>v==null?void 0:v.refMetric):h=[u];let d=[],f=[],g=!1;((m=l==null?void 0:l.indirections)==null?void 0:m.length)>0&&!c&&(g=!0),t.forEach(v=>{if(!g&&v.englishName===u){const b=v==null?void 0:v.metricUnit;o[s]={formatType:(b==null?void 0:b.type)||"none",decimalPlaces:(b==null?void 0:b.decimal)||0,suffix:uqe(b==null?void 0:b.valueUnit,b==null?void 0:b.formatUnit)}}else o[s]={formatType:"none",decimalPlaces:0,suffix:""};h!=null&&h.includes(v==null?void 0:v.englishName)&&!f.includes(v==null?void 0:v.metricId)&&(d.push(v),f.push(v==null?void 0:v.metricId))}),r.push({isDerived:g,displayName:s,label:s,value:"uuid-"+BV(6),metricDefinitions:l,atomicMetricIds:f,atomicMetricsInfo:d})}),{metricsOptions:r,dataFormat:o}}function _Si(i,e,t,n){const{dimensions:r,timeDimension:o={},filters:a=[]}=i,{metricsOptions:s,dataFormat:l}=e,u=Ii(Me({},n),{dataType:"TIMESTAMP"}),c=cqe(s),h=bse(t,c,n),d=(r==null?void 0:r.map(f=>h.find(g=>(f==null?void 0:f.displayName)===g.label||(f==null?void 0:f.dimensionId)===g.value)).filter(Boolean))||[];return(o==null?void 0:o.dimensionName)===(n==null?void 0:n.value)&&d.unshift(u),{metrics:s,dataFormat:l,dimensions:d,dissionOptions:h,timeDimension:o,filters:a,queryMetricOrgId:i==null?void 0:i.orgId}}function cqe(i){const e=[];return i==null||i.forEach(t=>{var n;t!=null&&t.atomicMetricsInfo&&((n=t==null?void 0:t.atomicMetricsInfo)==null||n.forEach(r=>{dl(r==null?void 0:r.derivationMethod)?e.push(...r.derivationMethod):fc(r==null?void 0:r.derivationMethod)&&e.push(r.derivationMethod)}))}),e==null?void 0:e[0]}function CSi(i,e){var r,o,a,s,l;let t=!1,n=!1;if(!(e!=null&&e.enabled))return{defaultSelected:t,defaultDisabled:n};if((e==null?void 0:e.method)==="Ranking"&&(e!=null&&e.ranking)){const u=((r=e.ranking)==null?void 0:r.dimensions)||[],c=((o=e.ranking)==null?void 0:o.ranges)||[];return{defaultSelected:[...u,...c].includes(i),defaultDisabled:n}}if((e==null?void 0:e.method)==="Proportion"&&(e!=null&&e.proportion)){const u=((a=e.proportion)==null?void 0:a.dimensions)||[],c=((s=e.proportion)==null?void 0:s.ranges)||[];return{defaultSelected:[...u,...c].includes(i),defaultDisabled:n}}if((e==null?void 0:e.method)==="Custom"&&((l=e==null?void 0:e.custom)==null?void 0:l.length)>0){const u=e.custom,c=u.findIndex(h=>(h==null?void 0:h.dimension)===i);return c!==-1&&(c===u.length-1?t=!0:(t=!1,n=!0)),{defaultSelected:t,defaultDisabled:n}}return{defaultSelected:t,defaultDisabled:n}}const xSi=(i,e)=>{var t,n;if(i&&((t=e==null?void 0:e.computationalAttributes)!=null&&t.format)){const r=(n=e==null?void 0:e.computationalAttributes)==null?void 0:n.format;return{[i]:{formatType:(r==null?void 0:r.type)||"none",decimalPlaces:(r==null?void 0:r.decimal)||0,suffix:uqe(r==null?void 0:r.valueUnit,r==null?void 0:r.formatUnit)}}}return null};function hqe(i){let e={};if(typeof i=="object")e=i;else if(typeof i=="string")try{e=JSON.parse(i)}catch(t){console.error(t)}return e}function bse(i,e,t){const n=(i==null?void 0:i.map(r=>{const{defaultSelected:o,defaultDisabled:a}=CSi(r.dimensionId,e);return{label:r.displayName,value:r.dimensionId,englishName:r.englishName||r.dimensionColumn,dataType:r.dimensionColumnType,datasetName:r.datasetName,dimensionColumn:r.dimensionColumn,defaultSelected:o,defaultDisabled:a,disabled:o||a}}))||[];return n.unshift(Ii(Me({},t),{dataType:"TIMESTAMP",englishName:t.value,datasetName:void 0,dimensionColumn:void 0,defaultSelected:!1,defaultDisabled:!1,disabled:!1})),n}const SSi=[{key:"custom",label:"Custom",value:"custom"},{key:"today",label:"Today",value:"today"},{key:"last7Days",label:"Last 7 days",value:"last7Days"},{key:"last30Days",label:"Last 30 days",value:"last30Days"},{key:"last1Year",label:"Last year",value:"last1Year"},{key:"thisWeek",label:"This week",value:"thisWeek"},{key:"thisMonth",label:"This month",value:"thisMonth"},{key:"thisQuarter",label:"This quarter",value:"thisQuarter"},{key:"thisYear",label:"This year",value:"thisYear"},{key:"weekToDate",label:"Week-to-date",value:"weekToDate"},{key:"monthToDate",label:"Month-to-date",value:"monthToDate"},{key:"quarterToDate",label:"Quarter-to-date",value:"quarterToDate"},{key:"yearToDate",label:"Year-to-date",value:"yearToDate"},{key:"advanced",label:"Advanced",value:"advanced"}],wSi=[{key:"lastPeriod",label:"Last N period",value:"lastPeriod"},{key:"periodAgo",label:"N periods ago",value:"periodAgo"},{key:"periodBoundary",label:"Current/previous period boundary",value:"periodBoundary"}],ESi=[{key:"current",label:"Current",value:"current"},{key:"previous",label:"Previous",value:"previous"}],CS=[{key:"minute",label:"Minute",value:"minute"},{key:"hour",label:"Hour",value:"hour"},{key:"day",label:"Day",value:"day"},{key:"week",label:"Week",value:"week"},{key:"month",label:"Month",value:"month"},{key:"quarter",label:"Quarter",value:"quarter"},{key:"year",label:"Year",value:"year"}],dqe=[{key:"year",label:"Year",value:"year"},{key:"quarter",label:"Quarter",value:"quarter"},{key:"month",label:"Month",value:"month"},{key:"week",label:"Week",value:"week"},{key:"day",label:"Day",value:"day"},{key:"hour",label:"Hour",value:"hour"},{key:"minute",label:"Minute",value:"minute"}],ASi=[{key:"first",label:"First",value:"first"},{key:"last",label:"Last",value:"last"}],fqe={type:"lastPeriod",lastPeriod:{range:7,unit:"day"},periodAgo:{range:7,unit:"day"},periodBoundary:{periodType:"current",periodUnit:"month",periodRange:void 0,boundaryType:"first",boundaryUnit:"day"}},jT={second:0,minute:1,hour:2,day:3,week:4,month:5,quarter:6,year:7},TSi=i=>{if(i&&Object.prototype.hasOwnProperty.call(jT,i)){const e=jT[i];return CS.filter(t=>jT[t.value]<e)}return CS},RSi=i=>{const e=jT[i==null?void 0:i.toLowerCase()];return e!==void 0?dqe.filter(t=>jT[t.value]<e):dqe},MSi=(i,e,t)=>{var n,r,o,a,s,l;if((e==null?void 0:e.type)==="custom"&&(n=e==null?void 0:e.custom)!=null&&n.from&&(r=e==null?void 0:e.custom)!=null&&r.to){const u=Ir(e.custom.from).format(Ob),c=Ir(e.custom.to).format(Ob);return`${u}-${c}`}if((e==null?void 0:e.type)==="advanced"&&e.advanced){const u=e.advanced;let c="";if((u==null?void 0:u.type)==="lastPeriod")return t({id:"lastNUnits"},{range:(o=u==null?void 0:u.lastPeriod)==null?void 0:o.range,unit:t({id:"unit"+((a=u.lastPeriod)==null?void 0:a.unit)})});if((u==null?void 0:u.type)==="periodAgo")return t({id:"periodAgoNUnits"},{range:(s=u.periodAgo)==null?void 0:s.range,unit:t({id:"unit"+((l=u.periodAgo)==null?void 0:l.unit)})});if((u==null?void 0:u.type)==="periodBoundary"){const h=u.periodBoundary;if((h==null?void 0:h.periodType)==="current")return t({id:"currentNUnit"},{periodUnit:t({id:"unit"+h.periodUnit}),boundaryType:t({id:h.boundaryType}),boundaryUnit:t({id:"unit"+h.boundaryUnit})});if((h==null?void 0:h.periodType)==="previous")return t({id:"previousNUnits"},{periodRange:h.periodRange,periodUnit:t({id:"unit"+h.periodUnit}),boundaryType:t({id:h.boundaryType}),boundaryUnit:t({id:"unit"+h.boundaryUnit})})}return c}return i},kSi=i=>i==null?void 0:i.dimensionUnit,OSi=(i,e)=>{var t,n,r;if(!(i!=null&&i.type)){const o=e==null?void 0:e.mql;let a;if(a=(t=hqe(o))==null?void 0:t.timeConstraint,!a)return{};const s=Object.keys(a)[0],l=a[s];return l&&typeof l=="object"&&(l==null?void 0:l.type)==="advanced"&&((r=(n=l==null?void 0:l.advanced)==null?void 0:n.custom)!=null&&r.from)?{type:"custom",custom:{from:l.advanced.custom.from,to:l.advanced.custom.to||Ir().format("YYYY-MM-DD HH:mm:ss")}}:{}}return i},ISi=i=>{var e;return(i==null?void 0:i.type)==="custom"&&((e=i==null?void 0:i.custom)!=null&&e.from)?{type:"custom",custom:{from:Ir(i.custom.from).format("YYYY-MM-DD HH:mm:ss"),to:Ir(i.custom.to).format("YYYY-MM-DD HH:mm:ss")}}:i},yse=i=>{const e=ed(),t=i.type,{queryChartData:n,transformData:r}=aqe(t),{chartJson:o,drillBy:a,setLoading:s,setChartJson:l,setError:u,setDataSourceQueryInfo:c,setChartDrillBy:h}=Jh(),d=e.formatMessage({id:"metricTime"});return{queryChartDataFromDatasource:(m,v)=>ga(null,null,function*(){var x;const{metrics:b,dimensions:y,timeGrain:_,dataFormat:S}=m;if(u({visible:!1,title:"",message:""}),m.timeRange=ISi(m.timeRange),m.dimensions=y==null?void 0:y.map(w=>Me({},w)),b!=null&&b.length){const w=yield n(i,m).catch(k=>{u({visible:!0,title:e.formatMessage({id:"chartDataLoadingFailed"}),message:k.message}),s(!1)});c({fieldInfo:(x=w==null?void 0:w.columns)==null?void 0:x.map(k=>{let O=k.name;return O==="metricTime"&&(O=d),{fieldName:O,type:k.type}})});const E=r({data:w,metricTime:d});let A=o;Xke(o)&&(A=yield Kke(Ii(Me({},o),{data:E})));let T=LV({chartJson:A,metrics:b,dimensions:y,isInit:v});const R=Ii(Me({},T),{data:E,timeGrain:_,dataFormat:S});l(R),s(!1),w&&u({visible:!1,title:"",message:""})}}),queryDrillByChartData:y=>ga(null,[y],function*({queryData:m,setDrillLoading:v,setDrillError:b}){var x;const{metrics:_,dimensions:S}=m;if(_!=null&&_.length){const w=yield n(i,m).catch(O=>{b({visible:!0,title:e.formatMessage({id:"drillDataLoadingFailed"}),message:O.message}),v(!1)}),E=r({data:w,metricTime:d}),A=LV({chartJson:o,metrics:_,dimensions:S}),T=Ii(Me({},A),{data:E}),R=UJ(T),k=a;h(Ii(Me({},k),{chartState:{chartJson:T,dataset:R,history:[...((x=k.chartState)==null?void 0:x.history)||[],{chartJson:T,dataset:R}]}})),v(!1),w&&b({visible:!1,title:"",message:""})}}),queyDetailTableData:m=>ga(null,null,function*(){return n(i,Ii(Me({},m),{queryType:"detailed"})).then(v=>r({data:v,metricTime:d}))})}},DSi=Ya(ml)`
10731
+ `,Mc=i=>{var l;const s=i,{prefix:e,allowClear:t}=s,n=kh(s,["prefix","allowClear"]),[r,o]=ce.useState((l=i==null?void 0:i.open)!=null?l:!1);ce.useEffect(()=>{(i==null?void 0:i.open)!==void 0&&o(i==null?void 0:i.open)},[i==null?void 0:i.open]);const a=u=>{if(i!=null&&i.onOpenChange){i==null||i.onOpenChange(u);return}o(u)};return _e.jsxs(Yf,{theme:Zxi,children:[_e.jsx(Jxi,{}),_e.jsx(Qxi,{className:r?"open":"",children:_e.jsx(hm,Me({prefix:e?_e.jsx("span",{className:r?"open":"",children:e}):void 0,suffixIcon:_e.jsxs(_e.Fragment,{children:[r&&_e.jsx("div",{className:"suffixIcon",children:_e.jsx(use,{style:{color:"#008CD6",pointerEvents:"none"}})}),!r&&_e.jsx("div",{className:"suffixIcon",children:_e.jsx(zL,{style:{color:"#89898a",pointerEvents:"none"}})})]}),maxTagCount:"responsive",allowClear:t?{clearIcon:_e.jsx(VL,{className:"clear-icon"})}:!1,onOpenChange:a},n))})]})},eSi="http://localhost";class tSi{constructor({baseURL:e=eSi,host:t,protocol:n,timeout:r=6e5,headers:o}={}){var s,l,u;this.host=t||((s=window.location)==null?void 0:s.host),this.protocol=n||(["http:","https:"].includes((l=window==null?void 0:window.location)==null?void 0:l.protocol)?(u=window==null?void 0:window.location)==null?void 0:u.protocol:void 0);const a=new URL(this.host||this.protocol?`${this.protocol||"https:"}//${this.host||"localhost"}`:e,window.location.href);this.baseURL=a.href.replace(/\/+$/,""),this.host=a.host,this.protocol=a.protocol,this.timeout=r,this.headers=o||{"Content-Type":"application/json"},this.instance=Ks.create({baseURL:this.baseURL,timeout:this.timeout,headers:this.headers})}get(e){return ga(this,null,function*(){return this.request(Ii(Me({},e),{method:"GET"}))})}delete(e){return ga(this,null,function*(){return this.request(Ii(Me({},e),{method:"DELETE"}))})}put(e){return ga(this,null,function*(){return this.request(Ii(Me({},e),{method:"PUT"}))})}post(e){return ga(this,null,function*(){return this.request(Ii(Me({},e),{method:"POST"}))})}patch(e){return ga(this,null,function*(){return this.request(Ii(Me({},e),{method:"PATCH"}))})}ping(){return this.request({url:"/api/ping",method:"GET",retry:1})}request(e){return ga(this,null,function*(){return this.instance(e).then(t=>{const{status:n,config:r}=t;return(r==null?void 0:r.method)==="delete"&&(n===200||n===201)?{message:"delete success"}:{data:t.data}}).catch(t=>Promise.reject(t))})}}const VT=new tSi,iSi=i=>bAt({},x$e,i,t=>{if(Array.isArray(t))return t}),nSi=[{key:"basic",label:"Basic",value:"basic"},{key:"customSql",label:"Custom SQL",value:"customSql"}],mse=[{key:"equal",label:"Equal",value:"equal"},{key:"notEqual",label:"Not equal",value:"not equal"},{key:"isNull",label:"Is null",value:"is null"},{key:"isNotNull",label:"Is not null",value:"is not null"},{key:"greaterThan",label:"Greater than",value:"greater than"},{key:"greaterThanOrEqualto",label:"Greater than or equal to",value:"greater than or equal to"},{key:"lessThan",label:"Less than",value:"less than"},{key:"lessThanEqualTo",label:"Less than or equal to",value:"less than or equal to"},{key:"contains",label:"Contains",value:"contains"},{key:"notContains",label:"Not contains",value:"not contains"},{key:"StartsWith",label:"Starts with",value:"starts with"},{key:"doesNotStartWith",label:"Does not start with",value:"does not start with"},{key:"endsWith",label:"Ends with",value:"ends with"},{key:"doesNotEndWith",label:"Does not end with",value:"does not end with"}],rSi={equal:"=",notEqual:"!=",isNull:"IS NULL",isNotNull:"IS NOT NULL",greaterThan:">",greaterThanOrEqualto:">=",lessThan:"<",lessThanEqualTo:"<=",contains:"LIKE",notContains:"NOT LIKE",StartsWith:"LIKE",doesNotStartWith:"NOT LIKE",endsWith:"LIKE",doesNotEndWith:"NOT LIKE"},oSi=[{key:"where",label:"WHERE",value:"WHERE"},{key:"having",label:"HAVING",value:"HAVING"}];function vse(i,e){const t=e==null?void 0:e.find(n=>n.value===i.dimensionId||n.label===i.name);return t?{datasetName:t.datasetName,dimensionColumn:t.dimensionColumn,englishName:t.englishName,dimensionId:t.value}:null}const aSi=i=>i?i.map(e=>{var t;return((t=e==null?void 0:e.subFilter)==null?void 0:t.type)==="basic"&&e.subFilter.basic&&e.subFilter.basic.condition&&(e.subFilter.basic.condition=e.subFilter.basic.condition.toLowerCase()),Me({},e.subFilter)}):[],sSi=(i,e)=>{var r,o;if(!fc(i)||!(e&&(e==null?void 0:e.length)>0))return[];const t=((r=e==null?void 0:e[0])==null?void 0:r.label)||((o=e==null?void 0:e[0])==null?void 0:o.value);return(i==null?void 0:i[t])||[]},lSi=i=>{const e="/metricInsight/api/v1/metric/"+i;return VT.get({url:e}).then(t=>t.data||[])},uSi=i=>{const e="/metricInsight/api/v1/dimension/metric?mode=intersect&metricIds="+i.join(",");return VT.get({url:e}).then(t=>{var n;return((n=t==null?void 0:t.data)==null?void 0:n.items)||[]})},cSi=i=>VT.post({url:"/metricInsight/api/v1/mql/params",data:i}).then(t=>(t==null?void 0:t.data)||[]),hSi=(i,e)=>i!=null&&i.mql?fSi(i,e):dSi(e),dSi=({timeRange:i,metrics:e,dimensions:t,timeGrain:n,filters:r,queryMetricOrgId:o,queryType:a,orders:s})=>{const l=e==null?void 0:e.map(p=>p.value),u=l==null?void 0:l[0],c=t==null?void 0:t.some(p=>p.value==="metricTime");let h=t,d;c&&(h=t==null?void 0:t.filter(p=>p.value!=="metricTime"),d={dimensionName:"metricTime",dimensionUnit:n});const f={orgId:o,metricIds:l,timeRange:i,dimensionIds:h==null?void 0:h.map(p=>p.value),queryType:a};(i==null?void 0:i.type)==="custom"&&(i!=null&&i.custom)&&(f.timeRange.custom={from:Ir(i.custom.from).format(q7),to:Ir(i.custom.to).format(q7)}),d&&(f.timeDimension=d),r&&r.length>0&&(f.filters=r.map(p=>({conjunction:"AND",subFilter:Me({},p)}))),s&&(s==null?void 0:s.length)>0&&u&&(f.orders={[e==null?void 0:e[0].label]:s});const g=`/metricInsight/api/v1/metric/${u}/preview`;return VT.post({url:g,data:f}).then(p=>(p==null?void 0:p.data)||[])},fSi=(i,{timeRange:e,metrics:t,dimensions:n,timeGrain:r,filters:o,queryMetricOrgId:a,queryType:s,orders:l})=>{const u=i==null?void 0:i.mql,c={dimensions:[],metricDefinitions:{},metrics:[],timeConstraint:{},filters:{},orders:{},limits:(u==null?void 0:u.limits)||{},orgId:a,queryType:s},h=n==null?void 0:n.map(g=>{let p=(g==null?void 0:g.englishName)||(g==null?void 0:g.label);return g.value==="metricTime"&&(p="metric_time__"+r),p});c.dimensions={};let d=o==null?void 0:o.map(g=>{var p;return g.type==="basic"?pSi(g==null?void 0:g.basic):g.type==="customSql"?(p=g==null?void 0:g.sql)==null?void 0:p.filterCondition:null}).filter(g=>g!==null&&g.trim()!=="");return t==null||t.forEach(g=>{const p=(g==null?void 0:g.displayName)||(g==null?void 0:g.label);c.metrics.push(p),c.dimensions[p]=h,c.metricDefinitions[p]=g.metricDefinitions,c.filters[p]=d||[],c.timeConstraint[p]=e||{},c.orders[p]=l||{}}),VT.post({url:"/metricInsight/api/v1/mql/query",data:c}).then(g=>{var p;return((p=g==null?void 0:g.data)==null?void 0:p[0])||[]})},gSi=i=>{const{data:e,metricTime:t}=i;if(!e)return[];if(!(e!=null&&e.columns)||!(e!=null&&e.rows))return[];const{columns:n,rows:r}=e;return n.forEach((a,s)=>{a.name}),r.map(a=>{const s={};return n.forEach((l,u)=>{if(a.row[u]!==void 0){let c=l.name;c==="metricTime"&&(c=t),s[c]=a.row[u].v}}),s})},pSi=i=>{var s;const e=(i==null?void 0:i.englishName)||(i==null?void 0:i.dimensionColumn),t=i==null?void 0:i.condition,n=i==null?void 0:i.value,r=(s=mse.find(l=>l.value===t))==null?void 0:s.key,o=rSi[r];if(!e||!o)throw new Error("Invalid filter configuration");if(r==="isNull"||r==="isNotNull")return`${e} ${o}`;if(o==="LIKE"||o==="NOT LIKE"){let l=n;return t==="contains"?l=`%${n}%`:t==="StartsWith"?l=`${n}%`:t==="endsWith"?l=`%${n}`:t==="notContains"?l=`%${n}%`:t==="doesNotStartWith"?l=`${n}%`:t==="doesNotEndWith"&&(l=`%${n}`),`${e} ${o} '${l}'`}const a=typeof n=="string"?`'${n}'`:n;return`${e} ${o} ${a}`},mSi={metricInsight:{queryMql2Params:cSi,queryChartData:hSi,queryMetricId:lSi,queryDimensions:uSi,transformData:gSi},simpleJson:{}},aqe=i=>{const e=ed(),{setError:t,setLoading:n}=Jh();return ce.useMemo(()=>{const o=mSi[i];return{queryMql2Params:o.queryMql2Params?sqe(o.queryMql2Params,t,n,e):()=>Promise.resolve({}),queryMetricId:o.queryMetricId?sqe(o.queryMetricId,t,n,e):()=>Promise.resolve({}),queryDimensions:o.queryDimensions?o.queryDimensions:()=>Promise.resolve({}),queryChartData:o.queryChartData?o.queryChartData:()=>Promise.resolve({}),transformData:a=>o.transformData?o.transformData(a):[]}},[i])};function sqe(i,e,t,n){return((...r)=>ga(null,null,function*(){try{return yield i(...r)}catch(o){let a=o==null?void 0:o.message;throw typeof o=="string"&&(a=o),t(!1),e({visible:!0,title:n.formatMessage({id:"metricError"}),message:a||"error"}),o}}))}const lqe=[{key:"none",label:"None",value:"none"},{key:"number",label:"Number",value:"number"},{key:"percentage_raw",label:"Percentage (raw)",value:"percentage_raw",desc:"1→1%"},{key:"percentage_scaled",label:"Percentage (scaled)",value:"percentage_scaled",desc:"1→100%"}],vSi={none:"",number:"",percentage_raw:"%",percentage_scaled:"%",celsius:"°C",fahrenheit:"°F",CNY:"¥",USD:"$",GBP:"£",EUR:"€"};function uqe(i,e){if(!i&&!e)return"";let t="",n="";return i&&i!=="none"&&(t=i),e&&e!=="none"&&(n=vSi[e]||e),t+(n?" "+n:"")}function bSi(i,e,t){if(!i)return null;const{dimensionDetailList:n,displayName:r,metricId:o,derivationMethod:a}=i,s={value:o,label:r},l=bse(n,a,t),c=((e==null?void 0:e.dimensions)||[(e==null?void 0:e.xField)||(e==null?void 0:e.nameField)]).map(d=>l.find(f=>d===f.label||d===f.value)).filter(Boolean),h=xSi(r,i);return{metrics:[s],dimensions:c,dissionOptions:l,dataFormat:h}}function ySi(i,e){const{metrics:t}=e,n=hqe(i),r=[],o={};return((n==null?void 0:n.metrics)||[]).forEach(s=>{var p,m;const l=(p=n==null?void 0:n.metricDefinitions)==null?void 0:p[s],u=l==null?void 0:l.refMetric,c=l==null?void 0:l.variables;let h;!u&&c?h=Object.values(c).map(v=>v==null?void 0:v.refMetric):h=[u];let d=[],f=[],g=!1;((m=l==null?void 0:l.indirections)==null?void 0:m.length)>0&&!c&&(g=!0),t.forEach(v=>{if(!g&&v.englishName===u){const b=v==null?void 0:v.metricUnit;o[s]={formatType:(b==null?void 0:b.type)||"none",decimalPlaces:(b==null?void 0:b.decimal)||0,suffix:uqe(b==null?void 0:b.valueUnit,b==null?void 0:b.formatUnit)}}else o[s]={formatType:"none",decimalPlaces:0,suffix:""};h!=null&&h.includes(v==null?void 0:v.englishName)&&!f.includes(v==null?void 0:v.metricId)&&(d.push(v),f.push(v==null?void 0:v.metricId))}),r.push({isDerived:g,displayName:s,label:s,value:"uuid-"+BV(6),metricDefinitions:l,atomicMetricIds:f,atomicMetricsInfo:d})}),{metricsOptions:r,dataFormat:o}}function _Si(i,e,t,n){const{dimensions:r,timeDimension:o={},filters:a=[]}=i,{metricsOptions:s,dataFormat:l}=e,u=Ii(Me({},n),{dataType:"TIMESTAMP"}),c=cqe(s),h=bse(t,c,n),d=(r==null?void 0:r.map(f=>h.find(g=>(f==null?void 0:f.displayName)===g.label||(f==null?void 0:f.dimensionId)===g.value)).filter(Boolean))||[];return(o==null?void 0:o.dimensionName)===(n==null?void 0:n.value)&&d.unshift(u),{metrics:s,dataFormat:l,dimensions:d,dissionOptions:h,timeDimension:o,filters:a,queryMetricOrgId:i==null?void 0:i.orgId}}function cqe(i){const e=[];return i==null||i.forEach(t=>{var n;t!=null&&t.atomicMetricsInfo&&((n=t==null?void 0:t.atomicMetricsInfo)==null||n.forEach(r=>{dl(r==null?void 0:r.derivationMethod)?e.push(...r.derivationMethod):fc(r==null?void 0:r.derivationMethod)&&e.push(r.derivationMethod)}))}),e==null?void 0:e[0]}function CSi(i,e){var r,o,a,s,l;let t=!1,n=!1;if(!(e!=null&&e.enabled))return{defaultSelected:t,defaultDisabled:n};if((e==null?void 0:e.method)==="Ranking"&&(e!=null&&e.ranking)){const u=((r=e.ranking)==null?void 0:r.dimensions)||[],c=((o=e.ranking)==null?void 0:o.ranges)||[];return{defaultSelected:[...u,...c].includes(i),defaultDisabled:n}}if((e==null?void 0:e.method)==="Proportion"&&(e!=null&&e.proportion)){const u=((a=e.proportion)==null?void 0:a.dimensions)||[],c=((s=e.proportion)==null?void 0:s.ranges)||[];return{defaultSelected:[...u,...c].includes(i),defaultDisabled:n}}if((e==null?void 0:e.method)==="Custom"&&((l=e==null?void 0:e.custom)==null?void 0:l.length)>0){const u=e.custom,c=u.findIndex(h=>(h==null?void 0:h.dimension)===i);return c!==-1&&(c===u.length-1?t=!0:(t=!1,n=!0)),{defaultSelected:t,defaultDisabled:n}}return{defaultSelected:t,defaultDisabled:n}}const xSi=(i,e)=>{var t,n;if(i&&((t=e==null?void 0:e.computationalAttributes)!=null&&t.format)){const r=(n=e==null?void 0:e.computationalAttributes)==null?void 0:n.format;return{[i]:{formatType:(r==null?void 0:r.type)||"none",decimalPlaces:(r==null?void 0:r.decimal)||0,suffix:uqe(r==null?void 0:r.valueUnit,r==null?void 0:r.formatUnit)}}}return null};function hqe(i){let e={};if(typeof i=="object")e=i;else if(typeof i=="string")try{e=JSON.parse(i)}catch(t){console.error(t)}return e}function bse(i,e,t){const n=(i==null?void 0:i.map(r=>{const{defaultSelected:o,defaultDisabled:a}=CSi(r.dimensionId,e);return{label:r.displayName,value:r.dimensionId,englishName:r.englishName||r.dimensionColumn,dataType:r.dimensionColumnType,datasetName:r.datasetName,dimensionColumn:r.dimensionColumn,defaultSelected:o,defaultDisabled:a,disabled:o||a}}))||[];return n.unshift(Ii(Me({},t),{dataType:"TIMESTAMP",englishName:t.value,datasetName:void 0,dimensionColumn:void 0,defaultSelected:!1,defaultDisabled:!1,disabled:!1})),n}const SSi=[{key:"custom",label:"Custom",value:"custom"},{key:"today",label:"Today",value:"today"},{key:"last7Days",label:"Last 7 days",value:"last7Days"},{key:"last30Days",label:"Last 30 days",value:"last30Days"},{key:"last1Year",label:"Last year",value:"last1Year"},{key:"thisWeek",label:"This week",value:"thisWeek"},{key:"thisMonth",label:"This month",value:"thisMonth"},{key:"thisQuarter",label:"This quarter",value:"thisQuarter"},{key:"thisYear",label:"This year",value:"thisYear"},{key:"weekToDate",label:"Week-to-date",value:"weekToDate"},{key:"monthToDate",label:"Month-to-date",value:"monthToDate"},{key:"quarterToDate",label:"Quarter-to-date",value:"quarterToDate"},{key:"yearToDate",label:"Year-to-date",value:"yearToDate"},{key:"advanced",label:"Advanced",value:"advanced"}],wSi=[{key:"lastPeriod",label:"Last N period",value:"lastPeriod"},{key:"periodAgo",label:"N periods ago",value:"periodAgo"},{key:"periodBoundary",label:"Current/previous period boundary",value:"periodBoundary"}],ESi=[{key:"current",label:"Current",value:"current"},{key:"previous",label:"Previous",value:"previous"}],CS=[{key:"minute",label:"Minute",value:"minute"},{key:"hour",label:"Hour",value:"hour"},{key:"day",label:"Day",value:"day"},{key:"week",label:"Week",value:"week"},{key:"month",label:"Month",value:"month"},{key:"quarter",label:"Quarter",value:"quarter"},{key:"year",label:"Year",value:"year"}],dqe=[{key:"year",label:"Year",value:"year"},{key:"quarter",label:"Quarter",value:"quarter"},{key:"month",label:"Month",value:"month"},{key:"week",label:"Week",value:"week"},{key:"day",label:"Day",value:"day"},{key:"hour",label:"Hour",value:"hour"},{key:"minute",label:"Minute",value:"minute"}],ASi=[{key:"first",label:"First",value:"first"},{key:"last",label:"Last",value:"last"}],fqe={type:"lastPeriod",lastPeriod:{range:7,unit:"day"},periodAgo:{range:7,unit:"day"},periodBoundary:{periodType:"current",periodUnit:"month",periodRange:void 0,boundaryType:"first",boundaryUnit:"day"}},jT={second:0,minute:1,hour:2,day:3,week:4,month:5,quarter:6,year:7},TSi=i=>{if(i&&Object.prototype.hasOwnProperty.call(jT,i)){const e=jT[i];return CS.filter(t=>jT[t.value]<e)}return CS},RSi=i=>{const e=jT[i==null?void 0:i.toLowerCase()];return e!==void 0?dqe.filter(t=>jT[t.value]<e):dqe},MSi=(i,e,t)=>{var n,r,o,a,s,l;if((e==null?void 0:e.type)==="custom"&&(n=e==null?void 0:e.custom)!=null&&n.from&&(r=e==null?void 0:e.custom)!=null&&r.to){const u=Ir(e.custom.from).format(Ob),c=Ir(e.custom.to).format(Ob);return`${u}-${c}`}if((e==null?void 0:e.type)==="advanced"&&e.advanced){const u=e.advanced;let c="";if((u==null?void 0:u.type)==="lastPeriod")return t({id:"lastNUnits"},{range:(o=u==null?void 0:u.lastPeriod)==null?void 0:o.range,unit:t({id:"unit"+((a=u.lastPeriod)==null?void 0:a.unit)})});if((u==null?void 0:u.type)==="periodAgo")return t({id:"periodAgoNUnits"},{range:(s=u.periodAgo)==null?void 0:s.range,unit:t({id:"unit"+((l=u.periodAgo)==null?void 0:l.unit)})});if((u==null?void 0:u.type)==="periodBoundary"){const h=u.periodBoundary;if((h==null?void 0:h.periodType)==="current")return t({id:"currentNUnit"},{periodUnit:t({id:"unit"+h.periodUnit}),boundaryType:t({id:h.boundaryType}),boundaryUnit:t({id:"unit"+h.boundaryUnit})});if((h==null?void 0:h.periodType)==="previous")return t({id:"previousNUnits"},{periodRange:h.periodRange,periodUnit:t({id:"unit"+h.periodUnit}),boundaryType:t({id:h.boundaryType}),boundaryUnit:t({id:"unit"+h.boundaryUnit})})}return c}return i},kSi=i=>i==null?void 0:i.dimensionUnit,OSi=(i,e)=>{var t,n,r;if(!(i!=null&&i.type)){const o=e==null?void 0:e.mql;let a;if(a=(t=hqe(o))==null?void 0:t.timeConstraint,!a)return{};const s=Object.keys(a)[0],l=a[s];return l&&typeof l=="object"&&(l==null?void 0:l.type)==="advanced"&&((r=(n=l==null?void 0:l.advanced)==null?void 0:n.custom)!=null&&r.from)?{type:"custom",custom:{from:l.advanced.custom.from,to:l.advanced.custom.to||Ir().format("YYYY-MM-DD HH:mm:ss")}}:{}}return i},ISi=i=>{var e;return(i==null?void 0:i.type)==="custom"&&((e=i==null?void 0:i.custom)!=null&&e.from)?{type:"custom",custom:{from:Ir(i.custom.from).format("YYYY-MM-DD HH:mm:ss"),to:Ir(i.custom.to).format("YYYY-MM-DD HH:mm:ss")}}:i},yse=i=>{const e=ed(),t=i.type,{queryChartData:n,transformData:r}=aqe(t),{chartJson:o,drillBy:a,setLoading:s,setChartJson:l,setError:u,setDataSourceQueryInfo:c,setChartDrillBy:h}=Jh(),d=e.formatMessage({id:"metricTime"});return{queryChartDataFromDatasource:(m,v)=>ga(null,null,function*(){var x;const{metrics:b,dimensions:y,timeGrain:_,dataFormat:S}=m;if(u({visible:!1,title:"",message:""}),m.timeRange=ISi(m.timeRange),m.dimensions=y==null?void 0:y.map(w=>Me({},w)),b!=null&&b.length){const w=yield n(i,m).catch(k=>{u({visible:!0,title:e.formatMessage({id:"chartDataLoadingFailed"}),message:k.message}),s(!1)});c({fieldInfo:(x=w==null?void 0:w.columns)==null?void 0:x.map(k=>{let O=k.name;return O==="metricTime"&&(O=d),{fieldName:O,type:k.type}})});const E=r({data:w,metricTime:d});let A=o;Xke(o)&&(A=yield Kke(Ii(Me({},o),{data:E})));let T=LV({chartJson:A,metrics:b,dimensions:y,isInit:v});const R=Ii(Me({},T),{data:E,timeGrain:_,dataFormat:S});l(R),s(!1),w&&u({visible:!1,title:"",message:""})}}),queryDrillByChartData:y=>ga(null,[y],function*({queryData:m,setDrillLoading:v,setDrillError:b}){var x;const{metrics:_,dimensions:S}=m;if(_!=null&&_.length){const w=yield n(i,m).catch(O=>{b({visible:!0,title:e.formatMessage({id:"drillDataLoadingFailed"}),message:O.message}),v(!1)}),E=r({data:w,metricTime:d}),A=LV({chartJson:o,metrics:_,dimensions:S}),T=Ii(Me({},A),{data:E}),R=UJ(T),k=a;h(Ii(Me({},k),{chartState:{chartJson:T,dataset:R,history:[...((x=k.chartState)==null?void 0:x.history)||[],{chartJson:T,dataset:R}]}})),v(!1),w&&b({visible:!1,title:"",message:""})}}),queyDetailTableData:m=>ga(null,null,function*(){return n(i,Ii(Me({},m),{queryType:"detailed"})).then(v=>r({data:v,metricTime:d}))})}},DSi=Ya(ml)`
10732
10732
  ${()=>Ns`
10733
10733
  &.advt-vis-chart-antd-btn {
10734
10734
  color: #89898a;
@@ -11001,7 +11001,7 @@ ${r}
11001
11001
  margin: 0 4px;
11002
11002
  }
11003
11003
  `}
11004
- `,iRi=[{key:"asc",label:"Ascending",value:"asc"},{key:"desc",label:"Descending",value:"desc"}],xQe=({order:i,orderKey:e,orderOptions:t,dimensions:n,selectDefaultOpen:r,addOrder:o,onOrderChange:a,deleteOrder:s})=>{var f,g;const[l,u]=ce.useState(!1),c=p=>{const m=t==null?void 0:t.find(v=>v.value===p.key);if(m!=null&&m.englishName||m!=null&&m.label){const v={[m.englishName||(m==null?void 0:m.label)]:{type:m==null?void 0:m.type,direction:void 0}};o==null||o(v)}u(!1)},h=p=>{i[e]=Ii(Me({},i[e]),{direction:p}),a==null||a(i),u(!1)},d=((f=n==null?void 0:n.find(p=>p.englishName===e||p.value===e))==null?void 0:f.label)||e;return _e.jsxs(_e.Fragment,{children:[e==="add-order"&&_e.jsx(LA,{classNames:{root:"advt-chart-popover"},content:_e.jsx(tRi,{children:_e.jsx(hg,{onClick:c,mode:"inline",items:t==null?void 0:t.map(p=>Ii(Me({},p),{key:p==null?void 0:p.value}))})}),trigger:"click",open:l&&t&&(t==null?void 0:t.length)>0,placement:"bottomLeft",arrow:!1,onOpenChange:p=>u(p),children:_e.jsx(m0,{className:"add-order-btn",icon:_e.jsx(fse,{}),onClick:()=>{u(!0)},disabled:!t||(t==null?void 0:t.length)===0})},e),e!=="add-order"&&_e.jsxs(gg.Compact,{className:"order-item-box",children:[_e.jsx(Mc,{prefix:d,options:od(iRi),className:"order-select",defaultOpen:r,autoFocus:r,value:(g=i==null?void 0:i[e])==null?void 0:g.direction,onChange:h}),_e.jsx(m0,{icon:_e.jsx(VL,{}),onClick:p=>{p.stopPropagation(),s&&s()}})]})]})},nRi=({orders:i,metrics:e,dimensions:t,onChange:n})=>{const[r,o]=ce.useState([]),[a,s]=ce.useState([]);ce.useEffect(()=>{const h=[];e==null||e.forEach(d=>{const f=d==null?void 0:d.label,g=i==null?void 0:i.find(p=>f&&p[f]);f&&!g&&h.push({label:d.label,value:d.value,type:"metric"})}),t==null||t.forEach(d=>{const f=d==null?void 0:d.englishName,g=i==null?void 0:i.find(p=>f&&p[f]);f&&!g&&h.push({label:d.label,value:f,type:"dimension"})}),o(h)},[i,e,t]),ce.useEffect(()=>{s([...i])},[i]);const l=h=>{n([...a,h])},u=h=>{a.splice(h,1),n([...a])},c=(h,d)=>{a[d]=h,n([...a])};return _e.jsxs(eRi,{children:[a==null?void 0:a.map((h,d)=>{var m;const f=((m=Object.keys(h))==null?void 0:m[0])||d.toString(),g=h==null?void 0:h[f],p=(g==null?void 0:g.type)&&(g==null?void 0:g.direction)===void 0;return _e.jsx("div",{className:"order-item",children:_e.jsx(xQe,{order:h,orderKey:f,deleteOrder:()=>u(d),onOrderChange:v=>c(v,d),dimensions:t,selectDefaultOpen:p})},f)}),_e.jsx("div",{className:"order-item",children:_e.jsx(xQe,{order:{},orderOptions:r,orderKey:"add-order",addOrder:l})},"add-order")]})},rRi=Ya.div`
11004
+ `,iRi=[{key:"asc",label:"Ascending",value:"asc"},{key:"desc",label:"Descending",value:"desc"}],xQe=({order:i,orderKey:e,orderOptions:t,dimensions:n,selectDefaultOpen:r,addOrder:o,onOrderChange:a,deleteOrder:s})=>{var f,g;const[l,u]=ce.useState(!1),c=p=>{const m=t==null?void 0:t.find(b=>b.value===p.key);let v="";if((m==null?void 0:m.type)==="metric"&&(v=m==null?void 0:m.label),(m==null?void 0:m.type)==="dimension"&&(v=(m==null?void 0:m.value)||(m==null?void 0:m.label)),v){const b={[v]:{type:m==null?void 0:m.type,direction:void 0}};o==null||o(b)}u(!1)},h=p=>{i[e]=Ii(Me({},i[e]),{direction:p}),a==null||a(i),u(!1)},d=((f=n==null?void 0:n.find(p=>p.englishName===e||p.value===e))==null?void 0:f.label)||e;return _e.jsxs(_e.Fragment,{children:[e==="add-order"&&_e.jsx(LA,{classNames:{root:"advt-chart-popover"},content:_e.jsx(tRi,{children:_e.jsx(hg,{onClick:c,mode:"inline",items:t==null?void 0:t.map(p=>Ii(Me({},p),{key:p==null?void 0:p.value}))})}),trigger:"click",open:l&&t&&(t==null?void 0:t.length)>0,placement:"bottomLeft",arrow:!1,onOpenChange:p=>u(p),children:_e.jsx(m0,{className:"add-order-btn",icon:_e.jsx(fse,{}),onClick:()=>{u(!0)},disabled:!t||(t==null?void 0:t.length)===0})},e),e!=="add-order"&&_e.jsxs(gg.Compact,{className:"order-item-box",children:[_e.jsx(Mc,{prefix:d,options:od(iRi),className:"order-select",defaultOpen:r,autoFocus:r,value:(g=i==null?void 0:i[e])==null?void 0:g.direction,onChange:h}),_e.jsx(m0,{icon:_e.jsx(VL,{}),onClick:p=>{p.stopPropagation(),s&&s()}})]})]})},nRi=({orders:i,metrics:e,dimensions:t,onChange:n})=>{const[r,o]=ce.useState([]),[a,s]=ce.useState([]);ce.useEffect(()=>{const h=[];e==null||e.forEach(d=>{const f=d==null?void 0:d.label,g=i==null?void 0:i.find(p=>f&&p[f]);f&&!g&&h.push({label:d.label,value:d.value,type:"metric"})}),t==null||t.forEach(d=>{const f=d==null?void 0:d.englishName,g=i==null?void 0:i.find(p=>f&&p[f]);f&&!g&&h.push({label:d.label,value:f,type:"dimension"})}),o(h)},[i,e,t]),ce.useEffect(()=>{s([...i])},[i]);const l=h=>{n([...a,h])},u=h=>{a.splice(h,1),n([...a])},c=(h,d)=>{a[d]=h,n([...a])};return _e.jsxs(eRi,{children:[a==null?void 0:a.map((h,d)=>{var m;const f=((m=Object.keys(h))==null?void 0:m[0])||d.toString(),g=h==null?void 0:h[f],p=(g==null?void 0:g.type)&&(g==null?void 0:g.direction)===void 0;return _e.jsx("div",{className:"order-item",children:_e.jsx(xQe,{order:h,orderKey:f,deleteOrder:()=>u(d),onOrderChange:v=>c(v,d),dimensions:t,selectDefaultOpen:p})},f)}),_e.jsx("div",{className:"order-item",children:_e.jsx(xQe,{order:{},orderOptions:r,orderKey:"add-order",addOrder:l})},"add-order")]})},rRi=Ya.div`
11005
11005
  ${()=>Ns`
11006
11006
  width: 100%;
11007
11007
 
Binary file
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const version = "3.0.16";
1
+ declare const version = "3.0.17";
2
2
  export default version;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@advt-gpt-chart/package",
3
3
  "private": false,
4
- "version": "3.0.16",
4
+ "version": "3.0.17",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"