@vlci/cdmciutat 30.0.0 → 32.0.0

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/js/piae.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.piae=e():t.piae=e()}(self,(()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{THRESHOLDS:()=>it,addPointInteger:()=>u,buildCamarasTrafico:()=>ft,buildTableCalidadAire:()=>st,calculateMaxYAxis:()=>b,calculatePentahoPath:()=>lt,calculateXAxisStart:()=>y,checkAllGroupsCollapsed:()=>at,configureDataBar:()=>T,configureDataGaugeCommon:()=>x,configureDataGaugeMonthCommon:()=>v,configureDataLine:()=>$,configureDataValidate:()=>Tt,configureLinesChartValidates:()=>Ct,convertToLanguageSelectorDateRange:()=>X,convertToTableTreeView:()=>nt,downloadCSVTable:()=>ot,downloadPDFTable:()=>rt,formatCellMultiplesLines:()=>K,formatDayMonthYear:()=>i,formatMilMillionEuros:()=>I,formatMonthAnyo:()=>r,formatName:()=>m,formatNameHeaderColumn:()=>Q,formatRoundTooltip:()=>D,formatShortMonthShortYear:()=>l,formatShortMonthYear:()=>s,formatToMillions:()=>f,formatToTons:()=>h,formatTooltip:()=>g,formatTooltipPie:()=>E,formatTrimestre:()=>c,getEnvironment:()=>ct,getMaxFieldNumberFromData:()=>O,getMonth:()=>a,getMonthList:()=>d,getSelectCommonOptions:()=>Y,getSelectTwoColumnsOptions:()=>W,initBarChart:()=>gt,initBarChartComparationMonth:()=>Mt,initChart:()=>p,initStackedBarChart:()=>pt,initStackedBarChartMonthSeries:()=>St,initTable:()=>Z,initValueDefaultDate:()=>J,initialCalls:()=>ut,loadIframeOnClickEvent:()=>xt,printDataChart:()=>S,printDataInHTMLElements:()=>w,printNoDataChart:()=>A,resetFilter:()=>V,resetFilterDate:()=>j,resetFilterDates:()=>q,resultsetWithFields:()=>C,selectConfigDatasource:()=>U,selectFilterAll:()=>_,selectValueDefaultInFilter:()=>H,splitDataset:()=>R,traverseRows:()=>et,updateObject:()=>L,updateStackedBarOptions:()=>At});const n={"01":"Enero","02":"Febrero","03":"Marzo","04":"Abril","05":"Mayo","06":"Junio","07":"Julio","08":"Agosto","09":"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"};function a(t){return{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(t.toString(),10)]}function o(t){return[t.substring(0,4),n[t.substring(4,6)]]}function r(t){const[e,n]=o(t);return`${n} ${e}`}function i(t){const[e,a,o]=function(t){return[t.substring(0,4),n[t.substring(4,6)],t.substring(6,8)]}(t);return`${o} ${a} ${e}`}function s(t){const[e,n]=o(t);return`${n.substring(0,3)} ${e}`}function l(t){const[e,n]=o(t);return`${n.substring(0,3)} '${e.substring(2,4)}`}function c(t){const[e,n]=t.split("-");return`${parseFloat(n)/3}T ${e}`}function d(t,e){const n=t[e];return Array.from(n.values()).map((t=>t.slice(0,3)))}function u(t,e=2){let n=navigator.language||navigator.userLanguage;n=n.length<=2?`${n}-${n.toUpperCase()}`:n;const a={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===n?t.toLocaleString("de-DE",a):t.toLocaleString(n,a)}function f(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function h(t){return t>=1e3?t/1e3+" Tn":t.toString()}function m(t,e=29){if(t.length>=e){const n=t.split(" ");let a="",o="";return n.forEach((t=>{`${a} ${t}`.length<=e?a+=(a?" ":"")+t:(o+=`${a}\n`,a=t)})),o+=a,o}return t}function p(t,e){const n=document.getElementById(t);if(!n)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const a=echarts.init(n);a.setOption(e,!0),window.addEventListener("resize",(()=>{null!=a&&void 0!==a&&a.resize()}));const o=document.getElementById("main-content");return o&&(o.addEventListener("shown.bs.collapse",(()=>{a.resize()})),o.addEventListener("hidden.bs.collapse",(()=>{a.resize()}))),a}function A(t,e){const n=t?document.querySelector(t):null,a=e?document.querySelector(e):null;n&&(n.hidden=!0),a&&(a.style.background="url('./build/images/nodata1.png') no-repeat top center",a.hidden=!1)}function S(t,e){const n=t?document.querySelector(t):null,a=e?document.querySelector(e):null;n&&(n.hidden=!0),a&&(a.style.background="#ffffff",a.hidden=!1)}function g(t,e=!1,n=!0,a=""){let o=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach((t=>{const r=e?Math.round(t.data):t.data,i=n?`<div style="font-weight: 400;color: #666;">${s=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${s}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${u(r)} ${a}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${u(r)} ${a}`:"-"}\n </span>\n </div>`;var s;o+=i})),o}function y(t){return 100*(t-120)/t}function b(t,e){const n=Math.max(...t);return n+(e-n%e)}function E(t,e=!1){const n=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,a=e?`${t.percent}%`:u(t.value);return`<div> ${n} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${a} </span></div>`}function D(t,e){let n=`${t.name} : `;return n+=`<span style="font-weight:500">${u(Math.round(t.value))}</span>`,e&&(n+=`<span> (${t.percent}%)</span>`),t.marker+n}function I(t){const e=1e6,n=Number(t);return n>=0&&n<e?`${u(n)} €`:n>=e?`${u(n/e)} M €`:"-"}function M(t,e,n=1){const a=Math.max(...t.map((t=>t[e])))*n;return 5e3*Math.ceil(a/5e3)}function x(t,e,n,a=30,o=15,r=30,i=-70,s=70,l=3){const c=M(t,e.data,1.1),d=s,f=n.slice(),h=[];let p=o,A=r,S=i;for(let n=0;n<t.length;n+=1)h.push({value:t[n][e.data],name:m(String(t[n][e.type]).replace(/\[.*?\]/g,"")),color:f.shift(),title:{offsetCenter:[`${String(S)}%`,`${String(p)}%`],fontFamily:"Montserrat",fontSize:a},detail:{offsetCenter:[`${String(S)}%`,`${String(A)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>u(Math.round(t))}}),S+=d,(n+1)%l==0&&(A+=r,p+=2*o,S=i);return[c,h]}function v(t,e,n,o=0){return[M(e,n.data,1),t=>function(t,e,n){const o=u(Math.round(e)),r=a(t[n][0]),i=t[n][1],s=`\n${r} ${i} : ${o}`,l=`${o}\n${r} ${i}`;return window.innerWidth<=1710?s:l}(e,t,o),[{value:e[o][n.data]}]]}function N(t,e){const{resultset:n}={resultset:t},a=new Set,o=new Set,r=n.map((([t,n,r])=>{const i=e?Math.round(r):r;return a.add(t),o.add(n),{day:n,type:t,value:i}})),i=Array.from(o.values()),s=Array.from(a.values());return s.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[s.map((t=>{const e=r.filter((e=>e.type===t)).map((({day:e,value:n})=>[e,t,n])),n=i.map((t=>{const n=e.find((([e])=>e===t));return n?n[2]:null}));return{name:t,data:n}})),s,o]}function $(t,e=[],n=!1){const[a,o,r]=N(t,n);return a.forEach((t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())})),[a,r,o]}function T(t,e,n=!1){const[a,o,r]=N(t,n);return a.forEach((t=>{t.type="bar",t.color=e.shift(),t.smooth=!1})),[a,r,o]}function C(t){const{resultset:e,metadata:n}=t,a=[];return e.forEach((t=>{const e={};t.forEach(((t,a)=>{e[n[a].colName]=t})),a.push(e)})),a}function L(t,e){const n=t;return Object.keys(e).forEach((a=>{Object.prototype.hasOwnProperty.call(e,a)&&("series"===a?n[a]=e[a].map(((e,n)=>({...t[a][n],...e}))):"object"!=typeof e[a]||Array.isArray(e[a])?n[a]=e[a]:n[a]=L(t[a]||{},e[a]))})),t}function w(t,e){t.forEach((t=>{t.id in e&&Object.entries(e[t.id]).forEach((n=>{const a=n[0],o=n[1];"object"==typeof o?o.className?document.querySelector(o.className).className=t[a]:o.element&&o.format&&(document.querySelector(o.element).textContent=e[t.id][a].format(t[a])):document.querySelector(o).textContent=t[a]}))}))}function O(t,e){const n=C(t),a=[];let o=null;return n.forEach((t=>{const n=t[e];"number"!=typeof n||Number.isNaN(n)||a.push(n)})),a.length>0&&(o=Math.max(...a)),o}function R(t,e=!0){const n={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?n.Cont.push([t[3],t[4],t[2]]):n.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?n.Mob.push([t[3],t[4],t[2]]):n.Mob.push([t[3],t[2]]))})),n}const F=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],k=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],P=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],z=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],B=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function _(t){const e=t.resultset.map((t=>t[0]));return this.dashboard.fireChange(this.parameter,e),t}function G(t){for(const e of t)if(Array.isArray(e)){if(!G(e))return!1}else if("All"!==e)return!1;return!0}function U(t,e,n,a){return G(e)?(t.queryDefinition.dataAccessId=n,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=a,!0}function V(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function Y(){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function W(){const t={input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}};return t.input.indexes.id=1,t.input.indexes.label=0,t}function q(t,e,n,a){const o=Dashboards.getParameterValue(n),r=Dashboards.getParameterValue(a);return Dashboards.fireChange(t,[o]),Dashboards.fireChange(e,[r]),!0}function j(t,e){const n=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[n]),!0}function J(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function H(t,e){const n=Dashboards.getParameterValue(e),a=t.parameter;t.dashboard.setParameter(a,[n])}function X(t){t.regional.es={monthNames:F,abbreviatedMonthNames:k,dayNames:P,abbreviatedDayNames:z,dayNamesMin:B,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function Z(t,e){const n=document.getElementById(t);return n?new Tabulator(n,e):(console.error(`No se pudo encontrar el elemento con ID ${t}.`),null)}function Q(t,e){let n=t.getValue();return n.length>e&&(n=`${n.substr(0,e)}<br>${n.substr(e)}`),n}function K(t,e){const n=t.getValue().split(" ");let a="",o="";return n.forEach((t=>{(o+t).length<=e?o+=`${t} `:(a+=`${o}<br>`,o=`${t} `)})),a+=`${o}<br>`,a}function tt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const n=t.getTreeChildren();n.length>0&&n.forEach((t=>{t.getTreeChildren().length>0&&tt(t,e)}))}function et(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&tt(t,e)}))}function nt(t,e,n,a){const o=[];for(const r in t)if(t.hasOwnProperty(r)){const i=t[r],s={[e]:i[0],_children:[]};i.shift(),i.forEach(((t,o)=>{const r={[e]:n[o],[a]:t};s._children.push(r)})),o.push(s)}return o}function at(t){let e=!0;return t.getGroups().forEach((t=>{t._group.visible&&(e=!1)})),e}function ot(t,e,n){const a=document.getElementById(n),o=a.cloneNode(!0);a.parentNode.replaceChild(o,a),o.addEventListener("click",(()=>{t.download("csv",`${e}.csv`,{delimiter:";"})}))}function rt(t,e,n){const a=document.getElementById(n),o=a.cloneNode(!0);a.parentNode.replaceChild(o,a),o.addEventListener("click",(()=>{t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8}}})}))}const it={SO2:[100,200,350,500,750,751],NO2:[40,90,120,230,340,341],O3:[50,100,130,240,380,381],PM10:[20,40,50,100,150,151],PM25:[10,20,25,50,75,76]};function st(t){const e=[],n={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function a(t,e,a){const o=document.createElement("td");if(o.setAttribute("id",t),null!=e){o.innerHTML=e;const t=function(t,e){let a;return void 0===e?a=6:"ND"===e?a=7:(a=5,t.forEach(((t,n)=>{e<=t&&5===a&&(a=n)}))),n[a]}(a,e);o.classList.add(t)}return o}return t.forEach((t=>{const n=t;"noData"===n.operationalstatus&&(n.so2value="ND",n.no2value="ND",n.o3value="ND",n.pm10value="ND",n.pm25value="ND"),"A09_CABANYAL_60m"===n.entityid&&(n.pm10value=void 0,n.pm25value=void 0);const o=document.createElement("tr"),r=document.createElement("td");r.innerHTML=n.address,o.appendChild(r),o.appendChild(a(`${n.entityid}_so2`,n.so2value,it.SO2)),o.appendChild(a(`${n.entityid}_no2`,n.no2value,it.NO2)),o.appendChild(a(`${n.entityid}_o3`,n.o3value,it.O3)),o.appendChild(a(`${n.entityid}_pm10`,n.pm10value,it.PM10)),o.appendChild(a(`${n.entityid}_pm25`,n.pm25value,it.PM25)),e.push(o)})),e}function lt(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function ct(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function dt(t,e){document.querySelectorAll(`[${t}]`).forEach((n=>{!function(t,e,n){const a=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(a.innerHTML=this.responseText,n&&n()),404===this.status&&(a.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(n.getAttribute(t),n,e)}))}function ut(t){dt("include-html-cabecera",(function(){!function(){const t=ct();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=ct();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()})),dt("include-html-menu"),dt("include-html-main-container",(function(){(function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])})(),t&&t()})),dt("include-html-copyright")}function ft(t,e,n,a,o,r){let i=!1,s=!1;const l=document.querySelector(t),c=document.querySelector(e),d=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function u(t=!0){const e=document.querySelector(n);t?(l&&(l.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),s=!0):(e.classList.remove("blur"),d(),s=!1)}const f=t=>{new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(s||d(),i||(i=!0,window.setTimeout(u,r)))}))})).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(l&&(l.setAttribute("sandbox","allow-scripts"),f(l)),c&&(c.setAttribute("sandbox","allow-scripts"),f(c)),document.querySelector(o).addEventListener("click",(()=>{u(!1),window.setTimeout(u,r)}))):document.querySelectorAll(a)[0].style.display="none"}const ht={grid:{containLabel:!0},title:{left:"center",top:"0",textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"}},legend:{orient:"horizontal",bottom:"0",left:"center",width:"100%",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400,color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{restore:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}},saveAsImage:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12}},xAxis:[{type:"category",axisLabel:{show:!0,interval:0,textStyle:{fontFamily:"Montserrat",fontSize:11}},data:[]}],yAxis:[{type:"value",alignTicks:!0,position:"right",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${t}%`}},{type:"value",position:"left",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${f(t)}€`}}]},mt=(t,e)=>{e.sort(((t,e)=>parseInt(t.anyo)-parseInt(e.anyo)));const n={};e.forEach((e=>{const a=e[1],o=e[0];o!==t.seriesName||n[a]||(n[a]=0),o===t.seriesName&&(n[a]+=e[2])}));let a=`<p>${t.seriesName}</p>`;for(const[e,o]of Object.entries(n))a+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${u(o)}</span></div>`;return a};function pt(t,e,n=void 0,a=void 0){const o=null===a?void 0:a,r=new Set(e.map((t=>t[1])));let i;const s={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{axisPointer:{type:"shadow"},trigger:"item",formatter:t=>mt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,n,a,o){const r={},i=o.contentSize[1]/2,s=o.viewSize[1],l=t[1];return l<i?r.top=10:l+i>s?r.bottom=10:r.top=l-i,t[0]<o.viewSize[0]/2?r.left=t[0]+20:r.right=o.viewSize[0]-t[0]+20,r}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>u(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(r),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>u(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};o&&o.itemStyle&&Array.isArray(o.itemStyle.borderColor)&&(i=[...o.itemStyle.borderColor],delete o.itemStyle.borderColor);const n=function(t){return t.reduce(((t,e)=>{const n=e[0];return t[n]||(t[n]=[]),t[n].push(e),t}),{})}(e),a=Object.keys(n);r.forEach((t=>{a.forEach((e=>{void 0===n[e].find((e=>e[1]===t))&&(n[e].push([n[e][0][0],t,void 0]),n[e].sort())}))}));const s=[];return Object.keys(n).forEach((e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=n[e].map((t=>t[2]));let a={};a=void 0!==o?L(t,o):t,s.push({...a})})),s})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let l={};l=void 0!==n?L(s,n):s,p(t,l)}function At(t){let e={};return e=L(t,ht),e}function St(t,e,n={},o={}){let r={};r=L(n,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach((e=>{t.add(e[1])})),Array.from(t).sort(((t,e)=>t-e))}()}});const i={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},s=null===o?i:L(o,i),l=e;l.forEach(((t,e)=>{l[e][0]=a(t[0])})),pt(t,l,r,s)}function gt(t,e=void 0){const n={title:{text:"SIN TITULO",left:"center",top:"top",padding:50,textStyle:{fontSize:14,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"30%",bottom:"5%",left:"8%",right:"8%"},xAxis:{type:"value",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},appendToBody:!0,formatter:t=>D(t,!1)},series:[{type:"bar",showBackground:!0}]};let a={};a=void 0!==e?L(n,e):n,p(t,a)}const yt="es_ES",bt={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])};function Et(t){return Math.max(...t.map((t=>Number(t[0]))))}function Dt(t){const e=t.filter((e=>Number(e[0])===Et(t))),n=Array.from({length:12},(()=>0));return e.forEach((([t,e,a])=>{const o=parseInt(e,10)-1;n[o]=a})),n}function It(t){const e=t.filter((e=>Number(e[0])===Et(t)-1)),n=Array.from({length:12},(()=>0));return e.forEach((([t,e,a])=>{const o=parseInt(e,10)-1;n[o]=a})),n}function Mt(t,e,n=void 0){const a=Et(e).toString(),o=(Et(e)-1).toString();gt(t,L({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[o,a],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:d(bt,yt),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:o,type:"bar",data:It(e)},{name:a,type:"bar",barGap:0,data:Dt(e)}]},n))}function xt(t,e,n){const a=document.querySelector(e),o=document.querySelector(t);let r=!1;o.addEventListener("click",(()=>{!1===r&&(r=!0,a.setAttribute("src","about:blank"),a.setAttribute("src",n),a.onload=()=>{r=!1})})),o.disabled=!1}const vt="id",Nt="fecha",$t="value";function Tt(t,e,n,a){const[o,r]=function(t,e,n){const a=[],o=[];return t.forEach((t=>{e.includes(`${t[vt]}`)?a.push(`${t[Nt]}`):n.includes(`${t[vt]}`)&&o.push(`${t[Nt]}`)})),[a.map((t=>[t,0])),o.map((t=>[t,0]))]}(t,n,a);let i="Datos sin validar";0===r.length&&(i="");const s={name:"Datos validados",type:"line",data:[...o,r[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let l="",c="";if(0===r.length){const e=t[t.length-1].fecha;l=e,c=e}else l=r[0][0],c=r[r.length-1][0];return[...e,s,{name:"Datos NO validados",type:"line",data:r,lineStyle:{color:"#80D4CF",width:4},showSymbol:!1,tooltip:{show:!1},markArea:{silent:!0,itemStyle:{opacity:.6,color:"#eee"},tooltip:{show:!1},label:{color:"#333",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:11},data:[[{name:i,xAxis:l,yAxis:0},{name:"end",xAxis:c,yAxis:Math.max(...t.filter((t=>null!==t[$t])).map((t=>parseInt(`${t[$t]}`,10))))}]]}}]}function Ct(t,e,n=void 0){p(t,L({grid:{left:"2.5%",right:"5%",bottom:"70",top:"150",containLabel:!0},title:{left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},legend:{type:"plain",top:"50",width:"98%",textStyle:{fontFamily:"Montserrat"}},tooltip:{trigger:"axis",show:!0,formatter:t=>g(t),textStyle:{fontFamily:"Montserrat"}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{type:"value",nameLocation:"end",nameGap:"0",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"500",padding:[-25,0,0,-48],margin:0,align:"left",verticalAlign:"top",width:"auto"},scale:!0,splitNumber:"6",axisLabel:{margin:10,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},dataZoom:{end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}},toolbox:{feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:"1%",top:"0%"},series:e},n))}return e})(),t.exports=e()}},e={};function n(a){var o=e[a];if(void 0!==o)return o.exports;var r=e[a]={exports:{}};return t[a](r,r.exports,n),r.exports}n.d=(t,e)=>{for(var a in e)n.o(e,a)&&!n.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var a={};return(()=>{"use strict";n.r(a),n.d(a,{echartInstanciesDonadesAlta:()=>v,echartNotificacionsTelematic:()=>T,echartPIAEDonadesAltaBarMonth:()=>U,echartPIAEDonadesAltaGaugeMonth:()=>W,echartPIAEDonadesAltaGaugeYear:()=>q,echartPIAEDonadesAltaStackedBarYears:()=>Y,echartResolucionsAssentades:()=>N});const t="8%",e="2.5%",o="5%",r="18%",i="20%",s="10%",l="90%",c="1%",d="0%",u=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],f=33,h=27,m=30;function p(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const n={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",n):t.toLocaleString(e,n)}function A(t){return p(t)}function S(t,e,n=1){const a=Math.max(...t.map((t=>t[e])))*n;return 5e3*Math.ceil(a/5e3)}function g(t){return Math.round(document.getElementById(t).offsetWidth/f)}function y(n,a,u,f,h,m,S,g=5,y="",b=h,E=100,D,I=void 0,M=void 0){return{title:{text:y,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",show:!0,formatter:t=>function(t,e=!1){let n=`<p>${t[0].name}</p>`;return t.forEach((t=>{const a=e?Math.round(t.data):t.data,o=`<div>${r=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${r}"></span>`} ${t.seriesName}: <strong style="float: right; margin-left:20px">${t.data?p(a):"-"}</strong></div>`;var r;n+=o})),n}(t),textStyle:{fontFamily:"Montserrat"}},legend:a?{type:"plain",data:a,textStyle:{fontFamily:"Montserrat"},top:I||t,selected:D}:null,grid:{left:e,right:o,bottom:r,top:a?I?"30%":i:s,heigh:l,containLabel:!0},xAxis:{type:"category",data:u,boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{name:f,nameLocation:"end",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"bold",padding:[0,0,0,S]},type:"value",scale:!0,min:M,axisLabel:{margin:g,formatter:A,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},series:n,dataZoom:[{show:m,data:u,start:b,end:E,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}],toolbox:{show:m,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:c,top:d}}}function b(t,e,n=-45,a="",o=e){const r=new Set,i=[];t.forEach((t=>{const e=t[0].toString().padStart(2,"0");r.add(`${e}/${t[1]}`),i.push(Math.round(t[2]))}));const s=i.length<100?40:80;return y({name:o,type:"bar",smooth:!1,barMaxWidth:40,itemStyle:{color:"#5470c6"},textStyle:{fontFamily:"Montserrat"},data:i},null,Array.from(r.values()),e,s,!0,n,25,a)}function E(t,e,n,a){return{color:u,title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:a,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"},formatter:t=>function(t,e){const n=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${t.color};"></span>`;let a=`${t.name} : `;return a+=`<span style="font-weight:bold">${p(t.value)}</span>`,e&&(a+=`<span> (${t.percent}%)</span>`),n+a}(t,!1)},splitNumber:3,series:{type:"gauge",max:e,startAngle:-180,endAngle:0,splitNumber:2,pointer:{show:!1,icon:"roundRect"},progress:{show:!0,overlap:!1,roundCap:!0,clip:!0,itemStyle:{borderWidth:1,borderColor:"#464646"}},axisLine:{lineStyle:{width:60}},splitLine:{show:!0,distance:10,length:10},axisTick:{show:!0,splitNumber:5},axisLabel:{show:!0,distance:70,formatter:t=>p(Math.round(t)),fontFamily:"Montserrat",color:"#666"},data:n,detail:{fontSize:a/1.2,color:"inherit",formatter:t=>p(Math.round(t))}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:h,top:m}}}function D(t,e="",n){const a=[],o=S(t,1,1.1),r=o.toString().length>=9?100:95,i=115===r?-45:-35;let s=t.length<5?t.length*i:-190;for(let e=0;e<t.length;e+=1)a.push({value:t[e][1],name:String(t[e][0]),title:{offsetCenter:[String(s),"20%"],fontFamily:"Montserrat"},detail:{offsetCenter:[String(s),"35%"],fontFamily:"Montserrat"}}),s+=r;return E(e,o,a,n)}function I(t,e,n="",a){return{title:{text:n,left:"center",top:"top",padding:10,textStyle:{fontSize:a,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:S(t,2),itemStyle:{color:"#FFAB91"},progress:{show:!0,width:30},pointer:{show:!1},axisLine:{lineStyle:{width:30}},axisTick:{distance:10,splitNumber:5,lineStyle:{width:2,color:"#999"}},splitLine:{distance:10,length:14,lineStyle:{width:3,color:"#999"}},axisLabel:{fontFamily:"Montserrat",color:"#666",fontSize:14,show:!0,distance:40,formatter:t=>p(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[-5,"-10%"],fontSize:a+5,fontWeight:"bolder",formatter:n=>function(t,e,n){const a=p(Math.round(e)),o=(r=t[n][0],{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(r.toString(),10)]);var r;const i=t[n][1],s=`\n\n\n${o} ${i} : ${a}`,l=`${a}\n${o} ${i}`;return window.innerWidth<=1710?s:l}(t,n,e),fontFamily:"Montserrat",color:"inherit"},data:[{value:t[e][2]}]},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:h,top:m}}}function M(t,e){const n=document.getElementById(t);if(!n)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const a=echarts.init(n);return a.setOption(e,!0),$(window).on("resize",(()=>{null!=a&&void 0!==a&&a.resize()})),a}function x(t){return 100*(t-120)/t}function v(t,e){if(0===e.resultset.length)$("#chartInstanciesDonadesAlta").hide(),$("#chartExpDonatsAlta").hide(),$("#chartAdministrativesRealitzades").hide(),$("#no_dataInstanciesDonadesAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataInstanciesDonadesAlta").show(),$("#no_dataExpDonatsAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExpDonatsAlta").show(),$("#no_dataAdministrativesRealitzades").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAdministrativesRealitzades").show();else{$("#no_dataInstanciesDonadesAlta").hide(),$("#no_dataExpDonatsAlta").hide(),$("#no_dataAdministrativesRealitzades").hide(),$("#chartInstanciesDonadesAlta").css("background","#ffffff"),$("#chartInstanciesDonadesAlta").show(),$("#chartExpDonatsAlta").css("background","#ffffff"),$("#chartExpDonatsAlta").show(),$("#chartAdministrativesRealitzades").css("background","#ffffff"),$("#chartAdministrativesRealitzades").show();const t=e.resultset,n=new Set,a=[],o=[],r=[],i=1130,s=1124,l=1122;t.forEach((t=>{t[0]===i&&(n.add(t[1]),a.push(t[2])),t[0]===l&&(n.add(t[1]),r.push(t[2])),t[0]===s&&(n.add(t[1]),o.push(t[2]))}));const c=x(n.size),d=25,u=-5,f=[{name:"Instàncies",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:r}],h=[{name:"Expedients",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:o}],m=y([{name:"Tasques",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:a}],null,Array.from(n.values()),"Tasques",c,!0,u,void 0,"TASQUES ADMINISTRATIVES PIAE REALITZADES: EVOLUCIÓ DIÀRIA"),p=y(f,null,Array.from(n.values()),"Instàncies",c,!0,d,void 0,"INSTÀNCIES PIAE DONADES D'ALTA: EVOLUCIÓ DIÀRIA"),A=y(h,null,Array.from(n.values()),"Expedients",c,!0,d,void 0,"EXPEDIENTS PIAE DONADES D'ALTA: EVOLUCIÓ DIÀRIA");M("chartInstanciesDonadesAlta",p),M("chartAdministrativesRealitzades",m),M("chartExpDonatsAlta",A)}}function N(t,e){if(0===e.resultset.length)$("#chartInstanciesDonadesAlta").hide(),$("#chartExpDonatsAlta").hide(),$("#chartAdministrativesRealitzades").hide(),$("#no_dataInstanciesDonadesAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataInstanciesDonadesAlta").show(),$("#no_dataExpDonatsAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExpDonatsAlta").show(),$("#no_dataAdministrativesRealitzades").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAdministrativesRealitzades").show();else{$("#no_dataResolucionsAssentades").hide(),$("#no_dataExpDonatsAlta").hide(),$("#no_dataAdministrativesRealitzades").hide(),$("#chartInstanciesDonadesAlta").css("background","#ffffff"),$("#chartInstanciesDonadesAlta").show(),$("#chartExpDonatsAlta").css("background","#ffffff"),$("#chartExpDonatsAlta").show(),$("#chartAdministrativesRealitzades").css("background","#ffffff"),$("#chartAdministrativesRealitzades").show(),$("#chartResolucionsAssentades").css("background","#ffffff"),$("#chartResolucionsAssentades").show(),$("#chartNotificacionsTelematic").css("background","#ffffff"),$("#chartNotificacionsTelematic").show();const t=e.resultset,n=e.resultset.length,a=new Set,o=[];for(let e=0;e<n;e+=1)a.add(t[e][0]),o.push(t[e][1]);const r=x(a.size),i=35;M("chartResolucionsAssentades",y([{name:"Resolucions",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:o}],null,Array.from(a.values()),"Resolucions",r,!0,i,void 0,"RESOLUCIONS PIAE ASSENTADES: EVOLUCIÓ DIÀRIA"))}}function T(t,e){if(0===e.resultset.length)$("#chartInstanciesDonadesAlta").hide(),$("#chartExpDonatsAlta").hide(),$("#chartAdministrativesRealitzades").hide(),$("#no_dataInstanciesDonadesAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataInstanciesDonadesAlta").show(),$("#no_dataExpDonatsAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExpDonatsAlta").show(),$("#no_dataAdministrativesRealitzades").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAdministrativesRealitzades").show();else{$("#no_dataNotificacionsTelematic").hide(),$("#no_dataExpDonatsAlta").hide(),$("#no_dataAdministrativesRealitzades").hide(),$("#chartInstanciesDonadesAlta").css("background","#ffffff"),$("#chartInstanciesDonadesAlta").show(),$("#chartExpDonatsAlta").css("background","#ffffff"),$("#chartExpDonatsAlta").show(),$("#chartAdministrativesRealitzades").css("background","#ffffff"),$("#chartAdministrativesRealitzades").show(),$("#chartResolucionsAssentades").css("background","#ffffff"),$("#chartResolucionsAssentades").show(),$("#chartNotificacionsTelematic").css("background","#ffffff"),$("#chartNotificacionsTelematic").show();const t=e.resultset,n=e.resultset.length,a=new Set,o=[];for(let e=0;e<n;e+=1)a.add(t[e][0]),o.push(t[e][1]);const r=x(a.size),i=40;M("chartNotificacionsTelematic",y([{name:"Notificacions",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:o}],null,Array.from(a.values()),"Notificacions",r,!0,i,void 0,"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: EVOLUCIÓ DIÀRIA"))}}const C=0,L=1,w=2,O=3,R=4,F=1130,k=1124,P=1122,z=1143,B=1139;function _(t){const e=[],n=[],a=[],o=[],r=[];return t.forEach((t=>{t[0]===F?a.push([t[1],t[2],t[3]]):t[0]===P?e.push([t[1],t[2],t[3]]):t[0]===k?n.push([t[1],t[2],t[3]]):t[0]===z?o.push([t[1],t[2],t[3]]):t[0]===B&&r.push([t[1],t[2],t[3]])})),[e,n,a,r,o]}function G(t,e){[{chartId:`#chartInstanciesDonadesAlta${t}`,noDataId:`#no_dataInstanciesDonadesAlta${t}`},{chartId:`#chartExpDonadesAlta${t}`,noDataId:`#no_dataExpDonadesAlta${t}`},{chartId:`#chartAdministrativesDonadesAlta${t}`,noDataId:`#no_dataAdministrativesDonadesAlta${t}`},{chartId:`#chartResDonadesAlta${t}`,noDataId:`#no_dataResDonadesAlta${t}`},{chartId:`#chartNotificacionsDonadesAlta${t}`,noDataId:`#no_dataNotificacionsDonadesAlta${t}`}].forEach((({chartId:t,noDataId:n})=>{e?function(t,e){const n=t?document.querySelector(t):null,a=e?document.querySelector(e):null;n&&(n.hidden=!0),a&&(a.style.background="#ffffff",a.hidden=!1)}(t,n):function(t,e){const n=t?document.querySelector(t):null,a=e?document.querySelector(e):null;n&&(n.hidden=!0),a&&(a.style.background="url('./build/images/nodata1.png') no-repeat top center",a.hidden=!1)}(n,t)}))}function U(t,e){if(0===e.resultset.length)G("BarMonth");else{G("BarMonth");const t=_(e.resultset),n=-30,a=b(t[C],"Instàncies",n,"INSTÀNCIES PIAE DONADES D'ALTA: EVOLUCIÓ MENSUAL"),o=b(t[L],"Expedients",n,"EXPEDIENTS PIAE DONADES D'ALTA: EVOLUCIÓ MENSUAL"),r=b(t[w],"Tasques",n,"TASQUES ADMINISTRATIVES PIAE REALITZADES: EVOLUCIÓ MENSUAL"),i=b(t[O],"Resolucions",n,"RESOLUCIONS PIAE ASSENTADES: EVOLUCIÓ MENSUAL"),s=b(t[R],"Notificacions",n+15,"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: EVOLUCIÓ MENSUAL");M("chartInstanciesDonadesAltaBarMonth",a),M("chartExpDonadesAltaBarMonth",o),M("chartAdministrativesDonadesAltaBarMonth",r),M("chartResDonadesAltaBarMonth",i),M("chartNotificacionsDonadesAltaBarMonth",s)}}var V=n(2725);function Y(t,e){if(0===e.resultset.length)G("StackedBarYears");else{G("StackedBarYears");const t=_(e.resultset),n={title:{text:"INSTÀNCIES PIAE DONADES D'ALTA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nInstàncies"}};(0,V.initStackedBarChartMonthSeries)("chartInstanciesDonadesAltaStackedBarYears",t[C],n);const a={title:{text:"EXPEDIENTS PIAE DONATS D'ALTA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nExpedients"}};(0,V.initStackedBarChartMonthSeries)("chartExpDonadesAltaStackedBarYears",t[L],a);const o={title:{text:"TASQUES ADMINISTRATIVES PIAE REALITZADES: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nTasques"}};(0,V.initStackedBarChartMonthSeries)("chartAdministrativesDonadesAltaStackedBarYears",t[w],o);const r={title:{text:"RESOLUCIONS PIAE ASSENTADES: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nResolucions"}};(0,V.initStackedBarChartMonthSeries)("chartResDonadesAltaStackedBarYears",t[O],r);const i={title:{text:"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nNotificacions"}};(0,V.initStackedBarChartMonthSeries)("chartNotificacionsDonadesAltaStackedBarYears",t[R],i)}}function W(t,e){if(0===e.resultset.length)G("GaugeMonth");else{G("GaugeMonth");const t=0,n=1,a=_(e.resultset),o=g("chartInstanciesDonadesAltaGaugeMonth"),r=I(a[C],t,"INSTÀNCIES PIAE DONADES D'ALTA: MES ACTUAL",o),i=I(a[L],t,"EXPEDIENTS PIAE DONADES D'ALTA: MES ACTUAL",o),s=I(a[w],t,"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: MES ACTUAL",o),l=I(a[O],t,"RESOLUCIONS PIAE ASSENTADES: MES ACTUAL",o),c=I(a[R],t,"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: MES ACTUAL",o);M("chartInstanciesDonadesAltaGaugeMonth",r),M("chartExpDonadesAltaGaugeMonth",i),M("chartAdministrativesDonadesAltaGaugeMonth",s),M("chartResDonadesAltaGaugeMonth",l),M("chartNotificacionsDonadesAltaGaugeMonth",c);const d=I(a[C],n,"INSTÀNCIES PIAE DONADES D'ALTA: MES ANTERIOR",o),u=I(a[L],n,"EXPEDIENTS PIAE DONADES D'ALTA: MES ANTERIOR",o),f=I(a[w],n,"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: MES ANTERIOR",o),h=I(a[O],n,"RESOLUCIONS PIAE ASSENTADES: MES ANTERIOR",o),m=I(a[R],n,"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: MES ANTERIOR",o);M("chartInstanciesDonadesAltaGaugeLastMonth",d),M("chartExpDonadesAltaGaugeLastMonth",u),M("chartAdministrativesDonadesAltaGaugeLastMonth",f),M("chartResDonadesAltaGaugeLastMonth",h),M("chartNotificacionsDonadesAltaGaugeLastMonth",m)}}function q(t,e){if(0===e.resultset.length)G("GaugeYear");else{G("GaugeYear");const t=function(t){const e=[],n=[],a=[],o=[],r=[];return t.forEach((t=>{t[0]===F?a.push([t[1],t[2]]):t[0]===P?e.push([t[1],t[2]]):t[0]===k?n.push([t[1],t[2]]):t[0]===z?r.push([t[1],t[2]]):t[0]===B&&o.push([t[1],t[2]])})),[e,n,a,o,r]}(e.resultset),n=g("chartInstanciesDonadesAltaGaugeYear"),a=D(t[C],"INSTÀNCIES PIAE DONADES D'ALTA: ÚLTIMS ANYS",n),o=D(t[L],"EXPEDIENTS PIAE DONADES D'ALTA: ÚLTIMS ANYS",n),r=D(t[w],"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: ÚLTIMS ANYS",n),i=D(t[O],"RESOLUCIONS PIAE ASSENTADES: ÚLTIMS ANYS",n),s=D(t[R],"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: ÚLTIMS ANYS",n);M("chartInstanciesDonadesAltaGaugeYear",a),M("chartExpDonadesAltaGaugeYear",o),M("chartAdministrativesDonadesAltaGaugeYear",r),M("chartResDonadesAltaGaugeYear",i),M("chartNotificacionsDonadesAltaGaugeYear",s)}}})(),a})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.piae=e():t.piae=e()}(self,(()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{THRESHOLDS:()=>ct,addPointInteger:()=>u,buildCamarasTrafico:()=>pt,buildTableCalidadAire:()=>dt,calculateMaxYAxis:()=>b,calculatePentahoPath:()=>ut,calculateXAxisStart:()=>y,chartBar:()=>It,chartTop10:()=>Dt,checkAllGroupsCollapsed:()=>it,configureDataBar:()=>$,configureDataGaugeCommon:()=>M,configureDataGaugeMonthCommon:()=>v,configureDataLine:()=>T,configureDataValidate:()=>Rt,configureLinesChartValidates:()=>kt,convertToLanguageSelectorDateRange:()=>Q,convertToTableTreeView:()=>rt,distributionChart:()=>Mt,downloadCSVTable:()=>st,downloadPDFTable:()=>lt,formatCellMultiplesLines:()=>ot,formatDayMonthYear:()=>i,formatMilMillionEuros:()=>D,formatMonthAnyo:()=>r,formatName:()=>m,formatNameHeaderColumn:()=>et,formatRoundTooltip:()=>x,formatShortMonthShortYear:()=>l,formatShortMonthYear:()=>s,formatToMillions:()=>f,formatToTons:()=>h,formatTooltip:()=>A,formatTooltipPie:()=>E,formatTrimestre:()=>c,gaugeChart:()=>xt,getEnvironment:()=>ft,getMaxFieldNumberFromData:()=>F,getMonth:()=>n,getMonthList:()=>d,getSelectCommonOptions:()=>q,getSelectTwoColumnsOptions:()=>H,initBarChart:()=>Et,initBarChartComparationMonth:()=>Lt,initChart:()=>p,initStackedBarChart:()=>At,initStackedBarChartMonthSeries:()=>bt,initTable:()=>tt,initValueDefaultDate:()=>X,initialCalls:()=>mt,loadIframeOnClickEvent:()=>Ct,printDataChart:()=>S,printDataInHTMLElements:()=>C,printNoDataChart:()=>g,resetFilter:()=>Y,resetFilterDate:()=>J,resetFilterDates:()=>j,resetFilterToDefault:()=>K,resultsetWithFields:()=>w,selectConfigDatasource:()=>U,selectConfigDatasourceAllValue:()=>V,selectFilterAll:()=>_,selectValueDefaultInFilter:()=>Z,splitDataset:()=>z,traverseRows:()=>at,updateDomElement:()=>O,updateObject:()=>L,updateStackedBarOptions:()=>yt});const o={"01":"Enero","02":"Febrero","03":"Marzo","04":"Abril","05":"Mayo","06":"Junio","07":"Julio","08":"Agosto","09":"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"};function n(t){return{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(t.toString(),10)]}function a(t){return[t.substring(0,4),o[t.substring(4,6)]]}function r(t){const[e,o]=a(t);return`${o} ${e}`}function i(t){const[e,n,a]=function(t){return[t.substring(0,4),o[t.substring(4,6)],t.substring(6,8)]}(t);return`${a} ${n} ${e}`}function s(t){const[e,o]=a(t);return`${o.substring(0,3)} ${e}`}function l(t){const[e,o]=a(t);return`${o.substring(0,3)} '${e.substring(2,4)}`}function c(t){const[e,o]=t.split("-");return`${parseFloat(o)/3}T ${e}`}function d(t,e){const o=t[e];return Array.from(o.values()).map((t=>t.slice(0,3)))}function u(t,e=2){let o=navigator.language||navigator.userLanguage;o=o.length<=2?`${o}-${o.toUpperCase()}`:o;const n={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===o?t.toLocaleString("de-DE",n):t.toLocaleString(o,n)}function f(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function h(t){return t>=1e3?t/1e3+" Tn":t.toString()}function m(t,e=29){if(t.length>=e){const o=t.split(" ");let n="",a="";return o.forEach((t=>{`${n} ${t}`.length<=e?n+=(n?" ":"")+t:(a+=`${n}\n`,n=t)})),a+=n,a}return t}function p(t,e){const o=t=>{const o=echarts.init(t);o.setOption(e,!0),window.addEventListener("resize",(()=>{null!=o&&void 0!==o&&o.resize()}));const n=document.getElementById("main-content");return n&&(n.addEventListener("shown.bs.collapse",(()=>{o.resize()})),n.addEventListener("hidden.bs.collapse",(()=>{o.resize()}))),o};let n=document.getElementById(t);return n?o(n):(document.body.addEventListener("MainContentLoadedCustom",(()=>(n=document.getElementById(t),n?o(n):(console.error(`El elemento con ID ${t} no está disponible.`),null)))),null)}function g(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}function S(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}function A(t,e=!1,o=!0,n=""){let a=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach((t=>{const r=e?Math.round(t.data):t.data,i=o?`<div style="font-weight: 400;color: #666;">${s=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${s}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${u(r)} ${n}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${u(r)} ${n}`:"-"}\n </span>\n </div>`;var s;a+=i})),a}function y(t){return 100*(t-120)/t}function b(t,e){const o=Math.max(...t);return o+(e-o%e)}function E(t,e=!1){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,n=e?`${t.percent}%`:u(t.value);return`<div> ${o} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${n} </span></div>`}function x(t,e){let o=`${t.name} : `;return o+=`<span style="font-weight:500">${u(Math.round(t.value))}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),t.marker+o}function D(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${u(o)} €`:o>=e?`${u(o/e)} M €`:"-"}function I(t,e,o=1){const n=Math.max(...t.map((t=>t[e])))*o;return 5e3*Math.ceil(n/5e3)}function M(t,e,o,n=30,a=15,r=30,i=-70,s=70,l=3){const c=I(t,e.data,1.1),d=s,f=o.slice(),h=[];let p=a,g=r,S=i;for(let o=0;o<t.length;o+=1)h.push({value:t[o][e.data],name:m(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:f.shift(),title:{offsetCenter:[`${String(S)}%`,`${String(p)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(S)}%`,`${String(g)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>u(Math.round(t))}}),S+=d,(o+1)%l==0&&(g+=r,p+=2*a,S=i);return[c,h]}function v(t,e,o,a=0){return[I(e,o.data,1),t=>function(t,e,o){const a=u(Math.round(e)),r=n(t[o][0]),i=t[o][1],s=`\n${r} ${i} : ${a}`,l=`${a}\n${r} ${i}`;return window.innerWidth<=1710?s:l}(e,t,a),[{value:e[a][o.data]}]]}function N(t,e){const{resultset:o}={resultset:t},n=new Set,a=new Set,r=o.map((([t,o,r])=>{const i=e?Math.round(r):r;return n.add(t),a.add(o),{day:o,type:t,value:i}})),i=Array.from(a.values()),s=Array.from(n.values());return s.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[s.map((t=>{const e=r.filter((e=>e.type===t)).map((({day:e,value:o})=>[e,t,o])),o=i.map((t=>{const o=e.find((([e])=>e===t));return o?o[2]:null}));return{name:t,data:o}})),s,a]}function T(t,e=[],o=!1){const[n,a,r]=N(t,o);return n.forEach((t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())})),[n,r,a]}function $(t,e,o=!1){const[n,a,r]=N(t,o);return n.forEach((t=>{t.type="bar",t.color=e.shift(),t.smooth=!1})),[n,r,a]}function w(t){const{resultset:e,metadata:o}=t,n=[];return e.forEach((t=>{const e={};t.forEach(((t,n)=>{e[o[n].colName]=t})),n.push(e)})),n}function L(t,e){const o={...t};return Object.keys(e).forEach((n=>{Object.prototype.hasOwnProperty.call(e,n)&&("series"===n&&Array.isArray(e[n])?o[n]=e[n].map(((e,o)=>({...Array.isArray(t[n])&&t[n][o]||{},...e}))):"object"!=typeof e[n]||null===e[n]||Array.isArray(e[n])?t[n]!==e[n]&&(o[n]=e[n]):o[n]=L(t[n]||{},e[n]))})),o}function C(t,e){console.log("INICIO HTML");const o=()=>{t.forEach((t=>{t.id in e&&Object.entries(e[t.id]).forEach((o=>{const n=o[0],a=o[1];"object"==typeof a?a.className?document.querySelector(a.className).className=t[n]:a.element&&a.format&&(document.querySelector(a.element).textContent=e[t.id][n].format(t[n])):document.querySelector(a).textContent=t[n]}))}))};try{o()}catch(t){document.body.addEventListener("MainContentLoadedCustom",(()=>{o()}))}}function F(t,e){const o=w(t),n=[];let a=null;return o.forEach((t=>{const o=t[e];"number"!=typeof o||Number.isNaN(o)||n.push(o)})),n.length>0&&(a=Math.max(...n)),a}function O(t,e){const o=document.querySelector(t);o?o.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function z(t,e=!0){const o={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?o.Cont.push([t[3],t[4],t[2]]):o.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?o.Mob.push([t[3],t[4],t[2]]):o.Mob.push([t[3],t[2]]))})),o}const R=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],k=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],P=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],B=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],W=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function _(t){const e=t.resultset.map((t=>t[0]));return this.dashboard.fireChange(this.parameter,e),t}function G(t){for(const e of t)if(Array.isArray(e)){if(!G(e))return!1}else if("All"!==e)return!1;return!0}function U(t,e,o,n){return G(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function V(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function Y(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function q(t="Todos"){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:t,noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function H(t="Todos"){const e=q(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function j(t,e,o,n){const a=Dashboards.getParameterValue(o),r=Dashboards.getParameterValue(n);return Dashboards.fireChange(t,[a]),Dashboards.fireChange(e,[r]),!0}function J(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function X(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function Z(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;t.dashboard.setParameter(n,[o])}function Q(t){t.regional.es={monthNames:R,abbreviatedMonthNames:k,dayNames:P,abbreviatedDayNames:B,dayNamesMin:W,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function K(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(o)?o:[o]),!0}function tt(t,e){const o=document.getElementById(t);return o?new Tabulator(o,e):(console.error(`No se pudo encontrar el elemento con ID ${t}.`),null)}function et(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function ot(t,e){const o=t.getValue().split(" ");let n="",a="";return o.forEach((t=>{(a+t).length<=e?a+=`${t} `:(n+=`${a}<br>`,a=`${t} `)})),n+=`${a}<br>`,n}function nt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach((t=>{t.getTreeChildren().length>0&&nt(t,e)}))}function at(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&nt(t,e)}))}function rt(t,e,o,n){const a=[];for(const r in t)if(t.hasOwnProperty(r)){const i=t[r],s={[e]:i[0],_children:[]};i.shift(),i.forEach(((t,a)=>{const r={[e]:o[a],[n]:t};s._children.push(r)})),a.push(s)}return a}function it(t){let e=!0;return t.getGroups().forEach((t=>{t._group.visible&&(e=!1)})),e}function st(t,e,o){const n=document.getElementById(o),a=n.cloneNode(!0);n.parentNode.replaceChild(a,n),a.addEventListener("click",(()=>{t.download("csv",`${e}.csv`,{delimiter:";"})}))}function lt(t,e,o){const n=document.getElementById(o),a=n.cloneNode(!0);n.parentNode.replaceChild(a,n),a.addEventListener("click",(()=>{t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8}}})}))}const ct={SO2:[100,200,350,500,750,751],NO2:[40,90,120,230,340,341],O3:[50,100,130,240,380,381],PM10:[20,40,50,100,150,151],PM25:[10,20,25,50,75,76]};function dt(t){const e=[],o={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function n(t,e,n){const a=document.createElement("td");if(a.setAttribute("id",t),null!=e){a.innerHTML=e;const t=function(t,e){let n;return void 0===e?n=6:"ND"===e?n=7:(n=5,t.forEach(((t,o)=>{e<=t&&5===n&&(n=o)}))),o[n]}(n,e);a.classList.add(t)}return a}return t.forEach((t=>{const o=t;"noData"===o.operationalstatus&&(o.so2value="ND",o.no2value="ND",o.o3value="ND",o.pm10value="ND",o.pm25value="ND"),"A09_CABANYAL_60m"===o.entityid&&(o.pm10value=void 0,o.pm25value=void 0);const a=document.createElement("tr"),r=document.createElement("td");r.innerHTML=o.address,a.appendChild(r),a.appendChild(n(`${o.entityid}_so2`,o.so2value,ct.SO2)),a.appendChild(n(`${o.entityid}_no2`,o.no2value,ct.NO2)),a.appendChild(n(`${o.entityid}_o3`,o.o3value,ct.O3)),a.appendChild(n(`${o.entityid}_pm10`,o.pm10value,ct.PM10)),a.appendChild(n(`${o.entityid}_pm25`,o.pm25value,ct.PM25)),e.push(a)})),e}function ut(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function ft(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function ht(t,e){document.querySelectorAll(`[${t}]`).forEach((o=>{!function(t,e,o){const n=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(n.innerHTML=this.responseText,o&&o()),404===this.status&&(n.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(o.getAttribute(t),o,e)}))}function mt(t){ht("include-html-cabecera",(function(){!function(){const t=ft();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=ft();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()})),ht("include-html-menu"),ht("include-html-main-container",(function(){document.body.dispatchEvent(new Event("MainContentLoadedCustom")),function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])}(),t&&t()})),ht("include-html-copyright")}function pt(t,e,o,n,a,r){let i=!1,s=!1;const l=document.querySelector(t),c=document.querySelector(e),d=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function u(t=!0){const e=document.querySelector(o);t?(l&&(l.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),s=!0):(e.classList.remove("blur"),d(),s=!1)}const f=t=>{new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(s||d(),i||(i=!0,window.setTimeout(u,r)))}))})).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(l&&(l.setAttribute("sandbox","allow-scripts"),f(l)),c&&(c.setAttribute("sandbox","allow-scripts"),f(c)),document.querySelector(a).addEventListener("click",(()=>{u(!1),window.setTimeout(u,r)}))):document.querySelectorAll(n)[0].style.display="none"}const gt={grid:{containLabel:!0},title:{left:"center",top:"0",textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"}},legend:{orient:"horizontal",bottom:"0",left:"center",width:"100%",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400,color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{restore:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}},saveAsImage:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12}},xAxis:[{type:"category",axisLabel:{show:!0,interval:0,textStyle:{fontFamily:"Montserrat",fontSize:11}},data:[]}],yAxis:[{type:"value",alignTicks:!0,position:"right",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${t}%`}},{type:"value",position:"left",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${f(t)}€`}}]},St=(t,e)=>{e.sort(((t,e)=>parseInt(t.anyo)-parseInt(e.anyo)));const o={};e.forEach((e=>{const n=e[1],a=e[0];a!==t.seriesName||o[n]||(o[n]=0),a===t.seriesName&&(o[n]+=e[2])}));let n=`<p>${t.seriesName}</p>`;for(const[e,a]of Object.entries(o))n+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${u(a)}</span></div>`;return n};function At(t,e,o=void 0,n=void 0){const a=null===n?void 0:n,r=new Set(e.map((t=>t[1])));let i;const s={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{axisPointer:{type:"shadow"},trigger:"item",formatter:t=>St(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,o,n,a){const r={},i=a.contentSize[1]/2,s=a.viewSize[1],l=t[1];return l<i?r.top=10:l+i>s?r.bottom=10:r.top=l-i,t[0]<a.viewSize[0]/2?r.left=t[0]+20:r.right=a.viewSize[0]-t[0]+20,r}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>u(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(r),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>u(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};a&&a.itemStyle&&Array.isArray(a.itemStyle.borderColor)&&(i=[...a.itemStyle.borderColor],delete a.itemStyle.borderColor);const o=function(t){return t.reduce(((t,e)=>{const o=e[0];return t[o]||(t[o]=[]),t[o].push(e),t}),{})}(e),n=Object.keys(o);r.forEach((t=>{n.forEach((e=>{void 0===o[e].find((e=>e[1]===t))&&(o[e].push([o[e][0][0],t,void 0]),o[e].sort())}))}));const s=[];return Object.keys(o).forEach((e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=o[e].map((t=>t[2]));let n={};n=void 0!==a?L(t,a):t,s.push({...n})})),s})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let l={};l=void 0!==o?L(s,o):s,p(t,l)}function yt(t){let e={};return e=L(gt,t),e}function bt(t,e,o={},a={}){let r={};r=L(o,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach((e=>{t.add(e[1])})),Array.from(t).sort(((t,e)=>t-e))}()}});const i={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},s=null===a?i:L(a,i),l=e;l.forEach(((t,e)=>{l[e][0]=n(t[0])})),At(t,l,r,s)}function Et(t,e=void 0){const o={title:{text:"SIN TITULO",left:"center",top:"top",padding:50,textStyle:{fontSize:14,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"30%",bottom:"5%",left:"8%",right:"8%"},xAxis:{type:"value",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},appendToBody:!0,formatter:t=>x(t,!1)},series:[{type:"bar",showBackground:!0}]};let n={};n=void 0!==e?L(o,e):o,p(t,n)}function xt(t,e,o,n,a,r){const i={grid:{left:"0",right:"0",bottom:"0",top:"50",containLabel:!0},title:{text:o,margin:"0",padding:0,top:"0",left:"60%",textAlign:"center",itemGap:5,textStyle:{fontSize:15,lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:n,subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},legend:{show:!1,top:"bottom",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:"400",color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{saveAsImage:{title:"Descargar",textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},series:[{type:"gauge",center:["50%","65%"],startAngle:200,endAngle:-20,min:0,max:r,splitNumber:10,progress:{show:!0,width:40,itemStyle:{color:"#4BA3C3"}},pointer:{show:!1},axisLine:{lineStyle:{width:40}},axisTick:{distance:-50,splitNumber:5,lineStyle:{width:2,color:"#ccc"}},splitLine:{distance:-55,length:9,lineStyle:{width:2,color:"#ccc"}},axisLabel:{distance:0,textStyle:{color:"#999",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:12}},anchor:{show:!1,showAbove:!0,size:35,itemStyle:{borderWidth:40,color:"#284B63"}},detail:{formatter:t+e,width:"60%",borderRadius:8,offsetCenter:[0,0],valueAnimation:!0,textStyle:{color:"#284B63",fontStyle:"normal",fontWeight:"600",fontFamily:"Montserrat",fontSize:30}},data:[{value:t}]}]};echarts.init(document.getElementById(a)).setOption(i)}function Dt(t,e,o,n){return{grid:{top:"15%",bottom:"3%",left:"3%",right:"3%"},title:{text:t,margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontFamily:"Montserrat",fontSize:18,fontWeight:600,color:"#666"},subtext:e,subtextStyle:{fontFamily:"Montserrat",fontSize:17,fontWeight:500,color:"#666"}},tooltip:{textStyle:{fontFamily:"Montserrat"},renderMode:"html",tooltipFormatter:n},yAxis:{data:o.map((t=>t[0])),axisLabel:{show:!1}},series:[{data:o.map((t=>t[1])),type:"bar",barWidth:"75%",barCategoryGap:"20%",label:{show:!0,position:"insideLeft",formatter:"{b}",width:400,overflow:"truncate",textStyle:{fontSize:13,fontWeight:600,fontFamily:"Montserrat",color:"#284B63"}},itemStyle:{color:"#82bed4"}}]}}function It(t,e,o,n,a){const r={grid:{left:"0",right:"0",bottom:"0",top:"60",containLabel:!0},title:{text:t,margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontSize:"15",lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:e,subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},toolbox:{show:!0,right:"0",top:"0",feature:{saveAsImage:{title:"Descragar",textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},legend:{show:!1,orient:"vertical",top:"55",bottom:"5",left:"0",padding:[0,0],width:"20%",itemHeight:10,itemWidth:11,itemGap:10,textStyle:{fontSize:"12",lineHeight:14,fontFamily:"Montserrat",fontWeight:"400",color:"#666",width:210,overflow:"break"}},tooltip:{trigger:"axis",confine:!0,axisPointer:{type:"none"},textStyle:{fontFamily:"Montserrat",fontSize:12,fontWeight:500}},xAxis:{data:o,axisLabel:{show:!0,margin:6,textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:"500"}}},yAxis:{type:"value",alignTicks:!0,scale:!0,axisLabel:{formatter:"{value} kWh",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400}}},series:[{data:n,type:"bar",itemStyle:{color:"#4BA3C3"}}]};echarts.init(document.getElementById(a)).setOption(r)}function Mt(t,e,o,n,a,r,i){const s=echarts.init(document.getElementById(n)),l={grid:{left:"0",right:"0",bottom:"0",top:"50",containLabel:!0},title:{text:t,margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontSize:"15",lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:e,subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},toolbox:{show:!0,right:"0",top:"0",feature:{saveAsImage:{title:"Descargar",textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},legend:{show:!1},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12,color:"#666",fontWeight:500},formatter:function(t){return t.value[2]+o+a[t.value[0]]+i}},xAxis:{type:"category",data:a,boundaryGap:["20%","20%"],gridIndex:0,offset:0,axisTick:{show:!1},axisLine:{lineStyle:{color:"#ccc"}},axisLabel:{show:!0,interval:0,rotate:0,padding:0,margin:10,fontSize:10,lineHeight:13,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},yAxis:{type:"category",data:i,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!0,fontSize:10,fontFamily:"Montserrat",fontWeight:500,color:"#333"}},series:[{name:"Consum Energètic",type:"scatter",color:"#4BA3C3",symbolSize:function(t){return 11*t[2]},data:r,animationDelay:function(t){return 5*t}}]};l&&s.setOption(l),window.addEventListener("resize",s.resize)}const vt="es_ES",Nt={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])};function Tt(t){return Math.max(...t.map((t=>Number(t[0]))))}function $t(t){const e=t.filter((e=>Number(e[0])===Tt(t))),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const a=parseInt(e,10)-1;o[a]=n})),o}function wt(t){const e=t.filter((e=>Number(e[0])===Tt(t)-1)),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const a=parseInt(e,10)-1;o[a]=n})),o}function Lt(t,e,o=void 0){const n=Tt(e).toString(),a=(Tt(e)-1).toString();Et(t,L({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[a,n],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:d(Nt,vt),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:a,type:"bar",data:wt(e)},{name:n,type:"bar",barGap:0,data:$t(e)}]},o))}function Ct(t,e,o){const n=document.querySelector(e),a=document.querySelector(t);let r=!1;a.addEventListener("click",(()=>{!1===r&&(r=!0,n.setAttribute("src","about:blank"),n.setAttribute("src",o),n.onload=()=>{r=!1})})),a.disabled=!1}const Ft="id",Ot="fecha",zt="value";function Rt(t,e,o,n,a="es_ES"){const[r,i]=function(t,e,o){const n=[],a=[];return t.forEach((t=>{e.includes(`${t[Ft]}`)?n.push(`${t[Ot]}`):o.includes(`${t[Ft]}`)&&a.push(`${t[Ot]}`)})),[n.map((t=>[t,0])),a.map((t=>[t,0]))]}(t,o,n);let s="es_ES"==a?"Datos sin validar":"Dades sense validar";0===i.length&&(s="");const l={name:"Datos validados",type:"line",data:[...r,i[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",d="";if(0===i.length){const e=t[t.length-1].fecha;c=e,d=e}else c=i[0][0],d=i[i.length-1][0];return[...e,l,{name:"Datos NO validados",type:"line",data:i,lineStyle:{color:"#80D4CF",width:4},showSymbol:!1,tooltip:{show:!1},markArea:{silent:!0,itemStyle:{opacity:.6,color:"#eee"},tooltip:{show:!1},label:{color:"#333",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:11},data:[[{name:s,xAxis:c,yAxis:0},{name:"end",xAxis:d,yAxis:Math.max(...t.filter((t=>null!==t[zt])).map((t=>parseInt(`${t[zt]}`,10))))}]]}}]}function kt(t,e,o=void 0){p(t,L({grid:{left:"2.5%",right:"5%",bottom:"70",top:"150",containLabel:!0},title:{left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},legend:{type:"plain",top:"50",width:"98%",textStyle:{fontFamily:"Montserrat"}},tooltip:{trigger:"axis",show:!0,formatter:t=>A(t),textStyle:{fontFamily:"Montserrat"}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{type:"value",nameLocation:"end",nameGap:"0",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"500",padding:[-25,0,0,-48],margin:0,align:"left",verticalAlign:"top",width:"auto"},scale:!0,splitNumber:"6",axisLabel:{margin:10,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},dataZoom:{end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}},toolbox:{feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:"1%",top:"0%"},series:e},o))}return e})(),t.exports=e()}},e={};function o(n){var a=e[n];if(void 0!==a)return a.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,o),r.exports}o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";o.r(n),o.d(n,{echartInstanciesDonadesAlta:()=>v,echartNotificacionsTelematic:()=>T,echartPIAEDonadesAltaBarMonth:()=>G,echartPIAEDonadesAltaGaugeMonth:()=>Y,echartPIAEDonadesAltaGaugeYear:()=>q,echartPIAEDonadesAltaStackedBarYears:()=>V,echartResolucionsAssentades:()=>N});const t="8%",e="2.5%",a="5%",r="18%",i="20%",s="10%",l="90%",c="1%",d="0%",u=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],f=33,h=27,m=30;function p(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const o={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",o):t.toLocaleString(e,o)}function g(t){return p(t)}function S(t,e,o=1){const n=Math.max(...t.map((t=>t[e])))*o;return 5e3*Math.ceil(n/5e3)}function A(t){return Math.round(document.getElementById(t).offsetWidth/f)}function y(o,n,u,f,h,m,S,A=5,y="",b=h,E=100,x,D=void 0,I=void 0){return{title:{text:y,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",show:!0,formatter:t=>function(t,e=!1){let o=`<p>${t[0].name}</p>`;return t.forEach((t=>{const n=e?Math.round(t.data):t.data,a=`<div>${r=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${r}"></span>`} ${t.seriesName}: <strong style="float: right; margin-left:20px">${t.data?p(n):"-"}</strong></div>`;var r;o+=a})),o}(t),textStyle:{fontFamily:"Montserrat"}},legend:n?{type:"plain",data:n,textStyle:{fontFamily:"Montserrat"},top:D||t,selected:x}:null,grid:{left:e,right:a,bottom:r,top:n?D?"30%":i:s,heigh:l,containLabel:!0},xAxis:{type:"category",data:u,boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{name:f,nameLocation:"end",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"bold",padding:[0,0,0,S]},type:"value",scale:!0,min:I,axisLabel:{margin:A,formatter:g,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},series:o,dataZoom:[{show:m,data:u,start:b,end:E,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}],toolbox:{show:m,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:c,top:d}}}function b(t,e,o=-45,n="",a=e){const r=new Set,i=[];t.forEach((t=>{const e=t[0].toString().padStart(2,"0");r.add(`${e}/${t[1]}`),i.push(Math.round(t[2]))}));const s=i.length<100?40:80;return y({name:a,type:"bar",smooth:!1,barMaxWidth:40,itemStyle:{color:"#5470c6"},textStyle:{fontFamily:"Montserrat"},data:i},null,Array.from(r.values()),e,s,!0,o,25,n)}function E(t,e,o,n){return{color:u,title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:n,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"},formatter:t=>function(t,e){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${t.color};"></span>`;let n=`${t.name} : `;return n+=`<span style="font-weight:bold">${p(t.value)}</span>`,e&&(n+=`<span> (${t.percent}%)</span>`),o+n}(t,!1)},splitNumber:3,series:{type:"gauge",max:e,startAngle:-180,endAngle:0,splitNumber:2,pointer:{show:!1,icon:"roundRect"},progress:{show:!0,overlap:!1,roundCap:!0,clip:!0,itemStyle:{borderWidth:1,borderColor:"#464646"}},axisLine:{lineStyle:{width:60}},splitLine:{show:!0,distance:10,length:10},axisTick:{show:!0,splitNumber:5},axisLabel:{show:!0,distance:70,formatter:t=>p(Math.round(t)),fontFamily:"Montserrat",color:"#666"},data:o,detail:{fontSize:n/1.2,color:"inherit",formatter:t=>p(Math.round(t))}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:h,top:m}}}function x(t,e="",o){const n=[],a=S(t,1,1.1),r=a.toString().length>=9?100:95,i=115===r?-45:-35;let s=t.length<5?t.length*i:-190;for(let e=0;e<t.length;e+=1)n.push({value:t[e][1],name:String(t[e][0]),title:{offsetCenter:[String(s),"20%"],fontFamily:"Montserrat"},detail:{offsetCenter:[String(s),"35%"],fontFamily:"Montserrat"}}),s+=r;return E(e,a,n,o)}function D(t,e,o="",n){return{title:{text:o,left:"center",top:"top",padding:10,textStyle:{fontSize:n,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:S(t,2),itemStyle:{color:"#FFAB91"},progress:{show:!0,width:30},pointer:{show:!1},axisLine:{lineStyle:{width:30}},axisTick:{distance:10,splitNumber:5,lineStyle:{width:2,color:"#999"}},splitLine:{distance:10,length:14,lineStyle:{width:3,color:"#999"}},axisLabel:{fontFamily:"Montserrat",color:"#666",fontSize:14,show:!0,distance:40,formatter:t=>p(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[-5,"-10%"],fontSize:n+5,fontWeight:"bolder",formatter:o=>function(t,e,o){const n=p(Math.round(e)),a=(r=t[o][0],{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(r.toString(),10)]);var r;const i=t[o][1],s=`\n\n\n${a} ${i} : ${n}`,l=`${n}\n${a} ${i}`;return window.innerWidth<=1710?s:l}(t,o,e),fontFamily:"Montserrat",color:"inherit"},data:[{value:t[e][2]}]},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:h,top:m}}}function I(t,e){const o=document.getElementById(t);if(!o)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const n=echarts.init(o);return n.setOption(e,!0),$(window).on("resize",(()=>{null!=n&&void 0!==n&&n.resize()})),n}function M(t){return 100*(t-120)/t}function v(t,e){if(0===e.resultset.length)$("#chartInstanciesDonadesAlta").hide(),$("#chartExpDonatsAlta").hide(),$("#chartAdministrativesRealitzades").hide(),$("#no_dataInstanciesDonadesAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataInstanciesDonadesAlta").show(),$("#no_dataExpDonatsAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExpDonatsAlta").show(),$("#no_dataAdministrativesRealitzades").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAdministrativesRealitzades").show();else{$("#no_dataInstanciesDonadesAlta").hide(),$("#no_dataExpDonatsAlta").hide(),$("#no_dataAdministrativesRealitzades").hide(),$("#chartInstanciesDonadesAlta").css("background","#ffffff"),$("#chartInstanciesDonadesAlta").show(),$("#chartExpDonatsAlta").css("background","#ffffff"),$("#chartExpDonatsAlta").show(),$("#chartAdministrativesRealitzades").css("background","#ffffff"),$("#chartAdministrativesRealitzades").show();const t=e.resultset,o=new Set,n=[],a=[],r=[],i=1130,s=1124,l=1122;t.forEach((t=>{t[0]===i&&(o.add(t[1]),n.push(t[2])),t[0]===l&&(o.add(t[1]),r.push(t[2])),t[0]===s&&(o.add(t[1]),a.push(t[2]))}));const c=M(o.size),d=25,u=-5,f=[{name:"Instàncies",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:r}],h=[{name:"Expedients",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:a}],m=y([{name:"Tasques",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:n}],null,Array.from(o.values()),"Tasques",c,!0,u,void 0,"TASQUES ADMINISTRATIVES PIAE REALITZADES: EVOLUCIÓ DIÀRIA"),p=y(f,null,Array.from(o.values()),"Instàncies",c,!0,d,void 0,"INSTÀNCIES PIAE DONADES D'ALTA: EVOLUCIÓ DIÀRIA"),g=y(h,null,Array.from(o.values()),"Expedients",c,!0,d,void 0,"EXPEDIENTS PIAE DONADES D'ALTA: EVOLUCIÓ DIÀRIA");I("chartInstanciesDonadesAlta",p),I("chartAdministrativesRealitzades",m),I("chartExpDonatsAlta",g)}}function N(t,e){if(0===e.resultset.length)$("#chartInstanciesDonadesAlta").hide(),$("#chartExpDonatsAlta").hide(),$("#chartAdministrativesRealitzades").hide(),$("#no_dataInstanciesDonadesAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataInstanciesDonadesAlta").show(),$("#no_dataExpDonatsAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExpDonatsAlta").show(),$("#no_dataAdministrativesRealitzades").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAdministrativesRealitzades").show();else{$("#no_dataResolucionsAssentades").hide(),$("#no_dataExpDonatsAlta").hide(),$("#no_dataAdministrativesRealitzades").hide(),$("#chartInstanciesDonadesAlta").css("background","#ffffff"),$("#chartInstanciesDonadesAlta").show(),$("#chartExpDonatsAlta").css("background","#ffffff"),$("#chartExpDonatsAlta").show(),$("#chartAdministrativesRealitzades").css("background","#ffffff"),$("#chartAdministrativesRealitzades").show(),$("#chartResolucionsAssentades").css("background","#ffffff"),$("#chartResolucionsAssentades").show(),$("#chartNotificacionsTelematic").css("background","#ffffff"),$("#chartNotificacionsTelematic").show();const t=e.resultset,o=e.resultset.length,n=new Set,a=[];for(let e=0;e<o;e+=1)n.add(t[e][0]),a.push(t[e][1]);const r=M(n.size),i=35;I("chartResolucionsAssentades",y([{name:"Resolucions",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:a}],null,Array.from(n.values()),"Resolucions",r,!0,i,void 0,"RESOLUCIONS PIAE ASSENTADES: EVOLUCIÓ DIÀRIA"))}}function T(t,e){if(0===e.resultset.length)$("#chartInstanciesDonadesAlta").hide(),$("#chartExpDonatsAlta").hide(),$("#chartAdministrativesRealitzades").hide(),$("#no_dataInstanciesDonadesAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataInstanciesDonadesAlta").show(),$("#no_dataExpDonatsAlta").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExpDonatsAlta").show(),$("#no_dataAdministrativesRealitzades").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataAdministrativesRealitzades").show();else{$("#no_dataNotificacionsTelematic").hide(),$("#no_dataExpDonatsAlta").hide(),$("#no_dataAdministrativesRealitzades").hide(),$("#chartInstanciesDonadesAlta").css("background","#ffffff"),$("#chartInstanciesDonadesAlta").show(),$("#chartExpDonatsAlta").css("background","#ffffff"),$("#chartExpDonatsAlta").show(),$("#chartAdministrativesRealitzades").css("background","#ffffff"),$("#chartAdministrativesRealitzades").show(),$("#chartResolucionsAssentades").css("background","#ffffff"),$("#chartResolucionsAssentades").show(),$("#chartNotificacionsTelematic").css("background","#ffffff"),$("#chartNotificacionsTelematic").show();const t=e.resultset,o=e.resultset.length,n=new Set,a=[];for(let e=0;e<o;e+=1)n.add(t[e][0]),a.push(t[e][1]);const r=M(n.size),i=40;I("chartNotificacionsTelematic",y([{name:"Notificacions",type:"line",smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:"#3f02f7"},data:a}],null,Array.from(n.values()),"Notificacions",r,!0,i,void 0,"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: EVOLUCIÓ DIÀRIA"))}}const w=0,L=1,C=2,F=3,O=4,z=1130,R=1124,k=1122,P=1143,B=1139;function W(t){const e=[],o=[],n=[],a=[],r=[];return t.forEach((t=>{t[0]===z?n.push([t[1],t[2],t[3]]):t[0]===k?e.push([t[1],t[2],t[3]]):t[0]===R?o.push([t[1],t[2],t[3]]):t[0]===P?a.push([t[1],t[2],t[3]]):t[0]===B&&r.push([t[1],t[2],t[3]])})),[e,o,n,r,a]}function _(t,e){[{chartId:`#chartInstanciesDonadesAlta${t}`,noDataId:`#no_dataInstanciesDonadesAlta${t}`},{chartId:`#chartExpDonadesAlta${t}`,noDataId:`#no_dataExpDonadesAlta${t}`},{chartId:`#chartAdministrativesDonadesAlta${t}`,noDataId:`#no_dataAdministrativesDonadesAlta${t}`},{chartId:`#chartResDonadesAlta${t}`,noDataId:`#no_dataResDonadesAlta${t}`},{chartId:`#chartNotificacionsDonadesAlta${t}`,noDataId:`#no_dataNotificacionsDonadesAlta${t}`}].forEach((({chartId:t,noDataId:o})=>{e?function(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}(t,o):function(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}(o,t)}))}function G(t,e){if(0===e.resultset.length)_("BarMonth");else{_("BarMonth");const t=W(e.resultset),o=-30,n=b(t[w],"Instàncies",o,"INSTÀNCIES PIAE DONADES D'ALTA: EVOLUCIÓ MENSUAL"),a=b(t[L],"Expedients",o,"EXPEDIENTS PIAE DONADES D'ALTA: EVOLUCIÓ MENSUAL"),r=b(t[C],"Tasques",o,"TASQUES ADMINISTRATIVES PIAE REALITZADES: EVOLUCIÓ MENSUAL"),i=b(t[F],"Resolucions",o,"RESOLUCIONS PIAE ASSENTADES: EVOLUCIÓ MENSUAL"),s=b(t[O],"Notificacions",o+15,"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: EVOLUCIÓ MENSUAL");I("chartInstanciesDonadesAltaBarMonth",n),I("chartExpDonadesAltaBarMonth",a),I("chartAdministrativesDonadesAltaBarMonth",r),I("chartResDonadesAltaBarMonth",i),I("chartNotificacionsDonadesAltaBarMonth",s)}}var U=o(2725);function V(t,e){if(0===e.resultset.length)_("StackedBarYears");else{_("StackedBarYears");const t=W(e.resultset),o={title:{text:"INSTÀNCIES PIAE DONADES D'ALTA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nInstàncies"}};(0,U.initStackedBarChartMonthSeries)("chartInstanciesDonadesAltaStackedBarYears",t[w],o);const n={title:{text:"EXPEDIENTS PIAE DONATS D'ALTA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nExpedients"}};(0,U.initStackedBarChartMonthSeries)("chartExpDonadesAltaStackedBarYears",t[L],n);const a={title:{text:"TASQUES ADMINISTRATIVES PIAE REALITZADES: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nTasques"}};(0,U.initStackedBarChartMonthSeries)("chartAdministrativesDonadesAltaStackedBarYears",t[C],a);const r={title:{text:"RESOLUCIONS PIAE ASSENTADES: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nResolucions"}};(0,U.initStackedBarChartMonthSeries)("chartResDonadesAltaStackedBarYears",t[F],r);const i={title:{text:"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nNotificacions"}};(0,U.initStackedBarChartMonthSeries)("chartNotificacionsDonadesAltaStackedBarYears",t[O],i)}}function Y(t,e){if(0===e.resultset.length)_("GaugeMonth");else{_("GaugeMonth");const t=0,o=1,n=W(e.resultset),a=A("chartInstanciesDonadesAltaGaugeMonth"),r=D(n[w],t,"INSTÀNCIES PIAE DONADES D'ALTA: MES ACTUAL",a),i=D(n[L],t,"EXPEDIENTS PIAE DONADES D'ALTA: MES ACTUAL",a),s=D(n[C],t,"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: MES ACTUAL",a),l=D(n[F],t,"RESOLUCIONS PIAE ASSENTADES: MES ACTUAL",a),c=D(n[O],t,"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: MES ACTUAL",a);I("chartInstanciesDonadesAltaGaugeMonth",r),I("chartExpDonadesAltaGaugeMonth",i),I("chartAdministrativesDonadesAltaGaugeMonth",s),I("chartResDonadesAltaGaugeMonth",l),I("chartNotificacionsDonadesAltaGaugeMonth",c);const d=D(n[w],o,"INSTÀNCIES PIAE DONADES D'ALTA: MES ANTERIOR",a),u=D(n[L],o,"EXPEDIENTS PIAE DONADES D'ALTA: MES ANTERIOR",a),f=D(n[C],o,"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: MES ANTERIOR",a),h=D(n[F],o,"RESOLUCIONS PIAE ASSENTADES: MES ANTERIOR",a),m=D(n[O],o,"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: MES ANTERIOR",a);I("chartInstanciesDonadesAltaGaugeLastMonth",d),I("chartExpDonadesAltaGaugeLastMonth",u),I("chartAdministrativesDonadesAltaGaugeLastMonth",f),I("chartResDonadesAltaGaugeLastMonth",h),I("chartNotificacionsDonadesAltaGaugeLastMonth",m)}}function q(t,e){if(0===e.resultset.length)_("GaugeYear");else{_("GaugeYear");const t=function(t){const e=[],o=[],n=[],a=[],r=[];return t.forEach((t=>{t[0]===z?n.push([t[1],t[2]]):t[0]===k?e.push([t[1],t[2]]):t[0]===R?o.push([t[1],t[2]]):t[0]===P?r.push([t[1],t[2]]):t[0]===B&&a.push([t[1],t[2]])})),[e,o,n,a,r]}(e.resultset),o=A("chartInstanciesDonadesAltaGaugeYear"),n=x(t[w],"INSTÀNCIES PIAE DONADES D'ALTA: ÚLTIMS ANYS",o),a=x(t[L],"EXPEDIENTS PIAE DONADES D'ALTA: ÚLTIMS ANYS",o),r=x(t[C],"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: ÚLTIMS ANYS",o),i=x(t[F],"RESOLUCIONS PIAE ASSENTADES: ÚLTIMS ANYS",o),s=x(t[O],"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: ÚLTIMS ANYS",o);I("chartInstanciesDonadesAltaGaugeYear",n),I("chartExpDonadesAltaGaugeYear",a),I("chartAdministrativesDonadesAltaGaugeYear",r),I("chartResDonadesAltaGaugeYear",i),I("chartNotificacionsDonadesAltaGaugeYear",s)}}})(),n})()));
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.residus=e():t.residus=e()}(self,(()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{THRESHOLDS:()=>it,addPointInteger:()=>d,buildCamarasTrafico:()=>ft,buildTableCalidadAire:()=>st,calculateMaxYAxis:()=>M,calculatePentahoPath:()=>lt,calculateXAxisStart:()=>b,checkAllGroupsCollapsed:()=>nt,configureDataBar:()=>$,configureDataGaugeCommon:()=>C,configureDataGaugeMonthCommon:()=>A,configureDataLine:()=>w,configureDataValidate:()=>$t,configureLinesChartValidates:()=>It,convertToLanguageSelectorDateRange:()=>J,convertToTableTreeView:()=>ot,downloadCSVTable:()=>rt,downloadPDFTable:()=>at,formatCellMultiplesLines:()=>Q,formatDayMonthYear:()=>i,formatMilMillionEuros:()=>v,formatMonthAnyo:()=>a,formatName:()=>h,formatNameHeaderColumn:()=>Z,formatRoundTooltip:()=>D,formatShortMonthShortYear:()=>l,formatShortMonthYear:()=>s,formatToMillions:()=>f,formatToTons:()=>m,formatTooltip:()=>y,formatTooltipPie:()=>E,formatTrimestre:()=>c,getEnvironment:()=>ct,getMaxFieldNumberFromData:()=>F,getMonth:()=>n,getMonthList:()=>u,getSelectCommonOptions:()=>j,getSelectTwoColumnsOptions:()=>W,initBarChart:()=>yt,initBarChartComparationMonth:()=>xt,initChart:()=>g,initStackedBarChart:()=>gt,initStackedBarChartMonthSeries:()=>St,initTable:()=>X,initValueDefaultDate:()=>H,initialCalls:()=>dt,loadIframeOnClickEvent:()=>Ct,printDataChart:()=>S,printDataInHTMLElements:()=>L,printNoDataChart:()=>p,resetFilter:()=>U,resetFilterDate:()=>q,resetFilterDates:()=>Y,resultsetWithFields:()=>I,selectConfigDatasource:()=>G,selectFilterAll:()=>z,selectValueDefaultInFilter:()=>V,splitDataset:()=>O,traverseRows:()=>et,updateObject:()=>N,updateStackedBarOptions:()=>pt});const o={"01":"Enero","02":"Febrero","03":"Marzo","04":"Abril","05":"Mayo","06":"Junio","07":"Julio","08":"Agosto","09":"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"};function n(t){return{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(t.toString(),10)]}function r(t){return[t.substring(0,4),o[t.substring(4,6)]]}function a(t){const[e,o]=r(t);return`${o} ${e}`}function i(t){const[e,n,r]=function(t){return[t.substring(0,4),o[t.substring(4,6)],t.substring(6,8)]}(t);return`${r} ${n} ${e}`}function s(t){const[e,o]=r(t);return`${o.substring(0,3)} ${e}`}function l(t){const[e,o]=r(t);return`${o.substring(0,3)} '${e.substring(2,4)}`}function c(t){const[e,o]=t.split("-");return`${parseFloat(o)/3}T ${e}`}function u(t,e){const o=t[e];return Array.from(o.values()).map((t=>t.slice(0,3)))}function d(t,e=2){let o=navigator.language||navigator.userLanguage;o=o.length<=2?`${o}-${o.toUpperCase()}`:o;const n={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===o?t.toLocaleString("de-DE",n):t.toLocaleString(o,n)}function f(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function m(t){return t>=1e3?t/1e3+" Tn":t.toString()}function h(t,e=29){if(t.length>=e){const o=t.split(" ");let n="",r="";return o.forEach((t=>{`${n} ${t}`.length<=e?n+=(n?" ":"")+t:(r+=`${n}\n`,n=t)})),r+=n,r}return t}function g(t,e){const o=document.getElementById(t);if(!o)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const n=echarts.init(o);n.setOption(e,!0),window.addEventListener("resize",(()=>{null!=n&&void 0!==n&&n.resize()}));const r=document.getElementById("main-content");return r&&(r.addEventListener("shown.bs.collapse",(()=>{n.resize()})),r.addEventListener("hidden.bs.collapse",(()=>{n.resize()}))),n}function p(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}function S(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}function y(t,e=!1,o=!0,n=""){let r=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach((t=>{const a=e?Math.round(t.data):t.data,i=o?`<div style="font-weight: 400;color: #666;">${s=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${s}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${d(a)} ${n}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${d(a)} ${n}`:"-"}\n </span>\n </div>`;var s;r+=i})),r}function b(t){return 100*(t-120)/t}function M(t,e){const o=Math.max(...t);return o+(e-o%e)}function E(t,e=!1){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,n=e?`${t.percent}%`:d(t.value);return`<div> ${o} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${n} </span></div>`}function D(t,e){let o=`${t.name} : `;return o+=`<span style="font-weight:500">${d(Math.round(t.value))}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),t.marker+o}function v(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${d(o)} €`:o>=e?`${d(o/e)} M €`:"-"}function x(t,e,o=1){const n=Math.max(...t.map((t=>t[e])))*o;return 5e3*Math.ceil(n/5e3)}function C(t,e,o,n=30,r=15,a=30,i=-70,s=70,l=3){const c=x(t,e.data,1.1),u=s,f=o.slice(),m=[];let g=r,p=a,S=i;for(let o=0;o<t.length;o+=1)m.push({value:t[o][e.data],name:h(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:f.shift(),title:{offsetCenter:[`${String(S)}%`,`${String(g)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(S)}%`,`${String(p)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>d(Math.round(t))}}),S+=u,(o+1)%l==0&&(p+=a,g+=2*r,S=i);return[c,m]}function A(t,e,o,r=0){return[x(e,o.data,1),t=>function(t,e,o){const r=d(Math.round(e)),a=n(t[o][0]),i=t[o][1],s=`\n${a} ${i} : ${r}`,l=`${r}\n${a} ${i}`;return window.innerWidth<=1710?s:l}(e,t,r),[{value:e[r][o.data]}]]}function R(t,e){const{resultset:o}={resultset:t},n=new Set,r=new Set,a=o.map((([t,o,a])=>{const i=e?Math.round(a):a;return n.add(t),r.add(o),{day:o,type:t,value:i}})),i=Array.from(r.values()),s=Array.from(n.values());return s.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[s.map((t=>{const e=a.filter((e=>e.type===t)).map((({day:e,value:o})=>[e,t,o])),o=i.map((t=>{const o=e.find((([e])=>e===t));return o?o[2]:null}));return{name:t,data:o}})),s,r]}function w(t,e=[],o=!1){const[n,r,a]=R(t,o);return n.forEach((t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())})),[n,a,r]}function $(t,e,o=!1){const[n,r,a]=R(t,o);return n.forEach((t=>{t.type="bar",t.color=e.shift(),t.smooth=!1})),[n,a,r]}function I(t){const{resultset:e,metadata:o}=t,n=[];return e.forEach((t=>{const e={};t.forEach(((t,n)=>{e[o[n].colName]=t})),n.push(e)})),n}function N(t,e){const o=t;return Object.keys(e).forEach((n=>{Object.prototype.hasOwnProperty.call(e,n)&&("series"===n?o[n]=e[n].map(((e,o)=>({...t[n][o],...e}))):"object"!=typeof e[n]||Array.isArray(e[n])?o[n]=e[n]:o[n]=N(t[n]||{},e[n]))})),t}function L(t,e){t.forEach((t=>{t.id in e&&Object.entries(e[t.id]).forEach((o=>{const n=o[0],r=o[1];"object"==typeof r?r.className?document.querySelector(r.className).className=t[n]:r.element&&r.format&&(document.querySelector(r.element).textContent=e[t.id][n].format(t[n])):document.querySelector(r).textContent=t[n]}))}))}function F(t,e){const o=I(t),n=[];let r=null;return o.forEach((t=>{const o=t[e];"number"!=typeof o||Number.isNaN(o)||n.push(o)})),n.length>0&&(r=Math.max(...n)),r}function O(t,e=!0){const o={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?o.Cont.push([t[3],t[4],t[2]]):o.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?o.Mob.push([t[3],t[4],t[2]]):o.Mob.push([t[3],t[2]]))})),o}const T=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],_=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],B=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],K=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],k=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function z(t){const e=t.resultset.map((t=>t[0]));return this.dashboard.fireChange(this.parameter,e),t}function P(t){for(const e of t)if(Array.isArray(e)){if(!P(e))return!1}else if("All"!==e)return!1;return!0}function G(t,e,o,n){return P(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function U(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function j(){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function W(){const t={input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}};return t.input.indexes.id=1,t.input.indexes.label=0,t}function Y(t,e,o,n){const r=Dashboards.getParameterValue(o),a=Dashboards.getParameterValue(n);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[a]),!0}function q(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function H(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function V(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;t.dashboard.setParameter(n,[o])}function J(t){t.regional.es={monthNames:T,abbreviatedMonthNames:_,dayNames:B,abbreviatedDayNames:K,dayNamesMin:k,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function X(t,e){const o=document.getElementById(t);return o?new Tabulator(o,e):(console.error(`No se pudo encontrar el elemento con ID ${t}.`),null)}function Z(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function Q(t,e){const o=t.getValue().split(" ");let n="",r="";return o.forEach((t=>{(r+t).length<=e?r+=`${t} `:(n+=`${r}<br>`,r=`${t} `)})),n+=`${r}<br>`,n}function tt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach((t=>{t.getTreeChildren().length>0&&tt(t,e)}))}function et(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&tt(t,e)}))}function ot(t,e,o,n){const r=[];for(const a in t)if(t.hasOwnProperty(a)){const i=t[a],s={[e]:i[0],_children:[]};i.shift(),i.forEach(((t,r)=>{const a={[e]:o[r],[n]:t};s._children.push(a)})),r.push(s)}return r}function nt(t){let e=!0;return t.getGroups().forEach((t=>{t._group.visible&&(e=!1)})),e}function rt(t,e,o){const n=document.getElementById(o),r=n.cloneNode(!0);n.parentNode.replaceChild(r,n),r.addEventListener("click",(()=>{t.download("csv",`${e}.csv`,{delimiter:";"})}))}function at(t,e,o){const n=document.getElementById(o),r=n.cloneNode(!0);n.parentNode.replaceChild(r,n),r.addEventListener("click",(()=>{t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8}}})}))}const it={SO2:[100,200,350,500,750,751],NO2:[40,90,120,230,340,341],O3:[50,100,130,240,380,381],PM10:[20,40,50,100,150,151],PM25:[10,20,25,50,75,76]};function st(t){const e=[],o={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function n(t,e,n){const r=document.createElement("td");if(r.setAttribute("id",t),null!=e){r.innerHTML=e;const t=function(t,e){let n;return void 0===e?n=6:"ND"===e?n=7:(n=5,t.forEach(((t,o)=>{e<=t&&5===n&&(n=o)}))),o[n]}(n,e);r.classList.add(t)}return r}return t.forEach((t=>{const o=t;"noData"===o.operationalstatus&&(o.so2value="ND",o.no2value="ND",o.o3value="ND",o.pm10value="ND",o.pm25value="ND"),"A09_CABANYAL_60m"===o.entityid&&(o.pm10value=void 0,o.pm25value=void 0);const r=document.createElement("tr"),a=document.createElement("td");a.innerHTML=o.address,r.appendChild(a),r.appendChild(n(`${o.entityid}_so2`,o.so2value,it.SO2)),r.appendChild(n(`${o.entityid}_no2`,o.no2value,it.NO2)),r.appendChild(n(`${o.entityid}_o3`,o.o3value,it.O3)),r.appendChild(n(`${o.entityid}_pm10`,o.pm10value,it.PM10)),r.appendChild(n(`${o.entityid}_pm25`,o.pm25value,it.PM25)),e.push(r)})),e}function lt(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function ct(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function ut(t,e){document.querySelectorAll(`[${t}]`).forEach((o=>{!function(t,e,o){const n=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(n.innerHTML=this.responseText,o&&o()),404===this.status&&(n.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(o.getAttribute(t),o,e)}))}function dt(t){ut("include-html-cabecera",(function(){!function(){const t=ct();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=ct();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()})),ut("include-html-menu"),ut("include-html-main-container",(function(){(function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])})(),t&&t()})),ut("include-html-copyright")}function ft(t,e,o,n,r,a){let i=!1,s=!1;const l=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function d(t=!0){const e=document.querySelector(o);t?(l&&(l.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),s=!0):(e.classList.remove("blur"),u(),s=!1)}const f=t=>{new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(s||u(),i||(i=!0,window.setTimeout(d,a)))}))})).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(l&&(l.setAttribute("sandbox","allow-scripts"),f(l)),c&&(c.setAttribute("sandbox","allow-scripts"),f(c)),document.querySelector(r).addEventListener("click",(()=>{d(!1),window.setTimeout(d,a)}))):document.querySelectorAll(n)[0].style.display="none"}const mt={grid:{containLabel:!0},title:{left:"center",top:"0",textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"}},legend:{orient:"horizontal",bottom:"0",left:"center",width:"100%",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400,color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{restore:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}},saveAsImage:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12}},xAxis:[{type:"category",axisLabel:{show:!0,interval:0,textStyle:{fontFamily:"Montserrat",fontSize:11}},data:[]}],yAxis:[{type:"value",alignTicks:!0,position:"right",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${t}%`}},{type:"value",position:"left",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${f(t)}€`}}]},ht=(t,e)=>{e.sort(((t,e)=>parseInt(t.anyo)-parseInt(e.anyo)));const o={};e.forEach((e=>{const n=e[1],r=e[0];r!==t.seriesName||o[n]||(o[n]=0),r===t.seriesName&&(o[n]+=e[2])}));let n=`<p>${t.seriesName}</p>`;for(const[e,r]of Object.entries(o))n+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${d(r)}</span></div>`;return n};function gt(t,e,o=void 0,n=void 0){const r=null===n?void 0:n,a=new Set(e.map((t=>t[1])));let i;const s={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{axisPointer:{type:"shadow"},trigger:"item",formatter:t=>ht(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,o,n,r){const a={},i=r.contentSize[1]/2,s=r.viewSize[1],l=t[1];return l<i?a.top=10:l+i>s?a.bottom=10:a.top=l-i,t[0]<r.viewSize[0]/2?a.left=t[0]+20:a.right=r.viewSize[0]-t[0]+20,a}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>d(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(a),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>d(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};r&&r.itemStyle&&Array.isArray(r.itemStyle.borderColor)&&(i=[...r.itemStyle.borderColor],delete r.itemStyle.borderColor);const o=function(t){return t.reduce(((t,e)=>{const o=e[0];return t[o]||(t[o]=[]),t[o].push(e),t}),{})}(e),n=Object.keys(o);a.forEach((t=>{n.forEach((e=>{void 0===o[e].find((e=>e[1]===t))&&(o[e].push([o[e][0][0],t,void 0]),o[e].sort())}))}));const s=[];return Object.keys(o).forEach((e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=o[e].map((t=>t[2]));let n={};n=void 0!==r?N(t,r):t,s.push({...n})})),s})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let l={};l=void 0!==o?N(s,o):s,g(t,l)}function pt(t){let e={};return e=N(t,mt),e}function St(t,e,o={},r={}){let a={};a=N(o,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach((e=>{t.add(e[1])})),Array.from(t).sort(((t,e)=>t-e))}()}});const i={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},s=null===r?i:N(r,i),l=e;l.forEach(((t,e)=>{l[e][0]=n(t[0])})),gt(t,l,a,s)}function yt(t,e=void 0){const o={title:{text:"SIN TITULO",left:"center",top:"top",padding:50,textStyle:{fontSize:14,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"30%",bottom:"5%",left:"8%",right:"8%"},xAxis:{type:"value",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},appendToBody:!0,formatter:t=>D(t,!1)},series:[{type:"bar",showBackground:!0}]};let n={};n=void 0!==e?N(o,e):o,g(t,n)}const bt="es_ES",Mt={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])};function Et(t){return Math.max(...t.map((t=>Number(t[0]))))}function Dt(t){const e=t.filter((e=>Number(e[0])===Et(t))),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n})),o}function vt(t){const e=t.filter((e=>Number(e[0])===Et(t)-1)),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n})),o}function xt(t,e,o=void 0){const n=Et(e).toString(),r=(Et(e)-1).toString();yt(t,N({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[r,n],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:u(Mt,bt),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:r,type:"bar",data:vt(e)},{name:n,type:"bar",barGap:0,data:Dt(e)}]},o))}function Ct(t,e,o){const n=document.querySelector(e),r=document.querySelector(t);let a=!1;r.addEventListener("click",(()=>{!1===a&&(a=!0,n.setAttribute("src","about:blank"),n.setAttribute("src",o),n.onload=()=>{a=!1})})),r.disabled=!1}const At="id",Rt="fecha",wt="value";function $t(t,e,o,n){const[r,a]=function(t,e,o){const n=[],r=[];return t.forEach((t=>{e.includes(`${t[At]}`)?n.push(`${t[Rt]}`):o.includes(`${t[At]}`)&&r.push(`${t[Rt]}`)})),[n.map((t=>[t,0])),r.map((t=>[t,0]))]}(t,o,n);let i="Datos sin validar";0===a.length&&(i="");const s={name:"Datos validados",type:"line",data:[...r,a[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let l="",c="";if(0===a.length){const e=t[t.length-1].fecha;l=e,c=e}else l=a[0][0],c=a[a.length-1][0];return[...e,s,{name:"Datos NO validados",type:"line",data:a,lineStyle:{color:"#80D4CF",width:4},showSymbol:!1,tooltip:{show:!1},markArea:{silent:!0,itemStyle:{opacity:.6,color:"#eee"},tooltip:{show:!1},label:{color:"#333",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:11},data:[[{name:i,xAxis:l,yAxis:0},{name:"end",xAxis:c,yAxis:Math.max(...t.filter((t=>null!==t[wt])).map((t=>parseInt(`${t[wt]}`,10))))}]]}}]}function It(t,e,o=void 0){g(t,N({grid:{left:"2.5%",right:"5%",bottom:"70",top:"150",containLabel:!0},title:{left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},legend:{type:"plain",top:"50",width:"98%",textStyle:{fontFamily:"Montserrat"}},tooltip:{trigger:"axis",show:!0,formatter:t=>y(t),textStyle:{fontFamily:"Montserrat"}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{type:"value",nameLocation:"end",nameGap:"0",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"500",padding:[-25,0,0,-48],margin:0,align:"left",verticalAlign:"top",width:"auto"},scale:!0,splitNumber:"6",axisLabel:{margin:10,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},dataZoom:{end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}},toolbox:{feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:"1%",top:"0%"},series:e},o))}return e})(),t.exports=e()}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,o),a.exports}o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";o.r(n),o.d(n,{echartDesKgsBar:()=>V,echartDesKgsGauge:()=>q,echartDesKgsHorStackedBar:()=>U,echartDesKgsPerTipusResidu:()=>K,echartDesKgsPie:()=>J,echartDesKgsStackedBar:()=>j,echartKgsResidus:()=>O,echartKgsResidusBarMonth:()=>H,echartKgsResidusRelojSemicircle:()=>W,echartKgsResidusStackedBarYears:()=>G,echartYearKgsResidusGaugeSemicircle:()=>Y});const t="8%",e="2.5%",r="5%",a="18%",i="20%",s="10%",l="90%",c="1%",u="0%",d=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],f=33,m=27,h=30;function g(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const o={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",o):t.toLocaleString(e,o)}function p(t){return 100*(1-17/t)}function S(t,e=!1){let o=`<p>${t[0].name}</p>`;return t.forEach((t=>{const n=e?Math.round(t.data):t.data,r=`<div>${a=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${a}"></span>`} ${t.seriesName}: <strong style="float: right; margin-left:20px">${t.data?g(n):"-"}</strong></div>`;var a;o+=r})),o}function y(t){return g(t)}function b(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}function M(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}function E(t,e,o=1){const n=Math.max(...t.map((t=>t[e])))*o;return 5e3*Math.ceil(n/5e3)}function D(t){return Math.round(document.getElementById(t).offsetWidth/f)}function v(o,n,d,f,m,h,g,p=5,b="",M=m,E=100,D,v=void 0,x=void 0){return{title:{text:b,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",show:!0,formatter:t=>S(t),textStyle:{fontFamily:"Montserrat"}},legend:n?{type:"plain",data:n,textStyle:{fontFamily:"Montserrat"},top:v||t,selected:D}:null,grid:{left:e,right:r,bottom:a,top:n?v?"30%":i:s,heigh:l,containLabel:!0},xAxis:{type:"category",data:d,boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{name:f,nameLocation:"end",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"bold",padding:[0,0,0,g]},type:"value",scale:!0,min:x,axisLabel:{margin:p,formatter:y,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},series:o,dataZoom:[{show:h,data:d,start:M,end:E,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}],toolbox:{show:h,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:c,top:u}}}function x(t,e,o=-45,n="",r=e){const a=new Set,i=[];t.forEach((t=>{const e=t[0].toString().padStart(2,"0");a.add(`${e}/${t[1]}`),i.push(Math.round(t[2]))}));const s=i.length<100?40:80;return v({name:r,type:"bar",smooth:!1,barMaxWidth:40,itemStyle:{color:"#5470c6"},textStyle:{fontFamily:"Montserrat"},data:i},null,Array.from(a.values()),e,s,!0,o,25,n)}function C(t,e){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${t.color};"></span>`;let n=`${t.name} : `;return n+=`<span style="font-weight:bold">${g(t.value)}</span>`,e&&(n+=`<span> (${t.percent}%)</span>`),o+n}function A(t,e,o,n){return{color:d,title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:n,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"},formatter:t=>C(t,!1)},splitNumber:3,series:{type:"gauge",max:e,startAngle:-180,endAngle:0,splitNumber:2,pointer:{show:!1,icon:"roundRect"},progress:{show:!0,overlap:!1,roundCap:!0,clip:!0,itemStyle:{borderWidth:1,borderColor:"#464646"}},axisLine:{lineStyle:{width:60}},splitLine:{show:!0,distance:10,length:10},axisTick:{show:!0,splitNumber:5},axisLabel:{show:!0,distance:70,formatter:t=>g(Math.round(t)),fontFamily:"Montserrat",color:"#666"},data:o,detail:{fontSize:n/1.2,color:"inherit",formatter:t=>g(Math.round(t))}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:m,top:h}}}function R(t,e="",o){const n=[],r=E(t,1,1.1),a=r.toString().length>=9?100:95,i=115===a?-45:-35;let s=t.length<5?t.length*i:-190;for(let e=0;e<t.length;e+=1)n.push({value:t[e][1],name:String(t[e][0]),title:{offsetCenter:[String(s),"20%"],fontFamily:"Montserrat"},detail:{offsetCenter:[String(s),"35%"],fontFamily:"Montserrat"}}),s+=a;return A(e,r,n,o)}function w(t,e,o="",n){return{title:{text:o,left:"center",top:"top",padding:10,textStyle:{fontSize:n,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:E(t,2),itemStyle:{color:"#FFAB91"},progress:{show:!0,width:30},pointer:{show:!1},axisLine:{lineStyle:{width:30}},axisTick:{distance:10,splitNumber:5,lineStyle:{width:2,color:"#999"}},splitLine:{distance:10,length:14,lineStyle:{width:3,color:"#999"}},axisLabel:{fontFamily:"Montserrat",color:"#666",fontSize:14,show:!0,distance:40,formatter:t=>g(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[-5,"-10%"],fontSize:n+5,fontWeight:"bolder",formatter:o=>function(t,e,o){const n=g(Math.round(e)),r=(a=t[o][0],{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(a.toString(),10)]);var a;const i=t[o][1],s=`\n\n\n${r} ${i} : ${n}`,l=`${n}\n${r} ${i}`;return window.innerWidth<=1710?s:l}(t,o,e),fontFamily:"Montserrat",color:"inherit"},data:[{value:t[e][2]}]},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:m,top:h}}}function I(t){if(t.length>=29){const e=t.split(" ");let o="",n="";for(const t of e)`${o} ${t}`.length<=29?o+=(o?" ":"")+t:(n+=`${o}\n`,o=t);return n+=o,n}return t}function N(t,e){const o=document.getElementById(t);if(!o)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const n=echarts.init(o);return n.setOption(e,!0),$(window).on("resize",(()=>{null!=n&&void 0!==n&&n.resize()})),n}function L(t){return 100*(t-120)/t}function F(t){const e=Array.from(t.keys(),(t=>function(t){const e=t.split("/"),o=parseInt(e[0],10),n=parseInt(e[1],10)-1,r=parseInt(e[2],10);return new Date(r,n,o)}(t))),o=[],n=[],r=function(t,e){const o=[];for(;t<=e;){const e=(n=t,`${String(n.getDate()).padStart(2,"0")}/${String(n.getMonth()+1).padStart(2,"0")}/${String(n.getFullYear())}`);o.push(e),t.setDate(t.getDate()+1)}var n;return o}(new Date(Math.min(...e)),new Date(Math.max(...e)));return r.forEach((e=>{if(t.has(e)){const o=t.get(e);n.push(o)}else n.push(null)})),o.push(r),o.push(n),o}function O(t,e){if(0===e.resultset.length)b("#chartKgsResidus","#no_dataKgsResidus");else{M("#no_dataKgsResidus","#chartKgsResidus");const t="KGS. DE RESIDUS EN CONTENIDORS: EVOLUCIÓ DIÀRIA",o="KGS. DE RESIDUS EN MOBLES: EVOLUCIÓ DIÀRIA",n=e.resultset,r=0,a=1,i=2,s=3,l=new Map,c=new Map;let u=[],d=[];n.forEach((t=>{"Contenidor"===t[i]&&"total"===t[a]&&l.set(t[r],t[s]),"Moble"===t[i]&&c.set(t[r],t[s])})),u=F(l),d=F(c);const f=L(u[0].length),m=L(d[0].length),h=-30,g=[{name:"Contenidor",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u[1]}],p=[{name:"Moble",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:d[1]}];N("chartKgsResidus",v(g,null,u[0],"Kgs",f,!0,h,void 0,t)),N("chartKgsResidusMoble",v(p,null,d[0],"Kgs",m,!0,h,void 0,o))}}function T(t,e=!0){const o={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?o.Cont.push([t[3],t[4],t[2]]):o.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?o.Mob.push([t[3],t[4],t[2]]):o.Mob.push([t[3],t[2]]))})),o}const _=["#0077b6","#ffc300","#55828b","#a26769","#b1a7a6","#38b000"],B=_.slice(0,-2).concat(_.slice(-1));function K(t,e){!function(t,e,o,n,r,a,i,s,l=!1,c=!1,u,f=!0,m=d.slice(),h=!1,g,S){const y=t.resultset||t;if(0===y.length)b(`#${a}`,`#${i}`),s&&b(`#${s}`,`#${i}`);else{M(`#${i}`,`#${a}`),s&&M(`#${i}`,`#${s}`);const t=function(t,e,o=!1){const{resultset:n}={resultset:t},r=new Set,a=new Set,i=e,s=n.map((([t,e,n])=>{const i=o?Math.round(n):n;return r.add(t),a.add(e),{day:e,type:t,value:i}})),l=Array.from(a.values()),c=Array.from(r.values());return c.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[c.map((t=>{const e=s.filter((e=>e.type===t)).map((({day:e,value:o})=>[e,t,o])),o=l.map((t=>{const o=e.find((([e])=>e===t));return o?o[2]:null}));return{name:t,type:"line",symbol:"circle",color:i.shift(),symbolSize:6,smooth:!1,data:o}})),a,c]}(y,m,h),d=t[0],b=t[1],D=t[2],x=f?D:null,C=c?(E=b,Array.from(E.values()).map((t=>{const[e,o]=t.split("/");return function(t){const e=t.slice(0,2);return`${t.slice(3,5)}/${e}`}(t)}))):Array.from(b.values());void 0===u&&(u=l?p(b.size):L(b.size)),N(a,v(d,x,C,r,u,e,o,void 0,n,void 0,void 0,void 0,g,S))}var E}(e,!0,0,"DESAGREGACIÓ KGS. CONTENIDORS PER TIPUS DE RESIDUS","Kgs","chartDesKgsPerTipusResidu","no_dataDesKgsPerTipusResidu",void 0,void 0,void 0,void 0,void 0,_)}var k=o(2725);const z={es_ES:new Map([["chartResidusContenidorstackedBarYears","KGS. DE RESIDUOS EN CONTENEDORES: DESGLOSE DE LOS ÚLTIMOS AÑOS"],["chartResidusMoblesstackedBarYears","KGS. DE RESIDUOS EN MUEBLES: DESGLOSE DE LOS ÚLTIMOS AÑOS"],["chartDesKgsHorStackedBar","KGS. DE RESIDUOS DE RECICLAJE: HISTORICO ANUAL"]]),ca_ES:new Map([["chartResidusContenidorstackedBarYears","KGS. DE RESIDUS EN CONTENIDORS: DESGLOSSAMENT DELS ÚLTIMS ANYS"],["chartResidusMoblesstackedBarYears","KGS. DE RESIDUS EN MOBLES: DESGLOSSAMENT DELS ÚLTIMS ANYS"],["chartDesKgsHorStackedBar","KGS. DE RESIDUS DE RECICLATGE: HISTÒRIC ANUAL"]])},P="ca_ES";function G(t,e){function o(t,o,n){if(0===e.resultset.length)(0,k.printNoDataChart)(`#${t}`,`#${o}`);else{const e={title:{text:z[P].get(t)},xAxis:{name:"\n\n\n\nKgs"}};(0,k.initStackedBarChartMonthSeries)(t,n,e)}}const n=(0,k.splitDataset)(e.resultset),r=n.Cont,a=n.Mob;o("chartResidusContenidorstackedBarYears","no_dataResidusContenidorstackedBarYears",r),o("chartResidusMoblesstackedBarYears","no_dataResidusMoblesstackedBarYears",a)}function U(t,e){const o="chartDesKgsHorStackedBar",n="no_dataDesKgsHorStackedBar";if(0===e.resultset.length)(0,k.printNoDataChart)(`#${o}`,`#${n}`);else{(0,k.printDataChart)(`#${n}`,`#${o}`);const t={title:{text:z[P].get(o)},color:B,xAxis:{name:"\n\n\n\nKgs"}};(0,k.initStackedBarChart)(o,e.resultset,t)}}function j(t,o){!function(t,o,n,s,c="",u="total",f=0,m=1,h=2,E=d){if(0===n.length)b(`#${t}`,`#${o}`);else{M(`#${o}`,`#${t}`);const d=[];let b=(D=f,n.reduce(((t,e)=>{const o=e[D];return t[o]||(t[o]=[]),t[o].push(e),t}),{}));const v=new Set(n.map((t=>t[m]))),x=Object.keys(b);v.forEach((t=>{x.forEach((e=>{void 0===b[e].find((e=>e[m]===t))&&(b[e].push([b[e][0][f],t,void 0]),b[e][0][1].length>4?b[e].sort(((t,e)=>{const[o,n]=t[1].split("/"),[r,a]=e[1].split("/"),i=new Date(n,o-1,1),s=new Date(a,r-1,1);return i.getTime()-s.getTime()})):b[e].sort())}))}));const C=Object.entries(b).sort(((t,e)=>t[0].localeCompare(e[0]))),A=""===u?90:0;b=Object.fromEntries(C),Object.keys(b).forEach((t=>{d.push({name:t,type:"bar",stack:u,label:{show:!0,fontFamily:"Montserrat",rotate:A,formatter:t=>g(Math.round(t.value))},emphasis:{focus:"series"},data:b[t].map((t=>t[h]))})}));const R=""!==u?p(v.size):100*(1-7/v.size);N(t,{color:E,title:{text:c,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat"},formatter:t=>S(t,!0)},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:e,right:r,bottom:a,top:i,heigh:l,containLabel:!0},yAxis:{type:"value",splitNumber:4,name:s,nameLocation:"end",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666"},axisLabel:{formatter:y,textStyle:{fontSize:8,fontFamily:"Montserrat",color:"#666"}}},xAxis:{type:"category",data:[...v],axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:d,toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50},dataZoom:[{show:!0,data:[...v],start:R,end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}]})}var D}("chartDesKgsStackedBar","no_dataDesKgsStackedBar",o.resultset,"Kgs","KGS. DE RESIDUS DE RECICLATGE: HISTÒRIC MENSUAL",void 0,void 0,void 0,void 0,B)}function W(t,e){if(0===e.resultset.length)b("#chartResidusContenidorreloj_semicircle","#no_dataResidusContenidorreloj_semicircle"),b("#chartResidusContenidorreloj_semicircle_lastmonth","#no_dataResidusContenidorreloj_semicircle_lastmonth"),b("#chartResidusMoblesreloj_semicircle","#no_dataResidusMoblesreloj_semicircle"),b("#chartResidusMoblesreloj_semicircle_lastmonth","#no_dataResidusMoblesreloj_semicircle_lastmonth");else{M("#no_dataResidusContenidorreloj_semicircle","#chartResidusContenidorreloj_semicircle"),M("#no_dataResidusContenidorreloj_semicircle_lastmonth","#chartResidusContenidorreloj_semicircle_lastmonth"),M("#no_dataResidusMoblesreloj_semicircle","#chartResidusMoblesreloj_semicircle"),M("#no_dataResidusMoblesreloj_semicircle_lastmonth","#chartResidusMoblesreloj_semicircle_lastmonth");const t=0,o=1,n=T(e.resultset),r=n.Cont,a=n.Mob,i=D("chartResidusContenidorreloj_semicircle");N("chartResidusContenidorreloj_semicircle",w(r,t,"KGS. DE RESIDUS EN CONTENIDORS: MES ACTUAL",i)),N("chartResidusContenidorreloj_semicircle_lastmonth",w(r,o,"KGS. DE RESIDUS EN CONTENIDORS: MES ANTERIOR",i)),N("chartResidusMoblesreloj_semicircle",w(a,t,"KGS. DE RESIDUS EN MOBLES: MES ACTUAL",i)),N("chartResidusMoblesreloj_semicircle_lastmonth",w(a,o,"KGS. DE RESIDUS EN MOBLES: MES ANTERIOR",i))}}function Y(t,e){if(0===e.resultset.length)b("#chartYearResidusContenidorgauge_semicircle","#no_dataYearResidusContenidorgauge_semicircle"),b("#chartYearResidusMoblesgauge_semicircle","#no_dataYearResidusMoblesgauge_semicircle");else{M("#no_dataYearResidusContenidorgauge_semicircle","#chartYearResidusContenidorgauge_semicircle"),M("#no_dataYearResidusMoblesgauge_semicircle","#chartYearResidusMoblesgauge_semicircle");const t=T(e.resultset,!1),o=t.Cont,n=t.Mob,r=D("chartYearResidusContenidorgauge_semicircle");N("chartYearResidusContenidorgauge_semicircle",R(o,"KGS. DE RESIDUS EN CONTENIDORS: ÚLTIMS ANYS",r)),N("chartYearResidusMoblesgauge_semicircle",R(n,"KGS. DE RESIDUS EN MOBLES: ÚLTIMS ANYS",r))}}function q(t,e){if(0===e.resultset.length)b("#chartDesKgsGauge","#no_dataDesKgsPie");else{M("#no_dataDesKgsPie","#chartDesKgsGauge");const t=e.resultset;document.querySelector("#idDesKgs").addEventListener("click",(()=>{requestAnimationFrame((()=>{const e=D("chartDesKgsGauge"),o=function(t,e,o=!1){const n=[],r=1.1*E(t,1);let a,i=50,s=250,l=20,c=30,u=-80;r>9999999&&(i=65,s=75);const d=o?4:3;for(let o=0;o<t.length;o+=1)a=String(t[o][0]).replace(/\[.*?\]/g,""),a=I(a),n.push({value:t[o][1],name:a,title:{offsetCenter:[`${String(u)}%`,`${String(l)}%`],fontFamily:"Montserrat",fontSize:e},detail:{offsetCenter:[`${String(u)}%`,`${String(c)}%`],fontFamily:"Montserrat",fontSize:e}}),u+=s,(o+1)%d==0&&(c+=30,l+=30,u=-80);return[r,n,i]}(t,e);N("chartDesKgsGauge",A("KGS. DE RESIDUS RSU RESTA: ÚLTIMS ANYS",o[0],o[1],e))}))}))}}function H(t,e){if(0===e.resultset.length)b("#chartResidusContenidorBarMonth","#no_dataResidusContenidorBarMonth");else{M("#no_dataResidusContenidorBarMonth","#chartResidusContenidorBarMonth");const t=T(e.resultset),o=t.Cont,n=t.Mob;N("chartResidusContenidorBarMonth",x(o,"Kgs",void 0,"KGS. DE RESIDUS EN CONTENIDORS: EVOLUCIÓ MENSUAL","Contenidor")),N("chartResidusMoblesBarMonth",x(n,"Kgs",void 0,"KGS. DE RESIDUS EN MOBLES: EVOLUCIÓ MENSUAL","Moble"))}}function V(t,e){0===e.resultset.length?b("#chartDesKgsBar","#no_dataDesKgsBar"):(M("#no_dataDesKgsBar","#chartDesKgsBar"),N("chartDesKgsBar",x(e.resultset,"Kgs",void 0,"KGS. DE RESIDUS RSU RESTA: HISTÒRIC MENSUAL","RSU Resta")))}function J(t,e){if(0===e.resultset.length)b("#chartDesKgsPie","#no_dataDesKgsPie");else{M("#no_dataDesKgsPie","#chartDesKgsPie");const t=e.resultset,o=[],n=0,r=1,a=2;for(let e=0;e<t.length;e+=1)o.push({value:t[e][r],name:t[e][n]});document.querySelector("#idDesKgs").addEventListener("click",(()=>{requestAnimationFrame((()=>{const e=D("chartDesKgsPie"),n=function(t,e,o,n=d){return{textStyle:{fontFamily:"Montserrat"},title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:o-4,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"item",textStyle:{fontFamily:"Montserrat"},formatter:t=>C(t,!0)},legend:{orient:"horizontal",textStyle:{fontFamily:"Montserrat"},left:e.length>5?"10%":"12%",bottom:"10%",top:"65%",selectedMode:!1},series:[{type:"pie",radius:"33%",data:e,color:n,top:"-30%",emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:10,top:20}}}(`KGS. DE RESIDUS DE RECICLATGE: DISTRIBUCIÓ ANY ${t[0][a]}`,o,e+5,B);N("chartDesKgsPie",n)}))}))}}})(),n})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.residus=e():t.residus=e()}(self,(()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{THRESHOLDS:()=>ct,addPointInteger:()=>u,buildCamarasTrafico:()=>gt,buildTableCalidadAire:()=>dt,calculateMaxYAxis:()=>M,calculatePentahoPath:()=>ut,calculateXAxisStart:()=>b,chartBar:()=>vt,chartTop10:()=>Dt,checkAllGroupsCollapsed:()=>it,configureDataBar:()=>L,configureDataGaugeCommon:()=>A,configureDataGaugeMonthCommon:()=>C,configureDataLine:()=>R,configureDataValidate:()=>_t,configureLinesChartValidates:()=>Bt,convertToLanguageSelectorDateRange:()=>Z,convertToTableTreeView:()=>at,distributionChart:()=>At,downloadCSVTable:()=>st,downloadPDFTable:()=>lt,formatCellMultiplesLines:()=>ot,formatDayMonthYear:()=>i,formatMilMillionEuros:()=>D,formatMonthAnyo:()=>a,formatName:()=>h,formatNameHeaderColumn:()=>et,formatRoundTooltip:()=>E,formatShortMonthShortYear:()=>l,formatShortMonthYear:()=>s,formatToMillions:()=>f,formatToTons:()=>m,formatTooltip:()=>y,formatTooltipPie:()=>x,formatTrimestre:()=>c,gaugeChart:()=>Et,getEnvironment:()=>ft,getMaxFieldNumberFromData:()=>N,getMonth:()=>n,getMonthList:()=>d,getSelectCommonOptions:()=>H,getSelectTwoColumnsOptions:()=>Y,initBarChart:()=>xt,initBarChartComparationMonth:()=>$t,initChart:()=>g,initStackedBarChart:()=>yt,initStackedBarChartMonthSeries:()=>Mt,initTable:()=>tt,initValueDefaultDate:()=>J,initialCalls:()=>ht,loadIframeOnClickEvent:()=>It,printDataChart:()=>S,printDataInHTMLElements:()=>I,printNoDataChart:()=>p,resetFilter:()=>j,resetFilterDate:()=>V,resetFilterDates:()=>q,resetFilterToDefault:()=>Q,resultsetWithFields:()=>F,selectConfigDatasource:()=>P,selectConfigDatasourceAllValue:()=>U,selectFilterAll:()=>W,selectValueDefaultInFilter:()=>X,splitDataset:()=>T,traverseRows:()=>rt,updateDomElement:()=>O,updateObject:()=>$,updateStackedBarOptions:()=>bt});const o={"01":"Enero","02":"Febrero","03":"Marzo","04":"Abril","05":"Mayo","06":"Junio","07":"Julio","08":"Agosto","09":"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"};function n(t){return{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(t.toString(),10)]}function r(t){return[t.substring(0,4),o[t.substring(4,6)]]}function a(t){const[e,o]=r(t);return`${o} ${e}`}function i(t){const[e,n,r]=function(t){return[t.substring(0,4),o[t.substring(4,6)],t.substring(6,8)]}(t);return`${r} ${n} ${e}`}function s(t){const[e,o]=r(t);return`${o.substring(0,3)} ${e}`}function l(t){const[e,o]=r(t);return`${o.substring(0,3)} '${e.substring(2,4)}`}function c(t){const[e,o]=t.split("-");return`${parseFloat(o)/3}T ${e}`}function d(t,e){const o=t[e];return Array.from(o.values()).map((t=>t.slice(0,3)))}function u(t,e=2){let o=navigator.language||navigator.userLanguage;o=o.length<=2?`${o}-${o.toUpperCase()}`:o;const n={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===o?t.toLocaleString("de-DE",n):t.toLocaleString(o,n)}function f(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function m(t){return t>=1e3?t/1e3+" Tn":t.toString()}function h(t,e=29){if(t.length>=e){const o=t.split(" ");let n="",r="";return o.forEach((t=>{`${n} ${t}`.length<=e?n+=(n?" ":"")+t:(r+=`${n}\n`,n=t)})),r+=n,r}return t}function g(t,e){const o=t=>{const o=echarts.init(t);o.setOption(e,!0),window.addEventListener("resize",(()=>{null!=o&&void 0!==o&&o.resize()}));const n=document.getElementById("main-content");return n&&(n.addEventListener("shown.bs.collapse",(()=>{o.resize()})),n.addEventListener("hidden.bs.collapse",(()=>{o.resize()}))),o};let n=document.getElementById(t);return n?o(n):(document.body.addEventListener("MainContentLoadedCustom",(()=>(n=document.getElementById(t),n?o(n):(console.error(`El elemento con ID ${t} no está disponible.`),null)))),null)}function p(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}function S(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}function y(t,e=!1,o=!0,n=""){let r=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach((t=>{const a=e?Math.round(t.data):t.data,i=o?`<div style="font-weight: 400;color: #666;">${s=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${s}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${u(a)} ${n}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${u(a)} ${n}`:"-"}\n </span>\n </div>`;var s;r+=i})),r}function b(t){return 100*(t-120)/t}function M(t,e){const o=Math.max(...t);return o+(e-o%e)}function x(t,e=!1){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,n=e?`${t.percent}%`:u(t.value);return`<div> ${o} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${n} </span></div>`}function E(t,e){let o=`${t.name} : `;return o+=`<span style="font-weight:500">${u(Math.round(t.value))}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),t.marker+o}function D(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${u(o)} €`:o>=e?`${u(o/e)} M €`:"-"}function v(t,e,o=1){const n=Math.max(...t.map((t=>t[e])))*o;return 5e3*Math.ceil(n/5e3)}function A(t,e,o,n=30,r=15,a=30,i=-70,s=70,l=3){const c=v(t,e.data,1.1),d=s,f=o.slice(),m=[];let g=r,p=a,S=i;for(let o=0;o<t.length;o+=1)m.push({value:t[o][e.data],name:h(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:f.shift(),title:{offsetCenter:[`${String(S)}%`,`${String(g)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(S)}%`,`${String(p)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>u(Math.round(t))}}),S+=d,(o+1)%l==0&&(p+=a,g+=2*r,S=i);return[c,m]}function C(t,e,o,r=0){return[v(e,o.data,1),t=>function(t,e,o){const r=u(Math.round(e)),a=n(t[o][0]),i=t[o][1],s=`\n${a} ${i} : ${r}`,l=`${r}\n${a} ${i}`;return window.innerWidth<=1710?s:l}(e,t,r),[{value:e[r][o.data]}]]}function w(t,e){const{resultset:o}={resultset:t},n=new Set,r=new Set,a=o.map((([t,o,a])=>{const i=e?Math.round(a):a;return n.add(t),r.add(o),{day:o,type:t,value:i}})),i=Array.from(r.values()),s=Array.from(n.values());return s.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[s.map((t=>{const e=a.filter((e=>e.type===t)).map((({day:e,value:o})=>[e,t,o])),o=i.map((t=>{const o=e.find((([e])=>e===t));return o?o[2]:null}));return{name:t,data:o}})),s,r]}function R(t,e=[],o=!1){const[n,r,a]=w(t,o);return n.forEach((t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())})),[n,a,r]}function L(t,e,o=!1){const[n,r,a]=w(t,o);return n.forEach((t=>{t.type="bar",t.color=e.shift(),t.smooth=!1})),[n,a,r]}function F(t){const{resultset:e,metadata:o}=t,n=[];return e.forEach((t=>{const e={};t.forEach(((t,n)=>{e[o[n].colName]=t})),n.push(e)})),n}function $(t,e){const o={...t};return Object.keys(e).forEach((n=>{Object.prototype.hasOwnProperty.call(e,n)&&("series"===n&&Array.isArray(e[n])?o[n]=e[n].map(((e,o)=>({...Array.isArray(t[n])&&t[n][o]||{},...e}))):"object"!=typeof e[n]||null===e[n]||Array.isArray(e[n])?t[n]!==e[n]&&(o[n]=e[n]):o[n]=$(t[n]||{},e[n]))})),o}function I(t,e){console.log("INICIO HTML");const o=()=>{t.forEach((t=>{t.id in e&&Object.entries(e[t.id]).forEach((o=>{const n=o[0],r=o[1];"object"==typeof r?r.className?document.querySelector(r.className).className=t[n]:r.element&&r.format&&(document.querySelector(r.element).textContent=e[t.id][n].format(t[n])):document.querySelector(r).textContent=t[n]}))}))};try{o()}catch(t){document.body.addEventListener("MainContentLoadedCustom",(()=>{o()}))}}function N(t,e){const o=F(t),n=[];let r=null;return o.forEach((t=>{const o=t[e];"number"!=typeof o||Number.isNaN(o)||n.push(o)})),n.length>0&&(r=Math.max(...n)),r}function O(t,e){const o=document.querySelector(t);o?o.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function T(t,e=!0){const o={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?o.Cont.push([t[3],t[4],t[2]]):o.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?o.Mob.push([t[3],t[4],t[2]]):o.Mob.push([t[3],t[2]]))})),o}const _=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],B=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],z=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],k=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],K=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function W(t){const e=t.resultset.map((t=>t[0]));return this.dashboard.fireChange(this.parameter,e),t}function G(t){for(const e of t)if(Array.isArray(e)){if(!G(e))return!1}else if("All"!==e)return!1;return!0}function P(t,e,o,n){return G(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function U(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function j(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function H(t="Todos"){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:t,noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function Y(t="Todos"){const e=H(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function q(t,e,o,n){const r=Dashboards.getParameterValue(o),a=Dashboards.getParameterValue(n);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[a]),!0}function V(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function J(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function X(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;t.dashboard.setParameter(n,[o])}function Z(t){t.regional.es={monthNames:_,abbreviatedMonthNames:B,dayNames:z,abbreviatedDayNames:k,dayNamesMin:K,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function Q(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(o)?o:[o]),!0}function tt(t,e){const o=document.getElementById(t);return o?new Tabulator(o,e):(console.error(`No se pudo encontrar el elemento con ID ${t}.`),null)}function et(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function ot(t,e){const o=t.getValue().split(" ");let n="",r="";return o.forEach((t=>{(r+t).length<=e?r+=`${t} `:(n+=`${r}<br>`,r=`${t} `)})),n+=`${r}<br>`,n}function nt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach((t=>{t.getTreeChildren().length>0&&nt(t,e)}))}function rt(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&nt(t,e)}))}function at(t,e,o,n){const r=[];for(const a in t)if(t.hasOwnProperty(a)){const i=t[a],s={[e]:i[0],_children:[]};i.shift(),i.forEach(((t,r)=>{const a={[e]:o[r],[n]:t};s._children.push(a)})),r.push(s)}return r}function it(t){let e=!0;return t.getGroups().forEach((t=>{t._group.visible&&(e=!1)})),e}function st(t,e,o){const n=document.getElementById(o),r=n.cloneNode(!0);n.parentNode.replaceChild(r,n),r.addEventListener("click",(()=>{t.download("csv",`${e}.csv`,{delimiter:";"})}))}function lt(t,e,o){const n=document.getElementById(o),r=n.cloneNode(!0);n.parentNode.replaceChild(r,n),r.addEventListener("click",(()=>{t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8}}})}))}const ct={SO2:[100,200,350,500,750,751],NO2:[40,90,120,230,340,341],O3:[50,100,130,240,380,381],PM10:[20,40,50,100,150,151],PM25:[10,20,25,50,75,76]};function dt(t){const e=[],o={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function n(t,e,n){const r=document.createElement("td");if(r.setAttribute("id",t),null!=e){r.innerHTML=e;const t=function(t,e){let n;return void 0===e?n=6:"ND"===e?n=7:(n=5,t.forEach(((t,o)=>{e<=t&&5===n&&(n=o)}))),o[n]}(n,e);r.classList.add(t)}return r}return t.forEach((t=>{const o=t;"noData"===o.operationalstatus&&(o.so2value="ND",o.no2value="ND",o.o3value="ND",o.pm10value="ND",o.pm25value="ND"),"A09_CABANYAL_60m"===o.entityid&&(o.pm10value=void 0,o.pm25value=void 0);const r=document.createElement("tr"),a=document.createElement("td");a.innerHTML=o.address,r.appendChild(a),r.appendChild(n(`${o.entityid}_so2`,o.so2value,ct.SO2)),r.appendChild(n(`${o.entityid}_no2`,o.no2value,ct.NO2)),r.appendChild(n(`${o.entityid}_o3`,o.o3value,ct.O3)),r.appendChild(n(`${o.entityid}_pm10`,o.pm10value,ct.PM10)),r.appendChild(n(`${o.entityid}_pm25`,o.pm25value,ct.PM25)),e.push(r)})),e}function ut(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function ft(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function mt(t,e){document.querySelectorAll(`[${t}]`).forEach((o=>{!function(t,e,o){const n=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(n.innerHTML=this.responseText,o&&o()),404===this.status&&(n.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(o.getAttribute(t),o,e)}))}function ht(t){mt("include-html-cabecera",(function(){!function(){const t=ft();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=ft();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()})),mt("include-html-menu"),mt("include-html-main-container",(function(){document.body.dispatchEvent(new Event("MainContentLoadedCustom")),function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])}(),t&&t()})),mt("include-html-copyright")}function gt(t,e,o,n,r,a){let i=!1,s=!1;const l=document.querySelector(t),c=document.querySelector(e),d=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function u(t=!0){const e=document.querySelector(o);t?(l&&(l.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),s=!0):(e.classList.remove("blur"),d(),s=!1)}const f=t=>{new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(s||d(),i||(i=!0,window.setTimeout(u,a)))}))})).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(l&&(l.setAttribute("sandbox","allow-scripts"),f(l)),c&&(c.setAttribute("sandbox","allow-scripts"),f(c)),document.querySelector(r).addEventListener("click",(()=>{u(!1),window.setTimeout(u,a)}))):document.querySelectorAll(n)[0].style.display="none"}const pt={grid:{containLabel:!0},title:{left:"center",top:"0",textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"}},legend:{orient:"horizontal",bottom:"0",left:"center",width:"100%",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400,color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{restore:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}},saveAsImage:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12}},xAxis:[{type:"category",axisLabel:{show:!0,interval:0,textStyle:{fontFamily:"Montserrat",fontSize:11}},data:[]}],yAxis:[{type:"value",alignTicks:!0,position:"right",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${t}%`}},{type:"value",position:"left",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${f(t)}€`}}]},St=(t,e)=>{e.sort(((t,e)=>parseInt(t.anyo)-parseInt(e.anyo)));const o={};e.forEach((e=>{const n=e[1],r=e[0];r!==t.seriesName||o[n]||(o[n]=0),r===t.seriesName&&(o[n]+=e[2])}));let n=`<p>${t.seriesName}</p>`;for(const[e,r]of Object.entries(o))n+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${u(r)}</span></div>`;return n};function yt(t,e,o=void 0,n=void 0){const r=null===n?void 0:n,a=new Set(e.map((t=>t[1])));let i;const s={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{axisPointer:{type:"shadow"},trigger:"item",formatter:t=>St(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,o,n,r){const a={},i=r.contentSize[1]/2,s=r.viewSize[1],l=t[1];return l<i?a.top=10:l+i>s?a.bottom=10:a.top=l-i,t[0]<r.viewSize[0]/2?a.left=t[0]+20:a.right=r.viewSize[0]-t[0]+20,a}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>u(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(a),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>u(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};r&&r.itemStyle&&Array.isArray(r.itemStyle.borderColor)&&(i=[...r.itemStyle.borderColor],delete r.itemStyle.borderColor);const o=function(t){return t.reduce(((t,e)=>{const o=e[0];return t[o]||(t[o]=[]),t[o].push(e),t}),{})}(e),n=Object.keys(o);a.forEach((t=>{n.forEach((e=>{void 0===o[e].find((e=>e[1]===t))&&(o[e].push([o[e][0][0],t,void 0]),o[e].sort())}))}));const s=[];return Object.keys(o).forEach((e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=o[e].map((t=>t[2]));let n={};n=void 0!==r?$(t,r):t,s.push({...n})})),s})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let l={};l=void 0!==o?$(s,o):s,g(t,l)}function bt(t){let e={};return e=$(pt,t),e}function Mt(t,e,o={},r={}){let a={};a=$(o,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach((e=>{t.add(e[1])})),Array.from(t).sort(((t,e)=>t-e))}()}});const i={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},s=null===r?i:$(r,i),l=e;l.forEach(((t,e)=>{l[e][0]=n(t[0])})),yt(t,l,a,s)}function xt(t,e=void 0){const o={title:{text:"SIN TITULO",left:"center",top:"top",padding:50,textStyle:{fontSize:14,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"30%",bottom:"5%",left:"8%",right:"8%"},xAxis:{type:"value",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},appendToBody:!0,formatter:t=>E(t,!1)},series:[{type:"bar",showBackground:!0}]};let n={};n=void 0!==e?$(o,e):o,g(t,n)}function Et(t,e,o,n,r,a){const i={grid:{left:"0",right:"0",bottom:"0",top:"50",containLabel:!0},title:{text:o,margin:"0",padding:0,top:"0",left:"60%",textAlign:"center",itemGap:5,textStyle:{fontSize:15,lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:n,subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},legend:{show:!1,top:"bottom",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:"400",color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{saveAsImage:{title:"Descargar",textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},series:[{type:"gauge",center:["50%","65%"],startAngle:200,endAngle:-20,min:0,max:a,splitNumber:10,progress:{show:!0,width:40,itemStyle:{color:"#4BA3C3"}},pointer:{show:!1},axisLine:{lineStyle:{width:40}},axisTick:{distance:-50,splitNumber:5,lineStyle:{width:2,color:"#ccc"}},splitLine:{distance:-55,length:9,lineStyle:{width:2,color:"#ccc"}},axisLabel:{distance:0,textStyle:{color:"#999",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:12}},anchor:{show:!1,showAbove:!0,size:35,itemStyle:{borderWidth:40,color:"#284B63"}},detail:{formatter:t+e,width:"60%",borderRadius:8,offsetCenter:[0,0],valueAnimation:!0,textStyle:{color:"#284B63",fontStyle:"normal",fontWeight:"600",fontFamily:"Montserrat",fontSize:30}},data:[{value:t}]}]};echarts.init(document.getElementById(r)).setOption(i)}function Dt(t,e,o,n){return{grid:{top:"15%",bottom:"3%",left:"3%",right:"3%"},title:{text:t,margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontFamily:"Montserrat",fontSize:18,fontWeight:600,color:"#666"},subtext:e,subtextStyle:{fontFamily:"Montserrat",fontSize:17,fontWeight:500,color:"#666"}},tooltip:{textStyle:{fontFamily:"Montserrat"},renderMode:"html",tooltipFormatter:n},yAxis:{data:o.map((t=>t[0])),axisLabel:{show:!1}},series:[{data:o.map((t=>t[1])),type:"bar",barWidth:"75%",barCategoryGap:"20%",label:{show:!0,position:"insideLeft",formatter:"{b}",width:400,overflow:"truncate",textStyle:{fontSize:13,fontWeight:600,fontFamily:"Montserrat",color:"#284B63"}},itemStyle:{color:"#82bed4"}}]}}function vt(t,e,o,n,r){const a={grid:{left:"0",right:"0",bottom:"0",top:"60",containLabel:!0},title:{text:t,margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontSize:"15",lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:e,subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},toolbox:{show:!0,right:"0",top:"0",feature:{saveAsImage:{title:"Descragar",textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},legend:{show:!1,orient:"vertical",top:"55",bottom:"5",left:"0",padding:[0,0],width:"20%",itemHeight:10,itemWidth:11,itemGap:10,textStyle:{fontSize:"12",lineHeight:14,fontFamily:"Montserrat",fontWeight:"400",color:"#666",width:210,overflow:"break"}},tooltip:{trigger:"axis",confine:!0,axisPointer:{type:"none"},textStyle:{fontFamily:"Montserrat",fontSize:12,fontWeight:500}},xAxis:{data:o,axisLabel:{show:!0,margin:6,textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:"500"}}},yAxis:{type:"value",alignTicks:!0,scale:!0,axisLabel:{formatter:"{value} kWh",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400}}},series:[{data:n,type:"bar",itemStyle:{color:"#4BA3C3"}}]};echarts.init(document.getElementById(r)).setOption(a)}function At(t,e,o,n,r,a,i){const s=echarts.init(document.getElementById(n)),l={grid:{left:"0",right:"0",bottom:"0",top:"50",containLabel:!0},title:{text:t,margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontSize:"15",lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:e,subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},toolbox:{show:!0,right:"0",top:"0",feature:{saveAsImage:{title:"Descargar",textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},legend:{show:!1},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12,color:"#666",fontWeight:500},formatter:function(t){return t.value[2]+o+r[t.value[0]]+i}},xAxis:{type:"category",data:r,boundaryGap:["20%","20%"],gridIndex:0,offset:0,axisTick:{show:!1},axisLine:{lineStyle:{color:"#ccc"}},axisLabel:{show:!0,interval:0,rotate:0,padding:0,margin:10,fontSize:10,lineHeight:13,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},yAxis:{type:"category",data:i,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!0,fontSize:10,fontFamily:"Montserrat",fontWeight:500,color:"#333"}},series:[{name:"Consum Energètic",type:"scatter",color:"#4BA3C3",symbolSize:function(t){return 11*t[2]},data:a,animationDelay:function(t){return 5*t}}]};l&&s.setOption(l),window.addEventListener("resize",s.resize)}const Ct="es_ES",wt={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])};function Rt(t){return Math.max(...t.map((t=>Number(t[0]))))}function Lt(t){const e=t.filter((e=>Number(e[0])===Rt(t))),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n})),o}function Ft(t){const e=t.filter((e=>Number(e[0])===Rt(t)-1)),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n})),o}function $t(t,e,o=void 0){const n=Rt(e).toString(),r=(Rt(e)-1).toString();xt(t,$({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[r,n],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:d(wt,Ct),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:r,type:"bar",data:Ft(e)},{name:n,type:"bar",barGap:0,data:Lt(e)}]},o))}function It(t,e,o){const n=document.querySelector(e),r=document.querySelector(t);let a=!1;r.addEventListener("click",(()=>{!1===a&&(a=!0,n.setAttribute("src","about:blank"),n.setAttribute("src",o),n.onload=()=>{a=!1})})),r.disabled=!1}const Nt="id",Ot="fecha",Tt="value";function _t(t,e,o,n,r="es_ES"){const[a,i]=function(t,e,o){const n=[],r=[];return t.forEach((t=>{e.includes(`${t[Nt]}`)?n.push(`${t[Ot]}`):o.includes(`${t[Nt]}`)&&r.push(`${t[Ot]}`)})),[n.map((t=>[t,0])),r.map((t=>[t,0]))]}(t,o,n);let s="es_ES"==r?"Datos sin validar":"Dades sense validar";0===i.length&&(s="");const l={name:"Datos validados",type:"line",data:[...a,i[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",d="";if(0===i.length){const e=t[t.length-1].fecha;c=e,d=e}else c=i[0][0],d=i[i.length-1][0];return[...e,l,{name:"Datos NO validados",type:"line",data:i,lineStyle:{color:"#80D4CF",width:4},showSymbol:!1,tooltip:{show:!1},markArea:{silent:!0,itemStyle:{opacity:.6,color:"#eee"},tooltip:{show:!1},label:{color:"#333",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:11},data:[[{name:s,xAxis:c,yAxis:0},{name:"end",xAxis:d,yAxis:Math.max(...t.filter((t=>null!==t[Tt])).map((t=>parseInt(`${t[Tt]}`,10))))}]]}}]}function Bt(t,e,o=void 0){g(t,$({grid:{left:"2.5%",right:"5%",bottom:"70",top:"150",containLabel:!0},title:{left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},legend:{type:"plain",top:"50",width:"98%",textStyle:{fontFamily:"Montserrat"}},tooltip:{trigger:"axis",show:!0,formatter:t=>y(t),textStyle:{fontFamily:"Montserrat"}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{type:"value",nameLocation:"end",nameGap:"0",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"500",padding:[-25,0,0,-48],margin:0,align:"left",verticalAlign:"top",width:"auto"},scale:!0,splitNumber:"6",axisLabel:{margin:10,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},dataZoom:{end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}},toolbox:{feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:"1%",top:"0%"},series:e},o))}return e})(),t.exports=e()}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,o),a.exports}o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";o.r(n),o.d(n,{echartDesKgsBar:()=>V,echartDesKgsGauge:()=>Y,echartDesKgsHorStackedBar:()=>P,echartDesKgsPerTipusResidu:()=>z,echartDesKgsPie:()=>J,echartDesKgsStackedBar:()=>U,echartKgsResidus:()=>O,echartKgsResidusBarMonth:()=>q,echartKgsResidusRelojSemicircle:()=>j,echartKgsResidusStackedBarYears:()=>G,echartYearKgsResidusGaugeSemicircle:()=>H});const t="8%",e="2.5%",r="5%",a="18%",i="20%",s="10%",l="90%",c="1%",d="0%",u=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],f=33,m=27,h=30;function g(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const o={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",o):t.toLocaleString(e,o)}function p(t){return 100*(1-17/t)}function S(t,e=!1){let o=`<p>${t[0].name}</p>`;return t.forEach((t=>{const n=e?Math.round(t.data):t.data,r=`<div>${a=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${a}"></span>`} ${t.seriesName}: <strong style="float: right; margin-left:20px">${t.data?g(n):"-"}</strong></div>`;var a;o+=r})),o}function y(t){return g(t)}function b(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}function M(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}function x(t,e,o=1){const n=Math.max(...t.map((t=>t[e])))*o;return 5e3*Math.ceil(n/5e3)}function E(t){return Math.round(document.getElementById(t).offsetWidth/f)}function D(o,n,u,f,m,h,g,p=5,b="",M=m,x=100,E,D=void 0,v=void 0){return{title:{text:b,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",show:!0,formatter:t=>S(t),textStyle:{fontFamily:"Montserrat"}},legend:n?{type:"plain",data:n,textStyle:{fontFamily:"Montserrat"},top:D||t,selected:E}:null,grid:{left:e,right:r,bottom:a,top:n?D?"30%":i:s,heigh:l,containLabel:!0},xAxis:{type:"category",data:u,boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{name:f,nameLocation:"end",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"bold",padding:[0,0,0,g]},type:"value",scale:!0,min:v,axisLabel:{margin:p,formatter:y,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},series:o,dataZoom:[{show:h,data:u,start:M,end:x,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}],toolbox:{show:h,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:c,top:d}}}function v(t,e,o=-45,n="",r=e){const a=new Set,i=[];t.forEach((t=>{const e=t[0].toString().padStart(2,"0");a.add(`${e}/${t[1]}`),i.push(Math.round(t[2]))}));const s=i.length<100?40:80;return D({name:r,type:"bar",smooth:!1,barMaxWidth:40,itemStyle:{color:"#5470c6"},textStyle:{fontFamily:"Montserrat"},data:i},null,Array.from(a.values()),e,s,!0,o,25,n)}function A(t,e){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${t.color};"></span>`;let n=`${t.name} : `;return n+=`<span style="font-weight:bold">${g(t.value)}</span>`,e&&(n+=`<span> (${t.percent}%)</span>`),o+n}function C(t,e,o,n){return{color:u,title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:n,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"},formatter:t=>A(t,!1)},splitNumber:3,series:{type:"gauge",max:e,startAngle:-180,endAngle:0,splitNumber:2,pointer:{show:!1,icon:"roundRect"},progress:{show:!0,overlap:!1,roundCap:!0,clip:!0,itemStyle:{borderWidth:1,borderColor:"#464646"}},axisLine:{lineStyle:{width:60}},splitLine:{show:!0,distance:10,length:10},axisTick:{show:!0,splitNumber:5},axisLabel:{show:!0,distance:70,formatter:t=>g(Math.round(t)),fontFamily:"Montserrat",color:"#666"},data:o,detail:{fontSize:n/1.2,color:"inherit",formatter:t=>g(Math.round(t))}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:m,top:h}}}function w(t,e="",o){const n=[],r=x(t,1,1.1),a=r.toString().length>=9?100:95,i=115===a?-45:-35;let s=t.length<5?t.length*i:-190;for(let e=0;e<t.length;e+=1)n.push({value:t[e][1],name:String(t[e][0]),title:{offsetCenter:[String(s),"20%"],fontFamily:"Montserrat"},detail:{offsetCenter:[String(s),"35%"],fontFamily:"Montserrat"}}),s+=a;return C(e,r,n,o)}function R(t,e,o="",n){return{title:{text:o,left:"center",top:"top",padding:10,textStyle:{fontSize:n,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:x(t,2),itemStyle:{color:"#FFAB91"},progress:{show:!0,width:30},pointer:{show:!1},axisLine:{lineStyle:{width:30}},axisTick:{distance:10,splitNumber:5,lineStyle:{width:2,color:"#999"}},splitLine:{distance:10,length:14,lineStyle:{width:3,color:"#999"}},axisLabel:{fontFamily:"Montserrat",color:"#666",fontSize:14,show:!0,distance:40,formatter:t=>g(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[-5,"-10%"],fontSize:n+5,fontWeight:"bolder",formatter:o=>function(t,e,o){const n=g(Math.round(e)),r=(a=t[o][0],{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(a.toString(),10)]);var a;const i=t[o][1],s=`\n\n\n${r} ${i} : ${n}`,l=`${n}\n${r} ${i}`;return window.innerWidth<=1710?s:l}(t,o,e),fontFamily:"Montserrat",color:"inherit"},data:[{value:t[e][2]}]},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:m,top:h}}}function L(t){if(t.length>=29){const e=t.split(" ");let o="",n="";for(const t of e)`${o} ${t}`.length<=29?o+=(o?" ":"")+t:(n+=`${o}\n`,o=t);return n+=o,n}return t}function F(t,e){const o=document.getElementById(t);if(!o)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const n=echarts.init(o);return n.setOption(e,!0),$(window).on("resize",(()=>{null!=n&&void 0!==n&&n.resize()})),n}function I(t){return 100*(t-120)/t}function N(t){const e=Array.from(t.keys(),(t=>function(t){const e=t.split("/"),o=parseInt(e[0],10),n=parseInt(e[1],10)-1,r=parseInt(e[2],10);return new Date(r,n,o)}(t))),o=[],n=[],r=function(t,e){const o=[];for(;t<=e;){const e=(n=t,`${String(n.getDate()).padStart(2,"0")}/${String(n.getMonth()+1).padStart(2,"0")}/${String(n.getFullYear())}`);o.push(e),t.setDate(t.getDate()+1)}var n;return o}(new Date(Math.min(...e)),new Date(Math.max(...e)));return r.forEach((e=>{if(t.has(e)){const o=t.get(e);n.push(o)}else n.push(null)})),o.push(r),o.push(n),o}function O(t,e){if(0===e.resultset.length)b("#chartKgsResidus","#no_dataKgsResidus");else{M("#no_dataKgsResidus","#chartKgsResidus");const t="KGS. DE RESIDUS EN CONTENIDORS: EVOLUCIÓ DIÀRIA",o="KGS. DE RESIDUS EN MOBLES: EVOLUCIÓ DIÀRIA",n=e.resultset,r=0,a=1,i=2,s=3,l=new Map,c=new Map;let d=[],u=[];n.forEach((t=>{"Contenidor"===t[i]&&"total"===t[a]&&l.set(t[r],t[s]),"Moble"===t[i]&&c.set(t[r],t[s])})),d=N(l),u=N(c);const f=I(d[0].length),m=I(u[0].length),h=-30,g=[{name:"Contenidor",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:d[1]}],p=[{name:"Moble",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u[1]}];F("chartKgsResidus",D(g,null,d[0],"Kgs",f,!0,h,void 0,t)),F("chartKgsResidusMoble",D(p,null,u[0],"Kgs",m,!0,h,void 0,o))}}function T(t,e=!0){const o={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?o.Cont.push([t[3],t[4],t[2]]):o.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?o.Mob.push([t[3],t[4],t[2]]):o.Mob.push([t[3],t[2]]))})),o}const _=["#0077b6","#ffc300","#55828b","#a26769","#b1a7a6","#38b000"],B=_.slice(0,-2).concat(_.slice(-1));function z(t,e){!function(t,e,o,n,r,a,i,s,l=!1,c=!1,d,f=!0,m=u.slice(),h=!1,g,S){const y=t.resultset||t;if(0===y.length)b(`#${a}`,`#${i}`),s&&b(`#${s}`,`#${i}`);else{M(`#${i}`,`#${a}`),s&&M(`#${i}`,`#${s}`);const t=function(t,e,o=!1){const{resultset:n}={resultset:t},r=new Set,a=new Set,i=e,s=n.map((([t,e,n])=>{const i=o?Math.round(n):n;return r.add(t),a.add(e),{day:e,type:t,value:i}})),l=Array.from(a.values()),c=Array.from(r.values());return c.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[c.map((t=>{const e=s.filter((e=>e.type===t)).map((({day:e,value:o})=>[e,t,o])),o=l.map((t=>{const o=e.find((([e])=>e===t));return o?o[2]:null}));return{name:t,type:"line",symbol:"circle",color:i.shift(),symbolSize:6,smooth:!1,data:o}})),a,c]}(y,m,h),u=t[0],b=t[1],E=t[2],v=f?E:null,A=c?(x=b,Array.from(x.values()).map((t=>{const[e,o]=t.split("/");return function(t){const e=t.slice(0,2);return`${t.slice(3,5)}/${e}`}(t)}))):Array.from(b.values());void 0===d&&(d=l?p(b.size):I(b.size)),F(a,D(u,v,A,r,d,e,o,void 0,n,void 0,void 0,void 0,g,S))}var x}(e,!0,0,"DESAGREGACIÓ KGS. CONTENIDORS PER TIPUS DE RESIDUS","Kgs","chartDesKgsPerTipusResidu","no_dataDesKgsPerTipusResidu",void 0,void 0,void 0,void 0,void 0,_)}var k=o(2725);const K={es_ES:new Map([["chartResidusContenidorstackedBarYears","KGS. DE RESIDUOS EN CONTENEDORES: DESGLOSE DE LOS ÚLTIMOS AÑOS"],["chartResidusMoblesstackedBarYears","KGS. DE RESIDUOS EN MUEBLES: DESGLOSE DE LOS ÚLTIMOS AÑOS"],["chartDesKgsHorStackedBar","KGS. DE RESIDUOS DE RECICLAJE: HISTORICO ANUAL"]]),ca_ES:new Map([["chartResidusContenidorstackedBarYears","KGS. DE RESIDUS EN CONTENIDORS: DESGLOSSAMENT DELS ÚLTIMS ANYS"],["chartResidusMoblesstackedBarYears","KGS. DE RESIDUS EN MOBLES: DESGLOSSAMENT DELS ÚLTIMS ANYS"],["chartDesKgsHorStackedBar","KGS. DE RESIDUS DE RECICLATGE: HISTÒRIC ANUAL"]])},W="ca_ES";function G(t,e){function o(t,o,n){if(0===e.resultset.length)(0,k.printNoDataChart)(`#${t}`,`#${o}`);else{const e={title:{text:K[W].get(t)},xAxis:{name:"\n\n\n\nKgs"}};(0,k.initStackedBarChartMonthSeries)(t,n,e)}}const n=(0,k.splitDataset)(e.resultset),r=n.Cont,a=n.Mob;o("chartResidusContenidorstackedBarYears","no_dataResidusContenidorstackedBarYears",r),o("chartResidusMoblesstackedBarYears","no_dataResidusMoblesstackedBarYears",a)}function P(t,e){const o="chartDesKgsHorStackedBar",n="no_dataDesKgsHorStackedBar";if(0===e.resultset.length)(0,k.printNoDataChart)(`#${o}`,`#${n}`);else{(0,k.printDataChart)(`#${n}`,`#${o}`);const t={title:{text:K[W].get(o)},color:B,xAxis:{name:"\n\n\n\nKgs"}};(0,k.initStackedBarChart)(o,e.resultset,t)}}function U(t,o){!function(t,o,n,s,c="",d="total",f=0,m=1,h=2,x=u){if(0===n.length)b(`#${t}`,`#${o}`);else{M(`#${o}`,`#${t}`);const u=[];let b=(E=f,n.reduce(((t,e)=>{const o=e[E];return t[o]||(t[o]=[]),t[o].push(e),t}),{}));const D=new Set(n.map((t=>t[m]))),v=Object.keys(b);D.forEach((t=>{v.forEach((e=>{void 0===b[e].find((e=>e[m]===t))&&(b[e].push([b[e][0][f],t,void 0]),b[e][0][1].length>4?b[e].sort(((t,e)=>{const[o,n]=t[1].split("/"),[r,a]=e[1].split("/"),i=new Date(n,o-1,1),s=new Date(a,r-1,1);return i.getTime()-s.getTime()})):b[e].sort())}))}));const A=Object.entries(b).sort(((t,e)=>t[0].localeCompare(e[0]))),C=""===d?90:0;b=Object.fromEntries(A),Object.keys(b).forEach((t=>{u.push({name:t,type:"bar",stack:d,label:{show:!0,fontFamily:"Montserrat",rotate:C,formatter:t=>g(Math.round(t.value))},emphasis:{focus:"series"},data:b[t].map((t=>t[h]))})}));const w=""!==d?p(D.size):100*(1-7/D.size);F(t,{color:x,title:{text:c,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat"},formatter:t=>S(t,!0)},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:e,right:r,bottom:a,top:i,heigh:l,containLabel:!0},yAxis:{type:"value",splitNumber:4,name:s,nameLocation:"end",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666"},axisLabel:{formatter:y,textStyle:{fontSize:8,fontFamily:"Montserrat",color:"#666"}}},xAxis:{type:"category",data:[...D],axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:u,toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50},dataZoom:[{show:!0,data:[...D],start:w,end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}]})}var E}("chartDesKgsStackedBar","no_dataDesKgsStackedBar",o.resultset,"Kgs","KGS. DE RESIDUS DE RECICLATGE: HISTÒRIC MENSUAL",void 0,void 0,void 0,void 0,B)}function j(t,e){if(0===e.resultset.length)b("#chartResidusContenidorreloj_semicircle","#no_dataResidusContenidorreloj_semicircle"),b("#chartResidusContenidorreloj_semicircle_lastmonth","#no_dataResidusContenidorreloj_semicircle_lastmonth"),b("#chartResidusMoblesreloj_semicircle","#no_dataResidusMoblesreloj_semicircle"),b("#chartResidusMoblesreloj_semicircle_lastmonth","#no_dataResidusMoblesreloj_semicircle_lastmonth");else{M("#no_dataResidusContenidorreloj_semicircle","#chartResidusContenidorreloj_semicircle"),M("#no_dataResidusContenidorreloj_semicircle_lastmonth","#chartResidusContenidorreloj_semicircle_lastmonth"),M("#no_dataResidusMoblesreloj_semicircle","#chartResidusMoblesreloj_semicircle"),M("#no_dataResidusMoblesreloj_semicircle_lastmonth","#chartResidusMoblesreloj_semicircle_lastmonth");const t=0,o=1,n=T(e.resultset),r=n.Cont,a=n.Mob,i=E("chartResidusContenidorreloj_semicircle");F("chartResidusContenidorreloj_semicircle",R(r,t,"KGS. DE RESIDUS EN CONTENIDORS: MES ACTUAL",i)),F("chartResidusContenidorreloj_semicircle_lastmonth",R(r,o,"KGS. DE RESIDUS EN CONTENIDORS: MES ANTERIOR",i)),F("chartResidusMoblesreloj_semicircle",R(a,t,"KGS. DE RESIDUS EN MOBLES: MES ACTUAL",i)),F("chartResidusMoblesreloj_semicircle_lastmonth",R(a,o,"KGS. DE RESIDUS EN MOBLES: MES ANTERIOR",i))}}function H(t,e){if(0===e.resultset.length)b("#chartYearResidusContenidorgauge_semicircle","#no_dataYearResidusContenidorgauge_semicircle"),b("#chartYearResidusMoblesgauge_semicircle","#no_dataYearResidusMoblesgauge_semicircle");else{M("#no_dataYearResidusContenidorgauge_semicircle","#chartYearResidusContenidorgauge_semicircle"),M("#no_dataYearResidusMoblesgauge_semicircle","#chartYearResidusMoblesgauge_semicircle");const t=T(e.resultset,!1),o=t.Cont,n=t.Mob,r=E("chartYearResidusContenidorgauge_semicircle");F("chartYearResidusContenidorgauge_semicircle",w(o,"KGS. DE RESIDUS EN CONTENIDORS: ÚLTIMS ANYS",r)),F("chartYearResidusMoblesgauge_semicircle",w(n,"KGS. DE RESIDUS EN MOBLES: ÚLTIMS ANYS",r))}}function Y(t,e){if(0===e.resultset.length)b("#chartDesKgsGauge","#no_dataDesKgsPie");else{M("#no_dataDesKgsPie","#chartDesKgsGauge");const t=e.resultset;document.querySelector("#idDesKgs").addEventListener("click",(()=>{requestAnimationFrame((()=>{const e=E("chartDesKgsGauge"),o=function(t,e,o=!1){const n=[],r=1.1*x(t,1);let a,i=50,s=250,l=20,c=30,d=-80;r>9999999&&(i=65,s=75);const u=o?4:3;for(let o=0;o<t.length;o+=1)a=String(t[o][0]).replace(/\[.*?\]/g,""),a=L(a),n.push({value:t[o][1],name:a,title:{offsetCenter:[`${String(d)}%`,`${String(l)}%`],fontFamily:"Montserrat",fontSize:e},detail:{offsetCenter:[`${String(d)}%`,`${String(c)}%`],fontFamily:"Montserrat",fontSize:e}}),d+=s,(o+1)%u==0&&(c+=30,l+=30,d=-80);return[r,n,i]}(t,e);F("chartDesKgsGauge",C("KGS. DE RESIDUS RSU RESTA: ÚLTIMS ANYS",o[0],o[1],e))}))}))}}function q(t,e){if(0===e.resultset.length)b("#chartResidusContenidorBarMonth","#no_dataResidusContenidorBarMonth");else{M("#no_dataResidusContenidorBarMonth","#chartResidusContenidorBarMonth");const t=T(e.resultset),o=t.Cont,n=t.Mob;F("chartResidusContenidorBarMonth",v(o,"Kgs",void 0,"KGS. DE RESIDUS EN CONTENIDORS: EVOLUCIÓ MENSUAL","Contenidor")),F("chartResidusMoblesBarMonth",v(n,"Kgs",void 0,"KGS. DE RESIDUS EN MOBLES: EVOLUCIÓ MENSUAL","Moble"))}}function V(t,e){0===e.resultset.length?b("#chartDesKgsBar","#no_dataDesKgsBar"):(M("#no_dataDesKgsBar","#chartDesKgsBar"),F("chartDesKgsBar",v(e.resultset,"Kgs",void 0,"KGS. DE RESIDUS RSU RESTA: HISTÒRIC MENSUAL","RSU Resta")))}function J(t,e){if(0===e.resultset.length)b("#chartDesKgsPie","#no_dataDesKgsPie");else{M("#no_dataDesKgsPie","#chartDesKgsPie");const t=e.resultset,o=[],n=0,r=1,a=2;for(let e=0;e<t.length;e+=1)o.push({value:t[e][r],name:t[e][n]});document.querySelector("#idDesKgs").addEventListener("click",(()=>{requestAnimationFrame((()=>{const e=E("chartDesKgsPie"),n=function(t,e,o,n=u){return{textStyle:{fontFamily:"Montserrat"},title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:o-4,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"item",textStyle:{fontFamily:"Montserrat"},formatter:t=>A(t,!0)},legend:{orient:"horizontal",textStyle:{fontFamily:"Montserrat"},left:e.length>5?"10%":"12%",bottom:"10%",top:"65%",selectedMode:!1},series:[{type:"pie",radius:"33%",data:e,color:n,top:"-30%",emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:10,top:20}}}(`KGS. DE RESIDUS DE RECICLATGE: DISTRIBUCIÓ ANY ${t[0][a]}`,o,e+5,B);F("chartDesKgsPie",n)}))}))}}})(),n})()));