@vlci/cdmciutat 38.0.0 → 39.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.
@@ -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.mediAmbient=e():t.mediAmbient=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,{MONTHS_YEAR:()=>r,MONTHS_YEAR_SHORT:()=>a,TEXTS_COMMON:()=>i,THRESHOLDS:()=>Mt,addPointInteger:()=>b,buildCamarasTrafico:()=>$t,buildTableCalidadAire:()=>xt,calculateMaxYAxis:()=>N,calculatePentahoPath:()=>At,calculateXAxisStart:()=>F,capitalizarTexto:()=>A,checkAllGroupsCollapsed:()=>bt,configureDataBar:()=>q,configureDataGaugeCommon:()=>P,configureDataGaugeMonthCommon:()=>k,configureDataLine:()=>_,configureDataValidate:()=>Rt,configureLinesChartValidates:()=>Ht,convertDateToInteger:()=>g,convertToLanguageSelectorDateRange:()=>ct,convertToTableTreeView:()=>gt,downloadCSVTable:()=>St,downloadPDFTable:()=>vt,formatCellMultiplesLines:()=>pt,formatDayMonthYear:()=>u,formatMilMillionEuros:()=>O,formatMonthAnyo:()=>c,formatName:()=>x,formatNameHeaderColumn:()=>mt,formatRoundTooltip:()=>T,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>d,formatToMillions:()=>S,formatToTons:()=>v,formatTooltip:()=>w,formatTooltipPie:()=>L,formatTrimestre:()=>m,formatWithPrefix:()=>M,getEnvironment:()=>Dt,getMaxFieldNumberFromData:()=>R,getMonth:()=>n,getMonthList:()=>p,getSelectCommonOptions:()=>nt,getSelectTwoColumnsOptions:()=>rt,initBarChart:()=>Ot,initBarChartComparationMonth:()=>_t,initChart:()=>E,initElement:()=>D,initStackedBarChart:()=>Nt,initStackedBarChartMonthSeries:()=>Tt,initTable:()=>ft,initValueDefaultDate:()=>lt,initialCalls:()=>Ct,loadIframeOnClickEvent:()=>qt,printDataChart:()=>$,printDataInHTMLElements:()=>J,printEchart:()=>z,printNoDataChart:()=>C,resetFilter:()=>ot,resetFilterDate:()=>it,resetFilterDates:()=>at,resetFilterToDefault:()=>ut,resultsetWithFields:()=>W,selectConfigDatasource:()=>tt,selectConfigDatasourceAllValue:()=>et,selectFilterAll:()=>K,selectFilterNumItemsDefault:()=>dt,selectValueDefaultInFilter:()=>st,separateDayMonthYearToSlash:()=>l,splitDataset:()=>V,subtractOneDay:()=>h,subtractOneMonth:()=>y,traverseRows:()=>yt,updateDomElement:()=>H,updateObject:()=>j,updateStackedBarOptions:()=>Lt});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)]}const r={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"]])},a={es_ES:new Map([["1","Ene"],["2","Feb"],["3","Mar"],["4","Abr"],["5","May"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Sep"],["10","Oct"],["11","Nov"],["12","Dic"]]),ca_ES:new Map([["1","Gen"],["2","Feb"],["3","Mar"],["4","Abr"],["5","Mai"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Set"],["10","Oct"],["11","Nov"],["12","Des"]])},i={es_ES:new Map([["last_update","Última actualización"]]),ca_ES:new Map([["last_update","Última actualització"]])};function l(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function s(t){return[t.substring(0,4),o[t.substring(4,6)]]}function c(t){const[e,o]=s(t);return`${o} ${e}`}function u(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 d(t){const[e,o]=s(t);return`${o.substring(0,3)} ${e}`}function f(t){const[e,o]=s(t);return`${o.substring(0,3)} '${e.substring(2,4)}`}function m(t){const[e,o]=t.split("-");return`${parseFloat(o)/3}T ${e}`}function p(t,e){const o=t[e];return Array.from(o.values()).map(t=>t.slice(0,3))}function h(t){const e=Math.floor(t/1e4),o=new Date(e,t%1e4/100-1,t%100);return o.setDate(o.getDate()-1),`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}${o.getDate().toString().padStart(2,"0")}`}function y(t){let e;const o=new Date(Math.floor(t/100),t%100-1,0);return e=`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}`,e}function g(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function b(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 S(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function v(t){return t>=1e3?t/1e3+" Tn":t.toString()}function M(t){let e,o;return t>=1e6?(e=t/1e6,o="G"):t>=1e3?(e=t/1e3,o="M"):(e=t,o="k"),{value:Math.round(100*e)/100,prefix:o}}function x(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 A(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,o)=>e+o[0].toUpperCase())}function D(t,e,o="MainContentLoadedCustom"){let n=document.getElementById(t);return n?Promise.resolve(e(n)):new Promise(r=>{document.body.addEventListener(o,()=>{n=document.getElementById(t),n?r(e(n)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),r(null))})})}function E(t,e){return D(t,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})}function C(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 $(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 w(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;">${l=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${l}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${b(a)} ${n}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${b(a)} ${n}`:"-"}\n </span>\n </div>`;var l;r+=i}),r}function F(t){return 100*(t-120)/t}function N(t,e){const o=Math.max(...t);return o+(e-o%e)}function L(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}%`:b(t.value);return`<div> ${o} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${n} </span></div>`}function T(t,e){let o=`${t.name} : `;return o+=`<span style="font-weight:500">${b(Math.round(t.value))}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),t.marker+o}function O(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${b(o)} €`:o>=e?`${b(o/e)} M €`:"-"}function z(t,e,o){return 0===t.length?(C(`#${e}`,`#${o}`),!1):($(`#${o}`,`#${e}`),!0)}function I(t,e,o=1){const n=Math.max(...t.map(t=>t[e]))*o;return 5e3*Math.ceil(n/5e3)}function P(t,e,o,n=30,r=15,a=30,i=-70,l=70,s=3){const c=I(t,e.data,1.1),u=l,d=o.slice(),f=[];let m=r,p=a,h=i;for(let o=0;o<t.length;o+=1)f.push({value:t[o][e.data],name:x(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(h)}%`,`${String(m)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(h)}%`,`${String(p)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>b(Math.round(t))}}),h+=u,(o+1)%s===0&&(p+=a,m+=2*r,h=i);return[c,f]}function k(t,e,o,r=0){return[I(e,o.data,1),t=>function(t,e,o){const r=b(Math.round(e)),a=n(t[o][0]),i=t[o][1],l=`\n${a} ${i} : ${r}`,s=`${r}\n${a} ${i}`;return window.innerWidth<=1710?l:s}(e,t,r),[{value:e[r][o.data]}]]}function B(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()),l=Array.from(n.values());return l.sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0})),[l.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}}),l,r]}function _(t,e=[],o=!1){const[n,r,a]=B(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 q(t,e,o=!1){const[n,r,a]=B(t,o);return n.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[n,a,r]}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 j(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]=j(t[n]||{},e[n]))}),o}function J(t,e){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 R(t,e){const o=W(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 H(t,e){const o=document.querySelector(t);o?o.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function V(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 G=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Y=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],U=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],Z=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],X=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function K(t){const e=t.resultset.map(t=>t[0]);return this.dashboard.fireChange(this.parameter,e),t}function Q(t){for(const e of t)if(Array.isArray(e)){if(!Q(e))return!1}else if("All"!==e)return!1;return!0}function tt(t,e,o,n){return Q(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function et(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function ot(t){t.forEach(t=>{Dashboards.fireChange(t,["All"])})}function nt(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 rt(t="Todos"){const e=nt(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function at(t,e,o,n){const r=Dashboards.getParameterValue(o),a=Dashboards.getParameterValue(n);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[a]),!0}function it(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function lt(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function st(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;""!==o&&t.dashboard.setParameter(n,[o])}function ct(t){t.regional.es={monthNames:G,abbreviatedMonthNames:Y,dayNames:U,abbreviatedDayNames:Z,dayNamesMin:X,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function ut(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(o)?o:[o]),!0}function dt(t,e,o,n=0){const r=t.resultset.slice(0,o).map(t=>t[n]);return Dashboards.setParameter(e,r),t}function ft(t,e){return D(t,t=>new Tabulator(t,e))}function mt(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function pt(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 ht(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach(t=>{t.getTreeChildren().length>0&&ht(t,e)})}function yt(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&ht(t,e)})}function gt(t,e,o,n){const r=[];for(const a in t)if(t.hasOwnProperty(a)){const i=t[a],l={[e]:i[0],_children:[]};i.shift(),i.forEach((t,r)=>{const a={[e]:o[r],[n]:t};l._children.push(a)}),r.push(l)}return r}function bt(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 vt(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 Mt={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 xt(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");const r=document.createElement("tr"),a=document.createElement("td");a.innerHTML=o.address,r.appendChild(a),r.appendChild(n(`${o.entityid}_so2`,o.so2value,Mt.SO2)),r.appendChild(n(`${o.entityid}_no2`,o.no2value,Mt.NO2)),r.appendChild(n(`${o.entityid}_o3`,o.o3value,Mt.O3)),r.appendChild(n(`${o.entityid}_pm10`,o.pm10value,Mt.PM10)),r.appendChild(n(`${o.entityid}_pm25`,o.pm25value,Mt.PM25)),e.push(r)}),e}function At(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 Dt(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function Et(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 Ct(t){Et("include-html-cabecera",function(){!function(){const t=Dt();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=Dt();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()}),Et("include-html-menu"),Et("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()}),Et("include-html-copyright"),function(t="MainContentLoadedCustom"){let e=["FilterComponent","buttonComponent"];const o=document.body.getAttribute("update-component-types");o&&(e=o.split(",").map(t=>t.trim())),document.body.addEventListener(t,()=>{const t=(Dashboards.components||[]).filter(t=>e.includes(t.type));0!==t.length&&t.forEach(t=>{document.getElementById(t.htmlObject)?"function"==typeof t.update?setTimeout(()=>{try{t.update()}catch(e){console.error(`Error al actualizar "${t.name}":`,e)}},250):console.error(`El componente de Pentaho "${t.name}" no tiene método .update().`):console.warn(`No se encontró el contenedor para el componente "${t.name}" de tipo "${t.type}".`)})},{once:!0})}()}function $t(t,e,o,n,r,a){let i=!1,l=!1;const s=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(s&&s.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")):(s&&s.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?(s&&(s.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),l=!0):(e.classList.remove("blur"),u(),l=!1)}const f=t=>{new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(l||u(),i||(i=!0,window.setTimeout(d,a)))})}).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(s&&(s.setAttribute("sandbox","allow-scripts"),f(s)),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 wt={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=>`${S(t)}€`}}]},Ft=(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;">${b(r)}</span></div>`;return n};function Nt(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 l={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=>Ft(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,o,n,r){const a={},i=r.contentSize[1]/2,l=r.viewSize[1],s=t[1];return s<i?a.top=10:s+i>l?a.bottom=10:a.top=s-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=>b(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=>b(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 l=[];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?j(t,r):t,l.push({...n})}),l})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let s={};s=void 0!==o?j(l,o):l,E(t,s)}function Lt(t){let e={};return e=j(wt,t),e}function Tt(t,e,o={},r={}){let a={};a=j(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"]}},l=null===r?i:j(r,i),s=e;s.forEach((t,e)=>{s[e][0]=n(t[0])}),Nt(t,s,a,l)}function Ot(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=>T(t,!1)},series:[{type:"bar",showBackground:!0}]};let n={};n=void 0!==e?j(o,e):o,E(t,n)}const zt="es_ES",It={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 Pt(t){return Math.max(...t.map(t=>Number(t[0])))}function kt(t){const e=t.filter(e=>Number(e[0])===Pt(t)),o=Array.from({length:12},()=>0);return e.forEach(([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n}),o}function Bt(t){const e=t.filter(e=>Number(e[0])===Pt(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=Pt(e).toString(),r=(Pt(e)-1).toString();Ot(t,j({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:p(It,zt),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:Bt(e)},{name:n,type:"bar",barGap:0,data:kt(e)}]},o))}function qt(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 Wt="id",jt="fecha",Jt="value";function Rt(t,e,o,n,r="es_ES"){const[a,i]=function(t,e,o){const n=[],r=[];return t.forEach(t=>{e.includes(`${t[Wt]}`)?n.push(`${t[jt]}`):o.includes(`${t[Wt]}`)&&r.push(`${t[jt]}`)}),[n.map(t=>[t,0]),r.map(t=>[t,0])]}(t,o,n);let l="es_ES"==r?"Datos sin validar":"Dades sense validar";0===i.length&&(l="");const s={name:"Datos validados",type:"line",data:[...a,i[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",u="";if(0===i.length){const e=t[t.length-1].fecha;c=e,u=e}else c=i[0][0],u=i[i.length-1][0];return[...e,s,{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:l,xAxis:c,yAxis:0},{name:"end",xAxis:u,yAxis:Math.max(...t.filter(t=>null!==t[Jt]).map(t=>parseInt(`${t[Jt]}`,10)))}]]}}]}function Ht(t,e,o=void 0){E(t,j({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=>w(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,{echartTemperatureMitjanaDiaria:()=>i});var t=o(2725);const e={title:{text:""},tooltip:{trigger:"axis",textStyle:{fontFamily:"Montserrat",fontSize:12},formatter:e=>(0,t.formatTooltip)(e,!1,!0," ºC")},legend:{data:[],textStyle:{fontFamily:"Montserrat",fontSize:12}},grid:{left:"0",right:"20",bottom:"60",top:"100",containLabel:!0},toolbox:{feature:{saveAsImage:{title:"Desar"}}},xAxis:[{type:"category",data:[],axisTick:{show:!1},boundaryGap:["20%","20%"],gridIndex:0,offset:0,axisLine:{lineStyle:{color:"#ccc"}},axisLabel:{show:!0,interval:"auto",textStyle:{fontFamily:"Montserrat",fontSize:10,color:"#333"}}}],yAxis:{type:"value",margin:"10",show:!0,axisLabel:{formatter:"{value} ºC",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:"500"}}},series:[],dataZoom:[{show:!0,start:0,end:25,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)"}}}],media:[{query:{minWidth:635},option:{legend:{top:"50"},dataZoom:{end:35}}},{query:{minWidth:890},option:{legend:{top:"5"},dataZoom:{end:50}}},{query:{minWidth:1100},option:{grid:{bottom:"0",top:"50"},dataZoom:{show:!1,end:100}}}]},r=["#FDBCB4","#999999","#FAD6A5"],a="#05668d";function i(o,n){const i="chartTemperatureMitjanaDiaria";!function(t,e,o){!function(t){return t.length>0}(t)?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)}(`#${e}`,`#${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="#ffffff",n.hidden=!1)}(`#${o}`,`#${e}`)}(n.resultset,i,"no_dataTemperatureMitjanaDiaria");const l=(0,t.resultsetWithFields)(n),s=JSON.parse(JSON.stringify(e));s.tooltip.formatter=e.tooltip.formatter;const c=function(t){const e={},o={},n=[],a=function(){const t=[],e=new Date(2024,0,1),o=new Date(2024,11,31);for(let n=e;n<=o;n.setDate(n.getDate()+1)){const e=String(n.getDate()).padStart(2,"0"),o=String(n.getMonth()+1).padStart(2,"0");t.push(`${e}-${o}`)}return t}(),i=r.slice();return t.forEach(t=>{const{dias:r,name:a,value:l}=t;o[r]||(o[r]={}),o[r][a]=l,n.includes(a)||(n.push(a),e[a]={name:a,smooth:!0,symbol:"circle",symbolSize:1,type:"line",data:[],color:i.shift()})}),n.sort(),{seriesMap:e,groupedSerieData:o,legendData:n,xAxisCategories:a}}(l);let{seriesMap:u}=c;const{groupedSerieData:d,legendData:f,xAxisCategories:m}=c,p=f.find(t=>t.includes("pdte.")),h=(y=p)?y.substring(0,4):"";var y;s.legend.data=f,s.xAxis[0].data=m,function(t,e,o,n){t.forEach(t=>{e.forEach(e=>{n[e].data.push(o[t][e]||null)})})}(m,f,d,u),u=function(t,e,o){const n={dotted:{color:a,type:"dotted",width:3,zlevel:4},solid:{color:a,width:3,zlevel:4}},r={...t},i=(t,e)=>{t&&r[t]&&(r[t].lineStyle=e,r[t].itemStyle=e)};return i(e,n.dotted),i(o,n.solid),r}(u,p,h),s.series=Object.values(u),function(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).on("resize",()=>{null!=n&&void 0!==n&&n.resize()})}(i,s)}})(),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.mediAmbient=e():t.mediAmbient=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,{MONTHS_YEAR:()=>r,MONTHS_YEAR_SHORT:()=>a,TEXTS_COMMON:()=>i,THRESHOLDS:()=>At,addPointInteger:()=>b,buildCamarasTrafico:()=>Ft,buildTableCalidadAire:()=>Dt,calculateMaxYAxis:()=>L,calculatePentahoPath:()=>Et,calculateXAxisStart:()=>F,capitalizarTexto:()=>A,checkAllGroupsCollapsed:()=>bt,configureDataBar:()=>q,configureDataGaugeCommon:()=>k,configureDataGaugeMonthCommon:()=>P,configureDataLine:()=>_,configureDataValidate:()=>Ht,configureLinesChartValidates:()=>Vt,convertDateToInteger:()=>g,convertToLanguageSelectorDateRange:()=>ct,convertToTableTreeView:()=>gt,downloadCSVTable:()=>St,downloadPDFTable:()=>vt,formatCellMultiplesLines:()=>pt,formatDayMonthYear:()=>u,formatMilMillionEuros:()=>T,formatMonthAnyo:()=>c,formatName:()=>x,formatNameHeaderColumn:()=>mt,formatRoundTooltip:()=>O,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>d,formatToMillions:()=>S,formatToTons:()=>v,formatTooltip:()=>$,formatTooltipPie:()=>N,formatTrimestre:()=>m,formatWithPrefix:()=>M,getEnvironment:()=>wt,getMaxFieldNumberFromData:()=>R,getMonth:()=>n,getMonthList:()=>p,getSelectCommonOptions:()=>nt,getSelectTwoColumnsOptions:()=>rt,initBarChart:()=>zt,initBarChartComparationMonth:()=>Wt,initChart:()=>E,initContractAllGroups:()=>Mt,initElement:()=>D,initExpandAllGroups:()=>xt,initStackedBarChart:()=>Ot,initStackedBarChartMonthSeries:()=>It,initTable:()=>ft,initValueDefaultDate:()=>lt,initialCalls:()=>$t,loadIframeOnClickEvent:()=>jt,printDataChart:()=>C,printDataInHTMLElements:()=>J,printEchart:()=>I,printNoDataChart:()=>w,resetFilter:()=>ot,resetFilterDate:()=>it,resetFilterDates:()=>at,resetFilterToDefault:()=>ut,resultsetWithFields:()=>W,selectConfigDatasource:()=>tt,selectConfigDatasourceAllValue:()=>et,selectFilterAll:()=>K,selectFilterNumItemsDefault:()=>dt,selectValueDefaultInFilter:()=>st,separateDayMonthYearToSlash:()=>l,splitDataset:()=>H,subtractOneDay:()=>h,subtractOneMonth:()=>y,traverseRows:()=>yt,updateDomElement:()=>G,updateObject:()=>j,updateStackedBarOptions:()=>Tt});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)]}const r={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"]])},a={es_ES:new Map([["1","Ene"],["2","Feb"],["3","Mar"],["4","Abr"],["5","May"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Sep"],["10","Oct"],["11","Nov"],["12","Dic"]]),ca_ES:new Map([["1","Gen"],["2","Feb"],["3","Mar"],["4","Abr"],["5","Mai"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Set"],["10","Oct"],["11","Nov"],["12","Des"]])},i={es_ES:new Map([["last_update","Última actualización"]]),ca_ES:new Map([["last_update","Última actualització"]])};function l(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function s(t){return[t.substring(0,4),o[t.substring(4,6)]]}function c(t){const[e,o]=s(t);return`${o} ${e}`}function u(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 d(t){const[e,o]=s(t);return`${o.substring(0,3)} ${e}`}function f(t){const[e,o]=s(t);return`${o.substring(0,3)} '${e.substring(2,4)}`}function m(t){const[e,o]=t.split("-");return`${parseFloat(o)/3}T ${e}`}function p(t,e){const o=t[e];return Array.from(o.values()).map(t=>t.slice(0,3))}function h(t){const e=Math.floor(t/1e4),o=new Date(e,t%1e4/100-1,t%100);return o.setDate(o.getDate()-1),`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}${o.getDate().toString().padStart(2,"0")}`}function y(t){let e;const o=new Date(Math.floor(t/100),t%100-1,0);return e=`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}`,e}function g(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function b(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 S(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function v(t){return t>=1e3?t/1e3+" Tn":t.toString()}function M(t){let e,o;return t>=1e6?(e=t/1e6,o="G"):t>=1e3?(e=t/1e3,o="M"):(e=t,o="k"),{value:Math.round(100*e)/100,prefix:o}}function x(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 A(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,o)=>e+o[0].toUpperCase())}function D(t,e,o="MainContentLoadedCustom"){let n=document.getElementById(t);return n?Promise.resolve(e(n)):new Promise(r=>{document.body.addEventListener(o,()=>{n=document.getElementById(t),n?r(e(n)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),r(null))})})}function E(t,e){return D(t,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})}function w(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 C(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 $(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;">${l=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${l}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${b(a)} ${n}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${b(a)} ${n}`:"-"}\n </span>\n </div>`;var l;r+=i}),r}function F(t){return 100*(t-120)/t}function L(t,e){const o=Math.max(...t);return o+(e-o%e)}function N(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}%`:b(t.value);return`<div> ${o} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${n} </span></div>`}function O(t,e){let o=`${t.name} : `;return o+=`<span style="font-weight:500">${b(Math.round(t.value))}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),t.marker+o}function T(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${b(o)} €`:o>=e?`${b(o/e)} M €`:"-"}function I(t,e,o){return 0===t.length?(w(`#${e}`,`#${o}`),!1):(C(`#${o}`,`#${e}`),!0)}function z(t,e,o=1){const n=Math.max(...t.map(t=>t[e]))*o;return 5e3*Math.ceil(n/5e3)}function k(t,e,o,n=30,r=15,a=30,i=-70,l=70,s=3){const c=z(t,e.data,1.1),u=l,d=o.slice(),f=[];let m=r,p=a,h=i;for(let o=0;o<t.length;o+=1)f.push({value:t[o][e.data],name:x(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(h)}%`,`${String(m)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(h)}%`,`${String(p)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>b(Math.round(t))}}),h+=u,(o+1)%s===0&&(p+=a,m+=2*r,h=i);return[c,f]}function P(t,e,o,r=0){return[z(e,o.data,1),t=>function(t,e,o){const r=b(Math.round(e)),a=n(t[o][0]),i=t[o][1],l=`\n${a} ${i} : ${r}`,s=`${r}\n${a} ${i}`;return window.innerWidth<=1710?l:s}(e,t,r),[{value:e[r][o.data]}]]}function B(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()),l=Array.from(n.values());return l.sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0})),[l.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}}),l,r]}function _(t,e=[],o=!1){const[n,r,a]=B(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 q(t,e,o=!1){const[n,r,a]=B(t,o);return n.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[n,a,r]}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 j(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]=j(t[n]||{},e[n]))}),o}function J(t,e){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 R(t,e){const o=W(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 G(t,e){const o=document.querySelector(t);o?o.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function H(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 V=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Y=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],U=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],Z=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],X=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function K(t){const e=t.resultset.map(t=>t[0]);return this.dashboard.fireChange(this.parameter,e),t}function Q(t){for(const e of t)if(Array.isArray(e)){if(!Q(e))return!1}else if("All"!==e)return!1;return!0}function tt(t,e,o,n){return Q(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function et(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function ot(t){t.forEach(t=>{Dashboards.fireChange(t,["All"])})}function nt(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 rt(t="Todos"){const e=nt(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function at(t,e,o,n){const r=Dashboards.getParameterValue(o),a=Dashboards.getParameterValue(n);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[a]),!0}function it(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function lt(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function st(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;""!==o&&t.dashboard.setParameter(n,[o])}function ct(t){t.regional.es={monthNames:V,abbreviatedMonthNames:Y,dayNames:U,abbreviatedDayNames:Z,dayNamesMin:X,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function ut(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(o)?o:[o]),!0}function dt(t,e,o,n=0){const r=t.resultset.slice(0,o).map(t=>t[n]);return Dashboards.setParameter(e,r),t}function ft(t,e){return D(t,t=>new Tabulator(t,e))}function mt(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function pt(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 ht(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach(t=>{t.getTreeChildren().length>0&&ht(t,e)})}function yt(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&ht(t,e)})}function gt(t,e,o,n){const r=[];return Object.keys(t).forEach(a=>{if(Object.prototype.hasOwnProperty.call(t,a)){const i=t[a],l={[e]:i[0],_children:[]};i.shift(),i.forEach((t,r)=>{const a={[e]:o[r],[n]:t};l._children.push(a)}),r.push(l)}}),r}function bt(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:";",bom:!0})})}function vt(t,e,o){const n=document.getElementById(o),r=n.cloneNode(!0);n.parentNode.replaceChild(r,n),r.addEventListener("click",()=>{const o=t.getRows().map(t=>t.getData()),n=t.getColumns(),r={};n.forEach((t,e)=>{const n=t.getField();n&&o.every(t=>{const e=t[n];return null==e||/^-?\d+([.,]\d+)?$/.test(e.toString().trim())})&&(r[e]={halign:"right"})}),t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8,lineWidth:.1,lineColor:[200,200,200]},headStyles:{halign:"center"},columnStyles:r}})})}function Mt(t,e,o){const n=document.getElementById(o);n&&n.addEventListener("click",()=>{t.setGroupStartOpen(!1),t.setData(e)})}function xt(t,e,o){const n=document.getElementById(o);n&&n.addEventListener("click",()=>{t.setGroupStartOpen(!0),t.setData(e)})}const At={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");const r=document.createElement("tr"),a=document.createElement("td");a.innerHTML=o.address,r.appendChild(a),r.appendChild(n(`${o.entityid}_so2`,o.so2value,At.SO2)),r.appendChild(n(`${o.entityid}_no2`,o.no2value,At.NO2)),r.appendChild(n(`${o.entityid}_o3`,o.o3value,At.O3)),r.appendChild(n(`${o.entityid}_pm10`,o.pm10value,At.PM10)),r.appendChild(n(`${o.entityid}_pm25`,o.pm25value,At.PM25)),e.push(r)}),e}function Et(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 wt(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function Ct(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 $t(t){window.realDashboardsInit=Dashboards.init,Dashboards.init=function(){console.warn("Dashboards.init bloqueado temporalmente")},Ct("include-html-cabecera",function(){!function(){const t=wt();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=wt();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()}),Ct("include-html-menu"),Ct("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()}),Ct("include-html-copyright"),function(t="MainContentLoadedCustom"){document.body.addEventListener(t,()=>{try{Dashboards.init=window.realDashboardsInit,Dashboards.init()}catch(t){console.warn("No se pudo restaurar Dashboards.init; la función original no está disponible.")}},{once:!0})}()}function Ft(t,e,o,n,r,a){let i=!1,l=!1;const s=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(s&&s.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")):(s&&s.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?(s&&(s.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),l=!0):(e.classList.remove("blur"),u(),l=!1)}const f=t=>{new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(l||u(),i||(i=!0,window.setTimeout(d,a)))})}).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(s&&(s.setAttribute("sandbox","allow-scripts"),f(s)),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 Lt={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=>`${S(t)}€`}}]},Nt=(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;">${b(r)}</span></div>`;return n};function Ot(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 l={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=>Nt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,o,n,r){const a={},i=r.contentSize[1]/2,l=r.viewSize[1],s=t[1];return s<i?a.top=10:s+i>l?a.bottom=10:a.top=s-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=>b(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=>b(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 l=[];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?j(t,r):t,l.push({...n})}),l})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let s={};s=void 0!==o?j(l,o):l,E(t,s)}function Tt(t){let e={};return e=j(Lt,t),e}function It(t,e,o={},r={}){let a={};a=j(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"]}},l=null===r?i:j(r,i),s=e;s.forEach((t,e)=>{s[e][0]=n(t[0])}),Ot(t,s,a,l)}function zt(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=>O(t,!1)},series:[{type:"bar",showBackground:!0}]};let n={};n=void 0!==e?j(o,e):o,E(t,n)}const kt="es_ES",Pt={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 Bt(t){return Math.max(...t.map(t=>Number(t[0])))}function _t(t){const e=t.filter(e=>Number(e[0])===Bt(t)),o=Array.from({length:12},()=>0);return e.forEach(([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n}),o}function qt(t){const e=t.filter(e=>Number(e[0])===Bt(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 Wt(t,e,o=void 0){const n=Bt(e).toString(),r=(Bt(e)-1).toString();zt(t,j({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:p(Pt,kt),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:qt(e)},{name:n,type:"bar",barGap:0,data:_t(e)}]},o))}function jt(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 Jt="id",Rt="fecha",Gt="value";function Ht(t,e,o,n,r="es_ES"){const[a,i]=function(t,e,o){const n=[],r=[];return t.forEach(t=>{e.includes(`${t[Jt]}`)?n.push(`${t[Rt]}`):o.includes(`${t[Jt]}`)&&r.push(`${t[Rt]}`)}),[n.map(t=>[t,0]),r.map(t=>[t,0])]}(t,o,n);let l="es_ES"==r?"Datos sin validar":"Dades sense validar";0===i.length&&(l="");const s={name:"Datos validados",type:"line",data:[...a,i[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",u="";if(0===i.length){const e=t[t.length-1].fecha;c=e,u=e}else c=i[0][0],u=i[i.length-1][0];return[...e,s,{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:l,xAxis:c,yAxis:0},{name:"end",xAxis:u,yAxis:Math.max(...t.filter(t=>null!==t[Gt]).map(t=>parseInt(`${t[Gt]}`,10)))}]]}}]}function Vt(t,e,o=void 0){E(t,j({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=>$(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,{echartTemperatureMitjanaDiaria:()=>i});var t=o(2725);const e={title:{text:""},tooltip:{trigger:"axis",textStyle:{fontFamily:"Montserrat",fontSize:12},formatter:e=>(0,t.formatTooltip)(e,!1,!0," ºC")},legend:{data:[],textStyle:{fontFamily:"Montserrat",fontSize:12}},grid:{left:"0",right:"20",bottom:"60",top:"100",containLabel:!0},toolbox:{feature:{saveAsImage:{title:"Desar"}}},xAxis:[{type:"category",data:[],axisTick:{show:!1},boundaryGap:["20%","20%"],gridIndex:0,offset:0,axisLine:{lineStyle:{color:"#ccc"}},axisLabel:{show:!0,interval:"auto",textStyle:{fontFamily:"Montserrat",fontSize:10,color:"#333"}}}],yAxis:{type:"value",margin:"10",show:!0,axisLabel:{formatter:"{value} ºC",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:"500"}}},series:[],dataZoom:[{show:!0,start:0,end:25,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)"}}}],media:[{query:{minWidth:635},option:{legend:{top:"50"},dataZoom:{end:35}}},{query:{minWidth:890},option:{legend:{top:"5"},dataZoom:{end:50}}},{query:{minWidth:1100},option:{grid:{bottom:"0",top:"50"},dataZoom:{show:!1,end:100}}}]},r=["#FDBCB4","#999999","#FAD6A5"],a="#05668d";function i(o,n){const i="chartTemperatureMitjanaDiaria";!function(t,e,o){!function(t){return t.length>0}(t)?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)}(`#${e}`,`#${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="#ffffff",n.hidden=!1)}(`#${o}`,`#${e}`)}(n.resultset,i,"no_dataTemperatureMitjanaDiaria");const l=(0,t.resultsetWithFields)(n),s=JSON.parse(JSON.stringify(e));s.tooltip.formatter=e.tooltip.formatter;const c=function(t){const e={},o={},n=[],a=function(){const t=[],e=new Date(2024,0,1),o=new Date(2024,11,31);for(let n=e;n<=o;n.setDate(n.getDate()+1)){const e=String(n.getDate()).padStart(2,"0"),o=String(n.getMonth()+1).padStart(2,"0");t.push(`${e}-${o}`)}return t}(),i=r.slice();return t.forEach(t=>{const{dias:r,name:a,value:l}=t;o[r]||(o[r]={}),o[r][a]=l,n.includes(a)||(n.push(a),e[a]={name:a,smooth:!0,symbol:"circle",symbolSize:1,type:"line",data:[],color:i.shift()})}),n.sort(),{seriesMap:e,groupedSerieData:o,legendData:n,xAxisCategories:a}}(l);let{seriesMap:u}=c;const{groupedSerieData:d,legendData:f,xAxisCategories:m}=c,p=f.find(t=>t.includes("pdte.")),h=(y=p)?y.substring(0,4):"";var y;s.legend.data=f,s.xAxis[0].data=m,function(t,e,o,n){t.forEach(t=>{e.forEach(e=>{n[e].data.push(o[t][e]||null)})})}(m,f,d,u),u=function(t,e,o){const n={dotted:{color:a,type:"dotted",width:3,zlevel:4},solid:{color:a,width:3,zlevel:4}},r={...t},i=(t,e)=>{t&&r[t]&&(r[t].lineStyle=e,r[t].itemStyle=e)};return i(e,n.dotted),i(o,n.solid),r}(u,p,h),s.series=Object.values(u),function(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).on("resize",()=>{null!=n&&void 0!==n&&n.resize()})}(i,s)}})(),n})());
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,{MONTHS_YEAR:()=>o,MONTHS_YEAR_SHORT:()=>r,TEXTS_COMMON:()=>s,THRESHOLDS:()=>Et,addPointInteger:()=>g,buildCamarasTrafico:()=>$t,buildTableCalidadAire:()=>Dt,calculateMaxYAxis:()=>C,calculatePentahoPath:()=>Mt,calculateXAxisStart:()=>T,capitalizarTexto:()=>M,checkAllGroupsCollapsed:()=>gt,configureDataBar:()=>B,configureDataGaugeCommon:()=>P,configureDataGaugeMonthCommon:()=>k,configureDataLine:()=>_,configureDataValidate:()=>Yt,configureLinesChartValidates:()=>Wt,convertDateToInteger:()=>S,convertToLanguageSelectorDateRange:()=>ct,convertToTableTreeView:()=>St,downloadCSVTable:()=>yt,downloadPDFTable:()=>bt,formatCellMultiplesLines:()=>mt,formatDayMonthYear:()=>d,formatMilMillionEuros:()=>O,formatMonthAnyo:()=>c,formatName:()=>D,formatNameHeaderColumn:()=>ht,formatRoundTooltip:()=>w,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>u,formatToMillions:()=>y,formatToTons:()=>b,formatTooltip:()=>N,formatTooltipPie:()=>L,formatTrimestre:()=>h,formatWithPrefix:()=>E,getEnvironment:()=>It,getMaxFieldNumberFromData:()=>Y,getMonth:()=>a,getMonthList:()=>m,getSelectCommonOptions:()=>at,getSelectTwoColumnsOptions:()=>ot,initBarChart:()=>Ot,initBarChartComparationMonth:()=>_t,initChart:()=>x,initElement:()=>I,initStackedBarChart:()=>Ct,initStackedBarChartMonthSeries:()=>wt,initTable:()=>ft,initValueDefaultDate:()=>it,initialCalls:()=>vt,loadIframeOnClickEvent:()=>Bt,printDataChart:()=>$,printDataInHTMLElements:()=>V,printEchart:()=>F,printNoDataChart:()=>v,resetFilter:()=>nt,resetFilterDate:()=>st,resetFilterDates:()=>rt,resetFilterToDefault:()=>dt,resultsetWithFields:()=>G,selectConfigDatasource:()=>tt,selectConfigDatasourceAllValue:()=>et,selectFilterAll:()=>Q,selectFilterNumItemsDefault:()=>ut,selectValueDefaultInFilter:()=>lt,separateDayMonthYearToSlash:()=>i,splitDataset:()=>q,subtractOneDay:()=>p,subtractOneMonth:()=>A,traverseRows:()=>At,updateDomElement:()=>W,updateObject:()=>U,updateStackedBarOptions:()=>Lt});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)]}const o={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"]])},r={es_ES:new Map([["1","Ene"],["2","Feb"],["3","Mar"],["4","Abr"],["5","May"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Sep"],["10","Oct"],["11","Nov"],["12","Dic"]]),ca_ES:new Map([["1","Gen"],["2","Feb"],["3","Mar"],["4","Abr"],["5","Mai"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Set"],["10","Oct"],["11","Nov"],["12","Des"]])},s={es_ES:new Map([["last_update","Última actualización"]]),ca_ES:new Map([["last_update","Última actualització"]])};function i(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function l(t){return[t.substring(0,4),n[t.substring(4,6)]]}function c(t){const[e,n]=l(t);return`${n} ${e}`}function d(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 u(t){const[e,n]=l(t);return`${n.substring(0,3)} ${e}`}function f(t){const[e,n]=l(t);return`${n.substring(0,3)} '${e.substring(2,4)}`}function h(t){const[e,n]=t.split("-");return`${parseFloat(n)/3}T ${e}`}function m(t,e){const n=t[e];return Array.from(n.values()).map(t=>t.slice(0,3))}function p(t){const e=Math.floor(t/1e4),n=new Date(e,t%1e4/100-1,t%100);return n.setDate(n.getDate()-1),`${n.getFullYear()}${(n.getMonth()+1).toString().padStart(2,"0")}${n.getDate().toString().padStart(2,"0")}`}function A(t){let e;const n=new Date(Math.floor(t/100),t%100-1,0);return e=`${n.getFullYear()}${(n.getMonth()+1).toString().padStart(2,"0")}`,e}function S(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function g(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 y(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function b(t){return t>=1e3?t/1e3+" Tn":t.toString()}function E(t){let e,n;return t>=1e6?(e=t/1e6,n="G"):t>=1e3?(e=t/1e3,n="M"):(e=t,n="k"),{value:Math.round(100*e)/100,prefix:n}}function D(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 M(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,n)=>e+n[0].toUpperCase())}function I(t,e,n="MainContentLoadedCustom"){let a=document.getElementById(t);return a?Promise.resolve(e(a)):new Promise(o=>{document.body.addEventListener(n,()=>{a=document.getElementById(t),a?o(e(a)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),o(null))})})}function x(t,e){return I(t,t=>{const n=echarts.init(t);n.setOption(e,!0),window.addEventListener("resize",()=>{null!=n&&void 0!==n&&n.resize()});const a=document.getElementById("main-content");return a&&(a.addEventListener("shown.bs.collapse",()=>{n.resize()}),a.addEventListener("hidden.bs.collapse",()=>{n.resize()})),n})}function v(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 $(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 N(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,s=n?`<div style="font-weight: 400;color: #666;">${i=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${i}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${g(r)} ${a}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${g(r)} ${a}`:"-"}\n </span>\n </div>`;var i;o+=s}),o}function T(t){return 100*(t-120)/t}function C(t,e){const n=Math.max(...t);return n+(e-n%e)}function L(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}%`:g(t.value);return`<div> ${n} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${a} </span></div>`}function w(t,e){let n=`${t.name} : `;return n+=`<span style="font-weight:500">${g(Math.round(t.value))}</span>`,e&&(n+=`<span> (${t.percent}%)</span>`),t.marker+n}function O(t){const e=1e6,n=Number(t);return n>=0&&n<e?`${g(n)} €`:n>=e?`${g(n/e)} M €`:"-"}function F(t,e,n){return 0===t.length?(v(`#${e}`,`#${n}`),!1):($(`#${n}`,`#${e}`),!0)}function R(t,e,n=1){const a=Math.max(...t.map(t=>t[e]))*n;return 5e3*Math.ceil(a/5e3)}function P(t,e,n,a=30,o=15,r=30,s=-70,i=70,l=3){const c=R(t,e.data,1.1),d=i,u=n.slice(),f=[];let h=o,m=r,p=s;for(let n=0;n<t.length;n+=1)f.push({value:t[n][e.data],name:D(String(t[n][e.type]).replace(/\[.*?\]/g,"")),color:u.shift(),title:{offsetCenter:[`${String(p)}%`,`${String(h)}%`],fontFamily:"Montserrat",fontSize:a},detail:{offsetCenter:[`${String(p)}%`,`${String(m)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>g(Math.round(t))}}),p+=d,(n+1)%l===0&&(m+=r,h+=2*o,p=s);return[c,f]}function k(t,e,n,o=0){return[R(e,n.data,1),t=>function(t,e,n){const o=g(Math.round(e)),r=a(t[n][0]),s=t[n][1],i=`\n${r} ${s} : ${o}`,l=`${o}\n${r} ${s}`;return window.innerWidth<=1710?i:l}(e,t,o),[{value:e[o][n.data]}]]}function z(t,e){const{resultset:n}={resultset:t},a=new Set,o=new Set,r=n.map(([t,n,r])=>{const s=e?Math.round(r):r;return a.add(t),o.add(n),{day:n,type:t,value:s}}),s=Array.from(o.values()),i=Array.from(a.values());return i.sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0})),[i.map(t=>{const e=r.filter(e=>e.type===t).map(({day:e,value:n})=>[e,t,n]),n=s.map(t=>{const n=e.find(([e])=>e===t);return n?n[2]:null});return{name:t,data:n}}),i,o]}function _(t,e=[],n=!1){const[a,o,r]=z(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 B(t,e,n=!1){const[a,o,r]=z(t,n);return a.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[a,r,o]}function G(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 U(t,e){const n={...t};return Object.keys(e).forEach(a=>{Object.prototype.hasOwnProperty.call(e,a)&&("series"===a&&Array.isArray(e[a])?n[a]=e[a].map((e,n)=>({...Array.isArray(t[a])&&t[a][n]||{},...e})):"object"!=typeof e[a]||null===e[a]||Array.isArray(e[a])?t[a]!==e[a]&&(n[a]=e[a]):n[a]=U(t[a]||{},e[a]))}),n}function V(t,e){const n=()=>{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]})})};try{n()}catch(t){document.body.addEventListener("MainContentLoadedCustom",()=>{n()})}}function Y(t,e){const n=G(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 W(t,e){const n=document.querySelector(t);n?n.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function q(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 J=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],j=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],H=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],X=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],Z=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function Q(t){const e=t.resultset.map(t=>t[0]);return this.dashboard.fireChange(this.parameter,e),t}function K(t){for(const e of t)if(Array.isArray(e)){if(!K(e))return!1}else if("All"!==e)return!1;return!0}function tt(t,e,n,a){return K(e)?(t.queryDefinition.dataAccessId=n,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=a,!0}function et(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function nt(t){t.forEach(t=>{Dashboards.fireChange(t,["All"])})}function at(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 ot(t="Todos"){const e=at(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function rt(t,e,n,a){const o=Dashboards.getParameterValue(n),r=Dashboards.getParameterValue(a);return Dashboards.fireChange(t,[o]),Dashboards.fireChange(e,[r]),!0}function st(t,e){const n=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[n]),!0}function it(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function lt(t,e){const n=Dashboards.getParameterValue(e),a=t.parameter;""!==n&&t.dashboard.setParameter(a,[n])}function ct(t){t.regional.es={monthNames:J,abbreviatedMonthNames:j,dayNames:H,abbreviatedDayNames:X,dayNamesMin:Z,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function dt(t,e){const n=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(n)?n:[n]),!0}function ut(t,e,n,a=0){const o=t.resultset.slice(0,n).map(t=>t[a]);return Dashboards.setParameter(e,o),t}function ft(t,e){return I(t,t=>new Tabulator(t,e))}function ht(t,e){let n=t.getValue();return n.length>e&&(n=`${n.substr(0,e)}<br>${n.substr(e)}`),n}function mt(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 pt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const n=t.getTreeChildren();n.length>0&&n.forEach(t=>{t.getTreeChildren().length>0&&pt(t,e)})}function At(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&pt(t,e)})}function St(t,e,n,a){const o=[];for(const r in t)if(t.hasOwnProperty(r)){const s=t[r],i={[e]:s[0],_children:[]};s.shift(),s.forEach((t,o)=>{const r={[e]:n[o],[a]:t};i._children.push(r)}),o.push(i)}return o}function gt(t){let e=!0;return t.getGroups().forEach(t=>{t._group.visible&&(e=!1)}),e}function yt(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 bt(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 Et={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=[],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");const o=document.createElement("tr"),r=document.createElement("td");r.innerHTML=n.address,o.appendChild(r),o.appendChild(a(`${n.entityid}_so2`,n.so2value,Et.SO2)),o.appendChild(a(`${n.entityid}_no2`,n.no2value,Et.NO2)),o.appendChild(a(`${n.entityid}_o3`,n.o3value,Et.O3)),o.appendChild(a(`${n.entityid}_pm10`,n.pm10value,Et.PM10)),o.appendChild(a(`${n.entityid}_pm25`,n.pm25value,Et.PM25)),e.push(o)}),e}function Mt(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 It(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function xt(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 vt(t){xt("include-html-cabecera",function(){!function(){const t=It();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=It();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()}),xt("include-html-menu"),xt("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()}),xt("include-html-copyright"),function(t="MainContentLoadedCustom"){let e=["FilterComponent","buttonComponent"];const n=document.body.getAttribute("update-component-types");n&&(e=n.split(",").map(t=>t.trim())),document.body.addEventListener(t,()=>{const t=(Dashboards.components||[]).filter(t=>e.includes(t.type));0!==t.length&&t.forEach(t=>{document.getElementById(t.htmlObject)?"function"==typeof t.update?setTimeout(()=>{try{t.update()}catch(e){console.error(`Error al actualizar "${t.name}":`,e)}},250):console.error(`El componente de Pentaho "${t.name}" no tiene método .update().`):console.warn(`No se encontró el contenedor para el componente "${t.name}" de tipo "${t.type}".`)})},{once:!0})}()}function $t(t,e,n,a,o,r){let s=!1,i=!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"),i=!0):(e.classList.remove("blur"),d(),i=!1)}const f=t=>{new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(i||d(),s||(s=!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 Nt={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=>`${y(t)}€`}}]},Tt=(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;">${g(o)}</span></div>`;return a};function Ct(t,e,n=void 0,a=void 0){const o=null===a?void 0:a,r=new Set(e.map(t=>t[1]));let s;const i={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=>Tt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,n,a,o){const r={},s=o.contentSize[1]/2,i=o.viewSize[1],l=t[1];return l<s?r.top=10:l+s>i?r.bottom=10:r.top=l-s,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=>g(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=>g(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};o&&o.itemStyle&&Array.isArray(o.itemStyle.borderColor)&&(s=[...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 i=[];return Object.keys(n).forEach(e=>{s&&(t.itemStyle={borderColor:s.shift()}),t.name=e,t.data=n[e].map(t=>t[2]);let a={};a=void 0!==o?U(t,o):t,i.push({...a})}),i})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let l={};l=void 0!==n?U(i,n):i,x(t,l)}function Lt(t){let e={};return e=U(Nt,t),e}function wt(t,e,n={},o={}){let r={};r=U(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 s={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},i=null===o?s:U(o,s),l=e;l.forEach((t,e)=>{l[e][0]=a(t[0])}),Ct(t,l,r,i)}function Ot(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=>w(t,!1)},series:[{type:"bar",showBackground:!0}]};let a={};a=void 0!==e?U(n,e):n,x(t,a)}const Ft="es_ES",Rt={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 Pt(t){return Math.max(...t.map(t=>Number(t[0])))}function kt(t){const e=t.filter(e=>Number(e[0])===Pt(t)),n=Array.from({length:12},()=>0);return e.forEach(([t,e,a])=>{const o=parseInt(e,10)-1;n[o]=a}),n}function zt(t){const e=t.filter(e=>Number(e[0])===Pt(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 _t(t,e,n=void 0){const a=Pt(e).toString(),o=(Pt(e)-1).toString();Ot(t,U({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:m(Rt,Ft),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:zt(e)},{name:a,type:"bar",barGap:0,data:kt(e)}]},n))}function Bt(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 Gt="id",Ut="fecha",Vt="value";function Yt(t,e,n,a,o="es_ES"){const[r,s]=function(t,e,n){const a=[],o=[];return t.forEach(t=>{e.includes(`${t[Gt]}`)?a.push(`${t[Ut]}`):n.includes(`${t[Gt]}`)&&o.push(`${t[Ut]}`)}),[a.map(t=>[t,0]),o.map(t=>[t,0])]}(t,n,a);let i="es_ES"==o?"Datos sin validar":"Dades sense validar";0===s.length&&(i="");const l={name:"Datos validados",type:"line",data:[...r,s[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",d="";if(0===s.length){const e=t[t.length-1].fecha;c=e,d=e}else c=s[0][0],d=s[s.length-1][0];return[...e,l,{name:"Datos NO validados",type:"line",data:s,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:c,yAxis:0},{name:"end",xAxis:d,yAxis:Math.max(...t.filter(t=>null!==t[Vt]).map(t=>parseInt(`${t[Vt]}`,10)))}]]}}]}function Wt(t,e,n=void 0){x(t,U({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=>N(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%",s="20%",i="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,M=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 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:M||t,selected:D}:null,grid:{left:e,right:o,bottom:r,top:a?M?"30%":s:i,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: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,s=[];t.forEach(t=>{const e=t[0].toString().padStart(2,"0");r.add(`${e}/${t[1]}`),s.push(Math.round(t[2]))});const i=s.length<100?40:80;return y({name:o,type:"bar",smooth:!1,barMaxWidth:40,itemStyle:{color:"#5470c6"},textStyle:{fontFamily:"Montserrat"},data:s},null,Array.from(r.values()),e,i,!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,s=115===r?-45:-35;let i=t.length<5?t.length*s:-190;for(let e=0;e<t.length;e+=1)a.push({value:t[e][1],name:String(t[e][0]),title:{offsetCenter:[String(i),"20%"],fontFamily:"Montserrat"},detail:{offsetCenter:[String(i),"35%"],fontFamily:"Montserrat"}}),i+=r;return E(e,o,a,n)}function M(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 s=t[n][1],i=`\n\n\n${o} ${s} : ${a}`,l=`${a}\n${o} ${s}`;return window.innerWidth<=1710?i: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 I(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=[],s=1130,i=1124,l=1122;t.forEach(t=>{t[0]===s&&(n.add(t[1]),a.push(t[2])),t[0]===l&&(n.add(t[1]),r.push(t[2])),t[0]===i&&(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");I("chartInstanciesDonadesAlta",p),I("chartAdministrativesRealitzades",m),I("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),s=35;I("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,s,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),s=40;I("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,s,void 0,"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: EVOLUCIÓ DIÀRIA"))}}const C=0,L=1,w=2,O=3,F=4,R=1130,P=1124,k=1122,z=1143,_=1139;function B(t){const e=[],n=[],a=[],o=[],r=[];return t.forEach(t=>{t[0]===R?a.push([t[1],t[2],t[3]]):t[0]===k?e.push([t[1],t[2],t[3]]):t[0]===P?n.push([t[1],t[2],t[3]]):t[0]===z?o.push([t[1],t[2],t[3]]):t[0]===_&&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=B(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"),s=b(t[O],"Resolucions",n,"RESOLUCIONS PIAE ASSENTADES: EVOLUCIÓ MENSUAL"),i=b(t[F],"Notificacions",n+15,"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: EVOLUCIÓ MENSUAL");I("chartInstanciesDonadesAltaBarMonth",a),I("chartExpDonadesAltaBarMonth",o),I("chartAdministrativesDonadesAltaBarMonth",r),I("chartResDonadesAltaBarMonth",s),I("chartNotificacionsDonadesAltaBarMonth",i)}}var V=n(2725);function Y(t,e){if(0===e.resultset.length)G("StackedBarYears");else{G("StackedBarYears");const t=B(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 s={title:{text:"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nNotificacions"}};(0,V.initStackedBarChartMonthSeries)("chartNotificacionsDonadesAltaStackedBarYears",t[F],s)}}function W(t,e){if(0===e.resultset.length)G("GaugeMonth");else{G("GaugeMonth");const t=0,n=1,a=B(e.resultset),o=g("chartInstanciesDonadesAltaGaugeMonth"),r=M(a[C],t,"INSTÀNCIES PIAE DONADES D'ALTA: MES ACTUAL",o),s=M(a[L],t,"EXPEDIENTS PIAE DONADES D'ALTA: MES ACTUAL",o),i=M(a[w],t,"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: MES ACTUAL",o),l=M(a[O],t,"RESOLUCIONS PIAE ASSENTADES: MES ACTUAL",o),c=M(a[F],t,"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: MES ACTUAL",o);I("chartInstanciesDonadesAltaGaugeMonth",r),I("chartExpDonadesAltaGaugeMonth",s),I("chartAdministrativesDonadesAltaGaugeMonth",i),I("chartResDonadesAltaGaugeMonth",l),I("chartNotificacionsDonadesAltaGaugeMonth",c);const d=M(a[C],n,"INSTÀNCIES PIAE DONADES D'ALTA: MES ANTERIOR",o),u=M(a[L],n,"EXPEDIENTS PIAE DONADES D'ALTA: MES ANTERIOR",o),f=M(a[w],n,"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: MES ANTERIOR",o),h=M(a[O],n,"RESOLUCIONS PIAE ASSENTADES: MES ANTERIOR",o),m=M(a[F],n,"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: MES ANTERIOR",o);I("chartInstanciesDonadesAltaGaugeLastMonth",d),I("chartExpDonadesAltaGaugeLastMonth",u),I("chartAdministrativesDonadesAltaGaugeLastMonth",f),I("chartResDonadesAltaGaugeLastMonth",h),I("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]===R?a.push([t[1],t[2]]):t[0]===k?e.push([t[1],t[2]]):t[0]===P?n.push([t[1],t[2]]):t[0]===z?r.push([t[1],t[2]]):t[0]===_&&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),s=D(t[O],"RESOLUCIONS PIAE ASSENTADES: ÚLTIMS ANYS",n),i=D(t[F],"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: ÚLTIMS ANYS",n);I("chartInstanciesDonadesAltaGaugeYear",a),I("chartExpDonadesAltaGaugeYear",o),I("chartAdministrativesDonadesAltaGaugeYear",r),I("chartResDonadesAltaGaugeYear",s),I("chartNotificacionsDonadesAltaGaugeYear",i)}}})(),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,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,{MONTHS_YEAR:()=>o,MONTHS_YEAR_SHORT:()=>r,TEXTS_COMMON:()=>i,THRESHOLDS:()=>Mt,addPointInteger:()=>g,buildCamarasTrafico:()=>Tt,buildTableCalidadAire:()=>It,calculateMaxYAxis:()=>C,calculatePentahoPath:()=>xt,calculateXAxisStart:()=>T,capitalizarTexto:()=>M,checkAllGroupsCollapsed:()=>gt,configureDataBar:()=>_,configureDataGaugeCommon:()=>k,configureDataGaugeMonthCommon:()=>P,configureDataLine:()=>B,configureDataValidate:()=>qt,configureLinesChartValidates:()=>Jt,convertDateToInteger:()=>S,convertToLanguageSelectorDateRange:()=>ct,convertToTableTreeView:()=>St,downloadCSVTable:()=>yt,downloadPDFTable:()=>bt,formatCellMultiplesLines:()=>mt,formatDayMonthYear:()=>d,formatMilMillionEuros:()=>O,formatMonthAnyo:()=>c,formatName:()=>D,formatNameHeaderColumn:()=>ht,formatRoundTooltip:()=>L,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>u,formatToMillions:()=>y,formatToTons:()=>b,formatTooltip:()=>$,formatTooltipPie:()=>w,formatTrimestre:()=>h,formatWithPrefix:()=>E,getEnvironment:()=>vt,getMaxFieldNumberFromData:()=>Y,getMonth:()=>a,getMonthList:()=>m,getSelectCommonOptions:()=>at,getSelectTwoColumnsOptions:()=>ot,initBarChart:()=>Rt,initBarChartComparationMonth:()=>Gt,initChart:()=>x,initContractAllGroups:()=>Et,initElement:()=>I,initExpandAllGroups:()=>Dt,initStackedBarChart:()=>Lt,initStackedBarChartMonthSeries:()=>Ft,initTable:()=>ft,initValueDefaultDate:()=>st,initialCalls:()=>$t,loadIframeOnClickEvent:()=>Ut,printDataChart:()=>N,printDataInHTMLElements:()=>V,printEchart:()=>F,printNoDataChart:()=>v,resetFilter:()=>nt,resetFilterDate:()=>it,resetFilterDates:()=>rt,resetFilterToDefault:()=>dt,resultsetWithFields:()=>G,selectConfigDatasource:()=>tt,selectConfigDatasourceAllValue:()=>et,selectFilterAll:()=>Q,selectFilterNumItemsDefault:()=>ut,selectValueDefaultInFilter:()=>lt,separateDayMonthYearToSlash:()=>s,splitDataset:()=>q,subtractOneDay:()=>p,subtractOneMonth:()=>A,traverseRows:()=>At,updateDomElement:()=>W,updateObject:()=>U,updateStackedBarOptions:()=>Ot});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)]}const o={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"]])},r={es_ES:new Map([["1","Ene"],["2","Feb"],["3","Mar"],["4","Abr"],["5","May"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Sep"],["10","Oct"],["11","Nov"],["12","Dic"]]),ca_ES:new Map([["1","Gen"],["2","Feb"],["3","Mar"],["4","Abr"],["5","Mai"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Set"],["10","Oct"],["11","Nov"],["12","Des"]])},i={es_ES:new Map([["last_update","Última actualización"]]),ca_ES:new Map([["last_update","Última actualització"]])};function s(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function l(t){return[t.substring(0,4),n[t.substring(4,6)]]}function c(t){const[e,n]=l(t);return`${n} ${e}`}function d(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 u(t){const[e,n]=l(t);return`${n.substring(0,3)} ${e}`}function f(t){const[e,n]=l(t);return`${n.substring(0,3)} '${e.substring(2,4)}`}function h(t){const[e,n]=t.split("-");return`${parseFloat(n)/3}T ${e}`}function m(t,e){const n=t[e];return Array.from(n.values()).map(t=>t.slice(0,3))}function p(t){const e=Math.floor(t/1e4),n=new Date(e,t%1e4/100-1,t%100);return n.setDate(n.getDate()-1),`${n.getFullYear()}${(n.getMonth()+1).toString().padStart(2,"0")}${n.getDate().toString().padStart(2,"0")}`}function A(t){let e;const n=new Date(Math.floor(t/100),t%100-1,0);return e=`${n.getFullYear()}${(n.getMonth()+1).toString().padStart(2,"0")}`,e}function S(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function g(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 y(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function b(t){return t>=1e3?t/1e3+" Tn":t.toString()}function E(t){let e,n;return t>=1e6?(e=t/1e6,n="G"):t>=1e3?(e=t/1e3,n="M"):(e=t,n="k"),{value:Math.round(100*e)/100,prefix:n}}function D(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 M(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,n)=>e+n[0].toUpperCase())}function I(t,e,n="MainContentLoadedCustom"){let a=document.getElementById(t);return a?Promise.resolve(e(a)):new Promise(o=>{document.body.addEventListener(n,()=>{a=document.getElementById(t),a?o(e(a)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),o(null))})})}function x(t,e){return I(t,t=>{const n=echarts.init(t);n.setOption(e,!0),window.addEventListener("resize",()=>{null!=n&&void 0!==n&&n.resize()});const a=document.getElementById("main-content");return a&&(a.addEventListener("shown.bs.collapse",()=>{n.resize()}),a.addEventListener("hidden.bs.collapse",()=>{n.resize()})),n})}function v(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 N(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 $(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?`${g(r)} ${a}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${g(r)} ${a}`:"-"}\n </span>\n </div>`;var s;o+=i}),o}function T(t){return 100*(t-120)/t}function C(t,e){const n=Math.max(...t);return n+(e-n%e)}function w(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}%`:g(t.value);return`<div> ${n} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${a} </span></div>`}function L(t,e){let n=`${t.name} : `;return n+=`<span style="font-weight:500">${g(Math.round(t.value))}</span>`,e&&(n+=`<span> (${t.percent}%)</span>`),t.marker+n}function O(t){const e=1e6,n=Number(t);return n>=0&&n<e?`${g(n)} €`:n>=e?`${g(n/e)} M €`:"-"}function F(t,e,n){return 0===t.length?(v(`#${e}`,`#${n}`),!1):(N(`#${n}`,`#${e}`),!0)}function R(t,e,n=1){const a=Math.max(...t.map(t=>t[e]))*n;return 5e3*Math.ceil(a/5e3)}function k(t,e,n,a=30,o=15,r=30,i=-70,s=70,l=3){const c=R(t,e.data,1.1),d=s,u=n.slice(),f=[];let h=o,m=r,p=i;for(let n=0;n<t.length;n+=1)f.push({value:t[n][e.data],name:D(String(t[n][e.type]).replace(/\[.*?\]/g,"")),color:u.shift(),title:{offsetCenter:[`${String(p)}%`,`${String(h)}%`],fontFamily:"Montserrat",fontSize:a},detail:{offsetCenter:[`${String(p)}%`,`${String(m)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>g(Math.round(t))}}),p+=d,(n+1)%l===0&&(m+=r,h+=2*o,p=i);return[c,f]}function P(t,e,n,o=0){return[R(e,n.data,1),t=>function(t,e,n){const o=g(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 z(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 B(t,e=[],n=!1){const[a,o,r]=z(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,e,n=!1){const[a,o,r]=z(t,n);return a.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[a,r,o]}function G(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 U(t,e){const n={...t};return Object.keys(e).forEach(a=>{Object.prototype.hasOwnProperty.call(e,a)&&("series"===a&&Array.isArray(e[a])?n[a]=e[a].map((e,n)=>({...Array.isArray(t[a])&&t[a][n]||{},...e})):"object"!=typeof e[a]||null===e[a]||Array.isArray(e[a])?t[a]!==e[a]&&(n[a]=e[a]):n[a]=U(t[a]||{},e[a]))}),n}function V(t,e){const n=()=>{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]})})};try{n()}catch(t){document.body.addEventListener("MainContentLoadedCustom",()=>{n()})}}function Y(t,e){const n=G(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 W(t,e){const n=document.querySelector(t);n?n.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function q(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 J=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],j=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],H=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],X=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],Z=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function Q(t){const e=t.resultset.map(t=>t[0]);return this.dashboard.fireChange(this.parameter,e),t}function K(t){for(const e of t)if(Array.isArray(e)){if(!K(e))return!1}else if("All"!==e)return!1;return!0}function tt(t,e,n,a){return K(e)?(t.queryDefinition.dataAccessId=n,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=a,!0}function et(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function nt(t){t.forEach(t=>{Dashboards.fireChange(t,["All"])})}function at(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 ot(t="Todos"){const e=at(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function rt(t,e,n,a){const o=Dashboards.getParameterValue(n),r=Dashboards.getParameterValue(a);return Dashboards.fireChange(t,[o]),Dashboards.fireChange(e,[r]),!0}function it(t,e){const n=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[n]),!0}function st(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function lt(t,e){const n=Dashboards.getParameterValue(e),a=t.parameter;""!==n&&t.dashboard.setParameter(a,[n])}function ct(t){t.regional.es={monthNames:J,abbreviatedMonthNames:j,dayNames:H,abbreviatedDayNames:X,dayNamesMin:Z,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function dt(t,e){const n=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(n)?n:[n]),!0}function ut(t,e,n,a=0){const o=t.resultset.slice(0,n).map(t=>t[a]);return Dashboards.setParameter(e,o),t}function ft(t,e){return I(t,t=>new Tabulator(t,e))}function ht(t,e){let n=t.getValue();return n.length>e&&(n=`${n.substr(0,e)}<br>${n.substr(e)}`),n}function mt(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 pt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const n=t.getTreeChildren();n.length>0&&n.forEach(t=>{t.getTreeChildren().length>0&&pt(t,e)})}function At(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&pt(t,e)})}function St(t,e,n,a){const o=[];return Object.keys(t).forEach(r=>{if(Object.prototype.hasOwnProperty.call(t,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)}}),o}function gt(t){let e=!0;return t.getGroups().forEach(t=>{t._group.visible&&(e=!1)}),e}function yt(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:";",bom:!0})})}function bt(t,e,n){const a=document.getElementById(n),o=a.cloneNode(!0);a.parentNode.replaceChild(o,a),o.addEventListener("click",()=>{const n=t.getRows().map(t=>t.getData()),a=t.getColumns(),o={};a.forEach((t,e)=>{const a=t.getField();a&&n.every(t=>{const e=t[a];return null==e||/^-?\d+([.,]\d+)?$/.test(e.toString().trim())})&&(o[e]={halign:"right"})}),t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8,lineWidth:.1,lineColor:[200,200,200]},headStyles:{halign:"center"},columnStyles:o}})})}function Et(t,e,n){const a=document.getElementById(n);a&&a.addEventListener("click",()=>{t.setGroupStartOpen(!1),t.setData(e)})}function Dt(t,e,n){const a=document.getElementById(n);a&&a.addEventListener("click",()=>{t.setGroupStartOpen(!0),t.setData(e)})}const Mt={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 It(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");const o=document.createElement("tr"),r=document.createElement("td");r.innerHTML=n.address,o.appendChild(r),o.appendChild(a(`${n.entityid}_so2`,n.so2value,Mt.SO2)),o.appendChild(a(`${n.entityid}_no2`,n.no2value,Mt.NO2)),o.appendChild(a(`${n.entityid}_o3`,n.o3value,Mt.O3)),o.appendChild(a(`${n.entityid}_pm10`,n.pm10value,Mt.PM10)),o.appendChild(a(`${n.entityid}_pm25`,n.pm25value,Mt.PM25)),e.push(o)}),e}function xt(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 vt(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function Nt(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 $t(t){window.realDashboardsInit=Dashboards.init,Dashboards.init=function(){console.warn("Dashboards.init bloqueado temporalmente")},Nt("include-html-cabecera",function(){!function(){const t=vt();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=vt();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()}),Nt("include-html-menu"),Nt("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()}),Nt("include-html-copyright"),function(t="MainContentLoadedCustom"){document.body.addEventListener(t,()=>{try{Dashboards.init=window.realDashboardsInit,Dashboards.init()}catch(t){console.warn("No se pudo restaurar Dashboards.init; la función original no está disponible.")}},{once:!0})}()}function Tt(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 Ct={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=>`${y(t)}€`}}]},wt=(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;">${g(o)}</span></div>`;return a};function Lt(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=>wt(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=>g(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=>g(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?U(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?U(s,n):s,x(t,l)}function Ot(t){let e={};return e=U(Ct,t),e}function Ft(t,e,n={},o={}){let r={};r=U(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:U(o,i),l=e;l.forEach((t,e)=>{l[e][0]=a(t[0])}),Lt(t,l,r,s)}function Rt(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=>L(t,!1)},series:[{type:"bar",showBackground:!0}]};let a={};a=void 0!==e?U(n,e):n,x(t,a)}const kt="es_ES",Pt={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 zt(t){return Math.max(...t.map(t=>Number(t[0])))}function Bt(t){const e=t.filter(e=>Number(e[0])===zt(t)),n=Array.from({length:12},()=>0);return e.forEach(([t,e,a])=>{const o=parseInt(e,10)-1;n[o]=a}),n}function _t(t){const e=t.filter(e=>Number(e[0])===zt(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 Gt(t,e,n=void 0){const a=zt(e).toString(),o=(zt(e)-1).toString();Rt(t,U({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:m(Pt,kt),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:_t(e)},{name:a,type:"bar",barGap:0,data:Bt(e)}]},n))}function Ut(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",Yt="fecha",Wt="value";function qt(t,e,n,a,o="es_ES"){const[r,i]=function(t,e,n){const a=[],o=[];return t.forEach(t=>{e.includes(`${t[Vt]}`)?a.push(`${t[Yt]}`):n.includes(`${t[Vt]}`)&&o.push(`${t[Yt]}`)}),[a.map(t=>[t,0]),o.map(t=>[t,0])]}(t,n,a);let s="es_ES"==o?"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[Wt]).map(t=>parseInt(`${t[Wt]}`,10)))}]]}}]}function Jt(t,e,n=void 0){x(t,U({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=>$(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,M=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 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:M||t,selected:D}:null,grid:{left:e,right:o,bottom:r,top:a?M?"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: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 M(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 I(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");I("chartInstanciesDonadesAlta",p),I("chartAdministrativesRealitzades",m),I("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;I("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;I("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,w=1,L=2,O=3,F=4,R=1130,k=1124,P=1122,z=1143,B=1139;function _(t){const e=[],n=[],a=[],o=[],r=[];return t.forEach(t=>{t[0]===R?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[w],"Expedients",n,"EXPEDIENTS PIAE DONADES D'ALTA: EVOLUCIÓ MENSUAL"),r=b(t[L],"Tasques",n,"TASQUES ADMINISTRATIVES PIAE REALITZADES: EVOLUCIÓ MENSUAL"),i=b(t[O],"Resolucions",n,"RESOLUCIONS PIAE ASSENTADES: EVOLUCIÓ MENSUAL"),s=b(t[F],"Notificacions",n+15,"NOTIFICACIONS PIAE AMB ENVIAMENT TELEMATIC: EVOLUCIÓ MENSUAL");I("chartInstanciesDonadesAltaBarMonth",a),I("chartExpDonadesAltaBarMonth",o),I("chartAdministrativesDonadesAltaBarMonth",r),I("chartResDonadesAltaBarMonth",i),I("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[w],a);const o={title:{text:"TASQUES ADMINISTRATIVES PIAE REALITZADES: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nTasques"}};(0,V.initStackedBarChartMonthSeries)("chartAdministrativesDonadesAltaStackedBarYears",t[L],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[F],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=M(a[C],t,"INSTÀNCIES PIAE DONADES D'ALTA: MES ACTUAL",o),i=M(a[w],t,"EXPEDIENTS PIAE DONADES D'ALTA: MES ACTUAL",o),s=M(a[L],t,"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: MES ACTUAL",o),l=M(a[O],t,"RESOLUCIONS PIAE ASSENTADES: MES ACTUAL",o),c=M(a[F],t,"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: MES ACTUAL",o);I("chartInstanciesDonadesAltaGaugeMonth",r),I("chartExpDonadesAltaGaugeMonth",i),I("chartAdministrativesDonadesAltaGaugeMonth",s),I("chartResDonadesAltaGaugeMonth",l),I("chartNotificacionsDonadesAltaGaugeMonth",c);const d=M(a[C],n,"INSTÀNCIES PIAE DONADES D'ALTA: MES ANTERIOR",o),u=M(a[w],n,"EXPEDIENTS PIAE DONADES D'ALTA: MES ANTERIOR",o),f=M(a[L],n,"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: MES ANTERIOR",o),h=M(a[O],n,"RESOLUCIONS PIAE ASSENTADES: MES ANTERIOR",o),m=M(a[F],n,"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: MES ANTERIOR",o);I("chartInstanciesDonadesAltaGaugeLastMonth",d),I("chartExpDonadesAltaGaugeLastMonth",u),I("chartAdministrativesDonadesAltaGaugeLastMonth",f),I("chartResDonadesAltaGaugeLastMonth",h),I("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]===R?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[w],"EXPEDIENTS PIAE DONADES D'ALTA: ÚLTIMS ANYS",n),r=D(t[L],"TASQUES ADMINISTRATIVES PIAE\nREALITZADES: ÚLTIMS ANYS",n),i=D(t[O],"RESOLUCIONS PIAE ASSENTADES: ÚLTIMS ANYS",n),s=D(t[F],"NOTIFICACIONS PIAE AMB\nENVIAMENT TELEMATIC: ÚLTIMS ANYS",n);I("chartInstanciesDonadesAltaGaugeYear",a),I("chartExpDonadesAltaGaugeYear",o),I("chartAdministrativesDonadesAltaGaugeYear",r),I("chartResDonadesAltaGaugeYear",i),I("chartNotificacionsDonadesAltaGaugeYear",s)}}})(),a})());