!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return r};var r={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(C){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new O(n||[]);return o(a,"_invoke",{value:A(t,r,c)}),a}function v(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(C){return{type:"throw",arg:C}}}r.wrap=f;var h={};function d(){}function p(){}function m(){}var y={};s(y,c,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(P([])));b&&b!==n&&i.call(b,c)&&(y=b);var w=m.prototype=d.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(e,r){function n(o,a,c,u){var l=v(e[o],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return n("throw",t,c,u)}))}u(l.arg)}var a;o(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,i){n(t,e,r,i)}))}return a=a?a.then(i,i):i()}})}function A(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return T()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=v(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=v(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function P(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(i.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:T}}function T(){return{value:void 0,done:!0}}return p.prototype=m,o(w,"constructor",{value:m,configurable:!0}),o(m,"constructor",{value:p,configurable:!0}),p.displayName=s(m,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},x(L.prototype),s(L.prototype,u,(function(){return this})),r.AsyncIterator=L,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new L(f(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(w),s(w,l,"Generator"),s(w,c,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=i.call(o,"catchLoc"),u=i.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},r}function r(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function i(t,e,r,n,i,o,a){try{var c=t[o](a),u=c.value}catch(l){return void r(l)}c.done?e(u):Promise.resolve(u).then(n,i)}function o(e,r,n){return(r=function(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,r||"default");if("object"!==t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===t(r)?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}System.register(["vue","@ibiz-template/vue-util","@ibiz-template/model","ramda","./use-chart-controller.legacy.js","@ibiz-template/controller","qx-util","echarts","@ibiz-template/service"],(function(t,n){"use strict";var a,c,u,l,s,f,v,h,d;return{setters:[function(t){a=t.defineComponent,c=t.ref,u=t.h,l=t.getCurrentInstance,s=t.default},function(t){f=t.useNamespace},function(t){v=t.ChartModel},function(t){h=t.mergeDeepRight},function(t){d=t.u},null,null,null,null],execute:function(){var n=a({name:"ChartTooltip",props:{params:{type:[Object,Array],required:!0},c:{type:Object,required:!0},codeListMap:{type:Array,required:!0}},setup:function(t){var e,r=f("chart-tooltip"),n=c([]),i=c(""),o=c(),a=(null===(e=t.c.model.source.getPSControlParam())||void 0===e?void 0:e.ctrlParams)||{},u=a.LABEL,l=a.TEXT,s=a.LEFT,v=a.CENTER,h=a.RIGHT,d=a.PERCENTAGE,p=a.RATE,m=JSON.parse(a.LIST||"[]"),y=function(t){if(null==t)return"";try{return ibiz.util.text.format("".concat(t),"#,##0.##")}catch(e){return ibiz.log.error("".concat(t," 值格式化错误")),"".concat(t)}};return function(){var e=t.params;if(Array.isArray(e))n.value=e.map((function(e){if(!o.value&&Array.isArray(t.c.items)&&t.c.items.length){var r,n,a=e.seriesIndex||0,c=t.c.service.seriesList[a],u=null==c||null===(r=c.catalogField)||void 0===r?void 0:r.toLowerCase(),l=e.name||"",s=null===(n=t.codeListMap[a])||void 0===n?void 0:n.catalog;u&&l&&(o.value=t.c.items.find((function(t){return s&&s.get(t[u])?s.get(t[u])===l:t[u]===l})))}i.value=e.name||"";var f=Array.isArray(e.value)?e.value[1]:e.value;return{text:e.seriesName,value:y(f),color:e.color}})),Array.isArray(m)&&m.length&&(n.value=m.map((function(t){var e,r,n=null===(e=o.value)||void 0===e?void 0:e[t.value];return{color:t.color,text:t.text,value:y(n),rate:null===(r=o.value)||void 0===r?void 0:r[t.rate]}})));else if(e){var r,a,c,u,f,g=e;if(Array.isArray(t.c.items)&&t.c.items.length){var b,w,x,L=g.seriesIndex||0,A=t.c.service.seriesList[L],E=null==A||null===(b=A.catalogField)||void 0===b?void 0:b.toLowerCase(),j=null==A||null===(w=A.valueField)||void 0===w?void 0:w.toLowerCase();if("radar"===g.seriesType)return n.value=t.c.items.map((function(t){return{text:t[E],value:y(t[j]),color:g.color,left:s,center:t[v],right:h}})),void(o.value={});var S=g.name||"",O=null===(x=t.codeListMap[L])||void 0===x?void 0:x.catalog;E&&S&&(o.value=t.c.items.find((function(t){return O&&O.get(t[E])?O.get(t[E])===S:t[E]===S})))}var P=Array.isArray(g.value)?null===(r=g.value)||void 0===r?void 0:r[1]:g.value;n.value=[{text:(null===(a=o.value)||void 0===a?void 0:a[l])||e.name,value:y(P),color:g.color,left:s,center:null===(c=o.value)||void 0===c?void 0:c[v],right:h,percentage:null===(u=o.value)||void 0===u?void 0:u[d],rate:null===(f=o.value)||void 0===f?void 0:f[p]}]}}(),{ns:r,title:i,items:n,curData:o,label:u}},render:function(){var t=this;if(this.curData)return u("div",{class:this.ns.b()},[this.label&&this.curData[this.label]&&u("div",{class:this.ns.b("header")},[this.curData[this.label]]),!(this.label&&this.curData[this.label])&&this.title&&u("div",{class:this.ns.b("header")},[this.title]),u("div",{class:this.ns.b("content")},[u("div",{class:this.ns.b("item-icon")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.color&&u("div",{class:t.ns.be("item","icon"),style:{background:e.color}})])}))]),u("div",{class:this.ns.b("item-text")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.text&&u("div",{class:t.ns.be("item","text")},[e.text])])}))]),u("div",{class:this.ns.b("item-value")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[null!=e.value&&u("div",{class:t.ns.be("item","value")},[e.value])])}))]),u("div",{class:this.ns.b("item-center")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.left&&u("div",{class:t.ns.be("item","left")},[e.left]),null!=e.center&&u("div",{class:t.ns.be("item","center")},[e.center]),e.right&&u("div",{class:t.ns.be("item","right")},[e.right])])}))]),u("div",{class:this.ns.b("item-percentage")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.percentage&&u("div",{class:t.ns.be("item","percentage")},[e.percentage])])}))]),u("div",{class:this.ns.b("item-rate")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.rate&&u("div",{class:t.ns.be("item","rate")},[u("rate-span",{attrs:{value:e.rate}})])])}))])])])}});t("default",a({name:"GwxnChartControl",props:{modelData:{type:v,required:!0},context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}}},setup:function(t){var a,c=l().proxy,u=f("chart"),v=d(c,t.modelData,t.context,t.params),p=(null===(a=v.model.source.getPSControlParam())||void 0===a?void 0:a.ctrlParams)||{},m=p.TYPE,y=p.TOTAL,g=!0;v.registerLoadHook((function(t){return Array.isArray(t)&&y&&0===t.length&&(t.push(o({},y,100)),g=!1),t}));var b=function(){var t,o=(t=e().mark((function t(i){var o,a,c,u,l,f,d,b,w,x,L,A,E,j,S;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(o=i.tooltip)){t.next=6;break}return t.next=4,v.service.getAllCodeListMap(v.context,v.params);case 4:a=t.sent,o.formatter=function(t){var e=document.createElement("div"),r=new s({el:e,render:function(e){return e(n,{props:{params:t,ctrlParams:p,c:v,codeListMap:a}})}});return r.$el};case 6:if("line"===m&&(c=i.xAxis,Array.isArray(c)&&c.length&&c.forEach((function(t){t.max=function(t){return t.max+1}}))),u=i.series,Array.isArray(u)){t.next=10;break}return t.abrupt("return",i);case 10:return"custom"===m&&(-1!==(l=u.findIndex((function(t){return"pie"===t.type})))&&(b=!0,w=v.service.seriesList,(x=null===(f=w[l])||void 0===f||null===(d=f.valueField)||void 0===d?void 0:d.toLowerCase())&&v.items.every((function(t){return!t[x]}))&&(u.splice(l,1),b=!1),b&&(u[l]=h(u[l],{emphasis:{label:{formatter:function(t){var e,r=null===(e=t.value[0])||void 0===e?void 0:e.replace("~","-"),n=t.value[1];return"{value|".concat(n,"}\n{key|").concat(r,"}")}}}}))),-1!==(L=u.findIndex((function(t){return"gauge"===t.type})))&&(u[L]=h(u[L],{axisLabel:{formatter:function(t){return 24===t||t%2==1?"":"".concat(t)}}}))),"radar"===m&&(A=i.radar,E=u.find((function(t){return"radar"===t.type})),A&&!Array.isArray(A)&&Array.isArray(A.indicator)&&E&&Array.isArray(E.data)&&E.data.length&&(A.indicator=[].concat(r(A.indicator.slice(0,1)),r(A.indicator.slice(1).reverse())),E.data[0]=[].concat(r(E.data[0].slice(0,1)),r(E.data[0].slice(1).reverse())))),y&&(j=i.graphic,Array.isArray(j)&&j.length&&g&&(S=v.items.reduce((function(t,e){return t+e[y]}),0),j[0]=h(j[0],{style:{text:S}})),g||i.tooltip&&Object.assign(i.tooltip,{show:!1})),t.abrupt("return",i);case 14:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t){return o.apply(this,arguments)}}();return v.registerHook(b),{c:v,ns:u}},render:function(){if(this.c.complete)return u("control-layout",{attrs:{modelData:this.c.model}},[u("div",{class:this.ns.b(),style:{width:this.c.width,height:this.c.height}},[u("div",{attrs:{id:this.c.chartId},class:this.ns.b("content")}),this.c.items.length?null:u("div",{class:this.ns.b("empty-content")},["暂无数据"])])])}}))}}}))}();