ar-poncho 2.0.3 → 2.0.4
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/.babelrc +4 -0
- package/.github/workflows/build-poncho.yml +71 -0
- package/.vscode/settings.json +3 -0
- package/composer.json +1 -1
- package/dist/css/argentina.css +3 -163
- package/dist/css/device-breadcrumb.css +1 -0
- package/dist/css/documentacion.css +1 -32
- package/dist/css/encode-fontface.css +1 -0
- package/dist/css/icono-arg.css +697 -13
- package/dist/css/miargentina.css +1 -1656
- package/dist/css/planilla-cud.css +1 -130
- package/dist/css/ponchito.css +1 -1
- package/dist/css/poncho-map.css +1 -0
- package/dist/css/poncho.css +4 -5830
- package/dist/css/poncho.min.css +3 -4
- package/dist/css/poncho_mobile.css +1 -3
- package/dist/css/roboto-fontface 2.css +239 -0
- package/dist/css/roboto-fontface.css +32 -0
- package/dist/fonts/EncodeSans-Bold.ttf +0 -0
- package/dist/fonts/EncodeSans-Medium.ttf +0 -0
- package/dist/fonts/EncodeSans-Regular.ttf +0 -0
- package/dist/fonts/EncodeSans-SemiBold.ttf +0 -0
- package/dist/fonts/icono-arg_55ca14c9b8a051396574195f270630d6.eot +0 -0
- package/dist/fonts/icono-arg_55ca14c9b8a051396574195f270630d6.svg +5651 -0
- package/dist/fonts/icono-arg_55ca14c9b8a051396574195f270630d6.ttf +0 -0
- package/dist/fonts/icono-arg_55ca14c9b8a051396574195f270630d6.woff +0 -0
- package/dist/fonts/icono-arg_55ca14c9b8a051396574195f270630d6.woff2 +0 -0
- package/dist/js/device-breadcrumb.js +1 -0
- package/dist/js/device-panel-menu.js +1 -0
- package/dist/js/mapa-argentina.js +1 -0
- package/dist/js/national-holidays.js +1 -0
- package/dist/js/poncho.js +6029 -373
- package/dist/js/poncho.min.js +1 -1
- package/dist/js/showdown-extensions.js +55 -0
- package/gulpfile.js +135 -0
- package/package-lock.json +10147 -0
- package/package.json +27 -5
- package/readme.md +25 -10
- package/test/color.test.js +16 -0
- package/test/gapi-sheet-data.test.js +17 -0
- package/test/html.test.js +18 -0
- package/test/poncho-gapi-legacy.test.js +7 -0
- package/test/resources/response.js +56 -0
- package/test/string.test.js +20 -0
- package/dist/css/poncho.css.map +0 -7
- package/dist/css/poncho.map +0 -7
- package/dist/css/poncho.min.css.map +0 -7
- package/dist/css/turnos.css +0 -0
- package/dist/fonts/icono-arg_220d85c68c8d4e97295d1acfea4481d1.eot +0 -0
- package/dist/fonts/icono-arg_220d85c68c8d4e97295d1acfea4481d1.svg +0 -3360
- package/dist/fonts/icono-arg_220d85c68c8d4e97295d1acfea4481d1.ttf +0 -0
- package/dist/fonts/icono-arg_220d85c68c8d4e97295d1acfea4481d1.woff +0 -0
- package/dist/fonts/icono-arg_220d85c68c8d4e97295d1acfea4481d1.woff2 +0 -0
- package/dist/icono-arg.css +0 -1182
package/dist/js/poncho.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function ponchoTable(opt){var filtroColumna,listado=[],filteredTitle=[],filteredTitleGsx=[],filtro=[],titulos="",th=[],lista="";jQuery.fn.DataTable.isDataTable("#ponchoTable")&&jQuery("#ponchoTable").DataTable().destroy(),jQuery.getJSON("https://spreadsheets.google.com/feeds/list/"+opt.idSpread+"/"+opt.hojaNumero+"/public/values?alt=json",function(data){listado=data.feed.entry,jQuery.each(Object.keys(listado[0]),function(index,key){"gsx$"==key.substr(0,4)&&(filteredTitle.push(listado[0][key].$t),filteredTitleGsx.push(key),titulos+="<th>"+listado[0][key].$t+"</th>",th.push(listado[0][key].$t))}),jQuery("#ponchoTable caption").html(opt.tituloTabla),jQuery("#ponchoTable thead tr").empty(),jQuery("#ponchoTable thead tr").append(titulos),jQuery.each(listado,function(row,value){0<row&&(lista+="<tr>",jQuery.each(filteredTitleGsx,function(index,title){var tdEmpty="";if("gsx$"==title.substr(0,4)){if(filas=listado[row][filteredTitleGsx[index]].$t,title==filteredTitleGsx[0]&&(labelBtn=filas),title.includes("btn-")&&""!=filas&&(nameBtn=title.substr(8,title.length-8).replace("-"," "),filas='<a aria-label="'+nameBtn+" "+labelBtn+'" class="btn btn-primary btn-sm margin-btn" target="_blank" href="'+filas+'">'+nameBtn+"</a>"),title.includes("filtro-")&&""!=filas&&(filtroColumna=index,nameFiltro=title.substr(11,title.length-11).replace("-"," "),jQuery("#tituloFiltro").html(nameFiltro),filtro.push(filas)),title.includes("fecha-")&&""!=filas){var dteSplit=filas.split("/");filas='<span style="display:none;">'+(dteSplit[2]+"-"+dteSplit[1]+"-"+dteSplit[0])+"</span>"+filas}""==filas&&(tdEmpty="hidden-xs");var filas=(new showdown.Converter).makeHtml(filas);lista+='<td class="'+tdEmpty+'" data-title="'+th[index]+'">'+filas+"</td>"}}),lista+="</tr>")}),jQuery.each(function(array){return array.filter(function(el,index,arr){return index===arr.indexOf(el)})}(filtro),function(index,val){jQuery("#ponchoTableFiltro").append("<option>"+val+"</option>")}),jQuery("#ponchoTable tbody").empty(),jQuery("#ponchoTableSearchCont").show(),jQuery("#ponchoTable tbody").append(lista),jQuery("#ponchoTable").removeClass("state-loading"),function(){function removeAccents(data){return data.replace(/έ/g,"ε").replace(/[ύϋΰ]/g,"υ").replace(/ό/g,"ο").replace(/ώ/g,"ω").replace(/ά/g,"α").replace(/[ίϊΐ]/g,"ι").replace(/ή/g,"η").replace(/\n/g," ").replace(/[áÁ]/g,"a").replace(/[éÉ]/g,"e").replace(/[íÍ]/g,"i").replace(/[óÓ]/g,"o").replace(/[úÚ]/g,"u").replace(/ê/g,"e").replace(/î/g,"i").replace(/ô/g,"o").replace(/è/g,"e").replace(/ï/g,"i").replace(/ü/g,"u").replace(/ã/g,"a").replace(/õ/g,"o").replace(/ç/g,"c").replace(/ì/g,"i")}var searchType=jQuery.fn.DataTable.ext.type.search;console.log(jQuery.fn.DataTable.ext.type.search),searchType.string=function(data){return data?"string"==typeof data?removeAccents(data):data:""},searchType.html=function(data){return data?"string"==typeof data?removeAccents(data.replace(/<.*?>/g,"")):data:""};var tabla=jQuery("#ponchoTable").DataTable({lengthChange:!1,autoWidth:!1,columnDefs:[{type:"html-num",targets:opt.tipoNumero},{targets:opt.ocultarColumnas,visible:!1}],ordering:opt.orden,order:[[opt.ordenColumna-1,opt.ordenTipo]],dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'i>><'row'<'col-sm-12'tr>><'row'<'col-md-offset-3 col-md-6 col-sm-offset-2 col-sm-8'p>>",language:{sProcessing:"Procesando...",sLengthMenu:"Mostrar _MENU_ registros",sZeroRecords:"No se encontraron resultados",sEmptyTable:"Ningún dato disponible en esta tabla",sInfo:"_TOTAL_ resultados",sInfoEmpty:"No hay resultados",sInfoFiltered:"",sInfoPostFix:"",sSearch:"Buscar:",sUrl:"",sInfoThousands:",",sLoadingRecords:"Cargando...",oPaginate:{sFirst:"<<",sLast:">>",sNext:">",sPrevious:"<"},oAria:{sSortAscending:": Activar para ordenar la columna de manera ascendente",sSortDescending:": Activar para ordenar la columna de manera descendente",paginate:{first:"Ir a la primera página",previous:"Ir a la página anterior",next:"Ir a la página siguiente",last:"Ir a la última página"}}}});jQuery(document).ready(function(){jQuery("#ponchoTableSearch").keyup(function(){tabla.search(jQuery.fn.DataTable.ext.type.search.string(this.value)).draw()})}),jQuery("#ponchoTable_filter").parent().parent().remove(),1<jQuery("#ponchoTableFiltro option").length&&jQuery("#ponchoTableFiltroCont").show();jQuery("#ponchoTableFiltro").on("change",function(){var filtro=jQuery(this).val();""!=filtro?tabla.column(filtroColumna).every(function(){this.search(jQuery.fn.DataTable.ext.type.search.string(filtro)).draw()}):tabla.search("").columns().search("").draw()})}()})}jQuery("#ponchoTable").addClass("state-loading");var opt={tipoMapa:"roadmap"};function ponchoMaps(opt){var puntos,mapOptions={center:new google.maps.LatLng(58,16),zoom:5,mapTypeId:opt.tipoMapa,center:{lat:-39.6930895,lng:-57.2432742},styles:[{featureType:"administrative.country",stylers:[{visibility:"on"}]},{featureType:"poi",stylers:[{visibility:"off"}]}]},map=new google.maps.Map(document.getElementById("map"),mapOptions);jQuery.getJSON("https://spreadsheets.google.com/feeds/list/"+opt.idSpreadheet+"/"+opt.hojaNumero+"/public/values?alt=json",function(data){var autores=["metricas.mod@gmail.com","modernizacion.ux@gmail.com","contenidosgobar@gmail.com"];jQuery.each(data.feed.author,function(index,val){-1==autores.indexOf(val.email.$t)&&(jQuery("body").remove(),window.location.replace("http://www.argentina.gob.ar"))}),puntos=data.feed.entry;var markers=[],detalles=[],template=['<?xml version="1.0"?>','<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="286.818px" height="396.798px" viewBox="63.14 8.15 286.818 396.798" enable-background="new 63.14 8.15 286.818 396.798" xml:space="preserve">','<path stroke="#FFF" stroke-width="10" fill="{{ color }}" d="M206.549,20.359L206.549,20.359c-74.459,0-134.584,60.126-134.584,134.584c0,25.961,8.293,50.751,19.832,71.122l87.71,151.801c5.499,9.916,16.586,14.874,27.043,14.874c10.458,0,21.003-4.958,27.043-14.874l87.71-151.711c11.629-20.373,19.832-44.712,19.832-71.124C341.133,80.574,281.008,20.359,206.549,20.359z M206.549,206.978c-33.804,0-61.41-27.606-61.41-61.41s27.606-61.41,61.41-61.41s61.41,27.606,61.41,61.41C267.959,179.484,240.353,206.978,206.549,206.978z"/>',"</svg>"].join("\n"),colores={azul:{hex:"#0072BB"},verde:{hex:"#2E7D33"},rojo:{hex:"#C62828"},gris:{hex:"#707070"},fucsia:{hex:"#EC407A"},arandano:{hex:"#C2185B"},uva:{hex:"#6A1B99"},cielo:{hex:"#039BE5"},verdin:{hex:"#6EA100"},lima:{hex:"#CDDC39"},maiz:{hex:"#FFCE00"},tomate:{hex:"#EF5350"},"naranja oscuro":{hex:"#EF6C00"},"verde azulado":{hex:"#008388"}};jQuery.each(puntos,function(key,punto){color=punto.gsx$color.$t.toLowerCase(),svg=template.replace("{{ color }}",colores[color].hex);var latLng=new google.maps.LatLng(punto.gsx$latitud.$t,punto.gsx$longitud.$t),marker=new google.maps.Marker({position:latLng,title:punto.gsx$nombre.$t,icon:{url:"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(svg),scaledSize:new google.maps.Size(40,40)},optimized:!1});if(markers.push(marker),provincia=localidad=telefono=email=boton=descripcion=ubicacion=direccion=foto="",""==punto.gsx$provincia.$t&&""==punto.gsx$localidad.$t||(ubicacion='<div class="separarGuiones"><i class="fa fa-map-marker"></i><span>'+punto.gsx$direccion.$t+"</span><span>"+punto.gsx$localidad.$t+"</span><span>"+punto.gsx$provincia.$t+"</span></div>"),""!=punto.gsx$telefono.$t&&(telefono="<div><i class='fa fa-phone'></i>"+punto.gsx$telefono.$t+"</div>"),""!=punto.gsx$email.$t&&(email="<div><i class='fa fa-envelope'></i>"+punto.gsx$email.$t+"</div>"),""!=punto.gsx$descripcion.$t){var converter=new showdown.Converter;descripcion="<div>"+converter.makeHtml(punto.gsx$descripcion.$t)+"</div>"}""!=punto.gsx$boton.$t&&(boton="<hr><a class='btn btn-success btn-sm' href="+punto.gsx$boton.$t+">"+opt.textoBoton+"</a>"),null!=punto.gsx$foto&&(foto='<img width="100%" src="'+punto.gsx$foto.$t+'">'),detalles[key]=new google.maps.InfoWindow({content:'<div class="media"><div class="media-body"><small class="text-primary">'+punto.gsx$tipo.$t+"</small><h4>"+punto.gsx$nombre.$t+"</h4> "+foto+descripcion+ubicacion+telefono+email+boton+"</div></div>",maxWidth:300}),markers[key].addListener("click",function(){closeWindows(),detalles[key].open(map,markers[key])}),jQuery("#map-container").removeClass("state-loading"),marker.setMap(map)});var closeWindows=function(){for(i=0;i<detalles.length;i++)detalles[i].close()};if("si"==opt.agrupar)new MarkerClusterer(map,markers,{enableRetinaIcons:!0,imageSizes:[20,30,40,50,60,70],maxZoom:10,gridSize:50,styles:[{textColor:"white",url:"https://www.argentina.gob.ar/sites/default/files/cluster_ponchomaps.png",width:45,height:45}]})})}var content_popover=document.getElementById("content-popover");function popshow(){content_popover.classList.toggle("hidden")}function pophidde(){content_popover.classList.add("hidden")}
|
|
1
|
+
const ponchoColorDefinitionsList=[{description:"",name:"Azul",color:"#0072BB",code:"primary",alias:["azul","primary"]},{description:"Acción principal o exitosa",name:"Verde",color:"#2E7D33",code:"success",alias:["verde","success"]},{description:"Atención o peligro",name:"Rojo",color:"#C62828",code:"danger",alias:["rojo","danger"]},{description:"Foco o alerta",name:"Amarillo",color:"#F9A822",code:"warning",alias:["amarillo","warning"]},{description:"",name:"Celeste",color:"#2897D4",code:"info",alias:["celeste","info"]},{description:"Elementos básicos",name:"Negro",color:"#333333",code:"black",alias:["negro","black"]},{description:"Enlace visitado",name:"Uva",color:"#6A1B99",code:"uva",alias:["uva"]},{description:"Texto secundario (subtitulos)",name:"Gris",color:"#525252",code:"muted",alias:["gris","muted"]},{description:"Gris área",name:"Gris intermedio",color:"#F2F2F2",code:"gray",alias:["grisintermedio","gris-area","gray"]},{description:"Fondo footer/header",name:"Celeste Argentina",color:"#37BBED",code:"celeste-argentina",alias:["celesteargentina","celeste-argentina"]},{description:"",name:"Fucsia",color:"#EC407A",code:"fucsia",alias:["fucsia"]},{description:"",name:"Arándano",color:"#C2185B",code:"arandano",alias:["arandano"]},{description:"",name:"Cielo",color:"#039BE5",code:"cielo",alias:["cielo"]},{description:"",name:"Verdin",color:"#6EA100",code:"verdin",alias:["verdin"]},{description:"",name:"Lima",color:"#CDDC39",code:"lima",alias:["lima"]},{description:"",name:"Maiz",color:"#FFCE00",code:"maiz",alias:["maiz","maíz"]},{description:"",name:"Tomate",color:"#EF5350",code:"tomate",alias:["tomate"]},{description:"",name:"Naranja oscuro",color:"#EF6C00",code:"naranja",alias:["naranjaoscuro","naranja"]},{description:"",name:"Verde azulado",color:"#008388",code:"verde-azulado",alias:["verdeazulado","verde-azulado"]},{description:"",name:"Escarapela",color:"#2CB9EE",code:"escarapela",alias:["escarapela"]},{description:"",name:"Lavanda",color:"#9284BE",code:"lavanda",alias:["lavanda"]},{description:"",name:"Mandarina",color:"#F79525",code:"mandarina",alias:["mandarina"]},{description:"",name:"Palta",color:"#50B7B2",code:"palta",alias:["palta"]},{description:"",name:"Cereza",color:"#ED3D8F",code:"cereza",alias:["cereza"]},{description:"",name:"Limón",color:"#D7DF23",code:"limon",alias:["limon"]},{description:"",name:"Verde Jade",color:"#006666",code:"verde-jade",alias:["verdejade","verde-jade"]},{description:"",name:"Verde Aloe",color:"#4FBB73",code:"verde-aloe",alias:["verdealoe","verde-aloe"]},{description:"",name:"Verde Cemento",color:"#B4BEBA",code:"verde-cemento",alias:["verdecemento","verde-cemento"]}],colorVariations={high:["primary","verde-jade","success","naranja","danger","arandano","uva","celeste-argentina","palta","verdin","warning","tomate","fucsia","lavanda","black"],medium:["info","verde-azulado","verdin","warning","tomate","fucsia","lavanda","palta","lima","maiz","muted"]},ponchoColorDefinitions=t=>{return ponchoColorDefinitionsList.find(e=>e.alias.some(e=>null!=typeof t&&e==t))||!1},ponchoColor=e=>ponchoColorDefinitions(e)?.color||e,cleanUpHex=e=>{let t=e.toString().replace("#","").trim().toUpperCase();return t=3==t.length?Array.from(t).map(e=>e.repeat(2)).join(""):t},findPonchoColorByHex=t=>ponchoColorDefinitionsList.find(e=>{return cleanUpHex(t)==cleanUpHex(e.color)});async function fetch_json(e,t="GET"){e=await fetch(e,{method:t,headers:{Accept:"application/json","Content-Type":"application/json"}});if(e.ok)return e.json();throw new Error("HTTP error! status: "+e.status)}const replaceSpecialChars=e=>{if(!e)return"";var t="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż",s="aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz";const a=t+t.toUpperCase(),r=s+s.toUpperCase();t=new RegExp(a.split("").join("|"),"g");return e.toString().replace(t,e=>r.charAt(a.indexOf(e)))},slugify=e=>{if(!e)return e;const t="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;";var s=new RegExp(t.split("").join("|"),"g");return e.toString().toLowerCase().replace(/\s+/g,"-").replace(s,e=>"aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------".charAt(t.indexOf(e))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},secureHTML=(e,t=[])=>{var s;return!t.some(e=>"*"===e)&&(e=e.toString().replace(/</g,"<").replace(/>/g,">"),0<t.length)?(s=new RegExp("<("+t.join("|")+")(.*?)>","g"),t=new RegExp("</("+t.join("|")+")(.*?)>","g"),e.replace(s,"<$1$2>").replace(t,"</$1>")):e};function ponchoTable(e){return ponchoTableLegacyPatch(),ponchoTableDependant(e)}ponchoTableLegacyPatch=()=>{document.querySelectorAll("select[id=ponchoTableFiltro]").forEach(e=>{var e=e.parentElement,t=document.createElement("div");t.id="ponchoTableFiltro",t.classList.add("row"),e.parentElement.appendChild(t),e.remove()})};const ponchoTableDependant=u=>{var m,_=[],y={},s=!(!u.hasOwnProperty("orderFilter")||!u.orderFilter),g={},b=["*"];let v={tables:!0,simpleLineBreaks:!0,extensions:["details","images","alerts","numbers","ejes","button","target","bootstrap-tables","video"]};document.querySelector("#ponchoTable").classList.add("state-loading"),jQuery.fn.DataTable.isDataTable("#ponchoTable")&&jQuery("#ponchoTable").DataTable().destroy();const C=(e,t)=>{return s?(t=t,e.toString().localeCompare(t.toString(),"es",{numeric:!0})):null},x=e=>[...new Set(e)],k=(e=0,t,s,a=!1)=>{var r=document.createElement("option");return r.value=s.toString().trim(),r.dataset.column=e,r.textContent=t.toString().trim(),a&&r.setAttribute("selected","selected"),r},l=e=>e.toString().replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),h=e=>e<=0?0:e,p=()=>[...document.querySelectorAll("[data-filter]")].map(e=>e.value),E=()=>!("undefined"==typeof showdown||!showdown.hasOwnProperty("Converter")),w=e=>e.every(e=>{try{return showdown.extension(e),!0}catch(e){return!1}}),S=(e,t)=>{var s=document.createElement("a");return s.setAttribute("aria-label",e),s.classList.add("btn","btn-primary","btn-sm","margin-btn"),s.target="_blank",s.href=t,s.textContent=e,s.setAttribute("rel","noopener noreferrer"),s.outerHTML},j=e=>{var t=e.split("/"),t=new Date(t[2],t[1]-1,t[0]),s=document.createElement("span");return s.style.display="none",s.textContent=t.toISOString().split("T")[0],s.outerHTML+e},L=e=>replaceSpecialChars(e.toLowerCase()),n=(n,l,c)=>{l=l==_.length?l-1:l;const d=p();var e=m.entries.flatMap(e=>{t=n,s=e,a=c,r=d;var t,s,a,r,o=[...Array(h(t+1)).keys()].map(e=>s[_[h(t-1)]]==r[h(t-1)]&&s[_[h(t)]]==a||""==r[h(t-1)]).every(e=>e);if(e[_[h(l-1)]]==c&&o){const i=e[_[h(l)]];return T(l,y)?A(l).filter(e=>L(i).includes(L(e))):i}}).filter(e=>e),e=x(e);return e.sort(C),e},T=e=>{var t=Object.keys(y);return!!g.hasOwnProperty("filtro-"+t[e])},A=e=>{var t=Object.keys(y);return g.hasOwnProperty("filtro-"+t[e])?g["filtro-"+t[e]]:[]},a=(t,a)=>{var r=Object.keys(y);const o=p();for(let s=t+1;s<=r.length&&r.length!=s;s++){let e=n(t,s,a);0==e.length&&(e=((s,a,r)=>{var e=m.entries.flatMap(e=>{const t=e[_[h(a)]];return(e[_[h(s)]]==r||""==r)&&(T(a,y)?A(a).filter(e=>L(t).includes(L(e))):t)}).filter(e=>e),e=x(e);return e.sort(C),e})(t,s,a));const i=document.querySelector("#"+r[s]);i.innerHTML="",i.appendChild(k(s,"Todos","",!0)),e.forEach(e=>{var t;e.trim()&&(t=o[s]==e,i.appendChild(k(s,e,e,t)))})}},t=()=>{return window.location.hash.replace("#","")||!1},O=()=>{var e=jQuery.fn.DataTable.ext.type.search;e.string=e=>e?"string"==typeof e?replaceSpecialChars(e):e:"",e.html=e=>e?"string"==typeof e?replaceSpecialChars(e.replace(/<.*?>/g,"")):e:"";let n=jQuery("#ponchoTable").DataTable({lengthChange:!1,autoWidth:!1,pageLength:u.cantidadItems,columnDefs:[{type:"html-num",targets:u.tipoNumero},{targets:u.ocultarColumnas,visible:!1}],ordering:u.orden,order:[[u.ordenColumna-1,u.ordenTipo]],dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'i>><'row'<'col-sm-12'tr>><'row'<'col-md-offset-3 col-md-6 col-sm-offset-2 col-sm-8'p>>",language:{sProcessing:"Procesando...",sLengthMenu:"Mostrar _MENU_ registros",sZeroRecords:"No se encontraron resultados",sEmptyTable:"Ningún dato disponible en esta tabla",sInfo:"_TOTAL_ resultados",sInfoEmpty:"No hay resultados",sInfoFiltered:"",sInfoPostFix:"",sSearch:"Buscar:",sUrl:"",sInfoThousands:".",sLoadingRecords:"Cargando...",oPaginate:{sFirst:"<<",sLast:">>",sNext:">",sPrevious:"<"},oAria:{sSortAscending:": Activar para ordenar la columna de manera ascendente",sSortDescending:": Activar para ordenar la columna de manera descendente",paginate:{first:"Ir a la primera página",previous:"Ir a la página anterior",next:"Ir a la página siguiente",last:"Ir a la última página"}}}});jQuery("#ponchoTableSearch").keyup(function(){n.search(jQuery.fn.DataTable.ext.type.search.string(this.value)).draw()}),jQuery("#ponchoTable_filter").parent().parent().remove(),1<document.querySelectorAll("#ponchoTableFiltro option").length&&(document.querySelector("#ponchoTableFiltroCont").style.display="block"),jQuery("select[data-filter]").change(function(){var e=jQuery(this).find("option:selected").data("column"),t=jQuery(this).find("option:selected").val();a(e,t),n.columns().search("").columns().search("").draw();const o=Object.keys(y),i=p();i.forEach((e,t)=>{s=o[t];var s=Object.keys(m.headers).indexOf("filtro-"+s),a=l(i[t]),r=l(replaceSpecialChars(i[t]));T(t,y)?n.columns(s).search(L(i[t])):n.columns(s).search(i[t]?`^(${a}|${r})$`:"",!0,!1,!0)}),n.draw()}),u.hasOwnProperty("hash")&&u.hash&&(e=(e=t())?decodeURIComponent(e):"",document.querySelector("#ponchoTableSearch").value=e,n.search(jQuery.fn.DataTable.ext.type.search.string(e)).draw())},r=e=>{(m=e).entries="function"==typeof u.refactorEntries&&null!==u.refactorEntries?u.refactorEntries(m.entries):m.entries,m.headers=(u.hasOwnProperty("headers")&&u.headers?u:m).headers,_=Object.keys(m.headers).filter(e=>e.startsWith("filtro-")),g=u.asFilter?u.asFilter(m.entries):{},y=((r,o)=>{let i={};return o.forEach((t,s)=>{let e=[];e=g.hasOwnProperty(o[s])?g[o[s]]:r.entries.map(e=>e[t]);var a=x(e);a.sort(C),t=t.replace("filtro-",""),i[t]=[],a.forEach(e=>{i[t].push({columna:s,value:e})})}),i})(m,_),u.hasOwnProperty("filterContClassList")&&u.filterContClassList&&((e=document.getElementById("ponchoTableFiltroCont")).removeAttribute("class"),e.classList.add(...u.filterContClassList)),u.hasOwnProperty("searchContClassList")&&u.searchContClassList&&((e=document.getElementById("ponchoTableSearchCont")).removeAttribute("class"),e.classList.add(...u.searchContClassList));{var i=m;(e=document.querySelector("#ponchoTable thead")).innerHTML="";const c=document.createElement("tr"),d=(Object.keys(i.headers).forEach((e,t)=>{var s=document.createElement("th");s.textContent=i.headers[e],s.setAttribute("scope","col"),c.appendChild(s)}),e.appendChild(c),(e=document.querySelector("#ponchoTable caption")).innerHTML="",e.textContent=u.tituloTabla,document.querySelector("#ponchoTable tbody"));d.innerHTML="",i.entries.forEach((r,e)=>{if(Object.values(r).some(e=>String(e).trim())){r="function"==typeof u.customEntry&&null!==u.customEntry?u.customEntry(r):r;const o=d.insertRow();o.id="id_"+e;let a;E()&&(e=u.hasOwnProperty("markdownOptions")?u.markdownOptions:v,a=w(e.extensions)?e:{}),Object.keys(i.headers).forEach(e=>{filas=r[e],e.startsWith("btn-")&&""!=filas?filas=S(e.replace("btn-","").replace("-"," "),filas):e.startsWith("fecha-")&&""!=filas&&(filas=j(filas));var t=o.insertCell(),s=(t.dataset.title=i.headers[e],""==filas&&(t.className="hidden-xs"),u.hasOwnProperty("allowedTags")?u.allowedTags:b),s=e.startsWith("btn-")&&""!=filas?[...s,"a"]:s,e=secureHTML(filas,s);E()?(s=new showdown.Converter(a),t.innerHTML=s.makeHtml(e)):t.innerHTML=e})}})}var t=m,s=document.querySelector("#ponchoTableFiltro");for(f in s.innerHTML="",y){const h=y[f][0].columna||0;var a,r=y[f].map(e=>e.value).sort(C),o=document.createElement("div"),n=(u.hasOwnProperty("filterClassList")?(a="string"==typeof u.filterClassList?u.filterClassList.split(" "):u.filterClassList,o.classList.add(...a)):(a=Math.floor(12/Object.keys(y).length),o.classList.add("col-sm-12","col-md-"+a)),document.createElement("div")),l=(n.className="form-group",document.createElement("label"));l.setAttribute("for",f),l.textContent=t.headers["filtro-"+f];const p=document.createElement("select");p.classList.add("form-control"),p.dataset.filter=1,p.name=f,p.id=f,p.appendChild(k(h,"Todos","",!0)),r.forEach(e=>{e&&p.appendChild(k(h,e,e,!1))}),n.appendChild(l),n.appendChild(p),o.appendChild(n),s.appendChild(o)}document.querySelector("#ponchoTableSearchCont").style.display="block",document.querySelector("#ponchoTable").classList.remove("state-loading"),O()},o=e=>{jQuery.getJSON(e,function(e){var t=new GapiSheetData;m=t.json_data(e),r(m)})};if(u.jsonData){var e=Object.fromEntries(Object.keys(u.jsonData[0]).map(e=>[e,e])),e={entries:u.jsonData,headers:e};r(e)}else if(u.jsonUrl)o(u.jsonUrl);else if(u.hojaNombre&&u.idSpread){e=(new GapiSheetData).url(u.hojaNombre,u.idSpread);o(e)}else{if(!u.hojaNumero||!u.idSpread)throw"¡Error! No hay datos suficientes para crear la tabla.";{var i=u.hojaNumero;const c=new GapiSheetData;e=["https://sheets.googleapis.com/v4/spreadsheets/",u.idSpread,"/?alt=json&key=",c.gapi_key].join("");jQuery.getJSON(e,function(e){e=e.sheets[i-1].properties.title,e=c.url(e,u.idSpread);o(e)})}}};var content_popover=document.getElementById("content-popover");function popshow(){content_popover.classList.toggle("hidden")}function pophidde(){content_popover.classList.add("hidden")}var ponchoUbicacion=function(e){var s,a,r,o,t="/profiles/argentinagobar/themes/contrib/poncho/resources/jsons/geoprovincias.json",i="/profiles/argentinagobar/themes/contrib/poncho/resources/jsons/geolocalidades.json",n=jQuery('input[name="submitted['+e.provincia+']"]'),l=jQuery('input[name="submitted['+e.localidad+']"]');function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d(e,t,s,a=!1,r=!1,o=!1){var i=jQuery("<select></select>").attr("id",t).attr("name",e).addClass("form-control form-select").prop("required",a);return r&&i.append("<option value=''>Seleccione una opción</option>"),jQuery.each(s,function(e,t){let s="";o==t.nombre&&(s='selected="selected"'),i.append("<option value='"+t.id+"' "+s+">"+t.nombre+"</option>")}),i}function h(e,t){var s=l.prop("required");return n.val()?d("sLocalidades","sLocalidades",e.filter(function(e){return String(e.provincia.id)==String(t)}).map(function(e){return e.departamento.nombre&&(e.nombre=c(e.departamento.nombre.toLowerCase())+" - "+c(e.nombre.toLowerCase())),e}).sort(function(e,t){e=e.nombre.toUpperCase(),t=t.nombre.toUpperCase();return e.localeCompare(t)}),s,emptyOption=!!l.val(),l.val()):d("sLocalidades","sLocalidades",[],s,!0,!1)}t=e.urlProvincias||t,i=e.urlLocalidades||i,jQuery.getJSON(t,function(e){var t;s=[],e.results.forEach(function(e,t){s.push(e)}),e=[],e=(t=s).sort(function(e,t){e=e.nombre.toUpperCase(),t=t.nombre.toUpperCase();return e.localeCompare(t)}),t=n.prop("required"),(r=d("sProvincias","sProvincias",e,t,!0,n.val())).on("change",function(e){var t;n.val(""),l.val(""),o.children("option:not(:first)").remove(),""!=r.val()&&(n.val(r.find(":selected").text()),t=h(a,r.val()).find("option"),o.append(t),o.val(""))}),n.after(r),jQuery(r).select2()}),jQuery.getJSON(i,function(e){a=[],e.results.forEach(function(e,t){a.push(e)}),(o=h(a,r.val())).on("change",function(e){l.val(""),""!=o.val()&&l.val(o.find(":selected").text())}),l.after(o),jQuery(o).select2()}),n.hide(),l.hide()};function ponchoChart(t){"use strict";var e;function _e(e){var t={Line:"line",Bar:"bar",Pie:"pie",Area:"line","Horizontal Bar":"horizontalBar","Stacked Bar":"bar",Mixed:"mixed",HeatMap:"heatmap",default:""};return t[e]||t.default}function ye(e){var e=e.toString().replace(".",","),t=e.split(","),s=new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(t[0]);return e=1<t.length?s.concat(",",t[1].substr(0,2)):s}function s(e,a){var F,t,s,H,r,o,B,D,z,i,n,N,G,l,c,R,U,$,d,h,Q,p,V,u,W,m,f=[],_=[],y=[],Z=[],g=[],b=[],v=[],C=[],x=0,k="",J=[],E=0,w=[],Y=[],X=0,S=a.posicionLeyendas||"top",j="",j=void 0===a.mostrarLeyendas||a.mostrarLeyendas,L="",L=void 0===a.mostrarTotalStacked||a.mostrarTotalStacked,T=_e(a.tipoGrafico),A=e.values;if(jQuery.each(Object.keys(A[0]),function(e,t){var s;"eje-y"==A[0][e].substr(0,5)?(s=(s=A[0][e].split("-"))[0]+s[1],_.push(s),y.push(e)):"nombre-corto"==A[0][e]&&"heatmap"==T&&(X=e)}),jQuery.each(A,function(r,e){var a;0==r&&jQuery.each(y,function(e,t){var s=A[r][y[e]].split("-"),a=s[0]+s[1];v[a]=[],Z.push(s[2]),"mixed"==T&&(3<s.length&&("barra"==s[3]||"linea"==s[3])?J.push(s[3]):(0==e&&J.push("barra"),1==e&&J.push("linea")))}),1==r&&jQuery.each(y,function(e,t){"pie"==T||"heatmap"==T?f.push(A[r][y[e]]):(b.push(A[r][y[e]]),x+=1)}),1<r&&(a=!1,jQuery.each(y,function(e,t){var s=A[0][y[e]].split("-"),s=s[0]+s[1];"pie"==T?v[s].push(A[r][y[e]]):"heatmap"==T?(0==a&&(b.push(A[r][0]),a=!0,x+=1),e!=X&&v[s].push(A[r][y[e]]),e+2==X&&(void 0===A[r][e+2]?Y.push("*"):Y.push(A[r][e+2]))):(0==a&&(f.push(A[r][0]),a=!0),v[s].push(A[r][y[e]]))}))}),"pie"==T?(F=[],jQuery.each(Object.keys(_),function(e,t){e=_[e];v.hasOwnProperty(e)&&F.push(v[e])}),C=F):1==x&&jQuery.each(Object.keys(_),function(e,t){e=_[e];v.hasOwnProperty(e)&&(C=v[e])}),"mixed"==T&&0<(t=a.porcentajesMixed||"").length&&(w=t.split(",")),k=1==a.porcentajes?"line"==T&&1<x?{enabled:!0,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"}},mode:"index",intersect:!1}:"pie"==T?{enabled:!0,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.labels[e.index]+": "+s+"%"}}}:"Stacked Bar"==a.tipoGrafico?1==L?{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"},footer:(e,t)=>{e=e.reduce((e,t)=>e+parseFloat(t.yLabel),0);return"Total: "+new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(e)+"%"}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"}}}:"line"==T&&1<x?{enabled:!0,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s}},mode:"index",intersect:!1}:"pie"==T?{enabled:!0,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.labels[e.index]+": "+s}}}:"Stacked Bar"==a.tipoGrafico&&1<x?1==L?{enabled:!0,mode:"index",intersect:!1,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s},footer:(e,t)=>{e=e.reduce((e,t)=>e+parseFloat(t.yLabel),0);return"Total: "+new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(e)}}}:{enabled:!0,mode:"index",intersect:!1,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s}}},"pie"==T&&(Z.forEach(function(e,t,s){g.push(ponchoColor(e))}),t=f,L=C,z=T,i=g,s=a.idComponenteGrafico,N=S,G=k,n=j,s=document.getElementById(s),new Chart(s,{type:z,data:{labels:t,datasets:[{data:L,borderColor:i,backgroundColor:i,borderWidth:2}]},options:{legend:{display:n,position:N},responsive:!0,tooltips:G}})),1==x&&(s=ponchoColor(Z[0]),"Line"==a.tipoGrafico&&(z=f,L=C,i=T,n=s,N=b[0],G=a.ejeYenCero,l=a.idComponenteGrafico,c=S,R=k,U=j,l=document.getElementById(l),new Chart(l,{type:i,data:{labels:z,datasets:[{data:L,borderColor:n,backgroundColor:n,borderWidth:2,lineTension:0,fill:!1,label:N}]},options:{legend:{display:U,position:c},tooltips:R,responsive:!0,scales:{yAxes:[{ticks:{beginAtZero:G}}]}}})),"bar"!=T&&"Area"!=a.tipoGrafico||(l=f,L=C,U=T,c=s,R=b[0],H=a.ejeYenCero,r=a.idComponenteGrafico,o=S,B=k,D=j,r=document.getElementById(r),new Chart(r,{type:U,data:{labels:l,datasets:[{data:L,borderColor:c,backgroundColor:c,borderWidth:2,lineTension:0,label:R}]},options:{legend:{display:D,position:o},tooltips:B,responsive:!0,scales:{yAxes:[{ticks:{beginAtZero:H}}]}}})),"horizontalBar"==T)&&(r=f,L=C,D=T,o=s,B=b[0],H=a.ejeYenCero,O=a.idComponenteGrafico,re=S,oe=k,ee=j,O=document.getElementById(O),new Chart(O,{type:D,data:{labels:r,datasets:[{data:L,borderColor:o,backgroundColor:o,borderWidth:2,lineTension:0,label:B}]},options:{legend:{display:ee,position:re},tooltips:oe,responsive:!0,scales:{xAxes:[{ticks:{beginAtZero:H}}]}}})),1<x)if("heatmap"==T)if(void 0!==a.heatMapColors&&""!=a.heatMapColors&&void 0!==a.heatMapColorsRange&&""!=a.heatMapColorsRange){for(var K=[],O="labelFila",L="labelColumna",ee="labelValor",te=(void 0!==a.datosTooltip&&0<a.datosTooltip.length&&(void 0!==a.datosTooltip[0]&&void 0!==a.datosTooltip[0].labelFila&&(O=a.datosTooltip[0].labelFila),void 0!==a.datosTooltip[1]&&void 0!==a.datosTooltip[1].labelColumna&&(L=a.datosTooltip[1].labelColumna),void 0!==a.datosTooltip[2])&&void 0!==a.datosTooltip[2].labelValor&&(ee=a.datosTooltip[2].labelValor),jQuery.each(Object.keys(_),function(e,t){e=_[e];v.hasOwnProperty(e)&&(C=v[e],K.push(C))}),[]),M=0;M<b.length;M++){for(var e=[],se=0;se<f.length;se++){C={x:f[se],y:parseInt(K[se][M])};e.push(C)}te.push({name:("*"!=Y[M]?Y:b)[M],data:e})}for(var ae=[],M=0;M<a.heatMapColorsRange.length-1;M++){e={from:a.heatMapColorsRange[M],to:a.heatMapColorsRange[M+1],color:ponchoColor(a.heatMapColors[M])};ae.push(e)}var re="",re=void 0===a.mostrarEjeY||a.mostrarEjeY,oe=te,ie=a.idComponenteGrafico,ne=b,le=ae,ce=O,de=L,he=ee,L=a.tituloGrafico,P=re,pe=S,ue=j,ie=document.getElementById(ie),me=(new ApexCharts(ie,{series:oe,chart:{height:650,type:"heatmap"},dataLabels:{enabled:!1},title:{text:L},tooltip:{custom:function({series:e,seriesIndex:t,dataPointIndex:s,w:a}){e=ye(e[t][s]);return'<div class="arrow_box"><span>'+ce+": "+ne[t]+"<br>"+de+": "+a.globals.labels[s]+"<br>"+he+": "+e+"</span></div>"}},plotOptions:{heatmap:{shadeIntensity:.5,radius:0,useFillColorAsStroke:!1,colorScale:{ranges:le}}},yaxis:{show:P},legend:{show:ue,position:pe},responsive:[{breakpoint:1e3,options:{yaxis:{show:!1},legend:{show:ue,position:"top"}}}]}).render(),document.getElementsByClassName("apexcharts-toolbar"));for(let e=0;e<me.length;e++)me[e].style.display="none"}else void 0!==a.heatMapColors&&a.heatMapColors,void 0!==a.heatMapColorsRange&&a.heatMapColorsRange;else{var I=[],q=0,fe=(Z.forEach(function(e,t,s){g.push(ponchoColor(e))}),0);jQuery.each(Object.keys(_),function(e,t){var s,e=_[e];v.hasOwnProperty(e)&&(C=v[e],"Line"==a.tipoGrafico?s={label:b[q],data:C,borderColor:g[q],fill:!1,borderWidth:2,lineTension:0,backgroundColor:g[q]}:"Bar"==a.tipoGrafico||"Area"==a.tipoGrafico||"Horizontal Bar"==a.tipoGrafico||"Stacked Bar"==a.tipoGrafico?s={label:b[q],data:C,borderColor:g[q],backgroundColor:g[q],borderWidth:2,lineTension:0}:"Mixed"==a.tipoGrafico&&("barra"==(e=J[fe])?s={label:b[q],data:C,backgroundColor:g[q],yAxisID:"left-y-axis",type:"bar"}:"linea"==e&&(s={label:b[q],data:C,borderColor:g[q],backgroundColor:g[q],type:"line",yAxisID:"right-y-axis",fill:!1})),I.push(s),q+=1,fe+=1)}),"mixed"==T&&(2==w.length?E=2:1==w.length?"eje-y1"==w[0]?E=0:"eje-y2"==w[0]&&(E=1):E=3),"Stacked Bar"==a.tipoGrafico?(ie=f,L=T,le=I,P=a.idComponenteGrafico,pe=a.ejeYenCero,ue=S,w=k,W=j,P=document.getElementById(P),new Chart(P,{type:L,data:{labels:ie,datasets:le},options:{legend:{display:W,position:ue,labels:{textAlign:"center"}},tooltips:w,responsive:!0,scales:{yAxes:[{ticks:{beginAtZero:pe},stacked:!0}],xAxes:[{stacked:!0}]}}})):"Mixed"==a.tipoGrafico?(L=f,W="bar",w=I,d=a.idComponenteGrafico,h=a.ejeYenCero,Q=S,p=E,E=b[0],V=b[1],u=j,d=document.getElementById(d),new Chart(d,{type:W,data:{labels:L,datasets:w},options:{legend:{display:u,position:Q,labels:{textAlign:"center"}},tooltips:{enabled:!0,mode:"single",callbacks:{label:function(e,t){var s="",a=((2==p||e.datasetIndex==p)&&(s="%"),ye(e.yLabel));return t.datasets[e.datasetIndex].label+": "+a+" "+s}}},responsive:!0,scales:{yAxes:[{id:"left-y-axis",type:"linear",position:"left",ticks:{beginAtZero:h,callback:function(e){return e+(1!=p&&2!=p?"":"%")}},scaleLabel:{display:!0,labelString:V,fontColor:"black"}},{id:"right-y-axis",type:"linear",position:"right",ticks:{beginAtZero:h,callback:function(e){return e+(0!=p&&2!=p?"":"%")}},scaleLabel:{display:!0,labelString:E,fontColor:"black"}}]}}})):"Horizontal Bar"==a.tipoGrafico?(d=f,L=T,w=I,u=a.idComponenteGrafico,Q=a.ejeYenCero,V=S,h=k,E=j,u=document.getElementById(u),new Chart(u,{type:L,data:{labels:d,datasets:w},options:{legend:{display:E,position:V,labels:{textAlign:"center"}},tooltips:h,responsive:!0,maintainAspectRatio:!0,scales:{xAxes:[{ticks:{beginAtZero:Q}}]}}})):(L=f,w=T,E=I,m=a.idComponenteGrafico,$=a.ejeYenCero,S=S,k=k,j=j,m=document.getElementById(m),new Chart(m,{type:w,data:{labels:L,datasets:E},options:{legend:{display:j,position:S,labels:{textAlign:"center"}},tooltips:k,responsive:!0,maintainAspectRatio:!0,scales:{yAxes:[{ticks:{beginAtZero:$}}]}}}))}""!=a.tituloGrafico&&void 0!==a.tituloGrafico&&(m=a.idTagTituloGrafico,w=a.tituloGrafico,document.getElementById(m))&&(document.getElementById(m).innerHTML=w)}!function(e){var t=!1;(e.idSpread&&e.hojaNombre||e.jsonUrl||e.jsonInput)&&void 0!==e.tipoGrafico&&""!=e.tipoGrafico&&void 0!==e.idComponenteGrafico&&""!=e.idComponenteGrafico&&""!=_e(e.tipoGrafico)&&(t=!0);return t}(t)?(void 0!==t.idSpread&&t.idSpread,void 0!==t.hojaNombre&&t.hojaNombre,void 0!==t.tipoGrafico&&t.tipoGrafico,void 0!==t.idComponenteGrafico&&t.idComponenteGrafico,_e(t.tipoGrafico)):t.jsonInput?s(jQuery.parseJSON(t.jsonInput),t):(e=t.jsonUrl||"https://sheets.googleapis.com/v4/spreadsheets/"+t.idSpread+"/values/"+t.hojaNombre+"?alt=json&key=AIzaSyCq2wEEKL9-6RmX-TkW23qJsrmnFHFf5tY",jQuery.getJSON(e,function(e){s(e,t)}))}const gapi_legacy=e=>{const o=e.values[0],i=/ |\/|_/gi;let n=[];return e.values.forEach((e,t)=>{if(0<t){var s={};for(const r in o){var a=e.hasOwnProperty(r)?e[r].trim():"";s["gsx$"+o[r].toLowerCase().replace(i,"")]={$t:a}}n.push(s)}}),{feed:{entry:n}}};class PonchoMap{constructor(e,t){var s={error_reporting:!0,no_info:!1,title:!1,id:"id",template:!1,template_structure:{container_classlist:["info-container"],definition_classlist:[],definition_list_classlist:["definition-list"],definition_list_tag:"dl",definition_tag:"dd",term_classlist:["h6","m-b-0"],term_tag:"dt",title_classlist:["h4","text-primary","m-t-0"]},allowed_tags:[],template_innerhtml:!1,template_markdown:!1,markdown_options:{extensions:["details","images","alerts","numbers","ejes","button","target","bootstrap-tables","video"],simpleLineBreaks:!0,tables:!0},render_slider:!0,scope:"",slider:!1,scroll:!1,hash:!1,headers:{},header_icons:[],content_selector:!1,map_selector:"map",anchor_delay:0,slider_selector:".slider",map_view:[-40.44,-63.59],map_anchor_zoom:16,map_zoom:4,min_zoom:2,reset_zoom:!0,latitud:"latitud",longitud:"longitud",marker:"azul",tooltip:!1,tooltip_options:{permanent:!1,className:"leaflet-tooltip-own",direction:"auto",offset:[13,-18],sticky:!1,opacity:.8},marker_cluster_options:{spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,zoomToBoundsOnClick:!0,maxClusterRadius:30,spiderfyDistanceMultiplier:.5,spiderLegPolylineOptions:{weight:1,color:"#666666",opacity:.5,"fill-opacity":.5}},accesible_menu_extras:[{text:"Ayudá a mejorar el mapa",anchor:"https://www.argentina.gob.ar/sugerencias"}]},a=Object.assign({},s,t);this.error_reporting=a.error_reporting,this.scope=a.scope,this.render_slider=a.render_slider,this.template=a.template,this.template_structure={...s.template_structure,...t.template_structure},this.template_innerhtml=a.template_innerhtml,this.template_markdown=a.template_markdown,this.markdown_options=a.markdown_options,this.allowed_tags=a.allowed_tags,this.map_selector=a.map_selector,this.headers=this.setHeaders(a.headers),this.header_icons=a.header_icons,this.hash=a.hash,this.scroll=a.scroll,this.map_view=a.map_view,this.anchor_delay=a.anchor_delay,this.map_zoom=a.map_zoom,this.min_zoom=a.min_zoom,this.map_anchor_zoom=a.map_anchor_zoom,this.tooltip_options=a.tooltip_options,this.tooltip=a.tooltip,this.marker_cluster_options=a.marker_cluster_options,this.marker_color=a.marker,this.id=a.id,this.title=a.title,this.latitude=a.latitud,this.longitude=a.longitud,this.slider=a.slider,this.no_info=a.no_info,this.reset_zoom=a.reset_zoom,this.slider_selector=this._selectorName(a.slider_selector),this.selected_marker,this.scope_selector=`[data-scope="${this.scope}"]`,this.scope_sufix="--"+this.scope,this.content_selector=a.content_selector||".js-content"+this.scope_sufix,this.data=this.formatInput(e),this.geometryTypes=["Point","LineString","Polygon","MultiPoint","MultiLineString"],this.featureStyle={stroke:"dodgerblue","stroke-opacity":1,"stroke-width":2,"fill-opacity":.5},this.accesible_menu_search=[],this.accesible_menu_filter=[],this.accesible_menu_extras=a.accesible_menu_extras,this.geojson,this.map=new L.map(this.map_selector,{renderer:L.svg()}).setView(this.map_view,this.map_zoom),this.titleLayer=new L.tileLayer("https://mapa-ign.argentina.gob.ar/osm/{z}/{x}/{-y}.png",{attribution:'Contribuidores: <a href="https://www.ign.gob.ar/AreaServicios/Argenmap/Introduccion" target="_blank">Instituto Geográfico Nacional</a>, <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>'}),this.markers=new L.markerClusterGroup(this.marker_cluster_options),this.ponchoLoaderTimeout}isGeoJSON=e=>"FeatureCollection"===e?.type;get entries(){return this.data.features}get geoJSON(){return this.featureCollection(this.entries)}formatInput=e=>{e.length<1&&this.errorMessage("No se puede visualizar el mapa, el documento está vacío","warning");let t;return t=this.isGeoJSON(e)?e:(e=this.features(e),this.featureCollection(e)),this._setIdIfNotExists(t)};errorMessage=(e=!1,t="danger")=>{document.querySelectorAll("#js-error-message"+this.scope_sufix).forEach(e=>e.remove());const s=document.createElement("div");s.id="js-error-message"+this.scope_sufix,s.classList.add("poncho-map--message",t);var a=document.createElement("i"),r=(a.classList.add("icono-arg-mapa-argentina","poncho-map--message__icon"),document.createElement("h2"));r.classList.add("h6","title","sr-only"),r.textContent="¡Se produjo un error!",s.appendChild(a),s.appendChild(r);throw[["En estos momentos tenemos inconvenientes para mostrar el mapa.","text-center"],["<em>Disculpe las molestias</em>","text-center","p"]].forEach(e=>{var t=document.createElement(void 0!==(t=e[2])||t?t:"p");void 0===e[1]&&!e[1]||(t.className=e[1]),t.innerHTML=e[0],s.appendChild(t)}),this.error_reporting&&((a=document.querySelector(this.scope_selector+".poncho-map")).parentNode.insertBefore(s,a),"danger"==t)&&document.getElementById(this.map_selector).remove(),e};feature=e=>{var t=e[this.latitude],s=e[this.longitude];return[t,s].forEach(e=>{isNaN(Number(e))&&this.errorMessage("El archivo contiene errores en la definición de latitud y longitud.\n "+e)}),delete e[this.latitude],delete e[this.longitude],{type:"Feature",properties:e,geometry:{type:"Point",coordinates:[s,t]}}};featureCollection=e=>({type:"FeatureCollection",features:e});features=e=>e.map(this.feature);_setIdIfNotExists=e=>{var t;return e.features.filter((e,t)=>0===t).every(e=>e.properties.hasOwnProperty("id"))||(t=e.features.map((e,t)=>{var t=t+1,s=this.title&&e.properties[this.title]?"-"+slugify(e.properties[this.title]):"";return e.properties.id=t+s,e}),e.features=t),e};addHash=e=>{if(!this.hash||this.no_info)return null;window.location.hash="#"+e};entry=t=>this.entries.find(e=>e.properties[this.id]==t);searchEntries=(t,e)=>{return e=void 0===e?this.geoJSON:e,t?e.filter(e=>{if(this.searchEntry(t,e.properties))return e}):e};searchEntry=(e,t)=>{for(const r of[...new Set([this.title,...this.search_fields])].filter(e=>e))if(t.hasOwnProperty(r)){var s=replaceSpecialChars(e).toUpperCase(),a=replaceSpecialChars(t[r]).toString().toUpperCase();try{if(a.includes(s))return t}catch(e){}}return null};_selectorName=e=>e.replace(/^(\.|\#)/,"");scrollCenter=()=>{var e=document.getElementById(this.map_selector),t=e.getBoundingClientRect(),e=(e.offsetLeft+e.offsetWidth)/2,t=t.top+window.scrollY;window.scrollTo({top:t,left:e,behavior:"smooth"})};_clearContent=()=>document.querySelector(".js-content"+this.scope_sufix).innerHTML="";toggleSlider=()=>{this.no_info||(document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.classList.toggle(this.slider_selector+"--in")}),document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.style.display=this.isSliderOpen()?"block":"none"}))};_focusOnFeature=t=>{this.map.eachLayer(e=>{e?.options?.id==t&&(e?._path?e._path.focus():e?._icon&&e._icon.focus())})};_clickToggleSlider=()=>document.querySelectorAll(".js-close-slider"+this.scope_sufix).forEach(e=>e.addEventListener("click",()=>{this._clearContent(),this.toggleSlider(),this._focusOnFeature(e.dataset.entryId)}));isSliderOpen=()=>{let t=[];return document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.classList.contains(this.slider_selector+"--in")&&t.push(!0)}),t.some(e=>e)};setContent=t=>{if(!this.no_info){this._focusOnSlider(),this.isSliderOpen()||this.toggleSlider();const s="function"==typeof this.template?this.template(this,t):this.defaultTemplate(this,t);document.querySelectorAll(this.content_selector).forEach(e=>{e.innerHTML=s}),document.querySelectorAll(".js-close-slider"+this.scope_sufix).forEach(e=>{e.dataset.entryId=t[this.id]})}};_focusOnSlider=()=>{var e;this.no_info||(this.isSliderOpen()?document.querySelector(".js-close-slider"+this.scope_sufix).focus():(e=document.querySelector(".js-slider"+this.scope_sufix))&&e.addEventListener("animationend",()=>{document.querySelector(".js-close-slider"+this.scope_sufix).focus()}))};setHeaders=e=>{var t;return[this.template_structure,this.template_structure.mixing].every(e=>e)?(t=this.template_structure.mixing.reduce((e,t)=>{if([t.key].every(e=>e))return{...e,[t.key]:t.header||""}},{}),{...e,...t}):e};header=e=>this.headers.hasOwnProperty(e)?this.headers[e]:e;_renderSlider=()=>{var e,t,s,a;this.render_slider&&!this.no_info&&(document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>e.remove()),(e=document.createElement("button")).classList.add("btn","btn-xs","btn-secondary","btn-close","js-close-slider"+this.scope_sufix),e.title="Cerrar panel",e.setAttribute("role","button"),e.setAttribute("aria-label","Cerrar panel de información"),e.innerHTML='<span class="sr-only">Cerrar</span>✕',(t=document.createElement("a")).setAttribute("tabindex",0),t.id="js-anchor-slider"+this.scope_sufix,(s=document.createElement("div")).classList.add("content-container"),(a=document.createElement("div")).classList.add("content","js-content"+this.scope_sufix),a.tabIndex=0,s.appendChild(a),(a=document.createElement("div")).style.display="none",a.setAttribute("role","region"),a.setAttribute("aria-live","polite"),a.setAttribute("aria-label","Panel de información"),a.classList.add("slider","js-slider"+this.scope_sufix),a.id="slider"+this.scope_sufix,a.appendChild(e),a.appendChild(t),a.appendChild(s),document.querySelector(this.scope_selector+".poncho-map").appendChild(a))};_showSlider=(e,t)=>{e.hasOwnProperty("_latlng")?this.map.setView(e._latlng,this.map_anchor_zoom):this.map.fitBounds(e.getBounds()),e.fireEvent("click")};_showPopup=e=>{e.hasOwnProperty("_latlng")?this.markers.zoomToShowLayer(e,()=>{e.openPopup()}):(this.map.fitBounds(e.getBounds()),e.openPopup())};removeHash=()=>history.replaceState(null,null," ");hasHash=()=>{return window.location.hash.replace("#","")||!1};gotoHashedEntry=()=>{var e=this.hasHash();e&&this.gotoEntry(e)};gotoEntry=t=>{const s=this.entry(t),a=(e,t,s)=>{e.options.hasOwnProperty("id")&&e.options.id==t&&(this._setSelectedMarker(t,e),this.hash&&this.addHash(t),this.slider&&this.hash?this._showSlider(e,s):this._showPopup(e))};this.markers.eachLayer(e=>a(e,t,s)),this.map.eachLayer(e=>{e.hasOwnProperty("feature")&&"Point"!=e.feature.geometry.type&&a(e,t,s)})};_setClickeable=s=>{s.on("keypress click",t=>{document.querySelectorAll(".marker--active").forEach(e=>e.classList.remove("marker--active")),["_icon","_path"].forEach(e=>{t.sourceTarget.hasOwnProperty(e)&&t.sourceTarget[e].classList.add("marker--active")});var e=this.entries.find(e=>e.properties[this.id]==s.options.id);this.setContent(e.properties)})};isFeature=e=>!!e.hasOwnProperty("feature");_clickeableFeatures=()=>{this.reset_zoom&&this.map.eachLayer(e=>{this.isFeature(e)&&"Point"!=e.feature.geometry.type&&"MultiPoint"!=e.feature.geometry.type&&this._setClickeable(e)})};_clickeableMarkers=()=>{this.no_info||this.markers.eachLayer(this._setClickeable)};_urlHash=()=>{const t=e=>{e.on("click",()=>{this.addHash(e.options.id)})};this.markers.eachLayer(t),this.map.eachLayer(e=>{e.hasOwnProperty("feature")&&"Point"!=e.feature.geometry.type&&"MultiPoint"!=e.feature.geometry.type&&t(e)})};removeListElement=(e,t)=>{t=e.indexOf(t);return-1<t&&e.splice(t,1),e};_templateTitle=e=>{if(!e.hasOwnProperty(this.title))return!1;var t=this.template_structure,s=!!t.hasOwnProperty("title")&&t.title,a=this.title||!1;if(t.hasOwnProperty("title")&&"boolean"==typeof t.title)return!1;if(!s&&!a)return!1;s=s||a;let r;t?.header?((a=document.createElement("div")).innerHTML=this._mdToHtml(t.header(this,e)),this.template_innerhtml&&(a.innerHTML=t.header(this,e)),r=a):((r=document.createElement("h2")).classList.add(...t.title_classlist),r.textContent=e[s]);a=document.createElement("header");return a.className="header",a.appendChild(r),a};_templateList=e=>{var t=this.template_structure,s=Object.keys(e);let a=s;if(t.hasOwnProperty("values")&&0<t?.values?.length)a=t.values;else if(t.hasOwnProperty("exclude")&&0<t.exclude.length)for(const r of t.exclude)a=this.removeListElement(s,r);return a};_mdToHtml=e=>{var t,s;return this.template_markdown&&this._markdownEnable()?(t=new showdown.Converter(this.markdown_options),s=secureHTML(e,this.allowed_tags),t.makeHtml((""+s).trim())):e};_markdownEnable=()=>!("undefined"==typeof showdown||!showdown.hasOwnProperty("Converter"));_templateMixing=r=>{if(this.template_structure.hasOwnProperty("mixing")&&0<this.template_structure.mixing.length){var e=this.template_structure.mixing;let a={};return e.forEach(e=>{var{values:e,separator:t=", ",key:s}=e;void 0===s&&this.errorMessage("Mixing requiere un valor en el atributo «key».","warning"),a[s]=e.map(e=>e in r?r[e]:e.toString()).filter(e=>e).join(t)}),Object.assign({},r,a)}return r};_setType=(e,t=!1,s=!1)=>"function"==typeof e?e(this,t,s):e;_lead=e=>{var t,s,a,r;if(this.template_structure.hasOwnProperty("lead"))return this.template_structure.lead.hasOwnProperty("key")||this.errorMessage("Lead requiere un valor en el atributo «key».","warning"),{key:a=!1,css:t="small",style:r=!1}=this.template_structure.lead,(s=document.createElement("p")).textContent=e[a],(a=this._setType(r,e))&&s.setAttribute("style",a),(r=this._setType(t,e))&&s.classList.add(...r.split(" ")),s};_termIcon=(e,t)=>{var s=this.header_icons.find(e=>e.key==t);if(s){var{css:s=!1,style:a=!1,html:r=!1}=s,r=this._setType(r,e,t),a=this._setType(a,e,t),s=this._setType(s,e,t);if(s)return(e=document.createElement("i")).setAttribute("aria-hidden","true"),e.classList.add(...s.split(" ")),a&&e.setAttribute("style",a),e;if(r)return(s=document.createElement("template")).innerHTML=r,s.content}return!1};defaultTemplate=(e,t)=>{t=this._templateMixing(t);var s,a,r=this["template_structure"],o=this._templateList(t),i=this._templateTitle(t),n=document.createElement("article"),l=(n.classList.add(...r.container_classlist),document.createElement(r.definition_list_tag));l.classList.add(...r.definition_list_classlist),l.style.fontSize="1rem";for(const c of o)t.hasOwnProperty(c)&&t[c]&&((s=document.createElement(r.term_tag)).classList.add(...r.term_classlist),(a=this._termIcon(t,c))&&(s.appendChild(a),s.insertAdjacentText("beforeend"," ")),s.insertAdjacentText("beforeend",this.header(c)),(a=document.createElement(r.definition_tag)).classList.add(...r.definition_classlist),a.textContent=t[c],this.template_markdown?a.innerHTML=this._mdToHtml(t[c]):this.template_innerhtml&&(a.innerHTML=secureHTML(t[c],this.allowed_tags)),""!=this.header(c)&&l.appendChild(s),l.appendChild(a));o=this._lead(t);return o&&n.appendChild(o),i&&n.appendChild(i),n.appendChild(l),n.outerHTML};icon=(e="azul")=>new L.icon({iconUrl:"https://www.argentina.gob.ar/sites/default/files/"+`marcador-${e}.svg`,iconSize:[29,40],iconAnchor:[14,40],popupAnchor:[0,-37]});resetView=()=>this.map.setView(this.map_view,this.map_zoom);fitBounds=()=>{try{this.map.fitBounds(this.geojson.getBounds())}catch(e){}};_resetViewButton=()=>{this.reset_zoom&&(document.querySelectorAll(".js-reset-view"+this.scope_sufix).forEach(e=>e.remove()),document.querySelectorAll(this.scope_selector+" .leaflet-control-zoom-in").forEach(e=>{var t=document.createElement("i"),s=(t.classList.add("fa","fa-expand"),t.setAttribute("aria-hidden","true"),document.createElement("a"));s.classList.add("js-reset-view"+this.scope_sufix,"leaflet-control-zoom-reset"),s.href="#",s.title="Zoom para ver todo el mapa",s.setAttribute("role","button"),s.setAttribute("aria-label","Zoom para ver todo el mapa"),s.appendChild(t),s.onclick=e=>{e.preventDefault(),this.cleanState(),this.resetView()},e.after(s)}))};marker=e=>{var t;return this.marker_color&&"boolean"!=typeof this.marker_color?"string"==typeof this.marker_color?this.icon(this.marker_color):"string"==typeof this.marker_color(this,e)?(t=this.marker_color(this,e),this.icon(t)):"function"==typeof this.marker_color?this.marker_color(this,e):void 0:null};_clearLayers=()=>{this.markers.clearLayers(),this.map.eachLayer(e=>{this.isFeature(e)&&this.map.removeLayer(e)})};markersMap=e=>{var r=this;this._clearLayers(),this.geojson=new L.geoJson(e,{pointToLayer:function(e,t){var e=e["properties"],s=r.marker(e),a={},s=(a.id=e[r.id],s&&(a.icon=s),r.title&&(a.alt=e[r.title]),new L.marker(t,a));return r.map.options.minZoom=r.min_zoom,r.markers.addLayer(s),r.tooltip&&e[r.title]&&s.bindTooltip(e[r.title],r.tooltip_options),r.no_info||r.slider||(t="function"==typeof r.template?r.template(r,e):r.defaultTemplate(r,e),s.bindPopup(t)),r.markers},onEachFeature:function(e,t){var{properties:s,geometry:a}=e;t.options.id=s[r.id],e.properties.name=s[r.title],r.tooltip&&s[r.title]&&"Point"!=a.type&&"MultiPoint"!=a.type&&t.bindTooltip(s[r.title],r.tooltip_options),r.no_info||r.slider||"Point"==a.type||"MultiPoint"==a.type||(e="function"==typeof r.template?r.template(r,s):r.defaultTemplate(r,s),t.bindPopup(e))},style:function(e){const s=e["properties"];e=(e,t=!1)=>s.hasOwnProperty(e)?s[e]:t||r.featureStyle[e];return{color:e("stroke-color",e("stroke")),strokeOpacity:e("stroke-opacity"),weight:e("stroke-width"),fillColor:e("stroke"),opacity:e("stroke-opacity"),fillOpacity:e("fill-opacity")}}}),this.geojson.addTo(this.map)};_setSelectedMarker=(e,t)=>{e={entry:this.entry(e),marker:t};return this.selected_marker=e};_selectedMarker=()=>{this.map.eachLayer(t=>{this.isFeature(t)&&t.on("click",e=>{this._setSelectedMarker(t.options.id,t)})})};_hiddenSearchInput=()=>{const t=document.createElement("input");t.type="hidden",t.name="js-search-input"+this.scope_sufix,t.setAttribute("disabled","disabled"),t.id="js-search-input"+this.scope_sufix,document.querySelectorAll(this.scope_selector+".poncho-map").forEach(e=>e.appendChild(t))};_setFetureAttributes=()=>{const t=(e,t)=>{e.hasOwnProperty(t)&&(e[t].setAttribute("aria-label",e?.feature?.properties?.[this.title]),e[t].setAttribute("role","button"),e[t].setAttribute("tabindex",0),e[t].dataset.entryId=e?.feature?.properties?.[this.id],e[t].dataset.leafletId=e._leaflet_id)};this.map.eachLayer(e=>t(e,"_path"))};_accesibleAnchors=()=>{var e=[[this.scope_selector+" .leaflet-map-pane","leaflet-map-pane"+this.scope_sufix,[["role","region"]]],[this.scope_selector+" .leaflet-control-zoom","leaflet-control-zoom"+this.scope_sufix,[["aria-label","Herramientas de zoom"],["role","region"]]]];return e.forEach(e=>{const t=document.querySelector(e[0]);t.id=e[1],e[2].forEach(e=>t.setAttribute(e[0],e[1]))}),e};_accesibleMenu=()=>{document.querySelectorAll(this.scope_selector+" .accesible-nav").forEach(e=>e.remove());var e=this._accesibleAnchors(),e=[...e=[{text:"Ir a los marcadores del mapa",anchor:"#"+e[0][1]},{text:"Ajustar marcadores al mapa",anchor:"#",class:"js-fit-bounds"},{text:"Ir al panel de zoom",anchor:"#"+e[1][1]}],...this.accesible_menu_filter,...this.accesible_menu_search,...this.accesible_menu_extras],t=document.createElement("i");t.classList.add("icono-arg-sitios-accesibles","accesible-nav__icon"),t.setAttribute("aria-hidden","true");const s=document.createElement("div"),a=(s.classList.add("accesible-nav","top"),s.id="accesible-nav"+this.scope_sufix,s.setAttribute("aria-label","Menú para el mapa"),s.setAttribute("role","navigation"),s.tabIndex=0,document.createElement("ul"));e.forEach((e,t)=>{var s=document.createElement("a"),e=(s.textContent=e.text,s.tabIndex=0,s.href=e.anchor,e.hasOwnProperty("class")&&""!=e.class&&s.classList.add(...e.class.split(" ")),document.createElement("li"));e.appendChild(s),a.appendChild(e)}),s.appendChild(t),s.appendChild(a);e=document.createElement("a");e.textContent="Ir a la navegación del mapa",e.href="#accesible-nav"+this.scope_sufix,e.id="accesible-return-nav"+this.scope_sufix;const r=document.createElement("div");r.classList.add("accesible-nav","bottom"),r.appendChild(t.cloneNode(!0)),r.appendChild(e),document.querySelectorAll(""+this.scope_selector).forEach(e=>{e.insertBefore(s,e.children[0]),e.appendChild(r)}),this.fit()};fit=()=>document.querySelectorAll(this.scope_selector+" .js-fit-bounds").forEach(e=>{e.onclick=e=>{e.preventDefault(),this.fitBounds()}});clearAll=()=>{[".js-filter-container"+this.scope_sufix,".js-slider"+this.scope_sufix].forEach(e=>document.querySelectorAll(e).forEach(e=>e.remove()))};cleanState=()=>history.replaceState(null,null," ");render=()=>{this._hiddenSearchInput(),this._resetViewButton(),this.titleLayer.addTo(this.map),this.markersMap(this.entries),this._selectedMarker(),this.slider&&(this._renderSlider(),this._clickeableFeatures(),this._clickeableMarkers(),this._clickToggleSlider()),this.hash&&this._urlHash(),this.scroll&&this.hasHash()&&this.scrollCenter(),setTimeout(this.gotoHashedEntry,this.anchor_delay),this._setFetureAttributes(),this._accesibleMenu()}}class PonchoMapLoader{constructor(e){e=Object.assign({},{scope:"",timeout:5e4},e);this.scope=e.scope,this.timeout=e.timeout,this.scope_sufix="--"+this.scope,this.scope_selector=`[data-scope="${this.scope}"]`,this.ponchoLoaderTimeout}close=()=>document.querySelectorAll(".js-poncho-map__loader"+this.scope_sufix).forEach(e=>e.remove());load=()=>{this.close(),clearTimeout(this.ponchoLoaderTimeout);var e=document.querySelector(".poncho-map"+this.scope_selector),t=document.createElement("span"),s=(t.className="loader",document.createElement("div"));s.dataset.scope=this.selector,s.classList.add("poncho-map__loader","js-poncho-map__loader"+this.scope_sufix),s.appendChild(t),e.appendChild(s),this.ponchoLoaderTimeout=setTimeout(this.remove,this.timeout)};loader=(e,t=500)=>{this.load(),setTimeout(()=>{e(),this.remove()},t)}}class PonchoMapFilter extends PonchoMap{constructor(e,t){super(e,t);e=Object.assign({},{filters:[],filters_visible:!1,filters_info:!1,search_fields:[],messages:{reset:' <a href="#" class="{{reset_search}}" title="Restablece el mapa a su estado inicial">Restablecer mapa</a>',initial:"Hay {{total_results}} puntos en el mapa.",no_results_by_term:"No encontramos resultados para tu búsqueda.",no_results:"No s + this.messages.resete encontraron entradas.",results:"{{total_results}} resultados coinciden con tu búsqueda.",one_result:"{{total_results}} resultado coincide con tu búsqueda.",has_filters:'<i title="¡Advertencia!" aria-hidden="true" class="fa fa-warning text-danger"></i> Se están usando filtros.'}},t);this.filters=e.filters,this.filters_info=e.filters_info,this.filters_visible=e.filters_visible,this.valid_fields=["checkbox","radio"],this.search_fields=e.search_fields,this.messages=e.messages,this.accesible_menu_filter=[{text:"Ir al panel de filtros",anchor:"#filtrar-busqueda"+this.scope_sufix}]}tplParser=(e,a)=>Object.keys(a).reduce(function(e,t){var s=new RegExp("\\{\\{\\s{0,2}"+t+"\\s{0,2}\\}\\}","gm");return e=e.replace(s,a[t])},e);_helpText=e=>{var t=document.querySelectorAll(this.scope_selector+" .js-poncho-map__help");const a={total_results:e.length,total_entries:this.entries.length,total_filtered_entries:this.filtered_entries.length,filter_class:"js-close-filter"+this.scope_sufix,anchor:"#",term:this.inputSearchValue,reset_search:"js-poncho-map-reset"+this.scope_sufix};t.forEach(e=>{e.innerHTML="";var t=document.createElement("ul"),s=(t.classList.add("m-b-0","list-unstyled"),t.setAttribute("aria-live","polite"),e=>{var t=document.createElement("li");return t.innerHTML=e,t});a.total_entries===a.total_results?t.appendChild(s(this.tplParser(this.messages.initial,a))):a.total_results<1?t.appendChild(s(this.tplParser(this.messages.no_results_by_term+this.messages.reset,a))):""===this.inputSearchValue&&a.total_results<1?t.appendChild(s(this.tplParser(this.messages.no_results+this.messages.reset,a))):1==a.total_results?t.appendChild(s(this.tplParser(this.messages.one_result+this.messages.reset,a))):1<a.total_results&&t.appendChild(s(this.tplParser(this.messages.results+this.messages.reset,a))),this.usingFilters(),e.appendChild(t)})};_filterPosition=e=>{e=/^([\w\-]+?)(?:__([0-9]+))(?:__([0-9]+))?$/gm.exec(e);return e?[e[1],e[2]]:null};isFilterOpen=()=>document.querySelector(".js-poncho-map-filters"+this.scope_sufix).classList.contains("filter--in");toggleFilter=()=>{document.querySelector(".js-poncho-map-filters"+this.scope_sufix).classList.toggle("filter--in")};_filterContainerHeight=()=>{var e=document.querySelector(".js-filter-container"+this.scope_sufix),t=document.querySelector(".js-close-filter"+this.scope_sufix),s=e.offsetParent.offsetHeight,a=2*this._cssVarComputedDistance(),s=s-e.offsetTop-t.offsetHeight-a,e=document.querySelector(".js-poncho-map-filters"+this.scope_sufix),t=(e.style.maxHeight=s+"px",e.offsetHeight-45),a=document.querySelector(".js-filters"+this.scope_sufix);a.style.height=t+"px",a.style.overflow="auto"};_clickToggleFilter=()=>document.querySelectorAll(".js-close-filter"+this.scope_sufix).forEach(e=>e.onclick=e=>{e.preventDefault(),this.toggleFilter(),this._filterContainerHeight()});_setFilter=e=>{const[t,s="checked"]=e;e=this.entries.map(e=>{if(e.properties.hasOwnProperty(t))return e.properties[t]}).filter(e=>e),e=[...new Set(e)].map(e=>[t,e,[e],s]);return e.sort((e,t)=>{e=e[1].toUpperCase(),t=t[1].toUpperCase();return t<e?1:e<t?-1:0}),e};_fieldsToUse=e=>{var{fields:e=!1,field:t=!1}=e,e=(e||t||this.errorMessage("Filters requiere el uso del atributo `field` o `fields`.","warning"),e||this._setFilter(t));return e};_fields=(e,t)=>{var s=document.createElement("div"),a=(s.classList.add("field-list","p-b-1"),this._fieldsToUse(e));for(const c in a){var r=a[c],o=document.createElement("input"),i=(o.type=this.valid_fields.includes(e.type)?e.type:"checkbox",o.id=`id__${r[0]}__${t}__`+c,"radio"==e.type?o.name=r[0]+"__"+t:o.name=r[0]+`__${t}__`+c,o.className="form-check-input",o.value=c,void 0!==r[3]&&"checked"==r[3]&&o.setAttribute("checked","checked"),document.createElement("label")),n=(i.style.marginLeft=".33rem",i.textContent=r[1],i.className="form-check-label",i.setAttribute("for",`id__${r[0]}__${t}__`+c),document.createElement("span")),r=(n.dataset.info=r[0]+`__${t}__`+c,i.appendChild(n),document.createElement("div"));r.className="form-check",r.appendChild(o),r.appendChild(i),s.appendChild(r)}var l=document.createElement("div");return l.appendChild(s),l};_filterButton=()=>{var e=document.createElement("i"),t=(e.setAttribute("aria-hidden","true"),e.classList.add("fa","fa-filter"),document.createElement("span")),s=(t.textContent="Abre o cierra el filtro de búsqueda",t.classList.add("sr-only"),document.createElement("button")),e=(s.classList.add("btn","btn-secondary","btn-filter","js-close-filter"+this.scope_sufix),s.id="filtrar-busqueda"+this.scope_sufix,s.appendChild(e),s.appendChild(t),s.setAttribute("role","button"),s.setAttribute("aria-label","Abre o cierra el filtro de búsqueda"),s.setAttribute("aria-controls","poncho-map-filters"+this.scope_sufix),document.createElement("div"));e.classList.add("js-filter-container"+this.scope_sufix,"filter-container"),e.appendChild(s),document.querySelector(".poncho-map"+this.scope_selector).appendChild(e)};_cssVarComputedDistance=()=>{var e=document.querySelector(".poncho-map"),e=getComputedStyle(e).getPropertyValue("--slider-distance");return parseInt(e.toString().replace(/[^0-9]*/gm,""))||0};_controlZoomSize=()=>{var e=document.querySelector(this.scope_selector+" .leaflet-control-zoom");return{controlHeight:e.offsetHeight,controlTop:e.offsetTop}};_filterContainer=()=>{var e=document.createElement("div"),t=(e.className="js-filters"+this.scope_sufix,document.createElement("button")),s=(t.classList.add("btn","btn-xs","btn-secondary","btn-close","js-close-filter"+this.scope_sufix),t.title="Cerrar panel",t.setAttribute("role","button"),t.setAttribute("aria-label","Cerrar panel de filtros"),t.innerHTML='<span class="sr-only">Cerrar </span>✕',document.createElement("form"));s.classList.add("js-formulario"+this.scope_sufix),s.appendChild(t),s.appendChild(e);const a=document.createElement("div");a.classList.add("js-poncho-map-filters"+this.scope_sufix,"poncho-map-filters"),a.setAttribute("role","region"),a.setAttribute("aria-live","polite"),a.setAttribute("aria-label","Panel de filtros"),a.id="poncho-map-filters"+this.scope_sufix,this.filters_visible&&a.classList.add("filter--in");t=this._cssVarComputedDistance(),e=this._controlZoomSize();const r=e.controlHeight+e.controlTop+t+"px";a.appendChild(s),document.querySelectorAll(".js-filter-container"+this.scope_sufix).forEach(e=>{e.style.top=r,e.appendChild(a)})};_checkUncheckButtons=e=>{var t=document.createElement("button"),s=(t.classList.add("js-select-items","select-items__button"),t.textContent="Marcar todos",t.dataset.field=e.field[0],t.dataset.value=1,document.createElement("button")),e=(s.classList.add("js-select-items","select-items__button"),s.textContent="Desmarcar todos",s.dataset.field=e.field[0],s.dataset.value=0,document.createElement("div"));return e.classList.add("select-items"),e.appendChild(t),e.appendChild(s),e};_createFilters=e=>{const r=document.querySelector(".js-filters"+this.scope_sufix);e.forEach((e,t)=>{var s=document.createElement("legend"),a=(s.textContent=e.legend,s.classList.add("m-b-1","text-primary","h6"),document.createElement("fieldset"));a.appendChild(s),e.hasOwnProperty("check_uncheck_all")&&e.check_uncheck_all&&a.appendChild(this._checkUncheckButtons(e)),a.appendChild(this._fields(e,t)),r.appendChild(a)})};formFilters=()=>{var e;return this.filters.length<1?[]:(e=document.querySelector(".js-formulario"+this.scope_sufix),e=new FormData(e),Array.from(e).map(e=>{var t=this._filterPosition(e[0]);return[parseInt(t[1]),parseInt(e[1]),t[0]]}))};defaultFiltersConfiguration=()=>{return this.filters.map((e,s)=>{return this._fieldsToUse(e).map((e,t)=>[s,t,e[0],"undefinded"!=typeof e[3]&&"checked"==e[3]])}).flat()};usingFilters=()=>{return this.defaultFiltersConfiguration().every(e=>document.querySelector(`#id__${e[2]}__${e[0]}__`+e[1]).checked)};_resetFormFilters=()=>{this.defaultFiltersConfiguration().forEach(e=>{document.querySelector(`#id__${e[2]}__${e[0]}__`+e[1]).checked=e[3]})};get inputSearchValue(){var e=document.querySelector("#js-search-input"+this.scope_sufix).value.trim();return""!==e&&e}_countOccurrences=(e,s,a)=>{return e.reduce((e,t)=>s.some(e=>t.properties[a].includes(e))?e+1:e,0)};totals=()=>{return this.formFilters().map(e=>{var t=this._fieldsToUse(this.filters[e[0]])[e[1]];return[t[1],this._countOccurrences(this.filtered_entries,t[2],t[0]),...e]})};_totalsInfo=()=>{if(!this.filters_info)return"";this.totals().forEach(e=>{var t=document.querySelector(""+this.scope_selector+` [data-info="${e[4]}__${e[2]}__${e[3]}"]`),s=e[1]<2?"":"s",a=document.createElement("i"),r=(a.style.cursor="help",a.style.opacity=".75",a.style.marginLeft=".5em",a.style.marginRight=".25em",a.classList.add("fa","fa-info-circle","small","text-info"),a.title=e[1]+" resultado"+s,a.setAttribute("aria-hidden","true"),document.createElement("span")),e=(r.className="sr-only",r.style.fontWeight="400",r.textContent=e[1]+` elemento${s}.`,document.createElement("small"));e.appendChild(a),e.appendChild(r),t.appendChild(e)})};_validateEntry=(t,s)=>{var a=this.filters.length,r=[];for(let e=0;e<a;e++)r.push(this._validateGroup(t,(t=>s.filter(e=>e[0]==t))(e)));return r.every(e=>e)};_search=(t,e,s)=>{const a=this._fieldsToUse(this.filters[e])[s];return a[2].filter(e=>e).some(e=>{if(t.hasOwnProperty(a[0]))return t[a[0]].includes(e)})};_validateGroup=(t,e)=>{return e.map(e=>this._search(t,e[0],e[1])).some(e=>e)};_filterData=()=>{var e=this.formFilters(),t=this.entries.filter(e=>this._validateEntry(e.properties,this.formFilters())),t=this.searchEntries(this.inputSearchValue,t);return t=this.filters.length<1||0<e.length?t:[],this.filtered_entries=t};_filteredData=e=>{e=void 0!==e?this.entries:this._filterData(),this.markersMap(e),this._selectedMarker(),this._helpText(e),this._resetSearch(),this._clickToggleFilter(),this.slider&&(this._renderSlider(),this._clickeableMarkers(),this._clickeableFeatures(),this._clickToggleSlider()),this.hash&&this._urlHash(),this._setFetureAttributes(),this._accesibleMenu()};_clearSearchInput=()=>document.querySelectorAll("#js-search-input"+this.scope_sufix).forEach(e=>e.value="");_resetSearch=()=>{document.querySelectorAll(".js-poncho-map-reset"+this.scope_sufix).forEach(e=>{e.onclick=e=>{e.preventDefault(),this._resetFormFilters(),this._filteredData(this.entries),this._clearSearchInput(),this.resetView()}})};filterChange=t=>document.querySelectorAll(".js-filters"+this.scope_sufix).forEach(e=>{e.onchange=t});checkUncheckFilters=()=>{document.querySelectorAll(this.scope_selector+" .js-select-items").forEach(t=>{t.onclick=e=>{e.preventDefault(),document.querySelectorAll(`${this.scope_selector} [id^=id__${t.dataset.field}]`).forEach(e=>{e.checked=parseInt(t.dataset.value)}),this._filteredData()}})};render=()=>{this._hiddenSearchInput(),this._resetViewButton(),0<this.filters.length&&(this._filterButton(),this._filterContainer(),this._createFilters(this.filters)),this.titleLayer.addTo(this.map),this._filteredData(),this._totalsInfo(),this.scroll&&this.hasHash()&&this.scrollCenter(),this.checkUncheckFilters(),this.filterChange(e=>{e.preventDefault(),this._filteredData()}),setTimeout(this.gotoHashedEntry,this.anchor_delay),this.filters_visible&&this._filterContainerHeight()}}class PonchoMapSearch{constructor(e,t){var s={scope:!1,placeholder:"Su búsqueda",search_fields:e.search_fields,sort:!0,sort_reverse:!1,sort_key:"text",datalist:!0},s=(this.instance=e,Object.assign({},s,t));this.text=e.title||!1,this.datalist=s.datalist,this.placeholder=s.placeholder,this.scope=s.scope,this.scope_sufix="--"+this.scope,this.sort=s.sort,this.sort_reverse=s.sort_reverse,this.search_scope_selector=this.scope?`[data-scope="${this.scope}"]`:"",this.instance.search_fields=s.search_fields,this.instance.accesible_menu_search=[{text:"Hacer una búsqueda",anchor:"#id-poncho-map-search"+this.scope_sufix}]}sortData=(e,a)=>{e=e.sort((e,t)=>{var s=e=>{this.instance.removeAccents(e).toUpperCase()};return s(e[a]),s(t[a]),s(e[a]),s(t[a]),0});return this.sort_reverse?e.reverse():e};_triggerSearch=()=>{const t=document.querySelector(this.search_scope_selector+" .js-poncho-map-search__input");t.id="id-poncho-map-search"+this.scope_sufix,document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__submit").forEach(e=>{e.onclick=e=>{e.preventDefault();document.querySelector("#js-search-input"+this.instance.scope_sufix).value=t.value;e=t.value;this._renderSearch(e)}})};_keyup=()=>{document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__input").forEach(e=>{const t=document.querySelector("#js-search-input"+this.instance.scope_sufix);e.onkeyup=()=>{t.value=e.value},e.onkeydown=()=>{t.value=e.value}})};_placeHolder=()=>{if(!this.placeholder)return"";document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__input").forEach(e=>e.placeholder=this.placeholder.toString())};_renderSearch=e=>{var t=this.instance._filterData();this.instance.markersMap(t),this.instance.slider&&(this.instance._renderSlider(),this.instance._clickeableFeatures(),this.instance._clickeableMarkers(),this.instance._clickToggleSlider()),this.instance.hash&&this.instance._urlHash(),this.instance.resetView(),1==t.length?this.instance.gotoEntry(t[0].properties[this.instance.id]):""!=e.trim()&&(this.instance.removeHash(),setTimeout(this.instance.fitBounds,this.instance.anchor_delay)),this.instance._helpText(t),this.instance._resetSearch(),this.instance._clickToggleFilter(),this.instance._setFetureAttributes(),this.instance._accesibleMenu()};_addDataListOptions=()=>{if(!this.datalist)return null;document.querySelectorAll(this.search_scope_selector+" .js-porcho-map-search__list,"+` ${this.search_scope_selector} .js-poncho-map-search__list`).forEach(s=>{s.innerHTML="";var e=document.querySelector(this.search_scope_selector+" .js-poncho-map-search__input"),t="id-datalist"+this.scope_sufix;e.setAttribute("list",t),s.id=t,this.instance.filtered_entries.forEach(e=>{var t;e.properties[this.text]&&s.appendChild((e=e.properties[this.text],(t=document.createElement("option")).value=e,t))})})};_searchRegion=()=>{var e=document.querySelector(this.search_scope_selector);e.setAttribute("role","region"),e.setAttribute("aria-label","Buscador")};render=()=>{this._placeHolder(),this._triggerSearch(),this._addDataListOptions(),this.instance.filterChange(e=>{e.preventDefault(),this.instance._filteredData(),this._addDataListOptions()}),this._searchRegion(),this._keyup(),this.instance._accesibleMenu()}}class GapiSheetData{constructor(e){e=Object.assign({},{gapi_key:"AIzaSyCq2wEEKL9-6RmX-TkW23qJsrmnFHFf5tY",gapi_uri:"https://sheets.googleapis.com/v4/spreadsheets/"},e);this.gapi_key=e.gapi_key,this.gapi_uri=e.gapi_uri}url=(e,t,s)=>{return["https://sheets.googleapis.com/v4/spreadsheets/",t,"/values/",e,"?key=",void 0!==s?s:this.gapi_key,"&alt=json"].join("")};json_data=e=>{e=this.feed(e);return{feed:e,entries:this.entries(e),headers:this.headers(e)}};feed=(e,o=!0)=>{const i=e.values[0],n=/ |\/|_/gi;let l=[];return e.values.forEach((e,t)=>{if(0<t){var s,a={};for(s in i){var r=e.hasOwnProperty(s)?e[s].trim():"";o?a[""+i[s].toLowerCase().replace(n,"")]=r:a[""+i[s].replace(n,"")]=r}l.push(a)}}),l};gapi_feed_row=(e,t="-",s=!0)=>{const a=s?"filtro-":"";s=Object.entries(e);let r={};return s.map(e=>{return r[e[0].replace("gsx$","").replace(a,"").replace(/-/g,t)]=e[1].$t}),r};entries=e=>e.filter((e,t)=>0<t);headers=e=>e.find((e,t)=>0==t)}class TranslateHTML{ATTRIBUTES=["title","placeholder","alt","value","href","src","lang"];constructor(e=[],t=[]){this.dictionary=e,this.attributes=t.length?t:this.ATTRIBUTES}translateAttributes=(e=!1)=>{const t=e||this.dictionary;this.attributes.forEach(s=>t.forEach(t=>document.querySelectorAll(`[${s}='${t[0]}']`).forEach(e=>e[s]=t[1])))};translateHTML=(s,a)=>{for(var e,t=document.evaluate("//*/text()",document,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),r=[];e=t.iterateNext();)r.push(e);r.forEach(e=>{var t=e.textContent.replace(s,a);t!==e.textContent&&(t=document.createTextNode(t),e.parentNode.replaceChild(t,e))})};translate=()=>{this.dictionary.forEach(e=>{var t=new RegExp(e[0],"g");this.translateHTML(t,e[1])})}}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
function cleanner(e,n){"object"!=typeof n&&(n=[]);var r=["html","body","div","span","applet","object","iframe","h1","h2","h3","h4","h5","h6","p","blockquote","pre","a","abbr","acronym","address","big","cite","code","del","dfn","em","img","ins","kbd","q","s","samp","small","strike","strong","sub","sup","tt","var","b","u","i","center","dl","dt","dd","ol","ul","li","fieldset","form","label","legend","table","caption","tbody","tfoot","thead","tr","th","td","article","aside","canvas","details","embed","figure","figcaption","footer","header","hgroup","menu","nav","output","ruby","section","summary","time","mark","audio","video","button"],t=(r.forEach(function(e,t){n.includes(e)&&r.splice(t,1)}),new RegExp("<\\/?("+r.join("|")+")(?![a-z])[^>]*>","gmi"));return e.replace(t,"")}var classlist=function(e,t){let n=[];return e&&e[t].split(".").forEach(e=>{e&&n.push(e)}),0<n.length?n.join(" "):""},target=function(e){var t=new RegExp(/(\[(.*?)\]\(((blank):#)([-\_\.\~\!\*\'\(\)\;\:\@\&\=\+\$\,\/\?\%\#\[\]\!\¿\?\¡0-9a-zA-Záéíóúñ]*)\))/,"gmi");return e=e.replace(t,'<a href="$5" target="_$4">$2</a>')};showdown&&(showdown.extension("bootstrap-tables",function(){return[{type:"output",filter:function(e,t,n){e=jQuery("<div></div>").html(e);return jQuery("table",e).each(function(){jQuery(this).addClass("table table-bordered").wrap('<div class="class table-responsive"></div>')}),e.html()}}]}),showdown.extension("images",function(){"use strict";return[{type:"lang",filter:function(e,t,n){const r=/\!\[([^\[\]]{0,255})\]\(([-\_\.\~\!\*\'\(\)\;\:\@\&\=\+\$\,\/\?\%\#\[\]\!\¿\?\¡0-9a-zA-Záéíóúñ\s]{1,255})\)\{([\w\.-]+)\}/;var a=new RegExp(r,"gm");return e=e.replace(a,function(e){var e=new RegExp(r,"gm").exec(e),t=document.createElement("img");return t.src=e[2],t.className=classlist(e,3),t.alt=e[1],t.outerHTML})}}]}),showdown.extension("target",function(){"use strict";return[{type:"lang",filter:function(e,t,n){var r=new RegExp(/(\[(.*?)\]\(((blank):#)([-\_\.\~\!\*\'\(\)\;\:\@\&\=\+\$\,\/\?\%\#\[\]\!\¿\?\¡0-9a-zA-Záéíóúñ]*)\))/,"gmi");return e=e.replace(r,target)}}]}),showdown.extension("button",function(){"use strict";return[{type:"lang",filter:function(e,t,n){const r=/(\[([^\[\]]+)\]\((blank:#)?([a-zA-Z0-9\_\.\-\~\!\*\'\(\)\;\:\@\&\=\+\$\,\/\?\%\#]+)\)\{([\w_\-.]+?)\})/gm;var a=new RegExp(r,"gmi");return e=e.replace(a,function(e){var e=new RegExp(r,"gm").exec(e),t=document.createElement("a");return t.href=e[4],e[3]&&(t.target="_blank"),null!=e[5]&&(t.className=classlist(e,5)),t.textContent=e[2],t.dataset.created="true",t.outerHTML})}}]}),showdown.extension("video",function(){"use strict";return[{type:"lang",filter:function(e,t,n){const a=/\[\[(youtube|vimeo)-\{(16by9|4by3)\}-\{([a-zA-Z0-9]+)\}\]\]/;var r=new RegExp(a,"gm");return e=e.replace(r,function(e){var t,n,r,e=new RegExp(a,"gm").exec(e);return e&&(t=e[2],n=e[3],r="","vimeo"==e[1]?r=`<div
|
|
2
|
+
class="embed-responsive embed-responsive-${t}">
|
|
3
|
+
<iframe
|
|
4
|
+
width=""
|
|
5
|
+
height=""
|
|
6
|
+
src="https://player.vimeo.com/video/${n}"
|
|
7
|
+
frameborder="0"
|
|
8
|
+
webkitallowfullscreen=""
|
|
9
|
+
mozallowfullscreen=""
|
|
10
|
+
allowfullscreen=""
|
|
11
|
+
data-gtm-yt-inspected-1807370_332="true"
|
|
12
|
+
data-gtm-yt-inspected-1807370_380="true"
|
|
13
|
+
data-gtm-yt-inspected-1807370_518="true"
|
|
14
|
+
data-gtm-yt-inspected-1807370_611="true"
|
|
15
|
+
data-gtm-yt-inspected-1807370_618="true">
|
|
16
|
+
</iframe>
|
|
17
|
+
</div>`:"youtube"==e[1]&&(r=`<div
|
|
18
|
+
class="embed-responsive embed-responsive-${t}">
|
|
19
|
+
<iframe
|
|
20
|
+
src="https://www.youtube.com/embed/${n}?enablejsapi=1&origin=https%3A%2F%2Fwww.argentina.gob.ar"
|
|
21
|
+
allowfullscreen=""
|
|
22
|
+
data-gtm-yt-inspected-1807370_332="true"
|
|
23
|
+
id="957974559"
|
|
24
|
+
data-gtm-yt-inspected-1807370_380="true"
|
|
25
|
+
data-gtm-yt-inspected-1807370_518="true"
|
|
26
|
+
data-gtm-yt-inspected-1807370_611="true"
|
|
27
|
+
data-gtm-yt-inspected-1807370_618="true">
|
|
28
|
+
</iframe>
|
|
29
|
+
</div>`)),r})}}]}),showdown.extension("alerts",function(){"use strict";return[{type:"lang",filter:function(e,n,t){const r=/\[\[alerta-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}-\{([\w-\s]*?)\}-\{(warning|danger|info|success)\}\]\]/;var a=new RegExp(r,"gm");return e=e.replace(a,function(e){var t,e=new RegExp(r,"gm").exec(e);return t=e?`<div class="alert alert-${e[4]}">
|
|
30
|
+
<div class="media">
|
|
31
|
+
<div class="media-left">
|
|
32
|
+
<i class="fa ${e[3]} fa-fw fa-4x"></i>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="media-body">
|
|
35
|
+
<h5></h5>
|
|
36
|
+
<h5>${n.makeHtml(e[1])}</h5>
|
|
37
|
+
<p class="margin-0"></p>
|
|
38
|
+
<p>${n.makeHtml(e[2])}</p>
|
|
39
|
+
<p></p>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>`:t})}}]}),showdown.extension("ejes",function(){"use strict";return[{type:"lang",filter:function(e,t,n){const r=/(col([1-4])<<)[\s\S]*?\[\[ejes-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}\]\][\s\S]*?(>>)/;var a=new RegExp(r,"gmi");return e=e.replace(a,function(e){var e=new RegExp(r,"gmi").exec(e),t={2:"6",3:"4",4:"3",1:"12"};return`<div class="col-xs-12 col-sm-${t[e[2]]} col-md-${t[e[2]]}">
|
|
43
|
+
<div class="icon-item">
|
|
44
|
+
<i class="${e[5]} ${e[6]}"></i>
|
|
45
|
+
<p></p>
|
|
46
|
+
<h3>${e[3]}</h3>
|
|
47
|
+
<p>${e[4]}</p>
|
|
48
|
+
</div>
|
|
49
|
+
</div>`})}}]}),showdown.extension("numbers",function(){"use strict";return[{type:"lang",filter:function(e,t,n){const r=/(col([1-4])<<)[\s\S]*?\[\[numeros-\{([^\{\}-]*?)-([^\{\}]*?)\}-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}\]\][\s\S]*?(>>)/;var a=new RegExp(r,"gmi");return e=e.replace(a,function(e){var e=new RegExp(r,"gmi").exec(e),t={2:"6",3:"4",4:"3",1:"12"};return`<div class="col-xs-12 col-sm-${t[e[2]]} col-md-${t[e[2]]}">
|
|
50
|
+
<div class="h2 ${e[7]}">
|
|
51
|
+
${e[3]}<small>${e[4]}</small>
|
|
52
|
+
</div>
|
|
53
|
+
<p class="lead">${e[5]}</p>
|
|
54
|
+
<p class="text-muted">${e[6]}</p>
|
|
55
|
+
</div>`})}}]}),showdown.extension("details",function(){"use strict";return[{type:"lang",filter:function(e,a,t){const s=/^\[\[details(-open|-close)?\s?\{\[([\s\S]*?)\]\[([\s\S]*?)\]\}\]\]$/gm;var n=new RegExp(s,"gmi");return e=e.replace(n,function(e){var e=new RegExp(s,"gmi").exec(e),t="-open"==e[1]&&"true",n=document.createElement("details"),t=(t&&n.setAttribute("open","true"),document.createElement("summary")),r=(t.innerHTML=cleanner(a.makeHtml(e[2]),["h1","h2","h3","h4","h5","h6","strong","em","i"]),document.createElement("div")),e=(r.innerHTML=a.makeHtml(e[3]),n.appendChild(t),n.appendChild(r),n.outerHTML);return e})}}]}));
|
package/gulpfile.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
var gulp = require('gulp');
|
|
2
|
+
var jshint = require('gulp-jshint');
|
|
3
|
+
var uglify = require('gulp-uglify');
|
|
4
|
+
var sass = require('gulp-sass')(require('sass'));
|
|
5
|
+
var plumber = require('gulp-plumber');
|
|
6
|
+
var concat = require('gulp-concat');
|
|
7
|
+
var SRC = './src/js/*.js';
|
|
8
|
+
var rename = require('gulp-rename');
|
|
9
|
+
const gulpIF = require('gulp-if');
|
|
10
|
+
var replace = require('gulp-replace');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var generalCompressOptions = {
|
|
14
|
+
compress: {
|
|
15
|
+
drop_console: true
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const ponchoMinList = [
|
|
20
|
+
'./src/js/utils/color.js',
|
|
21
|
+
'./src/js/utils/connect.js',
|
|
22
|
+
'./src/js/utils/string.js',
|
|
23
|
+
'./src/js/utils/html.js',
|
|
24
|
+
'./src/js/poncho-table/poncho-table.js',
|
|
25
|
+
'./src/js/poncho-table/poncho-table-dependant.js',
|
|
26
|
+
'./src/js/utils/popover.js',
|
|
27
|
+
'./src/js/poncho-ubicacion/poncho-ubicacion.js',
|
|
28
|
+
'./src/js/poncho-charts/poncho-charts.js',
|
|
29
|
+
'./src/js/utils/gapi-legacy.js',
|
|
30
|
+
'./src/js/poncho-map/poncho-map.js',
|
|
31
|
+
'./src/js/poncho-map/poncho-map-filter.js',
|
|
32
|
+
'./src/js/poncho-map/poncho-map-search.js',
|
|
33
|
+
'./src/js/gapi-sheet-data/gapi-sheet-data.js',
|
|
34
|
+
'./src/js/translate-html/translate-html.js'
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
gulp.task('poncho', function(){
|
|
39
|
+
return gulp.src(ponchoMinList)
|
|
40
|
+
.pipe(replace(/\/\/\s?\$START_TEST\$([\s\S]*?)\/\/\s?\$END_TEST\$/gm, '/* module.exports REMOVED */'))
|
|
41
|
+
.pipe(concat('poncho.js', {'newLine':'\n\n'}))
|
|
42
|
+
// .pipe(babel())
|
|
43
|
+
.pipe(gulp.dest('dist/js/'));
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Compila y minifica los archivs JS en poncho.min.js
|
|
49
|
+
*/
|
|
50
|
+
gulp.task('ponchomin', function(){
|
|
51
|
+
return gulp.src(ponchoMinList)
|
|
52
|
+
.pipe(
|
|
53
|
+
replace(
|
|
54
|
+
/\/\/\s?\$START_TEST\$([\s\S]*?)\/\/\s?\$END_TEST\$/gm,
|
|
55
|
+
'/* module.exports REMOVED */'
|
|
56
|
+
)
|
|
57
|
+
)
|
|
58
|
+
.pipe(concat('poncho.min.js'))
|
|
59
|
+
.pipe(uglify(generalCompressOptions))
|
|
60
|
+
.pipe(gulp.dest('dist/js/'));
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
gulp.task('jshint', function(){
|
|
65
|
+
return gulp.src([SRC], {"allowEmpty": true})
|
|
66
|
+
.pipe(plumber())
|
|
67
|
+
.pipe(jshint())
|
|
68
|
+
.pipe(jshint.reporter('default'));
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Minifica los siguientes componentes
|
|
74
|
+
* — Mapa de argentina en SVG
|
|
75
|
+
* — Extensiones showdown markdown
|
|
76
|
+
* — omponente para controlar las migas de pan en Argentina.gob.ar
|
|
77
|
+
*/
|
|
78
|
+
gulp.task('compress', function () {
|
|
79
|
+
return gulp.src([
|
|
80
|
+
'./src/js/showdown-extensions/showdown-extensions.js',
|
|
81
|
+
'./src/js/mapa-argentina/mapa-argentina.js',
|
|
82
|
+
'./src/js/device-breadcrumb/device-breadcrumb.js',
|
|
83
|
+
'./src/js/national-holidays/national-holidays.js',
|
|
84
|
+
'./src/js/device-panel-menu/device-panel-menu.js'
|
|
85
|
+
])
|
|
86
|
+
// .pipe(babel())
|
|
87
|
+
.pipe(uglify(generalCompressOptions))
|
|
88
|
+
.pipe(gulp.dest('./dist/js/'));
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* SASS
|
|
95
|
+
*/
|
|
96
|
+
gulp.task('sass', function(){
|
|
97
|
+
return gulp.src([
|
|
98
|
+
'./src/scss/*.scss'
|
|
99
|
+
])
|
|
100
|
+
// .pipe(sass())
|
|
101
|
+
.pipe(sass.sync({outputStyle: 'compressed'}).on('error', sass.logError))
|
|
102
|
+
.pipe(gulpIF(function(file){return file.path.match('poncho.css')}, rename('poncho.min.css')))
|
|
103
|
+
.pipe(gulp.dest('./dist/css'))
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Compila los archivso SASS
|
|
109
|
+
*/
|
|
110
|
+
gulp.task('sass_poncho', function(){
|
|
111
|
+
return gulp.src([
|
|
112
|
+
'./src/scss/poncho.scss',
|
|
113
|
+
'./src/scss/device-breadcrumb/device-breadcrumb.scss',
|
|
114
|
+
])
|
|
115
|
+
.pipe(sass.sync({outputStyle: 'compressed'}).on('error', sass.logError))
|
|
116
|
+
// .pipe(sass())
|
|
117
|
+
.pipe(gulp.dest('./dist/css'))
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Compila los archivso SASS
|
|
123
|
+
*/
|
|
124
|
+
gulp.task('sass_poncho-map', function(){
|
|
125
|
+
return gulp.src([
|
|
126
|
+
'./src/scss/poncho-map.scss'
|
|
127
|
+
])
|
|
128
|
+
.pipe(sass.sync({outputStyle: 'compressed'}).on('error', sass.logError))
|
|
129
|
+
// .pipe(sass())
|
|
130
|
+
.pipe(gulp.dest('./dist/css'))
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
gulp.task('default', gulp.series( 'sass', 'sass_poncho', 'compress', 'poncho', 'ponchomin', "sass_poncho-map"))
|