@vlci/cdmciutat 41.0.0 → 42.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.husky/commit-msg +4 -4
- package/dist/js/aigua.js +1 -1
- package/dist/js/analitica.js +1 -1
- package/dist/js/ciclista.js +1 -1
- package/dist/js/contaminacio.js +1 -1
- package/dist/js/emt.js +1 -1
- package/dist/js/energia.js +1 -1
- package/dist/js/initialCalls.js +1 -1
- package/dist/js/legacy.js +1 -1
- package/dist/js/mediAmbient.js +1 -1
- package/dist/js/piae.js +1 -1
- package/dist/js/residus.js +1 -1
- package/dist/js/seuElectronica.js +1 -1
- package/dist/js/vehicles.js +1 -1
- package/package.json +1 -1
package/dist/js/contaminacio.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.contaminacio=e():t.contaminacio=e()}(self,()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},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:()=>i,TEXTS_COMMON:()=>s,THRESHOLDS:()=>_t,addPointInteger:()=>S,buildCamarasTrafico:()=>Lt,buildTableCalidadAire:()=>Nt,calculateMaxYAxis:()=>L,calculatePentahoPath:()=>xt,calculateXAxisStart:()=>I,capitalizarTexto:()=>O,checkAllGroupsCollapsed:()=>vt,configureDataBar:()=>B,configureDataGaugeCommon:()=>z,configureDataGaugeMonthCommon:()=>V,configureDataLine:()=>U,configureDataValidate:()=>Gt,configureLinesChartValidates:()=>Ht,convertDateToInteger:()=>b,convertISODateToEUDate:()=>A,convertToLanguageSelectorDateRange:()=>dt,convertToTableTreeView:()=>St,downloadCSVTable:()=>Mt,downloadPDFTable:()=>Et,formatCellMultiplesLines:()=>gt,formatDayMonthYear:()=>d,formatMilMillionEuros:()=>$,formatMonthAnyo:()=>u,formatName:()=>C,formatNameHeaderColumn:()=>yt,formatRoundTooltip:()=>T,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>m,formatToMillions:()=>v,formatToTons:()=>M,formatTooltip:()=>D,formatTooltipPie:()=>w,formatTrimestre:()=>p,formatWithPrefix:()=>E,getEnvironment:()=>Pt,getMaxFieldNumberFromData:()=>q,getMonth:()=>a,getMonthList:()=>h,getSelectCommonOptions:()=>rt,getSelectTwoColumnsOptions:()=>it,initBarChart:()=>zt,initBarChartComparationMonth:()=>Bt,initChart:()=>N,initContractAllGroups:()=>Ct,initElement:()=>_,initExpandAllGroups:()=>Ot,initStackedBarChart:()=>$t,initStackedBarChartMonthSeries:()=>Rt,initTable:()=>ht,initValueDefaultDate:()=>ct,initialCalls:()=>It,loadIframeOnClickEvent:()=>Wt,printDataChart:()=>P,printDataInHTMLElements:()=>j,printEchart:()=>F,printNoDataChart:()=>x,resetFilter:()=>at,resetFilterAndUpdate:()=>pt,resetFilterDate:()=>lt,resetFilterDates:()=>st,resetFilterToDefault:()=>mt,resultsetWithFields:()=>W,selectConfigDatasource:()=>nt,selectConfigDatasourceAllValue:()=>ot,selectFilterAll:()=>tt,selectFilterNumItemsDefault:()=>ft,selectValueDefaultInFilter:()=>ut,separateDayMonthYearToSlash:()=>l,splitDataset:()=>H,subtractOneDay:()=>y,subtractOneMonth:()=>g,traverseRows:()=>At,updateDomElement:()=>G,updateObject:()=>J,updateStackedBarOptions:()=>Ft});const n="es_ES",o=(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"]]),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"]]),{"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 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"]])},i={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 l(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function c(t){return[t.substring(0,4),o[t.substring(4,6)]]}function u(t){const[e,n]=c(t);return`${n} ${e}`}function d(t){const[e,n,a]=function(t){return[t.substring(0,4),o[t.substring(4,6)],t.substring(6,8)]}(t);return`${a} ${n} ${e}`}function m(t){const[e,n]=c(t);return`${n.substring(0,3)} ${e}`}function f(t){const[e,n]=c(t);return`${n.substring(0,3)} '${e.substring(2,4)}`}function p(t){const[e,n]=t.split("-");return`${parseFloat(n)/3}T ${e}`}function h(){const t=r[n];return Array.from(t.values()).map(t=>t.slice(0,3))}function y(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 g(t){const e=new Date(Math.floor(t/100),t%100-1,0);return`${e.getFullYear()}${(e.getMonth()+1).toString().padStart(2,"0")}`}function b(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function A(t){if(!t||"string"!=typeof t)return"";const[e,n,o]=t.split("-");return`${o}/${n}/${e}`}function S(t,e=2){let n=navigator.language||navigator.userLanguage;n=n.length<=2?`${n}-${n.toUpperCase()}`:n;const o={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===n?t.toLocaleString("de-DE",o):t.toLocaleString(n,o)}function v(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function M(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 C(t,e=29){if(t.length>=e){const n=t.split(" ");let o="",a="";return n.forEach(t=>{`${o} ${t}`.length<=e?o+=(o?" ":"")+t:(a+=`${o}\n`,o=t)}),a+=o,a}return t}function O(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,n)=>e+n[0].toUpperCase())}function _(t,e,n="MainContentLoadedCustom"){let o=document.getElementById(t);return o?Promise.resolve(e(o)):new Promise(a=>{document.body.addEventListener(n,()=>{o=document.getElementById(t),o?a(e(o)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),a(null))})})}function N(t,e){return _(t,t=>{const n=echarts.init(t);n.setOption(e,!0),window.addEventListener("resize",()=>{null!=n&&void 0!==n&&n.resize()});const o=document.getElementById("main-content");return o&&(o.addEventListener("shown.bs.collapse",()=>{n.resize()}),o.addEventListener("hidden.bs.collapse",()=>{n.resize()})),n})}function x(t,e){const n=t?document.querySelector(t):null,o=e?document.querySelector(e):null;n&&(n.hidden=!0),o&&(o.style.background="url('./build/images/nodata1.png') no-repeat top center",o.hidden=!1)}function P(t,e){const n=t?document.querySelector(t):null,o=e?document.querySelector(e):null;n&&(n.hidden=!0),o&&(o.style.background="#ffffff",o.hidden=!1)}function D(t,e=!1,n=!0,o=""){let a=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach(t=>{const r=e?Math.round(t.data):t.data,i=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?`${S(r)} ${o}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${S(r)} ${o}`:"-"}\n </span>\n </div>`;var s;a+=i}),a}function I(t){return 100*(t-120)/t}function L(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>`,o=e?`${t.percent}%`:S(t.value);return`<div> ${n} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${o} </span></div>`}function T(t,e){let n=`${t.name} : `;return n+=`<span style="font-weight:500">${S(Math.round(t.value))}</span>`,e&&(n+=`<span> (${t.percent}%)</span>`),t.marker+n}function $(t){const e=1e6,n=Number(t);return n>=0&&n<e?`${S(n)} €`:n>=e?`${S(n/e)} M €`:"-"}function F(t,e,n){return 0===t.length?(x(`#${e}`,`#${n}`),!1):(P(`#${n}`,`#${e}`),!0)}function R(t,e,n=1){const o=Math.max(...t.map(t=>t[e]))*n;return 5e3*Math.ceil(o/5e3)}function z(t,e,n,o=30,a=15,r=30,i=-70,s=70,l=3){const c=R(t,e.data,1.1),u=s,d=n.slice(),m=[];let f=a,p=r,h=i;for(let n=0;n<t.length;n+=1)m.push({value:t[n][e.data],name:C(String(t[n][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(h)}%`,`${String(f)}%`],fontFamily:"Montserrat",fontSize:o},detail:{offsetCenter:[`${String(h)}%`,`${String(p)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>S(Math.round(t))}}),h+=u,(n+1)%l===0&&(p+=r,f+=2*a,h=i);return[c,m]}function V(t,e,n,o=0){return[R(e,n.data,1),t=>function(t,e,n){const o=S(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 k(t,e){const{resultset:n}={resultset:t},o=new Set,a=new Set,r=n.map(([t,n,r])=>{const i=e?Math.round(r):r;return o.add(t),a.add(n),{day:n,type:t,value:i}}),i=Array.from(a.values()),s=Array.from(o.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,a]}function U(t,e=[],n=!1){const[o,a,r]=k(t,n);return o.forEach(t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())}),[o,r,a]}function B(t,e,n=!1){const[o,a,r]=k(t,n);return o.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[o,r,a]}function W(t){const{resultset:e,metadata:n}=t,o=[];return e.forEach(t=>{const e={};t.forEach((t,o)=>{e[n[o].colName]=t}),o.push(e)}),o}function J(t,e){const n={...t};return Object.keys(e).forEach(o=>{Object.prototype.hasOwnProperty.call(e,o)&&("series"===o&&Array.isArray(e[o])?n[o]=e[o].map((e,n)=>({...Array.isArray(t[o])&&t[o][n]||{},...e})):"object"!=typeof e[o]||null===e[o]||Array.isArray(e[o])?t[o]!==e[o]&&(n[o]=e[o]):n[o]=J(t[o]||{},e[o]))}),n}function j(t,e){const n=()=>{t.forEach(t=>{t.id in e&&Object.entries(e[t.id]).forEach(n=>{const o=n[0],a=n[1];"object"==typeof a?a.className?document.querySelector(a.className).className=t[o]:a.element&&a.format&&(document.querySelector(a.element).textContent=e[t.id][o].format(t[o])):document.querySelector(a).textContent=t[o]})})};try{n()}catch(t){document.body.addEventListener("MainContentLoadedCustom",()=>{n()})}}function q(t,e){const n=W(t),o=[];let a=null;return n.forEach(t=>{const n=t[e];"number"!=typeof n||Number.isNaN(n)||o.push(n)}),o.length>0&&(a=Math.max(...o)),a}function G(t,e){const n=document.querySelector(t);n?n.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function H(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 Y=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],X=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],Z=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],K=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],Q=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function tt(t){const e=t.resultset.map(t=>t[0]);return this.dashboard.fireChange(this.parameter,e),t}function et(t){for(const e of t)if(Array.isArray(e)){if(!et(e))return!1}else if("All"!==e)return!1;return!0}function nt(t,e,n,o){return et(e)?(t.queryDefinition.dataAccessId=n,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=o,!0}function ot(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function at(t){t.forEach(t=>{Dashboards.fireChange(t,["All"])})}function rt(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 it(t="Todos"){const e=rt(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function st(t,e,n,o){const a=Dashboards.getParameterValue(n),r=Dashboards.getParameterValue(o);return Dashboards.fireChange(t,[a]),Dashboards.fireChange(e,[r]),!0}function lt(t,e){const n=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[n]),!0}function ct(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function ut(t,e){const n=Dashboards.getParameterValue(e),o=t.parameter;""!==n&&t.dashboard.setParameter(o,[n])}function dt(t){t.regional.es={monthNames:Y,abbreviatedMonthNames:X,dayNames:Z,abbreviatedDayNames:K,dayNamesMin:Q,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function mt(t,e){const n=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(n)?n:[n]),!0}function ft(t,e,n,o=0){const a=t.resultset.slice(0,n).map(t=>t[o]);return Dashboards.setParameter(e,a),t}function pt(t,e,n){const o=Array.isArray(e)?e:[e];Dashboards.fireChange(t,o);const a=Dashboards.getComponent(n);a&&a.update()}function ht(t,e){return _(t,t=>new Tabulator(t,e))}function yt(t,e){let n=t.getValue();return n.length>e&&(n=`${n.substr(0,e)}<br>${n.substr(e)}`),n}function gt(t,e){const n=t.getValue().split(" ");let o="",a="";return n.forEach(t=>{(a+t).length<=e?a+=`${t} `:(o+=`${a}<br>`,a=`${t} `)}),o+=`${a}<br>`,o}function bt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const n=t.getTreeChildren();n.length>0&&n.forEach(t=>{t.getTreeChildren().length>0&&bt(t,e)})}function At(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&bt(t,e)})}function St(t,e,n,o){const a=[];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,a)=>{const r={[e]:n[a],[o]:t};s._children.push(r)}),a.push(s)}}),a}function vt(t){let e=!0;return t.getGroups().forEach(t=>{t._group.visible&&(e=!1)}),e}function Mt(t,e,n){const o=document.getElementById(n),a=o.cloneNode(!0);o.parentNode.replaceChild(a,o),a.addEventListener("click",()=>{t.download("csv",`${e}.csv`,{delimiter:";",bom:!0})})}function Et(t,e,n){const o=document.getElementById(n),a=o.cloneNode(!0);o.parentNode.replaceChild(a,o),a.addEventListener("click",()=>{const n=t.getRows().map(t=>t.getData()),o=t.getColumns(),a={};o.forEach((t,e)=>{const o=t.getField();o&&n.every(t=>{const e=t[o];return null==e||/^-?\d+([.,]\d+)?$/.test(e.toString().trim())})&&(a[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:a}})})}function Ct(t,e,n){const o=document.getElementById(n);o&&o.addEventListener("click",()=>{t.setGroupStartOpen(!1),t.setData(e)})}function Ot(t,e,n){const o=document.getElementById(n);o&&o.addEventListener("click",()=>{t.setGroupStartOpen(!0),t.setData(e)})}const _t={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 Nt(t){const e=[],n={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function o(t,e,o){const a=document.createElement("td");if(a.setAttribute("id",t),null!=e){a.innerHTML=e;const t=function(t,e){let o;return void 0===e?o=6:"ND"===e?o=7:(o=5,t.forEach((t,n)=>{e<=t&&5===o&&(o=n)})),n[o]}(o,e);a.classList.add(t)}return a}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 a=document.createElement("tr"),r=document.createElement("td");r.innerHTML=n.address,a.appendChild(r),a.appendChild(o(`${n.entityid}_so2`,n.so2value,_t.SO2)),a.appendChild(o(`${n.entityid}_no2`,n.no2value,_t.NO2)),a.appendChild(o(`${n.entityid}_o3`,n.o3value,_t.O3)),a.appendChild(o(`${n.entityid}_pm10`,n.pm10value,_t.PM10)),a.appendChild(o(`${n.entityid}_pm25`,n.pm25value,_t.PM25)),e.push(a)}),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 Pt(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function Dt(t,e){document.querySelectorAll(`[${t}]`).forEach(n=>{!function(t,e,n){const o=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(o.innerHTML=this.responseText,n&&n()),404===this.status&&(o.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(n.getAttribute(t),n,e)})}function It(t){window.realDashboardsInit=Dashboards.init,Dashboards.init=function(){console.warn("Dashboards.init bloqueado temporalmente")},Dt("include-html-cabecera",function(){!function(){const t=Pt();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=Pt();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()}),Dt("include-html-menu"),Dt("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()}),Dt("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 Lt(t,e,n,o,a,r){let i=!1,s=!1;const l=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function d(t=!0){const e=document.querySelector(n);t?(l&&(l.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),s=!0):(e.classList.remove("blur"),u(),s=!1)}const m=t=>{new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(s||u(),i||(i=!0,window.setTimeout(d,r)))})}).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(l&&(l.setAttribute("sandbox","allow-scripts"),m(l)),c&&(c.setAttribute("sandbox","allow-scripts"),m(c)),document.querySelector(a).addEventListener("click",()=>{d(!1),window.setTimeout(d,r)})):document.querySelectorAll(o)[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=>`${v(t)}€`}}]},Tt=(t,e)=>{e.sort((t,e)=>parseInt(t.anyo)-parseInt(e.anyo));const n={};e.forEach(e=>{const o=e[1],a=e[0];a!==t.seriesName||n[o]||(n[o]=0),a===t.seriesName&&(n[o]+=e[2])});let o=`<p>${t.seriesName}</p>`;for(const[e,a]of Object.entries(n))o+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${S(a)}</span></div>`;return o};function $t(t,e,n=void 0,o=void 0){const a=null===o?void 0:o,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=>Tt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,n,o,a){const r={},i=a.contentSize[1]/2,s=a.viewSize[1],l=t[1];return l<i?r.top=10:l+i>s?r.bottom=10:r.top=l-i,t[0]<a.viewSize[0]/2?r.left=t[0]+20:r.right=a.viewSize[0]-t[0]+20,r}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>S(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=>S(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};a&&a.itemStyle&&Array.isArray(a.itemStyle.borderColor)&&(i=[...a.itemStyle.borderColor],delete a.itemStyle.borderColor);const n=function(t){return t.reduce((t,e)=>{const n=e[0];return t[n]||(t[n]=[]),t[n].push(e),t},{})}(e),o=Object.keys(n);r.forEach(t=>{o.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 o={};o=void 0!==a?J(t,a):t,s.push({...o})}),s})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let l={};l=void 0!==n?J(s,n):s,N(t,l)}function Ft(t){let e={};return e=J(wt,t),e}function Rt(t,e,n={},o={}){let r={};r=J(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:J(o,i),l=e;l.forEach((t,e)=>{l[e][0]=a(t[0])}),$t(t,l,r,s)}function zt(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=>T(t,!1)},series:[{type:"bar",showBackground:!0}]};let o={};o=void 0!==e?J(n,e):n,N(t,o)}function Vt(t){return Math.max(...t.map(t=>Number(t[0])))}function kt(t){const e=t.filter(e=>Number(e[0])===Vt(t)),n=Array.from({length:12},()=>0);return e.forEach(([t,e,o])=>{const a=parseInt(e,10)-1;n[a]=o}),n}function Ut(t){const e=t.filter(e=>Number(e[0])===Vt(t)-1),n=Array.from({length:12},()=>0);return e.forEach(([t,e,o])=>{const a=parseInt(e,10)-1;n[a]=o}),n}function Bt(t,e,n=void 0){const o=Vt(e).toString(),a=(Vt(e)-1).toString();zt(t,J({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[a,o],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:h(),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:a,type:"bar",data:Ut(e)},{name:o,type:"bar",barGap:0,data:kt(e)}]},n))}function Wt(t,e,n){const o=document.querySelector(e),a=document.querySelector(t);let r=!1;a.addEventListener("click",()=>{!1===r&&(r=!0,o.setAttribute("src","about:blank"),o.setAttribute("src",n),o.onload=()=>{r=!1})}),a.disabled=!1}const Jt="id",jt="fecha",qt="value";function Gt(t,e,n,o,a="es_ES"){const[r,i]=function(t,e,n){const o=[],a=[];return t.forEach(t=>{e.includes(`${t[Jt]}`)?o.push(`${t[jt]}`):n.includes(`${t[Jt]}`)&&a.push(`${t[jt]}`)}),[o.map(t=>[t,0]),a.map(t=>[t,0])]}(t,n,o);let s="es_ES"==a?"Datos sin validar":"Dades sense validar";0===i.length&&(s="");const l={name:"Datos validados",type:"line",data:[...r,i[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",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,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:u,yAxis:Math.max(...t.filter(t=>null!==t[qt]).map(t=>parseInt(`${t[qt]}`,10)))}]]}}]}function Ht(t,e,n=void 0){N(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=>D(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()},5606:t=>{var e,n,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(e===setTimeout)return setTimeout(t,0);if((e===a||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:a}catch(t){e=a}try{n="function"==typeof clearTimeout?clearTimeout:r}catch(t){n=r}}();var s,l=[],c=!1,u=-1;function d(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&m())}function m(){if(!c){var t=i(d);c=!0;for(var e=l.length;e;){for(s=l,l=[];++u<e;)s&&s[u].run();u=-1,e=l.length}s=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===r||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{return n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function p(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new f(t,e)),1!==l.length||c||i(m)},f.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}}},e={};function n(o){var a=e[o];if(void 0!==a)return a.exports;var r=e[o]={exports:{}};return t[o](r,r.exports,n),r.exports}n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},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 o={};return(()=>{"use strict";n.r(o),n.d(o,{echartHeatMap:()=>k,echartNO:()=>M,echartNO2:()=>S,echartNO2Portada:()=>A,echartNO2PresupuestosParticipativos:()=>v,echartNOPresupuestosParticipativos:()=>E,echartNOX:()=>C,echartNOXPresupuestosParticipativos:()=>O,echartO3:()=>w,echartO3PresupuestosParticipativos:()=>T,echartPM1:()=>x,echartPM10:()=>_,echartPM10PresupuestosParticipativos:()=>N,echartPM1PresupuestosParticipativos:()=>P,echartPM25:()=>D,echartPM25PresupuestosParticipativos:()=>I,echartSO2:()=>$,echartSO2PresupuestosParticipativos:()=>F,heatMapChart:()=>d,listeneresContamina:()=>g,loadContamincaioMap:()=>U});var t=n(2725);n(5606);const e="#000",a="Montserrat",r="normal",i="heatmap",s={show:!0,position:["50%","50%"],color:"transparent",fontSize:10,emphasis:{fontSize:26,color:e},align:"center",verticalAlign:"middle",opacity:1,fontWeight:"600",fontFamily:a},l={itemStyle:{opacity:1}};function c(t){return{formatter:"{value}",textStyle:{fontSize:t,fontFamily:a,color:"#333",fontWeight:"600"},margin:15}}function u(e,n){const o=t.THRESHOLDS[n];if(!o)return;const a=["#00ffff","#00b050","#ffcc00","#ff3300","#9a0000","#9a00ff"];for(let t=0;t<o.length;t+=1)if(e<=o[t])return a[t];return a[a.length-1]}function d(t,n,o){const d=document.getElementById("chartGasometroMapa");if(!d)return void console.error("Element with id 'chartGasometroMapa' not found");const m=echarts.init(d,null,{renderer:"canvas",useDirtyRect:!1}),f={title:{text:o,textStyle:{color:e,fontStyle:r,fontWeight:"600",fontFamily:a,fontSize:30}},tooltip:{renderMode:"html",formatter:t=>[`<b>${t.seriesName}</b>`,'<hr size="1" style="margin: 3px 0">',`${t.value[0]}:<br/>`,' <span style="display: block; text-align: right;">',` <b style="font-size: 120%;">${t.value[2]}</b> µg/m<sup>3</sup>`," </span>"].join(""),textStyle:{color:e,fontStyle:r,fontWeight:"400",fontFamily:a,fontSize:15}},toolbox:{feature:{dataZoom:{yAxisIndex:"none"},restore:{},saveAsImage:{}},right:10,top:10},legend:{data:["NO2","SO2","PM10","PM-2.5","O3"],top:"5%",show:!1,textStyle:{color:"#333",fontStyle:r,fontWeight:"600",fontFamily:a,fontSize:15}},grid:{top:"18%",left:".5%",right:".5%",bottom:"3%",containLabel:!0,height:"67%"},xAxis:{type:"category",data:t,axisLabel:c(12),nameGap:"5px"},yAxis:{type:"category",data:["NO2","SO2","PM10","PM25","O3"],axisLabel:c(16),splitArea:{show:!1}},dataZoom:[{type:"slider",show:!0,xAxisIndex:[0],start:97,end:100}],series:[{name:"O<sup>3</sup> validados",type:i,data:n.o3.validate,label:s,itemStyle:{color:t=>u(t.value[2],"O3"),opacity:.5},emphasis:l},{name:"O<sup>3</sup> no validados",type:i,data:n.o3.invalidate,label:s,itemStyle:{color:t=>u(t.value[2],"O3"),opacity:.3},emphasis:l},{name:"NO<sup>2</sup> validados",type:i,data:n.no2.validate,label:s,itemStyle:{color:t=>u(t.value[2],"NO2"),opacity:.5},emphasis:l},{name:"NO<sup>2</sup> no validados",type:i,data:n.no2.invalidate,label:s,itemStyle:{color:t=>u(t.value[2],"NO2"),opacity:.3},emphasis:l},{name:"SO<sup>2</sup> validados",type:i,data:n.so2.validate,label:s,itemStyle:{color:t=>u(t.value[2],"SO2"),opacity:.5},emphasis:l},{name:"SO<sup>2</sup> no validados",type:i,data:n.so2.invalidate,label:s,itemStyle:{color:t=>u(t.value[2],"SO2"),opacity:.3},emphasis:l},{name:"PM-10 validados",type:i,data:n.pm10.validate,label:s,itemStyle:{color:t=>u(t.value[2],"PM10"),opacity:.5},emphasis:l},{name:"PM-10 no validados",type:i,data:n.pm10.invalidate,label:s,itemStyle:{color:t=>u(t.value[2],"PM10"),opacity:.3},emphasis:l},{name:"PM-25 validados",type:i,data:n.pm25.validate,label:s,itemStyle:{color:t=>u(t.value[2],"PM25"),opacity:.5},emphasis:l},{name:"PM-25 no validados",type:i,data:n.pm25.invalidate,label:s,itemStyle:{color:t=>u(t.value[2],"PM25"),opacity:.3},emphasis:l}]};f&&m.setOption(f),window.addEventListener("resize",m.resize)}function m(t){return function(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)}(t)}function f(t,e,n=!1){const{resultset:o}={resultset:t},a=new Set,r=new Set,i=e,s=o.map(([t,e,o])=>{const i=n?Math.round(o):o;return a.add(t),r.add(e),{day:e,type:t,value:i}}),l=Array.from(r.values()),c=Array.from(a.values());return c.sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0})),[c.map(t=>{const e=s.filter(e=>e.type===t).map(({day:e,value:n})=>[e,t,n]),n=l.map(t=>{const n=e.find(([e])=>e===t);return n?n[2]:null});return{name:t,type:"line",symbol:"circle",color:i.shift(),symbolSize:6,smooth:!1,data:n}}),r,c]}function p(t){return`${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 h(t){return 100*(t-120)/t}const y=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"];function g(){render_echartPM10.listeners=["filterDatesParam","updateFilter"],render_echartPM1.listeners=["filterDatesParam","updateFilter"],render_echartPM25.listeners=["filterDatesParam","updateFilter"],render_echartO3.listeners=["filterDatesParam","updateFilter"],render_echartSO2.listeners=["filterDatesParam","updateFilter"],render_echartNO2.listeners=["filterDatesParam","updateFilter"],render_echartNO.listeners=["filterDatesParam","updateFilter"],render_echartNOX.listeners=["filterDatesParam","updateFilter"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter")}function b(t,e,n,o,a,r){return{title:{text:o},legend:{show:!0,data:e},xAxis:{type:"category",data:t},yAxis:{name:a,nameTextStyle:{padding:[-25,0,0,-22]},axisLabel:{formatter:m}},dataZoom:{show:r,data:t,start:n},toolbox:{show:!0}}}function A(t,e){z(e,"µg/m3","echartNO2Portada","CONTAMINACIÓ NO2",!1,!0)}function S(t,e){z(e,"µg/m3","chartNO2CEAM","CONTAMINACIÓ NO2\nEstacions CEAM")}function v(t,e){V(e,"µg/m3","chartNO2PRESUPUESTO","CONTAMINACIÓ NO2\nEstacions de Pressupostos Participatius")}function M(t,e){z(e,"µg/m3","chartNOCEAM","CONTAMINACIÓ NO\nEstacions CEAM")}function E(t,e){V(e,"µg/m3","chartNOPRESUPUESTO","CONTAMINACIÓ NO\nEstacions de Pressupostos Participatius")}function C(t,e){z(e,"µg/m3","chartNOXCEAM","CONTAMINACIÓ NOX\nEstacions CEAM")}function O(t,e){V(e,"µg/m3","chartNOXPRESUPUESTO","CONTAMINACIÓ NOX\nEstacions de Pressupostos Participatius")}function _(t,e){z(e,"µg/m3","chartPM10CEAM","CONTAMINACIÓ PM10\nEstacions CEAM")}function N(t,e){V(e,"µg/m3","chartPM10PRESUPUESTO","CONTAMINACIÓ PM10\nEstacions de Pressupostos Participatius")}function x(t,e){z(e,"µg/m3","chartPM1CEAM","CONTAMINACIÓ PM1\nEstacions CEAM")}function P(t,e){V(e,"µg/m3","chartPM1PRESUPUESTO","CONTAMINACIÓ PM1\nEstacions de Pressupostos Participatius")}function D(t,e){z(e,"µg/m3","chartPM25CEAM","CONTAMINACIÓ PM2,5\nEstacions CEAM")}function I(t,e){V(e,"µg/m3","chartPM25PRESUPUESTO","CONTAMINACIÓ PM25\nEstacions de Pressupostos Participatius")}function w(t,e){z(e,"µg/m3","chartO3CEAM","CONTAMINACIÓ O3\nEstacions CEAM")}function T(t,e){V(e,"µg/m3","chartO3PRESUPUESTO","CONTAMINACIÓ O3\nEstacions de Pressupostos Participatius")}function $(t,e){z(e,"µg/m3","chartSO2CEAM","CONTAMINACIÓ SO2\nEstacions CEAM")}function F(t,e){V(e,"µg/m3","chartSO2PRESUPUESTO","CONTAMINACIÓ SO2\nEstacions de Pressupostos Participatius")}function R(t,e){let n;switch(e.toUpperCase()){case"NO2":n=4;break;case"SO2":n=5;break;case"PM10":n=6;break;case"PM25":n=7;break;case"O3":n=8;break;default:return console.error("Unknown pollutant: ",e),[]}return t.map(t=>{const o=t[1],a=t[n-1];return[o,e.toUpperCase(),a]})}function z(e,n,o,a="Estaciones CEAM ",r=!0,i=!1){const s=y.slice(),l=f(e.resultset||e,s,!1),c=l[1],u=Array.from(c.values()),d=l[2],p=h(c.size),g=(0,t.resultsetWithFields)(e),A=(0,t.configureDataValidate)(g,l[0],["A01_AVFRANCIA_24h_va","A02_BULEVARDSUD_24h_va","A03_MOLISOL_24h_va","A04_PISTASILLA_24h_va","A05_POLITECNIC_24h_va","A06_VIVERS_24h_va","A07_VALENCIACENTRE_24h_va","A09_CABANYAL_24h_va","A01_AVFRANCIA_24h_vm","A02_BULEVARDSUD_24h_vm","A03_MOLISOL_24h_vm","A04_PISTASILLA_24h_vm","A05_POLITECNIC_24h_vm","A06_VIVERS_24h_vm","A07_VALENCIACENTRE_24h_vm","A09_CABANYAL_24h_vm"],["A01_AVFRANCIA_24h","A02_BULEVARDSUD_24h","A03_MOLISOL_24h","A04_PISTASILLA_24h","A05_POLITECNIC_24h","A06_VIVERS_24h","A07_VALENCIACENTRE_24h","A09_CABANYAL_24h"]);if(!1===i){const e=b(u,d,p,a,n,r);(0,t.configureLinesChartValidates)(o,A,e)}else{const e=function(t,e,n,o,a,r){return{grid:{left:"5",right:"0",bottom:"0",top:"200"},title:{text:o},legend:{show:!0,data:e},xAxis:{type:"category",data:t,axisLabel:{margin:15}},yAxis:{name:a,nameGap:"25",nameTextStyle:{padding:[0,0,0,-28],align:"left"},axisLabel:{formatter:m,align:"right",padding:[0,0,0,0]}},dataZoom:{show:r,data:t,start:n},toolbox:{show:!1}}}(u,d,p,a,n,r);(0,t.configureLinesChartValidates)(o,A,e)}}function V(e,n,o,a){e=function(t){return t.resultset=t.resultset.map(t=>(t[0]=t[0].replace(/^A\d{2}_/,""),t)),t}(e);const r=y.slice(),i=f(e.resultset||e,r,!1),s=i[1],l=Array.from(s.values()),c=i[2],u=h(s.size),d=(0,t.resultsetWithFields)(e),m=(0,t.configureDataValidate)(d,i[0],[],["A08_DR_LLUCH_24h","A10_OLIVERETA_24h","A11_PATRAIX_24h"]),p=b(l,c,u,a,n);(0,t.configureLinesChartValidates)(o,m,p)}function k(t,e){let n=[],o=[],a=[],r=[];n=function(t){const e=["A01_AVFRANCIA_24h_va","A02_BULEVARDSUD_24h_va","A03_MOLISOL_24h_va","A04_PISTASILLA_24h_va","A05_POLITECNIC_24h_va","A06_VIVERS_24h_va","A07_VALENCIACENTRE_24h_va","A01_AVFRANCIA_24h_vm","A02_BULEVARDSUD_24h_vm","A03_MOLISOL_24h_vm","A04_PISTASILLA_24h_vm","A05_POLITECNIC_24h_vm","A06_VIVERS_24h_vm","A07_VALENCIACENTRE_24h_vm"],n=["A01_AVFRANCIA_24h","A02_BULEVARDSUD_24h","A03_MOLISOL_24h","A04_PISTASILLA_24h","A05_POLITECNIC_24h","A06_VIVERS_24h","A07_VALENCIACENTRE_24h"],o=[],a=[],r=[],i=[];return t.forEach(t=>{n.includes(t[2])?o.push(t):e.includes(t[2])&&a.push(t),r.push(t[1])}),i.push(a),i.push(o),i.push(r),i}(e.filter(e=>e[8]===t)),o=n[0],a=n[1],r=n[2];const i="pm10",s="pm25";d(r,{no2:{validate:R(o,"no2"),invalidate:R(a,"no2")},so2:{validate:R(o,"so2"),invalidate:R(a,"so2")},pm10:{validate:R(o,i),invalidate:R(a,i)},pm25:{validate:R(o,s),invalidate:R(a,s)},o3:{validate:R(o,"o3"),invalidate:R(a,"o3")}},t)}function U(){var t;let e;const n=L.icon({iconUrl:p("build/images/mapas/marker-icon-polucion.svg/content"),iconSize:[34,34],shadowSize:[50,64],iconAnchor:[17,17],shadowAnchor:[4,62],popupAnchor:[0,-26]}),o=L.icon({iconUrl:p("build/images/mapas/marker-icon-selected-polucion.svg/content"),iconSize:[34,34],shadowSize:[50,64],iconAnchor:[17,17],shadowAnchor:[4,62],popupAnchor:[0,-26]});t=L.map("myMap").setView([39.47225,-.37739],14);let a=L.tileLayer("https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>',subdomains:"abcd",maxZoom:20});t.setMinZoom(5),t.setMaxZoom(20),a.addTo(t),L.geoJSON(legacy.obtenerGeoJson(resultadoContaminacion,0,8,9),{onEachFeature:function(t,a){!function(t,e){if(t.properties&&t.properties.objectoId){let n=t.properties.address;e.bindPopup(n),e.on("click",()=>k(n,resultadoContaminacion))}}(t,a),function(t){t.on("click",t=>{var a;a=t.target,e&&e.setIcon(n),e=a,e.setIcon(o)})}(a)},pointToLayer:function(t,e){return L.marker(e,{icon:n})}}).addTo(t)}})(),o})());
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.contaminacio=e():t.contaminacio=e()}(self,()=>(()=>{var t={2725(t){var e;self,e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},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:()=>i,TEXTS_COMMON:()=>s,THRESHOLDS:()=>_t,addPointInteger:()=>S,buildCamarasTrafico:()=>Lt,buildTableCalidadAire:()=>Nt,calculateMaxYAxis:()=>L,calculatePentahoPath:()=>xt,calculateXAxisStart:()=>I,capitalizarTexto:()=>O,checkAllGroupsCollapsed:()=>vt,configureDataBar:()=>B,configureDataGaugeCommon:()=>z,configureDataGaugeMonthCommon:()=>V,configureDataLine:()=>U,configureDataValidate:()=>Gt,configureLinesChartValidates:()=>Ht,convertDateToInteger:()=>b,convertISODateToEUDate:()=>A,convertToLanguageSelectorDateRange:()=>dt,convertToTableTreeView:()=>St,downloadCSVTable:()=>Mt,downloadPDFTable:()=>Et,formatCellMultiplesLines:()=>gt,formatDayMonthYear:()=>d,formatMilMillionEuros:()=>$,formatMonthAnyo:()=>u,formatName:()=>C,formatNameHeaderColumn:()=>yt,formatRoundTooltip:()=>T,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>m,formatToMillions:()=>v,formatToTons:()=>M,formatTooltip:()=>D,formatTooltipPie:()=>w,formatTrimestre:()=>p,formatWithPrefix:()=>E,getEnvironment:()=>Pt,getMaxFieldNumberFromData:()=>q,getMonth:()=>a,getMonthList:()=>h,getSelectCommonOptions:()=>rt,getSelectTwoColumnsOptions:()=>it,initBarChart:()=>zt,initBarChartComparationMonth:()=>Bt,initChart:()=>N,initContractAllGroups:()=>Ct,initElement:()=>_,initExpandAllGroups:()=>Ot,initStackedBarChart:()=>$t,initStackedBarChartMonthSeries:()=>Rt,initTable:()=>ht,initValueDefaultDate:()=>ct,initialCalls:()=>It,loadIframeOnClickEvent:()=>Wt,printDataChart:()=>P,printDataInHTMLElements:()=>j,printEchart:()=>F,printNoDataChart:()=>x,resetFilter:()=>at,resetFilterAndUpdate:()=>pt,resetFilterDate:()=>lt,resetFilterDates:()=>st,resetFilterToDefault:()=>mt,resultsetWithFields:()=>W,selectConfigDatasource:()=>nt,selectConfigDatasourceAllValue:()=>ot,selectFilterAll:()=>tt,selectFilterNumItemsDefault:()=>ft,selectValueDefaultInFilter:()=>ut,separateDayMonthYearToSlash:()=>l,splitDataset:()=>H,subtractOneDay:()=>y,subtractOneMonth:()=>g,traverseRows:()=>At,updateDomElement:()=>G,updateObject:()=>J,updateStackedBarOptions:()=>Ft});const n="es_ES",o=(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"]]),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"]]),{"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 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"]])},i={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 l(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function c(t){return[t.substring(0,4),o[t.substring(4,6)]]}function u(t){const[e,n]=c(t);return`${n} ${e}`}function d(t){const[e,n,a]=function(t){return[t.substring(0,4),o[t.substring(4,6)],t.substring(6,8)]}(t);return`${a} ${n} ${e}`}function m(t){const[e,n]=c(t);return`${n.substring(0,3)} ${e}`}function f(t){const[e,n]=c(t);return`${n.substring(0,3)} '${e.substring(2,4)}`}function p(t){const[e,n]=t.split("-");return`${parseFloat(n)/3}T ${e}`}function h(){const t=r[n];return Array.from(t.values()).map(t=>t.slice(0,3))}function y(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 g(t){const e=new Date(Math.floor(t/100),t%100-1,0);return`${e.getFullYear()}${(e.getMonth()+1).toString().padStart(2,"0")}`}function b(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function A(t){if(!t||"string"!=typeof t)return"";const[e,n,o]=t.split("-");return`${o}/${n}/${e}`}function S(t,e=2){let n=navigator.language||navigator.userLanguage;n=n.length<=2?`${n}-${n.toUpperCase()}`:n;const o={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===n?t.toLocaleString("de-DE",o):t.toLocaleString(n,o)}function v(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function M(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 C(t,e=29){if(t.length>=e){const n=t.split(" ");let o="",a="";return n.forEach(t=>{`${o} ${t}`.length<=e?o+=(o?" ":"")+t:(a+=`${o}\n`,o=t)}),a+=o,a}return t}function O(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,n)=>e+n[0].toUpperCase())}function _(t,e,n="MainContentLoadedCustom"){let o=document.getElementById(t);return o?Promise.resolve(e(o)):new Promise(a=>{document.body.addEventListener(n,()=>{o=document.getElementById(t),o?a(e(o)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),a(null))})})}function N(t,e){return _(t,t=>{const n=echarts.init(t);n.setOption(e,!0),window.addEventListener("resize",()=>{null!=n&&void 0!==n&&n.resize()});const o=document.getElementById("main-content");return o&&(o.addEventListener("shown.bs.collapse",()=>{n.resize()}),o.addEventListener("hidden.bs.collapse",()=>{n.resize()})),n})}function x(t,e){const n=t?document.querySelector(t):null,o=e?document.querySelector(e):null;n&&(n.hidden=!0),o&&(o.style.background="url('./build/images/nodata1.png') no-repeat top center",o.hidden=!1)}function P(t,e){const n=t?document.querySelector(t):null,o=e?document.querySelector(e):null;n&&(n.hidden=!0),o&&(o.style.background="#ffffff",o.hidden=!1)}function D(t,e=!1,n=!0,o=""){let a=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach(t=>{const r=e?Math.round(t.data):t.data,i=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?`${S(r)} ${o}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${S(r)} ${o}`:"-"}\n </span>\n </div>`;var s;a+=i}),a}function I(t){return 100*(t-120)/t}function L(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>`,o=e?`${t.percent}%`:S(t.value);return`<div> ${n} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${o} </span></div>`}function T(t,e){let n=`${t.name} : `;return n+=`<span style="font-weight:500">${S(Math.round(t.value))}</span>`,e&&(n+=`<span> (${t.percent}%)</span>`),t.marker+n}function $(t){const e=1e6,n=Number(t);return n>=0&&n<e?`${S(n)} €`:n>=e?`${S(n/e)} M €`:"-"}function F(t,e,n){return 0===t.length?(x(`#${e}`,`#${n}`),!1):(P(`#${n}`,`#${e}`),!0)}function R(t,e,n=1){const o=Math.max(...t.map(t=>t[e]))*n;return 5e3*Math.ceil(o/5e3)}function z(t,e,n,o=30,a=15,r=30,i=-70,s=70,l=3){const c=R(t,e.data,1.1),u=s,d=n.slice(),m=[];let f=a,p=r,h=i;for(let n=0;n<t.length;n+=1)m.push({value:t[n][e.data],name:C(String(t[n][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(h)}%`,`${String(f)}%`],fontFamily:"Montserrat",fontSize:o},detail:{offsetCenter:[`${String(h)}%`,`${String(p)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>S(Math.round(t))}}),h+=u,(n+1)%l===0&&(p+=r,f+=2*a,h=i);return[c,m]}function V(t,e,n,o=0){return[R(e,n.data,1),t=>function(t,e,n){const o=S(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 k(t,e){const{resultset:n}={resultset:t},o=new Set,a=new Set,r=n.map(([t,n,r])=>{const i=e?Math.round(r):r;return o.add(t),a.add(n),{day:n,type:t,value:i}}),i=Array.from(a.values()),s=Array.from(o.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,a]}function U(t,e=[],n=!1){const[o,a,r]=k(t,n);return o.forEach(t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())}),[o,r,a]}function B(t,e,n=!1){const[o,a,r]=k(t,n);return o.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[o,r,a]}function W(t){const{resultset:e,metadata:n}=t,o=[];return e.forEach(t=>{const e={};t.forEach((t,o)=>{e[n[o].colName]=t}),o.push(e)}),o}function J(t,e){const n={...t};return Object.keys(e).forEach(o=>{Object.prototype.hasOwnProperty.call(e,o)&&("series"===o&&Array.isArray(e[o])?n[o]=e[o].map((e,n)=>({...Array.isArray(t[o])&&t[o][n]||{},...e})):"object"!=typeof e[o]||null===e[o]||Array.isArray(e[o])?t[o]!==e[o]&&(n[o]=e[o]):n[o]=J(t[o]||{},e[o]))}),n}function j(t,e){const n=()=>{t.forEach(t=>{t.id in e&&Object.entries(e[t.id]).forEach(n=>{const o=n[0],a=n[1];"object"==typeof a?a.className?document.querySelector(a.className).className=t[o]:a.element&&a.format&&(document.querySelector(a.element).textContent=e[t.id][o].format(t[o])):document.querySelector(a).textContent=t[o]})})};try{n()}catch(t){document.body.addEventListener("MainContentLoadedCustom",()=>{n()})}}function q(t,e){const n=W(t),o=[];let a=null;return n.forEach(t=>{const n=t[e];"number"!=typeof n||Number.isNaN(n)||o.push(n)}),o.length>0&&(a=Math.max(...o)),a}function G(t,e){const n=document.querySelector(t);n?n.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function H(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 Y=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],X=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],Z=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],K=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],Q=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function tt(t){const e=t.resultset.map(t=>t[0]);return this.dashboard.fireChange(this.parameter,e),t}function et(t){for(const e of t)if(Array.isArray(e)){if(!et(e))return!1}else if("All"!==e)return!1;return!0}function nt(t,e,n,o){return et(e)?(t.queryDefinition.dataAccessId=n,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=o,!0}function ot(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function at(t){t.forEach(t=>{Dashboards.fireChange(t,["All"])})}function rt(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 it(t="Todos"){const e=rt(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function st(t,e,n,o){const a=Dashboards.getParameterValue(n),r=Dashboards.getParameterValue(o);return Dashboards.fireChange(t,[a]),Dashboards.fireChange(e,[r]),!0}function lt(t,e){const n=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[n]),!0}function ct(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function ut(t,e){const n=Dashboards.getParameterValue(e),o=t.parameter;""!==n&&t.dashboard.setParameter(o,[n])}function dt(t){t.regional.es={monthNames:Y,abbreviatedMonthNames:X,dayNames:Z,abbreviatedDayNames:K,dayNamesMin:Q,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function mt(t,e){const n=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(n)?n:[n]),!0}function ft(t,e,n,o=0){const a=t.resultset.slice(0,n).map(t=>t[o]);return Dashboards.setParameter(e,a),t}function pt(t,e,n){const o=Array.isArray(e)?e:[e];Dashboards.fireChange(t,o);const a=Dashboards.getComponent(n);a&&a.update()}function ht(t,e){return _(t,t=>new Tabulator(t,e))}function yt(t,e){let n=t.getValue();return n.length>e&&(n=`${n.substr(0,e)}<br>${n.substr(e)}`),n}function gt(t,e){const n=t.getValue().split(" ");let o="",a="";return n.forEach(t=>{(a+t).length<=e?a+=`${t} `:(o+=`${a}<br>`,a=`${t} `)}),o+=`${a}<br>`,o}function bt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const n=t.getTreeChildren();n.length>0&&n.forEach(t=>{t.getTreeChildren().length>0&&bt(t,e)})}function At(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&bt(t,e)})}function St(t,e,n,o){const a=[];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,a)=>{const r={[e]:n[a],[o]:t};s._children.push(r)}),a.push(s)}}),a}function vt(t){let e=!0;return t.getGroups().forEach(t=>{t._group.visible&&(e=!1)}),e}function Mt(t,e,n){const o=document.getElementById(n),a=o.cloneNode(!0);o.parentNode.replaceChild(a,o),a.addEventListener("click",()=>{t.download("csv",`${e}.csv`,{delimiter:";",bom:!0})})}function Et(t,e,n){const o=document.getElementById(n),a=o.cloneNode(!0);o.parentNode.replaceChild(a,o),a.addEventListener("click",()=>{const n=t.getRows().map(t=>t.getData()),o=t.getColumns(),a={};o.forEach((t,e)=>{const o=t.getField();o&&n.every(t=>{const e=t[o];return null==e||/^-?\d+([.,]\d+)?$/.test(e.toString().trim())})&&(a[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:a}})})}function Ct(t,e,n){const o=document.getElementById(n);o&&o.addEventListener("click",()=>{t.setGroupStartOpen(!1),t.setData(e)})}function Ot(t,e,n){const o=document.getElementById(n);o&&o.addEventListener("click",()=>{t.setGroupStartOpen(!0),t.setData(e)})}const _t={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 Nt(t){const e=[],n={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function o(t,e,o){const a=document.createElement("td");if(a.setAttribute("id",t),null!=e){a.innerHTML=e;const t=function(t,e){let o;return void 0===e?o=6:"ND"===e?o=7:(o=5,t.forEach((t,n)=>{e<=t&&5===o&&(o=n)})),n[o]}(o,e);a.classList.add(t)}return a}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 a=document.createElement("tr"),r=document.createElement("td");r.innerHTML=n.address,a.appendChild(r),a.appendChild(o(`${n.entityid}_so2`,n.so2value,_t.SO2)),a.appendChild(o(`${n.entityid}_no2`,n.no2value,_t.NO2)),a.appendChild(o(`${n.entityid}_o3`,n.o3value,_t.O3)),a.appendChild(o(`${n.entityid}_pm10`,n.pm10value,_t.PM10)),a.appendChild(o(`${n.entityid}_pm25`,n.pm25value,_t.PM25)),e.push(a)}),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 Pt(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function Dt(t,e){document.querySelectorAll(`[${t}]`).forEach(n=>{!function(t,e,n){const o=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(o.innerHTML=this.responseText,n&&n()),404===this.status&&(o.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(n.getAttribute(t),n,e)})}function It(t){window.realDashboardsInit=Dashboards.init,Dashboards.init=function(){console.warn("Dashboards.init bloqueado temporalmente")},Dt("include-html-cabecera",function(){!function(){const t=Pt();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=Pt();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()}),Dt("include-html-menu"),Dt("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()}),Dt("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 Lt(t,e,n,o,a,r){let i=!1,s=!1;const l=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function d(t=!0){const e=document.querySelector(n);t?(l&&(l.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),s=!0):(e.classList.remove("blur"),u(),s=!1)}const m=t=>{new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(s||u(),i||(i=!0,window.setTimeout(d,r)))})}).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(l&&(l.setAttribute("sandbox","allow-scripts"),m(l)),c&&(c.setAttribute("sandbox","allow-scripts"),m(c)),document.querySelector(a).addEventListener("click",()=>{d(!1),window.setTimeout(d,r)})):document.querySelectorAll(o)[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=>`${v(t)}€`}}]},Tt=(t,e)=>{e.sort((t,e)=>parseInt(t.anyo)-parseInt(e.anyo));const n={};e.forEach(e=>{const o=e[1],a=e[0];a!==t.seriesName||n[o]||(n[o]=0),a===t.seriesName&&(n[o]+=e[2])});let o=`<p>${t.seriesName}</p>`;for(const[e,a]of Object.entries(n))o+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${S(a)}</span></div>`;return o};function $t(t,e,n=void 0,o=void 0){const a=null===o?void 0:o,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=>Tt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,n,o,a){const r={},i=a.contentSize[1]/2,s=a.viewSize[1],l=t[1];return l<i?r.top=10:l+i>s?r.bottom=10:r.top=l-i,t[0]<a.viewSize[0]/2?r.left=t[0]+20:r.right=a.viewSize[0]-t[0]+20,r}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>S(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=>S(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};a&&a.itemStyle&&Array.isArray(a.itemStyle.borderColor)&&(i=[...a.itemStyle.borderColor],delete a.itemStyle.borderColor);const n=function(t){return t.reduce((t,e)=>{const n=e[0];return t[n]||(t[n]=[]),t[n].push(e),t},{})}(e),o=Object.keys(n);r.forEach(t=>{o.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 o={};o=void 0!==a?J(t,a):t,s.push({...o})}),s})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let l={};l=void 0!==n?J(s,n):s,N(t,l)}function Ft(t){let e={};return e=J(wt,t),e}function Rt(t,e,n={},o={}){let r={};r=J(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:J(o,i),l=e;l.forEach((t,e)=>{l[e][0]=a(t[0])}),$t(t,l,r,s)}function zt(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=>T(t,!1)},series:[{type:"bar",showBackground:!0}]};let o={};o=void 0!==e?J(n,e):n,N(t,o)}function Vt(t){return Math.max(...t.map(t=>Number(t[0])))}function kt(t){const e=t.filter(e=>Number(e[0])===Vt(t)),n=Array.from({length:12},()=>0);return e.forEach(([t,e,o])=>{const a=parseInt(e,10)-1;n[a]=o}),n}function Ut(t){const e=t.filter(e=>Number(e[0])===Vt(t)-1),n=Array.from({length:12},()=>0);return e.forEach(([t,e,o])=>{const a=parseInt(e,10)-1;n[a]=o}),n}function Bt(t,e,n=void 0){const o=Vt(e).toString(),a=(Vt(e)-1).toString();zt(t,J({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[a,o],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:h(),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:a,type:"bar",data:Ut(e)},{name:o,type:"bar",barGap:0,data:kt(e)}]},n))}function Wt(t,e,n){const o=document.querySelector(e),a=document.querySelector(t);let r=!1;a.addEventListener("click",()=>{!1===r&&(r=!0,o.setAttribute("src","about:blank"),o.setAttribute("src",n),o.onload=()=>{r=!1})}),a.disabled=!1}const Jt="id",jt="fecha",qt="value";function Gt(t,e,n,o,a="es_ES"){const[r,i]=function(t,e,n){const o=[],a=[];return t.forEach(t=>{e.includes(`${t[Jt]}`)?o.push(`${t[jt]}`):n.includes(`${t[Jt]}`)&&a.push(`${t[jt]}`)}),[o.map(t=>[t,0]),a.map(t=>[t,0])]}(t,n,o);let s="es_ES"==a?"Datos sin validar":"Dades sense validar";0===i.length&&(s="");const l={name:"Datos validados",type:"line",data:[...r,i[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",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,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:u,yAxis:Math.max(...t.filter(t=>null!==t[qt]).map(t=>parseInt(`${t[qt]}`,10)))}]]}}]}function Ht(t,e,n=void 0){N(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=>D(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()},5606(t){var e,n,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(e===setTimeout)return setTimeout(t,0);if((e===a||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:a}catch(t){e=a}try{n="function"==typeof clearTimeout?clearTimeout:r}catch(t){n=r}}();var s,l=[],c=!1,u=-1;function d(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&m())}function m(){if(!c){var t=i(d);c=!0;for(var e=l.length;e;){for(s=l,l=[];++u<e;)s&&s[u].run();u=-1,e=l.length}s=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===r||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{return n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function p(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new f(t,e)),1!==l.length||c||i(m)},f.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}}},e={};function n(o){var a=e[o];if(void 0!==a)return a.exports;var r=e[o]={exports:{}};return t[o](r,r.exports,n),r.exports}n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},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 o={};return(()=>{"use strict";n.r(o),n.d(o,{echartHeatMap:()=>k,echartNO:()=>M,echartNO2:()=>S,echartNO2Portada:()=>A,echartNO2PresupuestosParticipativos:()=>v,echartNOPresupuestosParticipativos:()=>E,echartNOX:()=>C,echartNOXPresupuestosParticipativos:()=>O,echartO3:()=>w,echartO3PresupuestosParticipativos:()=>T,echartPM1:()=>x,echartPM10:()=>_,echartPM10PresupuestosParticipativos:()=>N,echartPM1PresupuestosParticipativos:()=>P,echartPM25:()=>D,echartPM25PresupuestosParticipativos:()=>I,echartSO2:()=>$,echartSO2PresupuestosParticipativos:()=>F,heatMapChart:()=>d,listeneresContamina:()=>g,loadContamincaioMap:()=>U});var t=n(2725);n(5606);const e="#000",a="Montserrat",r="normal",i="heatmap",s={show:!0,position:["50%","50%"],color:"transparent",fontSize:10,emphasis:{fontSize:26,color:e},align:"center",verticalAlign:"middle",opacity:1,fontWeight:"600",fontFamily:a},l={itemStyle:{opacity:1}};function c(t){return{formatter:"{value}",textStyle:{fontSize:t,fontFamily:a,color:"#333",fontWeight:"600"},margin:15}}function u(e,n){const o=t.THRESHOLDS[n];if(!o)return;const a=["#00ffff","#00b050","#ffcc00","#ff3300","#9a0000","#9a00ff"];for(let t=0;t<o.length;t+=1)if(e<=o[t])return a[t];return a[a.length-1]}function d(t,n,o){const d=document.getElementById("chartGasometroMapa");if(!d)return void console.error("Element with id 'chartGasometroMapa' not found");const m=echarts.init(d,null,{renderer:"canvas",useDirtyRect:!1}),f={title:{text:o,textStyle:{color:e,fontStyle:r,fontWeight:"600",fontFamily:a,fontSize:30}},tooltip:{renderMode:"html",formatter:t=>[`<b>${t.seriesName}</b>`,'<hr size="1" style="margin: 3px 0">',`${t.value[0]}:<br/>`,' <span style="display: block; text-align: right;">',` <b style="font-size: 120%;">${t.value[2]}</b> µg/m<sup>3</sup>`," </span>"].join(""),textStyle:{color:e,fontStyle:r,fontWeight:"400",fontFamily:a,fontSize:15}},toolbox:{feature:{dataZoom:{yAxisIndex:"none"},restore:{},saveAsImage:{}},right:10,top:10},legend:{data:["NO2","SO2","PM10","PM-2.5","O3"],top:"5%",show:!1,textStyle:{color:"#333",fontStyle:r,fontWeight:"600",fontFamily:a,fontSize:15}},grid:{top:"18%",left:".5%",right:".5%",bottom:"3%",containLabel:!0,height:"67%"},xAxis:{type:"category",data:t,axisLabel:c(12),nameGap:"5px"},yAxis:{type:"category",data:["NO2","SO2","PM10","PM25","O3"],axisLabel:c(16),splitArea:{show:!1}},dataZoom:[{type:"slider",show:!0,xAxisIndex:[0],start:97,end:100}],series:[{name:"O<sup>3</sup> validados",type:i,data:n.o3.validate,label:s,itemStyle:{color:t=>u(t.value[2],"O3"),opacity:.5},emphasis:l},{name:"O<sup>3</sup> no validados",type:i,data:n.o3.invalidate,label:s,itemStyle:{color:t=>u(t.value[2],"O3"),opacity:.3},emphasis:l},{name:"NO<sup>2</sup> validados",type:i,data:n.no2.validate,label:s,itemStyle:{color:t=>u(t.value[2],"NO2"),opacity:.5},emphasis:l},{name:"NO<sup>2</sup> no validados",type:i,data:n.no2.invalidate,label:s,itemStyle:{color:t=>u(t.value[2],"NO2"),opacity:.3},emphasis:l},{name:"SO<sup>2</sup> validados",type:i,data:n.so2.validate,label:s,itemStyle:{color:t=>u(t.value[2],"SO2"),opacity:.5},emphasis:l},{name:"SO<sup>2</sup> no validados",type:i,data:n.so2.invalidate,label:s,itemStyle:{color:t=>u(t.value[2],"SO2"),opacity:.3},emphasis:l},{name:"PM-10 validados",type:i,data:n.pm10.validate,label:s,itemStyle:{color:t=>u(t.value[2],"PM10"),opacity:.5},emphasis:l},{name:"PM-10 no validados",type:i,data:n.pm10.invalidate,label:s,itemStyle:{color:t=>u(t.value[2],"PM10"),opacity:.3},emphasis:l},{name:"PM-25 validados",type:i,data:n.pm25.validate,label:s,itemStyle:{color:t=>u(t.value[2],"PM25"),opacity:.5},emphasis:l},{name:"PM-25 no validados",type:i,data:n.pm25.invalidate,label:s,itemStyle:{color:t=>u(t.value[2],"PM25"),opacity:.3},emphasis:l}]};f&&m.setOption(f),window.addEventListener("resize",m.resize)}function m(t){return function(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)}(t)}function f(t,e,n=!1){const{resultset:o}={resultset:t},a=new Set,r=new Set,i=e,s=o.map(([t,e,o])=>{const i=n?Math.round(o):o;return a.add(t),r.add(e),{day:e,type:t,value:i}}),l=Array.from(r.values()),c=Array.from(a.values());return c.sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0})),[c.map(t=>{const e=s.filter(e=>e.type===t).map(({day:e,value:n})=>[e,t,n]),n=l.map(t=>{const n=e.find(([e])=>e===t);return n?n[2]:null});return{name:t,type:"line",symbol:"circle",color:i.shift(),symbolSize:6,smooth:!1,data:n}}),r,c]}function p(t){return`${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 h(t){return 100*(t-120)/t}const y=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"];function g(){render_echartPM10.listeners=["filterDatesParam","updateFilter"],render_echartPM1.listeners=["filterDatesParam","updateFilter"],render_echartPM25.listeners=["filterDatesParam","updateFilter"],render_echartO3.listeners=["filterDatesParam","updateFilter"],render_echartSO2.listeners=["filterDatesParam","updateFilter"],render_echartNO2.listeners=["filterDatesParam","updateFilter"],render_echartNO.listeners=["filterDatesParam","updateFilter"],render_echartNOX.listeners=["filterDatesParam","updateFilter"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter")}function b(t,e,n,o,a,r){return{title:{text:o},legend:{show:!0,data:e},xAxis:{type:"category",data:t},yAxis:{name:a,nameTextStyle:{padding:[-25,0,0,-22]},axisLabel:{formatter:m}},dataZoom:{show:r,data:t,start:n},toolbox:{show:!0}}}function A(t,e){z(e,"µg/m3","echartNO2Portada","CONTAMINACIÓ NO2",!1,!0)}function S(t,e){z(e,"µg/m3","chartNO2CEAM","CONTAMINACIÓ NO2\nEstacions CEAM")}function v(t,e){V(e,"µg/m3","chartNO2PRESUPUESTO","CONTAMINACIÓ NO2\nEstacions de Pressupostos Participatius")}function M(t,e){z(e,"µg/m3","chartNOCEAM","CONTAMINACIÓ NO\nEstacions CEAM")}function E(t,e){V(e,"µg/m3","chartNOPRESUPUESTO","CONTAMINACIÓ NO\nEstacions de Pressupostos Participatius")}function C(t,e){z(e,"µg/m3","chartNOXCEAM","CONTAMINACIÓ NOX\nEstacions CEAM")}function O(t,e){V(e,"µg/m3","chartNOXPRESUPUESTO","CONTAMINACIÓ NOX\nEstacions de Pressupostos Participatius")}function _(t,e){z(e,"µg/m3","chartPM10CEAM","CONTAMINACIÓ PM10\nEstacions CEAM")}function N(t,e){V(e,"µg/m3","chartPM10PRESUPUESTO","CONTAMINACIÓ PM10\nEstacions de Pressupostos Participatius")}function x(t,e){z(e,"µg/m3","chartPM1CEAM","CONTAMINACIÓ PM1\nEstacions CEAM")}function P(t,e){V(e,"µg/m3","chartPM1PRESUPUESTO","CONTAMINACIÓ PM1\nEstacions de Pressupostos Participatius")}function D(t,e){z(e,"µg/m3","chartPM25CEAM","CONTAMINACIÓ PM2,5\nEstacions CEAM")}function I(t,e){V(e,"µg/m3","chartPM25PRESUPUESTO","CONTAMINACIÓ PM25\nEstacions de Pressupostos Participatius")}function w(t,e){z(e,"µg/m3","chartO3CEAM","CONTAMINACIÓ O3\nEstacions CEAM")}function T(t,e){V(e,"µg/m3","chartO3PRESUPUESTO","CONTAMINACIÓ O3\nEstacions de Pressupostos Participatius")}function $(t,e){z(e,"µg/m3","chartSO2CEAM","CONTAMINACIÓ SO2\nEstacions CEAM")}function F(t,e){V(e,"µg/m3","chartSO2PRESUPUESTO","CONTAMINACIÓ SO2\nEstacions de Pressupostos Participatius")}function R(t,e){let n;switch(e.toUpperCase()){case"NO2":n=4;break;case"SO2":n=5;break;case"PM10":n=6;break;case"PM25":n=7;break;case"O3":n=8;break;default:return console.error("Unknown pollutant: ",e),[]}return t.map(t=>{const o=t[1],a=t[n-1];return[o,e.toUpperCase(),a]})}function z(e,n,o,a="Estaciones CEAM ",r=!0,i=!1){const s=y.slice(),l=f(e.resultset||e,s,!1),c=l[1],u=Array.from(c.values()),d=l[2],p=h(c.size),g=(0,t.resultsetWithFields)(e),A=(0,t.configureDataValidate)(g,l[0],["A01_AVFRANCIA_24h_va","A02_BULEVARDSUD_24h_va","A03_MOLISOL_24h_va","A04_PISTASILLA_24h_va","A05_POLITECNIC_24h_va","A06_VIVERS_24h_va","A07_VALENCIACENTRE_24h_va","A09_CABANYAL_24h_va","A01_AVFRANCIA_24h_vm","A02_BULEVARDSUD_24h_vm","A03_MOLISOL_24h_vm","A04_PISTASILLA_24h_vm","A05_POLITECNIC_24h_vm","A06_VIVERS_24h_vm","A07_VALENCIACENTRE_24h_vm","A09_CABANYAL_24h_vm"],["A01_AVFRANCIA_24h","A02_BULEVARDSUD_24h","A03_MOLISOL_24h","A04_PISTASILLA_24h","A05_POLITECNIC_24h","A06_VIVERS_24h","A07_VALENCIACENTRE_24h","A09_CABANYAL_24h"]);if(!1===i){const e=b(u,d,p,a,n,r);(0,t.configureLinesChartValidates)(o,A,e)}else{const e=function(t,e,n,o,a,r){return{grid:{left:"5",right:"0",bottom:"0",top:"200"},title:{text:o},legend:{show:!0,data:e},xAxis:{type:"category",data:t,axisLabel:{margin:15}},yAxis:{name:a,nameGap:"25",nameTextStyle:{padding:[0,0,0,-28],align:"left"},axisLabel:{formatter:m,align:"right",padding:[0,0,0,0]}},dataZoom:{show:r,data:t,start:n},toolbox:{show:!1}}}(u,d,p,a,n,r);(0,t.configureLinesChartValidates)(o,A,e)}}function V(e,n,o,a){e=function(t){return t.resultset=t.resultset.map(t=>(t[0]=t[0].replace(/^A\d{2}_/,""),t)),t}(e);const r=y.slice(),i=f(e.resultset||e,r,!1),s=i[1],l=Array.from(s.values()),c=i[2],u=h(s.size),d=(0,t.resultsetWithFields)(e),m=(0,t.configureDataValidate)(d,i[0],[],["A08_DR_LLUCH_24h","A10_OLIVERETA_24h","A11_PATRAIX_24h"]),p=b(l,c,u,a,n);(0,t.configureLinesChartValidates)(o,m,p)}function k(t,e){let n=[],o=[],a=[],r=[];n=function(t){const e=["A01_AVFRANCIA_24h_va","A02_BULEVARDSUD_24h_va","A03_MOLISOL_24h_va","A04_PISTASILLA_24h_va","A05_POLITECNIC_24h_va","A06_VIVERS_24h_va","A07_VALENCIACENTRE_24h_va","A01_AVFRANCIA_24h_vm","A02_BULEVARDSUD_24h_vm","A03_MOLISOL_24h_vm","A04_PISTASILLA_24h_vm","A05_POLITECNIC_24h_vm","A06_VIVERS_24h_vm","A07_VALENCIACENTRE_24h_vm"],n=["A01_AVFRANCIA_24h","A02_BULEVARDSUD_24h","A03_MOLISOL_24h","A04_PISTASILLA_24h","A05_POLITECNIC_24h","A06_VIVERS_24h","A07_VALENCIACENTRE_24h"],o=[],a=[],r=[],i=[];return t.forEach(t=>{n.includes(t[2])?o.push(t):e.includes(t[2])&&a.push(t),r.push(t[1])}),i.push(a),i.push(o),i.push(r),i}(e.filter(e=>e[8]===t)),o=n[0],a=n[1],r=n[2];const i="pm10",s="pm25";d(r,{no2:{validate:R(o,"no2"),invalidate:R(a,"no2")},so2:{validate:R(o,"so2"),invalidate:R(a,"so2")},pm10:{validate:R(o,i),invalidate:R(a,i)},pm25:{validate:R(o,s),invalidate:R(a,s)},o3:{validate:R(o,"o3"),invalidate:R(a,"o3")}},t)}function U(){var t;let e;const n=L.icon({iconUrl:p("build/images/mapas/marker-icon-polucion.svg/content"),iconSize:[34,34],shadowSize:[50,64],iconAnchor:[17,17],shadowAnchor:[4,62],popupAnchor:[0,-26]}),o=L.icon({iconUrl:p("build/images/mapas/marker-icon-selected-polucion.svg/content"),iconSize:[34,34],shadowSize:[50,64],iconAnchor:[17,17],shadowAnchor:[4,62],popupAnchor:[0,-26]});t=L.map("myMap").setView([39.47225,-.37739],14);let a=L.tileLayer("https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>',subdomains:"abcd",maxZoom:20});t.setMinZoom(5),t.setMaxZoom(20),a.addTo(t),L.geoJSON(legacy.obtenerGeoJson(resultadoContaminacion,0,8,9),{onEachFeature:function(t,a){!function(t,e){if(t.properties&&t.properties.objectoId){let n=t.properties.address;e.bindPopup(n),e.on("click",()=>k(n,resultadoContaminacion))}}(t,a),function(t){t.on("click",t=>{var a;a=t.target,e&&e.setIcon(n),e=a,e.setIcon(o)})}(a)},pointToLayer:function(t,e){return L.marker(e,{icon:n})}}).addTo(t)}})(),o})());
|
package/dist/js/emt.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.emt=e():t.emt=e()}(self,()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[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:()=>n,MONTHS_YEAR_SHORT:()=>i,TEXTS_COMMON:()=>s,THRESHOLDS:()=>$t,addPointInteger:()=>M,buildCamarasTrafico:()=>Ft,buildTableCalidadAire:()=>xt,calculateMaxYAxis:()=>F,calculatePentahoPath:()=>Lt,calculateXAxisStart:()=>w,capitalizarTexto:()=>D,checkAllGroupsCollapsed:()=>Et,configureDataBar:()=>G,configureDataGaugeCommon:()=>R,configureDataGaugeMonthCommon:()=>z,configureDataLine:()=>_,configureDataValidate:()=>jt,configureLinesChartValidates:()=>Jt,convertDateToInteger:()=>b,convertISODateToEUDate:()=>S,convertToLanguageSelectorDateRange:()=>dt,convertToTableTreeView:()=>Mt,downloadCSVTable:()=>Tt,downloadPDFTable:()=>At,formatCellMultiplesLines:()=>yt,formatDayMonthYear:()=>d,formatMilMillionEuros:()=>O,formatMonthAnyo:()=>u,formatName:()=>v,formatNameHeaderColumn:()=>gt,formatRoundTooltip:()=>P,formatShortMonthShortYear:()=>h,formatShortMonthYear:()=>f,formatToMillions:()=>E,formatToTons:()=>T,formatTooltip:()=>U,formatTooltipPie:()=>N,formatTrimestre:()=>m,formatWithPrefix:()=>A,getEnvironment:()=>Ct,getMaxFieldNumberFromData:()=>W,getMonth:()=>o,getMonthList:()=>p,getSelectCommonOptions:()=>nt,getSelectTwoColumnsOptions:()=>it,initBarChart:()=>Rt,initBarChartComparationMonth:()=>Gt,initChart:()=>x,initContractAllGroups:()=>vt,initElement:()=>$,initExpandAllGroups:()=>Dt,initStackedBarChart:()=>Ot,initStackedBarChartMonthSeries:()=>kt,initTable:()=>pt,initValueDefaultDate:()=>ct,initialCalls:()=>wt,loadIframeOnClickEvent:()=>Vt,printDataChart:()=>C,printDataInHTMLElements:()=>Y,printEchart:()=>I,printNoDataChart:()=>L,resetFilter:()=>ot,resetFilterAndUpdate:()=>mt,resetFilterDate:()=>lt,resetFilterDates:()=>st,resetFilterToDefault:()=>ft,resultsetWithFields:()=>V,selectConfigDatasource:()=>rt,selectConfigDatasourceAllValue:()=>at,selectFilterAll:()=>tt,selectFilterNumItemsDefault:()=>ht,selectValueDefaultInFilter:()=>ut,separateDayMonthYearToSlash:()=>l,splitDataset:()=>J,subtractOneDay:()=>g,subtractOneMonth:()=>y,traverseRows:()=>St,updateDomElement:()=>j,updateObject:()=>q,updateStackedBarOptions:()=>It});const r="es_ES",a=(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"]]),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"]]),{"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 o(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 n={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"]])},i={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 l(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function c(t){return[t.substring(0,4),a[t.substring(4,6)]]}function u(t){const[e,r]=c(t);return`${r} ${e}`}function d(t){const[e,r,o]=function(t){return[t.substring(0,4),a[t.substring(4,6)],t.substring(6,8)]}(t);return`${o} ${r} ${e}`}function f(t){const[e,r]=c(t);return`${r.substring(0,3)} ${e}`}function h(t){const[e,r]=c(t);return`${r.substring(0,3)} '${e.substring(2,4)}`}function m(t){const[e,r]=t.split("-");return`${parseFloat(r)/3}T ${e}`}function p(){const t=n[r];return Array.from(t.values()).map(t=>t.slice(0,3))}function g(t){const e=Math.floor(t/1e4),r=new Date(e,t%1e4/100-1,t%100);return r.setDate(r.getDate()-1),`${r.getFullYear()}${(r.getMonth()+1).toString().padStart(2,"0")}${r.getDate().toString().padStart(2,"0")}`}function y(t){const e=new Date(Math.floor(t/100),t%100-1,0);return`${e.getFullYear()}${(e.getMonth()+1).toString().padStart(2,"0")}`}function b(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function S(t){if(!t||"string"!=typeof t)return"";const[e,r,a]=t.split("-");return`${a}/${r}/${e}`}function M(t,e=2){let r=navigator.language||navigator.userLanguage;r=r.length<=2?`${r}-${r.toUpperCase()}`:r;const a={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===r?t.toLocaleString("de-DE",a):t.toLocaleString(r,a)}function E(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function T(t){return t>=1e3?t/1e3+" Tn":t.toString()}function A(t){let e,r;return t>=1e6?(e=t/1e6,r="G"):t>=1e3?(e=t/1e3,r="M"):(e=t,r="k"),{value:Math.round(100*e)/100,prefix:r}}function v(t,e=29){if(t.length>=e){const r=t.split(" ");let a="",o="";return r.forEach(t=>{`${a} ${t}`.length<=e?a+=(a?" ":"")+t:(o+=`${a}\n`,a=t)}),o+=a,o}return t}function D(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,r)=>e+r[0].toUpperCase())}function $(t,e,r="MainContentLoadedCustom"){let a=document.getElementById(t);return a?Promise.resolve(e(a)):new Promise(o=>{document.body.addEventListener(r,()=>{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 $(t,t=>{const r=echarts.init(t);r.setOption(e,!0),window.addEventListener("resize",()=>{null!=r&&void 0!==r&&r.resize()});const a=document.getElementById("main-content");return a&&(a.addEventListener("shown.bs.collapse",()=>{r.resize()}),a.addEventListener("hidden.bs.collapse",()=>{r.resize()})),r})}function L(t,e){const r=t?document.querySelector(t):null,a=e?document.querySelector(e):null;r&&(r.hidden=!0),a&&(a.style.background="url('./build/images/nodata1.png') no-repeat top center",a.hidden=!1)}function C(t,e){const r=t?document.querySelector(t):null,a=e?document.querySelector(e):null;r&&(r.hidden=!0),a&&(a.style.background="#ffffff",a.hidden=!1)}function U(t,e=!1,r=!0,a=""){let o=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach(t=>{const n=e?Math.round(t.data):t.data,i=r?`<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?`${M(n)} ${a}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${M(n)} ${a}`:"-"}\n </span>\n </div>`;var s;o+=i}),o}function w(t){return 100*(t-120)/t}function F(t,e){const r=Math.max(...t);return r+(e-r%e)}function N(t,e=!1){const r=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,a=e?`${t.percent}%`:M(t.value);return`<div> ${r} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${a} </span></div>`}function P(t,e){let r=`${t.name} : `;return r+=`<span style="font-weight:500">${M(Math.round(t.value))}</span>`,e&&(r+=`<span> (${t.percent}%)</span>`),t.marker+r}function O(t){const e=1e6,r=Number(t);return r>=0&&r<e?`${M(r)} €`:r>=e?`${M(r/e)} M €`:"-"}function I(t,e,r){return 0===t.length?(L(`#${e}`,`#${r}`),!1):(C(`#${r}`,`#${e}`),!0)}function k(t,e,r=1){const a=Math.max(...t.map(t=>t[e]))*r;return 5e3*Math.ceil(a/5e3)}function R(t,e,r,a=30,o=15,n=30,i=-70,s=70,l=3){const c=k(t,e.data,1.1),u=s,d=r.slice(),f=[];let h=o,m=n,p=i;for(let r=0;r<t.length;r+=1)f.push({value:t[r][e.data],name:v(String(t[r][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(p)}%`,`${String(h)}%`],fontFamily:"Montserrat",fontSize:a},detail:{offsetCenter:[`${String(p)}%`,`${String(m)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>M(Math.round(t))}}),p+=u,(r+1)%l===0&&(m+=n,h+=2*o,p=i);return[c,f]}function z(t,e,r,a=0){return[k(e,r.data,1),t=>function(t,e,r){const a=M(Math.round(e)),n=o(t[r][0]),i=t[r][1],s=`\n${n} ${i} : ${a}`,l=`${a}\n${n} ${i}`;return window.innerWidth<=1710?s:l}(e,t,a),[{value:e[a][r.data]}]]}function B(t,e){const{resultset:r}={resultset:t},a=new Set,o=new Set,n=r.map(([t,r,n])=>{const i=e?Math.round(n):n;return a.add(t),o.add(r),{day:r,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=n.filter(e=>e.type===t).map(({day:e,value:r})=>[e,t,r]),r=i.map(t=>{const r=e.find(([e])=>e===t);return r?r[2]:null});return{name:t,data:r}}),s,o]}function _(t,e=[],r=!1){const[a,o,n]=B(t,r);return a.forEach(t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())}),[a,n,o]}function G(t,e,r=!1){const[a,o,n]=B(t,r);return a.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[a,n,o]}function V(t){const{resultset:e,metadata:r}=t,a=[];return e.forEach(t=>{const e={};t.forEach((t,a)=>{e[r[a].colName]=t}),a.push(e)}),a}function q(t,e){const r={...t};return Object.keys(e).forEach(a=>{Object.prototype.hasOwnProperty.call(e,a)&&("series"===a&&Array.isArray(e[a])?r[a]=e[a].map((e,r)=>({...Array.isArray(t[a])&&t[a][r]||{},...e})):"object"!=typeof e[a]||null===e[a]||Array.isArray(e[a])?t[a]!==e[a]&&(r[a]=e[a]):r[a]=q(t[a]||{},e[a]))}),r}function Y(t,e){const r=()=>{t.forEach(t=>{t.id in e&&Object.entries(e[t.id]).forEach(r=>{const a=r[0],o=r[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{r()}catch(t){document.body.addEventListener("MainContentLoadedCustom",()=>{r()})}}function W(t,e){const r=V(t),a=[];let o=null;return r.forEach(t=>{const r=t[e];"number"!=typeof r||Number.isNaN(r)||a.push(r)}),a.length>0&&(o=Math.max(...a)),o}function j(t,e){const r=document.querySelector(t);r?r.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function J(t,e=!0){const r={Cont:[],Mob:[]};return t.forEach(t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?r.Cont.push([t[3],t[4],t[2]]):r.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?r.Mob.push([t[3],t[4],t[2]]):r.Mob.push([t[3],t[2]]))}),r}const H=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Z=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],X=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],K=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],Q=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function tt(t){const e=t.resultset.map(t=>t[0]);return this.dashboard.fireChange(this.parameter,e),t}function et(t){for(const e of t)if(Array.isArray(e)){if(!et(e))return!1}else if("All"!==e)return!1;return!0}function rt(t,e,r,a){return et(e)?(t.queryDefinition.dataAccessId=r,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=a,!0}function at(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 it(t="Todos"){const e=nt(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function st(t,e,r,a){const o=Dashboards.getParameterValue(r),n=Dashboards.getParameterValue(a);return Dashboards.fireChange(t,[o]),Dashboards.fireChange(e,[n]),!0}function lt(t,e){const r=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[r]),!0}function ct(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function ut(t,e){const r=Dashboards.getParameterValue(e),a=t.parameter;""!==r&&t.dashboard.setParameter(a,[r])}function dt(t){t.regional.es={monthNames:H,abbreviatedMonthNames:Z,dayNames:X,abbreviatedDayNames:K,dayNamesMin:Q,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function ft(t,e){const r=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(r)?r:[r]),!0}function ht(t,e,r,a=0){const o=t.resultset.slice(0,r).map(t=>t[a]);return Dashboards.setParameter(e,o),t}function mt(t,e,r){const a=Array.isArray(e)?e:[e];Dashboards.fireChange(t,a);const o=Dashboards.getComponent(r);o&&o.update()}function pt(t,e){return $(t,t=>new Tabulator(t,e))}function gt(t,e){let r=t.getValue();return r.length>e&&(r=`${r.substr(0,e)}<br>${r.substr(e)}`),r}function yt(t,e){const r=t.getValue().split(" ");let a="",o="";return r.forEach(t=>{(o+t).length<=e?o+=`${t} `:(a+=`${o}<br>`,o=`${t} `)}),a+=`${o}<br>`,a}function bt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const r=t.getTreeChildren();r.length>0&&r.forEach(t=>{t.getTreeChildren().length>0&&bt(t,e)})}function St(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&bt(t,e)})}function Mt(t,e,r,a){const o=[];return Object.keys(t).forEach(n=>{if(Object.prototype.hasOwnProperty.call(t,n)){const i=t[n],s={[e]:i[0],_children:[]};i.shift(),i.forEach((t,o)=>{const n={[e]:r[o],[a]:t};s._children.push(n)}),o.push(s)}}),o}function Et(t){let e=!0;return t.getGroups().forEach(t=>{t._group.visible&&(e=!1)}),e}function Tt(t,e,r){const a=document.getElementById(r),o=a.cloneNode(!0);a.parentNode.replaceChild(o,a),o.addEventListener("click",()=>{t.download("csv",`${e}.csv`,{delimiter:";",bom:!0})})}function At(t,e,r){const a=document.getElementById(r),o=a.cloneNode(!0);a.parentNode.replaceChild(o,a),o.addEventListener("click",()=>{const r=t.getRows().map(t=>t.getData()),a=t.getColumns(),o={};a.forEach((t,e)=>{const a=t.getField();a&&r.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 vt(t,e,r){const a=document.getElementById(r);a&&a.addEventListener("click",()=>{t.setGroupStartOpen(!1),t.setData(e)})}function Dt(t,e,r){const a=document.getElementById(r);a&&a.addEventListener("click",()=>{t.setGroupStartOpen(!0),t.setData(e)})}const $t={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=[],r={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,r)=>{e<=t&&5===a&&(a=r)})),r[a]}(a,e);o.classList.add(t)}return o}return t.forEach(t=>{const r=t;"noData"===r.operationalstatus&&(r.so2value="ND",r.no2value="ND",r.o3value="ND",r.pm10value="ND",r.pm25value="ND");const o=document.createElement("tr"),n=document.createElement("td");n.innerHTML=r.address,o.appendChild(n),o.appendChild(a(`${r.entityid}_so2`,r.so2value,$t.SO2)),o.appendChild(a(`${r.entityid}_no2`,r.no2value,$t.NO2)),o.appendChild(a(`${r.entityid}_o3`,r.o3value,$t.O3)),o.appendChild(a(`${r.entityid}_pm10`,r.pm10value,$t.PM10)),o.appendChild(a(`${r.entityid}_pm25`,r.pm25value,$t.PM25)),e.push(o)}),e}function Lt(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function Ct(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function Ut(t,e){document.querySelectorAll(`[${t}]`).forEach(r=>{!function(t,e,r){const a=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(a.innerHTML=this.responseText,r&&r()),404===this.status&&(a.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(r.getAttribute(t),r,e)})}function wt(t){window.realDashboardsInit=Dashboards.init,Dashboards.init=function(){console.warn("Dashboards.init bloqueado temporalmente")},Ut("include-html-cabecera",function(){!function(){const t=Ct();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=Ct();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()}),Ut("include-html-menu"),Ut("include-html-main-container",function(){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()}),Ut("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,r,a,o,n){let i=!1,s=!1;const l=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function d(t=!0){const e=document.querySelector(r);t?(l&&(l.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),s=!0):(e.classList.remove("blur"),u(),s=!1)}const f=t=>{new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(s||u(),i||(i=!0,window.setTimeout(d,n)))})}).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",()=>{d(!1),window.setTimeout(d,n)})):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=>`${E(t)}€`}}]},Pt=(t,e)=>{e.sort((t,e)=>parseInt(t.anyo)-parseInt(e.anyo));const r={};e.forEach(e=>{const a=e[1],o=e[0];o!==t.seriesName||r[a]||(r[a]=0),o===t.seriesName&&(r[a]+=e[2])});let a=`<p>${t.seriesName}</p>`;for(const[e,o]of Object.entries(r))a+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${M(o)}</span></div>`;return a};function Ot(t,e,r=void 0,a=void 0){const o=null===a?void 0:a,n=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=>Pt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,r,a,o){const n={},i=o.contentSize[1]/2,s=o.viewSize[1],l=t[1];return l<i?n.top=10:l+i>s?n.bottom=10:n.top=l-i,t[0]<o.viewSize[0]/2?n.left=t[0]+20:n.right=o.viewSize[0]-t[0]+20,n}},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=>M(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(n),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>M(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 r=function(t){return t.reduce((t,e)=>{const r=e[0];return t[r]||(t[r]=[]),t[r].push(e),t},{})}(e),a=Object.keys(r);n.forEach(t=>{a.forEach(e=>{void 0===r[e].find(e=>e[1]===t)&&(r[e].push([r[e][0][0],t,void 0]),r[e].sort())})});const s=[];return Object.keys(r).forEach(e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=r[e].map(t=>t[2]);let a={};a=void 0!==o?q(t,o):t,s.push({...a})}),s})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let l={};l=void 0!==r?q(s,r):s,x(t,l)}function It(t){let e={};return e=q(Nt,t),e}function kt(t,e,r={},a={}){let n={};n=q(r,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach(e=>{t.add(e[1])}),Array.from(t).sort((t,e)=>t-e)}()}});const i={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},s=null===a?i:q(a,i),l=e;l.forEach((t,e)=>{l[e][0]=o(t[0])}),Ot(t,l,n,s)}function Rt(t,e=void 0){const r={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=>P(t,!1)},series:[{type:"bar",showBackground:!0}]};let a={};a=void 0!==e?q(r,e):r,x(t,a)}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)),r=Array.from({length:12},()=>0);return e.forEach(([t,e,a])=>{const o=parseInt(e,10)-1;r[o]=a}),r}function _t(t){const e=t.filter(e=>Number(e[0])===zt(t)-1),r=Array.from({length:12},()=>0);return e.forEach(([t,e,a])=>{const o=parseInt(e,10)-1;r[o]=a}),r}function Gt(t,e,r=void 0){const a=zt(e).toString(),o=(zt(e)-1).toString();Rt(t,q({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:p(),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)}]},r))}function Vt(t,e,r){const a=document.querySelector(e),o=document.querySelector(t);let n=!1;o.addEventListener("click",()=>{!1===n&&(n=!0,a.setAttribute("src","about:blank"),a.setAttribute("src",r),a.onload=()=>{n=!1})}),o.disabled=!1}const qt="id",Yt="fecha",Wt="value";function jt(t,e,r,a,o="es_ES"){const[n,i]=function(t,e,r){const a=[],o=[];return t.forEach(t=>{e.includes(`${t[qt]}`)?a.push(`${t[Yt]}`):r.includes(`${t[qt]}`)&&o.push(`${t[Yt]}`)}),[a.map(t=>[t,0]),o.map(t=>[t,0])]}(t,r,a);let s="es_ES"==o?"Datos sin validar":"Dades sense validar";0===i.length&&(s="");const l={name:"Datos validados",type:"line",data:[...n,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,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:u,yAxis:Math.max(...t.filter(t=>null!==t[Wt]).map(t=>parseInt(`${t[Wt]}`,10)))}]]}}]}function Jt(t,e,r=void 0){x(t,q({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=>U(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},r))}return e})(),t.exports=e()}},e={};function r(a){var o=e[a];if(void 0!==o)return o.exports;var n=e[a]={exports:{}};return t[a](n,n.exports,r),n.exports}r.d=(t,e)=>{for(var a in e)r.o(e,a)&&!r.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.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";r.r(a),r.d(a,{chargeData:()=>J,clearInputs:()=>V,createSerie:()=>H,echartLineLinia:()=>K,echartLineTitol:()=>X,echartUsuarisPerLinea:()=>Et,echartUsuarisPerLiniaBarYear:()=>$t,echartUsuarisPerLiniaGaugeMonth:()=>ft,echartUsuarisPerLiniaGaugeYear:()=>ut,echartUsuarisPerLiniaLineMonth:()=>vt,echartUsuarisPerTitol:()=>St,echartUsuarisPerTitolBarYear:()=>Dt,echartUsuarisPerTitolGaugeMonth:()=>dt,echartUsuarisPerTitolGaugeYear:()=>ct,echartUsuarisPerTitolLineMonth:()=>At,echartUsuarisTotals:()=>yt,echartUsuarisTotalsBarMonth:()=>I,echartUsuarisTotalsGaugeMonth:()=>pt,echartUsuarisTotalsGaugeYear:()=>lt,echartUsuarisTotalsStackedBarYears:()=>gt,filterData:()=>et,filterEMT1Update:()=>q,filterEMT2Update:()=>Y,handlerActivarFiltro:()=>Q,handlerDesactivarFiltro:()=>tt,listeneresEMT:()=>rt,usdEmtUsuarisPerLinea:()=>Tt,usdEmtUsuarisPerTitol:()=>Mt,usdEmtUsuarisTotals:()=>bt});const t="8%",e="2.5%",o="5%",n="18%",i="20%",s="10%",l="90%",c="1%",u="0%",d=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],f=33,h=27,m=30;function p(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const r={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",r):t.toLocaleString(e,r)}function g(t){return 100*(1-17/t)}function y(t,e=!1){let r=`<p>${t[0].name}</p>`;return t.forEach(t=>{const a=e?Math.round(t.data):t.data,o=`<div>${n=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${n}"></span>`} ${t.seriesName}: <strong style="float: right; margin-left:20px">${t.data?p(a):"-"}</strong></div>`;var n;r+=o}),r}function b(t){return p(t)}function S(){const t=$("#formFilterDates").find("input"),e=[];$(t).each((t,r)=>{r.checked&&e.push(r.id)}),Dashboards.fireChange("filterDatesParam",e),Dashboards.fireChange("updateFilter","True")}function M(t){return{1:"GENER",2:"FEBRER",3:"MARÇ",4:"ABRIL",5:"MAIG",6:"JUNY",7:"JULIO",8:"AGOST",9:"SETEMBRE",10:"OCTUBRE",11:"NOVEMBRE",12:"DESEMBRE"}[t]}function E(t,e){const r=t?document.querySelector(t):null,a=e?document.querySelector(e):null;r&&(r.hidden=!0),a&&(a.style.background="url('./build/images/nodata1.png') no-repeat top center",a.hidden=!1)}function T(t,e){const r=t?document.querySelector(t):null,a=e?document.querySelector(e):null;r&&(r.hidden=!0),a&&(a.style.background="#ffffff",a.hidden=!1)}function A(t,e){return t.reduce((t,r)=>{const a=r[e];return t[a]||(t[a]=[]),t[a].push(r),t},{})}function v(t,e,r=1){const a=Math.max(...t.map(t=>t[e]))*r;return 5e3*Math.ceil(a/5e3)}function D(t){return Math.round(document.getElementById(t).offsetWidth/f)}function x(r,a,d,f,h,m,p,g=5,S="",M=h,E=100,T,A=void 0,v=void 0){return{title:{text:S,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",show:!0,formatter:t=>y(t),textStyle:{fontFamily:"Montserrat"}},legend:a?{type:"plain",data:a,textStyle:{fontFamily:"Montserrat"},top:A||t,selected:T}:null,grid:{left:e,right:o,bottom:n,top:a?A?"30%":i:s,heigh:l,containLabel:!0},xAxis:{type:"category",data:d,boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{name:f,nameLocation:"end",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"bold",padding:[0,0,0,p]},type:"value",scale:!0,min:v,axisLabel:{margin:g,formatter:b,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},series:r,dataZoom:[{show:m,data:d,start:M,end:E,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}],toolbox:{show:m,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:c,top:u}}}function L(t,r,a,s,c="",u="total",f=0,h=1,m=2,S=d){if(0===a.length)E(`#${t}`,`#${r}`);else{T(`#${r}`,`#${t}`);const d=[];let M=A(a,f);const E=new Set(a.map(t=>t[h])),v=Object.keys(M);E.forEach(t=>{v.forEach(e=>{void 0===M[e].find(e=>e[h]===t)&&(M[e].push([M[e][0][f],t,void 0]),M[e][0][1].length>4?M[e].sort((t,e)=>{const[r,a]=t[1].split("/"),[o,n]=e[1].split("/"),i=new Date(a,r-1,1),s=new Date(n,o-1,1);return i.getTime()-s.getTime()}):M[e].sort())})});const D=Object.entries(M).sort((t,e)=>t[0].localeCompare(e[0])),$=""===u?90:0;M=Object.fromEntries(D),Object.keys(M).forEach(t=>{d.push({name:t,type:"bar",stack:u,label:{show:!0,fontFamily:"Montserrat",rotate:$,formatter:t=>p(Math.round(t.value))},emphasis:{focus:"series"},data:M[t].map(t=>t[m])})});const x=""!==u?g(E.size):100*(1-7/E.size);P(t,{color:S,title:{text:c,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat"},formatter:t=>y(t,!0)},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:e,right:o,bottom:n,top:i,heigh:l,containLabel:!0},yAxis:{type:"value",splitNumber:4,name:s,nameLocation:"end",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666"},axisLabel:{formatter:b,textStyle:{fontSize:8,fontFamily:"Montserrat",color:"#666"}}},xAxis:{type:"category",data:[...E],axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:d,toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50},dataZoom:[{show:!0,data:[...E],start:x,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)"}}}]})}}function C(t,e,r,a,o,n,i){if(0===o.length)E(`#${t}`,`#${r}`),E(`#${e}`,`#${a}`);else{T(`#${r}`,`#${t}`),T(`#${a}`,`#${e}`);const s=0,l=2,c=function(t,e){const r=v(t,e,1.1);let a=50,o=180;r>9999999&&(a=65,o=95);const n=A(t,1);let[i,s]=Object.values(n);return Object.values(n).slice(1).forEach(t=>{s=t}),[s,i,n,r,a,o]}(o,l),u=c[0],d=c[1],f=c[2],h=c[3],m=c[5],p=D(t),g=N(u,l,s,m,p),y=N(d,l,s,m,p);P(t,w(`${n}${M(String(Object.keys(f)[1]))}`,h,g,p)),P(e,w(`${i}${M(String(Object.keys(f)[0]))}`,h,y,p))}}function U(t,e,r,a){0===r.length?E(`#${t}`,`#${e}`):T(`#${e}`,`#${t}`);const o=v(r,1,1.1),n=D(t);let i=180;o>9999999&&(i=95);const s=N(r,1,0,i,n);P(t,w(`${a} ${r[0][2]}`,o,s,n))}function w(t,e,r,a){return{color:d,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 r=`<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>`),r+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:r,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 F(t){if(t.length>=29){const e=t.split(" ");let r="",a="";for(const t of e)`${r} ${t}`.length<=29?r+=(r?" ":"")+t:(a+=`${r}\n`,r=t);return a+=r,a}return t}function N(t,e,r,a,o){let n=20,i=35,s=-190,l=a;t.length<=2&&(s=-140,l+=100,n=25,i=42);const c=d.slice(),u=[];for(let a=0;a<t.length;a+=1)u.push({value:t[a][e],name:F(t[a][r]),color:c.shift(),title:{offsetCenter:[String(s),`${String(n)}%`],fontFamily:"Montserrat",fontSize:o-3},detail:{offsetCenter:[String(s),`${String(i)}%`],fontFamily:"Montserrat"}}),s+=l,(a+1)%3==0&&(i+=30,n+=30,s=-190);return u}function P(t,e){const r=document.getElementById(t);if(!r)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const a=echarts.init(r);return a.setOption(e,!0),$(window).on("resize",()=>{null!=a&&void 0!==a&&a.resize()}),a}function O(t){return 100*(t-120)/t}function I(t,e){0===e.resultset.length?E("#chartUsuarisTotalsBarMonth","#no_dataUsuarisTotalsBarMonth"):(T("#no_dataUsuarisTotalsBarMonth","#chartUsuarisTotalsBarMonth"),P("chartUsuarisTotalsBarMonth",function(t,e,r=-45,a="",o=e){const n=new Set,i=[];t.forEach(t=>{const e=t[0].toString().padStart(2,"0");n.add(`${e}/${t[1]}`),i.push(Math.round(t[2]))});const s=i.length<100?40:80;return x({name:o,type:"bar",smooth:!1,barMaxWidth:40,itemStyle:{color:"#5470c6"},textStyle:{fontFamily:"Montserrat"},data:i},null,Array.from(n.values()),e,s,!0,r,25,a)}(e.resultset,"Viatges",void 0,"ÚS D'EMT. USUARIS TOTALS: EVOLUCIÓ MENSUAL","Nombre viatges EMT")))}let k,R,z,B,_={start:void 0,end:void 0},G={start:void 0,end:void 0};function V(t=null){let e=$("#formFilterDates").find("input");e=$("#formFilterDates").find("input"),$(e).each((t,r)=>{r.checked&&(e[t].checked=!1)});const r=$("#formFilterEMT1").find("input");if($(r).each((t,e)=>{e.checked&&(r[t].checked=!1)}),t){const t=$("#formFilterEMT2").find("input");$(t).each((e,r)=>{r.checked&&(t[e].checked=!1)})}const a=$("#formFilterVar").find("input");$(a).each((t,e)=>{e.checked&&(a[t].checked=!1)}),function(t){let e=0;const r=$("#formFilterDates").find("input");$(r).each(t=>{e+=1,r[t].checked=!0}),e=0;const a=$("#formFilterEMT1").find("input");$(a).each(t=>{e+=1,e<=6&&(a[t].checked=!0)});const o=$("#formFilterEMT2").find("input");$(o).each(r=>{t&&t.includes(o[r].id)&&(e+=1,e<=6&&(o[r].checked=!0))}),e=0;const n=$("#formFilterVar").find("input");$(n).each(t=>{e+=1,e<=2&&(n[t].checked=!0)}),Dashboards.getParameterValue("filterDatesParam").length>0&&(Dashboards.fireChange("filterDatesParam"),render_echartAccessosCiutat.listeners=["filterDatesParam"],Dashboards.fireChange("filterDatesParam"),render_echartAccessosCiutat.listeners=[""]),Dashboards.getParameterValue("filterEMT2Param").length>0&&Dashboards.fireChange("filterEMT2Param"),Dashboards.getParameterValue("filterVarParam").length>0&&Dashboards.fireChange("filterVarParam")}(t)}function q(){k&&([_]=k.getOption().dataZoom);const t=$("#formFilterEMT1").find("input"),e=[];$(t).each((t,r)=>{r.checked&&e.push(r.id)}),Dashboards.fireChange("filterEMT1Param",e),Dashboards.fireChange("updateFilterEMT1","True")}function Y(){z&&([G]=z.getOption().dataZoom);const t=$("#formFilterEMT2").find("input"),e=[];$(t).each((t,r)=>{r.checked&&e.push(r.id)}),Dashboards.fireChange("filterEMT2Param",e),Dashboards.fireChange("updateFilterEMT2","True")}function W(t,e="number",r=null){let a;return"number"===e?a=new Map([...t].filter(([t])=>!Number.isNaN(Number(t)))):"includes"===e&&(a=new Map([...t].filter(([t])=>t.includes(r)))),a}function j(t){const e=Array.from(t.keys()).sort((t,e)=>t-e),r=new Map;return e.forEach(e=>{r.set(e,t.get(e))}),r}function J(t,e,r=!1){const a=[],o=new Set,n=r?new Map:new Set;for(let i=0;i<e.length;i+=1)(0===t.length||t.includes(e[i][0]))&&(r?n.set(e[i][0],e[i][0]):n.add(e[i][0]),a.push({day:e[i][1],type:e[i][0],value:e[i][2]}),o.add(e[i][1]));return[n,a,Array.from(o.values())]}function H(t,e,r){const a=d.slice();return t.map(t=>{const o=e.filter(e=>e.type===t),n=r.map(t=>{const e=o.findIndex(e=>e.day===t);return-1!==e?o[e].value:null});return{name:t,type:"line",symbol:"circle",color:a.shift(),symbolSize:6,smooth:!1,data:n}})}function Z(t){const e={};t.forEach(t=>{const r=t.type,a=t.value;e[r]=(e[r]||0)+a});const r=Object.keys(e).map(t=>({tipo:t,valor:e[t]}));return r.sort((t,e)=>e.valor-t.valor),r.map(t=>t.tipo)}function X(t,e,r,a,o){const n=Dashboards.getParameterValue("filterEMT1Param");if(0===r.length)E(`#${t}`,`#${e}`);else{T(`#${e}`,`#${t}`);const[i,s,l]=J(n,r);if(!o){const t=Z(s);!function(t,e){const r=$("#formFilterEMT1");""===Dashboards.getParameterValue("updateFilterEMT1")&&(e.forEach(t=>{r.append(`<input type="checkbox" id="${t}" class="titol-${t}" onclick="emt.filterEMT1Update();" /> ${t} </br>`)}),V(),S(),q())}(t.length,t),n&&n.sort((t,e)=>t.localeCompare(e))}if(n){const r=x(H(n,s,l),n,l,"Viatges",o?g(l.length):O(l.length),!0,-10,void 0,a,_.start,_.end);let i;o?(R=P(t,r),i=R):(k=P(t,r),i=k),0===$("#formFilterEMT1 :checked").length&&E(`#${t}`,`#${e}`),$(window).on("resize",()=>{null!=i&&void 0!==i&&i.resize()})}}}function K(t,e,r,a,o){const n=Dashboards.getParameterValue("filterEMT2Param");if(0===r.length)E(`#${t}`,`#${e}`);else{T(`#${e}`,`#${t}`);const[i,s,l]=J(n,r,!0);if(!o){const t=Array.from(j(W(i,"number")).values());let e=[];(function(t){const e=[];return t.forEach((t,r)=>{Array.from(r).forEach(t=>{!e.includes(t)&&Number.isNaN(Number(t))&&e.push(t)})}),e})(i).forEach(t=>{e=e.concat(Array.from(j(function(t){const e=/\d+/g,r=new Map;return t.forEach(a=>{r.set(a.match(e),t.get(a))}),r}(W(i,"includes",t))).values()))});let r=t.concat(e);r=[...new Set(r)];const a=Z(s).slice(0,6);!function(t,e,r){const a=$("#formFilterEMT2");""===Dashboards.getParameterValue("updateFilterEMT2")&&(e.forEach(t=>{a.append(`<input type="checkbox" id="${t}" class="linea-${t}" onclick="emt.filterEMT2Update();" />`)}),V(r),S(),Y())}(r.length,r,a)}if(n){const r=x(H(n,s,l),n,l,"Viatges",O(l.length),!0,-10,void 0,a,G.start,G.end);let i;o?(B=P(t,r),i=B):(z=P(t,r),i=z),0===$("#formFilterEMT1 :checked").length&&E(`#${t}`,`#${e}`),$(window).on("resize",()=>{null!=i&&void 0!==i&&i.resize()})}}}function Q(){document.querySelector("#idFiltrar").style.visibility="visible"}function tt(){document.querySelector("#idFiltrar").style.visibility="hidden"}function et(t,e){return t.filter(t=>e.includes(t[0]))}function rt(){const t=["filterDatesParam","updateFilter","filterEMT1Param","updateFilterEMT1"],e=["filterDatesParam","updateFilter","filterEMT2Param","updateFilterEMT2"];render_echartUsuarisPerLinea.listeners=e,render_echartUsuarisPerLiniaLineMonth.listeners=e,render_echartUsuarisPerLiniaGaugeYear.listeners=e,render_echartUsuarisPerLiniaGaugeMonth.listeners=e,render_echartUsuarisPerLiniaBarYear.listeners=e,render_echartUsuarisPerTitol.listeners=t,render_echartUsuarisPerTitolLineMonth.listeners=t,render_echartUsuarisPerTitolGaugeYear.listeners=t,render_echartUsuarisPerTitolGaugeMonth.listeners=t,render_echartUsuarisPerTitolBarYear.listeners=t,render_echartUsuarisTotals.listeners=["filterDatesParam","updateFilter"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter"),Dashboards.fireChange("filterEMT1Param"),Dashboards.fireChange("updateFilterEMT1"),Dashboards.fireChange("filterEMT2Param"),Dashboards.fireChange("updateFilterEMT2")}const at="ca_ES",ot={es_ES:new Map([["chartUsuarisTotalsGaugeYear","USO DE EMT. USUARIOS TOTALES: ÚLTIMOS AÑOS"]]),ca_ES:new Map([["chartUsuarisTotalsGaugeYear","US D'EMT. USUARIS TOTALS: ÚLTIMS ANYS"]])},nt={es_ES:new Map([["chartUsuarisTotalsGaugeMonth","USO DE EMT. USUARIOS TOTALES: MES ACTUAL"],["chartUsuarisTotalsGaugeLastMonth","USO DE EMT. USUARIOS TOTALES: MES ANTERIOR"]]),ca_ES:new Map([["chartUsuarisTotalsGaugeMonth","ÚS D'EMT. USUARIS TOTALS: MES ACTUAL"],["chartUsuarisTotalsGaugeLastMonth","ÚS D'EMT. USUARIS TOTALS: MES ANTERIOR"]])};var it=r(2725);const st={color:void 0,title:{text:"",left:"center",top:"top",padding:10,textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"}},splitNumber:3,series:{type:"gauge",max:void 0,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:10},axisLabel:{show:!0,distance:70,formatter:void 0,fontFamily:"Montserrat",color:"#666"},data:[],detail:{fontSize:12,color:"inherit"}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:27,top:30}};function lt(t,e){!function(t,e){const r=e.resultset,a=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"];if(0===e.length)(0,it.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{(0,it.printDataChart)(`#${t.idNoData}`,`#${t.idChart}`);const e={type:0,data:1,time:2},[o,n]=(0,it.configureDataGaugeCommon)(r,e,a.slice(),t.fontSize,t.paramOffsetCenterTitle,t.paramOffsetCenterDetail,t.paramOffsetLabel,t.paramCalculatedOffset,t.paramNumberOfElementsByLine),i={...st};i.title.text=t.chartName,i.series.max=o,i.series.data=n,i.series.detail.fontSize=t.fontSize,i.series.detail.formatter=t=>(0,it.addPointInteger)(Math.round(t)),i.series.axisTick.splitNumber=5,i.color=a.slice(),i.series.axisLabel.formatter=t=>(0,it.addPointInteger)(Math.round(t)),i.tooltip.formatter=t=>function(t){let e=`${t.name} : `;return e+=`<span style="font-weight:bold">${(0,it.addPointInteger)(Math.round(t.value))}</span>`,t.marker+e}(t),(0,it.initChart)(t.idChart,i)}}({idChart:"chartUsuarisTotalsGaugeYear",idNoData:"no_dataUsuarisTotalsGaugeYear",chartName:`${ot[at].get("chartUsuarisTotalsGaugeYear")}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-100,paramCalculatedOffset:50,paramNumberOfElementsByLine:5},e)}function ct(t,e){const r=Dashboards.getParameterValue("filterEMT1Param");if(r.length>0){const a=et(e.resultset,r);function o(){U("chartUsuarisTitolGaugeYear","no_dataUsuarisTitolGaugeYear",a,"ÚS D'EMT. USUARIS PER TÍTOL: ANY")}r.sort((t,e)=>t.localeCompare(e)),0===document.querySelector("#chartUsuarisTitolGaugeYear").childElementCount?document.querySelector("#tabUsuarisPerTitol").addEventListener("click",()=>{requestAnimationFrame(()=>{o()})}):o()}}function ut(t,e){const r=Dashboards.getParameterValue("filterEMT2Param"),a=et(e.resultset,r);function o(){U("chartUsuarisLiniaGaugeYear","no_dataUsuarisLiniaGaugeYear",a,"ÚS D'EMT. USUARIS PER LÍNIA: ANY")}a.sort((t,e)=>Number(t[0])-Number(e[0])),0===document.querySelector("#chartUsuarisLiniaGaugeYear").childElementCount?document.querySelector("#tabUsuarisPerLinia").addEventListener("click",()=>{requestAnimationFrame(()=>{o()})}):o()}function dt(t,e){const r=Dashboards.getParameterValue("filterEMT1Param"),a=et(e.resultset,r);function o(){C("chartUsuarisTitolMesActual","chartUsuarisTitolMesAnterior","no_dataUsuarisTitolMesActual","no_dataUsuarisTitolMesAnterior",a,"ÚS D'EMT. USUARIS PER TÍTOL: EVOLUCIÓ ","ÚS D'EMT. USUARIS PER TÍTOL: EVOLUCIÓ ")}0===document.querySelector("#chartUsuarisTitolMesActual").childElementCount||0===document.querySelector("#chartUsuarisTitolMesAnterior").childElementCount?document.querySelector("#tabUsuarisPerTitol").addEventListener("click",()=>{requestAnimationFrame(()=>{o()})}):o()}function ft(t,e){const r=Dashboards.getParameterValue("filterEMT2Param"),a=et(e.resultset,r);function o(){C("chartUsuarisLiniaMesActual","chartUsuarisLiniaMesAnterior","no_dataUsuarisLiniaMesActual","no_dataUsuarisLiniaMesAnterior",a,"ÚS D'EMT. USUARIS PER LÍNIA: EVOLUCIÓ ","ÚS D'EMT. USUARIS PER LÍNIA: EVOLUCIÓ ")}a.sort((t,e)=>Number(t[0])-Number(e[0])),0===document.querySelector("#chartUsuarisLiniaMesActual").childElementCount||0===document.querySelector("#chartUsuarisLiniaMesAnterior").childElementCount?document.querySelector("#tabUsuarisPerLinia").addEventListener("click",()=>{requestAnimationFrame(()=>{o()})}):o()}const ht={title:{text:"",left:"center",top:"top",padding:10,textStyle:{fontSize:12,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:void 0,itemStyle:{color:"#FFAB91"},progress:{show:!0,width:30},pointer:{show:!1},axisLine:{lineStyle:{width:30}},axisTick:{distance:5,splitNumber:10,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=>(0,it.addPointInteger)(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[0,"0%"],fontSize:17,fontWeight:"bolder",formatter:void 0,fontFamily:"Montserrat",color:"inherit"},data:void 0},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:27,top:40}};function mt(t,e,r){const a=e.resultset;if(0===a.length||r<0||r>=a.length)(0,it.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{(0,it.printDataChart)(`#${t.idNoData}`,`#${t.idChart}`);const e=a[r],o={type:0,time:1,data:2},[n,i,s]=(0,it.configureDataGaugeMonthCommon)(t.idChart,[e],o,0),l=JSON.parse(JSON.stringify(ht));l.title.text=t.chartName,l.series.max=n,l.series.detail.formatter=i,l.series.data=s,(0,it.initChart)(t.idChart,l)}}function pt(t,e){const r={idChart:"chartUsuarisTotalsGaugeMonth",idNoData:"no_dataUsuarisTotalsGaugeMonth",chartName:`${nt[at].get("chartUsuarisTotalsGaugeMonth")}`},a={idChart:"chartUsuarisTotalsGaugeLastMonth",idNoData:"no_dataUsuarisTotalsGaugeLastMonth",chartName:`${nt[at].get("chartUsuarisTotalsGaugeLastMonth")}`};mt(r,e,0),mt(a,e,1)}function gt(t,e){if(0===e.resultset.length)E("#chartUsuarisTotalsStackedBarYears","#no_dataUsuarisTotalsStackedBarYears");else{T("#no_dataUsuarisTotalsStackedBarYears","#chartUsuarisTotalsStackedBarYears");const t={title:{text:"ÚS D'EMT. USUARIS TOTALS: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nViatges"}};(0,it.initStackedBarChartMonthSeries)("chartUsuarisTotalsStackedBarYears",e.resultset,t)}}function yt(t,e){!function(t,e,r,a,o,n,i,s,l=!1,c=!1,u,f=!0,h=d.slice(),m=!1,p,y){const b=t.resultset||t;if(0===b.length)E(`#${n}`,`#${i}`),s&&E(`#${s}`,`#${i}`);else{T(`#${i}`,`#${n}`),s&&T(`#${i}`,`#${s}`);const t=function(t,e,r=!1){const{resultset:a}={resultset:t},o=new Set,n=new Set,i=e,s=a.map(([t,e,a])=>{const i=r?Math.round(a):a;return o.add(t),n.add(e),{day:e,type:t,value:i}}),l=Array.from(n.values()),c=Array.from(o.values());return c.sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0})),[c.map(t=>{const e=s.filter(e=>e.type===t).map(({day:e,value:r})=>[e,t,r]),r=l.map(t=>{const r=e.find(([e])=>e===t);return r?r[2]:null});return{name:t,type:"line",symbol:"circle",color:i.shift(),symbolSize:6,smooth:!1,data:r}}),n,c]}(b,h,m),d=t[0],M=t[1],E=t[2],A=f?E:null,v=c?(S=M,Array.from(S.values()).map(t=>{const[e,r]=t.split("/");return function(t){const e=t.slice(0,2);return`${t.slice(3,5)}/${e}`}(t)})):Array.from(M.values());void 0===u&&(u=l?g(M.size):O(M.size)),P(n,x(d,A,v,o,u,e,r,void 0,a,void 0,void 0,void 0,p,y))}var S}(e,!0,1,"ÚS D'EMT: USUARIS TOTALS","Viatges","chartUsuarisTotals","no_dataUsuarisTotals",void 0,void 0,void 0,void 0,!1)}function bt(){tt(),$("#idFieldsFilterEmtUsLinea").hide(),$("#idFieldsFilterEmtUsTitol").hide()}function St(t,e){X("chartUsuarisPerTitol","no_dataUsuarisPerTitol",e.resultset,"ÚS D'EMT: USUARIS PER TÍTOL",!1)}function Mt(){Q(),$("#idAllFilterFields").show(),$("#idFieldsFilterEmtUsLinea").hide(),$("#idFieldsFilterEmtUsTitol").show()}function Et(t,e){K("chartUsuarisPerLinea","no_dataUsuarisPerLinea",e.resultset,"ÚS D'EMT: USUARIS PER LÍNIA",!1)}function Tt(){tt(),$("#idAllFilterFields").show(),$("#idFieldsFilterEmtUsLinea").show(),$("#idFieldsFilterEmtUsTitol").hide()}function At(t,e){X("chartUsuarisTitolLineMonth","no_dataUsuarisTitolLineMonth",e.resultset,"ÚS D'EMT. USUARIS PER TÍTOL: HISTÒRIC MENSUAL",!0)}function vt(t,e){K("chartUsuarisLiniaLineMonth","no_dataUsuarisLiniaLineMonth",e.resultset,"ÚS D'EMT. USUARIS PER LÍNIA: HISTÒRIC MENSUAL",!0)}function Dt(t,e){const r=Dashboards.getParameterValue("filterEMT1Param");L("chartUsuarisTitolBar","no_dataUsuarisTitolBar",et(e.resultset,r),"Viatges","ÚS D'EMT. USUARIS PER TÍTOL: HISTÒRIC ANUAL","")}function $t(t,e){const r=Dashboards.getParameterValue("filterEMT2Param");L("chartUsuarisLiniaBar","no_dataUsuarisLiniaBar",et(e.resultset,r),"Viatges","ÚS D'EMT. USUARIS PER LÍNIA: HISTÒRIC ANUAL","")}})(),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.emt=e():t.emt=e()}(self,()=>(()=>{var t={2725(t){var e;self,e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[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:()=>n,MONTHS_YEAR_SHORT:()=>i,TEXTS_COMMON:()=>s,THRESHOLDS:()=>$t,addPointInteger:()=>M,buildCamarasTrafico:()=>Ft,buildTableCalidadAire:()=>xt,calculateMaxYAxis:()=>F,calculatePentahoPath:()=>Lt,calculateXAxisStart:()=>w,capitalizarTexto:()=>D,checkAllGroupsCollapsed:()=>Et,configureDataBar:()=>G,configureDataGaugeCommon:()=>R,configureDataGaugeMonthCommon:()=>z,configureDataLine:()=>_,configureDataValidate:()=>jt,configureLinesChartValidates:()=>Jt,convertDateToInteger:()=>b,convertISODateToEUDate:()=>S,convertToLanguageSelectorDateRange:()=>dt,convertToTableTreeView:()=>Mt,downloadCSVTable:()=>Tt,downloadPDFTable:()=>At,formatCellMultiplesLines:()=>yt,formatDayMonthYear:()=>d,formatMilMillionEuros:()=>O,formatMonthAnyo:()=>u,formatName:()=>v,formatNameHeaderColumn:()=>gt,formatRoundTooltip:()=>P,formatShortMonthShortYear:()=>h,formatShortMonthYear:()=>f,formatToMillions:()=>E,formatToTons:()=>T,formatTooltip:()=>U,formatTooltipPie:()=>N,formatTrimestre:()=>m,formatWithPrefix:()=>A,getEnvironment:()=>Ct,getMaxFieldNumberFromData:()=>W,getMonth:()=>o,getMonthList:()=>p,getSelectCommonOptions:()=>nt,getSelectTwoColumnsOptions:()=>it,initBarChart:()=>Rt,initBarChartComparationMonth:()=>Gt,initChart:()=>x,initContractAllGroups:()=>vt,initElement:()=>$,initExpandAllGroups:()=>Dt,initStackedBarChart:()=>Ot,initStackedBarChartMonthSeries:()=>kt,initTable:()=>pt,initValueDefaultDate:()=>ct,initialCalls:()=>wt,loadIframeOnClickEvent:()=>Vt,printDataChart:()=>C,printDataInHTMLElements:()=>Y,printEchart:()=>I,printNoDataChart:()=>L,resetFilter:()=>ot,resetFilterAndUpdate:()=>mt,resetFilterDate:()=>lt,resetFilterDates:()=>st,resetFilterToDefault:()=>ft,resultsetWithFields:()=>V,selectConfigDatasource:()=>rt,selectConfigDatasourceAllValue:()=>at,selectFilterAll:()=>tt,selectFilterNumItemsDefault:()=>ht,selectValueDefaultInFilter:()=>ut,separateDayMonthYearToSlash:()=>l,splitDataset:()=>J,subtractOneDay:()=>g,subtractOneMonth:()=>y,traverseRows:()=>St,updateDomElement:()=>j,updateObject:()=>q,updateStackedBarOptions:()=>It});const r="es_ES",a=(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"]]),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"]]),{"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 o(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 n={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"]])},i={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 l(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function c(t){return[t.substring(0,4),a[t.substring(4,6)]]}function u(t){const[e,r]=c(t);return`${r} ${e}`}function d(t){const[e,r,o]=function(t){return[t.substring(0,4),a[t.substring(4,6)],t.substring(6,8)]}(t);return`${o} ${r} ${e}`}function f(t){const[e,r]=c(t);return`${r.substring(0,3)} ${e}`}function h(t){const[e,r]=c(t);return`${r.substring(0,3)} '${e.substring(2,4)}`}function m(t){const[e,r]=t.split("-");return`${parseFloat(r)/3}T ${e}`}function p(){const t=n[r];return Array.from(t.values()).map(t=>t.slice(0,3))}function g(t){const e=Math.floor(t/1e4),r=new Date(e,t%1e4/100-1,t%100);return r.setDate(r.getDate()-1),`${r.getFullYear()}${(r.getMonth()+1).toString().padStart(2,"0")}${r.getDate().toString().padStart(2,"0")}`}function y(t){const e=new Date(Math.floor(t/100),t%100-1,0);return`${e.getFullYear()}${(e.getMonth()+1).toString().padStart(2,"0")}`}function b(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function S(t){if(!t||"string"!=typeof t)return"";const[e,r,a]=t.split("-");return`${a}/${r}/${e}`}function M(t,e=2){let r=navigator.language||navigator.userLanguage;r=r.length<=2?`${r}-${r.toUpperCase()}`:r;const a={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===r?t.toLocaleString("de-DE",a):t.toLocaleString(r,a)}function E(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function T(t){return t>=1e3?t/1e3+" Tn":t.toString()}function A(t){let e,r;return t>=1e6?(e=t/1e6,r="G"):t>=1e3?(e=t/1e3,r="M"):(e=t,r="k"),{value:Math.round(100*e)/100,prefix:r}}function v(t,e=29){if(t.length>=e){const r=t.split(" ");let a="",o="";return r.forEach(t=>{`${a} ${t}`.length<=e?a+=(a?" ":"")+t:(o+=`${a}\n`,a=t)}),o+=a,o}return t}function D(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,r)=>e+r[0].toUpperCase())}function $(t,e,r="MainContentLoadedCustom"){let a=document.getElementById(t);return a?Promise.resolve(e(a)):new Promise(o=>{document.body.addEventListener(r,()=>{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 $(t,t=>{const r=echarts.init(t);r.setOption(e,!0),window.addEventListener("resize",()=>{null!=r&&void 0!==r&&r.resize()});const a=document.getElementById("main-content");return a&&(a.addEventListener("shown.bs.collapse",()=>{r.resize()}),a.addEventListener("hidden.bs.collapse",()=>{r.resize()})),r})}function L(t,e){const r=t?document.querySelector(t):null,a=e?document.querySelector(e):null;r&&(r.hidden=!0),a&&(a.style.background="url('./build/images/nodata1.png') no-repeat top center",a.hidden=!1)}function C(t,e){const r=t?document.querySelector(t):null,a=e?document.querySelector(e):null;r&&(r.hidden=!0),a&&(a.style.background="#ffffff",a.hidden=!1)}function U(t,e=!1,r=!0,a=""){let o=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach(t=>{const n=e?Math.round(t.data):t.data,i=r?`<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?`${M(n)} ${a}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${M(n)} ${a}`:"-"}\n </span>\n </div>`;var s;o+=i}),o}function w(t){return 100*(t-120)/t}function F(t,e){const r=Math.max(...t);return r+(e-r%e)}function N(t,e=!1){const r=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,a=e?`${t.percent}%`:M(t.value);return`<div> ${r} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${a} </span></div>`}function P(t,e){let r=`${t.name} : `;return r+=`<span style="font-weight:500">${M(Math.round(t.value))}</span>`,e&&(r+=`<span> (${t.percent}%)</span>`),t.marker+r}function O(t){const e=1e6,r=Number(t);return r>=0&&r<e?`${M(r)} €`:r>=e?`${M(r/e)} M €`:"-"}function I(t,e,r){return 0===t.length?(L(`#${e}`,`#${r}`),!1):(C(`#${r}`,`#${e}`),!0)}function k(t,e,r=1){const a=Math.max(...t.map(t=>t[e]))*r;return 5e3*Math.ceil(a/5e3)}function R(t,e,r,a=30,o=15,n=30,i=-70,s=70,l=3){const c=k(t,e.data,1.1),u=s,d=r.slice(),f=[];let h=o,m=n,p=i;for(let r=0;r<t.length;r+=1)f.push({value:t[r][e.data],name:v(String(t[r][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(p)}%`,`${String(h)}%`],fontFamily:"Montserrat",fontSize:a},detail:{offsetCenter:[`${String(p)}%`,`${String(m)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>M(Math.round(t))}}),p+=u,(r+1)%l===0&&(m+=n,h+=2*o,p=i);return[c,f]}function z(t,e,r,a=0){return[k(e,r.data,1),t=>function(t,e,r){const a=M(Math.round(e)),n=o(t[r][0]),i=t[r][1],s=`\n${n} ${i} : ${a}`,l=`${a}\n${n} ${i}`;return window.innerWidth<=1710?s:l}(e,t,a),[{value:e[a][r.data]}]]}function B(t,e){const{resultset:r}={resultset:t},a=new Set,o=new Set,n=r.map(([t,r,n])=>{const i=e?Math.round(n):n;return a.add(t),o.add(r),{day:r,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=n.filter(e=>e.type===t).map(({day:e,value:r})=>[e,t,r]),r=i.map(t=>{const r=e.find(([e])=>e===t);return r?r[2]:null});return{name:t,data:r}}),s,o]}function _(t,e=[],r=!1){const[a,o,n]=B(t,r);return a.forEach(t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())}),[a,n,o]}function G(t,e,r=!1){const[a,o,n]=B(t,r);return a.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[a,n,o]}function V(t){const{resultset:e,metadata:r}=t,a=[];return e.forEach(t=>{const e={};t.forEach((t,a)=>{e[r[a].colName]=t}),a.push(e)}),a}function q(t,e){const r={...t};return Object.keys(e).forEach(a=>{Object.prototype.hasOwnProperty.call(e,a)&&("series"===a&&Array.isArray(e[a])?r[a]=e[a].map((e,r)=>({...Array.isArray(t[a])&&t[a][r]||{},...e})):"object"!=typeof e[a]||null===e[a]||Array.isArray(e[a])?t[a]!==e[a]&&(r[a]=e[a]):r[a]=q(t[a]||{},e[a]))}),r}function Y(t,e){const r=()=>{t.forEach(t=>{t.id in e&&Object.entries(e[t.id]).forEach(r=>{const a=r[0],o=r[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{r()}catch(t){document.body.addEventListener("MainContentLoadedCustom",()=>{r()})}}function W(t,e){const r=V(t),a=[];let o=null;return r.forEach(t=>{const r=t[e];"number"!=typeof r||Number.isNaN(r)||a.push(r)}),a.length>0&&(o=Math.max(...a)),o}function j(t,e){const r=document.querySelector(t);r?r.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function J(t,e=!0){const r={Cont:[],Mob:[]};return t.forEach(t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?r.Cont.push([t[3],t[4],t[2]]):r.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?r.Mob.push([t[3],t[4],t[2]]):r.Mob.push([t[3],t[2]]))}),r}const H=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Z=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],X=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],K=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],Q=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function tt(t){const e=t.resultset.map(t=>t[0]);return this.dashboard.fireChange(this.parameter,e),t}function et(t){for(const e of t)if(Array.isArray(e)){if(!et(e))return!1}else if("All"!==e)return!1;return!0}function rt(t,e,r,a){return et(e)?(t.queryDefinition.dataAccessId=r,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=a,!0}function at(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 it(t="Todos"){const e=nt(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function st(t,e,r,a){const o=Dashboards.getParameterValue(r),n=Dashboards.getParameterValue(a);return Dashboards.fireChange(t,[o]),Dashboards.fireChange(e,[n]),!0}function lt(t,e){const r=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[r]),!0}function ct(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function ut(t,e){const r=Dashboards.getParameterValue(e),a=t.parameter;""!==r&&t.dashboard.setParameter(a,[r])}function dt(t){t.regional.es={monthNames:H,abbreviatedMonthNames:Z,dayNames:X,abbreviatedDayNames:K,dayNamesMin:Q,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function ft(t,e){const r=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(r)?r:[r]),!0}function ht(t,e,r,a=0){const o=t.resultset.slice(0,r).map(t=>t[a]);return Dashboards.setParameter(e,o),t}function mt(t,e,r){const a=Array.isArray(e)?e:[e];Dashboards.fireChange(t,a);const o=Dashboards.getComponent(r);o&&o.update()}function pt(t,e){return $(t,t=>new Tabulator(t,e))}function gt(t,e){let r=t.getValue();return r.length>e&&(r=`${r.substr(0,e)}<br>${r.substr(e)}`),r}function yt(t,e){const r=t.getValue().split(" ");let a="",o="";return r.forEach(t=>{(o+t).length<=e?o+=`${t} `:(a+=`${o}<br>`,o=`${t} `)}),a+=`${o}<br>`,a}function bt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const r=t.getTreeChildren();r.length>0&&r.forEach(t=>{t.getTreeChildren().length>0&&bt(t,e)})}function St(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&bt(t,e)})}function Mt(t,e,r,a){const o=[];return Object.keys(t).forEach(n=>{if(Object.prototype.hasOwnProperty.call(t,n)){const i=t[n],s={[e]:i[0],_children:[]};i.shift(),i.forEach((t,o)=>{const n={[e]:r[o],[a]:t};s._children.push(n)}),o.push(s)}}),o}function Et(t){let e=!0;return t.getGroups().forEach(t=>{t._group.visible&&(e=!1)}),e}function Tt(t,e,r){const a=document.getElementById(r),o=a.cloneNode(!0);a.parentNode.replaceChild(o,a),o.addEventListener("click",()=>{t.download("csv",`${e}.csv`,{delimiter:";",bom:!0})})}function At(t,e,r){const a=document.getElementById(r),o=a.cloneNode(!0);a.parentNode.replaceChild(o,a),o.addEventListener("click",()=>{const r=t.getRows().map(t=>t.getData()),a=t.getColumns(),o={};a.forEach((t,e)=>{const a=t.getField();a&&r.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 vt(t,e,r){const a=document.getElementById(r);a&&a.addEventListener("click",()=>{t.setGroupStartOpen(!1),t.setData(e)})}function Dt(t,e,r){const a=document.getElementById(r);a&&a.addEventListener("click",()=>{t.setGroupStartOpen(!0),t.setData(e)})}const $t={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=[],r={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,r)=>{e<=t&&5===a&&(a=r)})),r[a]}(a,e);o.classList.add(t)}return o}return t.forEach(t=>{const r=t;"noData"===r.operationalstatus&&(r.so2value="ND",r.no2value="ND",r.o3value="ND",r.pm10value="ND",r.pm25value="ND");const o=document.createElement("tr"),n=document.createElement("td");n.innerHTML=r.address,o.appendChild(n),o.appendChild(a(`${r.entityid}_so2`,r.so2value,$t.SO2)),o.appendChild(a(`${r.entityid}_no2`,r.no2value,$t.NO2)),o.appendChild(a(`${r.entityid}_o3`,r.o3value,$t.O3)),o.appendChild(a(`${r.entityid}_pm10`,r.pm10value,$t.PM10)),o.appendChild(a(`${r.entityid}_pm25`,r.pm25value,$t.PM25)),e.push(o)}),e}function Lt(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function Ct(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function Ut(t,e){document.querySelectorAll(`[${t}]`).forEach(r=>{!function(t,e,r){const a=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(a.innerHTML=this.responseText,r&&r()),404===this.status&&(a.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(r.getAttribute(t),r,e)})}function wt(t){window.realDashboardsInit=Dashboards.init,Dashboards.init=function(){console.warn("Dashboards.init bloqueado temporalmente")},Ut("include-html-cabecera",function(){!function(){const t=Ct();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=Ct();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()}),Ut("include-html-menu"),Ut("include-html-main-container",function(){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()}),Ut("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,r,a,o,n){let i=!1,s=!1;const l=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function d(t=!0){const e=document.querySelector(r);t?(l&&(l.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),s=!0):(e.classList.remove("blur"),u(),s=!1)}const f=t=>{new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(s||u(),i||(i=!0,window.setTimeout(d,n)))})}).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",()=>{d(!1),window.setTimeout(d,n)})):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=>`${E(t)}€`}}]},Pt=(t,e)=>{e.sort((t,e)=>parseInt(t.anyo)-parseInt(e.anyo));const r={};e.forEach(e=>{const a=e[1],o=e[0];o!==t.seriesName||r[a]||(r[a]=0),o===t.seriesName&&(r[a]+=e[2])});let a=`<p>${t.seriesName}</p>`;for(const[e,o]of Object.entries(r))a+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${M(o)}</span></div>`;return a};function Ot(t,e,r=void 0,a=void 0){const o=null===a?void 0:a,n=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=>Pt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,r,a,o){const n={},i=o.contentSize[1]/2,s=o.viewSize[1],l=t[1];return l<i?n.top=10:l+i>s?n.bottom=10:n.top=l-i,t[0]<o.viewSize[0]/2?n.left=t[0]+20:n.right=o.viewSize[0]-t[0]+20,n}},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=>M(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(n),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>M(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 r=function(t){return t.reduce((t,e)=>{const r=e[0];return t[r]||(t[r]=[]),t[r].push(e),t},{})}(e),a=Object.keys(r);n.forEach(t=>{a.forEach(e=>{void 0===r[e].find(e=>e[1]===t)&&(r[e].push([r[e][0][0],t,void 0]),r[e].sort())})});const s=[];return Object.keys(r).forEach(e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=r[e].map(t=>t[2]);let a={};a=void 0!==o?q(t,o):t,s.push({...a})}),s})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let l={};l=void 0!==r?q(s,r):s,x(t,l)}function It(t){let e={};return e=q(Nt,t),e}function kt(t,e,r={},a={}){let n={};n=q(r,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach(e=>{t.add(e[1])}),Array.from(t).sort((t,e)=>t-e)}()}});const i={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},s=null===a?i:q(a,i),l=e;l.forEach((t,e)=>{l[e][0]=o(t[0])}),Ot(t,l,n,s)}function Rt(t,e=void 0){const r={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=>P(t,!1)},series:[{type:"bar",showBackground:!0}]};let a={};a=void 0!==e?q(r,e):r,x(t,a)}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)),r=Array.from({length:12},()=>0);return e.forEach(([t,e,a])=>{const o=parseInt(e,10)-1;r[o]=a}),r}function _t(t){const e=t.filter(e=>Number(e[0])===zt(t)-1),r=Array.from({length:12},()=>0);return e.forEach(([t,e,a])=>{const o=parseInt(e,10)-1;r[o]=a}),r}function Gt(t,e,r=void 0){const a=zt(e).toString(),o=(zt(e)-1).toString();Rt(t,q({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:p(),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)}]},r))}function Vt(t,e,r){const a=document.querySelector(e),o=document.querySelector(t);let n=!1;o.addEventListener("click",()=>{!1===n&&(n=!0,a.setAttribute("src","about:blank"),a.setAttribute("src",r),a.onload=()=>{n=!1})}),o.disabled=!1}const qt="id",Yt="fecha",Wt="value";function jt(t,e,r,a,o="es_ES"){const[n,i]=function(t,e,r){const a=[],o=[];return t.forEach(t=>{e.includes(`${t[qt]}`)?a.push(`${t[Yt]}`):r.includes(`${t[qt]}`)&&o.push(`${t[Yt]}`)}),[a.map(t=>[t,0]),o.map(t=>[t,0])]}(t,r,a);let s="es_ES"==o?"Datos sin validar":"Dades sense validar";0===i.length&&(s="");const l={name:"Datos validados",type:"line",data:[...n,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,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:u,yAxis:Math.max(...t.filter(t=>null!==t[Wt]).map(t=>parseInt(`${t[Wt]}`,10)))}]]}}]}function Jt(t,e,r=void 0){x(t,q({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=>U(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},r))}return e})(),t.exports=e()}},e={};function r(a){var o=e[a];if(void 0!==o)return o.exports;var n=e[a]={exports:{}};return t[a](n,n.exports,r),n.exports}r.d=(t,e)=>{for(var a in e)r.o(e,a)&&!r.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.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";r.r(a),r.d(a,{chargeData:()=>J,clearInputs:()=>V,createSerie:()=>H,echartLineLinia:()=>K,echartLineTitol:()=>X,echartUsuarisPerLinea:()=>Et,echartUsuarisPerLiniaBarYear:()=>$t,echartUsuarisPerLiniaGaugeMonth:()=>ft,echartUsuarisPerLiniaGaugeYear:()=>ut,echartUsuarisPerLiniaLineMonth:()=>vt,echartUsuarisPerTitol:()=>St,echartUsuarisPerTitolBarYear:()=>Dt,echartUsuarisPerTitolGaugeMonth:()=>dt,echartUsuarisPerTitolGaugeYear:()=>ct,echartUsuarisPerTitolLineMonth:()=>At,echartUsuarisTotals:()=>yt,echartUsuarisTotalsBarMonth:()=>I,echartUsuarisTotalsGaugeMonth:()=>pt,echartUsuarisTotalsGaugeYear:()=>lt,echartUsuarisTotalsStackedBarYears:()=>gt,filterData:()=>et,filterEMT1Update:()=>q,filterEMT2Update:()=>Y,handlerActivarFiltro:()=>Q,handlerDesactivarFiltro:()=>tt,listeneresEMT:()=>rt,usdEmtUsuarisPerLinea:()=>Tt,usdEmtUsuarisPerTitol:()=>Mt,usdEmtUsuarisTotals:()=>bt});const t="8%",e="2.5%",o="5%",n="18%",i="20%",s="10%",l="90%",c="1%",u="0%",d=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],f=33,h=27,m=30;function p(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const r={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",r):t.toLocaleString(e,r)}function g(t){return 100*(1-17/t)}function y(t,e=!1){let r=`<p>${t[0].name}</p>`;return t.forEach(t=>{const a=e?Math.round(t.data):t.data,o=`<div>${n=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${n}"></span>`} ${t.seriesName}: <strong style="float: right; margin-left:20px">${t.data?p(a):"-"}</strong></div>`;var n;r+=o}),r}function b(t){return p(t)}function S(){const t=$("#formFilterDates").find("input"),e=[];$(t).each((t,r)=>{r.checked&&e.push(r.id)}),Dashboards.fireChange("filterDatesParam",e),Dashboards.fireChange("updateFilter","True")}function M(t){return{1:"GENER",2:"FEBRER",3:"MARÇ",4:"ABRIL",5:"MAIG",6:"JUNY",7:"JULIO",8:"AGOST",9:"SETEMBRE",10:"OCTUBRE",11:"NOVEMBRE",12:"DESEMBRE"}[t]}function E(t,e){const r=t?document.querySelector(t):null,a=e?document.querySelector(e):null;r&&(r.hidden=!0),a&&(a.style.background="url('./build/images/nodata1.png') no-repeat top center",a.hidden=!1)}function T(t,e){const r=t?document.querySelector(t):null,a=e?document.querySelector(e):null;r&&(r.hidden=!0),a&&(a.style.background="#ffffff",a.hidden=!1)}function A(t,e){return t.reduce((t,r)=>{const a=r[e];return t[a]||(t[a]=[]),t[a].push(r),t},{})}function v(t,e,r=1){const a=Math.max(...t.map(t=>t[e]))*r;return 5e3*Math.ceil(a/5e3)}function D(t){return Math.round(document.getElementById(t).offsetWidth/f)}function x(r,a,d,f,h,m,p,g=5,S="",M=h,E=100,T,A=void 0,v=void 0){return{title:{text:S,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",show:!0,formatter:t=>y(t),textStyle:{fontFamily:"Montserrat"}},legend:a?{type:"plain",data:a,textStyle:{fontFamily:"Montserrat"},top:A||t,selected:T}:null,grid:{left:e,right:o,bottom:n,top:a?A?"30%":i:s,heigh:l,containLabel:!0},xAxis:{type:"category",data:d,boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{name:f,nameLocation:"end",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"bold",padding:[0,0,0,p]},type:"value",scale:!0,min:v,axisLabel:{margin:g,formatter:b,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},series:r,dataZoom:[{show:m,data:d,start:M,end:E,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}],toolbox:{show:m,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:c,top:u}}}function L(t,r,a,s,c="",u="total",f=0,h=1,m=2,S=d){if(0===a.length)E(`#${t}`,`#${r}`);else{T(`#${r}`,`#${t}`);const d=[];let M=A(a,f);const E=new Set(a.map(t=>t[h])),v=Object.keys(M);E.forEach(t=>{v.forEach(e=>{void 0===M[e].find(e=>e[h]===t)&&(M[e].push([M[e][0][f],t,void 0]),M[e][0][1].length>4?M[e].sort((t,e)=>{const[r,a]=t[1].split("/"),[o,n]=e[1].split("/"),i=new Date(a,r-1,1),s=new Date(n,o-1,1);return i.getTime()-s.getTime()}):M[e].sort())})});const D=Object.entries(M).sort((t,e)=>t[0].localeCompare(e[0])),$=""===u?90:0;M=Object.fromEntries(D),Object.keys(M).forEach(t=>{d.push({name:t,type:"bar",stack:u,label:{show:!0,fontFamily:"Montserrat",rotate:$,formatter:t=>p(Math.round(t.value))},emphasis:{focus:"series"},data:M[t].map(t=>t[m])})});const x=""!==u?g(E.size):100*(1-7/E.size);P(t,{color:S,title:{text:c,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat"},formatter:t=>y(t,!0)},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:e,right:o,bottom:n,top:i,heigh:l,containLabel:!0},yAxis:{type:"value",splitNumber:4,name:s,nameLocation:"end",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666"},axisLabel:{formatter:b,textStyle:{fontSize:8,fontFamily:"Montserrat",color:"#666"}}},xAxis:{type:"category",data:[...E],axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:d,toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50},dataZoom:[{show:!0,data:[...E],start:x,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)"}}}]})}}function C(t,e,r,a,o,n,i){if(0===o.length)E(`#${t}`,`#${r}`),E(`#${e}`,`#${a}`);else{T(`#${r}`,`#${t}`),T(`#${a}`,`#${e}`);const s=0,l=2,c=function(t,e){const r=v(t,e,1.1);let a=50,o=180;r>9999999&&(a=65,o=95);const n=A(t,1);let[i,s]=Object.values(n);return Object.values(n).slice(1).forEach(t=>{s=t}),[s,i,n,r,a,o]}(o,l),u=c[0],d=c[1],f=c[2],h=c[3],m=c[5],p=D(t),g=N(u,l,s,m,p),y=N(d,l,s,m,p);P(t,w(`${n}${M(String(Object.keys(f)[1]))}`,h,g,p)),P(e,w(`${i}${M(String(Object.keys(f)[0]))}`,h,y,p))}}function U(t,e,r,a){0===r.length?E(`#${t}`,`#${e}`):T(`#${e}`,`#${t}`);const o=v(r,1,1.1),n=D(t);let i=180;o>9999999&&(i=95);const s=N(r,1,0,i,n);P(t,w(`${a} ${r[0][2]}`,o,s,n))}function w(t,e,r,a){return{color:d,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 r=`<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>`),r+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:r,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 F(t){if(t.length>=29){const e=t.split(" ");let r="",a="";for(const t of e)`${r} ${t}`.length<=29?r+=(r?" ":"")+t:(a+=`${r}\n`,r=t);return a+=r,a}return t}function N(t,e,r,a,o){let n=20,i=35,s=-190,l=a;t.length<=2&&(s=-140,l+=100,n=25,i=42);const c=d.slice(),u=[];for(let a=0;a<t.length;a+=1)u.push({value:t[a][e],name:F(t[a][r]),color:c.shift(),title:{offsetCenter:[String(s),`${String(n)}%`],fontFamily:"Montserrat",fontSize:o-3},detail:{offsetCenter:[String(s),`${String(i)}%`],fontFamily:"Montserrat"}}),s+=l,(a+1)%3==0&&(i+=30,n+=30,s=-190);return u}function P(t,e){const r=document.getElementById(t);if(!r)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const a=echarts.init(r);return a.setOption(e,!0),$(window).on("resize",()=>{null!=a&&void 0!==a&&a.resize()}),a}function O(t){return 100*(t-120)/t}function I(t,e){0===e.resultset.length?E("#chartUsuarisTotalsBarMonth","#no_dataUsuarisTotalsBarMonth"):(T("#no_dataUsuarisTotalsBarMonth","#chartUsuarisTotalsBarMonth"),P("chartUsuarisTotalsBarMonth",function(t,e,r=-45,a="",o=e){const n=new Set,i=[];t.forEach(t=>{const e=t[0].toString().padStart(2,"0");n.add(`${e}/${t[1]}`),i.push(Math.round(t[2]))});const s=i.length<100?40:80;return x({name:o,type:"bar",smooth:!1,barMaxWidth:40,itemStyle:{color:"#5470c6"},textStyle:{fontFamily:"Montserrat"},data:i},null,Array.from(n.values()),e,s,!0,r,25,a)}(e.resultset,"Viatges",void 0,"ÚS D'EMT. USUARIS TOTALS: EVOLUCIÓ MENSUAL","Nombre viatges EMT")))}let k,R,z,B,_={start:void 0,end:void 0},G={start:void 0,end:void 0};function V(t=null){let e=$("#formFilterDates").find("input");e=$("#formFilterDates").find("input"),$(e).each((t,r)=>{r.checked&&(e[t].checked=!1)});const r=$("#formFilterEMT1").find("input");if($(r).each((t,e)=>{e.checked&&(r[t].checked=!1)}),t){const t=$("#formFilterEMT2").find("input");$(t).each((e,r)=>{r.checked&&(t[e].checked=!1)})}const a=$("#formFilterVar").find("input");$(a).each((t,e)=>{e.checked&&(a[t].checked=!1)}),function(t){let e=0;const r=$("#formFilterDates").find("input");$(r).each(t=>{e+=1,r[t].checked=!0}),e=0;const a=$("#formFilterEMT1").find("input");$(a).each(t=>{e+=1,e<=6&&(a[t].checked=!0)});const o=$("#formFilterEMT2").find("input");$(o).each(r=>{t&&t.includes(o[r].id)&&(e+=1,e<=6&&(o[r].checked=!0))}),e=0;const n=$("#formFilterVar").find("input");$(n).each(t=>{e+=1,e<=2&&(n[t].checked=!0)}),Dashboards.getParameterValue("filterDatesParam").length>0&&(Dashboards.fireChange("filterDatesParam"),render_echartAccessosCiutat.listeners=["filterDatesParam"],Dashboards.fireChange("filterDatesParam"),render_echartAccessosCiutat.listeners=[""]),Dashboards.getParameterValue("filterEMT2Param").length>0&&Dashboards.fireChange("filterEMT2Param"),Dashboards.getParameterValue("filterVarParam").length>0&&Dashboards.fireChange("filterVarParam")}(t)}function q(){k&&([_]=k.getOption().dataZoom);const t=$("#formFilterEMT1").find("input"),e=[];$(t).each((t,r)=>{r.checked&&e.push(r.id)}),Dashboards.fireChange("filterEMT1Param",e),Dashboards.fireChange("updateFilterEMT1","True")}function Y(){z&&([G]=z.getOption().dataZoom);const t=$("#formFilterEMT2").find("input"),e=[];$(t).each((t,r)=>{r.checked&&e.push(r.id)}),Dashboards.fireChange("filterEMT2Param",e),Dashboards.fireChange("updateFilterEMT2","True")}function W(t,e="number",r=null){let a;return"number"===e?a=new Map([...t].filter(([t])=>!Number.isNaN(Number(t)))):"includes"===e&&(a=new Map([...t].filter(([t])=>t.includes(r)))),a}function j(t){const e=Array.from(t.keys()).sort((t,e)=>t-e),r=new Map;return e.forEach(e=>{r.set(e,t.get(e))}),r}function J(t,e,r=!1){const a=[],o=new Set,n=r?new Map:new Set;for(let i=0;i<e.length;i+=1)(0===t.length||t.includes(e[i][0]))&&(r?n.set(e[i][0],e[i][0]):n.add(e[i][0]),a.push({day:e[i][1],type:e[i][0],value:e[i][2]}),o.add(e[i][1]));return[n,a,Array.from(o.values())]}function H(t,e,r){const a=d.slice();return t.map(t=>{const o=e.filter(e=>e.type===t),n=r.map(t=>{const e=o.findIndex(e=>e.day===t);return-1!==e?o[e].value:null});return{name:t,type:"line",symbol:"circle",color:a.shift(),symbolSize:6,smooth:!1,data:n}})}function Z(t){const e={};t.forEach(t=>{const r=t.type,a=t.value;e[r]=(e[r]||0)+a});const r=Object.keys(e).map(t=>({tipo:t,valor:e[t]}));return r.sort((t,e)=>e.valor-t.valor),r.map(t=>t.tipo)}function X(t,e,r,a,o){const n=Dashboards.getParameterValue("filterEMT1Param");if(0===r.length)E(`#${t}`,`#${e}`);else{T(`#${e}`,`#${t}`);const[i,s,l]=J(n,r);if(!o){const t=Z(s);!function(t,e){const r=$("#formFilterEMT1");""===Dashboards.getParameterValue("updateFilterEMT1")&&(e.forEach(t=>{r.append(`<input type="checkbox" id="${t}" class="titol-${t}" onclick="emt.filterEMT1Update();" /> ${t} </br>`)}),V(),S(),q())}(t.length,t),n&&n.sort((t,e)=>t.localeCompare(e))}if(n){const r=x(H(n,s,l),n,l,"Viatges",o?g(l.length):O(l.length),!0,-10,void 0,a,_.start,_.end);let i;o?(R=P(t,r),i=R):(k=P(t,r),i=k),0===$("#formFilterEMT1 :checked").length&&E(`#${t}`,`#${e}`),$(window).on("resize",()=>{null!=i&&void 0!==i&&i.resize()})}}}function K(t,e,r,a,o){const n=Dashboards.getParameterValue("filterEMT2Param");if(0===r.length)E(`#${t}`,`#${e}`);else{T(`#${e}`,`#${t}`);const[i,s,l]=J(n,r,!0);if(!o){const t=Array.from(j(W(i,"number")).values());let e=[];(function(t){const e=[];return t.forEach((t,r)=>{Array.from(r).forEach(t=>{!e.includes(t)&&Number.isNaN(Number(t))&&e.push(t)})}),e})(i).forEach(t=>{e=e.concat(Array.from(j(function(t){const e=/\d+/g,r=new Map;return t.forEach(a=>{r.set(a.match(e),t.get(a))}),r}(W(i,"includes",t))).values()))});let r=t.concat(e);r=[...new Set(r)];const a=Z(s).slice(0,6);!function(t,e,r){const a=$("#formFilterEMT2");""===Dashboards.getParameterValue("updateFilterEMT2")&&(e.forEach(t=>{a.append(`<input type="checkbox" id="${t}" class="linea-${t}" onclick="emt.filterEMT2Update();" />`)}),V(r),S(),Y())}(r.length,r,a)}if(n){const r=x(H(n,s,l),n,l,"Viatges",O(l.length),!0,-10,void 0,a,G.start,G.end);let i;o?(B=P(t,r),i=B):(z=P(t,r),i=z),0===$("#formFilterEMT1 :checked").length&&E(`#${t}`,`#${e}`),$(window).on("resize",()=>{null!=i&&void 0!==i&&i.resize()})}}}function Q(){document.querySelector("#idFiltrar").style.visibility="visible"}function tt(){document.querySelector("#idFiltrar").style.visibility="hidden"}function et(t,e){return t.filter(t=>e.includes(t[0]))}function rt(){const t=["filterDatesParam","updateFilter","filterEMT1Param","updateFilterEMT1"],e=["filterDatesParam","updateFilter","filterEMT2Param","updateFilterEMT2"];render_echartUsuarisPerLinea.listeners=e,render_echartUsuarisPerLiniaLineMonth.listeners=e,render_echartUsuarisPerLiniaGaugeYear.listeners=e,render_echartUsuarisPerLiniaGaugeMonth.listeners=e,render_echartUsuarisPerLiniaBarYear.listeners=e,render_echartUsuarisPerTitol.listeners=t,render_echartUsuarisPerTitolLineMonth.listeners=t,render_echartUsuarisPerTitolGaugeYear.listeners=t,render_echartUsuarisPerTitolGaugeMonth.listeners=t,render_echartUsuarisPerTitolBarYear.listeners=t,render_echartUsuarisTotals.listeners=["filterDatesParam","updateFilter"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter"),Dashboards.fireChange("filterEMT1Param"),Dashboards.fireChange("updateFilterEMT1"),Dashboards.fireChange("filterEMT2Param"),Dashboards.fireChange("updateFilterEMT2")}const at="ca_ES",ot={es_ES:new Map([["chartUsuarisTotalsGaugeYear","USO DE EMT. USUARIOS TOTALES: ÚLTIMOS AÑOS"]]),ca_ES:new Map([["chartUsuarisTotalsGaugeYear","US D'EMT. USUARIS TOTALS: ÚLTIMS ANYS"]])},nt={es_ES:new Map([["chartUsuarisTotalsGaugeMonth","USO DE EMT. USUARIOS TOTALES: MES ACTUAL"],["chartUsuarisTotalsGaugeLastMonth","USO DE EMT. USUARIOS TOTALES: MES ANTERIOR"]]),ca_ES:new Map([["chartUsuarisTotalsGaugeMonth","ÚS D'EMT. USUARIS TOTALS: MES ACTUAL"],["chartUsuarisTotalsGaugeLastMonth","ÚS D'EMT. USUARIS TOTALS: MES ANTERIOR"]])};var it=r(2725);const st={color:void 0,title:{text:"",left:"center",top:"top",padding:10,textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"}},splitNumber:3,series:{type:"gauge",max:void 0,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:10},axisLabel:{show:!0,distance:70,formatter:void 0,fontFamily:"Montserrat",color:"#666"},data:[],detail:{fontSize:12,color:"inherit"}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:27,top:30}};function lt(t,e){!function(t,e){const r=e.resultset,a=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"];if(0===e.length)(0,it.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{(0,it.printDataChart)(`#${t.idNoData}`,`#${t.idChart}`);const e={type:0,data:1,time:2},[o,n]=(0,it.configureDataGaugeCommon)(r,e,a.slice(),t.fontSize,t.paramOffsetCenterTitle,t.paramOffsetCenterDetail,t.paramOffsetLabel,t.paramCalculatedOffset,t.paramNumberOfElementsByLine),i={...st};i.title.text=t.chartName,i.series.max=o,i.series.data=n,i.series.detail.fontSize=t.fontSize,i.series.detail.formatter=t=>(0,it.addPointInteger)(Math.round(t)),i.series.axisTick.splitNumber=5,i.color=a.slice(),i.series.axisLabel.formatter=t=>(0,it.addPointInteger)(Math.round(t)),i.tooltip.formatter=t=>function(t){let e=`${t.name} : `;return e+=`<span style="font-weight:bold">${(0,it.addPointInteger)(Math.round(t.value))}</span>`,t.marker+e}(t),(0,it.initChart)(t.idChart,i)}}({idChart:"chartUsuarisTotalsGaugeYear",idNoData:"no_dataUsuarisTotalsGaugeYear",chartName:`${ot[at].get("chartUsuarisTotalsGaugeYear")}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-100,paramCalculatedOffset:50,paramNumberOfElementsByLine:5},e)}function ct(t,e){const r=Dashboards.getParameterValue("filterEMT1Param");if(r.length>0){const a=et(e.resultset,r);function o(){U("chartUsuarisTitolGaugeYear","no_dataUsuarisTitolGaugeYear",a,"ÚS D'EMT. USUARIS PER TÍTOL: ANY")}r.sort((t,e)=>t.localeCompare(e)),0===document.querySelector("#chartUsuarisTitolGaugeYear").childElementCount?document.querySelector("#tabUsuarisPerTitol").addEventListener("click",()=>{requestAnimationFrame(()=>{o()})}):o()}}function ut(t,e){const r=Dashboards.getParameterValue("filterEMT2Param"),a=et(e.resultset,r);function o(){U("chartUsuarisLiniaGaugeYear","no_dataUsuarisLiniaGaugeYear",a,"ÚS D'EMT. USUARIS PER LÍNIA: ANY")}a.sort((t,e)=>Number(t[0])-Number(e[0])),0===document.querySelector("#chartUsuarisLiniaGaugeYear").childElementCount?document.querySelector("#tabUsuarisPerLinia").addEventListener("click",()=>{requestAnimationFrame(()=>{o()})}):o()}function dt(t,e){const r=Dashboards.getParameterValue("filterEMT1Param"),a=et(e.resultset,r);function o(){C("chartUsuarisTitolMesActual","chartUsuarisTitolMesAnterior","no_dataUsuarisTitolMesActual","no_dataUsuarisTitolMesAnterior",a,"ÚS D'EMT. USUARIS PER TÍTOL: EVOLUCIÓ ","ÚS D'EMT. USUARIS PER TÍTOL: EVOLUCIÓ ")}0===document.querySelector("#chartUsuarisTitolMesActual").childElementCount||0===document.querySelector("#chartUsuarisTitolMesAnterior").childElementCount?document.querySelector("#tabUsuarisPerTitol").addEventListener("click",()=>{requestAnimationFrame(()=>{o()})}):o()}function ft(t,e){const r=Dashboards.getParameterValue("filterEMT2Param"),a=et(e.resultset,r);function o(){C("chartUsuarisLiniaMesActual","chartUsuarisLiniaMesAnterior","no_dataUsuarisLiniaMesActual","no_dataUsuarisLiniaMesAnterior",a,"ÚS D'EMT. USUARIS PER LÍNIA: EVOLUCIÓ ","ÚS D'EMT. USUARIS PER LÍNIA: EVOLUCIÓ ")}a.sort((t,e)=>Number(t[0])-Number(e[0])),0===document.querySelector("#chartUsuarisLiniaMesActual").childElementCount||0===document.querySelector("#chartUsuarisLiniaMesAnterior").childElementCount?document.querySelector("#tabUsuarisPerLinia").addEventListener("click",()=>{requestAnimationFrame(()=>{o()})}):o()}const ht={title:{text:"",left:"center",top:"top",padding:10,textStyle:{fontSize:12,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:void 0,itemStyle:{color:"#FFAB91"},progress:{show:!0,width:30},pointer:{show:!1},axisLine:{lineStyle:{width:30}},axisTick:{distance:5,splitNumber:10,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=>(0,it.addPointInteger)(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[0,"0%"],fontSize:17,fontWeight:"bolder",formatter:void 0,fontFamily:"Montserrat",color:"inherit"},data:void 0},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:27,top:40}};function mt(t,e,r){const a=e.resultset;if(0===a.length||r<0||r>=a.length)(0,it.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{(0,it.printDataChart)(`#${t.idNoData}`,`#${t.idChart}`);const e=a[r],o={type:0,time:1,data:2},[n,i,s]=(0,it.configureDataGaugeMonthCommon)(t.idChart,[e],o,0),l=JSON.parse(JSON.stringify(ht));l.title.text=t.chartName,l.series.max=n,l.series.detail.formatter=i,l.series.data=s,(0,it.initChart)(t.idChart,l)}}function pt(t,e){const r={idChart:"chartUsuarisTotalsGaugeMonth",idNoData:"no_dataUsuarisTotalsGaugeMonth",chartName:`${nt[at].get("chartUsuarisTotalsGaugeMonth")}`},a={idChart:"chartUsuarisTotalsGaugeLastMonth",idNoData:"no_dataUsuarisTotalsGaugeLastMonth",chartName:`${nt[at].get("chartUsuarisTotalsGaugeLastMonth")}`};mt(r,e,0),mt(a,e,1)}function gt(t,e){if(0===e.resultset.length)E("#chartUsuarisTotalsStackedBarYears","#no_dataUsuarisTotalsStackedBarYears");else{T("#no_dataUsuarisTotalsStackedBarYears","#chartUsuarisTotalsStackedBarYears");const t={title:{text:"ÚS D'EMT. USUARIS TOTALS: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nViatges"}};(0,it.initStackedBarChartMonthSeries)("chartUsuarisTotalsStackedBarYears",e.resultset,t)}}function yt(t,e){!function(t,e,r,a,o,n,i,s,l=!1,c=!1,u,f=!0,h=d.slice(),m=!1,p,y){const b=t.resultset||t;if(0===b.length)E(`#${n}`,`#${i}`),s&&E(`#${s}`,`#${i}`);else{T(`#${i}`,`#${n}`),s&&T(`#${i}`,`#${s}`);const t=function(t,e,r=!1){const{resultset:a}={resultset:t},o=new Set,n=new Set,i=e,s=a.map(([t,e,a])=>{const i=r?Math.round(a):a;return o.add(t),n.add(e),{day:e,type:t,value:i}}),l=Array.from(n.values()),c=Array.from(o.values());return c.sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0})),[c.map(t=>{const e=s.filter(e=>e.type===t).map(({day:e,value:r})=>[e,t,r]),r=l.map(t=>{const r=e.find(([e])=>e===t);return r?r[2]:null});return{name:t,type:"line",symbol:"circle",color:i.shift(),symbolSize:6,smooth:!1,data:r}}),n,c]}(b,h,m),d=t[0],M=t[1],E=t[2],A=f?E:null,v=c?(S=M,Array.from(S.values()).map(t=>{const[e,r]=t.split("/");return function(t){const e=t.slice(0,2);return`${t.slice(3,5)}/${e}`}(t)})):Array.from(M.values());void 0===u&&(u=l?g(M.size):O(M.size)),P(n,x(d,A,v,o,u,e,r,void 0,a,void 0,void 0,void 0,p,y))}var S}(e,!0,1,"ÚS D'EMT: USUARIS TOTALS","Viatges","chartUsuarisTotals","no_dataUsuarisTotals",void 0,void 0,void 0,void 0,!1)}function bt(){tt(),$("#idFieldsFilterEmtUsLinea").hide(),$("#idFieldsFilterEmtUsTitol").hide()}function St(t,e){X("chartUsuarisPerTitol","no_dataUsuarisPerTitol",e.resultset,"ÚS D'EMT: USUARIS PER TÍTOL",!1)}function Mt(){Q(),$("#idAllFilterFields").show(),$("#idFieldsFilterEmtUsLinea").hide(),$("#idFieldsFilterEmtUsTitol").show()}function Et(t,e){K("chartUsuarisPerLinea","no_dataUsuarisPerLinea",e.resultset,"ÚS D'EMT: USUARIS PER LÍNIA",!1)}function Tt(){tt(),$("#idAllFilterFields").show(),$("#idFieldsFilterEmtUsLinea").show(),$("#idFieldsFilterEmtUsTitol").hide()}function At(t,e){X("chartUsuarisTitolLineMonth","no_dataUsuarisTitolLineMonth",e.resultset,"ÚS D'EMT. USUARIS PER TÍTOL: HISTÒRIC MENSUAL",!0)}function vt(t,e){K("chartUsuarisLiniaLineMonth","no_dataUsuarisLiniaLineMonth",e.resultset,"ÚS D'EMT. USUARIS PER LÍNIA: HISTÒRIC MENSUAL",!0)}function Dt(t,e){const r=Dashboards.getParameterValue("filterEMT1Param");L("chartUsuarisTitolBar","no_dataUsuarisTitolBar",et(e.resultset,r),"Viatges","ÚS D'EMT. USUARIS PER TÍTOL: HISTÒRIC ANUAL","")}function $t(t,e){const r=Dashboards.getParameterValue("filterEMT2Param");L("chartUsuarisLiniaBar","no_dataUsuarisLiniaBar",et(e.resultset,r),"Viatges","ÚS D'EMT. USUARIS PER LÍNIA: HISTÒRIC ANUAL","")}})(),a})());
|