isobit-ui 0.3.8 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/library.js +1 -1
- package/dist/library.mjs +1 -1
- package/dist/theme.css +3507 -32
- package/dist/types/Drag.d.ts +28 -0
- package/dist/types/commons.d.ts +8 -1
- package/dist/types/components.d.ts +2 -0
- package/dist/types/index.d.ts +10 -3
- package/dist/types/useAppStore.d.ts +37 -0
- package/package.json +11 -6
package/dist/library.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Vue$1=require("vue"),axios$2=require("axios"),Observable=require("ol/Observable"),_imports_0=require("@/cdn/images/triangle-down.svg"),script$o={props:{value:{value:Object},data:{type:Array,default:null},placeholder:String,label:String,default:Object,store:null,params:null,autoload:null,floating:{default:!0},src:String,readonly:Boolean,nowrap:null,disabled:Boolean,showSelection:{type:Boolean,default:!0},pagination:{default:10}},data:()=>({page:0,selected:null,focused:-1,query:null,data0:null,show:!1,total:0,inputClass:""}),updated(){var e=this;e.selected=e.value,e.data&&(e.data0=e.data)},watch:{show(e){e&&this.$emit("contextmenu",this)}},computed:{data2(){var e=this;this.focused=-1;var t=e.query?e.query.trim().toLowerCase().split(/[ ,]+/):null;return e.data0&&e.query?e.data0.filter((e=>{for(var a=JSON.stringify(e).toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""),l=0;l<t.length;l++)if(-1==a.indexOf(t[l]))return!1;return!0})):e.data0}},mounted(){var e=this;e.inputClass=e.$attrs.inputclass,e.autoload&&e.search(),document.addEventListener("click",e.clickout),e.$root.online||e.loadStore()},beforeDestroy(){document.removeEventListener("click",this.clickout)},methods:{async getStoredList(e){let t=new Promise((t=>{var a=window._.db.transaction(e).objectStore(e).getAll();a.onsuccess=function(){t(a.result)}}));return await t},async loadStore(){var e,t=this,a=t.store;if(null!=a)return window._.db&&(e=await t.getStoredList(a)),e||(e=[]),t.data0=t.data0?e.concat(t.data0):e,t.data0},keyup(){40==event.keyCode?this.focused<this.data.length&&this.focused++:38==event.keyCode?this.focused>0&&this.focused--:13==event.keyCode&&this.focused>-1&&this.setSelected(this.data[this.focused])},remove(){this.$emit("input",null)},clickout(){var e=event.target;event.stopPropagation();do{if(e==this.$el)return!1}while(e=e.parentNode);this.show=!1},focusout(){"INPUT"!=event.target.nodeName&&(this.show=!1)},hasSlot(e="default"){return!!this.$slots[e]||!!this.$scopedSlots[e]},clear(){var e=this;e.selected=null,e.query="",e.data0=null},focus(e){this.$el.querySelector("input").focus(e)},setSelected(e,t){this.show=t,this.selected=e,this.$emit("input",e)},getLabel(e){if(this.label)for(var t=this.label.split("."),a=0;a<t.length;a++)e&&(e=e[t[a]]);return e},search(e){var t=this,a=Number(t.pagination);if(1===e)t.page+=a;else if(t.page=0,t.data&&t.autoload)return;var l={query:t.query};t.params&&(l=Vue.mergeDeep(l,t.params)),axios.get((t.src?t.src:t.source)+(a>0?"/"+t.page+"/"+a:""),{params:l}).then((a=>{var l=a.data;l.error?MsgBox(l.error):(t.data0=1===e?t.data0.concat(l.data?l.data:l):l.data?l.data:l,console.log(t.data0),t.total=l.size,t.autoload||(t.show=!0),console.log("========================="))})).catch(t.error).then((()=>{t.$emit("complete",{data:t.data0,query:t.query,target:t})}))}}};const _hoisted_1$h=["value","disabled"],_hoisted_2$c=Vue$1.createElementVNode("i",{class:"fa fa-times"},null,-1),_hoisted_3$8=[_hoisted_2$c],_hoisted_4$5=Vue$1.createElementVNode("i",{class:"fa fa-xs fa-sync"},null,-1),_hoisted_5$2=[_hoisted_4$5],_hoisted_6$1=["disabled","placeholder"],_hoisted_7$1=Vue$1.createElementVNode("button",{class:"hide",onclick:"return false"},null,-1),_hoisted_8={class:"v-list"},_hoisted_9=["onClick"],_hoisted_10={key:0,class:"center yellow",style:{padding:"5px"}};function render$n(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",{class:"v-autocomplete",onFocusout2:t[8]||(t[8]=(...e)=>r.focusout&&r.focusout(...e)),value:a.value,disabled:a.disabled},[o.selected&&a.showSelection?(Vue$1.openBlock(),Vue$1.createElementBlock("div",{key:0,class:"v-selection",style:Vue$1.normalizeStyle({whiteSpace:a.nowrap?"nowrap":""})},[Vue$1.renderSlot(e.$slots,"label",{selected:o.selected}),Vue$1.createTextVNode(" "+Vue$1.toDisplayString(r.hasSlot("label")?" ":r.getLabel(o.selected))+" ",1),a.readonly?Vue$1.createCommentVNode("v-if",!0):(Vue$1.openBlock(),Vue$1.createElementBlock("span",{key:0,onClick:t[0]||(t[0]=(...e)=>r.remove&&r.remove(...e)),style:{top:"0px",margin:"2px 4px",right:"0px",position:"absolute",cursor:"pointer"}},[..._hoisted_3$8]))],4)):Vue$1.createCommentVNode("v-if",!0),o.selected?Vue$1.createCommentVNode("v-if",!0):(Vue$1.openBlock(),Vue$1.createElementBlock("span",{key:1,onClick:t[1]||(t[1]=(...e)=>r.search&&r.search(...e)),style:{color:"gray",top:"4px",right:"6px",position:"absolute",cursor:"pointer"}},[..._hoisted_5$2])),o.selected?Vue$1.createCommentVNode("v-if",!0):Vue$1.withDirectives((Vue$1.openBlock(),Vue$1.createElementBlock("input",{key:2,onKeyup:[t[2]||(t[2]=(...e)=>r.keyup&&r.keyup(...e)),t[3]||(t[3]=Vue$1.withKeys(Vue$1.withModifiers(((...e)=>r.search&&r.search(...e)),["stop","prevent"]),["enter"])),t[4]||(t[4]=Vue$1.withKeys((t=>e.$emit("escape",o.query)),["esc"]))],class:Vue$1.normalizeClass(o.inputClass),onFocus:t[5]||(t[5]=e=>o.show=!0),disabled:a.disabled,placeholder:a.placeholder,"onUpdate:modelValue":t[6]||(t[6]=e=>o.query=e)},null,42,_hoisted_6$1)),[[Vue$1.vModelText,o.query]]),_hoisted_7$1,Vue$1.createVNode(Vue$1.Transition,{name:"fade",persisted:""},{default:Vue$1.withCtx((()=>[Vue$1.withDirectives(Vue$1.createElementVNode("div",{class:"v-resultpane",style:Vue$1.normalizeStyle([{zIndex:2,width:"calc(100% - 2px)",position:a.floating?"absolute":"relative"},{"z-index":"2,width: calc(100% - 2px)","max-height":"300px","overflow-y":"auto",border:"1px solid #0f62ac"}])},[Vue$1.createElementVNode("div",_hoisted_8,[(Vue$1.openBlock(!0),Vue$1.createElementBlock(Vue$1.Fragment,null,Vue$1.renderList(r.data2,((t,a)=>(Vue$1.openBlock(),Vue$1.createElementBlock("div",{class:Vue$1.normalizeClass({"v-selected":o.selected==t,"v-focused":o.focused==a}),onClick:e=>r.setSelected(t)},[Vue$1.renderSlot(e.$slots,"default",{row:t})],10,_hoisted_9)))),256)),o.data0&&o.data0.length<o.total?(Vue$1.openBlock(),Vue$1.createElementBlock("div",{key:0,class:"center",onClick:t[7]||(t[7]=e=>r.search(1))},"Cargar "+Vue$1.toDisplayString(o.total-o.data0.length)+" resultados mas...",1)):Vue$1.createCommentVNode("v-if",!0)]),r.data2&&r.data2.length<1?(Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_10,"No existen resultados.")):Vue$1.createCommentVNode("v-if",!0)],4),[[Vue$1.vShow,o.show&&!o.selected]])])),_:3})],40,_hoisted_1$h)}script$o.render=render$n,script$o.__file="src/v-autocomplete.vue";var script$n={mounted(){var e=this,t=document.createElement("span"),a=document.createElement("i");t.className="ui-button-text ui-c ",t.innerHTML=e.$attrs.value?e.$attrs.value:"ui-button",e.$el.addEventListener("click",(t=>{t.component=e,e.$emit("click",t)})),e.$attrs.icon?(e.$attrs.value?e.$el.classList.add("v-button-text-icon-left"):e.$el.classList.add("v-button-icon-only"),a.dataset.icon=e.$attrs.icon,a.className="fa "+e.$attrs.icon,e.$el.appendChild(a)):(t=document.createElement("span"),e.$el.classList.add("ui-button-text-only"),e.$el.appendChild(t)),e.$attrs.value&&((t=document.createElement("span")).appendChild(document.createTextNode(e.$attrs.value)),e.$el.appendChild(t)),e.updateIcon()},methods:{updateIcon(){var e=this;setTimeout((function(){var t=e.$el.querySelector("svg");if(t){var a=t.dataset;a.icon||(a.icon=e.$attrs.icon)}}),1e3)}}};const _hoisted_1$g={type:"button",class:"_ ui-widget ui-state-default ui-corner-all v-button"};function render$m(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("button",_hoisted_1$g)}script$n.render=render$m,script$n.__file="src/v-button.vue";var script$m={props:{value:{value:String},type:String,required:String,readonly:String,max:String,min:String},data:()=>({value2:null}),methods:{enterD(){var e=event.target.value,t=this,a=t.toDate(e);return console.log(a),t.max&&a&&a.getTime()>=t.toDate(t.max).getTime()||t.min&&a&&a.getTime()<=t.toDate(t.min).getTime()?(t.$emit("invalid",{target:t,value:a}),a=null,void(event.target.value=a)):void("time"===t.$props.type?this.$emit("input",t.pad(a.getHours(),2)+":"+t.pad(a.getMinutes(),2)+":00"):a.getTime&&this.$emit("input",a.getTime()))},pad(e,t){for(var a=e+"";a.length<t;)a="0"+a;return a},toDate(e){if(e){var t,a;if("time"===this.$props.type)return t=e.split(":"),new Date(1981,1,6,parseInt(t[0]),parseInt(t[1]),t.length>2?parseInt(t[2]):0);if(!isNaN(e))return new Date(e);if("datetime-local"===this.$props.type)return t=(a=e.split("T"))[1].split(":"),a=a[0].split("-"),a=new Date(parseInt(a[0]),parseInt(a[1])-1,parseInt(a[2]),parseInt(t[0]),parseInt(t[1]),t.length>2?parseInt(t[2]):0);a=e.split("-");var l=parseInt(a[0]);return l<100?e:a=new Date(l,parseInt(a[1])-1,parseInt(a[2]))}return e},changeDate(){var e,t=this,a=t.toDate(t.value);console.log(a),a&&(e="time"===t.$props.type?t.pad(a.getHours(),2)+":"+t.pad(a.getMinutes(),2):"datetime-local"===t.$props.type?t.pad(a.getFullYear(),4)+"-"+t.pad(a.getMonth()+1,2)+"-"+t.pad(a.getDate(),2)+"T"+t.pad(a.getHours(),2)+":"+t.pad(a.getMinutes(),2):t.pad(a.getFullYear(),4)+"-"+t.pad(a.getMonth()+1,2)+"-"+t.pad(a.getDate(),2)),this.$el.children[0].value=e}},updated(){this.changeDate()},mounted(){this.changeDate()}};const _hoisted_1$f=["value"],_hoisted_2$b=["required","readonly","min","max","type"];function render$l(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",{value:r.toDate(a.value)},[Vue$1.createElementVNode("input",{required:a.required,readonly:a.readonly,min:a.min,max:a.max,onChange:t[0]||(t[0]=(...e)=>r.enterD&&r.enterD(...e)),type:a.type?a.type:"date"},null,40,_hoisted_2$b)],8,_hoisted_1$f)}script$m.render=render$l,script$m.__file="src/v-calendar.vue";var script$l={model:{prop:"vmodel",event2:"change"},props:{value:null,vmodel:null,valueFalse:null,label:null,readonly:null},data:()=>({input:null,hadValue:0}),mounted(){var e=this,t=e.$el.querySelector("input");e.$parent&&e.$parent.nam&&(t.name=e.$parent.nam),e.input=t,e.$parent.onChange||(t.checked=e.value&&e.value==e.vmodel||""+e.vmodel=="true"||""+e.vmodel=="1"),e.$parent.$emit("mounted",e),e.$parent.update2&&e.$parent.update2()},updated(){var e=this;e.input.checked=e.value&&e.value==e.vmodel||""+e.vmodel=="true"||""+e.vmodel=="1"},methods:{change(){var e=this;if(!e.readonly){var t=e.$el.querySelector("input");e.$parent.onChange&&e.$parent.onChange(e.value,t.checked);var a=t.checked?e.value?e.value:t.checked:null!==e.valueFalse&&void 0!==e.valueFalse?e.valueFalse:t.checked;a&&(e.hadValue=1),console.log("nv="+a),e.$emit("input",a)}},getLabel(){var e=this.value;return this.label?this.label:e&&"string"==typeof e?e:""},onClick(e){return this.readonly&&e.preventDefault(),!1}}};const _hoisted_1$e={style:{"font-weight":"normal !important",display:"block"},class:"v-checkbox"},_hoisted_2$a=["innerHTML"],_hoisted_3$7=["checked","value"],_hoisted_4$4=Vue$1.createElementVNode("span",{class:"checkmark"},null,-1);function render$k(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("label",_hoisted_1$e,[Vue$1.createElementVNode("span",{innerHTML:r.getLabel()},null,8,_hoisted_2$a),Vue$1.createElementVNode("input",{type:"checkbox",checked:a.value&&a.vmodel==a.value||a.vmodel,onChange:t[0]||(t[0]=(...e)=>r.change&&r.change(...e)),value:a.value},null,40,_hoisted_3$7),_hoisted_4$4])}script$l.render=render$k,script$l.__file="src/v-checkbox.vue";var script$k={props:{required:String,name:String},data:()=>({value:[],options:[],nam:null}),created(){this.nam||(this.nam=this.$props.name?this.$props.name:"input_"+_.id()),this.update2()},updated(){this.update2()},mounted(){this.options=this.$el.querySelectorAll("input:not(.v-chk)");for(var e=0;e<this.options.length;e++)this.options[e].classList.add("v-chk");this.update2()},methods:{update2(){var e=this.options,t=this.$attrs.value;"string"==typeof t&&(t=t.split("|"));for(var a=0;a<e.length;a++){e[a].checked=!1;for(var l=0;t&&l<t.length;l++)e[a].value==t[l]&&(e[a].checked=!0)}},onChange:function(e,t){var a=this,l=a.$attrs.value;if(("string"==typeof l||l instanceof String)&&(l=l.split("|")),t)l||(a.$attrs.value=l=[]),l.push(e);else{var o=l.indexOf(e);o>-1&&l.splice(o,1)}a.$emit("input",l)}}};function render$j(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",null,[Vue$1.renderSlot(e.$slots,"default")])}script$k.render=render$j,script$k.__file="src/v-checkbox-group.vue";var script$j={props:["header","store","action"],watch:{header(e){this.setTitle(e)}},data:()=>({timer:null}),methods:{setTitle(e){var t=this.$parent.app;t&&setTimeout((()=>{t.title=e}),100)},getAbsoluteHeight(e){var t=window.getComputedStyle(e),a=parseFloat(t.marginTop)+parseFloat(t.marginBottom);return Math.ceil(e.offsetHeight+a)},resize(e){console.log("v-form.resize");var t=this,a=t.$el,l=e.height;a.style.height=l+"px",t.timer&&clearTimeout(t.timer),t.timer=setTimeout((()=>{if(a.parentElement){var e;if(a.children[1])console.log(a.children[0].textContent),console.log(a.children[0]),console.log(a.children[0].offsetHeight),l-=a.children[0].offsetHeight,a.children[1].style.height=l+"px",a.children[1].style.overflowY="auto",(a=a.children[1].children[0]).style.height=l+"px",a.children&&(a.parentNode.style.overflowY="hidden",a.parentNode.style.overflow="hidden"),[].forEach.call(a.children,((o,r)=>{r==a.children.length-1&&"CENTER"==o.tagName||!o.classList.contains("v-scrollable")&&!o.classList.contains("v-form")&&!o.classList.contains("v-resize")?l-=t.getAbsoluteHeight(o):e||(e=o)})),a=e;else(a=a.children[0]).style.height=l+"px";if(a){a.style.overflowY="auto",a.style.height=l+"px";var o=new Event("parentResize",{bubbles:!0});o.height=l,a.children[0].dispatchEvent(o),o.$target=t,t.$emit("resize",o)}}}),500)}},mounted(){var e=this;e.$el.querySelector("form").addEventListener("submit",(t=>{t.preventDefault();var a=e.$parent;return a.refresh&&a.refresh(),!1})),e.setTitle(e.header),e.$el.addEventListener("parentResize",(t=>{t.target==e.$el&&e.resize(t)}))},beforeUnmount(){console.log("unmounted")},updated(){for(var e=this,t=e.$el.querySelectorAll("[type=number]:not(._)"),a=0;a<t.length;a++){var l=()=>{var e=this,t=e.value;if(t){t=n(t),e.max&&t>n(e.max)&&(t=n(e.max)),e.min&&t<n(e.min)&&(t=n(e.min));var a=this.getAttribute("decimal");null!==a&&(t=t.toFixed(1*a)),e.value=t}};t[a].oninput=l,t[a].onblur=l,t[a].classList?t[a].classList.add("_"):t[a].className="_"}t=e.$el.querySelectorAll(".numeric:not(._)");for(a=0;a<t.length;a++)t[a].addEventListener("keyup",(e=>{86==e.keyCode&&isNaN(this.value)&&(this.value="")})),t[a].addEventListener("keydown",(e=>{console.log("eeeeeee"+e.keyCode),-1!==[46,8,9,27,13,110,88,86].indexOf(e.keyCode)||65===e.keyCode&&(!0===e.ctrlKey||!0===e.metaKey)||e.keyCode>=35&&e.keyCode<=40||(e.shiftKey||e.keyCode<48||e.keyCode>57)&&(e.keyCode<96||e.keyCode>105)&&e.preventDefault()})),t[a].classList?t[a].classList.add("_"):t[a].className="_";var o=function(e){var t=this,a=t.previousElementSibling;if(a&&a.classList&&a.classList.contains("v-error")&&a.parentNode.removeChild(a),!t.disabled&&!t.getAttribute("disabled")&&(t.required||"DIV"===t.tagName)&&("DIV"!=t.tagName&&!t.value||"DIV"===t.tagName&&!t.attributes.value)){for(a=t.previousElementSibling;a&&1!=a.nodeType;)a=a.previousElementSibling;if(!a)for(a=t.parentElement.previousElementSibling;a&&1!=a.nodeType;)a=a.previousElementSibling;var l=document.createElement("div");l.innerHTML="Este campo es requerido!",l.classList.add("v-error"),t.parentNode.insertBefore(l,t)}};e.$el.querySelectorAll("select,input[type=date]:not(.__),input[type=text]:not(.__),textarea:not(.__)").forEach((e=>{e.addEventListener("focusout",o),e.classList?e.classList.add("__"):e.className="__"}))}};const _hoisted_1$d={class:"ui-panel"},_hoisted_2$9={key:0,class:"v-widget-header v-panel-titlebar"},_hoisted_3$6={class:"v-panel-title"},_hoisted_4$3={class:"v-dialog-content v-widget-content"},_hoisted_5$1=["action"];function render$i(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$d,[a.header?(Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_2$9,[Vue$1.createElementVNode("span",_hoisted_3$6,Vue$1.toDisplayString(a.header),1)])):Vue$1.createCommentVNode("v-if",!0),Vue$1.createElementVNode("div",_hoisted_4$3,[Vue$1.createElementVNode("form",{action:a.action},[Vue$1.renderSlot(e.$slots,"default")],8,_hoisted_5$1)])])}script$j.render=render$i,script$j.__file="src/v-form.vue";var script$i={props:{value:String,label:String},mounted(){var e=this,t=e.$el.querySelector("input");e.$parent&&e.$parent.nam&&(t.name=e.$parent.nam),e.$parent.required&&(t.required=e.$parent.required),t.onclick=function(){e.$parent.onChange(e.value)}}};const _hoisted_1$c={class:"v-radio",style:{"font-weight":"normal !important",display:"block"}},_hoisted_2$8=["value"],_hoisted_3$5=Vue$1.createElementVNode("span",{class:"checkmark"},null,-1);function render$h(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("label",_hoisted_1$c,[Vue$1.createTextVNode(Vue$1.toDisplayString(a.label?a.label:a.value)+" ",1),Vue$1.createElementVNode("input",{type:"radio",value:a.value},null,8,_hoisted_2$8),_hoisted_3$5,Vue$1.renderSlot(e.$slots,"default")])}script$i.render=render$h,script$i.__file="src/v-radio.vue";var script$h={props:{required:String,name:String},data:()=>({value:null,nam:null}),updated(){this.update2()},mounted(){this.update2()},created(){this.nam||(this.nam=this.$props.name?this.$props.name:"input_"+window._.id())},methods:{getInputs(e,t){var a=this;return e.children&&Array.from(e.children).forEach((e=>{"INPUT"==e.tagName?t.push(e):e.classList.contains("v-group")||a.getInputs(e,t)})),t},update2(){for(var e=this.getInputs(this.$el,[]),t=0;t<e.length;t++)e[t].value==this.$attrs.value?e[t].checked=!0:e[t].checked=!1},onChange(e){this.value=e,""===e&&(e=null),this.$emit("input",e)}}};const _hoisted_1$b={class:"v-group"};function render$g(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$b,[Vue$1.renderSlot(e.$slots,"default")])}script$h.render=render$g,script$h.__file="src/v-group.vue";var script$g={props:{required:String,name:String},data:()=>({value:null,nam:null}),updated(){this.update2()},mounted(){this.update2()},created(){this.nam||(this.nam=this.$props.name?this.$props.name:"input_"+window._.id())},methods:{getInputs(e,t){var a=this;return e.children&&Array.from(e.children).forEach((e=>{"INPUT"==e.tagName?t.push(e):e.classList.contains("v-group")||a.getInputs(e,t)})),t},update2(){for(var e=this.getInputs(this.$el,[]),t=0;t<e.length;t++)e[t].value==this.$attrs.value?e[t].checked=!0:e[t].checked=!1},onChange(e){this.value=e,""===e&&(e=null),this.$emit("input",e)}}};function render$f(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",null,[Vue$1.renderSlot(e.$slots,"default")])}script$g.render=render$f,script$g.__file="src/v-radio-group.vue";var script$f={props:{value:Array,filterKey:String,src:String,filters:Object,store:null,itemWidth:null,rowKey:String,rowStyleClass:null,pagination:null,selectable:Boolean,scrollable:Boolean,autoload:{type:Boolean,default:!0}},data:function(){return{data:null,pages:1,page:1,columns:1,w:0,row:{},error:null,size:null,sortKey:"",selected:[],sortOrders:{},rowStyleClassFunc:null}},created(){var me=this;try{me.rowStyleClass&&(eval("me.rowStyleClassFunc=function(row,item,index){return "+me.rowStyleClass+"}"),me.rowStyleClassFunc({},{},0))}catch(e){me.rowStyleClassFunc=null,console.log("Error en la expresion rowStyleClassFunc=function(row,item,index){return "+me.rowStyleClass+"}")}},updated(){console.log("updated"),this.$emit("updated"),this.resize()},mounted(){var e=this;e.$el.addEventListener("parentResize2",e.resize),e.autoload&&e.load(),e.resize()},methods:{resize(){var e=this;if(e.itemWidth){var t=1+Math.trunc(e.$el.offsetWidth/Number(e.itemWidth));t>6&&(t=6),e.columns=t}},async getStoredList(e){let t=new Promise((t=>{var a=window._.db.transaction(e).objectStore(e).getAll();a.onsuccess=function(){t(a.result)}}));return await t},async loadStore(){let e=this,t=e.store;if(null!=t){let a;return window._.db&&(a=await e.getStoredList(t)),a||(a=[]),e.data=e.data?a.concat(e.data):a,console.log("loadStore"),console.log(e.data),e.data}},getRowClass(e,t){var a=this,l=t%a.columns+1,o=["c-w-"+a.columns];return l==a.columns&&o.push("v-last"),a.rowStyleClassFunc?o.push(a.rowStyleClassFunc(e,e,t)):o.push(a.rowStyleClass),o},remove(e){e=e.id?e.id:e;var t=this.data,a=t.map((e=>e.id)).indexOf(e);t.splice(a,1)},error2(e,t){this.data=[],this.error=t},load(e){var t=this;if(this.selected=[],t.value)t.data=t.value;else{!0===e&&(t.page=1);var a=t.src;a||(a=t.$root.apiLink(window.location.pathname)),a.endsWith("/")&&(a=a.slice(0,a.length-1)),t.pagination&&(a+="/"+(t.page-1)*t.pagination+"/"+t.pagination),axios.get(a,{error:t.error2,params:t.filters}).then((function(a){if(a.data&&a.data.error)MsgBox(a.data.error);else{var l=t.value?t.value:a.data.data?a.data.data:a.data;t.data||(t.data=[]),t.data=!0===e?l:t.data?t.data.concat(l):t.data,t.size=a.data.size,a.data&&a.data.size&&(t.pages=Math.ceil(a.data.size/t.pagination),t.page>t.pages&&(t.page=1)),t.$emit("loaded",{target:t,response:a})}})).catch(t.error)}}}};const _hoisted_1$a={class:"v-dataview"};function render$e(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$a,[e.data?(Vue$1.openBlock(!0),Vue$1.createElementBlock(Vue$1.Fragment,{key:0},Vue$1.renderList(e.data,((t,a)=>(Vue$1.openBlock(),Vue$1.createElementBlock("div",{class:Vue$1.normalizeClass(r.getRowClass(t,a))},[Vue$1.renderSlot(e.$slots,"default",{row:t,item:t,index:a})],2)))),256)):Vue$1.createCommentVNode("v-if",!0),e.data&&!e.data.length?(Vue$1.openBlock(),Vue$1.createElementBlock("div",{key:1,class:Vue$1.normalizeClass(["center v-no-results",{error:e.error}])},Vue$1.toDisplayString(e.error?e.error:"No existen registros para mostrar"),3)):Vue$1.createCommentVNode("v-if",!0),e.data&&e.size>e.data.length?(Vue$1.openBlock(),Vue$1.createElementBlock("div",{key:2,onClick:t[0]||(t[0]=t=>r.load(e.page++)),class:"center v-more-results"},"Ver mas resultados")):Vue$1.createCommentVNode("v-if",!0)])}script$f.render=render$e,script$f.__file="src/v-dataview.vue";var script$e={props:{legend:String,closable:null},watch:{closed(e){this.$emit("change",{target:this,closed:e}),this.$emit("input",!e)}},data:()=>({closed:!1}),created(){this.closed=this.closable},mounted(){var e=this;e.$el.addEventListener("parentResize",(t=>{t.$target=e,e.$emit("resize",t)}))},updated(){var e=this;setTimeout((function(){var t=e.$el.querySelector("legend > * > svg");if(t)try{console.log(),t.dataset.icon=t.parentNode.dataset.icon}catch(e){console.log("icon"),console.log(e)}}),50)}};const _hoisted_1$9={class:"v-fieldset"},_hoisted_2$7=["data-icon"],_hoisted_3$4=["innerHTML"];function render$d(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("fieldset",_hoisted_1$9,[a.legend?(Vue$1.openBlock(),Vue$1.createElementBlock("legend",{key:0,onClick:t[0]||(t[0]=e=>o.closed=a.closable&&!o.closed),style:Vue$1.normalizeStyle({cursor:a.closable?"pointer":""})},[a.closable?(Vue$1.openBlock(),Vue$1.createElementBlock("span",{key:0,"data-icon":o.closed?"plus":"minus",style:{margin:"0px 5px 0px 0px"}},[Vue$1.createElementVNode("i",{class:Vue$1.normalizeClass([o.closed?"fa-plus":"fa-minus","fa"])},null,2)],8,_hoisted_2$7)):Vue$1.createCommentVNode("v-if",!0),Vue$1.createElementVNode("span",{innerHTML:a.legend},null,8,_hoisted_3$4)],4)):Vue$1.createCommentVNode("v-if",!0),Vue$1.withDirectives(Vue$1.createElementVNode("div",null,[Vue$1.renderSlot(e.$slots,"default")],512),[[Vue$1.vShow,!o.closed]])])}script$e.render=render$d,script$e.__file="src/v-fieldset.vue";const template='\n\t<div :class={reflow:reflow} :key="\'v-table-\'+keyBody" :style={width:width}\n class="v-datatable v-resize">\n <template v-if="active">\n\t\t<div v-if="hasSlot(\'header\')" class="v-datatable-header v-widget-header ui-corner-top"><slot name="header"></slot>\n\t\t</div>\n\t\t<div v-if="pagination" class="v-paginator v-paginator-top v-widget-header v-paginator-pages center">\n\t\t\n\t\t<v-button value="|<" :disabled="page<=1" v-on:click.prevent="to(1)"/><v-button value="<" v-on:click.prevent="to(page-1)" :disabled="page<=1"/><div style="padding:3px 8px;display:inline-block">\n\t\t<input type="number" v-on:change="to(page,true)" style="width:60px" min="1" :max="pages" v-model="page"/> / {{pages}}</div>\n\t\t<v-button value=">" v-on:click.prevent="to(page+1)" :disabled="page==pages"/><v-button v-on:click.prevent="to(pages)" value=">|" :disabled="page==pages"/>\n\t\t\t</div>\n\t\t<div v-if="scrollable0" class="v-widget-header v-datatable-scrollable-header" style="position:relative">\n\t\t<div class="v-datatable-scrollable-header-box" style=""></div></div>\n\t\t<div :class="{\'v-datatable-scrollable-body\':scrollable0}">\n\t\t<table class="v-table" :style="{width:width}" v-if="columns">\n\t\t\t<thead>\n <tr>\n <th v-if="selectable0" :width="getCheckColumnWidth" >\n <span class="v-check" v-on:click="rowSelect(null,-10)" :data-icon="selected.length?\'square-check\':\'square\'">\n <i class="fa fa-lg" :class="selected.length?\'fa-square-check\':\'fa-square\'"></i>\n </span>\n </th>\n <th :class="k[\'h-class\']" v-for="k in columns" :width="k.width" v-on:click="sortBy(k)">\n <div v-html="k.header"></div>\n </th>\n\t\t\t</tr>\n </thead>\n\t\t\t<tbody class="v-datatable-data" :key="kc">\n <template v-for="(groupItem) in groupedData">\n\n <tr v-if="hasSlot(\'header-group\')" >\n <slot name="header-group" :group="groupItem"></slot>\n </tr>\n\n <tr v-for="(entry,r) in groupItem" @row="rowCreated(entry)" @click="_selectRow($event,entry,r)" \n :class="getRowClass(r,entry)">\n <td v-if="selectable0" width="18" class="center">\n <span :data-index="r" class="v-check" v-on:click="rowSelect(entry,r)"\n :data-icon="isSelected(r)?\'square-check\':\'square\'"><i class="far fa-lg" :class="isSelected(r)?\'fa-square-check\':\'fa-square\'" ></i></span>\n </td>\n <slot :row="entry" :index="r+(page-1)*paginatio_"></slot>\n </tr>\n\n <tr v-if="hasSlot(\'footer-group\')" >\n <slot name="footer-group" :group="groupItem"></slot>\n </tr>\n\n </template>\n\n\t\t\t\t<tr v-if="!sortedData||sortedData.length==0">\n\t\t\t\t\t<td :colspan="columns.length+(selectable0?1:0)">{{emptyMessage}}</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t\t</div>\n\t\t<div v-if="summary||hasSlot(\'summary\')" class="v-table-summary" :class="{\'v-datatable-scrollable-body\':scrollable}">\n\t\t\t<table class="v-table v-table-summary"><tr>\n\t\t\t<td v-if="selectable0" :width="getCheckColumnWidth" ></td>\n\t\t\t<slot name="summary" :data="sortedData"></slot>\n\t\t\t</tr></table>\n\t\t</div>\n\t\t<div class="hide filters"><slot name="filters"></slot><slot name="columns"></slot></div></template></div>\n',compiledTemplate=Vue$1.compile(template);var script$d={props:{value:Array,filterKey:String,reflow:null,summary:null,src:String,gql:null,filters:Object,store:null,width:null,emptyMessage:{default:"No existen registros"},rowKey:{default:"id"},rowStyleClass:String,groupKeys:{default:""},pagination:null,selectable:{default:!0},scrollable:null,autoload:{default:!0}},data:()=>({data:[],sorter:null,sortDir:1,pages:1,resizeAfterUpddate:0,page:1,active:0,selectable0:1,scrollable0:0,kc:1,keyBody:1,columns:null,row:{},hasFilters:0,kt:0,size:null,sortKey:"",selected:[],paginatio_:0,remoteLoaded:null,loaded:!1,sortOrders:{},rowStyleClassFunc:null}),render(e){var t=this,a=[];t.def||(t.def=t.$scopedSlots.default);var l=t.def({row:{}});l&&(l.forEach(((e,l)=>{var o=e.data.attrs;e.children&&(e.children.filter((e=>"v-filter"==e.tag)).forEach((a=>{o.filter=a,t.hasFilters=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.tag)).forEach((t=>{o.footer=t,e.children.shift()}))),a.push(o)})),t.columns||(t.columns=a),t.co=a),t.$scopedSlots.default=function(e,a,l){let o=t.def(e,a,l);return o.forEach(((e,a)=>{delete e.data.attrs.header,delete e.data.attrs.width,e.children&&(e.children.filter((e=>"v-filter"==e.tag)).forEach((a=>{t.hasFilters=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.tag)).forEach((t=>{e.children.shift()})))})),o};var o=compiledTemplate.render.call(this,e);return t.co.forEach((e=>{e.filter&&o.children[o.children.length-1].children.push(e.filter)})),o},computed:{getCheckColumnWidth:()=>36,filteredData(){const e=this;let t,a,l=e.data;return l=l.filter((l=>{for(let o in e.filters)if(t=e.filters[o],"function"==typeof t){if(!t(l))return 0}else if(t&&"string"==typeof t&&o in l&&(a=l[o],"string"==typeof a&&(a=a.toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""),!a.includes(t.toUpperCase()))))return 0;return 1})),l.sum=_.sum,l},groupedData(){const e={},t=this.groups,a=this.sortedData||[];return t?(alert(t),a.forEach((a=>{const l=a[t];e[l]||(e[l]=[]),e[l].push(a)})),Object.entries(e).map((([e,t])=>({group:Number(e),values:t})))):(alert(8),{group:"",values:a})},sortedData(){var e=this,t=e.filteredData;return(t=e.sorter?t.sort(((t,a)=>(a=(a=a[e.sorter])||0,t=t[e.sorter],aa=Number(t),aa&&(t=aa),t<a?-1*e.sortDir:t>a?1*e.sortDir:0))):t).sum=_.sum,t}},mounted(){var e=this,t=e.$el.style?e.$el.style.height:null;t&&(e.scrollable0=1,e.resizeAfterUpddate=1),e.$parent.tabs&&e.$el.addEventListener("tabChange",(t=>{e.active=1;var a=t.$target.k;e.kt!=a&&(e.load(),e.kt=a)})),e.active&&(e.buildColumns(),!0===e.autoload&&e.load()),e.$el.addEventListener("parentResize",(t=>{e.resize(t.height)})),e.$el.addEventListener("command",(t=>{switch(t.name){case"refresh":if(!t.key||e.$el.getAttribute("refresh")!=t.key){e.load(),e.$el.getAttribute("refresh",t.key);break}}})),t&&e.resize(parseInt(t))},created(){var me=this;me.$parent.tabs||(me.active=1);var s=""+me.selectable;me.selectable0="false"!=s&&"0"!=s?1:0,s=""+me.scrollable,me.scrollable0=me.scrollable&&"false"!=s&&"0"!=s?1:0,me.paginatio_=me.pagination?me.pagination:0,me.rowStyleClass&&eval("me.rowStyleClassFunc=function(row){return "+me.rowStyleClass+"}")},beforeUpdate(){var e=this;e.active&&(e.buildColumns(),e.value&&null==e.remoteLoaded&&(e.data=e.value))},updated(){var e=this;e.resizeAfterUpddate&&(e.resize(parseInt(e.$el.style.height)),e.resizeAfterUpddate=0),e.paginatio_=e.pagination?e.pagination:0;var t=e.$el.querySelectorAll(".v-table"),a=e.$el.querySelectorAll(".v-datatable-scrollable-header-box")[0];if(a){var l=e.$el.querySelectorAll(".v-cloned-header");if(0===l.length){l=document.createElement("table");var o=t[0].querySelectorAll("thead")[0],r=0,n=0,i=document.createElement("canvas"),s=window.getComputedStyle(a),d=i.getContext("2d");d.font=s.fontSize+" PTSans";var c=t=>{13===t.keyCode&&(t.preventDefault(),e.load())},u=o.childNodes[0].querySelectorAll("th");e.columns.forEach((e=>{e.filter&&e.filter.elm.querySelectorAll("input").forEach((e=>e.addEventListener("keyup",c)))}));var p,h=new _.HTML2Canvas({lineHeight:parseInt(s.lineHeight),ctx:d});r=0;if(u.forEach(((t,a)=>{t.childNodes[0].onclick=g;var l=e.columns[a-(e.selectable0?1:0)];if(l&&l.filter&&l.filter.elm)if(l.filter.elm.children.forEach)l.filter.elm.children.forEach((e=>t.appendChild(e)));else for(let e of l.filter.elm.children)t.appendChild(e);else if(a>0&&e.hasFilters){var o=document.createElement("input");o.disabled="disabled",o.className="center",t.appendChild(o)}t.clientHeight>n&&(n=t.clientHeight),r+=parseInt(t.width);var i=t.childNodes[0].offsetHeight;i=h.heightText(t.childNodes[0].textContent,parseInt(t.width)),t.childNodes[0].style.width=t.width+"px",t.childNodes[0].style.display="table-cell",t.childNodes[0].style.verticalAlign="middle",i>n&&(n=i)})),u.forEach(((e,t)=>{t&&(e.childNodes[0].style.height=n+"px"),l.appendChild(e)})),u.forEach(((e,t)=>{var a=document.createElement("th");a.width=e.width,o.childNodes[0].appendChild(a)})),t[0].style.width=r+"px",t[0].width=r,t.length>1){t[1].style.width=r+"px",t[1].width=r,t[0].parentNode.style.overflowX="hidden",t[0].parentNode.style.position="relative",t[0].style.position="absolute",t[0].parentNode.style.height="150px",t[1].parentNode.addEventListener("scroll",(e=>{var l=e.currentTarget.scrollLeft;a.style.left="-"+l+"px",t[0].style.left="-"+l+"px"}));var v=t[1].querySelectorAll("td");for(p=0;p<u.length;p++)v[p]&&(v[p].style.width=u[p].width+"px")}else t[0].parentElement.addEventListener("scroll",(e=>{var t=e.currentTarget.scrollLeft;a.style.left="-"+t+"px"}));l.style.width=r+"px";var g=t=>{var a=e.columns[t.target.parentNode.getAttribute("ind")].sort;a==e.sorter&&(e.sortDir=-1*e.sortDir),e.sorter=a};l.className="v-cloned-header v-table",a.appendChild(l),a.appendChild(a.firstChild),a.style.position="absolute",a.style.height=n+37-37+"px",a.parentElement.style.height=a.style.height,e.$el.style.maxHeight&&(a.parentElement.nextElementSibling.style.maxHeight=parseInt(e.$el.style.maxHeight)-n+"px"),o.className="v-head-cloned"}}var m=e.$el.querySelectorAll(".v-check > svg");for(p=0;p<m.length;p++)m[p].dataset.icon=m[p].parentNode.dataset.icon;if(e.loaded){for(var f=e.$el.querySelectorAll(".group"),$=0;$<f.length;$++)f[$].parentNode.removeChild(f[$]);e.$emit("updated",e),e.loaded=0}},filters:{capitalize:e=>e?e.charAt(0).toUpperCase()+e.slice(1):e,rowSelectedCount(){return this.selected.length}},watch:{kc(e){var t=this;setTimeout((function(){t.$emit("updated",t)}),100)}},methods:{buildColumns(){},getRowClass(e,t){var a=[],l=this;return l.selectable&&l.isSelected(e)&&a.push("v-selected"),l.rowStyleClassFunc&&a.push(l.rowStyleClassFunc(t)),a},resize(e){var t=this.$el;setTimeout((()=>{var a=t.querySelector(".v-datatable-header");a&&(e-=a.offsetHeight),(a=t.querySelector(".v-paginator"))&&(e-=a.offsetHeight),(a=t.querySelector(".v-datatable-scrollable-header"))&&(a.style.height=a.querySelector("table").offsetHeight+"px",e-=a.offsetHeight),(a=t.querySelector(".v-table-summary"))&&(e-=a.offsetHeight);const l=(a=t.querySelector(".v-datatable-scrollable-body")).offsetWidth-a.clientWidth;a.style.overflowY="auto",a.style.height=e+"px",(a=t.querySelector(".v-datatable-scrollable-header-box"))&&(a.parentNode.style.marginRight=l+"px"),(a=t.querySelector(".v-table-summary"))&&(a.style.overflowY="hidden",a.style.marginRight=l+"px")}),100)},to(e,t){this.loadP(e,t)},loadP(e,t){var a=this;(a.page!=e||t)&&(a.page=e,a.load())},rowCreated(){},hasSlot(e){return!!this.$slots[e]},sortBy(){},isSelected(e){return this.selected.contains(e)},_selectRow(e,t,a){this.selectable0&&0==_.whichChild(e.target)||this.rowSelect(t,a,1)},rowSelect(e,t,a){var l,o=this;if(-10===t)if(o.filteredData.length===o.selected.length)o.selected=[];else for(o.selected=[],l=0;l<o.filteredData.length;l++)o.selected.push(l);else a?this.selectable0||!o.selected.contains(t)?o.selected=[t]:(o.selected=[],e=null):o.selected.contains(t)?(o.selected.splice(o.selected.indexOf(t),1),e=null):o.selected.push(t);var r=[],n=o.selected.sort(((e,t)=>e-t));for(t=0;n.length>t;t++)r.push(o.data[n[t]]);o.$emit("row-select",{target:o,current:e,selection:r})},async getStoredList(e){let t=new Promise((t=>{var a=window._.db.transaction(e).objectStore(e).getAll();a.onsuccess=function(){t(a.result)}}));try{return await t}catch(t){throw alert(e),t}},async loadStore(){var e,t=this,a=t.store;null!=a&&(window._.db&&(e=await t.getStoredList(a)),e||(e=[]),t.data=t.data?e.concat(t.data):e);return t.data},load(){var e=this;if(this.selected=[],e.value&&(e.data=e.value),e.src){var t=e.src;if(!t)return;t.endsWith("/")&&(t=t.slice(0,t.length-1));var a=e.pagination;if(a&&(t+="/"+(e.page-1)*a+"/"+e.pagination),_.networkStatus.connected){var l;if(e.gql){var o=e.gql,r="query{"+Object.keys(o)[0]+"(offset:"+(e.page-1)*a+" limit:"+e.pagination+"){\ndata{"+o[Object.keys(o)[0]]+"}\nsize\n}\n}";l=axios.post(e.src,{query:r})}else l=axios.get(t,{params:_.clean(e.filters)});l.then((t=>{if(t.data&&t.data.error)MsgBox(t.data.error);else{var l=t.data;e.gql&&(l=t.data.data[Object.keys(e.gql)[0]]),e.data=l.data||l,l&&l.hasOwnProperty("size")&&a&&(e.pages=Math.ceil(l.size/a),e.page>e.pages&&(e.page=1),e.size=l.size),e.loadStore(),e.$emit("loaded",{target:e}),e.$emit("row-select",{}),e.remoteLoaded=1,e.loaded=1,e.kc++}})).catch(e.error)}else{e.data=[];var n=e.loadStore();n.then&&n.then((t=>{e.data=t})),e.$emit("row-select",{target:e})}}else e.data=[],e.loadStore(),e.$emit("loaded",{target:e});e.kc++,e.loaded=1},filter(){alert(12)}},__file:"src/v-table.vue"},script$c={data:()=>({tabs:[],height:0,currentTabIndex:0,k:0}),methods:{load(e){var t=new Event("command",{bubbles:!1});t.name="refresh",t.target=this.$el,this.$el.children[1+this.currentTabIndex].dispatchEvent(t)},reset(){this.load(this.k++)}},watch:{currentTabIndex(e){var t=this,a=t.$el.children[e+1];if(t.$children[e+1],a){console.log("aviso al actual tab q esta seleccionado seltab="+e);var l=new Event("tabChange",{bubbles:!1});l.$target=t,a.dispatchEvent(l),t.$el.style.height=t.height+"px",(l=new Event("parentResize",{bubbles:!1})).height=t.$el.offsetHeight-25,a.style.height=l.height+"px",setTimeout((()=>{a.dispatchEvent(l)}),2)}}},updated(){for(var e=this.$el.children,t=1;t<e.length;t++)e[t].tagName&&(t-1===this.currentTabIndex&&(e[t].style.display="",e[t].style.height=this.$el.offsetHeight-e[0].offsetHeight+"px"),t-1===this.currentTabIndex?e[t].classList.remove("hide"):e[t].classList.add("hide"))},mounted(){for(var e=this,t=e.$el.children,a=1;a<t.length;a++)t[a].style.display="none",e.tabs.push({title:""+t[a].getAttribute("tab")});e.$el.addEventListener("parentResize",(a=>{e.$el.style.height=a.height+1+"px",e.height=a.height+1;var l=new Event("parentResize",{bubbles:!1});l.height=e.$el.offsetHeight-25,l.target=e.$el,l.$target=e;for(var o=1;o<t.length;o++)"none"!=t[o].style.display&&(console.log("Se envia el alto "+l.height),t[o].style.height=l.height+"px",t[o].dispatchEvent(l));e.$emit("resize",l)})),t[1+e.currentTabIndex].setAttribute("active",1);var l=new Event("tabChange",{bubbles:!1});l.$target=e,t[1+e.currentTabIndex].dispatchEvent(l)}};const _hoisted_1$8={class:"v-tab-nav"},_hoisted_2$6=["onClick"];function render$c(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",{class:"v-tabview",style:Vue$1.normalizeStyle({height:o.height+"px"})},[Vue$1.createElementVNode("ul",_hoisted_1$8,[(Vue$1.openBlock(!0),Vue$1.createElementBlock(Vue$1.Fragment,null,Vue$1.renderList(o.tabs,((e,t)=>(Vue$1.openBlock(),Vue$1.createElementBlock("li",{class:Vue$1.normalizeClass({"v-selected":t==o.currentTabIndex}),key:t,onClick:e=>o.currentTabIndex=t},Vue$1.toDisplayString(e.title),11,_hoisted_2$6)))),128))]),Vue$1.renderSlot(e.$slots,"default")],4)}script$c.render=render$c,script$c.__file="src/v-tabview.vue";var script$b={props:{value:{type:String}},data:()=>({}),template:"<textarea>{{value}}</textarea>",updated(){var e=this,t=e.value;t&&e.$el.maxLength>0&&t.length>e.$el.maxLength&&(t=t.substring(0,e.$el.maxLength)),e.$el.value=t,e.$emit("input",t),e.delayedResize()},methods:{resize(){var e=this.$el;e.style.height="auto",e.style.height=e.scrollHeight+"px"},delayedResize(){window.setTimeout(this.resize,100)}},mounted(){var e=this;e.$el.addEventListener("keyup",(()=>{e.$emit("input",e.$el.value)}));var t,a=e.$el;(t=window.attachEvent?function(e,t,a){e.attachEvent("on"+t,a)}:function(e,t,a){e.addEventListener(t,a,!1)})(a,"change",e.resize),t(a,"cut",e.delayedResize),t(a,"paste",e.delayedResize),t(a,"drop",e.delayedResize),t(a,"keydown",e.delayedResize)}};function render$b(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("textarea",null,Vue$1.toDisplayString(a.value),1)}script$b.render=render$b,script$b.__file="src/v-textarea.vue";var script$a={props:{required:null,readonly:null,multiple:null,label:null,disabled:null,autoload:null},data:()=>({autoload_:!0,ik:0,lastLoad:null,data:[],popup:null,show:!1,sel:[],sela:null}),created(){var e=this;e.autoload_=!(e.autoload+""=="false"||1*e.autoload==0)},mounted(){this.internalLoad(),this.updateSelect()},watch:{disabled(e){var t=this.lastLoad,a=this;!e&&t&&(this.$el.disabled=!1,setTimeout((function(){a.load(t[0],t[1])}),50))},readonly(e){let t=this.lastLoad,a=this;!e&&t&&(this.$el.disabled=!1,setTimeout((()=>{a.load(t[0],t[1])}),50))},show(e){if(e){var t=this.$el.childNodes[1];this.popup||(this.popup=this.$el.childNodes[2],this.popup.style.position="absolute",this.popup.style.backgroundColor="white",document.body.append(this.popup));var a=t.getBoundingClientRect();this.popup.style.top=a.bottom+0+"px",this.popup.style.left=a.left+0+"px"}else this.$parent.load&&this.$parent.load()}},updated(){this.updateSelect()},methods:{expand(){console.log("click")},updateSelect(){var e=this,t=e.$attrs.value;null!=t&&t.target&&(t=t.value);var a=e.$el.childNodes[0],l=a.selectedIndex;t&&""!==t||(a.selectedIndex=0);for(var o=0;o<a.length;o++)a[o].value==t&&(a.selectedIndex=o);for(var r=0;r<e.$children.length;r++)if(e.$children[r].getValueByIndex){var n=e.$children[r].getValueByIndex(l-1);e.$children[r].getIndexByValue(t,(function(l,o){if(l>-1){a.selectedIndex=l+1;var i=e.$children[r].getValueByIndex(a.selectedIndex-1);i=-1==i?null:e.$children[r].filterList[a.selectedIndex-1];var s=Number(n);(s=isNaN(s)?n?!!t&&(t.id?t.id==n.id:t==n):!t:s==Number(t))||(e.$el.id&&(console.log("emit input ."+e.$el.id+"="+JSON.stringify(t)),console.log("ffound=",i)),e.$emit("input",t,{value:t,select:a,option:a[a.selectedIndex],target:e,object:i}))}}))}},internalLoad(){var e=this;e.autoload_=!(e.autoload+""=="false"||1*e.autoload==0);let t=e.$attrs.value;null!=t&&t.target&&(t=t.value);var a=e.$el.childNodes[0];t&&""!==t||(a.selectedIndex=0),t=e.$attrs.value;for(let e=0;e<a.length;e++)a[e].value==t&&(a.selectedIndex=e);e.autoload_&&e.load(),e.$emit("mounted",e),e.$on("changed",(function(t){let a=t.querySelectorAll("option"),l=[];for(let e=0;a.length>e;e++)l.push({value:a[e].value,label:a[e].textContent});e.data=l}))},load(e,t){let a=this;a.$children.forEach((a=>{a.load&&a.load(e,t)})),a.disabled||a.readonly?a.lastLoad=[e,t]:a.lastLoad=null},toggle(){this.show=!this.show},selectAll(){for(var e=[],t=0;t<this.data.length;t++)e.push(this.data[t].value);this.sel=e,this.ik++},checkboxInput(){var e=this.sel;e&&e.length&&(e=e.join(",")),this.$emit("input",e)},onChange(e){var t=this,a=this.$el.childNodes[0];e&&""!==e||(e=null,a.selectedIndex=0);for(var l,o=0,r=0;r<t.$children.length;r++){if(-1!=(o=t.$children[r].getValueByIndex(a.selectedIndex-1))){l=t.$children[r].filterList[a.selectedIndex-1];break}o=0}o?e=o:t.$children.length&&(a.selectedIndex=0),t.$emit("input",e,{value:e,select:a,option:a[a.selectedIndex],target:t,object:l})}}};const _hoisted_1$7={class:"v-select",style:{position:"relative"}},_hoisted_2$5=["required","disabled","click"],_hoisted_3$3={style:{padding:"5px",border:"1px solid lightgray"}},_hoisted_4$2={class:"_ ui-widget ui-state-default ui-corner-all",style:{padding:"5px 5px 1px 5px","margin-bottom":"5px"}};function render$a(e,t,a,l,o,r){const n=Vue$1.resolveComponent("v-checkbox"),i=Vue$1.resolveComponent("v-checkbox-group");return Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$7,[a.readonly?Vue$1.createCommentVNode("v-if",!0):Vue$1.withDirectives((Vue$1.openBlock(),Vue$1.createElementBlock("select",{key:0,style:{width:"100%"},onChange:t[0]||(t[0]=e=>r.onChange(e.target.value)),required:a.required,disabled:a.disabled,click:r.expand},[Vue$1.renderSlot(e.$slots,"default")],40,_hoisted_2$5)),[[Vue$1.vShow,!a.multiple]]),a.multiple?(Vue$1.openBlock(),Vue$1.createElementBlock(Vue$1.Fragment,{key:1},[Vue$1.createElementVNode("div",{class:Vue$1.normalizeClass(["v-widget-header",{"v-selected":o.show}]),style:{"padding-top":"3px","padding-bottom":"3px"},onClick:t[1]||(t[1]=(...e)=>r.toggle&&r.toggle(...e))}," ",2),Vue$1.withDirectives(Vue$1.createElementVNode("div",_hoisted_3$3,[Vue$1.createElementVNode("div",_hoisted_4$2,[Vue$1.createVNode(n,{modelValue:o.sela,"onUpdate:modelValue":t[2]||(t[2]=e=>o.sela=e),onInput:r.selectAll},null,8,["modelValue","onInput"])]),(Vue$1.openBlock(),Vue$1.createBlock(i,{key:"p"+o.ik,modelValue:o.sel,"onUpdate:modelValue":t[3]||(t[3]=e=>o.sel=e),onInput:r.checkboxInput},{default:Vue$1.withCtx((()=>[o.data.length?(Vue$1.openBlock(!0),Vue$1.createElementBlock(Vue$1.Fragment,{key:0},Vue$1.renderList(o.data,(e=>(Vue$1.openBlock(),Vue$1.createElementBlock("div",null,[Vue$1.createVNode(n,{value:e.value,label:e.label},null,8,["value","label"])])))),256)):Vue$1.createCommentVNode("v-if",!0)])),_:1},8,["modelValue","onInput"]))],512),[[Vue$1.vShow,o.show]])],64)):Vue$1.createCommentVNode("v-if",!0),a.readonly?(Vue$1.openBlock(),Vue$1.createElementBlock(Vue$1.Fragment,{key:2},[Vue$1.createTextVNode(Vue$1.toDisplayString(a.label?a.label:"---"),1)],64)):Vue$1.createCommentVNode("v-if",!0)])}script$a.render=render$a,script$a.__file="src/v-select.vue";var script$9={props:{value:{value:Object}},data:()=>({options:["NO","SI"],selected:null}),mounted(){var e=this,t=""+e.value;e.selected="true"===t?"SI":"false"===t?"NO":null,e.$emit("input",e.value)},updated(){var e=this,t=""+e.value;e.selected="true"===t?"SI":"false"===t?"NO":null,e.$emit("input",e.value)},methods:{onChange(e){this.selected=e,this.$emit("input","SI"===e||"NO"!==e&&null)}}};const _hoisted_1$6=["value","data-value"],_hoisted_2$4=["onClick"];function render$9(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",{value:!1===a.value?"false":a.value,"data-value":""+a.value},[(Vue$1.openBlock(!0),Vue$1.createElementBlock(Vue$1.Fragment,null,Vue$1.renderList(o.options,(e=>(Vue$1.openBlock(),Vue$1.createElementBlock("div",{onClick:t=>r.onChange(e),style:Vue$1.normalizeStyle("cursor:pointer;border: 1px solid #000;text-align:center;display:inline-block;width:calc(50% - 2px)"+(e===o.selected?"":";opacity: 0.5")),class:Vue$1.normalizeClass({"v-selected":e==o.selected})},Vue$1.toDisplayString(e),15,_hoisted_2$4)))),256))],8,_hoisted_1$6)}script$9.render=render$9,script$9.__file="src/v-switch.vue";var script$8={props:{delay:null},data:()=>({v:null}),created(){this.v=this.value},methods:{input(){var e=this,t=e.$el,a=e.v,l=Vue.n;if(a){a=l(a),e.max&&a>l(e.max)&&(a=l(e.max)),e.min&&a<l(e.min)&&(a=l(e.min));var o=t.getAttribute("decimal");null!==o&&(a=a.toFixed(1*o))}else a=null;a=event.target.value;var r=Vue.calendarTimer;r&&clearTimeout(r),e.delay?Vue.calendarTimer=setTimeout((function(){e.$emit("input",a),Vue.calendarTimer=null}),13===event.keyCode?0:e.delay):e.$emit("input",a)}}};function render$8(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("input",{type:"number",onKeyup:t[0]||(t[0]=Vue$1.withKeys(((...e)=>r.input&&r.input(...e)),["enter"])),"vmodel.number":"v",onInput:t[1]||(t[1]=(...e)=>r.input&&r.input(...e)),class:"_"},null,32)}script$8.render=render$8,script$8.__file="src/v-number.vue";var script$7={props:{url:String,src:String,displayField:String,data:Array,store:null,valueField:String,filters:null,filter:null,mode:null},watch:{data(){this.$parent.updateSelect()}},data:()=>({queue:[],data2:[],valueField_:[],lastLoad:null,loaded:null}),computed:{filterList(){var e=this;return e.data2&&e.filter?e.data2.filter((t=>-1!==JSON.stringify(t).toLowerCase().indexOf(e.filter.toLowerCase()))):e.data2}},created(){var e=this;e.data&&(e.data2=e.data)},updated(){let e=this;!e.loaded&&e.data&&(e.data2=e.data);let t=e.$el.parentElement;for(;e.$el.childNodes.length>0;)t.appendChild(e.$el.childNodes[0]);e.$parent.$emit("changed",t),e.$parent.updateSelect()},mounted(){var e=this;e.valueField&&(e.valueField_=e.valueField.split(".")),e.$parent&&e.$parent.updateSelect()},methods:{getParentE(){return this.$el.parentElement.parentElement},getIndexByValue(e,t){e&&e.id?e=e.id:e&&e.code&&(e=e.code);for(var a=0;a<this.filterList.length;a++)if(this.getValueField(this.filterList[a])==e)return t&&t(a),a;return t&&t(-1),-1},getValueByIndex(e){var t=this.filterList;return t?this.getValueField(t[e],1):null},getValueField(e,t){var a=this.valueField_;if(a&&a.length)for(var l=0;l<a.length;l++)e&&(e=e[a[l]]);else e&&!t&&(e=e.id?e.id:e.code?e.code:e);return e},getSelectedItem(){var e=this.$el.parentElement;return this.filterList[e.selectedIndex-1]},async load(e,t,a){let l=this;if(a||l.queue.push([e,t]),l.queue.length>1)return;let o=l.$el.parentElement;if(l.data2=l.data,l.data2||(l.data2=[]),l.store){console.log(l);let t=await l.$root.$children[0].getStoredList(l.store,e);const[a]=e?Object.keys(e):[];if(a)try{var r,n=t.filter((t=>(r=t,this.getParentE().id&&console.log(t[a]+" c "+e[a]+" = "+t[a].startsWith(e[a])),t[a].startsWith(e[a]))));l.data2=l.data2.concat(n)}catch(e){console.log("Error trying to filter ",r),console.error(e)}else l.data2=l.data2.concat(t);var i=l.displayField;l.data2=l.data2.sort((function(e,t){return e[i]>t[i]?1:e[i]<t[i]?-1:void 0}))}for(!l.url&&!l.src||o.disabled||(l.data2||(l.data2=[]),l.filters&&(e=window.Vue.mergeDeep(e||{},l.filters)),await window.axios.get(l.url?l.url:l.src,{params:e}).then((e=>{var a=e.data.data?e.data.data:e.data;l.$emit("loaded",{target:l,data:a}),l.data2=l.data2.concat(a),l.loaded=1,l.$parent.$forceUpdate(),t&&t()})).catch((()=>{}))),a||l.queue.shift();l.queue.length;){var s=l.queue.shift();await l.load(s[0],s[1],1)}}}};const _hoisted_1$5=["title"],_hoisted_2$3=["value"];function render$7(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",{title:a.data?a.data.length:0},[(Vue$1.openBlock(!0),Vue$1.createElementBlock(Vue$1.Fragment,null,Vue$1.renderList(r.filterList,((t,l)=>(Vue$1.openBlock(),Vue$1.createElementBlock("option",{key:l,value:r.getValueField(t)},[Vue$1.createTextVNode(Vue$1.toDisplayString(t[a.displayField])+" ",1),Vue$1.renderSlot(e.$slots,"default",{item:t})],8,_hoisted_2$3)))),128))],8,_hoisted_1$5)}script$7.render=render$7,script$7.__file="src/v-options.vue";var script$6={props:{value:String,onlyicon:Boolean,click:null,icon:String,domain:String},mounted(){var e=this;setTimeout((function(){e.$el.querySelector("svg").dataset.icon="image"}),1e3)},updated(){var e=this;setTimeout((function(){e.$el.querySelector("svg").dataset.icon="image"}),1e3)},data:()=>({uploadPercentage:0,showProgress:!1}),methods:{other(){this.click&&this.click(this)},handleFileUpload(){this.uploadPercentage=0,this.submitFile(this.$el.children[0].children[0].files[0])},submitFile(e,t){var a=this,l=new FormData;t=t||e.name.replace(/[^\w\s.]/gi,""),l.append("filename",t),l.append("file",e,t),a.showProgress=!0,axios.post((a.domain?a.domain:"")+"/api/file/upload",l,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(e){this.uploadPercentage=parseInt(Math.round(e.loaded/e.total*100))}.bind(this)}).then((function(e){a.$emit("input",e.data),a.showProgress=!1})).catch((function(){console.log("FAILURE!!")}))}}};const _hoisted_1$4={style:{cursor:"pointer"},class:""},_hoisted_2$2=["data-icon"],_hoisted_3$2=[".value"];function render$6(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",{onClick:t[1]||(t[1]=(...e)=>r.other&&r.other(...e)),class:Vue$1.normalizeClass([a.onlyicon?"":"v-button ui-widget ui-state-default ui-corner-all","v-uploader"]),style:Vue$1.normalizeStyle({padding:a.onlyicon?"0px":""})},[Vue$1.createElementVNode("label",_hoisted_1$4,[a.click?Vue$1.createCommentVNode("v-if",!0):(Vue$1.openBlock(),Vue$1.createElementBlock("input",{key:0,type:"file",onChange:t[0]||(t[0]=e=>r.handleFileUpload())},null,32)),Vue$1.createElementVNode("i",{class:Vue$1.normalizeClass(["fa",a.icon?a.icon:"fa-upload"]),"data-icon":a.icon,style:Vue$1.normalizeStyle({marginRight:a.onlyicon||""==a.value?"":"10px"})},null,14,_hoisted_2$2),Vue$1.createTextVNode(Vue$1.toDisplayString(a.onlyicon?"":null!=a.value?a.value:"Adjuntar Archivo")+" ",1),o.showProgress?(Vue$1.openBlock(),Vue$1.createElementBlock("progress",{key:1,max:"100",style:{width:"100%"},".value":o.uploadPercentage},null,40,_hoisted_3$2)):Vue$1.createCommentVNode("v-if",!0)])],6)}script$6.render=render$6,script$6.__file="src/v-uploader.vue";var script$5={props:{header:String}};const _hoisted_1$3={class:"ui-panel"},_hoisted_2$1={key:0,class:"v-panel-titlebar v-widget-header ui-helper-clearfix ui-corner-all"},_hoisted_3$1={class:"v-panel-title"},_hoisted_4$1={class:"v-panel-content v-dialog-content v-widget-content"};function render$5(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$3,[a.header?(Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_2$1,[Vue$1.createElementVNode("span",_hoisted_3$1,Vue$1.toDisplayString(a.header),1)])):Vue$1.createCommentVNode("v-if",!0),Vue$1.createElementVNode("div",_hoisted_4$1,[Vue$1.renderSlot(e.$slots,"default")])])}script$5.render=render$5,script$5.__file="src/v-panel.vue";var script$4={data:()=>({loaded:null,map:null,feature2:null,district:null,pl:null,selection:null,dl:null,scope:null,lastScope:null,unmove:null}),methods:{setScope(e,t){var a=this,l=a.map;if(console.log("me.map="+a.map),e!=a.lastScope)if(e<100&&(e*=1e4),a.scope=e,0==a.scope)l.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],l.getSize()),a.lastScope=e,l.getLayerById("districts").getSource().clear(),a.$emit("scope",{feature:{getId:()=>null},target:a});else if(l){if(e>9999){for(var o=l.getLayerById("districts"),r=o.getSource().getFeatures(),n=0;n<r.length;n++)if(1*r[n].id_==e){o.onChange({feature:r[n]});break}}else if(e){var i=l.getLayerById("provinces");for(e=1*(e.value?e.value:e),r=i.getSource().getFeatures(),n=0;n<r.length;n++)if(1*r[n].id_==e){i.onChange({feature:r[n]});break}}}else a.lastScope=e;else l.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],l.getSize())}},created(){var e=this;return e.$parent.$on("build",(t=>{var a=document.createElement("i"),l=t.map;e.selection=new ol.Collection;var o=e.selection;a.setAttribute("class","fa fa-expand"),l.addControl(new ol.control.FullScreen({label:a,tipLabel:"Fullscreen"}));var r=new ol.source.Vector({url:(axios.defaults.baseURL?axios.defaults.baseURL:"")+"/fs/geo/02.geojson",format:new ol.format.GeoJSON}),n=e.pl=new ol.layer.Vector({source:r,style:e=>new ol.style.Style({fill:new ol.style.Fill({color:"rgba(255, 0, 0, 0.0)"}),stroke:new ol.style.Stroke({color:"#4073CE",width:1}),text:new ol.style.Text({text:e.values_.name?e.values_.name.toUpperCase():"",fill:new ol.style.Fill({color:"#4073CE"}),stroke:new ol.style.Stroke({color:"#4073CE",width:.5})})}),id:"provinces"}),i=r.on("change",(()=>{var t=e.scope;t>9999&&(t=Math.floor(t/100));for(var a=r.getFeatures(),l=0;l<a.length;l++)if(1*a[l].id_==1*t){n.onChange({feature:a[l]});break}Observable.unByKey(i)})),s=new ol.layer.Vector({preload:1/0,source:new ol.source.Vector,id:"districts",style:e=>new ol.style.Style({fill:new ol.style.Fill({color:"rgba(16, 110, 138, 0.0)"}),stroke:new ol.style.Stroke({color:"#194300",width:1}),text:new ol.style.Text({text:e.values_.name?e.values_.name.toUpperCase():"",fill:new ol.style.Fill({color:"#194300"}),stroke:new ol.style.Stroke({color:"#194300",width:.5})})})}),d=()=>{if(e.feature2){if(e.feature2.id_<1e4){s.setSource(new ol.source.Vector({url:(axios.defaults.baseURL?axios.defaults.baseURL:"")+"/fs/geo/"+e.feature2.id_+".geojson",format:new ol.format.GeoJSON}));var t=s.getSource().on("change",(()=>{if(e.scope>0)for(var a=s.getSource().getFeatures(),l=e.scope,o=0;o<a.length;o++)if(1*a[o].id_==l){e.scope=0,s.onChange({feature:a[o]});break}Observable.unByKey(t)}))}console.log("emit scopee "+e.feature2.id_),e.$emit("scope",{feature:e.feature2,target:e}),e.feature2=null,console.log("layer moveend termina")}};l.on("moveend",d),n.onChange=t=>{var a=t.feature;e.lastScope!=a.getId()&&(o.clear(),o.push(a),t.preventDefault&&t.preventDefault(),e.lastScope=a.getId(),e.feature2=a,e.unmove?d():l.getView().fit(a.getGeometry().getExtent(),{duration:300}))},n.onSelect=t=>{e.$emit("select",t)},l.addLayer(n),l.addLayer(new ol.layer.Vector({id:"district",source:new ol.source.Vector,style:new ol.style.Style({fill:new ol.style.Fill({color:"rgba(255, 150, 150, 0.0)"}),stroke:new ol.style.Stroke({color:"#4073CE",width:1})})})),new ol.style.Style({fill:new ol.style.Fill({color:"rgba(16, 110, 138, 5.0)"})}),new ol.style.Style({fill:new ol.style.Fill({color:"rgba(255, 150, 150, 0.0)"})}),s.onChange=t=>{var a=t.feature;e.lastScope!=a.getId()&&(2==o.getLength()&&o.pop(),o.push(a),t.preventDefault&&t.preventDefault(),e.lastScope=a.getId(),e.feature2=a,e.unmove?d():l.getView().fit(a.getGeometry().getExtent(),{duration:300}))},s.onSelect=t=>{e.$emit("select",t)},l.addLayer(s),e.map=l,e.$emit("render",e)})),null}};function render$4(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",null,[Vue$1.renderSlot(e.$slots,"default")])}script$4.render=render$4,script$4.__file="src/v-layer-control.vue";var script$3={mounted(){this.$emit("beforeBuild"),this.build()},data:()=>({moved:!1,map:null,movingCompleted:null,collection:null,styleMap:null,coordinate:{}}),methods:{addLayer(e){this.map.addLayer(e),this.$emit("addlayer",e)},urlParam(e,t){t||(t=window.location.href);var a=new RegExp("[?&]"+e+"=([^&#]*)").exec(t);return a&&a[1]||0},addFeature(e,t){e=e||{};var a,l=this,o=l.map;if(e.lon&&e.lat){var r=[e.lon,e.lat];a=new ol.geom.Point(r[0]>-100?ol.proj.fromLonLat(r):r)}else a=new ol.geom.Point(o.getView().getCenter());r=(r=a.flatCoordinates)[0]<-1e4?ol.proj.toLonLat(r):r;l.$emit("translateend",{lon:r[0],lat:r[1]}),e.geometry=a;var n=new ol.Feature(e);if(n.data=e,e.draggable){var i=new ol.Collection;i.push(n);var s=new ol.interaction.Translate({features:i});s.on("translateend",(e=>{var t=ol.proj.toLonLat(e.coordinate);l.$emit("translateend",{lon:t[0],lat:t[1]})})),s.on("translatestart",(e=>{l.selectedFeature=e.features.getArray()[0]})),n.interactionCollection=i,l.map.addInteraction(s)}if("object"==typeof e.style?n.setStyle(e.style):n.setStyle(l.styleMap[e.style?e.style:"default"]),r=(r=a.flatCoordinates)[0]<-1e4?ol.proj.toLonLat(r):r,l.$emit("translateend",{lon:r[0],lat:r[1]}),null!=e.layer){var d=o.getLayerById(e.layer);d?d.getSource().addFeatures(n):o.addLayer(new ol.layer.Vector({id:e.layer,source:new ol.source.Vector({features:new ol.Collection([n])})}))}else l.collection.push(n);return t&&(console.log(n.getGeometry().getCoordinates()),l.map.getView().animate(Object.assign({center:n.getGeometry().getCoordinates(),zoom:17,duration:500},t))),n},animate(e){this.map.getView().animate(e),this.movingCompleted=e.complete},build(){var e=this;e.styleMap={default:new ol.style.Style({image:new ol.style.Circle({radius:8,stroke:new ol.style.Stroke({color:"#8a0000",width:2}),fill:new ol.style.Fill({color:"#ff0000"})})}),star:[new ol.style.Style({image:new ol.style.RegularShape({fill:new ol.style.Fill({color:"#ff0000"}),stroke:new ol.style.Stroke({color:"#8a0000",width:2}),points:5,radius:10,radius2:4,angle:0})})]};var t=e.urlParam("location"),a=-1;if(t){var l=t.split("/");t=[parseFloat(l[0]),parseFloat(l[1])],a=l[2],e.moved=!0}else t=!1;var o=new ol.Map({target:e.$el,layers:[new ol.layer.Tile({source:new ol.source.OSM({})})],view:new ol.View({})});o.getLayerById=function(e){var t;return o.getLayers().forEach((a=>{a.get("id")!==e||(t=a)})),t},o.styleMap=e.styleMap,o.addLayer(new ol.layer.Vector({source:new ol.source.Vector({features:e.collection=new ol.Collection})})),e.moved?(o.getView().setCenter(t),console.log("en el momento de cargar moved to pageLocation="+t),o.getView().setZoom(a||12),e.map=o,console.log("distarar evento buid pageLocation="+t),e.$emit("build",e)):(console.log("En caso no exista una coordenada se usara se fijara a los limites de la region"),_.getCurrentPosition().then((t=>{o.getView().setCenter(ol.proj.fromLonLat([t.coords.longitude,t.coords.latitude])),o.getView().setZoom(12),e.map=o,e.$emit("build",e)}),(t=>{o.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],o.getSize()),e.map=o,e.$emit("build",e)})));var r=o.getView().getZoom();o.on("moveend",(t=>{this.movingCompleted&&(this.movingCompleted(e),this.movingCompleted=null);var a=o.getView().getZoom();r!=a&&(r=a,e.$children.forEach((function(e){e.$vnode.tag.endsWith("v-overlay")&&e.$emit("zoom",a)})))})),o.on("singleclick",(e=>{var t=o.forEachFeatureAtPixel(e.pixel,((e,t)=>{if(t)return[e,t]}));if(t){var a=t[1];t=t[0];if(e.feature=t,e.map=o,e.preventDefault(),a.onSelect)return void a.onSelect(e)}})),o.on("dblclick",(t=>{var a=o.forEachFeatureAtPixel(t.pixel,((e,t)=>{if(t)return[e,t]}));if(a){var l=a[1];a=a[0];if(t.feature=a,t.map=o,l.onChange)return console.log("dbclick manda event onchangue"),void l.onChange(t);e.$emit("change",a),o.getView().animate({center:a.getGeometry().getCoordinates(),zoom:17,duration:500},(()=>{for(var a=0;a<e.$children.length;a++){var l=e.$children[0];l.open&&l.open(t)}}))}})),o.getViewport().parentNode.addEventListener("parentResize",(t=>{setTimeout((()=>{o.updateSize(),e.$emit("resize",o)}),100)})),Vue.resize()}}};function render$3(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",null,[Vue$1.renderSlot(e.$slots,"default")])}script$3.render=render$3,script$3.__file="src/v-map.vue";var script$2={props:{icon:String,visible:{default:1}},computed:{slotPassed(){return!!this.$slots.default}},data:()=>({ready:null,visible0:null,slotUsed:!1}),updated(){var e=this.$el.querySelectorAll(":scope > :not(.v-map-control-button)").length;0==e&&(e=this.$el.textContent.trim().length),this.slotUsed=e},created(){this.visible0=!!this.visible},mounted(){var e=this;e.slotUsed=!!this.$slots.default,e.$parent.map?(e.$parent.map.addControl(new ol.control.Control({element:e.$el})),e.ready=!0):e.$parent.$on("build",(t=>{t.map.addControl(new ol.control.Control({element:e.$el})),e.ready=!0}))},methods:{enter(e){e.x&&this.$emit("click",e)},toggle(){this.visible0=!this.visible0}}};const _hoisted_1$2={class:"ol-unselectable ol-control"};function render$2(e,t,a,l,o,r){return Vue$1.withDirectives((Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$2,[Vue$1.renderSlot(e.$slots,"default"),o.slotUsed?Vue$1.createCommentVNode("v-if",!0):(Vue$1.openBlock(),Vue$1.createElementBlock("button",{key:0,class:"v-map-control-button",onClick:t[0]||(t[0]=Vue$1.withModifiers(((...e)=>r.enter&&r.enter(...e)),["prevent"]))},[a.icon?(Vue$1.openBlock(),Vue$1.createElementBlock("i",{key:0,class:Vue$1.normalizeClass(["fa fa-xs",a.icon])},null,2)):Vue$1.createCommentVNode("v-if",!0)]))],512)),[[Vue$1.vShow,o.ready&&o.visible0]])}script$2.render=render$2,script$2.__file="src/v-map-control.vue";var ol$1=window.ol,_$2=window._,axios$1=window.axios,script$1={props:{value:{value:Object},src:String,width:{default:400},header:String},data:()=>({coordinate:null,overlay:null,location:null,ele:null,c:0}),created(){var e=this;e.$parent.$on("beforeBuild",(t=>{console.log(t),e.overlay=new ol$1.Overlay({element:e.$el,positioning:"bottom-right"})})),e.$parent.$on("build",(t=>{t.map.addOverlay(e.overlay)}))},mounted(){var e=this;e.header&&e.$el.childNodes[0].addEventListener("mousedown",(function(t){const a=e.$el.parentElement;var l=window.getComputedStyle(a),o=parseFloat(l.left),r=parseFloat(l.top),n=t.clientX,i=t.clientY,s=a.parentElement;function d(e){a.style.left=o+e.clientX-n+"px",a.style.top=r+e.clientY-i+"px"}s.addEventListener("mousemove",d,!1),s.addEventListener("mouseup",(function(){s.removeEventListener("mousemove",d,!1)}),!1)}),!1)},methods:{close(){this.overlay&&this.overlay.setPosition()},hasSlot(e="default"){return!!this.$slots[e]||!!this.$scopedSlots[e]},load(){var e=this;axios$1.get(_$2.remoteServer+e.src).then((t=>{e.$emit("input",t.data)}))},open(e){for(var t=this,a=e.map,l=e.feature,o=t.overlay,r=o.element,n=t.$parent.$children,i=0;i<n.length;i++)n[i].close&&(n[i].$el.style.opacity=0,n[i].close());e.coordinate?t.coordinate=e.coordinate:(e.coordinate=a.getView().getCenter(),t.coordinate=null),o.setPosition(e.coordinate);var s=a.getView().getCenter(),d=a.getView().getResolution(),c=l?l.getGeometry().getCoordinates():[null],u=a.getPixelFromCoordinate(Number(c[0])?c:e.coordinate);if(this.src)axios$1.get(_$2.remoteServer+this.src).then((e=>{t.$emit("input",e.data),t.c++,setTimeout((function(){var e=a.viewport_.offsetWidth,l=a.viewport_.offsetHeight,n=r.children[0].children[1];n.scrollTop=0;var i=r.offsetHeight;n.style.height=i+100>=l?l-100-r.children[0].children[0].offsetHeight+"px":"300px",i=r.offsetHeight;var c=1*t.width,p=e<=c+40?e-40:c;if(r.style.zIndex=10,r.style.width=p+"px",p/=2,a.getView().animate({center:[s[0]+(u[0]+p+20>=e?+(u[0]+p+20-e):u[0]-20-p<0?-p+u[0]-20:0)*d,s[1]+(u[1]<i?i-u[1]:0)*d],duration:500}),u[0]=u[0]+p-0,u[1]=u[1]-12,o.setPosition(a.getCoordinateFromPixel(u)),t.$el.style.opacity=1,_$2.mobil)for(var h=o.getElement().querySelectorAll("a:not(._)"),v=0;v<h.length;v++)h[v].addEventListener("click",_$2.open2)}),400)})).catch((e=>{console.log(e)}));else{var p=a.viewport_.offsetWidth,h=a.viewport_.offsetHeight,v=r.children[0].children[1];v.scrollTop=0;var g=r.offsetHeight;console.log(r.offsetHeight),v.style.height=g+100>=h?h-100-r.children[0].children[0].offsetHeight+"px":"300px",g=r.offsetHeight;var m=1*t.width,f=p<=m+40?p-40:m;if(r.style.zIndex=10,r.style.width=f+"px",f/=2,a.getView().animate({center:[s[0]+(u[0]+f+20>=p?+(u[0]+f+20-p):u[0]-20-f<0?-f+u[0]-20:0)*d,s[1]+(u[1]<g?g-u[1]:0)*d],duration:500}),u[0]=u[0]+f-0,u[1]=u[1]-12,o.setPosition(a.getCoordinateFromPixel(u)),t.$el.parentNode.style.opacity=0,t.$el.style.opacity=1,t.$el.parentNode.style.top=(h-t.$el.offsetHeight)/2+"px",t.$el.parentNode.style.opacity=1,_$2.mobil){var $=o.getElement().querySelectorAll("a:not(._)");for(i=0;i<$.length;i++)$[i].addEventListener("click",_$2.open2)}t.$emit("opened",{target:t})}}}};const _hoisted_1$1={class:"v-ol-overlay"},_hoisted_2={key:0,class:"v-panel-titlebar"},_hoisted_3=Vue$1.createElementVNode("i",{class:"fa fa-times"},null,-1),_hoisted_4=[_hoisted_3],_hoisted_5={key:2,style:{"text-align":"center"}},_hoisted_6=Vue$1.createElementVNode("img",{src:_imports_0,width:"20",height:"18"},null,-1),_hoisted_7=[_hoisted_6];function render$1(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$1,[a.header?(Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_2,[Vue$1.createElementVNode("span",{class:"v-icon v-icon-close",onClick:t[0]||(t[0]=(...e)=>r.close&&r.close(...e))},[..._hoisted_4]),Vue$1.createTextVNode(Vue$1.toDisplayString(a.header),1)])):Vue$1.createCommentVNode("v-if",!0),(Vue$1.openBlock(),Vue$1.createElementBlock("div",{class:"v-ol-body",key:"c-"+o.c,style:{padding:"10px"}},[a.value?Vue$1.renderSlot(e.$slots,"default",{key:0,value:a.value}):Vue$1.createCommentVNode("v-if",!0)])),r.hasSlot("footer")&&a.value?(Vue$1.openBlock(),Vue$1.createElementBlock("footer",{key:"f-"+o.c},[Vue$1.renderSlot(e.$slots,"footer",{value:a.value})])):Vue$1.createCommentVNode("v-if",!0),o.coordinate?(Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_5,[..._hoisted_7])):Vue$1.createCommentVNode("v-if",!0)])}script$1.render=render$1,script$1.__file="src/v-overlay.vue";var script={data:()=>({show:null,overlay:null}),mounted(){var e=this;e.$el.addEventListener("close",(function(){e.hide()}))},destroyed(){var e=this.overlay;e&&(e.style.visibility="hidden",e.style.opacity=0,e.remove(),e=null)},methods:{hide(){var e=this.overlay;e&&(e.style.visibility="hidden",e.style.opacity=0),this.show=0},toggle(){var e=this;e.show=!e.show;var t=e.overlay;if(e.show){var a=document.querySelector(".v-layout-north");e.$el.style.top=a.offsetHeight+"px",console.log(e.$el),t||((t=document.createElement("div")).classList.add("v-overlay"),t.style.padding="40px",t.addEventListener("click",(function(){t.style.visibility="hidden",t.style.opacity=0,e.show=!1})),document.body.appendChild(e.overlay=t)),t.style.visibility="unset",t.style.opacity="unset"}else this.hide()}}};const _hoisted_1={class:"v-popup",style:{position:"absolute"}};function render(e,t,a,l,o,r){return Vue$1.withDirectives((Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1,[Vue$1.renderSlot(e.$slots,"default")],512)),[[Vue$1.vShow,o.show]])}script.render=render,script.__file="src/v-popup.vue",window.isMobile=1,void 0===window._&&(window._={});var _$1=window._;_$1.instance||(_$1.instance=axios$2);var instance=_$1.instance;Vue$1.config.ignoredElements=[...Vue$1.config.ignoredElements||[],"v-filter","v-footer"],Vue$1.n=e=>e=e?""==e?null:Number(""+e):0,"function"!=typeof JSON.clone&&(JSON.clone=function(e){return JSON.parse(JSON.stringify(e))}),"function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),a=1;a<arguments.length;a++){var l=arguments[a];if(null!=l)for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(t[o]=l[o])}return t});let buildPopupMenu=function(e){var t=e.getAttribute("v--popup");if(!t){e.setAttribute("v--popup",t=_$1.id());var a=_$1.storeFunction[t],l=e.querySelectorAll(".v-datatable-header .v-button");l&&l.length&&!a&&window.innerWidth<=700&&setTimeout((function(){(a=document.createElement("ul")).className="v-popup-2",a.style.backgroundColor="white",a.style.position="absolute",a.style.bottom="0px",a.style.fontSize="26px",a.style.right="0px",a.style.display="none",a.style.width="200px",a.style.zIndex="12000",e.appendChild(a);var o=null,r=function(){a.style.display="none";var e=this.getAttribute("commandId"),t=document.querySelector("#"+e);"BUTTON"==t.tagName?t.click():t.children[0].click(),_$1.unmask(o)};e.style.position="relative";var n=document.createElement("div");n.className="v-mobil v-table-buttons";var i=document.createElement("i");i.className="fa fa-bars fa-w-14",n.appendChild(i),n.onclick=function(){for(l=e.querySelectorAll(".v-datatable-header .v-button");a.firstChild;)a.removeChild(a.firstChild);for(i=0;i<l.length;i++)if("none"!=l[i].style.display){var t=document.createElement("li");if(l[i].id||(l[i].id="c-"+_$1.id()),t.setAttribute("commandId",l[i].id),"BUTTON"==l[i].tagName){if(l[i].disabled)continue;t.appendChild(l[i].children[0].cloneNode(!0)),t.appendChild(document.createTextNode(l[i].value?l[i].value:l[i].title))}else l[i].children[0].children[1]&&(t.appendChild(l[i].children[0].children[1]),t.appendChild(document.createTextNode(l[i].textContent)));t.onclick=r,a.appendChild(t)}o=_$1.mask(a),a.style.display="block",o.onclick=function(){a.style.display="none",_$1.unmask(o)}},e.appendChild(n),_$1.storeFunction[t]=a}),1e3)}},resize=function(){console.log("Vue.resize2");var e=window.innerHeight;document.body.children[0].style.height=e+".px";var t=document.querySelectorAll("#page-header,.ui-layout-north,.v-layout-north,.ion-page >ion-header");t=t[0];var a,l=document.querySelectorAll(".ion-page >ion-header + .ui-panel,#page-content,.ui-layout-pane-center,.v-layout-center ,.ion-page > ion-content");if(l&&l[0]){var o,r;if("ION-CONTENT"==l[0].nodeName){var n;if(o=l[0].children[0],e=e-t.offsetHeight-0,o.style.height=e+"px",o.style.overflowY="auto",o.classList.contains("ui-panel")||(o=o.children[0]),(n=new Event("parentResize",{bubbles:!0})).height=e,o.dispatchEvent(n),o.children[1]){var i=o.children[1];"FORM"==i.children[0].tagName&&(i=i.children[0].children[0]),buildPopupMenu(i)}return}if("DIV"==l[0].nodeName)return o=l[0],console.log("==========DIV============"),console.log(o),o.style.height=e+"px",o.style.overflowY="auto",e=e-t.offsetHeight-0,o.classList.contains("ui-panel")||(o=o.children[0]),(n=new Event("parentResize",{bubbles:!0})).height=e,o.dispatchEvent(n),void(o.children[1]&&buildPopupMenu(o.children[1]));if(l[0].style.height=e-t.offsetHeight-2+"px",l[0].style.overflowY="auto",o=l[0].querySelector(".ui-panel"),console.log("==========ppp============"),console.log(o),o){if(l=o.children,t&&(e-=t.offsetHeight+l[0].offsetHeight+2),l[1]){console.log(l[1]),l[1].style.height=e+"px";var s=l[1].querySelectorAll(".v-resize,.v-datatable");for(r=0;r<s.length;r++){var d=new Event("parentResize",{bubbles:!0});d.height=e,s[r].dispatchEvent(d)}}}else{if(console.log(l[0]),!l[0].children[0])return;console.log(e);var c=l[0].children;for(r=0;r<c.length;r++){var u=new Event("parentResize",{bubbles:!0});u.height=e,c[r].dispatchEvent(u)}c=l[0].children[0].children;var p=[];for(r=0;r<c.length;r++)a=c[r],"none"!==window.getComputedStyle(a).display&&p.push(c[r]);1==p.length&&(p[0].style.overflowY="auto")}}else{var h=document.querySelectorAll(".ion-page");if(h[0]){console.log("?????????????");for(var v=0,g=0;g<h[0].childNodes.length;g++)"ION-HEADER"!=h[0].childNodes[g].nodeName&&"ION-FOOTER"!=h[0].childNodes[g].nodeName||(v+=h[0].childNodes[g].offsetHeight);var m=0;for(g=0;g<h[0].childNodes.length;g++){var f=h[0].childNodes[g];if("ION-HEADER"==f.nodeName&&(m=1),1==m&&"ION-HEADER"!=f.nodeName&&"ION-FOOTER"!=f.nodeName&&f.style){f.style.height=h[0].offsetHeight-v+"px",f.style.overflowY="auto";break}}}else console.log(12)}};function HTML2Canvas(e){this.props=e,this.ctx=e.ctx,this.lineHeight=e.lineHeight?e.lineHeight:20,this.heightText=function(e,t){var a=this.ctx,l=this,o="",r=l.lineHeight;return e.split("").forEach((e=>{o+=e,a.measureText(o).width>=t-15&&(o="",r+=l.lineHeight)})),r+=7},this.drawText=function(e,t,a,l,o,r){var n=this.ctx,i=this,s="",d=i.lineHeight+a;return n.fillStyle="#000000",e.split("").forEach((e=>{s+=e,n.measureText(s).width>=l-15&&(n.fillText(s,t,d),s="",d+=i.lineHeight)})),n.fillText(s,t+("right"==r?l-n.measureText(s).width:0),d),n.beginPath(),d+=7}}setTimeout(Vue$1.resize=resize,400),window.addEventListener("resize",(function(){setTimeout(resize,400)}));var f={value:function(e){for(var t=0;t<this.length;t++)if(this[t]==e)return!0;return!1}};if([].contains||Object.defineProperty(Array.prototype,"contains",f),"".contains||Object.defineProperty(String.prototype,"contains",f),_$1=Object.assign(_$1,{initDB(e,t){let a=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;if(_$1.IDBTransaction=window.IDBTransaction||window.webkitIDBTransaction||window.msIDBTransaction,_$1.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange||window.msIDBKeyRange,a){if(_$1.indexedDB=a,a)return _$1.stores=t,new Promise(((l,o)=>{let r=a.open("db",e);r.onupgradeneeded=e=>{let a=e.target.result;t.forEach((e=>{a.objectStoreNames.contains(e[0])||a.createObjectStore(e[0],e[1])}))},r.onerror=e=>{o(e)},r.onsuccess=()=>{_$1.db=r.result,l(_$1.db)}}))}else window.alert("Your browser doesn't support a stable version of IndexedDB.");return a},remoteServer:"",_id:0,networkStatus:{connected:!0},storeFunction:{},varMap:{},id:()=>++_$1._id,findForm(e){var t=e.parentNode;return t&&"FORM"!=t.tagName&&(t=_$1.findForm(t)),t},contains:(e,t)=>e&&e.includes(t),uiParent:e=>e.ui||!e?e:_$1.uiParent(e.$parent),closest(e,t){for(;(e=e.parentElement)&&!(e.matches||e.matchesSelector).call(e,t););return e},fadeOut(e,t){isNaN(t)&&(t=9),document.getElementById(e).style.opacity="0."+t,document.getElementById(e).style.filter="alpha(opacity="+t+"0)",t>0&&(t--,setTimeout('fadeOut("'+e+'",'+t+")",90))},fadeIn(e,t){isNaN(t)&&(t=0),document.getElementById(e).style.opacity="0."+t,document.getElementById(e).style.filter="alpha(opacity="+t+"0)",t<9&&(t++,setTimeout('fadeIn("'+e+'",'+t+")",90))},whichChild(e){for(var t=0;null!=(e=e.previousElementSibling);)++t;return t},showerror(e,t){e.$el&&(e=e.$el);var a=e.previousElementSibling;for(a&&a.classList&&a.classList.contains("v-error")&&a.parentNode.removeChild(a),a=e.previousElementSibling;a&&1!=a.nodeType;)a=a.previousElementSibling;if(!a)for(a=e.parentElement.previousElementSibling;a&&1!=a.nodeType;)a=a.previousElementSibling;var l=document.createElement("div");l.innerHTML=t||"Este campo es requerido!",l.classList.add("v-error"),e.parentNode.insertBefore(l,e)},print(e){var t=document.createElement("iframe");document.body.appendChild(t);var a=t.contentWindow.document;t.style.display="none",a.open(),a.write("<html><head><title>TT"+e.title+"</title>"),a.write('<link rel="stylesheet" type="text/css" href="/cdn/isobit.css?v=0004"><style>table{background-color:red}</style>'),a.write('</head><body style="padding:20px;background-color:white !important">'),a.write("<style>body, body > * {padding:20px;background-color:white !important }</style>"),a.write("<h1>"+e.title+"</h1>"),a.write(e.body),a.write("</body></html>"),a.close(),t.focus(),t.contentWindow.print()},mask(e,t){if(document.body){var a=document.createElement("div");a.style="top:50%;transform:translate(-50%,-50%);position:absolute;width:100%;z-index:2";var l=a.style;if(l.left="50%",l.textAlign="center",!1!==e)if(e instanceof Element)a=e;else{if(e){var o=document.createElement("div");o.innerHTML=e,a.append(o),a.style="padding:4px;margin-bottom:5px;color:white;font-size:24px;text-align:center"}var r=document.createElement("div");(l=r.style).width="100%",l.height="180px",r.className="loading"}var n=document.createElement("div");(l=n.style).height="100%",l.top="0px",l.position="absolute",l.left="0",l.zIndex=1e4,l.width="100%";var i=document.createElement("div");return(l=i.style).height="100%",l.width="100%",l.top="0",l.position="absolute",l.left="0",l.backgroundColor="rgba(0,0,0,0.5)",t&&t.opacity&&(l.opacity=t.opacity),t&&t.backgroundColor&&(l.backgroundColor=t.backgroundColor),n.appendChild(i),n.appendChild(a),r&&a.appendChild(r),document.body.appendChild(n),n}},unmask(e){e&&(e.style.display="none",e.parentNode&&e.parentNode.removeChild(e))},clean(e){for(var t in e)""!==e[t]&&null!==e[t]&&"function"!=typeof e[t]&&void 0!==e[t]||delete e[t];return e},processURL:e=>e,loadCSS(e){var t=document.getElementsByTagName("head")[0],a=document.createElement("link");a.rel="stylesheet",a.type="text/css",a.href=e,a.media="all",t.appendChild(a)},go(e){window.location=e},getCurrentPosition:()=>new Promise((function(e,t){if(_$1.location){var a="result"+_$1.id();_$1[a]=function(l){delete _$1[a],l.coords?e(l):t(l)},_$1.location(a)}else navigator.geolocation&&navigator.geolocation.getCurrentPosition(e,t)})),URL(e){var t=this;t.location=window.location,t.path=e||window.location.pathname;var a=t.path.split("?");a.length>1?(t.path=a[0],a=a[1].split("#"),t.query=a[0]):(a=a[0].split("#"),t.path=a[0]),t.get=function(e,a){if(t.query)for(var l,o=t.query.split("&"),r=o.length;r--;)if((l=o[r].split("="))[0]==e)return l[1];return a},t.put=function(e,a){e=encodeURI(e),a=encodeURI(a);var l=t.path.split("?");l.length>1&&(l=l[1].split("&"));for(var o,r=l.length;r--;)if((o=l[r].split("="))[0]==e){o[1]=a,l[r]=o.join("=");break}return r<0&&(l[l.length]=[e,a].join("=")),t.location.pathname+"?"+l.join("&")+t.location.hash}},loadScript(e,t){var a=document.getElementsByTagName("head")[0],l=document.createElement("script");l.type="text/javascript",l.src=e,l.onreadystatechange=t,l.onload=t,a.appendChild(l)},sum(e){return this.reduce(((t,a)=>t+((a=e?a[e]:a)?Number(a):0)),0)}}),_$1.getLocation=_$1.getCurrentPosition,Vue$1.id=_$1.id,"undefined"!=typeof ol){function e(e,t){var a;return e.getLayers().forEach((function(e){e.get("id")!==t||(a=e)})),a}ol.getLayerById=e,window.ol=ol}Vue$1.pad=function(e,t){if(null!=e){for(var a=1*e+"";a.length<t;)a="0"+a;return a}},Vue$1.filter("upper",_$1.upper=e=>e?e.toUpperCase():e),Vue$1.filter("capitalize",_$1.capitalize=e=>(e&&(e=e.replace("_"," ").replace(/\b[a-z](?=[a-z]{2})/gi,(function(e){return e.toUpperCase()}))),e)),Vue$1.filter("number",(function(e){return e?e.toFixed(2).replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1 "):e})),Vue$1.filter("date",_$1.toDate=(e,t)=>{if(e){var a,l=Vue$1.pad;if(e instanceof Date)a=e;else if("string"==typeof e){var o=e.split("T");a=o[0].split("-"),o.length>1?(o=o[1].split(":"),a=new Date(parseInt(a[0]),parseInt(a[1])-1,parseInt(a[2]),parseInt(o[0]),parseInt(o[1]),o.length>2?parseInt(o[2]):0)):a=a.length>2?new Date(parseInt(a[0]),parseInt(a[1])-1,parseInt(a[2])):(a=e.split(":")).length>2?new Date(1981,0,6,parseInt(a[0]),parseInt(a[1]),parseInt(a[2])):new Date(e)}else a=new Date(e);if(1==t)e=a;else if("time"===t)e=l(a.getHours(),2)+":"+l(a.getMinutes(),2)+":"+l(a.setSeconds()?a.setSeconds():0,2);else if("time a"==t)if("string"==typeof e||e instanceof String){var r=(e=e.split(":"))[0];e=l(r>12?r-12:r,2)+":"+e[1]+":"+e[2]+" "+(r>12?"PM":"AM")}else e=l((r=a.getHours())>12?r-12:r,2)+":"+l(a.getMinutes(),2)+(a.setSeconds()?":"+l(a.setSeconds(),2):"")+" "+(r>12?"PM":"AM");else e="date-"==t?l(a.getFullYear(),4)+"-"+l(a.getMonth()+1,2)+"-"+l(a.getDate(),2):"dMY"==t||"date"==t?l(a.getDate(),2)+"/"+l(a.getMonth()+1,2)+"/"+l(a.getFullYear(),4):"datetime"==t?l(a.getFullYear(),4)+"-"+l(a.getMonth()+1,2)+"-"+l(a.getDate(),2)+"T"+l(a.getHours(),2)+":"+l(a.getMinutes(),2)+":"+l(a.setSeconds()?a.setSeconds():0,2):l(a.getDate(),2)+"/"+l(a.getMonth()+1,2)+"/"+l(a.getFullYear(),4)+" "+l(a.getHours(),2)+":"+l(a.getMinutes(),2)}return e}),_$1.HTML2Canvas=HTML2Canvas,Vue$1.dateDiff=function(e,t){Number(e)===e&&(e=new Date(e));var a,l,o,r,n,i,s,d,c=e-t;c/=36e5,c/=24,c=Math.floor(c),c=Math.abs(c);var u=new Date,p=new Date;e>t?(u=e,p=t):(u=t,p=e),a=u.getFullYear()-p.getFullYear(),0>(l=(r=u.getMonth())-(n=p.getMonth()))&&(l+=12,--a),o=(s=u.getDate())-(d=p.getDate());var h=new Date(u.getFullYear(),r,1);return h.setDate(h.getDate()-1),i=h.getDate(),d>s&&(o+=i,0>--l&&(l+=12,--a),e>t&&((h=new Date(p.getFullYear(),n+1,1)).setDate(h.getDate()-1),30==(i=h.getDate())&&(o-=1),29==i&&(o-=2),28==i&&(o-=3))),{ans:a,meses:l,dias:o,Tdias:c}};var f={value:function(e){for(var t=0;t<this.length;t++)if(this[t]==e)return!0;return!1}};function isObject(e){return e&&"object"==typeof e&&!Array.isArray(e)}function configureAxios(e){var t;e.interceptors.request.use((function(e){return _$1.eeee=e,e.mask?e.mask():t||(t=_$1.mask()),e}),(function(e){return t=_$1.unmask(t),_$1.MsgBox("request "+_$1.id()+" "+e.message),Promise.reject(e)})),e.interceptors.response.use((function(e){return t=_$1.unmask(t),e}),(function(e){if(axios$2.error&&0==axios$2.error(e))t=_$1.unmask(t);else{var a=e.response,l=a&&a.data&&a.data.msg?a.data.msg:e.message;if(a&&(a.data&&a.data.message&&(l=a.data.message),"string"==typeof a.data&&(l=a.data),l||(l=a.status+": "+a.statusText)),t=_$1.unmask(t),a&&401==a.status&&_$1.app)return _$1.app.toast("Session terminada"),void _$1.app.logout();e.config.error?(console.log("error"),e.config.error(e,l)):(console.log("mssg"),_$1.MsgBox("<b>"+e.request.responseURL+"</b><br/><br/>"+l)),console.log(l),console.log(a)}return delete axios$2.error,Promise.reject(e)}))}[].contains||Object.defineProperty(Array.prototype,"contains",f),"".contains||Object.defineProperty(String.prototype,"contains",f),_$1.contains=function(e,t){return e&&e.includes(t)},_$1.MsgBox=function(e,t,a){if(a||(a=["OK"]),document.body){var l=document.createElement("div");l.classList.add("v-overlay"),l.style.padding="40px",l.style.zIndex="2000",document.body.appendChild(l);var o=document.createElement("div"),r=document.createElement("div"),n=document.createElement("div"),i=document.createElement("div");i.className="v-msgbox-buttons",o.classList.add("v-dialog"),o.classList.add("v-msgbox"),n.innerHTML=e,o.setAttribute("path",_$1.currentPath),o.setAttribute("callback",u);for(var s=function(){o.style.display="none",l.style.display="none",o.parentNode.removeChild(o),l.parentNode.removeChild(l),t&&(console.log(t),t(this.getAttribute("index")))},d=0;d<a.length;d++){var c=document.createElement("button");c.innerHTML=a[d],c.type="button",c.setAttribute("index",d),c.className="v-button ui-widget ui-state-default ui-corner-all",i.appendChild(c),c.addEventListener("click",s)}r.className="v-dialog-content v-widget-content",r.appendChild(n),r.appendChild(i),o.appendChild(r),l.appendChild(o),l.style.visibility="unset",l.style.opacity="unset",l.style.overflow="auto",o.style.margin="0 auto",o.style.position="unset";var u="v_0";Vue$1.resize()}},Vue$1.mergeDeep=function(){for(var e=arguments[0],t=[],a=1;a<arguments.length;a++)t.push(arguments[a]);if(!t.length)return e;var l,o=t.shift();if(isObject(e)&&isObject(o))for(var r in o)isObject(o[r])?(e[r]||((l={})[r]={},Object.assign(e,l)),Vue$1.mergeDeep(e[r],o[r])):((l={})[r]=o[r],Object.assign(e,l));var n=[];return n.push(e),n.concat(t),Vue$1.mergeDeep.apply(null,n)},window.ui=_$1.ui=function(cfg){var defs={watch:{$route(e){console.log("$route"),Vue$1.resize(),this.changeRoute(e)},cleanedFilters(){this.$el&&(this.t&&clearTimeout(this.t),this.t=setTimeout((()=>{this.refresh()}),1200))}},computed:{connected:{get(){return this.online&&!1!==this.x_connected_},set(e){let t=this.session;this.x_connected_=e,console.log("this.x_connected_ = "+this.x_connected_),this.$set(t,"connected",e),this.session=t}},session:{get(){if(!_$1._session){var e=localStorage.getItem("session");e=e?JSON.parse(e):{},_$1._session=e}return _$1._session},set(e){e?localStorage.setItem("session",JSON.stringify(e)):localStorage.removeItem("session"),_$1._session=e}},online(){return!1!==this.app.networkStatus.connected},cleanedFilters(){return _$1.clean(this.filters)},app:()=>_$1.app,user:()=>_$1.app.session,perms(){return this.session.perms||this.session.allcaps||{}},rowSelectedCount(){if(!this.$children[0])return 0;var e=this.$children[0].$children[0];return e?e.selected.length:0},baseURL:()=>Vue$1.baseURL?Vue$1.baseURL:axios$2.defaults.baseURL},data(){return{filters:{},ui:this,_session:null,x_connected_:null,row:{}}},created(){this.x_connected_=this.session.connected},updated(){console.log("main.update")},mounted(){var e=this,t=_$1.id();e.$el&&e.$el.setAttribute&&e.$el.setAttribute("vueid",t),_$1.varMap[t]=e,e.ddd(e.$root)},methods:{resize(){Vue$1.resize()},vv(e){var t=this;Network.getStatus().then((function(a){if(a.connected){var l=localStorage.getItem("session");if(l){try{l=JSON.parse(l)}catch(e){console.log(e),l={}}l.connected=e,localStorage.setItem("session",JSON.stringify(l))}}else t.toast("El dispositivo no tiene acceso a internet!"),t.connected=a.connected}))},bindLinks(e,t){var a=this;if((e=e||a.$el).querySelectorAll)for(var l=e.querySelectorAll("a:not(._),ion-item:not(._)"),o=function(e){e.preventDefault()},r=function(e){e.preventDefault(),t&&t(),a.open(e)},n=0;n<l.length;n++)l[n].attributes.href?l[n].onclick=r:l[n].onclick=o,l[n].classList?l[n].classList.add("_"):l[n].className="_"},MsgBox:_$1.MsgBox,changeRoute(){},pad:Vue$1.pad,key:()=>Math.random(),submitFile(e,t,a){var l=new FormData;t=t||e.name.replace(/[^\w\s.]/gi,""),l.append("filename",t),l.append("file",e,t),axios$2.post("/api/file/upload",l,{headers:{"Content-Type":"multipart/form-data",filename:t}}).then((function(e){a(e.data)})).catch((function(){console.log("FAILURE!!")}))},go(e){window.o(e)},ddd(){},rowCreated(e){this.row=e},getSelected(e){return(e&&e.$vnode?e:this.$children[0].$children[0]).selected},getRowSelectedCount(){var e=this.$children[0].$children[0];return e?e.selected.length:0},rewrite:e=>e,create(){var e=this,t=e.$children[0].action;t||(t=window.location.pathname),(t=_$1.processURL(t))&&(t=t.replace("/api","")),_$1.app?e.open(t+"/create"):instance.get(_$1.currentPath=(t+"/create").replace(/([^:]\/)\/+/g,"$1")+"?modal").then(_$1.open).catch(e.error)},edit(e){var t=this,a=t.$children[0].action,l=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];a||(a=window.location.pathname),l&&l.src&&(a=l.src),e.action&&(a=e.action),l||(l=e.$vnode||e.target&&e.target.$vnode?e:t.$children[0].$children[0]).src&&(a=l.src),a&&(a=t.rewrite(a.replace("/api","").replace("/0/0","")));var o=t.getSelected(l)[0],r=o[l.rowKey];o.tmpId&&(r=-o.tmpId),console.log(o),t.getSelectedId&&(r=t.getSelectedId(o)),_$1.app?t.open(a+"/"+r+"/edit"):axios$2.get((_$1.currentPath=(a+"/"+r+"/edit").replace(/([^:]\/)\/+/g,"$1"))+"?modal").then(t.open).catch(t.error)},get(e){var t=this.$el.querySelector("form").action;window.location.href=this.apiLink(t)+"/"+e},error(e){alert(e)},destroy(e){var t=this;t.$children[0].action;var a=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];a||(a=e.$vnode?e:t.$children[0].$children[0]);var l=e.$vnode?e.load:null,o=a.$attrs.rowkey;o||(o=a.rowKey);var r=a.data[a.selected[0]];if(a.data,r.tmpId)t.MsgBox("Esta seguro que desea eliminar los registros temporales seleccionados ?",(function(e){if(0==e){for(var o=0,n=_$1.db.transaction([a.store],"readwrite").objectStore(a.store),i=[],s=a.selected.length-1;s>=0;s--)r=a.data[a.selected[s]],i.push(r),r.tmpId&&n.delete(r.tmpId),o++,a.data.splice(a.selected[s],1);o&&(t.app&&t.app.toast?t.app.toast(o+" registros eliminados"):t.MsgBox(o+" registros eliminados")),a.rowSelect(null,-1),a.selected=[],t.$emit("destroyed",i,a.store),l&&l()}}),["SI","NO"]);else{if(!o)return alert("Table don`t have defined attribute 'rowkey'");var n=r[o];t.MsgBox("Esta seguro que desea eliminar el registro seleccionado?",(function(e){if(0==e){var l=a.src.replace("/0/0",""),o=[];console.log(a.selected);var i=a.selected.length-1;axios$2.delete(l+"/"+n,{params:a.filters}).then((function(){for(console.log(a.selected);i>=0;i--)console.log("k="+i),console.log(a.data),console.log("t.selected[k]="+a.selected[i]),r=a.data[a.selected[i]],o.push(r),console.log(o),a.data.splice(a.selected[i],1);t.app&&t.app.toast?t.app.toast(o.length+" registros eliminados"):t.MsgBox(o.length+" registros eliminados"),a.rowSelect(null,-1),a.selected=[]})).catch(t.error)}}),["SI","NO"])}},apiLink:e=>e.replace(_$1.contextPath,_$1.contextPath+"/api"),open(response,path,o){if(!(response.$el||response instanceof HTMLElement)){var e=response,t=e.target,me=this;return"string"==typeof e?t=e:"ION-ITEM"==t.tagName&&t.href?(e.preventDefault(),t=t.href):(e.preventDefault(),t.pathname||(t=t.parentNode),t.pathname||(t=t.parentNode),t.pathname||(t=t.parentNode),t=t.pathname),void(me.$route.path!==t&&(console.log("path="+t),me.$router.push(t)))}var me=this,el;if(response.$el)response=response.$el,path={};else if(response instanceof HTMLElement)path=path&&path.closeOnClickOut?path:{},console.log("PATH===="),console.log(path);else{if(response.target)return el=response.target,me.open(el.pathname?el.pathname:el.href);if("GET"===response){if("string"==typeof path){var cfg={path:_$1.currentPath=path+("string"==typeof o?"/"+o:"")};return"function"==typeof o?cfg.result=o:"object"==typeof o&&(cfg=Vue$1.mergeDeep(cfg,o)),me.open(response,cfg)}if(!path.data){if(el=document.querySelector("[path='"+path.path+"']"),el){for(var dd=document.querySelector("#layoutUnit-center > .ui-layout-unit-content,#page-content"),i=0;i<dd.children.length;i++)dd.children[i].style&&("ui-panel"==dd.children[i].className&&"none"!=dd.children[i].style.display&&(backPanel=dd.children[i]),dd.children[i].style.display="none");return el.style.removeProperty("display"),el}return axios$2.get((path.path+"/?modal").replace(/([^:]\/)\/+/g,"$1")).then((e=>{e.class=path.class?path.class:"",e.path=path.path,e.result=path.callback,e=Object.assign(e,path),me.open(response,e)})).catch(me.error)}}else{if(!response.data)return me.open("GET",response,path);response.data&&(path=response)}}console.log("open(path="+path+")"),console.log(path);var dialog,nid=Vue$1.id(),scriptDom=[],for_,ifor=0,backPanel;if(response instanceof HTMLElement)dialog=response,dialog.classList.add("v-dialog");else{dialog=document.createElement("div"),dialog.classList.add("v-dialog"),dialog.innerHTML=path.data;var s=dialog.getElementsByTagName("script");dialog.setAttribute("path",_$1.currentPath);for(var ld=dialog.children,k=0;k<s.length;k++)scriptDom.push(s[k]);for(k=0;k<ld.length;k++)"V-FORM"!=ld[k].tagName&&"V-PANEL"!=ld[k].tagName||(for_=ld[k],ifor=k)}var close=()=>{dialog.style.display="none",(overlay=dialog.parentNode).classList.contains("v-overlay")&&(overlay.style.display="none",dialog.parentNode.removeChild(dialog),overlay.parentNode.removeChild(overlay)),backPanel&&(dialog.parentNode.removeChild(dialog),backPanel.style.display="block"),Vue$1.resize()};if(for_&&for_.classList.contains("panel")){if(for_.id)window.currentEl="#"+for_.id;else{var clsId="cls-id-"+Vue$1.id();for_.classList.add(clsId),window.currentEl="."+clsId}for(dd=document.querySelector("#layoutUnit-center > .ui-layout-unit-content,#page-content"),i=0;i<dd.children.length;i++)dd.children[i].style&&("ui-panel"==dd.children[i].className&&"none"!=dd.children[i].style.display&&(backPanel=dd.children[i]),dd.children[i].style.display="none");dd.appendChild(dialog);for(var l2=0;scriptDom.length>l2;l2++)try{eval(scriptDom[l2].innerHTML)}catch(e){console.error(e)}var td;dialog.style.display="none";for(var aux=dialog.children[ifor];dialog.children.length>0;)td||(td=dialog.children[0]),dd.appendChild(dialog.children[0]);dialog.parentNode.removeChild(dialog),dialog=aux,dialog.setAttribute("path",path.path)}else{var overlay=document.createElement("div");if(overlay.classList.add("v-overlay"),overlay.style.padding="40px",document.body.appendChild(overlay),overlay.appendChild(dialog),!(response instanceof HTMLElement))for(l2=0;s.length>l2;l2++)try{eval(s[l2].innerHTML)}catch(e){console.error(e)}overlay.style.visibility="unset",overlay.style.opacity="unset",overlay.style.overflow="auto",dialog.style.margin="0 auto",dialog.style.position="unset";var resize=e=>{if(console.log("resize "),dialog.style.left=(window.innerWidth-dialog.offsetWidth)/2+"px",window.innerWidth<600){console.log(dialog);var t=dialog.querySelector(".v-dialog-content"),a=dialog.querySelector(".v-panel-titlebar"),l=window.innerHeight-94-(a?a.clientHeight:0);(t||dialog).style.height=l+"px"}};if(window.addEventListener("resize",resize),"v-search"===path.class){var d=dialog;d.className=d.className+" "+path.class,d.style.width="100%",d.style.height="calc(100% - 2px)";var children=d.querySelector("div"),f=d.querySelector("form"),t=d.querySelector(".v-datatable"),tb=d.querySelector(".v-datatable-scrollable-body");children.style.height="calc(100% - 2px)",children.style.overflowY="auto",children.children[1].style.padding="0px",children.children[1].style.height="calc(100% - 33px)",f.style.height="100%",f.style.overflowY="auto",t.style.height="calc(100% - 52px)",tb.style.height="calc(100% - 72px)",tb.style.overflowY="auto";var pag=d.querySelector(".v-paginator");pag.style.display="inline-block",f.appendChild(pag),tb=document.createElement("button"),tb.innerHTML="Recuperar",tb.style.padding="4px 16px",tb.className="_ ui-widget v-state-default ui-corner-all v-button ui-button-text-only";var vue=_$1.varMap[children.getAttribute("vueid")];tb.onclick=e=>{e.preventDefault(),vue.refresh()},f.appendChild(tb),tb=document.createElement("button"),tb.innerHTML="Seleccionar",tb.style.padding="4px 16px",tb.className="_ ui-widget v-state-default ui-corner-all v-button ui-button-text-only",vue=_$1.varMap[children.getAttribute("vueid")],tb.onclick=e=>{e.preventDefault();var t=[],a=vue.$children[0].$children[0];for(i=0;i<a.selected.length;i++)t.push(a.filteredData[a.selected[i]]);path.result(t),delete path.result,vue.close(e)},f.appendChild(tb)}resize()}_$1.storeFunction["PROPS="+nid]=path,_$1.storeFunction[nid]=e=>{path.result&&path.result(e),!0===e&&me.refresh()};var _vue_=dialog.querySelector("[vueid]");_vue_&&(path.__vue__=_vue_.__vue__,_vue_.__vue__.$emit("opened",path)),dialog.setAttribute("callback",nid);var h=dialog.querySelector(".v-panel-titlebar");if(h){var acl=h.querySelector(".ui-js-close");if(window.onkeyup=e=>{27==e.keyCode&&close()},!acl){var span=document.createElement("i");span.style.top="6px",span.style.right="6px",h.style.position="relative",span.style.position="absolute",span.style.color="white",span.className="fa fa-window-close v-dialog-close",acl=document.createElement("a"),acl.className="ui-js-close v-dialog-titlebar-icon v-dialog-titlebar-close ui-corner-all",acl.appendChild(span),h.appendChild(acl),acl.addEventListener("click",close)}}path.closeOnClickOut&&dialog.parentNode.addEventListener("click",close),dialog.style.display="block",Vue$1.resize(),document.documentElement.style.overflow="hidden",document.body.scroll="no"},close(e){e.$el&&(e=e.$el);var t=e instanceof HTMLElement?e:null;try{!t&&event.target instanceof HTMLElement&&(t=_$1.closest(event.target,".v-dialog"))}catch(e){console.log(e)}t||(t=this.$el.parentElement);var a=t.parentElement;if(a||!_$1.app.$router){t.style.display="none",(" "+a.className+" ").indexOf(" v-overlay ")>-1?a.style.display="none":a=null,Vue$1.resize();var l=_$1.storeFunction[t.getAttribute("callback")];l&&l(e),t.parentNode.removeChild(t),a&&a.parentNode.removeChild(a),document.documentElement.style.overflow="auto",document.body.scroll="yes"}else _$1.app.$router.back()},refresh(){this.$children[0].$children[0].load()},removeStored(e){if(window.idb){var t=this;window._.db.transaction([e],"readwrite").objectStore(e).clear().onerror=function(){t.MsgBox("Error al eliminar data temporal")}}else localStorage.removeItem(e)},async toast(e,t){e.message&&!e.duration&&(e.duration=2e3);const a=await this.$ionic.toastController.create(e.message?e:{message:e,duration:2e3});await a.present(),t&&t()},async setStoredList(e,t){if(_$1.db)try{var a=_$1.db.transaction([e],"readwrite").objectStore(e);a.clear().onsuccess=()=>{for(var e in t){console.log(t[e]),a.add(t[e]).onerror=e=>{console.log(e)}}}}catch(t){throw alert(e),t}else localStorage.setItem(e,JSON.stringify(t))},async getStoredList(e,t){let a;try{a=JSON.parse(sessionStorage.getItem("loadedStores"))}catch(e){}if(null==a&&(a={}),!a[e]&&_$1.networkStatus.connected){let t=_$1.stores.filter((t=>t[0]==e))[0];if(!t[2])throw"store url is empty";let o=await axios$2.get(t[2]),r=_$1.db.transaction([t[0]],"readwrite").objectStore(t[0]);for(var l in await r.clear(),o=o.data||o,o)try{await r.add(o[l])}catch(e){throw e}a[e]=1,sessionStorage.setItem("loadedStores",JSON.stringify(a))}let o=new Promise(((t,a)=>{if(_$1.db){var l=_$1.db.transaction(e).objectStore(e).getAll();l.onsuccess=function(){t(l.result)}}else a("db is null")}));return await o},getStoreObject:(e,t)=>window._.db.transaction([e],"readwrite").objectStore(e).get(t),async sync(e){var t=this,a=t.$el.querySelector("form").getAttribute("action");if(!a){var l=(a=t.$el.parentNode.getAttribute("path")).split("/");l="edit"==l[l.length-1]?l.splice(0,l.length-2):l.splice(0,l.length-1),a=t.apiLink(l.join("/"))}var o=t.$children[0].$children[0];a=o.src;for(var r=await t.getStoredList(o.store),n=o.selected,i=[],s=[],d=0;d<n.length;d++){var c=o.data[n[d]];if(c.tmpId&&!c.synchronized)for(var u=0;u<r.length;u++)if(r[u].tmpId==c.tmpId){var p=JSON.clone(r[u]);delete p.synchronized,s.push(p),i.push(u)}}i.length>0&&axios$2.post(a+"/bulk"+(e.sufix?e.sufix:""),s).then((function(e){let a=e.data;for(let e=0;e<a.length;e++){if(a[e].errors){t.MsgBox(JSON.stringify(a[e].errors));break}if(a[e].error){t.MsgBox(a[e].error);break}for(var l=0;l<r.length;l++)(a[e].ext&&a[e].ext.tmpId==r[l].tmpId||a[e].tmpId==r[l].tmpId)&&(console.log("ok"),a[e].ext&&r.ext&&(r[l].ext.error=a[e].ext.error),a[e].id&&(r[l].id=a[e].id),r[l].synchronized=1,t.$emit("sync",a[e],r[l]))}t.setStoredList(o.store,r),t.refresh()})).catch((function(e){e.response?t.MsgBox(e.response.data):console.log(e)}))},async save(){var e=this;e.$forceUpdate();var t=e.$el.querySelector("form");if(this.validate(t)){var a=t.getAttribute("action");if(!a&&(a=e.$el.parentNode.getAttribute("path"))){var l=a.split("/");l="edit"==l[l.length-1]?l.splice(0,l.length-2):l.splice(0,l.length-1),a=e.apiLink(l.join("/"))}var o=this._data.data?this._data.data:this._data.o,r=JSON.parse(JSON.stringify(o));if(e.process&&(r=e.process(r)),"object"!=typeof r||Array.isArray(r)||null===r)return;if(a&&e.app.networkStatus.connected)axios$2.post(a,r).then((function(t){var a=t.data;if(r.tmpId){var l=e.$children[0].store,n=window._.db.transaction([l],"readwrite").objectStore(l),i=n.get(r.tmpId);a.id&&(r.id=a.id,o.id=r.id),i.onsuccess=function(){o.synchronized=1,r.synchronized=1,(i.result?n.put(r):n.add(r)).onerror=e=>{console.error(e)},e.$emit("sync",a,r)},i.onerror=function(){e.MsgBox("Error getting temporal record "+r.tmpId)}}e.$ionic?e.app.toast("El registro fue grabado exitosamente!",(()=>{e.close({success:!0,data:a})})):(console.log(a),e.MsgBox("El registro fue grabado exitosamente!",(function(){e.close({success:!0,data:a})})))})).catch((function(a){var l,o;if(console.log(a),a.response)if("string"==typeof a.response.data)e.MsgBox(a.response.data);else{l=a.response.data.propertyViolations;for(var r=0;r<l.length;r++){var n=l[r];(o=t.querySelector("[name="+n.path+"]"))&&e.showerror(o,n.message)}for(l=a.response.data.fieldViolations,r=0;r<l.length;r++)n=l[r],(o=t.querySelector("[name="+n.path+"]"))&&e.showerror(o,n.message+", valor="+n.value);e.MsgBox("Verifique el formulario, aun tiene campos obligatorio completar."),"v-dialog"==e.$el.parentNode.className&&e.$el.parentNode.parentNode.scroll({top:0,behavior:"smooth"})}}));else{let t=e.$children[0].store;if(!t)return void e.MsgBox("Store in form is undefined!");let a=await e.getStoredList(t);if(a||(a=[]),r.id)for(var n=0;n<a.length;n++)a[n].tmpId==r.tmpId&&(delete r.synchronized,a[n]=r);var i=_$1.db.transaction([t],"readwrite").objectStore(t);if(r.id){delete r.synchronized;var s=i.get(r.tmpId);s.onsuccess=function(){console.log(s.result),s.result?(console.log("objectStore.put(o)"),i.put(r)):a.forEach((e=>{e.tmpId==r.tmpId&&i.put(r)})),e.$emit("stored",r,a,i),e.$ionic&&e.app.toast("El registro fue grabado exitosamente!"),e.close({success:!0,data:r})},s.onerror=function(){e.MsgBox("Error getting temporal record "+r.tmpId)}}else{r.tmpId=1*new Date,r.id=-r.tmpId;var d=i.add(r);d.onsuccess=l=>{console.log(l),console.log("saved to "+t),a.unshift(r),e.$emit("stored",r,a,i),e.app&&e.app.toast&&e.app.toast("El registro fue grabado exitosamente!"),o.tmpId=r.tmpId,o.id=r.id,e.close({success:!0,data:r})},d.onerror=t=>{e.app&&e.app.toast&&e.app.toast("Error!"),console.log(t)}}}}else e.MsgBox("Verifique el formulario, aun tiene campos obligatorios sin completar."),"v-dialog"==e.$el.parentNode.className&&e.$el.parentNode.parentNode.scroll({top:0,behavior:"smooth"})},saveAs(e,t,a){"string"==typeof t&&(t={body:t});var l="string"==typeof a?{fileName:a}:a;l||(l={}),(""+t?axios$2.post(e,t,{responseType:"blob"}):axios$2({method:"post",url:e,data:t,headers:{"Content-Type":"multipart/form-data"}})).then((e=>{const t=window.URL.createObjectURL(new Blob([e.data])),a=document.createElement("a");if(a.href=t,!l.fileName)var o=e.headers["content-disposition"];if(o&&-1!==o.indexOf("attachment")){var r=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(o);null!=r&&r[1]&&(l.fileName=r[1].replace(/['"]/g,"").trim())}a.setAttribute("download",l.fileName),document.body.appendChild(a),a.click()}))},savePost(){},validate(e){var t,a=!0,l=(e=e||this.$el).querySelectorAll("input,select,textarea,div[required=required]"),o={};for(p=0;l.length>p;p++){var r=l[p];if("radio"!==r.type){if((t=r.previousElementSibling)&&t.classList&&t.classList.contains("v-error")&&t.parentNode.removeChild(t),!r.disabled&&!r.getAttribute("disabled")&&(r.required||"DIV"===r.tagName)&&("DIV"!=r.tagName&&!r.value||"DIV"===r.tagName&&!r.attributes.value)){for(t=r.previousElementSibling;t&&1!=t.nodeType;)t=t.previousElementSibling;if(!t)for(t=r.parentElement.previousElementSibling;t&&1!=t.nodeType;)t=t.previousElementSibling;var n=document.createElement("div");n.innerHTML="Este campo es requerido!",a=!1,n.classList.add("v-error"),r.parentNode.insertBefore(n,r)}}else{var i=o[r.name];i||(o[r.name]=i=[]),i.push(r)}}for(var s in o)if(Object.prototype.hasOwnProperty.call(o,s)){for(var d=o[s],c=!1,u=!1,p=0;p<d.length;p++)d[p].required&&!d[p].disabled&&(u=!0),d[p].checked&&(c=!0);(t=(r=d[0].parentNode.parentNode).previousElementSibling)&&t.classList&&t.classList.contains("v-error")&&t.parentNode.removeChild(t),u&&!c&&(this.showerror(r),a=!1)}return a},showerror:_$1.showerror}};if(cfg||(cfg={data:{o:{}}}),!window.isMobile){var el=cfg.el;if("string"==typeof cfg.el)el=document.querySelector(cfg.el);else{var script=document.getElementsByTagName("script");el=script[script.length-1].previousElementSibling.previousElementSibling}for(var tv=el.querySelectorAll("v-tabview"),i=0;i<tv.length;i++){var id="v-"+_$1.id();tv[i].setAttribute("vid",id);var cn=tv[i].childNodes,tabs=[];_$1.varMap[id]=tabs;for(var j=0;j<cn.length;j++)cn[j].tagName&&(cn[j].className="hide",tabs.push({title:cn[j].title}))}cfg.el=el}return cfg={mixins:[defs,cfg]},window.isMobile?cfg:new Vue$1(cfg)},window._=_$1,window.Vue=Vue$1,window.axios=axios$2,_$1.axios=axios$2,Vue$1.configureAxios=configureAxios,configureAxios(axios$2);var index={install(e,t){console.log(_$1.Vue),e.filter("upper",(e=>e?e.toUpperCase():e)),e.filter("date",_$1.toDate.bind(t)),e.filter("capitalize",_$1.capitalize.bind(t)),e.filter("upper",_$1.upper.bind(t)),console.log("filter date addedd!"),e.component("v-autocomplete",script$o),e.component("v-button",script$n),e.component("v-calendar",script$m),e.component("v-checkbox",script$l),e.component("v-checkbox-group",script$k),e.component("v-radio",script$i),e.component("v-radio-group",script$g),e.component("v-group",script$h),e.component("v-dataview",script$f),e.component("v-fieldset",script$e),e.component("v-form",script$j),e.component("v-table",script$d),e.component("v-tabview",script$c),e.component("v-switch",script$9),e.component("v-select",script$a),e.component("v-layer-control",script$4),e.component("v-map",script$3),e.component("v-map-control",script$2),e.component("v-number",script$8),e.component("v-options",script$7),e.component("v-overlay",script$1),e.component("v-uploader",script$6),e.component("v-panel",script$5),e.component("v-popup",script),e.component("v-textarea",script$b),e.component("v-filter-calendar",{template:'<div><v-button icon="fa-calendar" v-on:click.prevent="open"/><v-panel style="text-align:left;position:absolute;display:none" v-bind:header="\'Configurar Filtro []\'"><div style="padding:20px"><div class="v-form"><label>Desde:</label><v-calendar v-model="from"/><label>Hasta:</label><v-calendar v-model="to"/></div><center style="padding-top:20px"><v-button icon="fa-check" value="Aceptar"/><v-button icon="fa-ban" v-on:click.prevent="close" value="Cerrar"/></center></div></v-panel></div>',data:function(){return{el:null,mask:null}},methods:{open(){var e=this.el?this.el:this.el=this.$el.children[1];this.mask=_$1.mask(e,{backgroundColor:"rgba(0,0,0,0.95)"}),e.style.display="block"},close(){_$1.unmask(this.mask)}}}),e.component("v-accordion",{mounted(){},methods:{toggle(e){this.$emit("change",e)}},template:'<div class="v-accordion"><slot></slot></div>'}),e.component("v-tab",{props:["title","expanded"],data:()=>({count:0,expanded_:0}),update(){this.$el.querySelector("svg").dataset.icon="chevron-down"},mounted(){var e=this;e.expanded_=e.expanded,setTimeout((function(){e.$el.querySelector("svg").dataset.icon="chevron-down"}),100)},methods:{toggle(){this.expanded_=!this.expanded_,this.$el.querySelector("svg").dataset.icon=this.expanded_?"chevron-up":"chevron-down",this.$parent&&this.$parent.toggle&&this.$parent.toggle(this)}},template:'<div><div v-on:click="toggle" v-bind:class="{expanded:expanded_}" style="cursor:pointer;position: relative;padding: 10px 0px;">{{title}}<span style="position:absolute;right:0px" ><i data-icon="chevron-down" class="fa"></i></span></div><transition name="fade"><div class="v-tab-content" v-if="expanded_"><slot></slot></div></transition></div>'})}};module.exports=index;
|
|
1
|
+
"use strict";var vue=require("vue"),pinia=require("pinia"),axios$2=require("axios"),Observable=require("ol/Observable"),ol$1=require("ol"),FullScreen=require("ol/control/FullScreen"),GeoJSON=require("ol/format/GeoJSON"),VectorLayer=require("ol/layer/Vector"),VectorSource=require("ol/source/Vector"),style=require("ol/style"),Control=require("ol/control/Control");require("ol/ol.css");var PointerInteraction=require("ol/interaction/Pointer"),Feature=require("ol/Feature"),Map=require("ol/Map");require("ol/interaction/Pointer.js"),require("ol/interaction/defaults");var View=require("ol/View"),geom=require("ol/geom");require("ol/interaction/Select");var proj=require("ol/proj"),layer=require("ol/layer"),source=require("ol/source");require("ol/interaction/Translate");var _imports_0=require("@/cdn/images/triangle-down.svg"),vueRouter=require("vue-router"),vueFontawesome=require("@fortawesome/vue-fontawesome"),freeRegularSvgIcons=require("@fortawesome/free-regular-svg-icons"),script$s={name:"InputText"};const _hoisted_1$j={type:"text"};function render$o(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("input",_hoisted_1$j)}script$s.render=render$o,script$s.__file="src/InputText.vue";var script$r={name:"InputTextarea"};function render$n(e,t,l,o,r,a){return" text "}script$r.render=render$n,script$r.__file="src/InputTextarea.vue";const _$1={stores:[],_id:0,axios_get:null,storeFunction:{}},log=(e,...t)=>{e&&console.log(e,...t)};let configApp={};function setupApp({pinia:e,axios:t,router:l}){configApp.pinia=e||pinia.createPinia(),t&&(configApp.axios=t),l&&(configApp.router=l),pinia.setActivePinia(configApp.pinia)}function getConfigApp(){return configApp}function getPiniaInstance(){return pinia.getActivePinia()||configApp.pinia}const id=()=>_$1._id++,num=e=>e=e?""==e?null:Number(""+e):0,date=(e,t)=>{if(e){let l;if(e instanceof Date)l=e;else if("string"==typeof e){let t=e.includes("T")?e.split("T"):e.split(" ");l=t[0].split("-"),t.length>1?(t=t[1].split(":"),l=new Date(parseInt(l[0]),parseInt(l[1])-1,parseInt(l[2]),parseInt(t[0]),parseInt(t[1]),t.length>2?parseInt(t[2]):0)):l.length>2?l=new Date(parseInt(l[0]),parseInt(l[1])-1,parseInt(l[2])):(l=e.split(":"),l=l.length>2?new Date(1981,0,6,parseInt(l[0]),parseInt(l[1]),parseInt(l[2])):new Date(e))}else l=new Date(e);if(1==t)e=l;else if("time"===t)e=pad(l.getHours(),2)+":"+pad(l.getMinutes(),2)+":"+pad(l.setSeconds()?l.setSeconds():0,2);else if("time a"==t)if("string"==typeof e||e instanceof String){let t=(e=e.split(":"))[0];e=pad(t>12?t-12:t,2)+":"+e[1]+":"+e[2]+" "+(t>12?"PM":"AM")}else h=l.getHours(),e=pad(h>12?h-12:h,2)+":"+pad(l.getMinutes(),2)+(l.setSeconds()?":"+pad(l.setSeconds(),2):"")+" "+(h>12?"PM":"AM");else e="date-"==t?pad(l.getFullYear(),4)+"-"+pad(l.getMonth()+1,2)+"-"+pad(l.getDate(),2):"dMY"==t||"date"==t?pad(l.getDate(),2)+"/"+pad(l.getMonth()+1,2)+"/"+pad(l.getFullYear(),4):"datetime"==t?pad(l.getFullYear(),4)+"-"+pad(l.getMonth()+1,2)+"-"+pad(l.getDate(),2)+"T"+pad(l.getHours(),2)+":"+pad(l.getMinutes(),2)+":"+pad(l.setSeconds()?l.setSeconds():0,2):pad(l.getDate(),2)+"/"+pad(l.getMonth()+1,2)+"/"+pad(l.getFullYear(),4)+" "+pad(l.getHours(),2)+":"+pad(l.getMinutes(),2)}return e},whichChild=e=>{let t=0;for(;null!=(e=e.previousElementSibling);)++t;return t},mask=(e,t)=>{if(!document.body)return;let l,o=document.createElement("div");o.className="abc",o.style="top:50%;transform:translate(-50%,-50%);position:absolute;width:100%;z-index:2; display: flex;justify-content: center;";let r=o.style;if(r.left="50%",r.textAlign="center",!1!==e)if(e instanceof Element)o=e;else{if(e){let t=document.createElement("div");t.innerHTML=e,o.append(t),o.style="padding:4px;margin-bottom:5px;color:white;font-size:24px;text-align:center"}l=document.createElement("div"),r=l.style,l.className="loading"}let a=document.createElement("div");r=a.style,r.height="100%",r.top="0px",r.position="absolute",r.left="0",r.zIndex=1e4,r.width="100%";let n=document.createElement("div");return r=n.style,r.height="100%",r.width="100%",r.top="0",r.position="absolute",r.left="0",r.backgroundColor="rgba(0,0,0,0.5)",t&&t.opacity&&(r.opacity=t.opacity),t&&t.backgroundColor&&(r.backgroundColor=t.backgroundColor),a.appendChild(n),a.appendChild(o),a.className="v-mask",l&&o.appendChild(l),document.body.appendChild(a),a},unmask=e=>{e&&(e.style.display="none",e.parentNode&&e.parentNode.removeChild(e))},isObject=e=>e&&"object"==typeof e&&!Array.isArray(e),mergeDeep=function(){let e=arguments[0],t=[];for(let e=1;e<arguments.length;e++)t.push(arguments[e]);if(!t.length)return e;let l,o=t.shift();if(isObject(e)&&isObject(o))for(let t in o)isObject(o[t])?(e[t]||(l={},l[t]={},Object.assign(e,l)),mergeDeep(e[t],o[t])):(l={},l[t]=o[t],Object.assign(e,l));let r=[];return r.push(e),r.concat(t),mergeDeep.apply(null,r)},buildPopupMenu=e=>{let t=e.getAttribute("v--popup");if(!t){e.setAttribute("v--popup",t=id());let l=_$1.storeFunction[t],o=e.querySelectorAll(".v-datatable-header .v-button");o&&o.length&&!l&&window.innerWidth<=700&&setTimeout((function(){l=document.createElement("ul"),l.className="v-popup-2",e.appendChild(l);let r=null;const a=e=>{l.style.display="none";let t=e.target.getAttribute("commandId"),o=document.querySelector("#"+t);"BUTTON"==o.tagName?o.click():o.children[0].click(),unmask(r)};e.style.position="relative";let n=document.createElement("div");n.className="v-mobil v-table-buttons";let s=document.createElement("i");s.className="fa fa-bars fa-w-14",n.appendChild(s),n.onclick=()=>{for(o=e.querySelectorAll(".v-datatable-header .v-button");l.firstChild;)l.removeChild(l.firstChild);for(s=0;s<o.length;s++)if("none"!=o[s].style.display){let e=document.createElement("li");if(o[s].id||(o[s].id="c-"+id()),e.setAttribute("commandId",o[s].id),"BUTTON"==o[s].tagName){if(o[s].disabled)continue;e.appendChild(o[s].children[0].cloneNode(!0)),e.appendChild(document.createTextNode(o[s].value?o[s].value:o[s].title))}else o[s].children[0].children[1]&&(e.appendChild(o[s].children[0].children[1]),e.appendChild(document.createTextNode(o[s].textContent)));e.onclick=a,l.appendChild(e)}r=mask(l),l.style.display="block",r.onclick=()=>{l.style.display="none",unmask(r)}},e.appendChild(n),_$1.storeFunction[t]=l}),500)}},resize=()=>{},MsgBox$1=(e,t,l)=>{if(l||(l=["OK"]),!document.body)return;let o=document.createElement("div");o.classList.add("v-overlay"),o.style.padding="40px",o.style.zIndex="2000",document.body.appendChild(o);let r=document.createElement("div"),a=document.createElement("div"),n=document.createElement("div"),s=document.createElement("div");s.className="v-msgbox-buttons",r.classList.add("v-dialog"),r.classList.add("v-msgbox"),n.innerHTML=e,r.setAttribute("path",_$1.currentPath);let i=function(){r.style.display="none",o.style.display="none",r.parentNode.removeChild(r),o.parentNode.removeChild(o),t&&t(this.getAttribute("index"))};for(let e=0;e<l.length;e++){let t=document.createElement("button");t.innerHTML=l[e],t.type="button",t.setAttribute("index",e),t.className="v-button ui-widget ui-state-default ui-corner-all",s.appendChild(t),t.addEventListener("click",i)}a.className="v-dialog-content v-widget-content",a.appendChild(n),a.appendChild(s),r.appendChild(a),o.appendChild(r),o.style.visibility="unset",o.style.opacity="unset",o.style.overflow="auto",r.style.margin="0 auto",r.style.position="unset"},configureAxios=e=>{if(e.configured)return;let t;e.configured=1,_$1.axios_get=e.get,e.interceptors.request.use((function(e){return _$1.eeee=e,e.mask?e.mask():t||(t=mask()),e}),(function(e){return t=unmask(t),MsgBox$1("request "+id()+" "+e.message),Promise.reject(e)})),e.interceptors.response.use((function(e){return t=unmask(t),e}),(function(l){if(e.error&&0==e.error(l))t=unmask(t);else{let e=l.response,o=e&&e.data&&e.data.msg?e.data.msg:l.message;if(e&&(e.data&&e.data.message&&(o=e.data.message),"string"==typeof e.data&&(o=e.data),o||(o=e.status+": "+e.statusText)),t=unmask(t),e&&401==e.status&&_$1.app)return _$1.app.toast("Session terminada"),void _$1.app.logout();l.config?.error?l.config.error(l,o):(console.log(l),l.request?MsgBox$1("<b>"+l.request.responseURL+"</b><br/><br/>"+o):MsgBox$1(o))}return delete e.error,Promise.reject(l)}))},pad=(e,t)=>{if(null!=e){let l=1*e+"";for(;l.length<t;)l="0"+l;return l}},clean=e=>{const t={...e};for(let e in t)""!==t[e]&&null!==t[e]&&"function"!=typeof t[e]&&void 0!==t[e]||delete t[e];return t},sum=e=>(void 0).reduce(((t,l)=>t+((l=e?l[e]:l)?Number(l):0)),0);function createGetters(){return{get networkStatus(){return _$1.app?.networkStatus||{connected:!0}},get db(){return _$1.app?.db},app:()=>_$1.app,setApp(e){_$1.app=e}}}const app=()=>_$1.app,db=()=>_$1.db,initDB=(e,t)=>{let l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;if(_$1.IDBTransaction=window.IDBTransaction||window.webkitIDBTransaction||window.msIDBTransaction,_$1.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange||window.msIDBKeyRange,l){if(l)return _$1.stores=t,new Promise(((o,r)=>{let a=l.open("db",e);a.onupgradeneeded=e=>{let l=e.target.result;t.forEach((e=>{l.objectStoreNames.contains(e[0])||l.createObjectStore(e[0],e[1])}))},a.onerror=e=>{r(e)},a.onsuccess=()=>{_$1.db=a.result,o(_$1.db)}}))}else window.alert("Your browser doesn't support a stable version of IndexedDB.");return l},getStoredList=async(e,t)=>{const l=db();let o;try{o=JSON.parse(sessionStorage.getItem("loadedStores"))}catch(e){}if(null==o&&(o={}),!o[e]&&networkStatus.connected){let t=_$1.stores.filter((t=>t[0]==e))[0];if(!t[2])throw`ERROR: Url for store '${t[0]}' is empty!`;let r=t[2]?await _$1.axios_get(t[2]):[];r=r.data||r,await new Promise(((a,n)=>{let s=l.transaction([t[0]],"readwrite"),i=s.objectStore(t[0]);const u=i.clear();u.onsuccess=()=>{console.log("data:",r),r.forEach((e=>{i.add(e).onerror=e=>{console.error(`⚠️ Store '${e[0]}' error addd data!`,e)}}))},u.onerror=()=>{console.error(`⚠️ Store '${t[0]}' error data!`,t)},s.oncomplete=()=>{o[e]=1,sessionStorage.setItem("loadedStores",JSON.stringify(o)),a()},s.onerror=e=>{console.error(`ERROR: ⚠️ Error en la transacción for store '${e[0]}'!`,e),n()}}))}return await new Promise(((t,o)=>{if(l){const o=l.transaction(e).objectStore(e).getAll();o.onsuccess=()=>{t(o.result)}}else console.log("1=========>db=",window._.db),o("=======>db is null esta faltando")}))},getters=createGetters(),{networkStatus:networkStatus,setApp:setApp}=getters,useAppStore=pinia.defineStore("connection",(()=>{const e=getPiniaInstance(),t=getConfigApp();if(!e)throw new Error("Pinia no ha sido inicializado. Llama a setupPinia() en tu app.");const l=vue.ref(!1),o=vue.ref(!1),r=vue.ref(t.router),a=vue.ref(t.axios),n=vue.ref(null),s=vue.ref(null);l.value="false"!==localStorage.getItem("connected");const i=localStorage.getItem("session");n.value=i?JSON.parse(i):null,vue.watch(l,(e=>{localStorage.setItem("connected",String(e))})),vue.watch(n,(e=>{localStorage.setItem("session",JSON.stringify(e))}));const u=vue.computed((()=>s.value?.connected)),c=vue.computed((()=>!!n.value?.token));return{connected:l,session:n,logout:()=>{l.value=!1,n.value=null,localStorage.removeItem("connected"),localStorage.removeItem("session"),r.value.push("/login")},unauthorized:o,connect:e=>{n.value=e,r.value.push("/admin")},authenticated:c,config:({axios:e,router:t})=>{t&&(r.value=t),e&&(a.value=e,configureAxios(e))},axios:a,router:r,online:u,networkStatusChange:e=>{s.value=e}}}));var script$q={name:"VAutocomplete",props:{value:{type:Object,required:!0},data:{type:Array,default:()=>null},placeholder:String,label:String,default:Object,store:String,params:Object,autoload:{type:Boolean,default:!1},floating:{type:Boolean,default:!0},src:String,readonly:Boolean,nowrap:Boolean,disabled:Boolean,showSelection:{type:Boolean,default:!0},pagination:{type:Number,default:10}},setup(e,t){const{emit:l,slots:o}=t;useAppStore();const r=vue.ref(0),a=vue.ref(null),n=vue.ref(-1),s=vue.ref(""),i=vue.ref(null),u=vue.ref(!1),c=vue.ref(0),d=vue.ref("");vue.watch((()=>e.value),(e=>{a.value=e})),vue.watch((()=>e.data),(e=>{i.value=e})),vue.onMounted((()=>{d.value=e.inputClass,e.autoload&&v(),document.addEventListener("click",h)})),vue.onBeforeUnmount((()=>{document.removeEventListener("click",h)}));const p=vue.computed((()=>{n.value=-1;const e=s.value?s.value.trim().toLowerCase().split(/[ ,]+/):null;return i.value&&s.value?i.value.filter((t=>{const l=JSON.stringify(t).toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"");return e.every((e=>l.includes(e)))})):i.value})),v=async t=>{const{src:o,source:a}=e;let n=Number(e.pagination);if(1===t)r.value+=n;else if(r.value=0,e.data&&e.autoload)return;let d={query:s.value};e.params&&(d=mergeDeep(d,e.params)),axios$2.get((o||e.source)+(n>0?"/"+r.value+"/"+n:""),{params:d}).then((l=>{const o=l.data;console.log(o),o.error?MsgBox(o.error):(i.value=1===t?i.value.concat(o.data?o.data:o):o.data?o.data:o,console.log(i),c.value=o.size,e.autoload||(u.value=!0),console.log("========================="))})).catch(m).then((()=>{l("complete",{data:i.value,query:s.value,target:"me"})}))},m=e=>{console.log(e)},h=e=>{};return{query:s,show:u,selected:a,data2:p,focused:n,inputClass:d,search:v,remove:()=>{l("input",null)},clickout:h,focusout:e=>{},setSelected:e=>{a.value=e,l("update:modelValue",e)},getLabel:t=>{if(e.label){const l=e.label.split(".");for(let e=0;e<l.length;e++)t&&(t=t[l[e]])}return t},hasSlot:(e="default")=>!!o[e]}}};const _hoisted_1$i=["value","disabled"],_hoisted_2$9=["disabled","placeholder"],_hoisted_3$5={class:"v-list"},_hoisted_4$3=["onClick"],_hoisted_5$1={key:0,class:"center yellow",style:{padding:"5px"}};function render$m(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("div",{class:"v-autocomplete",onFocusout:t[7]||(t[7]=(...e)=>o.focusout&&o.focusout(...e)),value:l.value,disabled:l.disabled},[o.selected&&l.showSelection?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"v-selection",style:vue.normalizeStyle({whiteSpace:l.nowrap?"nowrap":""})},[vue.renderSlot(e.$slots,"label",{selected:o.selected}),vue.createTextVNode(" "+vue.toDisplayString(o.hasSlot("label")?" ":o.getLabel(o.selected))+" ",1),l.readonly?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:0,onClick:t[0]||(t[0]=(...e)=>o.remove&&o.remove(...e)),class:"remove-icon"},t[8]||(t[8]=[vue.createElementVNode("i",{class:"fa fa-times"},null,-1)])))],4)):vue.createCommentVNode("v-if",!0),o.selected?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:1,onClick:t[1]||(t[1]=(...e)=>o.search&&o.search(...e)),class:"search-icon"},t[9]||(t[9]=[vue.createElementVNode("i",{class:"fa fa-xs fa-sync"},null,-1)]))),o.selected?vue.createCommentVNode("v-if",!0):vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{key:2,onKeyup:[t[2]||(t[2]=(...t)=>e.keyup&&e.keyup(...t)),t[3]||(t[3]=vue.withKeys(vue.withModifiers(((...e)=>o.search&&o.search(...e)),["stop","prevent"]),["enter"]))],class:vue.normalizeClass(o.inputClass),onFocus:t[4]||(t[4]=e=>o.show=!0),disabled:l.disabled,placeholder:l.placeholder,"onUpdate:modelValue":t[5]||(t[5]=e=>o.query=e)},null,42,_hoisted_2$9)),[[vue.vModelText,o.query]]),vue.createVNode(vue.Transition,{name:"fade",persisted:""},{default:vue.withCtx((()=>[vue.withDirectives(vue.createElementVNode("div",{class:"v-resultpane",style:vue.normalizeStyle({zIndex:2,width:"calc(100% - 2px)",position:l.floating?"absolute":"relative"})},[vue.createElementVNode("div",_hoisted_3$5,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(o.data2,((t,l)=>(vue.openBlock(),vue.createElementBlock("div",{key:l,class:vue.normalizeClass({"v-selected":o.selected==t,"v-focused":o.focused==l}),onClick:e=>o.setSelected(t)},[vue.renderSlot(e.$slots,"default",{row:t})],10,_hoisted_4$3)))),128)),e.data0&&e.data0.length<e.total?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"center",onClick:t[6]||(t[6]=e=>o.search(1))},"Load more "+vue.toDisplayString(e.total-e.data0.length)+" results...",1)):vue.createCommentVNode("v-if",!0)]),o.data2&&o.data2.length<1?(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,"No results found.")):vue.createCommentVNode("v-if",!0)],4),[[vue.vShow,o.show&&!o.selected]])])),_:3})],40,_hoisted_1$i)}script$q.render=render$m,script$q.__scopeId="data-v-72884078",script$q.__file="src/v-autocomplete.vue";var script$p={name:"VButton",mounted(){var e=this,t=document.createElement("span"),l=document.createElement("i");t.className="ui-button-text ui-c ",t.innerHTML=e.$attrs.value?e.$attrs.value:"ui-button",e.$el.addEventListener("click",(t=>{t.component=e})),e.$attrs.icon?(e.$attrs.value?e.$el.classList.add("v-button-text-icon-left"):e.$el.classList.add("v-button-icon-only"),l.dataset.icon=e.$attrs.icon,l.className="fa "+e.$attrs.icon,e.$el.appendChild(l)):(t=document.createElement("span"),e.$el.classList.add("ui-button-text-only"),e.$el.appendChild(t)),e.$attrs.value&&((t=document.createElement("span")).appendChild(document.createTextNode(e.$attrs.value)),e.$el.appendChild(t)),e.updateIcon()},methods:{updateIcon(){var e=this;setTimeout((function(){var t=e.$el.querySelector("svg");if(t){var l=t.dataset;l.icon||(l.icon=e.$attrs.icon)}}),1e3)}}};const _hoisted_1$h={type:"button",class:"_ ui-widget ui-state-default ui-corner-all v-button"};function render$l(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("button",_hoisted_1$h)}script$p.render=render$l,script$p.__file="src/v-button.vue";var script$o={name:"VCalendar",props:{modelValue:null,type:String,required:String,readonly:String,max:String,min:String},setup(e,{emit:t}){const{type:l,modelValue:o,max:r,min:a}=e,n=vue.ref(null),s=e=>{t("update:modelValue",e),vue.nextTick((()=>{t("changed",e)}))},i=e=>{if(e){let t;if("time"===l)return t=e.split(":"),new Date(1981,1,6,parseInt(t[0]),parseInt(t[1]),t.length>2?parseInt(t[2]):0);{if(!isNaN(e))return new Date(e);let o;if("datetime-local"===l)return o=e.split("T"),t=o[1].split(":"),o=o[0].split("-"),o=new Date(parseInt(o[0]),parseInt(o[1])-1,parseInt(o[2]),parseInt(t[0]),parseInt(t[1]),t.length>2?parseInt(t[2]):0),o;{o=e.split("-");let t=parseInt(o[0]);return t<100?e:(o=new Date(t,parseInt(o[1])-1,parseInt(o[2])),o)}}}return e};vue.watch((()=>e.modelValue),(e=>{u(e)}));const u=e=>{if(!n.value)return;let t,o=i(e);o&&(t="time"===l?pad(o.getHours(),2)+":"+pad(o.getMinutes(),2):"datetime-local"===l?pad(o.getFullYear(),4)+"-"+pad(o.getMonth()+1,2)+"-"+pad(o.getDate(),2)+"T"+pad(o.getHours(),2)+":"+pad(o.getMinutes(),2):pad(o.getFullYear(),4)+"-"+pad(o.getMonth()+1,2)+"-"+pad(o.getDate(),2)),n.value.value=t};return{enterD:e=>{let o=e.target.value,n=i(o);return r&&n&&n.getTime()>=i(r).getTime()||a&&n&&n.getTime()<=i(a).getTime()?(t("invalid",{target:me,value:n}),n=null,void(e.target.value=n)):void("time"===l?s(pad(n.getHours(),2)+":"+pad(n.getMinutes(),2)+":00"):n.getTime&&s(n.getTime()))},input:n}}};const _hoisted_1$g=["required","readonly","min","max","type"];function render$k(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("input",{required:l.required,ref:"input",readonly:l.readonly,min:l.min,max:l.max,onChange:t[0]||(t[0]=(...e)=>o.enterD&&o.enterD(...e)),type:l.type?l.type:"date"},null,40,_hoisted_1$g)])}script$o.render=render$k,script$o.__file="src/v-calendar.vue";var script$n={name:"VCheckboxGroup",props:{required:String,name:String},data:()=>({value:[],options:[],nam:null}),created(){this.nam||(this.nam=this.$props.name?this.$props.name:"input_"+id()),this.update2()},updated(){this.update2()},mounted(){this.options=this.$el.querySelectorAll("input:not(.v-chk)");for(var e=0;e<this.options.length;e++)this.options[e].classList.add("v-chk");this.update2()},methods:{update2(){var e=this.options,t=this.$attrs.value;"string"==typeof t&&(t=t.split("|"));for(var l=0;l<e.length;l++){e[l].checked=!1;for(var o=0;t&&o<t.length;o++)e[l].value==t[o]&&(e[l].checked=!0)}},onChange:function(e,t){var l=this,o=l.$attrs.value;if(("string"==typeof o||o instanceof String)&&(o=o.split("|")),t)o||(l.$attrs.value=o=[]),o.push(e);else{var r=o.indexOf(e);r>-1&&o.splice(r,1)}l.$emit("input",o)}}};function render$j(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("div",null,[vue.renderSlot(e.$slots,"default")])}script$n.render=render$j,script$n.__file="src/v-checkbox-group.vue";var script$m=vue.defineComponent({name:"VCheckbox",props:{value:null,modelValue:null,valueFalse:null,label:String,readonly:Boolean},emits:["update:modelValue"],setup(e,{emit:t}){const l=vue.ref(null),o=vue.ref(0),r=vue.computed((()=>e.value?e.value===e.modelValue:["true","1",!0].includes(e.modelValue)));vue.watch((()=>e.modelValue),(e=>{l.value&&(l.value.checked=r.value)}));return vue.onMounted((()=>{l.value&&(l.value.checked=r.value)})),{input:l,hadValue:o,isChecked:r,change:()=>{if(!e.readonly){const r=l.value.checked,a=r?e.value||r:e.valueFalse??r;a&&(o.value=1),t("update:modelValue",a)}},getLabel:vue.computed((()=>e.label||("string"==typeof e.value?e.value:"")))}}});const _hoisted_1$f=["innerHTML"],_hoisted_2$8=["checked","value"];function render$i(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("label",{style:{"font-weight":"normal !important",display:"block"},class:"v-checkbox",onClick:t[1]||(t[1]=vue.withModifiers((()=>{}),["stop"]))},[vue.createElementVNode("span",{innerHTML:e.getLabel},null,8,_hoisted_1$f),vue.createElementVNode("input",{ref:"input",type:"checkbox",checked:e.isChecked,onChange:t[0]||(t[0]=(...t)=>e.change&&e.change(...t)),value:e.value},null,40,_hoisted_2$8),t[2]||(t[2]=vue.createElementVNode("span",{class:"checkmark"},null,-1))])}script$m.render=render$i,script$m.__file="src/v-checkbox.vue";var script$l={name:"VDataview",props:{value:Array,filterKey:String,src:String,filters:Object,store:null,itemWidth:null,rowKey:String,rowStyleClass:null,pagination:null,selectable:Boolean,scrollable:Boolean,autoload:{type:Boolean,default:!0}},data:function(){return{data:null,pages:1,page:1,columns:1,w:0,row:{},error:null,size:null,sortKey:"",selected:[],sortOrders:{},rowStyleClassFunc:null}},created(){var me=this;try{me.rowStyleClass&&(eval("me.rowStyleClassFunc=function(row,item,index){return "+me.rowStyleClass+"}"),me.rowStyleClassFunc({},{},0))}catch(e){me.rowStyleClassFunc=null,console.log("Error en la expresion rowStyleClassFunc=function(row,item,index){return "+me.rowStyleClass+"}")}},updated(){console.log("updated"),this.$emit("updated"),this.resize()},mounted(){var e=this;e.$el.addEventListener("parentResize2",e.resize),e.autoload&&e.load(),e.resize()},methods:{resize(){var e=this;if(e.itemWidth){var t=1+Math.trunc(e.$el.offsetWidth/Number(e.itemWidth));t>6&&(t=6),e.columns=t}},async getStoredList(e){let t=new Promise((t=>{var l=window._.db.transaction(e).objectStore(e).getAll();l.onsuccess=function(){t(l.result)}}));return await t},async loadStore(){let e=this,t=e.store;if(null!=t){let l;return window._.db&&(l=await e.getStoredList(t)),l||(l=[]),e.data=e.data?l.concat(e.data):l,console.log("loadStore"),console.log(e.data),e.data}},getRowClass(e,t){var l=this,o=t%l.columns+1,r=["c-w-"+l.columns];return o==l.columns&&r.push("v-last"),l.rowStyleClassFunc?r.push(l.rowStyleClassFunc(e,e,t)):r.push(l.rowStyleClass),r},remove(e){e=e.id?e.id:e;var t=this.data,l=t.map((e=>e.id)).indexOf(e);t.splice(l,1)},error2(e,t){this.data=[],this.error=t},load(e){var t=this;if(this.selected=[],t.value)t.data=t.value;else{!0===e&&(t.page=1);var l=t.src;l||(l=t.$root.apiLink(window.location.pathname)),l.endsWith("/")&&(l=l.slice(0,l.length-1)),t.pagination&&(l+="/"+(t.page-1)*t.pagination+"/"+t.pagination),axios.get(l,{error:t.error2,params:t.filters}).then((function(l){if(l.data&&l.data.error)MsgBox(l.data.error);else{var o=t.value?t.value:l.data.data?l.data.data:l.data;t.data||(t.data=[]),t.data=!0===e?o:t.data?t.data.concat(o):t.data,t.size=l.data.size,l.data&&l.data.size&&(t.pages=Math.ceil(l.data.size/t.pagination),t.page>t.pages&&(t.page=1)),t.$emit("loaded",{target:t,response:l})}})).catch(t.error)}}}};const _hoisted_1$e={class:"v-dataview"};function render$h(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$e,[e.data?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(e.data,((t,l)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(a.getRowClass(t,l))},[vue.renderSlot(e.$slots,"default",{row:t,item:t,index:l})],2)))),256)):vue.createCommentVNode("v-if",!0),e.data&&!e.data.length?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(["center v-no-results",{error:e.error}])},vue.toDisplayString(e.error?e.error:"No existen registros para mostrar"),3)):vue.createCommentVNode("v-if",!0),e.data&&e.size>e.data.length?(vue.openBlock(),vue.createElementBlock("div",{key:2,onClick:t[0]||(t[0]=t=>a.load(e.page++)),class:"center v-more-results"},"Ver mas resultados")):vue.createCommentVNode("v-if",!0)])}script$l.render=render$h,script$l.__file="src/v-dataview.vue";var script$k={name:"VFieldset",props:{legend:String,closable:null},watch:{closed(e){this.$emit("change",{target:this,closed:e}),this.$emit("input",!e)}},data:()=>({closed:!1}),created(){this.closed=this.closable},mounted(){var e=this;e.$el.addEventListener("parentResize",(t=>{t.$target=e,e.$emit("resize",t)}))},updated(){var e=this;setTimeout((function(){var t=e.$el.querySelector("legend > * > svg");if(t)try{console.log(),t.dataset.icon=t.parentNode.dataset.icon}catch(e){console.log("icon"),console.log(e)}}),50)}};const _hoisted_1$d={class:"v-fieldset"},_hoisted_2$7=["data-icon"],_hoisted_3$4=["innerHTML"],_hoisted_4$2={style:{flex:"1",display:"flex","flex-direction":"column"}};function render$g(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("fieldset",_hoisted_1$d,[l.legend?(vue.openBlock(),vue.createElementBlock("legend",{key:0,onClick:t[0]||(t[0]=e=>r.closed=l.closable&&!r.closed),style:vue.normalizeStyle({cursor:l.closable?"pointer":""})},[l.closable?(vue.openBlock(),vue.createElementBlock("span",{key:0,"data-icon":r.closed?"plus":"minus",style:{margin:"0px 5px 0px 0px"}},[vue.createElementVNode("i",{class:vue.normalizeClass([r.closed?"fa-plus":"fa-minus","fa"])},null,2)],8,_hoisted_2$7)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("span",{innerHTML:l.legend},null,8,_hoisted_3$4)],4)):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createElementVNode("div",_hoisted_4$2,[vue.renderSlot(e.$slots,"default")],512),[[vue.vShow,!r.closed]])])}script$k.render=render$g,script$k.__file="src/v-fieldset.vue";var script$j={name:"VForm",props:["header","store","action"],setup(e,t){const{store:l}=e,{slots:o,expose:r}=t;return vue.inject("tableCollect").push({store:l}),r({abc:()=>{alert(8)},...e}),()=>{const t=[];return e.header&&t.push(vue.h("div",{class:"v-widget-header v-panel-titlebar"},[vue.h("span",{class:"v-panel-title"},e.header)])),t.push(vue.h("div",{class:"v-dialog-content v-widget-content"},[vue.h("form",{action:e.action},o.default())])),vue.h("div",{class:"ui-panel"},t)}},watch:{header(e){this.setTitle(e)}},data:()=>({timer:null}),methods:{setTitle(e){var t=this.$parent.app;t&&setTimeout((()=>{t.title=e}),100)},getAbsoluteHeight(e){var t=window.getComputedStyle(e),l=parseFloat(t.marginTop)+parseFloat(t.marginBottom);return Math.ceil(e.offsetHeight+l)},resize(e){var t=this,l=t.$el,o=e.height;l.style.height=o+"px",t.timer&&clearTimeout(t.timer),t.timer=setTimeout((()=>{if(l.parentElement){var e;if(l.children[1])o-=l.children[0].offsetHeight,l.children[1].style.height=o+"px",l.children[1].style.overflowY="auto",(l=l.children[1].children[0]).style.height=o+"px",l.children&&(l.parentNode.style.overflowY="hidden",l.parentNode.style.overflow="hidden"),[].forEach.call(l.children,((r,a)=>{a==l.children.length-1&&"CENTER"==r.tagName||!r.classList.contains("v-scrollable")&&!r.classList.contains("v-form")&&!r.classList.contains("v-resize")?o-=t.getAbsoluteHeight(r):e||(e=r)})),l=e;else(l=l.children[0]).style.height=o+"px";if(l){l.style.overflowY="auto",l.style.height=o+"px";var r=new Event("parentResize",{bubbles:!0});r.height=o,l.children[0].dispatchEvent(r),r.$target=t,t.$emit("resize",r)}}}),500)}},mounted(){var e=this;e.$el.querySelector("form").addEventListener("submit",(t=>{t.preventDefault();var l=e.$parent;return l.refresh&&l.refresh(),!1})),e.setTitle(e.header),e.$el.addEventListener("parentResize",(t=>{t.target==e.$el&&e.resize(t)}))},beforeUnmount(){console.log("unmounted")},updated(){for(var e=this,t=e.$el.querySelectorAll("[type=number]:not(._)"),l=0;l<t.length;l++){var o=()=>{var e=this,t=e.value;if(t){t=n(t),e.max&&t>n(e.max)&&(t=n(e.max)),e.min&&t<n(e.min)&&(t=n(e.min));var l=this.getAttribute("decimal");null!==l&&(t=t.toFixed(1*l)),e.value=t}};t[l].oninput=o,t[l].onblur=o,t[l].classList?t[l].classList.add("_"):t[l].className="_"}t=e.$el.querySelectorAll(".numeric:not(._)");for(l=0;l<t.length;l++)t[l].addEventListener("keyup",(e=>{86==e.keyCode&&isNaN(this.value)&&(this.value="")})),t[l].addEventListener("keydown",(e=>{console.log("eeeeeee"+e.keyCode),-1!==[46,8,9,27,13,110,88,86].indexOf(e.keyCode)||65===e.keyCode&&(!0===e.ctrlKey||!0===e.metaKey)||e.keyCode>=35&&e.keyCode<=40||(e.shiftKey||e.keyCode<48||e.keyCode>57)&&(e.keyCode<96||e.keyCode>105)&&e.preventDefault()})),t[l].classList?t[l].classList.add("_"):t[l].className="_";var r=function(e){var t=this,l=t.previousElementSibling;if(l&&l.classList&&l.classList.contains("v-error")&&l.parentNode.removeChild(l),!t.disabled&&!t.getAttribute("disabled")&&(t.required||"DIV"===t.tagName)&&("DIV"!=t.tagName&&!t.value||"DIV"===t.tagName&&!t.attributes.value)){for(l=t.previousElementSibling;l&&1!=l.nodeType;)l=l.previousElementSibling;if(!l)for(l=t.parentElement.previousElementSibling;l&&1!=l.nodeType;)l=l.previousElementSibling;var o=document.createElement("div");o.innerHTML="Este campo es requerido!",o.classList.add("v-error"),t.parentNode.insertBefore(o,t)}};e.$el.querySelectorAll("select,input[type=date]:not(.__),input[type=text]:not(.__),textarea:not(.__)").forEach((e=>{e.addEventListener("focusout",r),e.classList?e.classList.add("__"):e.className="__"}))},__file:"src/v-form.vue"},script$i={name:"VGroup",props:{required:String,name:String},data:()=>({value:null,nam:null}),updated(){this.update2()},mounted(){this.update2()},created(){this.nam||(this.nam=this.$props.name?this.$props.name:"input_"+window._.id())},methods:{getInputs(e,t){var l=this;return e.children&&Array.from(e.children).forEach((e=>{"INPUT"==e.tagName?t.push(e):e.classList.contains("v-group")||l.getInputs(e,t)})),t},update2(){for(var e=this.getInputs(this.$el,[]),t=0;t<e.length;t++)e[t].value==this.$attrs.value?e[t].checked=!0:e[t].checked=!1},onChange(e){this.value=e,""===e&&(e=null),this.$emit("input",e)}}};const _hoisted_1$c={class:"v-group"};function render$f(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$c,[vue.renderSlot(e.$slots,"default")])}script$i.render=render$f,script$i.__file="src/v-group.vue";var script$h={name:"VLayerControl",data:()=>({loaded:null,map:null,district:null,dl:null}),setup({baseURL:e="http://web.regionancash.gob.pe"},{emit:t}){const l=vue.ref(),o=vue.inject("collector"),r=vue.ref(),a=vue.ref();let n,s;return o.push((o=>{(o=>{a.value=o;let i=new ol$1.Collection;l.value=i;let u=document.createElement("i");u.setAttribute("class","fa fa-expand"),o.addControl(new FullScreen({label:u,tipLabel:"Fullscreen"}));let c=new VectorSource({url:e+"/fs/geo/02.geojson",format:new GeoJSON}),d=r.value=new VectorLayer({source:c,style:e=>new style.Style({fill:new style.Fill({color:"rgba(255, 0, 0, 0.0)"}),stroke:new style.Stroke({color:"#4073CE",width:1}),text:new style.Text({text:e.values_.name?e.values_.name.toUpperCase():"",fill:new style.Fill({color:"#4073CE"}),stroke:new style.Stroke({color:"#4073CE",width:.5})})}),id:"provinces"});d.onChange=e=>{let t=e.feature;s!=t.getId()&&(i.clear(),i.push(t),e.preventDefault&&e.preventDefault(),s=t.getId(),n=t,o.getView().fit(t.getGeometry().getExtent(),{duration:200,callback:()=>{}}))};let p=c.on("change",(()=>{let e,t=c.getFeatures();for(let l=0;l<t.length;l++)if(1*t[l].id_==1*e){d.onChange({feature:t[l]});break}Observable.unByKey(p)})),v=new VectorLayer({preload:1/0,source:new VectorSource,id:"districts",style:e=>new style.Style({fill:new style.Fill({color:"rgba(16, 110, 138, 0.0)"}),stroke:new style.Stroke({color:"#194300",width:1}),text:new style.Text({text:e.values_.name?e.values_.name.toUpperCase():"",fill:new style.Fill({color:"#194300"}),stroke:new style.Stroke({color:"#194300",width:.5})})})});o.on("moveend",(()=>{if(n){if(n.id_<1e4){v.setSource(new VectorSource({url:e+"/fs/geo/"+n.id_+".geojson",format:new GeoJSON}));let t=v.getSource().on("change",(()=>{Observable.unByKey(t)}))}t("scope",{feature:n,target:{}}),n=null}})),d.onSelect=e=>{me.$emit("select",e)},o.addLayer(d),o.addLayer(new VectorLayer({id:"district",source:new VectorSource,style:new style.Style({fill:new style.Fill({color:"rgba(255, 150, 150, 0.0)"}),stroke:new style.Stroke({color:"#4073CE",width:1})})})),new style.Style({fill:new style.Fill({color:"rgba(16, 110, 138, 5.0)"})}),new style.Style({fill:new style.Fill({color:"rgba(255, 150, 150, 0.0)"})}),v.onChange=e=>{let t=e.feature;s!=t.getId()&&(2==i.getLength()&&i.pop(),i.push(t),e.preventDefault&&e.preventDefault(),s=t.getId(),n=t,o.getView().fit(t.getGeometry().getExtent(),{duration:300}))},v.onSelect=e=>{t("select",e)},o.addLayer(v),t("render",{map:o})})(o)})),{}}};function render$e(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("div",null,[vue.renderSlot(e.$slots,"default")])}script$h.render=render$e,script$h.__file="src/v-layer-control.vue";var script$g={name:"VMapControl",setup(e,{emit:t}){const{visible:l}=e,o=vue.ref(null),r=vue.ref(!!l),a=vue.inject("collector"),n=vue.ref(null);a.push((e=>{e.addControl(new Control({element:o.value})),n.value=!0}));const s=vue.ref();return{el:o,ready:n,visible0:r,enter:e=>{e.stopPropagation(),s.value?clearTimeout(s.value):t("click",e),s.value=setTimeout((()=>{s.value=null}),500)}}},props:{icon:String,visible:{default:1}},computed:{slotPassed(){return!!this.$slots.default}},data:()=>({slotUsed:!1}),updated(){var e=this.$el.querySelectorAll(":scope > :not(.v-map-control-button)").length;0==e&&(e=this.$el.textContent.trim().length),this.slotUsed=e},methods:{toggle(){this.visible0=!this.visible0}}};const _hoisted_1$b={ref:"el",class:"ol-unselectable ol-control"};function render$d(e,t,l,o,r,a){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",_hoisted_1$b,[vue.renderSlot(e.$slots,"default"),r.slotUsed?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("button",{key:0,class:"v-map-control-button",onClick:t[0]||(t[0]=vue.withModifiers(((...e)=>o.enter&&o.enter(...e)),["prevent"]))},[l.icon?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(["fa fa-xs",l.icon])},null,2)):vue.createCommentVNode("v-if",!0)]))],512)),[[vue.vShow,o.ready&&!0]])}script$g.render=render$d,script$g.__file="src/v-map-control.vue";class Drag extends PointerInteraction{constructor(){super({handleDownEvent:handleDownEvent,handleDragEvent:handleDragEvent,handleMoveEvent:handleMoveEvent,handleUpEvent:handleUpEvent}),this.layers_=[],this.coordinate_=null,this.listeners_=[],this.cursor_="pointer",this.feature_=null,this.previousCursor_=void 0}addLayers(e){e.forEach((e=>{this.layers_.push(e)}))}$on(e,t){this.listeners_.push(t)}}function handleDownEvent(e){const t=e.map,l=this.layers_,o=t.forEachFeatureAtPixel(e.pixel,(function(e,t){if(t&&l.indexOf(t)>-1)return[e,t]}));return o&&(this.coordinate_=e.coordinate,this.feature_=o[0]),!!o}function handleDragEvent(e){const t=e.coordinate[0]-this.coordinate_[0],l=e.coordinate[1]-this.coordinate_[1];this.feature_.getGeometry().translate(t,l),this.coordinate_[0]=e.coordinate[0],this.coordinate_[1]=e.coordinate[1]}function handleMoveEvent(e){if(this.cursor_){const t=e.map,l=this.layers_,o=t.forEachFeatureAtPixel(e.pixel,(function(e,t){if(t&&l.indexOf(t)>-1)return e})),r=e.map.getTargetElement();o?r.style.cursor!=this.cursor_&&(this.previousCursor_=r.style.cursor,r.style.cursor=this.cursor_):void 0!==this.previousCursor_&&(r.style.cursor=this.previousCursor_,this.previousCursor_=void 0)}}function handleUpEvent(){return this.listeners_.forEach((e=>{e({feature:this.feature,coordinate:this.coordinate_})})),this.coordinate_=null,this.feature_=null,!1}var script$f={name:"VMap",setup(e,{emit:t,expose:l}){const o=vue.ref(null),r=vue.ref(null),a=vue.ref(null),n=vue.ref(null),s=vue.reactive([]);vue.provide("collector",{remove(e){s.splice(s.indexOf(e),1)},push(e){s.push(e)}});const i=e=>{r.value.addLayer(e),t("addlayer",e)},u=(e,l)=>{let o,a;e=e||{};const n=r.value;e.lon&&e.lat?(a=[e.lon,e.lat],o=new geom.Point(a[0]>-100?proj.fromLonLat(a):a)):o=new geom.Point(n.getView().getCenter()),a=o.flatCoordinates;const s=a[0]<-1e4?proj.toLonLat(a):a;t("translateend",{lon:s[0],lat:s[1]}),e.geometry=o;const i=new Feature(e);i.data=e,"object"==typeof e.style?i.setStyle(e.style):i.setStyle(n.styleMap[e.style?e.style:"default"]),a=o.flatCoordinates,a=a[0]<-1e4?proj.toLonLat(a):a,t("translateend",{lon:a[0],lat:a[1]});const u=e.layer||"default";let c=n.getLayerById(u);if(c?c.getSource().addFeatures(i):n.addLayer(c=new VectorLayer({id:u,source:new VectorSource({features:new ol$1.Collection([i])})})),e.draggable){let e=n.drag;e||(n.drag=e=new Drag,e.$on("up",(({coordinate:e,feature:l})=>{const o=proj.toLonLat(e);t("translateend",{lon:o[0],lat:o[1],feature:l})})),n.addInteraction(e),e.addLayers([c]))}return l&&n.getView().animate(Object.assign({center:i.getGeometry().getCoordinates(),zoom:17,duration:500},l)),i},c=e=>{const l={default:new style.Style({image:new style.Circle({radius:8,stroke:new style.Stroke({color:"#8a0000",width:2}),fill:new style.Fill({color:"#ff0000"})})}),star:[new style.Style({image:new style.RegularShape({fill:new style.Fill({color:"#ff0000"}),stroke:new style.Stroke({color:"#8a0000",width:2}),points:5,radius:10,radius2:4,angle:0})})]};let o=((e,t)=>{t||(t=window.location.href);const l=new RegExp("[?&]"+e+"=([^&#]*)").exec(t);return l&&l[1]||0})("location"),i=-1;if(o){let e=o.split("/");o=[parseFloat(e[0]),parseFloat(e[1])],i=e[2],a.value=!0}else o=!1;const c=new Map({target:e,layers:[new layer.Tile({source:new source.OSM})],view:new View({center:[0,0],zoom:2})});c.getLayerById=function(e="default"){let t;return c.getLayers().forEach((l=>{l.get("id")!==e||(t=l)})),t},c.styleMap=l,a.value?(c.getView().setCenter(o),console.log("en el momento de cargar moved to pageLocation="+o),c.getView().setZoom(i||12),r.value=c,console.log("distarar evento buid pageLocation="+o),t("build",m)):(c.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],c.getSize()),r.value=c,t("build",{map:c}),s.forEach((e=>{e(c)}))),c.getView().getZoom(),c.on("moveend",(()=>{n.value&&(n.value(m),n=null),c.getView().getZoom()})),c.on("singleclick",(e=>{let t=c.forEachFeatureAtPixel(e.pixel,((e,t)=>{if(t)return[e,t]}));if(t){let l=t[1],o=t[0];if(e.feature=o,e.map=c,e.preventDefault(),l.onSelect)return void l.onSelect(e)}})),c.on("dblclick",(e=>{let l=c.forEachFeatureAtPixel(e.pixel,((e,t)=>{if(t)return[e,t]}));if(l){let o=l[1];if(l=l[0],e.feature=l,e.map=c,o.onChange)return void o.onChange(e);t("change",l),c.getView().animate({center:l.getGeometry().getCoordinates(),zoom:17,duration:500},(()=>{for(let t=0;t<m.$children.length;t++){let t=m.$children[0];t.open&&t.open(e)}}))}})),r.value=c,setTimeout((()=>{c.updateSize(),c.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],c.getSize()),r.value=c,t("build",{map:c,addFeature:u})}),100)};return vue.watch(o,(e=>{e&&vue.nextTick((()=>{t("beforeBuild"),c(e)}))})),l({addFeature:u,addLayer:i,map:r,empty:(e="default")=>{if(e=r.value.getLayerById(e)){const t=e.getSource();if(t instanceof VectorSource){return 0===t.getFeatures().length}}return!0}}),{el:o,addLayer:i,addFeature:u}},data:()=>({moved:!1,map:null,movingCompleted:null,styleMap:null,coordinate:{}})};const _hoisted_1$a={ref:"el"};function render$c(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[vue.renderSlot(e.$slots,"default")],512)}script$f.render=render$c,script$f.__file="src/v-map.vue";var script$e={name:"VNumber",props:{value:Number,max:Number,min:Number,delay:Number},setup(e,t){const{emit:l}=t,o=vue.ref(null);vue.onMounted((()=>{o.value=e.value})),vue.onUpdated((()=>{o.value=t.attrs.modelValue}));return{v:o,handleInput:t=>{let r=o.value;const a=t.target.getAttribute("decimal");null!==r?(r=num(r),e.max&&r>num(e.max)&&(r=num(e.max)),e.min&&r<num(e.min)&&(r=num(e.min)),null!==a&&(r=r.toFixed(Number(a)))):r=null,o.value=t.target.value;let n=_$1.calendarTimer;n&&clearTimeout(n),e.delay?_$1.calendarTimer=setTimeout((()=>{l("input",r),_$1.calendarTimer=null}),13===t.keyCode?0:e.delay):l("input",r)}}}};function render$b(e,t,l,o,r,a){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"number",onKeyup:t[0]||(t[0]=vue.withKeys(((...e)=>o.handleInput&&o.handleInput(...e)),["enter"])),"onUpdate:modelValue":t[1]||(t[1]=e=>o.v=e),onInput:t[2]||(t[2]=(...e)=>o.handleInput&&o.handleInput(...e)),class:"_"},null,544)),[[vue.vModelText,o.v,void 0,{number:!0}]])}script$e.render=render$b,script$e.__file="src/v-number.vue";var script$d={setup(e,t){const l=e,{valueField:o,displayField:r,store:a,filter:n,name:s}=l,{expose:i,emit:u}=t,c=vue.ref([]),d=vue.ref([]),p=vue.ref([]);vue.ref(null);const v=vue.inject("collect");o&&(p.value=o.split("."));const m=vue.computed((()=>{const e=(l.data||[]).concat(d.value||[]);return n?e.filter((e=>-1!==JSON.stringify(e).toLowerCase().indexOf(n.toLowerCase()))):e}));vue.watch(m,(e=>{}));const h=(e,t)=>{const l=p.value;if(l&&l.length)for(let t=0;t<l.length;t++)e&&(e=e[l[t]]);else e&&!t&&(e=e.id?e.id:e.code?e.code:e);return e};let g=o,f=r;f||(f=g);const y=async(e=null,t=null,l=!1)=>{if(!l&&t&&e&&c.value.push([e,t]),!(c.value.length>1)){if(d.value=[],a){let t=await getStoredList(a);const[l]=e?Object.keys(e):[];if(l){let o;try{const r=t.filter((t=>(o=t,o[l].startsWith(e[l]))));d.value=r}catch(e){log(s,"options.error trying to filter ",o),console.error(e)}}else d.value=d.value.concat(t)}for(v(m),l||c.value.shift();c.value.length;){const e=c.value.shift()||[];await y(e[0],e[1],!0)}}};return y.getObjectByIndex=e=>{const t=m.value;return t?t[e]:null},y.getValueByIndex=e=>{const t=m.value;return t?h(t[e],1):null},y.getIndexByValue=(e,t)=>{e&&e.id?e=e.id:e&&e.code&&(e=e.code);for(let l=0;l<m.value.length;l++){const o=m.value[l];if(h(o)==e)return t&&t(l,o),l}return t&&t(-1),-1},v.push(y),vue.onUpdated((()=>{v((l.data||[]).concat(d.value))})),vue.onUnmounted((()=>{v.remove(y)})),i({load:y}),()=>m.value.map((e=>g?vue.h("option",{value:h(e)},e[f]):vue.h("option",{value:e},e)))},name:"VOptions",props:{url:String,src:String,name:String,displayField:String,data:Array,store:null,valueField:String,filters:null,filter:null,mode:null},updated(){let e=this;!e.loaded&&e.data&&(e.data2=e.data)},methods:{getParentE(){return this.$el.parentElement.parentElement},getSelectedItem(){let e=this.$el.parentElement;return this.filterList[e.selectedIndex-1]}},__file:"src/v-options.vue"},ol=window.ol,_=window._,axios$1=window.axios,script$c={name:"VOverlay",props:{value:{value:Object},src:String,width:{default:400},header:String},data:()=>({coordinate:null,overlay:null,location:null,ele:null,c:0}),created(){var e=this;e.$parent.$on("beforeBuild",(t=>{console.log(t),e.overlay=new ol.Overlay({element:e.$el,positioning:"bottom-right"})})),e.$parent.$on("build",(t=>{t.map.addOverlay(e.overlay)}))},mounted(){var e=this;e.header&&e.$el.childNodes[0].addEventListener("mousedown",(function(t){const l=e.$el.parentElement;var o=window.getComputedStyle(l),r=parseFloat(o.left),a=parseFloat(o.top),n=t.clientX,s=t.clientY,i=l.parentElement;function u(e){l.style.left=r+e.clientX-n+"px",l.style.top=a+e.clientY-s+"px"}i.addEventListener("mousemove",u,!1),i.addEventListener("mouseup",(function(){i.removeEventListener("mousemove",u,!1)}),!1)}),!1)},methods:{close(){this.overlay&&this.overlay.setPosition()},hasSlot(e="default"){return!!this.$slots[e]||!!this.$scopedSlots[e]},load(){var e=this;axios$1.get(_.remoteServer+e.src).then((t=>{e.$emit("input",t.data)}))},open(e){for(var t=this,l=e.map,o=e.feature,r=t.overlay,a=r.element,n=t.$parent.$children,s=0;s<n.length;s++)n[s].close&&(n[s].$el.style.opacity=0,n[s].close());e.coordinate?t.coordinate=e.coordinate:(e.coordinate=l.getView().getCenter(),t.coordinate=null),r.setPosition(e.coordinate);var i=l.getView().getCenter(),u=l.getView().getResolution(),c=o?o.getGeometry().getCoordinates():[null],d=l.getPixelFromCoordinate(Number(c[0])?c:e.coordinate);if(this.src)axios$1.get(_.remoteServer+this.src).then((e=>{t.$emit("input",e.data),t.c++,setTimeout((function(){var e=l.viewport_.offsetWidth,o=l.viewport_.offsetHeight,n=a.children[0].children[1];n.scrollTop=0;var s=a.offsetHeight;n.style.height=s+100>=o?o-100-a.children[0].children[0].offsetHeight+"px":"300px",s=a.offsetHeight;var c=1*t.width,p=e<=c+40?e-40:c;if(a.style.zIndex=10,a.style.width=p+"px",p/=2,l.getView().animate({center:[i[0]+(d[0]+p+20>=e?+(d[0]+p+20-e):d[0]-20-p<0?-p+d[0]-20:0)*u,i[1]+(d[1]<s?s-d[1]:0)*u],duration:500}),d[0]=d[0]+p-0,d[1]=d[1]-12,r.setPosition(l.getCoordinateFromPixel(d)),t.$el.style.opacity=1,_.mobil)for(var v=r.getElement().querySelectorAll("a:not(._)"),m=0;m<v.length;m++)v[m].addEventListener("click",_.open2)}),400)})).catch((e=>{console.log(e)}));else{var p=l.viewport_.offsetWidth,v=l.viewport_.offsetHeight,m=a.children[0].children[1];m.scrollTop=0;var h=a.offsetHeight;console.log(a.offsetHeight),m.style.height=h+100>=v?v-100-a.children[0].children[0].offsetHeight+"px":"300px",h=a.offsetHeight;var g=1*t.width,f=p<=g+40?p-40:g;if(a.style.zIndex=10,a.style.width=f+"px",f/=2,l.getView().animate({center:[i[0]+(d[0]+f+20>=p?+(d[0]+f+20-p):d[0]-20-f<0?-f+d[0]-20:0)*u,i[1]+(d[1]<h?h-d[1]:0)*u],duration:500}),d[0]=d[0]+f-0,d[1]=d[1]-12,r.setPosition(l.getCoordinateFromPixel(d)),t.$el.parentNode.style.opacity=0,t.$el.style.opacity=1,t.$el.parentNode.style.top=(v-t.$el.offsetHeight)/2+"px",t.$el.parentNode.style.opacity=1,_.mobil){var y=r.getElement().querySelectorAll("a:not(._)");for(s=0;s<y.length;s++)y[s].addEventListener("click",_.open2)}t.$emit("opened",{target:t})}}}};const _hoisted_1$9={class:"v-ol-overlay"},_hoisted_2$6={key:0,class:"v-panel-titlebar"},_hoisted_3$3={key:2,style:{"text-align":"center"}};function render$a(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[l.header?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$6,[vue.createElementVNode("span",{class:"v-icon v-icon-close",onClick:t[0]||(t[0]=(...e)=>a.close&&a.close(...e))},t[1]||(t[1]=[vue.createElementVNode("i",{class:"fa fa-times"},null,-1)])),vue.createTextVNode(vue.toDisplayString(l.header),1)])):vue.createCommentVNode("v-if",!0),(vue.openBlock(),vue.createElementBlock("div",{class:"v-ol-body",key:"c-"+r.c,style:{padding:"10px"}},[l.value?vue.renderSlot(e.$slots,"default",{key:0,value:l.value}):vue.createCommentVNode("v-if",!0)])),a.hasSlot("footer")&&l.value?(vue.openBlock(),vue.createElementBlock("footer",{key:"f-"+r.c},[vue.renderSlot(e.$slots,"footer",{value:l.value})])):vue.createCommentVNode("v-if",!0),r.coordinate?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$3,t[2]||(t[2]=[vue.createElementVNode("img",{src:_imports_0,width:"20",height:"18"},null,-1)]))):vue.createCommentVNode("v-if",!0)])}script$c.render=render$a,script$c.__file="src/v-overlay.vue";var script$b={name:"VPanel",props:{header:String}};const _hoisted_1$8={class:"ui-panel"},_hoisted_2$5={key:0,class:"v-panel-titlebar v-widget-header ui-helper-clearfix ui-corner-all"},_hoisted_3$2={class:"v-panel-title"},_hoisted_4$1={class:"v-panel-content v-dialog-content v-widget-content"};function render$9(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8,[l.header?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$5,[vue.createElementVNode("span",_hoisted_3$2,vue.toDisplayString(l.header),1)])):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",_hoisted_4$1,[vue.renderSlot(e.$slots,"default")])])}script$b.render=render$9,script$b.__file="src/v-panel.vue";var script$a={name:"VPopup",data:()=>({show:null,overlay:null}),mounted(){var e=this;e.$el.addEventListener("close",(function(){e.hide()}))},destroyed(){var e=this.overlay;e&&(e.style.visibility="hidden",e.style.opacity=0,e.remove(),e=null)},methods:{hide(){var e=this.overlay;e&&(e.style.visibility="hidden",e.style.opacity=0),this.show=0},toggle(){var e=this;e.show=!e.show;var t=e.overlay;if(e.show){var l=document.querySelector(".v-layout-north");e.$el.style.top=l.offsetHeight+"px",console.log(e.$el),t||((t=document.createElement("div")).classList.add("v-overlay"),t.style.padding="40px",t.addEventListener("click",(function(){t.style.visibility="hidden",t.style.opacity=0,e.show=!1})),document.body.appendChild(e.overlay=t)),t.style.visibility="unset",t.style.opacity="unset"}else this.hide()}}};const _hoisted_1$7={class:"v-popup",style:{position:"absolute"}};function render$8(e,t,l,o,r,a){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[vue.renderSlot(e.$slots,"default")],512)),[[vue.vShow,r.show]])}script$a.render=render$8,script$a.__file="src/v-popup.vue";var script$9={name:"VRadio",props:{value:String,label:String,className:String},methods:{getClass(){return"v-radio "+this.className}},mounted(){var e=this,t=e.$el.querySelector("input");e.$parent&&e.$parent.nam&&(t.name=e.$parent.nam),t.onclick=function(){}},updated(){this.$el.querySelector("input")}};const _hoisted_1$6=["value"];function render$7(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("label",{class:vue.normalizeClass(a.getClass())},[vue.createTextVNode(vue.toDisplayString(l.label?l.label:l.value)+" ",1),vue.createElementVNode("input",{type:"radio",value:l.value},null,8,_hoisted_1$6),t[0]||(t[0]=vue.createElementVNode("span",{class:"checkmark"},null,-1)),vue.renderSlot(e.$slots,"default")],2)}script$9.render=render$7,script$9.__file="src/v-radio.vue";var script$8={__name:"v-radio-group",props:{required:String,name:String,modelValue:String,items:{type:Array},type:{type:String,default:"radio"},label:{type:String,default:""}},emits:["update:modelValue"],setup(e,{emit:t}){const l=e,o=t,r=vue.ref(l.modelValue),{proxy:a}=vue.getCurrentInstance(),n=new Set,s=(e,t)=>(e.children&&Array.from(e.children).forEach((e=>{"INPUT"===e.tagName?t.push(e):e.classList&&e.classList.contains("v-group")||s(e,t)})),t),i=()=>{const e=s(a.$el,[]);let t=l.name;t||(t="input_"+Date.now().toString(36)+Math.random().toString(36).substring(2,15));const o=""===a.$props.required||a.$props.required;let i=!1;for(let l=0;l<e.length;l++)e[l].name=t,n.has(e[l])||(e[l].addEventListener("change",u),n.add(e[l])),e[l].checked=e[l].value===r.value,e[l].checked&&(i=!0),e[l].required=o,o&&(r.value?e[l].nextElementSibling.classList.remove("required"):e[l].nextElementSibling.classList.add("required"));i&&removeError(e[0].parentNode.parentNode)},u=e=>{let t=e.target.value;""===t&&(t=null),r.value=t,o("update:modelValue",t)};vue.watch((()=>l.modelValue),(e=>{r.value=e,i()})),vue.onMounted((()=>{i()})),vue.onUpdated((()=>{i()}));const c=()=>{const e=[];return a.$slots.default&&e.push(...a.$slots.default()),l.items&&e.push(...l.items.map((e=>vue.h(script$9,{className:l.required&&!l.modelValue?"required":null,...e,modelValue:r.value,"onUpdate:modelValue":u})))),vue.h("div",{class:"v-radio-group"},[l.label&&vue.h("label",l.label),...e])};return(e,t)=>(vue.openBlock(),vue.createBlock(c))},__file:"src/v-radio-group.vue"},script$7={name:"VSelect",setup(e,t){const{slots:l,emit:o}=t,{valueField:r,disabled:a,readonly:n,autoload:s,name:i}=e,u=vue.ref([]),c=vue.ref([]),d=vue.ref(null),p=vue.ref([]),v=[],m=vue.ref(!(s+""=="false"||1*s==0)),h=vue.ref(null),g=t=>{u.value=t,vue.nextTick((()=>{log(i,"collect.nextTick="+t.length),f(e.modelValue||d.value)}))};vue.watch(a,((e,t)=>{y(e,t)}));const f=t=>{let l=t||e.modelValue;if(h.value){let t=h.value,r=t.selectedIndex;l&&""!==l||(t.selectedIndex=0);for(let e=0;e<t.length;e++)t[e].value==l&&(t.selectedIndex=e);const a=v;for(let n=0;n<a.length;n++){if(!a[n].getValueByIndex)continue;let s=a[n].getValueByIndex(r-1);a[n].getIndexByValue(l,((r,c)=>{if(r>-1){let c=a[n].getObjectByIndex(r),p=Number(s);p=isNaN(p)?s?!!l&&(l.id?l.id==s.id:l==s):!l:p==Number(l),d.value!=e.modelValue&&(e.modelValue&&(d.value=e.modelValue),p||(log(i,"select.updateSelect="+l+" "+JSON.stringify(u.value.length)),t.selectedIndex=r+1,o("update:modelValue",l,{value:l,select:t,object:c}),vue.nextTick((()=>{o("input",l,{value:l,select:t,object:c})}))))}else e.modelValue&&(d.value=e.modelValue),log(i,"select.updateselect.not fout",r),o("update:modelValue",null,null),t.selectedIndex=0}))}}};g.remove=e=>{const t=v.filter((t=>t!==e));v.length=0,t.forEach((e=>v.push(e)))},g.push=e=>{v.push(e)},r&&(c.value=r.split(".")),vue.provide("collect",g);vue.watch((()=>e.modelValue),((e,t)=>{e!=t&&f()}));const y=(e,t)=>{e=!!e,t=!!t;let l=p.value;!e&&!e===t&&l.length&&$(l[0],l[1])},$=(t,l)=>{log(i,"select.load.params=",t),e.disabled?p.value=[t,l]:(p.value=[],v.forEach((e=>{e(t,l)})))};return vue.onMounted((()=>{m.value&&$()})),{options:u,getValueField:(e,t)=>{const l=c.value;if(l&&l.length)for(let t=0;t<l.length;t++)e&&(e=e[l[t]]);else e&&!t&&(e=e.id?e.id:e.code?e.code:e);return e},onChange:e=>{e.stopPropagation();let t=e.target.value;const l=h.value;log(i,"select.onchange=",t),t&&""!==t||(t=null,l.selectedIndex=0);let r,a=0;const n=u.value;for(let e=0;e<v.length;e++){if(a=v[e].getValueByIndex(l.selectedIndex-1),-1!=a){r=v[e].getObjectByIndex(l.selectedIndex-1);break}a=0}a?t=a:n.length&&(l.selectedIndex=0),o("update:modelValue",t,{value:t,select:l,object:r}),vue.nextTick((()=>{o("input",t,{value:t,select:l,object:r})}))},selectRef:h,load:$,lastLoad:p,autoload_:m}},props:{modelValue:null,required:null,readonly:null,multiple:null,label:null,name:null,disabled:null,autoload:null,valueField:null},data:()=>({autoload_:!0,ik:0,data:[],popup:null,show:!1,sel:[],sela:null,tmp:[],sel2:[]}),watch:{show(e){let t=this;if(e){let e=this.$refs.button,l=this.popup;l||(l=this.$refs.popup,l.style.position="absolute",document.body.append(l));let o=e.getBoundingClientRect();const r=l.children[0];window.innerWidth<400?(l.style.padding="40px",l.style.height="100%",r.style.height="100%"):(l.style.top=o.bottom+0+"px",l.style.left=o.left+0+"px",l.style.maxHeight=window.innerHeight-o.bottom-30+"px",r.style.maxHeight=l.style.maxHeight),r.style.display="flex",r.style.flexDirection="column",t.tmp=t.sel.sort().join(",")}else{let e=t.sel;"TH"!=t.$el.parentNode.tagName&&e&&e.length?e=e.join(","):e&&0==e.length&&(e=null),t.tmp!==t.sel.sort().join(",")&&t.$parent.load&&t.$parent.load()}}}};const _hoisted_1$5={class:"v-select",style:{position:"relative"}},_hoisted_2$4=["required","disabled","click"],_hoisted_3$1={style:{border:"1px solid lightgray","background-color":"white",padding:"5px"}},_hoisted_4={class:"_ ui-widget ui-state-default ui-corner-all",style:{padding:"3px 3px 1px 3px","margin-bottom":"5px"}},_hoisted_5={class:"center",style:{"padding-top":"4px"}};function render$6(e,t,l,o,r,a){const n=vue.resolveComponent("v-checkbox"),s=vue.resolveComponent("v-checkbox-group"),i=vue.resolveComponent("v-button");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[l.readonly?vue.createCommentVNode("v-if",!0):vue.withDirectives((vue.openBlock(),vue.createElementBlock("select",{key:0,style:{width:"100%"},ref:"selectRef",onChange:t[0]||(t[0]=(...e)=>o.onChange&&o.onChange(...e)),required:l.required,disabled:l.disabled,click:e.expand},[vue.renderSlot(e.$slots,"default")],40,_hoisted_2$4)),[[vue.vShow,!l.multiple]]),l.multiple?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createElementVNode("div",{class:vue.normalizeClass(["v-widget-header",{"v-selected":r.show}]),ref:"button",style:{"padding-top":"3px","padding-bottom":"3px"},onClick:t[1]||(t[1]=(...t)=>e.toggle&&e.toggle(...t))}," ",2),vue.withDirectives(vue.createElementVNode("div",{ref:"popup",onClick:t[4]||(t[4]=(...t)=>e.close&&e.close(...t)),style:{"background-color":"#0000009c"}},[vue.createElementVNode("div",_hoisted_3$1,[vue.createElementVNode("div",_hoisted_4,[vue.createVNode(n,{modelValue:r.sela,"onUpdate:modelValue":t[2]||(t[2]=e=>r.sela=e),onInput:e.selectAll},null,8,["modelValue","onInput"])]),(vue.openBlock(),vue.createBlock(s,{class:"v-select-checkbox-group",style:{"overflow-y":"auto"},key:"p"+r.ik,modelValue:r.sel,"onUpdate:modelValue":t[3]||(t[3]=e=>r.sel=e),onInput:e.checkboxInput},{default:vue.withCtx((()=>[r.data.length?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(r.data,(e=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(n,{value:e.value,label:e.label},null,8,["value","label"])])))),256)):vue.createCommentVNode("v-if",!0)])),_:1},8,["modelValue","onInput"])),vue.createElementVNode("div",_hoisted_5,[vue.createVNode(i,{icon:"fa-sync",value:"Filtrar"})])])],512),[[vue.vShow,r.show]])],64)):vue.createCommentVNode("v-if",!0),l.readonly?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[vue.createTextVNode(vue.toDisplayString(l.label?l.label:"---"),1)],64)):vue.createCommentVNode("v-if",!0)])}script$7.render=render$6,script$7.__file="src/v-select.vue";var script$6={name:"VSwitch",props:{value:{value:Object}},data:()=>({options:["NO","SI"],selected:null}),mounted(){var e=this,t=""+e.value;e.selected="true"===t?"SI":"false"===t?"NO":null,e.$emit("input",e.value)},updated(){var e=this,t=""+e.value;e.selected="true"===t?"SI":"false"===t?"NO":null,e.$emit("input",e.value)},methods:{onChange(e){this.selected=e,this.$emit("input","SI"===e||"NO"!==e&&null)}}};const _hoisted_1$4=["value","data-value"],_hoisted_2$3=["onClick"];function render$5(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("div",{value:!1===l.value?"false":l.value,"data-value":""+l.value},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.options,(e=>(vue.openBlock(),vue.createElementBlock("div",{onClick:t=>a.onChange(e),style:vue.normalizeStyle("cursor:pointer;border: 1px solid #000;text-align:center;display:inline-block;width:calc(50% - 2px)"+(e===r.selected?"":";opacity: 0.5")),class:vue.normalizeClass({"v-selected":e==r.selected})},vue.toDisplayString(e),15,_hoisted_2$3)))),256))],8,_hoisted_1$4)}script$6.render=render$5,script$6.__file="src/v-switch.vue";var script$5={name:"VTable",setup(e,t){const{autoload:l,src:o,rowKey:r,store:a,groups:n}=e,s=useAppStore(),i=vue.inject("tableCollect"),u=vue.ref(1),c=vue.ref(0),d=vue.ref(null),p=vue.ref(1),v=vue.ref([]),m=vue.ref([]),h=vue.ref(null),g=vue.ref(1),f=vue.computed((()=>{const t=e,l=m.value;let o,r;return l.sum=sum,l.filter((e=>{for(var l in t.filters)if(o=t.filters[l],"function"==typeof o){if(!o(e))return 0}else if(o&&"string"==typeof o&&l in e&&(r=e[l],"string"==typeof r&&(r=r.toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""),!r.includes(o.toUpperCase()))))return 0;return 1}))})),y=vue.computed((()=>{let e=f.value;return e=h?e.sort(((e,t)=>{t=(t=t[h])||0,e=e[h];const l=Number(e);return l&&(e=l),e<t?-1*g:e>t?1*g:0})):e,e.sum=sum,e})),$=vue.computed((()=>{const e=function(e){return this.reduce(((t,l)=>"number"==typeof e||"string"==typeof e?t+(l[e]||0):t),0)};Array.prototype.sum=e;const t={},l=n;return l?y.value.forEach((o=>{const r=o[l];if(!t[r]){const l=[];l.sum=e,t[r]=l}t[r].push(o)})):y.value.length&&(t[""]=y),Object.entries(t).map((([e,t])=>({name:e,values:t})))})),b=vue.ref(1),w=vue.ref(1),{slots:_,expose:k,emit:x}=t,S=vue.getCurrentInstance(),E=async()=>{if(null!=a){let e;db&&(e=await getStoredList(a)),e||(e=[]),m.value=m.value?e.concat(m.value):e}return m.value},C=(e,t,l)=>{-10===t?f.value.length===v.value.length?v.value=[]:v.value=f.value.map((e=>e)):l?u.value||!v.value.includes(e)?v.value=[e]:(v.value=[],e=null):v.value.includes(e)?(v.value.splice(v.value.indexOf(e),1),e=null):v.value.push(e),x("row-select",{target:this,current:e,selection:v})},V=e=>v.value.includes(e),N=t=>{const l=[];return e.selectable&&V(t)&&l.push("v-selected"),e.rowStyleClassFunc&&l.push(e.rowStyleClassFunc(t)),l},B=(e,t)=>{I(e,t)},I=(e,t)=>{(b.value!=e||t)&&(b.value=e,T())};let L=""+e.selectable;u.value="false"!=L&&"0"!=L?1:0,L=""+e.scrollable,c.value=e.scrollable&&"false"!=L&&"0"!=L?1:0;const T=()=>{const t=e;if(v.value=[],t.value&&(m.value=t.value),o){let e=o;if(!e)return;e.endsWith("/")&&(e=e.slice(0,e.length-1));const l=t.pagination;if(l&&(e+="/"+(b.value-1)*l+"/"+l),networkStatus.connected){let r;if(t.gql){const e=t.gql,a="query{"+Object.keys(e)[0]+"(offset:"+(b.value-1)*l+" limit:"+l+"){\ndata{"+e[Object.keys(e)[0]]+"}\nsize\n}\n}";r=s.axios.post(o,{query:a})}else r=s.axios.get(e,{params:clean(t.filters)});r.then((e=>{if(e.data&&e.data.error)MsgBox(e.data.error);else{let o=e.data;t.gql&&(o=e.data.data[Object.keys(t.gql)[0]]),m.value=o.data||o,o&&o.hasOwnProperty("size")&&l&&(w.value=Math.ceil(o.size/l),b.value>w.value&&(b.value=1),t.size=o.size),E(),x("loaded",{target:t}),x("row-select",{}),t.remoteLoaded=1,t.loaded=1,p.value++}})).catch(t.error)}else{m.value=[];const e=E();e.then&&e.then((e=>{m.value=e})),x("row-select",{target:t})}}else E().then((()=>x("loaded",{target:t})));p.value++,t.loaded=1},q=vue.computed((()=>v.value.length));T.rowSelectedCount=q,T.src=o,T.rowKey=r,T.rowSelect=C;const F=e=>d.value===e;T.is=F,T.remove=e=>{console.log(e,m.value);const t=m.value.findIndex((t=>t===e));-1!==t&&m.value.splice(t,1)},T.selected=v,T.type="v-table",i.push(T);const A=e=>{13===e.keyCode&&(e.preventDefault(),T())};return vue.onMounted((()=>{!0===l&&T(),setTimeout((()=>{const e=S.proxy,t=e.$el.querySelectorAll(".v-cloned-header div > span"),l=Math.max(...Array.from(t).map((e=>e.offsetHeight)));t.forEach((e=>{e.style.height=l+"px"}));e.$el.querySelectorAll("v-filter").forEach((e=>{console.log(e.querySelectorAll("input").forEach((e=>e.addEventListener("keyup",A))))}))}),100)})),vue.onUnmounted((()=>{i.remove(T)})),k({load:T,rowSelectedCount:q,j_is:F}),()=>{let t=0;const l=_.default({row:{}}),o=[];l.forEach(((e,l)=>{const r=e.props;e.children&&"function"==typeof e.children.filter&&(e.children.filter((e=>"v-filter"==e.type)).forEach((t=>{r.filter=t,e.children.shift()})),e.children.filter((e=>"v-footer"==e.type)).forEach((t=>{r.footer=t,e.children.shift()}))),t+=r.width?Number(r.width):0,o.push({filter:r.filter,header:r.header,width:r.width})})),t+=u.value?42:0;const r=vue.h("div",{className:"v-datatable-scrollable-header-box",style:"left: 0px;"},vue.h("table",{className:"v-cloned-header v-table",style:{width:`${t}px`}},[u.value?vue.h("th",{width:42},[vue.h("span",{onclick(){C(null,-10)},className:"v-check"},vue.h(vueFontawesome.FontAwesomeIcon,{icon:v.value.length?freeRegularSvgIcons.faSquareCheck:freeRegularSvgIcons.faSquare,class:"fa-lg"}))]):null,o.map((e=>vue.h("th",e,vue.h("div",[vue.h("span",{style:"display: flex;justify-content: center;align-items: center;"},[e.header]),vue.h("v-filter",e.filter?.children)]))))]));return vue.h("div",{ref:d,className:"v-datatable "+e.class},[_.header?vue.h("div",{className:"v-datatable-header v-widget-header ui-corner-top"},_.header()):null,e.pagination?vue.h("div",{className:"v-paginator v-paginator-top v-widget-header v-paginator-pages center"},[vue.h(script$p,{value:"|<",disabled:b.value<=1,onClick:()=>B(1)}),vue.h(script$p,{value:"<",disabled:b.value<=1,onClick:()=>B(b.value-1)}),vue.h("div",{style:"padding:3px 8px;display:inline-block"},[vue.h("input",{type:"number",style:"width:60px",value:b.value,onInput:e=>B(Number(e.target.value),!0)}),"/"+w.value]),vue.h(script$p,{value:">",disabled:b.value==w.value,onClick:()=>B(b.value+1)}),vue.h(script$p,{value:">|",disabled:b.value==w.value,onClick:()=>B(w.value)})]):null,vue.h("div",{className:"v-widget-header v-datatable-scrollable-header",style:"position: relative; margin-right: 0px;"},r),vue.h("div",{className:"v-datatable-scrollable-body",style:"overflow-y: auto; flex:1",onScroll(e){const t=e.currentTarget.scrollLeft;r.el.style.transform="translateX(-"+t+"px)"}},[vue.h("table",{className:"v-table",style:{width:`${t}px`}},[vue.h("tbody",{className:"v-datatable-data",key:p.value},$.value.length<1?vue.h("td",{colspan:o.length+(u.value?1:0)},e.emptyMessage):[$.value.map((e=>[_["header-group"]?vue.h("tr",{className:"v-header-group"},[u.value?vue.h("td"):null,_["header-group"]({group:e})]):null,(e.values.value||e.values).map(((e,t)=>{const l=_.default({row:e,index:t});return l.forEach(((e,t)=>{e.children&&"function"==typeof e.children.filter&&(e.children.filter((e=>"v-filter"==e.type)).forEach((t=>{e.children.shift()})),e.children.filter((e=>"v-footer"==e.type)).forEach((t=>{e.children.shift()})))})),vue.h("tr",{className:N(e),onclick(l){((e,t,l)=>{u.value&&0==whichChild(e.target)||C(t,l,1)})(l,e,t)}},[u.value?vue.h("td",{className:"center"},vue.h("span",{onclick(){C(e,t)},className:"v-check"},vue.h(vueFontawesome.FontAwesomeIcon,{icon:V(e)?freeRegularSvgIcons.faSquareCheck:freeRegularSvgIcons.faSquare,class:"fa-lg"}))):null,...l])})),_["footer-group"]?vue.h("tr",{className:"v-footer-group"},[u.value?vue.h("td"):null,_["footer-group"]({group:e})]):null,_["extra-group"]?_["extra-group"]({group:e,groups:$.value}):null]))])])])])}},props:{class:null,value:Array,filterKey:String,reflow:null,summary:null,src:String,gql:null,filters:Object,store:null,width:null,emptyMessage:{default:"No existen registros"},groups:{default:""},rowKey:{default:"id"},rowStyleClass:String,pagination:null,selectable:{default:!0},scrollable:null,autoload:{default:!0}},data:()=>({resizeAfterUpddate:0,active:0,keyBody:1,row:{},kt:0,size:null,sortKey:"",paginatio_:0,remoteLoaded:null,loaded:!1,sortOrders:{},rowStyleClassFunc:null}),created(){const me=this;me.$parent.tabs||(me.active=1),me.paginatio_=me.pagination?me.pagination:0,me.rowStyleClass&&eval("me.rowStyleClassFunc=function(row){return "+me.rowStyleClass+"}")},beforeUpdate(){var e=this;e.active&&e.value&&null==e.remoteLoaded&&(e.data=e.value)},filters:{capitalize:e=>e?e.charAt(0).toUpperCase()+e.slice(1):e},watch:{kc(e){var t=this;setTimeout((function(){emit("updated",t)}),100)}},methods:{hasSlot(e){return!!this.$slots[e]},sortBy(){},async getStoredList(e){let t=new Promise((t=>{var l=db.transaction(e).objectStore(e).getAll();l.onsuccess=function(){t(l.result)}}));try{return await t}catch(t){throw alert(e),t}},filter(){alert(12)}},__file:"src/v-table.vue"},script$4={name:"VTabview",data:()=>({tabs:[],height:0,currentTabIndex:0,k:0}),methods:{load(e){var t=new Event("command",{bubbles:!1});t.name="refresh",t.target=this.$el,this.$el.children[1+this.currentTabIndex].dispatchEvent(t)},reset(){this.load(this.k++)}},watch:{currentTabIndex(e){var t=this,l=t.$el.children[e+1];if(t.$children[e+1],l){var o=new Event("tabChange",{bubbles:!1});o.$target=t,l.dispatchEvent(o),t.$el.style.height=t.height+"px",(o=new Event("parentResize",{bubbles:!1})).height=t.$el.offsetHeight-25,l.style.height=o.height+"px",setTimeout((()=>{l.dispatchEvent(o)}),2)}}},updated(){for(var e=this.$el.children,t=1;t<e.length;t++)e[t].tagName&&(t-1===this.currentTabIndex&&(e[t].style.display="flex",e[t].style.flex="1",e[t].style.flexDirection="column"),t-1===this.currentTabIndex?e[t].classList.remove("hide"):(e[t].style.display="none",e[t].classList.add("hide"))),console.log(e[t])},mounted(){for(var e=this,t=e.$el.children,l=1;l<t.length;l++)t[l].style.display="none",e.tabs.push({title:""+t[l].getAttribute("tab")});e.$el.addEventListener("parentResize",(l=>{e.$el.style.height=l.height+1+"px",e.height=l.height+1;var o=new Event("parentResize",{bubbles:!1});o.height=e.$el.offsetHeight-25,o.target=e.$el,o.$target=e;for(var r=1;r<t.length;r++)"none"!=t[r].style.display&&(console.log("Se envia el alto "+o.height),t[r].style.height=o.height+"px",t[r].dispatchEvent(o));e.$emit("resize",o)})),t[1+e.currentTabIndex].setAttribute("active",1);var o=new Event("tabChange",{bubbles:!1});o.$target=e,t[1+e.currentTabIndex].dispatchEvent(o)}};const _hoisted_1$3={class:"v-tab-nav"},_hoisted_2$2=["onClick"];function render$4(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("div",{class:"v-tabview",style:vue.normalizeStyle({height:r.height+"px"})},[vue.createElementVNode("ul",_hoisted_1$3,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.tabs,((e,t)=>(vue.openBlock(),vue.createElementBlock("li",{class:vue.normalizeClass({"v-selected":t==r.currentTabIndex}),key:t,onClick:e=>r.currentTabIndex=t},vue.toDisplayString(e.title),11,_hoisted_2$2)))),128))]),vue.renderSlot(e.$slots,"default")],4)}script$4.render=render$4,script$4.__file="src/v-tabview.vue";var script$3={name:"VTextarea",props:{modelValue:String},setup(e,{emit:t}){const l=vue.ref(null),o=()=>{l.value&&(l.value.style.height="auto",l.value.value&&(l.value.style.height=`${l.value.scrollHeight}px`))},r=()=>{vue.nextTick(o)};return vue.watch((()=>e.modelValue),r,{immediate:!0}),vue.onMounted((()=>{const e=l.value;e&&(e.addEventListener("change",o),e.addEventListener("cut",r),e.addEventListener("paste",r),e.addEventListener("drop",r),e.addEventListener("keydown",r),r())})),{textarea:l,updateValue:e=>{t("update:modelValue",e.target.value),r()}}}};const _hoisted_1$2=["value"];function render$3(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("textarea",{ref:"textarea",value:l.modelValue,onInput:t[0]||(t[0]=(...e)=>o.updateValue&&o.updateValue(...e))},null,40,_hoisted_1$2)}script$3.render=render$3,script$3.__file="src/v-textarea.vue";var script$2={name:"VUploader",props:{value:String,onlyicon:Boolean,click:null,icon:String,domain:String},mounted(){var e=this;setTimeout((function(){e.$el.querySelector("svg").dataset.icon="image"}),1e3)},updated(){var e=this;setTimeout((function(){e.$el.querySelector("svg").dataset.icon="image"}),1e3)},data:()=>({uploadPercentage:0,showProgress:!1}),methods:{other(){this.click&&this.click(this)},handleFileUpload(){this.uploadPercentage=0,this.submitFile(this.$el.children[0].children[0].files[0])},submitFile(e,t){var l=this,o=new FormData;t=t||e.name.replace(/[^\w\s.]/gi,""),o.append("filename",t),o.append("file",e,t),l.showProgress=!0,axios$2.post((l.domain?l.domain:"")+"/api/file/upload",o,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(e){this.uploadPercentage=parseInt(Math.round(e.loaded/e.total*100))}.bind(this)}).then((function(e){l.$emit("input",e.data),l.showProgress=!1})).catch((function(){console.log("FAILURE!!")}))}}};const _hoisted_1$1={style:{cursor:"pointer"},class:""},_hoisted_2$1=["data-icon"],_hoisted_3=[".value"];function render$2(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock("div",{onClick:t[1]||(t[1]=(...e)=>a.other&&a.other(...e)),class:vue.normalizeClass([l.onlyicon?"":"v-button ui-widget ui-state-default ui-corner-all","v-uploader"]),style:vue.normalizeStyle({padding:l.onlyicon?"0px":""})},[vue.createElementVNode("label",_hoisted_1$1,[l.click?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("input",{key:0,type:"file",onChange:t[0]||(t[0]=e=>a.handleFileUpload())},null,32)),vue.createElementVNode("i",{class:vue.normalizeClass(["fa",l.icon?l.icon:"fa-upload"]),"data-icon":l.icon,style:vue.normalizeStyle({marginRight:l.onlyicon||""==l.value?"":"10px"})},null,14,_hoisted_2$1),vue.createTextVNode(vue.toDisplayString(l.onlyicon?"":null!=l.value?l.value:"Adjuntar Archivo")+" ",1),r.showProgress?(vue.openBlock(),vue.createElementBlock("progress",{key:1,max:"100",style:{width:"100%"},".value":r.uploadPercentage},null,40,_hoisted_3)):vue.createCommentVNode("v-if",!0)])],6)}script$2.render=render$2,script$2.__file="src/v-uploader.vue";var script$1={name:"VItem",setup:({href:e},{emit:t})=>({click:()=>{e?useAppStore().router.push({path:e}):t("click")}}),props:{icon:String,style:Object,label:String,href:String}};function render$1(e,t,l,o,r,a){return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("li",{onClick:t[0]||(t[0]=(...e)=>o.click&&o.click(...e)),style:vue.normalizeStyle(l.style)},[vue.createElementVNode("i",{class:vue.normalizeClass(["fa",l.icon])},null,2),vue.createTextVNode(vue.toDisplayString(l.label)+" ",1),vue.renderSlot(e.$slots,"label")],4),vue.createElementVNode("ul",null,[vue.renderSlot(e.$slots,"default")])],64)}script$1.render=render$1,script$1.__file="src/v-item.vue";var script={name:"VCalendarRange",props:{modelValue:null,type:String,required:String,readonly:String,max:String,min:String},setup({modelValue:e},{emit:t}){const l=vue.ref(),o=vue.ref(),r=vue.ref(),a=vue.ref(),n=vue.ref();return{show:l,open:()=>{l.value=!0,vue.nextTick((()=>{n.value=mask(a.value)}))},elRef:a,from:o,to:r,click:e=>{e||(o.value="",r.value="");const l=(date(o.value,"date-")||"")+"|"+(date(r.value,"date-")||"");t("update:modelValue","|"==l?null:l),unmask(n.value)},modelValue:e}}};const _hoisted_1={key:0,ref:"elRef",style:{position:"relative","z-index":"1000",padding:"20px","max-width":"240px"},class:"v-dialog v-msgbox"},_hoisted_2={style:{display:"flex","align-items":"center","justify-content":"center","margin-top":"20px"}};function render(e,t,l,o,r,a){const n=vue.resolveComponent("VButton"),s=vue.resolveComponent("v-calendar"),i=vue.resolveComponent("v-button");return vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(n,{icon:"fa-calendar",onClick:o.open,style:{width:"-webkit-fill-available",padding:"12px"},class:vue.normalizeClass(o.from||o.to?"marked":"")},null,8,["onClick","class"]),o.show?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[t[4]||(t[4]=vue.createElementVNode("label",null,"Desde:",-1)),vue.createVNode(s,{modelValue:o.from,"onUpdate:modelValue":t[0]||(t[0]=e=>o.from=e)},null,8,["modelValue"]),t[5]||(t[5]=vue.createElementVNode("label",null,"Hasta:",-1)),vue.createVNode(s,{modelValue:o.to,"onUpdate:modelValue":t[1]||(t[1]=e=>o.to=e)},null,8,["modelValue"]),vue.createElementVNode("div",_hoisted_2,[vue.createVNode(i,{icon:"fa-eraser",value:"Limpiar",onClick:t[2]||(t[2]=e=>o.click())}),vue.createVNode(i,{icon:"fa-filter",value:"Aplicar",onClick:t[3]||(t[3]=e=>o.click(!0))})])],512)):vue.createCommentVNode("v-if",!0)])}script.render=render,script.__file="src/v-calendar-range.vue";var components={InputTextarea:script$r,VItem:script$1,InputText:script$s,VAutocomplete:script$q,VButton:script$p,VCalendar:script$o,VCalendarFilter:script,VCheckboxGroup:script$n,VCheckbox:script$m,VDataview:script$l,VFieldset:script$k,VForm:script$j,VGroup:script$i,VLayerControl:script$h,VMapControl:script$g,VMap:script$f,VNumber:script$e,VOptions:script$d,VOverlay:script$c,VPanel:script$b,VPopup:script$a,VRadioGroup:script$8,VRadio:script$9,VSelect:script$7,VSwitch:script$6,VTable:script$5,VTabview:script$4,VTextarea:script$3,VUploader:script$2};const VForm=components.VForm,IsobitUI={install(e){setApp(e),e.BUILT_ON=(void 0).VITE_APP_BUILT_ON;for(const t in components)if(components.hasOwnProperty(t)){const l=components[t];e.component(l.name||t,l)}}};setTimeout(resize,400),window.addEventListener("resize",(()=>{setTimeout(resize,400)}));const removeError=e=>{let t=e.previousElementSibling;t&&t.classList&&t.classList.contains("v-error")&&t.parentNode.removeChild(t)},ui=l=>{const o={computed:{user:()=>_$1.app.session,perms(){return this.session.perms||this.session.allcaps||{}}},data(){return{app2:null,ui:this,_session:null,x_connected_:null,row:{},networkStatus:{connected:null}}},methods:{get(e){let t=this.$el.querySelector("form").action;window.location.href=this.apiLink(t)+"/"+e},async sync(e){let t=this,l=t.$el.querySelector("form").getAttribute("action");if(!l){l=t.$el.parentNode.getAttribute("path");let e=l.split("/");e="edit"==e[e.length-1]?e.splice(0,e.length-2):e.splice(0,e.length-1),l=t.apiLink(e.join("/"))}let o=t.$children[0].$children[0];l=o.src;let r=await t.getStoredList(o.store),a=o.selected,n=[],s=[];for(let e=0;e<a.length;e++){let t=o.data[a[e]];if(t.tmpId&&!t.synchronized)for(let e=0;e<r.length;e++)if(r[e].tmpId==t.tmpId){let t=JSON.clone(r[e]);delete t.synchronized,s.push(t),n.push(e)}}n.length>0&&axios.post(l+"/bulk"+(e.sufix?e.sufix:""),s).then((function(e){let l=e.data;for(let e=0;e<l.length;e++){if(l[e].errors){MsgBox$1(JSON.stringify(l[e].errors));break}if(l[e].error){MsgBox$1(l[e].error);break}for(let t=0;t<r.length;t++)(l[e].ext&&l[e].ext.tmpId==r[t].tmpId||l[e].tmpId==r[t].tmpId)&&(log("ui.ok"),l[e].ext&&r.ext&&(r[t].ext.error=l[e].ext.error),l[e].id&&(r[t].id=l[e].id),r[t].synchronized=1,emit("sync",l[e],r[t]))}t.setStoredList(o.store,r),t.refresh()})).catch((function(e){e.response?MsgBox$1(e.response.data):console.log(e)}))}}};l||(l={data:{o:{}}});const{setup:r,...a}=l,n=r;return l={mixins:[o,a],setup(l,o){const r=useAppStore();r.config(getConfigApp());const a=l;let s=vueRouter.useRouter();const u=vue.getCurrentInstance(),c=vue.reactive([]),d={remove(e){c.splice(c.indexOf(e),1)},push(e){c.push(e)}},p=e=>{alert(e)},v=async e=>{const t=u.proxy,l=_$1.db;let o;try{o=JSON.parse(sessionStorage.getItem("loadedStores"))}catch(e){}if(null==o&&(o={}),!o[e]&&t.connected){let t=_$1.stores.filter((t=>t[0]==e))[0];if(!t[2])throw`ERROR: Url for store '${t[0]}' is empty!`;let a=await r.axios.get(t[2]);a=a.data||a,await new Promise(((r,n)=>{let s=l.transaction([t[0]],"readwrite"),i=s.objectStore(t[0]);const u=i.clear();u.onsuccess=()=>{a.forEach((e=>{i.add(e).onerror=e=>{console.error(`⚠️ Store '${e[0]}' error addd data!`,e)}}))},u.onerror=()=>{console.error(`⚠️ Store '${t[0]}' error data!`,t)},s.oncomplete=()=>{o[e]=1,sessionStorage.setItem("loadedStores",JSON.stringify(o)),r()},s.onerror=e=>{console.error(`ERROR: ⚠️ Error en la transacción for store '${e[0]}'!`,e),n()}}))}return await new Promise(((t,o)=>{if(l){const o=l.transaction(e).objectStore(e).getAll();o.onsuccess=()=>{t(o.result)}}else console.log("1=========>db=",window._.db),o("=======>db is null esta faltando")}))},m=()=>{c.find((e=>"v-table"==e.type))()},h=(e,t,l)=>{if(!(e.$el||e instanceof HTMLElement)){let t=e,l=t.target;return"string"==typeof t?l=t:"ION-ITEM"==l.tagName&&l.href?(t.preventDefault(),l=l.href):(t.preventDefault(),l.pathname||(l=l.parentNode),l.pathname||(l=l.parentNode),l.pathname||(l=l.parentNode),l=l.pathname),void(s.path!==l&&s.push(l))}},g=()=>{const e=u?.proxy.$el.__vnode;let t;return t="VForm"==e.ctx.type.name?e.ctx:e.children[0].component,t},f=(e,t)=>{e.$el&&(e=e.$el),removeError(e);let l=e.previousElementSibling;for(;l&&1!=l.nodeType;)l=l.previousElementSibling;if(!l)for(l=e.parentElement.previousElementSibling;l&&1!=l.nodeType;)l=l.previousElementSibling;let o=document.createElement("div");o.innerHTML=t||"Este campo es requerido!",o.classList.add("v-error"),e.parentNode.insertBefore(o,e)},y=t=>{const l=[],o=[],r=u.proxy;t=t&&0!=t?t:r.$el;const a=t?.querySelectorAll("input,select,textarea,div[required=required]");let n,s={};for(let e=0;a?.length>e;e++){let t=a[e];if("radio"!==t.type){if(t.error&&(t.error.style.display="none"),!t.disabled&&!t.getAttribute("disabled")&&(t.required||"DIV"===t.tagName))if("DIV"!=t.tagName&&!t.value||"DIV"===t.tagName&&!t.attributes.value){for(n=t.previousElementSibling;n&&1!=n.nodeType;)n=n.previousElementSibling;if(!n)for(n=t.parentElement.previousElementSibling;n&&1!=n.nodeType;)n=n.previousElementSibling;l.push(t)}else o.push(t)}else{let e=s[t.name];e||(s[t.name]=e=[]),e.push(t)}}for(let t in s)if(Object.prototype.hasOwnProperty.call(s,t)){const r=s[t];let a=!1,i=!1;for(let e=0;e<r.length;e++)r[e].required&&!r[e].disabled&&(i=!0),r[e].checked&&(a=!0);e=r[0].parentNode.parentNode,n=e.previousElementSibling,n&&n.classList&&n.classList.contains("v-error")&&n.parentNode.removeChild(n),i&&!a?l.push(e):o.push(e)}for(const e of l)f(e);for(const e of o){let t=e.previousElementSibling;t&&t.classList&&t.classList.contains("v-error")&&t.parentNode.removeChild(t)}return!l.length},$=(e,t)=>{let l=e.parentElement;for(;l;){const e=l.querySelector(t);if(e)return e;l=l.parentElement}return null},b=e=>{console.log(o)};vue.provide("tableCollect",d);const w=vue.computed((()=>{let e=c.find((e=>e.selected?.value.length>0));return e?.rowSelectedCount||0})),_=vue.computed((()=>clean(k.value))),k=vue.reactive({}),x=vue.ref(null);let S;vue.watch(k,(()=>{c.find((e=>"v-table"==e.type))&&(x.value&&clearTimeout(x.value),x.value=setTimeout((()=>{m()}),1200))}));const E=()=>{clearTimeout(S),S=setTimeout((()=>{const e=document.querySelector(".v-datatable");e?.parentNode&&buildPopupMenu(e)}),100)};vue.onMounted((()=>{s=vueRouter.useRouter(),o.emit("sync",{u:9}),E(),window.addEventListener("resize",E)})),vue.onUnmounted((()=>{window.removeEventListener("resize",E)}));const C=vue.computed((()=>r.axios.defaults.baseURL)),V=vue.computed((()=>r.session));let N=n?n({...l,$on:(e,t)=>{},router:s,getStoredList:v},o):{};o.expose({router:s});let B={app:r,cleanedFilters:_,router:s,baseURL:C,filters:k,session:V,date:date,pad:pad,getStoredList:v,refresh:m,getSelected:()=>c.find((e=>"v-table"==e.type)).selected.value,saveAs:(e,t,l)=>{"string"==typeof t&&(t={body:t});let o="string"==typeof l?{fileName:l}:l;o||(o={}),(""+t?axios.post(e,t,{responseType:"blob"}):axios({method:"post",url:e,data:t,headers:{"Content-Type":"multipart/form-data"}})).then((e=>{const t=window.URL.createObjectURL(new Blob([e.data])),l=document.createElement("a");if(l.href=t,!o.fileName){const t=e.headers["content-disposition"];if(t&&-1!==t.indexOf("attachment")){const e=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(t);null!=e&&e[1]&&(o.fileName=e[1].replace(/['"]/g,"").trim())}else console.warn("content-disposition: attachment; filename = <filename>; header no es accesible o no esta definido correctamente")}l.setAttribute("download",o.fileName),document.body.appendChild(l),l.click()}))},validate:y,save:()=>{const e=u.proxy;e.$forceUpdate();let l=e.$el.querySelector("form");if(y(l)){let n=l.getAttribute("action");if(!n&&(n=a.$el.parentNode.getAttribute("path"),n)){let e=n.split("/");e="edit"==e[e.length-1]?e.splice(0,e.length-2):e.splice(0,e.length-1),n=a.apiLink(e.join("/"))}let s=e.data||e.o,u=JSON.parse(JSON.stringify(s));if(e.process&&(u=e.process(u)),"object"!=typeof u||Array.isArray(u)||null===u)return;if(console.log("action/componet==",n,e,o),n&&r.connected)r.axios.post(n,u).then((t=>{let l=t.data;if(u.tmpId){alert(12);let e=a.$children[0].store,t=window._.db.transaction([e],"readwrite").objectStore(e),o=t.get(u.tmpId);l.id&&(u.id=l.id,s.id=u.id),o.onsuccess=function(){let e;s.synchronized=1,u.synchronized=1,e=o.result?t.put(u):t.add(u),e.onerror=e=>{console.error(e)},a.$emit("sync",l,u)},o.onerror=function(){MsgBox$1("Error getting temporal record "+u.tmpId)}}r&&r.toast?r.toast("El registro fue grabado exitosamente!",(()=>{e.close({success:!0,data:l})})):MsgBox$1("El registro fue grabado exitosamente! msg",(()=>{alert(2222),b()}))})).catch((function(e){if(e.response){let o,r;if("string"==typeof e.response.data)MsgBox$1(e.response.data);else{o=e.response.data.propertyViolations;for(let e=0;e<o.length;e++){let t=o[e];r=l.querySelector("[name="+t.path+"]"),r&&a.showerror(r,t.message)}for(o=e.response.data.fieldViolations,i=0;i<o.length;i++)t=o[i],r=l.querySelector("[name="+t.path+"]"),r&&a.showerror(r,t.message+", valor="+t.value);MsgBox$1("Verifique el formulario, aun tiene campos obligatorio completar."),"v-dialog"==a.$el.parentNode.className&&a.$el.parentNode.parentNode.scroll({top:0,behavior:"smooth"})}}}));else{const t=c[0].store;if(!t)return void MsgBox$1("Store in form is undefined!");v(t).then((l=>{if(l||(l=[]),u.id)for(let e=0;e<l.length;e++)l[e].tmpId==u.tmpId&&(delete u.synchronized,l[e]=u);let o=_$1.db.transaction([t],"readwrite").objectStore(t);if(u.id){delete u.synchronized;let t=o.get(u.tmpId);t.onsuccess=function(){t.result?o.put(u):l.forEach((e=>{e.tmpId==u.tmpId&&o.put(u)})),a.$emit("stored",u,l,o),a.$ionic&&r.toast("El registro fue grabado exitosamente! onstored"),console.log("============2",e),e.close({success:!0,data:u})},t.onerror=function(){MsgBox$1("Error getting temporal record "+u.tmpId)}}else{u.tmpId=1*new Date,u.id=-u.tmpId;let t=o.add(u);t.onsuccess=t=>{l.unshift(u),a.$emit("stored",u,l,o),r&&r.toast&&r.toast("El registro fue grabado exitosamente! storeeeeee not connected"),s.tmpId=u.tmpId,s.id=u.id,console.log("========>>",e),e.close({success:!0,data:u})},t.onerror=e=>{r&&r.toast&&r.toast("Error!")}}}))}}else MsgBox$1("Verifique el formulario, aun tiene campos obligatorios sin completar."),"v-dialog"==a.$el.parentNode.className&&a.$el.parentNode.parentNode.scroll({top:0,behavior:"smooth"})},open:h,close:b,create:()=>{let e=g().action;e||(e=window.location.pathname),e&&(e=e.replace("/api","")),r&&h(e+"/create")},edit:e=>{let t=g().action;const l=$(e.target,".v-datatable");let o=c.filter((e=>"v-table"==e.type)).find((e=>e.is(l)));var n;t||(t=window.location.pathname),o&&o.src&&(t=o.src),e.action&&(t=e.action),t&&(n=t.replace("/api","").replace("/0/0",""),t="/admin"+n);const s=o.selected.value[0];let i=s[o.rowKey];s.tmpId&&(i=-s.tmpId),r?h(t+"/"+i+"/edit"):r.axios.get((_$1.currentPath=(t+"/"+i+"/edit").replace(/([^:]\/)\/+/g,"$1"))+"?modal").then(a.open).catch(p)},destroy:e=>{let t=this;const l=$(e.target,".v-datatable");let o=c.filter((e=>"v-table"==e.type)).find((e=>e.is(l)));c.find((e=>"v-table"!=e.type)).action;let a=e.$vnode?e.load:null,n=o.rowKey,s=o.selected.value[0];if(s.tmpId)MsgBox$1("Esta seguro que desea eliminar los registros temporales seleccionados ?",(function(e){if(0==e){let e=0,l=_$1.db.transaction([o.store],"readwrite").objectStore(o.store),n=[];for(let t=o.selected.length-1;t>=0;t--)s=o.data[o.selected[t]],n.push(s),s.tmpId&&l.delete(s.tmpId),e++,o.data.splice(o.selected[t],1);e&&(r&&r.toast?r.toast(e+" registros eliminados"):MsgBox$1(e+" registros eliminados")),o.rowSelect(null,-1),o.selected=[],t.$emit("destroyed",n,o.store),a&&a()}}),["SI","NO"]);else{if(!n)return alert("Table don`t have defined attribute 'rowkey'");let e=s[n];MsgBox$1("Esta seguro que desea eliminar el registro seleccionado?",(t=>{if(0==t){const t=o.src.replace("/0/0",""),l=[];let a=o.selected.value.length-1;r.axios.delete(t+"/"+e,{params:k.value}).then((()=>{for(;a>=0;a--)s=o.selected.value[a],l.push(s),o.remove(s);r&&r.toast?r.toast(l.length+" registros eliminados"):MsgBox$1(l.length+" registros eliminados"),o.rowSelect(null,-1),o.selected.value=[]})).catch(p)}}),["SI","NO"])}},rowSelectedCount:w,...N};return B}},l};exports.Drag=Drag,exports.IsobitUI=IsobitUI,exports.MsgBox=MsgBox$1,exports.VForm=VForm,exports._=_$1,exports.app=app,exports.date=date,exports.db=db,exports.getStoredList=getStoredList,exports.id=id,exports.initDB=initDB,exports.pad=pad,exports.removeError=removeError,exports.resize=resize,exports.setupApp=setupApp,exports.ui=ui,exports.useAppStore=useAppStore;
|