isobit-ui 0.3.0 → 0.3.2

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 CHANGED
@@ -1 +1 @@
1
- "use strict";var vue=require("vue"),axios$2=require("axios"),Observable=require("ol/Observable"),_imports_0=require("@/cdn/images/triangle-down.svg"),script$q={name:"InputText"};const _hoisted_1$g={type:"text"};function render$m(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("input",_hoisted_1$g)}script$q.render=render$m,script$q.__file="src/InputText.vue";var script$p={name:"InputTextarea"};function render$l(e,t,l,a,o,r){return" text "}script$p.render=render$l,script$p.__file="src/InputTextarea.vue";var script$o={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:a}=t,o=vue.ref(0),r=vue.ref(null),n=vue.ref(-1),s=vue.ref(""),i=vue.ref(null),d=vue.ref(!1),c=vue.ref(0),u=vue.ref("");vue.watch((()=>e.value),(e=>{r.value=e})),vue.watch((()=>e.data),(e=>{i.value=e})),vue.onMounted((()=>{u.value=e.inputClass,e.autoload&&v(),document.addEventListener("click",m)})),vue.onBeforeUnmount((()=>{document.removeEventListener("click",m)}));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:a,source:r}=e;let n=Number(e.pagination);if(1===t)o.value+=n;else if(o.value=0,e.data&&e.autoload)return;const u={query:s.value};e.params&&(u=Vue.mergeDeep(u,e.params)),axios$2.get((a||e.source)+(n>0?"/"+o.value+"/"+n:""),{params:u}).then((l=>{const a=l.data;console.log(a),a.error?MsgBox(a.error):(i.value=1===t?i.value.concat(a.data?a.data:a):a.data?a.data:a,console.log(i),c.value=a.size,e.autoload||(d.value=!0),console.log("========================="))})).catch(h).then((()=>{l("complete",{data:i.value,query:s.value,target:"me"})}))},h=e=>{console.log(e)},m=e=>{};return{query:s,show:d,selected:r,data2:p,focused:n,inputClass:u,search:v,remove:()=>{l("input",null)},clickout:m,focusout:e=>{},setSelected:e=>{r.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")=>!!a[e]}}};const _withScopeId=e=>(vue.pushScopeId("data-v-72884078"),e=e(),vue.popScopeId(),e),_hoisted_1$f=["value","disabled"],_hoisted_2$a=_withScopeId((()=>vue.createElementVNode("i",{class:"fa fa-times"},null,-1))),_hoisted_3$7=[_hoisted_2$a],_hoisted_4$5=_withScopeId((()=>vue.createElementVNode("i",{class:"fa fa-xs fa-sync"},null,-1))),_hoisted_5$2=[_hoisted_4$5],_hoisted_6$1=["disabled","placeholder"],_hoisted_7$1={class:"v-list"},_hoisted_8=["onClick"],_hoisted_9={key:0,class:"center yellow",style:{padding:"5px"}};function render$k(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",{class:"v-autocomplete",onFocusout:t[7]||(t[7]=(...e)=>a.focusout&&a.focusout(...e)),value:l.value,disabled:l.disabled},[a.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:a.selected}),vue.createTextVNode(" "+vue.toDisplayString(a.hasSlot("label")?" ":a.getLabel(a.selected))+"  ",1),l.readonly?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:0,onClick:t[0]||(t[0]=(...e)=>a.remove&&a.remove(...e)),class:"remove-icon"},[..._hoisted_3$7]))],4)):vue.createCommentVNode("v-if",!0),a.selected?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:1,onClick:t[1]||(t[1]=(...e)=>a.search&&a.search(...e)),class:"search-icon"},[..._hoisted_5$2])),a.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)=>a.search&&a.search(...e)),["stop","prevent"]),["enter"]))],class:vue.normalizeClass(a.inputClass),onFocus:t[4]||(t[4]=e=>a.show=!0),disabled:l.disabled,placeholder:l.placeholder,"onUpdate:modelValue":t[5]||(t[5]=e=>a.query=e)},null,42,_hoisted_6$1)),[[vue.vModelText,a.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_7$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(a.data2,((t,l)=>(vue.openBlock(),vue.createElementBlock("div",{key:l,class:vue.normalizeClass({"v-selected":a.selected==t,"v-focused":a.focused==l}),onClick:e=>a.setSelected(t)},[vue.renderSlot(e.$slots,"default",{row:t})],10,_hoisted_8)))),128)),e.data0&&e.data0.length<e.total?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"center",onClick:t[6]||(t[6]=e=>a.search(1))},"Load more "+vue.toDisplayString(e.total-e.data0.length)+" results...",1)):vue.createCommentVNode("v-if",!0)]),a.data2&&a.data2.length<1?(vue.openBlock(),vue.createElementBlock("div",_hoisted_9,"No results found.")):vue.createCommentVNode("v-if",!0)],4),[[vue.vShow,a.show&&!a.selected]])])),_:3})],40,_hoisted_1$f)}script$o.render=render$k,script$o.__scopeId="data-v-72884078",script$o.__file="src/v-autocomplete.vue";var script$n={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$e={type:"button",class:"_ ui-widget ui-state-default ui-corner-all v-button"};function render$j(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("button",_hoisted_1$e)}script$n.render=render$j,script$n.__file="src/v-button.vue";var script$m={name:"VCalendar",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,l=t.toDate(e);return console.log(l),t.max&&l&&l.getTime()>=t.toDate(t.max).getTime()||t.min&&l&&l.getTime()<=t.toDate(t.min).getTime()?(t.$emit("invalid",{target:t,value:l}),l=null,void(event.target.value=l)):void("time"===t.$props.type?this.$emit("input",t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2)+":00"):l.getTime&&this.$emit("input",l.getTime()))},pad(e,t){for(var l=e+"";l.length<t;)l="0"+l;return l},toDate(e){if(e){var t,l;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=(l=e.split("T"))[1].split(":"),l=l[0].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=e.split("-");var a=parseInt(l[0]);return a<100?e:l=new Date(a,parseInt(l[1])-1,parseInt(l[2]))}return e},changeDate(){var e,t=this,l=t.toDate(t.value);l&&(e="time"===t.$props.type?t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2):"datetime-local"===t.$props.type?t.pad(l.getFullYear(),4)+"-"+t.pad(l.getMonth()+1,2)+"-"+t.pad(l.getDate(),2)+"T"+t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2):t.pad(l.getFullYear(),4)+"-"+t.pad(l.getMonth()+1,2)+"-"+t.pad(l.getDate(),2)),this.$el.children[0].value=e}},updated(){this.changeDate()},mounted(){this.changeDate()}};const _hoisted_1$d=["value"],_hoisted_2$9=["required","readonly","min","max","type"];function render$i(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",{value:r.toDate(l.value)},[vue.createElementVNode("input",{required:l.required,readonly:l.readonly,min:l.min,max:l.max,onChange:t[0]||(t[0]=(...e)=>r.enterD&&r.enterD(...e)),type:l.type?l.type:"date"},null,40,_hoisted_2$9)],8,_hoisted_1$d)}script$m.render=render$i,script$m.__file="src/v-calendar.vue";var script$l={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 a=0;t&&a<t.length;a++)e[l].value==t[a]&&(e[l].checked=!0)}},onChange:function(e,t){var l=this,a=l.$attrs.value;if(("string"==typeof a||a instanceof String)&&(a=a.split("|")),t)a||(l.$attrs.value=a=[]),a.push(e);else{var o=a.indexOf(e);o>-1&&a.splice(o,1)}l.$emit("input",a)}}};function render$h(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",null,[vue.renderSlot(e.$slots,"default")])}script$l.render=render$h,script$l.__file="src/v-checkbox-group.vue";var script$k={name:"VCheckbox",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 l=t.checked?e.value?e.value:t.checked:null!==e.valueFalse&&void 0!==e.valueFalse?e.valueFalse:t.checked;l&&(e.hadValue=1),console.log("nv="+l),e.$emit("input",l)}},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$c={style:{"font-weight":"normal !important",display:"block"},class:"v-checkbox"},_hoisted_2$8=["innerHTML"],_hoisted_3$6=["checked","value"],_hoisted_4$4=vue.createElementVNode("span",{class:"checkmark"},null,-1);function render$g(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("label",_hoisted_1$c,[vue.createElementVNode("span",{innerHTML:r.getLabel()},null,8,_hoisted_2$8),vue.createElementVNode("input",{type:"checkbox",checked:l.value&&l.vmodel==l.value||l.vmodel,onChange:t[0]||(t[0]=(...e)=>r.change&&r.change(...e)),value:l.value},null,40,_hoisted_3$6),_hoisted_4$4])}script$k.render=render$g,script$k.__file="src/v-checkbox.vue";var script$j={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,a=t%l.columns+1,o=["c-w-"+l.columns];return a==l.columns&&o.push("v-last"),l.rowStyleClassFunc?o.push(l.rowStyleClassFunc(e,e,t)):o.push(l.rowStyleClass),o},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 a=t.value?t.value:l.data.data?l.data.data:l.data;t.data||(t.data=[]),t.data=!0===e?a:t.data?t.data.concat(a):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$b={class:"v-dataview"};function render$f(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$b,[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(r.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=>r.load(e.page++)),class:"center v-more-results"},"Ver mas resultados")):vue.createCommentVNode("v-if",!0)])}script$j.render=render$f,script$j.__file="src/v-dataview.vue";var script$i={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$a={class:"v-fieldset"},_hoisted_2$7=["data-icon"],_hoisted_3$5=["innerHTML"],_hoisted_4$3={style:{flex:"1",display:"flex","flex-direction":"column"}};function render$e(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("fieldset",_hoisted_1$a,[l.legend?(vue.openBlock(),vue.createElementBlock("legend",{key:0,onClick:t[0]||(t[0]=e=>o.closed=l.closable&&!o.closed),style:vue.normalizeStyle({cursor:l.closable?"pointer":""})},[l.closable?(vue.openBlock(),vue.createElementBlock("span",{key:0,"data-icon":o.closed?"plus":"minus",style:{margin:"0px 5px 0px 0px"}},[vue.createElementVNode("i",{class:vue.normalizeClass([o.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$5)],4)):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createElementVNode("div",_hoisted_4$3,[vue.renderSlot(e.$slots,"default")],512),[[vue.vShow,!o.closed]])])}script$i.render=render$e,script$i.__file="src/v-fieldset.vue";var script$h={name:"VForm",props:["header","store","action"],setup(e,t){const{slots:l,expose:a}=t;return a({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},l.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,a=e.height;l.style.height=a+"px",t.timer&&clearTimeout(t.timer),t.timer=setTimeout((()=>{if(l.parentElement){var e;if(l.children[1])a-=l.children[0].offsetHeight,l.children[1].style.height=a+"px",l.children[1].style.overflowY="auto",(l=l.children[1].children[0]).style.height=a+"px",l.children&&(l.parentNode.style.overflowY="hidden",l.parentNode.style.overflow="hidden"),[].forEach.call(l.children,((o,r)=>{r==l.children.length-1&&"CENTER"==o.tagName||!o.classList.contains("v-scrollable")&&!o.classList.contains("v-form")&&!o.classList.contains("v-resize")?a-=t.getAbsoluteHeight(o):e||(e=o)})),l=e;else(l=l.children[0]).style.height=a+"px";if(l){l.style.overflowY="auto",l.style.height=a+"px";var o=new Event("parentResize",{bubbles:!0});o.height=a,l.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 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 a=()=>{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=a,t[l].onblur=a,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 o=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 a=document.createElement("div");a.innerHTML="Este campo es requerido!",a.classList.add("v-error"),t.parentNode.insertBefore(a,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="__"}))},__file:"src/v-form.vue"},script$g={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$9={class:"v-group"};function render$d(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.renderSlot(e.$slots,"default")])}script$g.render=render$d,script$g.__file="src/v-group.vue";var script$f={name:"VLayerControl",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 l=this,a=l.map;if(console.log("me.map="+l.map),e!=l.lastScope)if(e<100&&(e*=1e4),l.scope=e,0==l.scope)a.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],a.getSize()),l.lastScope=e,a.getLayerById("districts").getSource().clear(),l.$emit("scope",{feature:{getId:()=>null},target:l});else if(a){if(e>9999){for(var o=a.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 s=a.getLayerById("provinces");for(e=1*(e.value?e.value:e),r=s.getSource().getFeatures(),n=0;n<r.length;n++)if(1*r[n].id_==e){s.onChange({feature:r[n]});break}}}else l.lastScope=e;else a.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],a.getSize())}},created(){var e=this;return e.$parent.$on("build",(t=>{var l=document.createElement("i"),a=t.map;e.selection=new ol.Collection;var o=e.selection;l.setAttribute("class","fa fa-expand"),a.addControl(new ol.control.FullScreen({label:l,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"}),s=r.on("change",(()=>{var t=e.scope;t>9999&&(t=Math.floor(t/100));for(var l=r.getFeatures(),a=0;a<l.length;a++)if(1*l[a].id_==1*t){n.onChange({feature:l[a]});break}Observable.unByKey(s)})),i=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){i.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=i.getSource().on("change",(()=>{if(e.scope>0)for(var l=i.getSource().getFeatures(),a=e.scope,o=0;o<l.length;o++)if(1*l[o].id_==a){e.scope=0,i.onChange({feature:l[o]});break}Observable.unByKey(t)}))}e.$emit("scope",{feature:e.feature2,target:e}),e.feature2=null}};a.on("moveend",d),n.onChange=t=>{var l=t.feature;e.lastScope!=l.getId()&&(o.clear(),o.push(l),t.preventDefault&&t.preventDefault(),e.lastScope=l.getId(),e.feature2=l,e.unmove?d():a.getView().fit(l.getGeometry().getExtent(),{duration:300}))},n.onSelect=t=>{e.$emit("select",t)},a.addLayer(n),a.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)"})}),i.onChange=t=>{var l=t.feature;e.lastScope!=l.getId()&&(2==o.getLength()&&o.pop(),o.push(l),t.preventDefault&&t.preventDefault(),e.lastScope=l.getId(),e.feature2=l,e.unmove?d():a.getView().fit(l.getGeometry().getExtent(),{duration:300}))},i.onSelect=t=>{e.$emit("select",t)},a.addLayer(i),e.map=a,e.$emit("render",e)})),null}};function render$c(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",null,[vue.renderSlot(e.$slots,"default")])}script$f.render=render$c,script$f.__file="src/v-layer-control.vue";var script$e={name:"VMapControl",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(){let e=this,t=window.ol;e.slotUsed=!!this.$slots.default,e.$parent.map?(e.$parent.map.addControl(new t.control.Control({element:e.$el})),e.ready=!0):e.$parent.$on("build",(l=>{l.map.addControl(new t.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$8={class:"ol-unselectable ol-control"};function render$b(e,t,l,a,o,r){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8,[vue.renderSlot(e.$slots,"default"),o.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)=>r.enter&&r.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&&o.visible0]])}script$e.render=render$b,script$e.__file="src/v-map-control.vue";var script$d={name:"VMap",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 l=new RegExp("[?&]"+e+"=([^&#]*)").exec(t);return l&&l[1]||0},addFeature(e,t){let l=window.ol;e=e||{};var a,o=this,r=o.map;if(e.lon&&e.lat){var n=[e.lon,e.lat];a=new l.geom.Point(n[0]>-100?l.proj.fromLonLat(n):n)}else a=new l.geom.Point(r.getView().getCenter());n=(n=a.flatCoordinates)[0]<-1e4?l.proj.toLonLat(n):n;o.$emit("translateend",{lon:n[0],lat:n[1]}),e.geometry=a;var s=new l.Feature(e);if(s.data=e,e.draggable){var i=new l.Collection;i.push(s);var d=new l.interaction.Translate({features:i});d.on("translateend",(e=>{var t=l.proj.toLonLat(e.coordinate);o.$emit("translateend",{lon:t[0],lat:t[1]})})),d.on("translatestart",(e=>{o.selectedFeature=e.features.getArray()[0]})),s.interactionCollection=i,o.map.addInteraction(d)}if("object"==typeof e.style?s.setStyle(e.style):s.setStyle(o.styleMap[e.style?e.style:"default"]),n=(n=a.flatCoordinates)[0]<-1e4?l.proj.toLonLat(n):n,o.$emit("translateend",{lon:n[0],lat:n[1]}),null!=e.layer){var c=r.getLayerById(e.layer);c?c.getSource().addFeatures(s):r.addLayer(new l.layer.Vector({id:e.layer,source:new l.source.Vector({features:new l.Collection([s])})}))}else o.collection.push(s);return t&&(console.log(s.getGeometry().getCoordinates()),o.map.getView().animate(Object.assign({center:s.getGeometry().getCoordinates(),zoom:17,duration:500},t))),s},animate(e){this.map.getView().animate(e),this.movingCompleted=e.complete},build(){var e=this,t=window.ol;e.styleMap={default:new t.style.Style({image:new t.style.Circle({radius:8,stroke:new t.style.Stroke({color:"#8a0000",width:2}),fill:new t.style.Fill({color:"#ff0000"})})}),star:[new t.style.Style({image:new t.style.RegularShape({fill:new t.style.Fill({color:"#ff0000"}),stroke:new t.style.Stroke({color:"#8a0000",width:2}),points:5,radius:10,radius2:4,angle:0})})]};var l=e.urlParam("location"),a=-1;if(l){var o=l.split("/");l=[parseFloat(o[0]),parseFloat(o[1])],a=o[2],e.moved=!0}else l=!1;console.log("w="+e.$el.clientHeight+";h="+e.$el.clientWidth);var r=new t.Map({target:e.$el,layers:[new t.layer.Tile({source:new t.source.OSM({})})],view:new t.View({})});new ResizeObserver((t=>{console.log("w="+e.$el.clientHeight+";h="+e.$el.clientWidth),r.updateSize()})).observe(e.$el),r.getLayerById=function(e){var t;return r.getLayers().forEach((l=>{l.get("id")!==e||(t=l)})),t},r.styleMap=e.styleMap,r.addLayer(new t.layer.Vector({source:new t.source.Vector({features:e.collection=new t.Collection})})),e.moved?(r.getView().setCenter(l),r.getView().setZoom(a||12),e.map=r,console.log("distarar evento buid pageLocation="+l),e.$emit("build",e)):(console.log("En caso no exista una coordenada se usara se fijara a los limites de la region"),_.getCurrentPosition().then((l=>{r.getView().setCenter(t.proj.fromLonLat([l.coords.longitude,l.coords.latitude])),r.getView().setZoom(12),e.map=r,e.$emit("build",e)}),(t=>{r.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],r.getSize()),e.map=r,e.$emit("build",e)})));var n=r.getView().getZoom();r.on("moveend",(t=>{this.movingCompleted&&(this.movingCompleted(e),this.movingCompleted=null);var l=r.getView().getZoom();n!=l&&(n=l,e.$children.forEach((function(e){e.$vnode.tag.endsWith("v-overlay")&&e.$emit("zoom",l)})))})),r.on("singleclick",(e=>{var t=r.forEachFeatureAtPixel(e.pixel,((e,t)=>{if(t)return[e,t]}));if(t){var l=t[1];t=t[0];if(e.feature=t,e.map=r,e.preventDefault(),l.onSelect)return void l.onSelect(e)}})),r.on("dblclick",(t=>{var l=r.forEachFeatureAtPixel(t.pixel,((e,t)=>{if(t)return[e,t]}));if(l){var a=l[1];l=l[0];if(t.feature=l,t.map=r,a.onChange)return console.log("dbclick manda event onchangue"),void a.onChange(t);e.$emit("change",l),r.getView().animate({center:l.getGeometry().getCoordinates(),zoom:17,duration:500},(()=>{for(var l=0;l<e.$children.length;l++){var a=e.$children[0];a.open&&a.open(t)}}))}})),r.getViewport().parentNode.addEventListener("parentResize",(t=>{setTimeout((()=>{r.updateSize(),e.$emit("resize",r)}),100)})),Vue.resize()}}};function render$a(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",null,[vue.renderSlot(e.$slots,"default")])}script$d.render=render$a,script$d.__file="src/v-map.vue";const _$2={stores:[],_id:0,axios_get:null,storeFunction:{},id:()=>_$2._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.split("T");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,a=document.createElement("div");a.className="abc",a.style="top:50%;transform:translate(-50%,-50%);position:absolute;width:100%;z-index:2; display: flex;justify-content: center;";let o=a.style;if(o.left="50%",o.textAlign="center",!1!==e)if(e instanceof Element)a=e;else{if(e){let t=document.createElement("div");t.innerHTML=e,a.append(t),a.style="padding:4px;margin-bottom:5px;color:white;font-size:24px;text-align:center"}l=document.createElement("div"),o=l.style,l.className="loading"}let r=document.createElement("div");o=r.style,o.height="100%",o.top="0px",o.position="absolute",o.left="0",o.zIndex=1e4,o.width="100%";let n=document.createElement("div");return o=n.style,o.height="100%",o.width="100%",o.top="0",o.position="absolute",o.left="0",o.backgroundColor="rgba(0,0,0,0.5)",t&&t.opacity&&(o.opacity=t.opacity),t&&t.backgroundColor&&(o.backgroundColor=t.backgroundColor),r.appendChild(n),r.appendChild(a),l&&a.appendChild(l),document.body.appendChild(r),r},unmask=e=>{e&&(e.style.display="none",e.parentNode&&e.parentNode.removeChild(e))},buildPopupMenu=e=>{let t=e.getAttribute("v--popup");if(!t){e.setAttribute("v--popup",t=_$2.id());let l=_$2.storeFunction[t],a=e.querySelectorAll(".v-datatable-header .v-button");a&&a.length&&!l&&window.innerWidth<=700&&setTimeout((function(){l=document.createElement("ul"),l.className="v-popup-2",e.appendChild(l);let o=null;const r=e=>{l.style.display="none";let t=e.target.getAttribute("commandId"),a=document.querySelector("#"+t);"BUTTON"==a.tagName?a.click():a.children[0].click(),unmask(o)};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(a=e.querySelectorAll(".v-datatable-header .v-button");l.firstChild;)l.removeChild(l.firstChild);for(s=0;s<a.length;s++)if("none"!=a[s].style.display){let e=document.createElement("li");if(a[s].id||(a[s].id="c-"+_$2.id()),e.setAttribute("commandId",a[s].id),"BUTTON"==a[s].tagName){if(a[s].disabled)continue;e.appendChild(a[s].children[0].cloneNode(!0)),e.appendChild(document.createTextNode(a[s].value?a[s].value:a[s].title))}else a[s].children[0].children[1]&&(e.appendChild(a[s].children[0].children[1]),e.appendChild(document.createTextNode(a[s].textContent)));e.onclick=r,l.appendChild(e)}o=mask(l),l.style.display="block",o.onclick=()=>{l.style.display="none",unmask(o)}},e.appendChild(n),_$2.storeFunction[t]=l}),500)}},resize=()=>{let e=window.innerHeight;document.body.children[0].style.height=e+".px";let t=document.querySelectorAll("#page-header,.ui-layout-north,.v-layout-north,.ion-page >ion-header");t=t[0];const l=document.querySelectorAll("#app > .ui-panel > .v-dialog-content > form > .v-datatable");if(l&&l[0])buildPopupMenu(l[0]);else{let e=document.querySelectorAll(".ion-page");if(e[0]){let t=0;for(let l=0;l<e[0].childNodes.length;l++)"ION-HEADER"!=e[0].childNodes[l].nodeName&&"ION-FOOTER"!=e[0].childNodes[l].nodeName||(t+=e[0].childNodes[l].offsetHeight);let l=0;for(kk=0;kk<e[0].childNodes.length;kk++){let a=e[0].childNodes[kk];if("ION-HEADER"==a.nodeName&&(l=1),1==l&&"ION-HEADER"!=a.nodeName&&"ION-FOOTER"!=a.nodeName&&a.style){a.style.height=e[0].offsetHeight-t+"px",a.style.overflowY="auto";break}}}else console.log(12)}},MsgBox$1=(e,t,l)=>{if(l||(l=["OK"]),!document.body)return;let a=document.createElement("div");a.classList.add("v-overlay"),a.style.padding="40px",a.style.zIndex="2000",document.body.appendChild(a);let o=document.createElement("div"),r=document.createElement("div"),n=document.createElement("div"),s=document.createElement("div");s.className="v-msgbox-buttons",o.classList.add("v-dialog"),o.classList.add("v-msgbox"),n.innerHTML=e,o.setAttribute("path",_$2.currentPath);let i=function(){o.style.display="none",a.style.display="none",o.parentNode.removeChild(o),a.parentNode.removeChild(a),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)}r.className="v-dialog-content v-widget-content",r.appendChild(n),r.appendChild(s),o.appendChild(r),a.appendChild(o),a.style.visibility="unset",a.style.opacity="unset",a.style.overflow="auto",o.style.margin="0 auto",o.style.position="unset",resize()},configureAxios=e=>{let t;_$2.axios_get=e.get,e.interceptors.request.use((function(e){return _$2.eeee=e,e.mask?e.mask():t||(t=mask()),e}),(function(e){return t=unmask(t),MsgBox$1("request "+_$2.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,a=e&&e.data&&e.data.msg?e.data.msg:l.message;if(e&&(e.data&&e.data.message&&(a=e.data.message),"string"==typeof e.data&&(a=e.data),a||(a=e.status+": "+e.statusText)),t=unmask(t),e&&401==e.status&&_$2.app)return _$2.app.toast("Session terminada"),void _$2.app.logout();l.config?.error?l.config.error(l,a):(console.log(l),l.request?MsgBox$1("<b>"+l.request.responseURL+"</b><br/><br/>"+a):MsgBox$1(a))}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=>{for(let t in e)""!==e[t]&&null!==e[t]&&"function"!=typeof e[t]&&void 0!==e[t]||delete e[t];return e},sum=e=>(void 0).reduce(((t,l)=>t+((l=e?l[e]:l)?Number(l):0)),0);function createGetters(){return{get networkStatus(){return _$2.app?.networkStatus||{connected:!0}},get db(){return _$2.app?.db},app:()=>(console.log("get.app="+_$2.app),_$2.app),setApp(e){_$2.app=e,console.log("setApp="+_$2.app)}}}const app=()=>_$2.app,db=()=>_$2.db,initDB=(e,t)=>{let l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;if(_$2.IDBTransaction=window.IDBTransaction||window.webkitIDBTransaction||window.msIDBTransaction,_$2.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange||window.msIDBKeyRange,l){if(l)return _$2.stores=t,new Promise(((a,o)=>{let r=l.open("db",e);r.onupgradeneeded=e=>{let l=e.target.result;t.forEach((e=>{l.objectStoreNames.contains(e[0])||l.createObjectStore(e[0],e[1])}))},r.onerror=e=>{o(e)},r.onsuccess=()=>{_$2.db=r.result,a(_$2.db)}}))}else window.alert("Your browser doesn't support a stable version of IndexedDB.");return l},getStoredList=async(e,t)=>{let l;try{l=JSON.parse(sessionStorage.getItem("loadedStores"))}catch(e){}null==l&&(l={});const a=db();if(!l[e]&&networkStatus.connected){let t=_$2.stores.filter((t=>t[0]==e))[0];if(!t)throw"store '"+e+"' undefined";if(!t[2])throw"store url for '"+e+"' is empty";let o=t[2]?await _$2.axios_get(t[2]):[];const r=a.transaction([t[0]],"readwrite").objectStore(t[0]);await r.clear(),o=o.data||o;for(let e in o)try{await r.add(o[e])}catch(e){throw e}l[e]=1,sessionStorage.setItem("loadedStores",JSON.stringify(l))}let o=new Promise(((t,l)=>{if(a){let l=a.transaction(e).objectStore(e).getAll();l.onsuccess=function(){t(l.result)}}else l("db is null")}));return await o},getters=createGetters(),{networkStatus:networkStatus,setApp:setApp}=getters;class HTML2Canvas{props;ctx;lineHeight;constructor(e){this.props=e,this.ctx=e.ctx,this.lineHeight=e.lineHeight?e.lineHeight:20}heightText(e,t){const{ctx:l,lineHeight:a}=this;let o="",r=a;return e.split("").forEach((e=>{o+=e,l.measureText(o).width>=t-15&&(o="",r+=a)})),r+=7,r}drawText(e,t,l,a,o,r){const{ctx:n,lineHeight:s}=this;let i="",d=s+l;return n.fillStyle="#000000",e.split("").forEach((e=>{i+=e,n.measureText(i).width>=a-15&&(n.fillText(i,t,d),i="",d+=s)})),n.fillText(i,t+("right"==r?a-n.measureText(i).width:0),d),n.beginPath(),d+=7,d}}var script$c={name:"VNumber",props:{value:Number,max:Number,min:Number,delay:Number},setup(e,t){const{emit:l}=t,a=vue.ref(null);vue.onMounted((()=>{a.value=e.value})),vue.onUpdated((()=>{a.value=t.attrs.modelValue}));return{v:a,handleInput:t=>{let o=a.value;const r=t.target.getAttribute("decimal");null!==o?(o=num(o),e.max&&o>num(e.max)&&(o=num(e.max)),e.min&&o<num(e.min)&&(o=num(e.min)),null!==r&&(o=o.toFixed(Number(r)))):o=null,a.value=t.target.value;let n=_$2.calendarTimer;n&&clearTimeout(n),e.delay?_$2.calendarTimer=setTimeout((()=>{l("input",o),_$2.calendarTimer=null}),13===t.keyCode?0:e.delay):l("input",o)}}}};function render$9(e,t,l,a,o,r){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"number",onKeyup:t[0]||(t[0]=vue.withKeys(((...e)=>a.handleInput&&a.handleInput(...e)),["enter"])),"onUpdate:modelValue":t[1]||(t[1]=e=>a.v=e),onInput:t[2]||(t[2]=(...e)=>a.handleInput&&a.handleInput(...e)),class:"_"},null,544)),[[vue.vModelText,a.v,void 0,{number:!0}]])}script$c.render=render$9,script$c.__file="src/v-number.vue";var script$b={setup(e,t){const l=e,{displayField:a,store:o,filter:r}=l,{expose:n,emit:s}=t,i=vue.ref([]),d=vue.ref([]),c=vue.ref([]);vue.ref(null),vue.ref(null);const u=vue.inject("collect"),p=vue.computed((()=>d.value&&r?d.value.filter((e=>-1!==JSON.stringify(e).toLowerCase().indexOf(r.toLowerCase()))):d.value)),v=(e,t)=>{const l=c.value;if(l&&l.length)for(var a=0;a<l.length;a++)e&&(e=e[l[a]]);else e&&!t&&(e=e.id?e.id:e.code?e.code:e);return e},h=async(e=null,t=null,a=!1)=>{if(!a&&t&&e&&i.value.push([e,t]),!(i.value.length>1)){if(d.value=[],d.value||(d.value=[]),l.store){let t=await getStoredList(l.store);const[a]=e?Object.keys(e):[];if(a){let l;try{d.value=t.filter((t=>(l=t,l[a].startsWith(e[a]))))}catch(e){console.log("Error trying to filter ",l),console.error(e)}}else d.value=d.value.concat(t)}for(u(p),a||i.value.shift();i.value.length;){const e=i.value.shift()||[];await h(e[0],e[1],!0)}}};return h.getObjectByIndex=e=>{const t=p.value;return t?t[e]:null},h.getValueByIndex=e=>{const t=p.value;return t?v(t[e],1):null},h.getIndexByValue=(e,t)=>{e&&e.id?e=e.id:e&&e.code&&(e=e.code);for(var l=0;l<p.value.length;l++)if(v(p.value[l])==e)return t&&t(l),l;return t&&t(-1),-1},u.push(h),vue.onUpdated((()=>{u.updateSelect()})),vue.onMounted((()=>{l.valueField&&(c.value=l.valueField.split(".")),u.updateSelect()})),vue.onUnmounted((()=>{u.remove(h)})),n({load:h}),()=>p.value.map((e=>vue.h("option",{value:v(e)},e[a])))},name:"VOptions",props:{url:String,src:String,displayField:String,data:Array,store:null,valueField:String,filters:null,filter:null,mode:null},watch:{data(){this.$parent.updateSelect()}},created(){var e=this;e.data&&(e.data2=e.data)},updated(){let e=this;!e.loaded&&e.data&&(e.data2=e.data)},methods:{getParentE(){return this.$el.parentElement.parentElement},getSelectedItem(){var e=this.$el.parentElement;return this.filterList[e.selectedIndex-1]},async load2(e,t,l){}},__file:"src/v-options.vue"},ol$1=window.ol,_$1=window._,axios$1=window.axios,script$a={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$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 l=e.$el.parentElement;var a=window.getComputedStyle(l),o=parseFloat(a.left),r=parseFloat(a.top),n=t.clientX,s=t.clientY,i=l.parentElement;function d(e){l.style.left=o+e.clientX-n+"px",l.style.top=r+e.clientY-s+"px"}i.addEventListener("mousemove",d,!1),i.addEventListener("mouseup",(function(){i.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(_$1.remoteServer+e.src).then((t=>{e.$emit("input",t.data)}))},open(e){for(var t=this,l=e.map,a=e.feature,o=t.overlay,r=o.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),o.setPosition(e.coordinate);var i=l.getView().getCenter(),d=l.getView().getResolution(),c=a?a.getGeometry().getCoordinates():[null],u=l.getPixelFromCoordinate(Number(c[0])?c:e.coordinate);if(this.src)axios$1.get(_$1.remoteServer+this.src).then((e=>{t.$emit("input",e.data),t.c++,setTimeout((function(){var e=l.viewport_.offsetWidth,a=l.viewport_.offsetHeight,n=r.children[0].children[1];n.scrollTop=0;var s=r.offsetHeight;n.style.height=s+100>=a?a-100-r.children[0].children[0].offsetHeight+"px":"300px",s=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,l.getView().animate({center:[i[0]+(u[0]+p+20>=e?+(u[0]+p+20-e):u[0]-20-p<0?-p+u[0]-20:0)*d,i[1]+(u[1]<s?s-u[1]:0)*d],duration:500}),u[0]=u[0]+p-0,u[1]=u[1]-12,o.setPosition(l.getCoordinateFromPixel(u)),t.$el.style.opacity=1,_$1.mobil)for(var v=o.getElement().querySelectorAll("a:not(._)"),h=0;h<v.length;h++)v[h].addEventListener("click",_$1.open2)}),400)})).catch((e=>{console.log(e)}));else{var p=l.viewport_.offsetWidth,v=l.viewport_.offsetHeight,h=r.children[0].children[1];h.scrollTop=0;var m=r.offsetHeight;console.log(r.offsetHeight),h.style.height=m+100>=v?v-100-r.children[0].children[0].offsetHeight+"px":"300px",m=r.offsetHeight;var g=1*t.width,f=p<=g+40?p-40:g;if(r.style.zIndex=10,r.style.width=f+"px",f/=2,l.getView().animate({center:[i[0]+(u[0]+f+20>=p?+(u[0]+f+20-p):u[0]-20-f<0?-f+u[0]-20:0)*d,i[1]+(u[1]<m?m-u[1]:0)*d],duration:500}),u[0]=u[0]+f-0,u[1]=u[1]-12,o.setPosition(l.getCoordinateFromPixel(u)),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,_$1.mobil){var y=o.getElement().querySelectorAll("a:not(._)");for(s=0;s<y.length;s++)y[s].addEventListener("click",_$1.open2)}t.$emit("opened",{target:t})}}}};const _hoisted_1$7={class:"v-ol-overlay"},_hoisted_2$6={key:0,class:"v-panel-titlebar"},_hoisted_3$4=vue.createElementVNode("i",{class:"fa fa-times"},null,-1),_hoisted_4$2=[_hoisted_3$4],_hoisted_5$1={key:2,style:{"text-align":"center"}},_hoisted_6=vue.createElementVNode("img",{src:_imports_0,width:"20",height:"18"},null,-1),_hoisted_7=[_hoisted_6];function render$8(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[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)=>r.close&&r.close(...e))},[..._hoisted_4$2]),vue.createTextVNode(vue.toDisplayString(l.header),1)])):vue.createCommentVNode("v-if",!0),(vue.openBlock(),vue.createElementBlock("div",{class:"v-ol-body",key:"c-"+o.c,style:{padding:"10px"}},[l.value?vue.renderSlot(e.$slots,"default",{key:0,value:l.value}):vue.createCommentVNode("v-if",!0)])),r.hasSlot("footer")&&l.value?(vue.openBlock(),vue.createElementBlock("footer",{key:"f-"+o.c},[vue.renderSlot(e.$slots,"footer",{value:l.value})])):vue.createCommentVNode("v-if",!0),o.coordinate?(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,[..._hoisted_7])):vue.createCommentVNode("v-if",!0)])}script$a.render=render$8,script$a.__file="src/v-overlay.vue";var script$9={name:"VPanel",props:{header:String}};const _hoisted_1$6={class:"ui-panel"},_hoisted_2$5={key:0,class:"v-panel-titlebar v-widget-header ui-helper-clearfix ui-corner-all"},_hoisted_3$3={class:"v-panel-title"},_hoisted_4$1={class:"v-panel-content v-dialog-content v-widget-content"};function render$7(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[l.header?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$5,[vue.createElementVNode("span",_hoisted_3$3,vue.toDisplayString(l.header),1)])):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",_hoisted_4$1,[vue.renderSlot(e.$slots,"default")])])}script$9.render=render$7,script$9.__file="src/v-panel.vue";var script$8={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$5={class:"v-popup",style:{position:"absolute"}};function render$6(e,t,l,a,o,r){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[vue.renderSlot(e.$slots,"default")],512)),[[vue.vShow,o.show]])}script$8.render=render$6,script$8.__file="src/v-popup.vue";var script$7={name:"VRadio",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(){}}};const _hoisted_1$4={class:"v-radio",style:{"font-weight":"normal !important",display:"block"}},_hoisted_2$4=["value"],_hoisted_3$2=vue.createElementVNode("span",{class:"checkmark"},null,-1);function render$5(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("label",_hoisted_1$4,[vue.createTextVNode(vue.toDisplayString(l.label?l.label:l.value)+" ",1),vue.createElementVNode("input",{type:"radio",value:l.value},null,8,_hoisted_2$4),_hoisted_3$2,vue.renderSlot(e.$slots,"default")])}script$7.render=render$5,script$7.__file="src/v-radio.vue";var script$6={__name:"v-radio-group",props:{required:String,name:String,modelValue:String,items:{type:Array,required:!0},type:{type:String,default:"radio"},label:{type:String,default:""}},emits:["update:modelValue"],setup(e,{emit:t}){const l=e,a=t,o=vue.ref(l.modelValue),{proxy:r}=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(r.$el,[]);let t=l.name;t||(t="input_"+Date.now().toString(36)+Math.random().toString(36).substring(2,15));for(let l=0;l<e.length;l++)e[l].name=t,n.has(e[l])||(e[l].addEventListener("change",d),n.add(e[l])),e[l].checked=e[l].value===o.value},d=e=>{let t=e.target.value;""===t&&(t=null),o.value=t,a("update:modelValue",t)};vue.watch((()=>l.modelValue),(e=>{o.value=e,i()})),vue.onMounted((()=>{i()})),vue.onUpdated((()=>{i()}));const c=()=>{const e=[];return r.$slots.default&&e.push(...r.$slots.default()),l.items&&e.push(...l.items.map((e=>vue.h(script$7,{...e,modelValue:o.value,"onUpdate:modelValue":d})))),vue.h("div",[l.label&&vue.h("label",l.label),...e])};return(e,t)=>(vue.openBlock(),vue.createBlock(c))},__file:"src/v-radio-group.vue"},script$5={name:"VSelect",setup(e,t){const{slots:l,emit:a}=t,{displayField:o,valueField:r,disabled:n,readonly:s,autoload:i}=e,d=vue.ref([]),c=vue.ref([]),u=vue.ref([]),p=[],v=vue.ref(!(i+""=="false"||1*i==0)),h=vue.ref(null),m=e=>{const t=e.value;d.value=o?t.sort(((e,t)=>{const l=e[o];return l>t[o]?1:l<t[o]?-1:0})):t},g=()=>{let e=t.attrs.modelValue;if(null!=e&&e.target&&(e=e.value),h.value){let t=h.value,l=t.selectedIndex;e&&""!==e||(t.selectedIndex=0);for(let l=0;l<t.length;l++)t[l].value==e&&(t.selectedIndex=l);const o=p;for(let r=0;r<o.length;r++){if(!o[r].getValueByIndex)continue;let n=o[r].getValueByIndex(l-1);o[r].getIndexByValue(e,((l,s)=>{if(l>-1){t.selectedIndex=l+1;let s=o[r].getValueByIndex(t.selectedIndex-1);-1==s?s=null:o[r].getObjectByIndex&&(s=o[r].getObjectByIndex(t.selectedIndex-1));let i=Number(n);i=isNaN(i)?n?!!e&&(e.id?e.id==n.id:e==n):!e:i==Number(e),i||a("input",e,{value:e,select:t,object:s})}}))}}};m.remove=e=>{const t=p.filter((t=>t!==e));p.length=0,t.forEach((e=>p.push(e)))},m.push=e=>{p.push(e)},m.updateSelect=()=>{g()},r&&(c.value=r.split(".")),vue.provide("collect",m);const f=(t,l)=>{e.disabled?u.value=[t,l]:(u.value=[],p.forEach((e=>{e(t,l)})))};return vue.onMounted((()=>{f()})),vue.onUpdated((()=>{g()})),{options:d,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;t&&""!==t||(t=null,l.selectedIndex=0);let o,r=0;const n=d.value;for(let e=0;e<p.length;e++){if(r=p[e].getValueByIndex(l.selectedIndex-1),-1!=r){o=p[e].getObjectByIndex(l.selectedIndex-1);break}r=0}r?t=r:n.length&&(l.selectedIndex=0),a("update:modelValue",t,{value:t,select:l,object:o}),a("input",t,{value:t,select:l,object:o})},onInput:e=>{e.target.value,e.stopPropagation()},select:h,load:f,lastLoad:u,autoload_:v}},props:{required:null,readonly:null,multiple:null,label:null,disabled:null,autoload:null,displayField:null,valueField:null},data:()=>({autoload_:!0,ik:0,data:[],popup:null,show:!1,sel:[],sela:null,tmp:[],sel2:[]}),mounted(){},watch:{disabled(e,t){this.activate(e,t)},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 a=e.getBoundingClientRect();const o=l.children[0];window.innerWidth<400?(l.style.padding="40px",l.style.height="100%",o.style.height="100%"):(l.style.top=a.bottom+0+"px",l.style.left=a.left+0+"px",l.style.maxHeight=window.innerHeight-a.bottom-30+"px",o.style.maxHeight=l.style.maxHeight),o.style.display="flex",o.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()}}},methods:{activate(e,t){e=!!e,t=!!t;let l=this.lastLoad,a=this;!e&&!e===t&&l.length&&(this.$el.disabled=!1,a.load(l[0],l[1]))},expand(){console.log("click")},internalLoad(){let e=this;e.autoload_=!(e.autoload+""=="false"||1*e.autoload==0);let t=e.$attrs.value;null!=t&&t.target&&(t=t.value);let l=e.$el.childNodes[0];t&&""!==t||(l.selectedIndex=0),t=e.$attrs.value;for(let e=0;e<l.length;e++)l[e].value==t&&(l.selectedIndex=e);e.autoload_&&e.load(),e.$emit("mounted",e)},toggle(){this.show=!this.show},close(){this.show=!1},selectAll(){let e=[];for(let t=0;t<this.data.length;t++)e.push(this.data[t].value);this.sel=e,this.ik++},checkboxInput(){let e=this.sel;e&&e.length&&(e=e.join(","))}}};const _hoisted_1$3={class:"v-select",style:{position:"relative"}},_hoisted_2$3=["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$4(e,t,l,a,o,r){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$3,[l.readonly?vue.createCommentVNode("v-if",!0):vue.withDirectives((vue.openBlock(),vue.createElementBlock("select",{key:0,style:{width:"100%"},ref:"select",onChange:t[0]||(t[0]=(...e)=>a.onChange&&a.onChange(...e)),onInput:t[1]||(t[1]=(...e)=>a.onInput&&a.onInput(...e)),required:l.required,disabled:l.disabled,click:r.expand},[vue.renderSlot(e.$slots,"default")],40,_hoisted_2$3)),[[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":o.show}]),ref:"button",style:{"padding-top":"3px","padding-bottom":"3px"},onClick:t[2]||(t[2]=(...e)=>r.toggle&&r.toggle(...e))},"   ",2),vue.withDirectives(vue.createElementVNode("div",{ref:"popup",onClick:t[5]||(t[5]=(...e)=>r.close&&r.close(...e)),style:{"background-color":"#0000009c"}},[vue.createElementVNode("div",_hoisted_3$1,[vue.createElementVNode("div",_hoisted_4,[vue.createVNode(n,{modelValue:o.sela,"onUpdate:modelValue":t[3]||(t[3]=e=>o.sela=e),onInput:r.selectAll},null,8,["modelValue","onInput"])]),(vue.openBlock(),vue.createBlock(s,{class:"v-select-checkbox-group",style:{"overflow-y":"auto"},key:"p"+o.ik,modelValue:o.sel,"onUpdate:modelValue":t[4]||(t[4]=e=>o.sel=e),onInput:r.checkboxInput},{default:vue.withCtx((()=>[o.data.length?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(o.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,o.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$5.render=render$4,script$5.__file="src/v-select.vue";var script$4={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$2=["value","data-value"],_hoisted_2$2=["onClick"];function render$3(e,t,l,a,o,r){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(o.options,(e=>(vue.openBlock(),vue.createElementBlock("div",{onClick:t=>r.onChange(e),style:vue.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.normalizeClass({"v-selected":e==o.selected})},vue.toDisplayString(e),15,_hoisted_2$2)))),256))],8,_hoisted_1$2)}script$4.render=render$3,script$4.__file="src/v-switch.vue";var script$3={name:"VTable",setup(e,t){const l=vue.ref(1),a=vue.ref(0),o=vue.ref([]),r=vue.ref([]),n=vue.ref(null),s=vue.ref(1),i=vue.computed((()=>{const t=e,l=r.value;let a,o;return l.sum=sum,l.filter((e=>{for(var l in t.filters)if(a=t.filters[l],"function"==typeof a){if(!a(e))return 0}else if(a&&"string"==typeof a&&l in e&&(o=e[l],"string"==typeof o&&(o=o.toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""),!o.includes(a.toUpperCase()))))return 0;return 1}))})),d=vue.computed((()=>{let e=i.value;return e=n?e.sort(((e,t)=>{t=(t=t[n])||0,e=e[n];const l=Number(e);return l&&(e=l),e<t?-1*s:e>t?1*s:0})):e,e.sum=sum,e})),c=[],u=vue.ref(1),p=vue.ref(0),{slots:v,expose:h,emit:m}=t,g=async()=>{var t,l=e.store;null!=l&&(db&&(t=await getStoredList(l)),t||(t=[]),r.value=r.value?t.concat(r.value):t);return data_},f=(e,t,a)=>{var n;if(-10===t)if(i.value.length===o.value.length)o.value=[];else for(o.value=[],n=0;n<i.value.length;n++)o.value.push(n);else a?l.value||!o.value.contains(t)?o.value=[t]:(o.value=[],e=null):this.selected.contains(t)?(o.value.splice(o.value.indexOf(t),1),e=null):o.value.push(t);var s=[],d=o.value.sort(((e,t)=>e-t));for(t=0;d.length>t;t++)s.push(r.value[d[t]]);m("row-select",{target:this,current:e,selection:s})},y=(t,l)=>{const a=[];return e.selectable&&(e=>o.value.includes(e))(t)&&a.push("v-selected"),e.rowStyleClassFunc&&a.push(e.rowStyleClassFunc(l)),a};let $=""+e.selectable;l.value="false"!=$&&"0"!=$?1:0,$=""+e.scrollable,a.value=e.scrollable&&"false"!=$&&"0"!=$?1:0;const b=v.default({row:{}});b&&b.forEach(((e,t)=>{const l=e.props;e.children&&e.children.filter&&(e.children.filter((e=>"v-filter"==e.type)).forEach((t=>{l.filter=t,p.value=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.type)).forEach((t=>{l.footer=t,e.children.shift()}))),c.push({filter:l.filter,header:l.header,width:l.width})}));return h({load:()=>{const t=e;if(o.value=[],t.value&&(r.value=t.value),t.src){var l=t.src;if(!l)return;l.endsWith("/")&&(l=l.slice(0,l.length-1));const e=t.pagination;if(e&&(l+="/"+(u.value-1)*e+"/"+e),networkStatus.connected){var a;if(t.gql){const l=t.gql,o="query{"+Object.keys(l)[0]+"(offset:"+(u.value-1)*e+" limit:"+e+"){\ndata{"+l[Object.keys(l)[0]]+"}\nsize\n}\n}";a=axios$2.post(t.src,{query:o})}else a=axios$2.get(l,{params:clean(t.filters)});a.then((l=>{if(l.data&&l.data.error)MsgBox(l.data.error);else{var a=l.data;t.gql&&(a=l.data.data[Object.keys(t.gql)[0]]),r.value=a.data||a,a&&a.hasOwnProperty("size")&&e&&(t.pages=Math.ceil(a.size/e),u.value>t.pages&&(u.value=1),t.size=a.size),g(),m("loaded",{target:t}),m("row-select",{}),t.remoteLoaded=1,t.loaded=1,t.kc++}})).catch(t.error)}else{r.value=[];const e=g();e.then&&e.then((e=>{r.value=e})),m("row-select",{target:t})}}else r.value=[],g().then((()=>m("loaded",{target:t})));t.kc++,t.loaded=1}}),()=>{const t=vue.h("div",{className:"v-datatable-scrollable-header-box",style:"position: absolute; height: 47px; left: 0px;"},vue.h("table",{className:"v-cloned-header v-table",style:"width: 1536px;"},[vue.h("th",{width:42},[vue.h("span",{className:"v-check"},vue.h("i",{className:"fa fa-lg"}))]),c.map((e=>vue.h("th",e,[e.header,e.filter?.children])))]));return vue.h("div",{className:"v-datatable"},[vue.h("div",{className:"v-datatable-header v-widget-header ui-corner-top"},v.header()),vue.h("div",{className:"v-paginator v-paginator-top v-widget-header v-paginator-pages center"},[vue.h(script$n,{value:"|<"}),vue.h(script$n,{value:"<"}),vue.h("input",{type:"number",style:"width:60px"}),vue.h(script$n,{value:">"}),vue.h(script$n,{value:">|"})]),vue.h("div",{className:"v-widget-header v-datatable-scrollable-header",style:"position: relative; height: 110px; margin-right: 0px;"},t),vue.h("div",{className:"v-datatable-scrollable-body",style:"overflow-y: auto; flex:1",onScroll(e){const l=e.currentTarget.scrollLeft;t.el.style.left="-"+l+"px"}},[vue.h("table",{className:"v-table",style:"width: 1536px;"},[vue.h("thead",{className:"v-head-cloned"},[vue.h("th",{width:42}),...c.map((e=>vue.h("th",{width:e.width})))]),vue.h("tbody",{className:"v-datatable-data"},d.value.length<1?vue.h("td",{colspan:c.length+(l.value?1:0)},e.emptyMessage):[d.value.map(((e,t)=>{const a=v.default({row:e});return a.forEach(((e,t)=>{delete e.props.header,delete e.props.width,e.children&&(e.children.filter((e=>"v-filter"==e.type)).forEach((t=>{p.value=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.type)).forEach((t=>{e.children.shift()})))})),vue.h("tr",{className:y(t,e),onclick(a){((e,t,a)=>{l.value&&0==whichChild(e.target)||f(t,a,1)})(a,e,t)}},[vue.h("td",{width:24}),...a])}))])])])])}},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,pagination:null,selectable:{default:!0},scrollable:null,autoload:{default:!0}},data:()=>({pages:1,resizeAfterUpddate:0,active:0,kc:1,keyBody:1,columns:null,row:{},hasFilters:0,kt:0,size:null,sortKey:"",paginatio_:0,remoteLoaded:null,loaded:!1,sortOrders:{},rowStyleClassFunc:null}),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 l=t.$target.k;e.kt!=l&&(e.load(),e.kt=l)})),e.active&&e.buildColumns(),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),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"),l=e.$el.querySelectorAll(".v-datatable-scrollable-header-box")[0];if(l){var a=e.$el.querySelectorAll(".v-cloned-header");if(0===a.length){a=document.createElement("table");var o=t[0].querySelectorAll("thead")[0],r=0,n=0,s=document.createElement("canvas"),i=window.getComputedStyle(l),d=s.getContext("2d");d.font=i.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,v=new HTML2Canvas({lineHeight:parseInt(i.lineHeight),ctx:d});r=0;if(u.forEach(((t,l)=>{t.childNodes[0].onclick=m;var a=e.columns[l-(selectable0.value?1:0)];if(a&&a.filter&&a.filter.elm)if(a.filter.elm.children.forEach)a.filter.elm.children.forEach((e=>t.appendChild(e)));else for(let e of a.filter.elm.children)t.appendChild(e);else if(l>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 s=t.childNodes[0].offsetHeight;s=v.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",s>n&&(n=s)})),u.forEach(((e,t)=>{t&&(e.childNodes[0].style.height=n+"px"),a.appendChild(e)})),u.forEach(((e,t)=>{var l=document.createElement("th");l.width=e.width,o.childNodes[0].appendChild(l)})),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 a=e.currentTarget.scrollLeft;l.style.left="-"+a+"px",t[0].style.left="-"+a+"px"}));var h=t[1].querySelectorAll("td");for(p=0;p<u.length;p++)h[p]&&(h[p].style.width=u[p].width+"px")}else t[0].parentElement.addEventListener("scroll",(e=>{var t=e.currentTarget.scrollLeft;l.style.left="-"+t+"px"}));a.style.width=r+"px";var m=t=>{var l=e.columns[t.target.parentNode.getAttribute("ind")].sort;l==e.sorter&&(e.sortDir=-1*e.sortDir),e.sorter=l};a.className="v-cloned-header v-table",l.appendChild(a),l.appendChild(l.firstChild),l.style.position="absolute",l.style.height=n+37-37+"px",l.parentElement.style.height=l.style.height,e.$el.style.maxHeight&&(l.parentElement.nextElementSibling.style.maxHeight=parseInt(e.$el.style.maxHeight)-n+"px"),o.className="v-head-cloned"}}var g=e.$el.querySelectorAll(".v-check > svg");for(p=0;p<g.length;p++)g[p].dataset.icon=g[p].parentNode.dataset.icon;if(e.loaded){for(var f=e.$el.querySelectorAll(".group"),y=0;y<f.length;y++)f[y].parentNode.removeChild(f[y]);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(){emit("updated",t)}),100)}},methods:{buildColumns(){},resize(e){var t=this.$el;setTimeout((()=>{var l=t.querySelector(".v-datatable-header");l&&(e-=l.offsetHeight),(l=t.querySelector(".v-paginator"))&&(e-=l.offsetHeight),(l=t.querySelector(".v-datatable-scrollable-header"))&&(l.style.height=l.querySelector("table").offsetHeight+"px",e-=l.offsetHeight),(l=t.querySelector(".v-table-summary"))&&(e-=l.offsetHeight);const a=(l=t.querySelector(".v-datatable-scrollable-body")).offsetWidth-l.clientWidth;l.style.overflowY="auto",l.style.height=e+"px",(l=t.querySelector(".v-datatable-scrollable-header-box"))&&(l.parentNode.style.marginRight=a+"px"),(l=t.querySelector(".v-table-summary"))&&(l.style.overflowY="hidden",l.style.marginRight=a+"px")}),100)},to(e,t){this.loadP(e,t)},loadP(e,t){var l=this;(l.page!=e||t)&&(l.page=e,l.load())},rowCreated(){},hasSlot(e){return!!this.$slots[e]},sortBy(){},rowSelect(e,t,l){var a,o=this;if(-10===t)if(filteredData.value.length===o.selected.length)o.selected=[];else for(o.selected=[],a=0;a<filteredData.value.length;a++)o.selected.push(a);else l?selectable0.value||!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]]);emit("row-select",{target:o,current:e,selection:r})},async getStoredList(e){let t=new Promise((t=>{console.log(db);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$2={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 a=new Event("tabChange",{bubbles:!1});a.$target=t,l.dispatchEvent(a),t.$el.style.height=t.height+"px",(a=new Event("parentResize",{bubbles:!1})).height=t.$el.offsetHeight-25,l.style.height=a.height+"px",setTimeout((()=>{l.dispatchEvent(a)}),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 a=new Event("parentResize",{bubbles:!1});a.height=e.$el.offsetHeight-25,a.target=e.$el,a.$target=e;for(var o=1;o<t.length;o++)"none"!=t[o].style.display&&(console.log("Se envia el alto "+a.height),t[o].style.height=a.height+"px",t[o].dispatchEvent(a));e.$emit("resize",a)})),t[1+e.currentTabIndex].setAttribute("active",1);var a=new Event("tabChange",{bubbles:!1});a.$target=e,t[1+e.currentTabIndex].dispatchEvent(a)}};const _hoisted_1$1={class:"v-tab-nav"},_hoisted_2$1=["onClick"];function render$2(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",{class:"v-tabview",style:vue.normalizeStyle({height:o.height+"px"})},[vue.createElementVNode("ul",_hoisted_1$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(o.tabs,((e,t)=>(vue.openBlock(),vue.createElementBlock("li",{class:vue.normalizeClass({"v-selected":t==o.currentTabIndex}),key:t,onClick:e=>o.currentTabIndex=t},vue.toDisplayString(e.title),11,_hoisted_2$1)))),128))]),vue.renderSlot(e.$slots,"default")],4)}script$2.render=render$2,script$2.__file="src/v-tabview.vue";var script$1={name:"VTextarea",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,l=e.$el;(t=window.attachEvent?function(e,t,l){e.attachEvent("on"+t,l)}:function(e,t,l){e.addEventListener(t,l,!1)})(l,"change",e.resize),t(l,"cut",e.delayedResize),t(l,"paste",e.delayedResize),t(l,"drop",e.delayedResize),t(l,"keydown",e.delayedResize)}};function render$1(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("textarea",null,vue.toDisplayString(l.value),1)}script$1.render=render$1,script$1.__file="src/v-textarea.vue";var script={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,a=new FormData;t=t||e.name.replace(/[^\w\s.]/gi,""),a.append("filename",t),a.append("file",e,t),l.showProgress=!0,axios.post((l.domain?l.domain:"")+"/api/file/upload",a,{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={style:{cursor:"pointer"},class:""},_hoisted_2=["data-icon"],_hoisted_3=[".value"];function render(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",{onClick:t[1]||(t[1]=(...e)=>r.other&&r.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,[l.click?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("input",{key:0,type:"file",onChange:t[0]||(t[0]=e=>r.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),vue.createTextVNode(vue.toDisplayString(l.onlyicon?"":null!=l.value?l.value:"Adjuntar Archivo")+" ",1),o.showProgress?(vue.openBlock(),vue.createElementBlock("progress",{key:1,max:"100",style:{width:"100%"},".value":o.uploadPercentage},null,40,_hoisted_3)):vue.createCommentVNode("v-if",!0)])],6)}script.render=render,script.__file="src/v-uploader.vue";var components={InputTextarea:script$p,InputText:script$q,VAutocomplete:script$o,VButton:script$n,VCalendar:script$m,VCheckboxGroup:script$l,VCheckbox:script$k,VDataview:script$j,VFieldset:script$i,VForm:script$h,VGroup:script$g,VLayerControl:script$f,VMapControl:script$e,VMap:script$d,VNumber:script$c,VOptions:script$b,VOverlay:script$a,VPanel:script$9,VPopup:script$8,VRadioGroup:script$6,VRadio:script$7,VSelect:script$5,VSwitch:script$4,VTable:script$3,VTabview:script$2,VTextarea:script$1,VUploader:script};const bindLinks=(e,t)=>{var l=void 0;if((e=e||l.$el).querySelectorAll)for(var a=e.querySelectorAll("a:not(._),ion-item:not(._)"),o=function(e){e.preventDefault()},r=function(e){e.preventDefault(),t&&t(),l.open(e)},n=0;n<a.length;n++)a[n].attributes.href?a[n].onclick=r:a[n].onclick=o,a[n].classList?a[n].classList.add("_"):a[n].className="_"},IsobitUI={install(e){setApp(e),e.BUILT_ON=(void 0).VITE_APP_BUILT_ON,e.bindLinks=bindLinks,configureAxios(axios$2);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 ui=cfg=>{const defs={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(!_$2._session){var e=localStorage.getItem("session");e=e?JSON.parse(e):{},_$2._session=e}return _$2._session},set(e){e?(Array.isArray(e.perms)&&(e.perms=e.perms.reduce(((e,t)=>(e[t]=!0,e)),{})),localStorage.setItem("session",JSON.stringify(e))):localStorage.removeItem("session"),_$2._session=e}},online(){return this.app2&&this.app2.networkStatus?.connected},cleanedFilters(){return clean(this.filters)},app:()=>_$2.app,user:()=>_$2.app.session,perms(){return this.session.perms||this.session.allcaps||{}},rowSelectedCount:()=>1,baseURL:()=>axios$2.defaults.baseURL},data(){return{app2:null,filters:{},ui:this,_session:null,x_connected_:null,row:{},networkStatus:{connected:null}}},created(){let e=this;_$2.app2||(_$2.app2=e,console.log("app created",_$2.app2)),e.app2=_$2.app2},methods:{pad:pad,resize(){},vv(e){var t=this;Network.getStatus().then((function(l){if(l.connected){var a=localStorage.getItem("session");if(a){try{a=JSON.parse(a)}catch(e){a={}}a.connected=e,localStorage.setItem("session",JSON.stringify(a))}}else t.toast("El dispositivo no tiene acceso a internet!"),t.connected=l.connected}))},getSelected(e){for(var t=e&&e.$vnode?e:this.$children[0].$children[0],l=[],a=0;a<t.selected.length;a++)l.push(t.data[t.selected[a]]);return l},getRowSelectedCount(){var e=this.$children[0].$children[0];return e?e.selected.length:0},rewrite:e=>e,edit(e){var t=this,l=t.$children[0].action,a=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];l||(l=window.location.pathname),a&&a.src&&(l=a.src),e.action&&(l=e.action),a||(a=e.$vnode||e.target&&e.target.$vnode?e:t.$children[0].$children[0]).src&&(l=a.src),l&&(l=t.rewrite(l.replace("/api","").replace("/0/0","")));var o=t.getSelected(a)[0],r=o[a.rowKey];o.tmpId&&(r=-o.tmpId),t.getSelectedId&&(r=t.getSelectedId(o)),_$2.app?t.open(l+"/"+r+"/edit"):axios$2.get((_$2.currentPath=(l+"/"+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 l=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];l||(l=e.$vnode?e:t.$children[0].$children[0]);var a=e.$vnode?e.load:null,o=l.$attrs.rowkey;o||(o=l.rowKey);var r=l.data[l.selected[0]];if(l.data,r.tmpId)t.MsgBox("Esta seguro que desea eliminar los registros temporales seleccionados ?",(function(e){if(0==e){for(var o=0,n=_$2.db.transaction([l.store],"readwrite").objectStore(l.store),s=[],i=l.selected.length-1;i>=0;i--)r=l.data[l.selected[i]],s.push(r),r.tmpId&&n.delete(r.tmpId),o++,l.data.splice(l.selected[i],1);o&&(t.app&&t.app.toast?t.app.toast(o+" registros eliminados"):t.MsgBox(o+" registros eliminados")),l.rowSelect(null,-1),l.selected=[],t.$emit("destroyed",s,l.store),a&&a()}}),["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 a=l.src.replace("/0/0",""),o=[],s=l.selected.length-1;axios$2.delete(a+"/"+n,{params:l.filters}).then((()=>{for(;s>=0;s--)r=l.data[l.selected[s]],o.push(r),l.data.splice(l.selected[s],1);t.app&&t.app.toast?t.app.toast(o.length+" registros eliminados"):t.MsgBox(o.length+" registros eliminados"),l.rowSelect(null,-1),l.selected=[]})).catch(t.error)}}),["SI","NO"])}},apiLink:e=>e.replace(_$2.contextPath,_$2.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("me.$route=",me.$router,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:{};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:_$2.currentPath=path+("string"==typeof o?"/"+o:"")};return"function"==typeof o?cfg.result=o:"object"==typeof o&&(cfg=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)}}var dialog,nid=Vue.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",_$2.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.resize()};if(for_&&for_.classList.contains("panel")){if(for_.id)window.currentEl="#"+for_.id;else{var clsId="cls-id-"+Vue.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"),l=dialog.querySelector(".v-panel-titlebar"),a=window.innerHeight-94-(l?l.clientHeight:0);(t||dialog).style.height=a+"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=_$2.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=_$2.varMap[children.getAttribute("vueid")],tb.onclick=e=>{e.preventDefault();var t=[],l=vue.$children[0].$children[0];for(i=0;i<l.selected.length;i++)t.push(l.filteredData[l.selected[i]]);path.result(t),delete path.result,vue.close(e)},f.appendChild(tb)}resize()}_$2.storeFunction["PROPS="+nid]=path,_$2.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.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=_$2.closest(event.target,".v-dialog"))}catch(e){console.log(e)}t||(t=this.$el.parentElement);var l=t.parentElement;if(l||!_$2.app.$router){t.style.display="none",(" "+l.className+" ").indexOf(" v-overlay ")>-1?l.style.display="none":l=null,Vue.resize();var a=_$2.storeFunction[t.getAttribute("callback")];a&&a(e),t.parentNode.removeChild(t),l&&l.parentNode.removeChild(l),document.documentElement.style.overflow="auto",document.body.scroll="yes"}else _$2.app.$router.back()},create(){const e=this,t=e.$el.__vnode.ctx.exposed;console.log(t);var l=t.action;l||(l=window.location.pathname),l&&(l=l.replace("/api","")),app()?e.open(l+"/create"):instance.get(_$2.currentPath=(l+"/create").replace(/([^:]\/)\/+/g,"$1")+"?modal").then(_$2.open).catch(e.error)},refresh(){const e=this.$el.__vnode;console.log(e.children[1].children[0]);e.children[1].children[0].children[0].component.exposed.load()},async sync(e){var t=this,l=t.$el.querySelector("form").getAttribute("action");if(!l){var a=(l=t.$el.parentNode.getAttribute("path")).split("/");a="edit"==a[a.length-1]?a.splice(0,a.length-2):a.splice(0,a.length-1),l=t.apiLink(a.join("/"))}var o=t.$children[0].$children[0];l=o.src;for(var r=await t.getStoredList(o.store),n=o.selected,s=[],i=[],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,i.push(p),s.push(u)}}s.length>0&&axios$2.post(l+"/bulk"+(e.sufix?e.sufix:""),i).then((function(e){let l=e.data;for(let e=0;e<l.length;e++){if(l[e].errors){t.MsgBox(JSON.stringify(l[e].errors));break}if(l[e].error){t.MsgBox(l[e].error);break}for(var a=0;a<r.length;a++)(l[e].ext&&l[e].ext.tmpId==r[a].tmpId||l[e].tmpId==r[a].tmpId)&&(console.log("ok"),l[e].ext&&r.ext&&(r[a].ext.error=l[e].ext.error),l[e].id&&(r[a].id=l[e].id),r[a].synchronized=1,t.$emit("sync",l[e],r[a]))}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();let t=e.$el.querySelector("form");if(this.validate(t)){let s=t.getAttribute("action");if(!s&&(s=e.$el.parentNode.getAttribute("path"),s)){let t=s.split("/");t="edit"==t[t.length-1]?t.splice(0,t.length-2):t.splice(0,t.length-1),s=e.apiLink(t.join("/"))}let i=e.$data.data?e.$data.data:e.$data.o;var l=JSON.parse(JSON.stringify(i));if(e.process&&(l=e.process(l)),"object"!=typeof l||Array.isArray(l)||null===l)return;if(s&&e.app2.connected)axios$2.post(s,l).then((t=>{var a=t.data;if(l.tmpId){alert(12);var o=e.$children[0].store,r=window._.db.transaction([o],"readwrite").objectStore(o),n=r.get(l.tmpId);a.id&&(l.id=a.id,i.id=l.id),n.onsuccess=function(){i.synchronized=1,l.synchronized=1,(n.result?r.put(l):r.add(l)).onerror=e=>{console.error(e)},e.$emit("sync",a,l)},n.onerror=function(){e.MsgBox("Error getting temporal record "+l.tmpId)}}e.app&&e.app.toast?e.app.toast("El registro fue grabado exitosamente!",(()=>{e.close({success:!0,data:a})})):MsgBox$1("El registro fue grabado exitosamente!",(()=>{e.close({success:!0,data:a})}))})).catch((function(l){var a,o;if(l.response)if("string"==typeof l.response.data)e.MsgBox(l.response.data);else{a=l.response.data.propertyViolations;for(var r=0;r<a.length;r++){var n=a[r];(o=t.querySelector("[name="+n.path+"]"))&&e.showerror(o,n.message)}for(a=l.response.data.fieldViolations,r=0;r<a.length;r++)n=a[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 s=await e.getStoredList(t);if(s||(s=[]),l.id)for(var a=0;a<s.length;a++)s[a].tmpId==l.tmpId&&(delete l.synchronized,s[a]=l);var o=_$2.db.transaction([t],"readwrite").objectStore(t);if(l.id){delete l.synchronized;var r=o.get(l.tmpId);r.onsuccess=function(){r.result?o.put(l):s.forEach((e=>{e.tmpId==l.tmpId&&o.put(l)})),e.$emit("stored",l,s,o),e.$ionic&&e.app.toast("El registro fue grabado exitosamente!"),e.close({success:!0,data:l})},r.onerror=function(){e.MsgBox("Error getting temporal record "+l.tmpId)}}else{l.tmpId=1*new Date,l.id=-l.tmpId;var n=o.add(l);n.onsuccess=t=>{s.unshift(l),e.$emit("stored",l,s,o),e.app&&e.app.toast&&e.app.toast("El registro fue grabado exitosamente!"),i.tmpId=l.tmpId,i.id=l.id,e.close({success:!0,data:l})},n.onerror=t=>{e.app&&e.app.toast&&e.app.toast("Error!")}}}}else MsgBox$1("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,l){"string"==typeof t&&(t={body:t});var a="string"==typeof l?{fileName:l}:l;a||(a={}),(""+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])),l=document.createElement("a");if(l.href=t,!a.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]&&(a.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",a.fileName),document.body.appendChild(l),l.click()}))},savePost(){},validate(e){const t=this;var l=!0;const a=[];e=e&&0!=e?e:t.$el;var o,r=e?.querySelectorAll("input,select,textarea,div[required=required]"),n={};for(v=0;r?.length>v;v++){var s=r[v];if("radio"!==s.type){if(s.error&&(s.error.style.display="none"),!s.disabled&&!s.getAttribute("disabled")&&(s.required||"DIV"===s.tagName)&&("DIV"!=s.tagName&&!s.value||"DIV"===s.tagName&&!s.attributes.value)){for(o=s.previousElementSibling;o&&1!=o.nodeType;)o=o.previousElementSibling;if(!o)for(o=s.parentElement.previousElementSibling;o&&1!=o.nodeType;)o=o.previousElementSibling;a.push(s)}}else{var i=n[s.name];i||(n[s.name]=i=[]),i.push(s)}}for(var d in console.log("valid radios"),n)if(Object.prototype.hasOwnProperty.call(n,d)){for(var c=n[d],u=!1,p=!1,v=0;v<c.length;v++)c[v].required&&!c[v].disabled&&(p=!0),c[v].checked&&(u=!0);(o=(s=c[0].parentNode.parentNode).previousElementSibling)&&o.classList&&o.classList.contains("v-error")&&o.parentNode.removeChild(o),p&&!u&&(t.showerror(s),l=!1)}console.log("ok="+l);for(const e of a)if(e.error)e.error.style.display="unset";else{const t=document.createElement("div");t.innerHTML="Este campo es requerido!",t.classList.add("v-error"),e.error=t,e.parentNode.insertBefore(t,e.nextSibling)}return!a.length}}};cfg||(cfg={data:{o:{}}});const{setup:setup,...other}=cfg;return cfg={mixins:[defs,other],setup:setup},cfg};exports.IsobitUI=IsobitUI,exports._=_$2,exports.app=app,exports.date=date,exports.db=db,exports.getStoredList=getStoredList,exports.initDB=initDB,exports.pad=pad,exports.resize=resize,exports.ui=ui;
1
+ "use strict";var vue=require("vue"),axios$2=require("axios"),Observable=require("ol/Observable"),_imports_0=require("@/cdn/images/triangle-down.svg"),script$q={name:"InputText"};const _hoisted_1$g={type:"text"};function render$m(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("input",_hoisted_1$g)}script$q.render=render$m,script$q.__file="src/InputText.vue";var script$p={name:"InputTextarea"};function render$l(e,t,l,a,o,r){return" text "}script$p.render=render$l,script$p.__file="src/InputTextarea.vue";const _$2={stores:[],_id:0,axios_get:null,storeFunction:{},id:()=>_$2._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.split("T");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,a=document.createElement("div");a.className="abc",a.style="top:50%;transform:translate(-50%,-50%);position:absolute;width:100%;z-index:2; display: flex;justify-content: center;";let o=a.style;if(o.left="50%",o.textAlign="center",!1!==e)if(e instanceof Element)a=e;else{if(e){let t=document.createElement("div");t.innerHTML=e,a.append(t),a.style="padding:4px;margin-bottom:5px;color:white;font-size:24px;text-align:center"}l=document.createElement("div"),o=l.style,l.className="loading"}let r=document.createElement("div");o=r.style,o.height="100%",o.top="0px",o.position="absolute",o.left="0",o.zIndex=1e4,o.width="100%";let n=document.createElement("div");return o=n.style,o.height="100%",o.width="100%",o.top="0",o.position="absolute",o.left="0",o.backgroundColor="rgba(0,0,0,0.5)",t&&t.opacity&&(o.opacity=t.opacity),t&&t.backgroundColor&&(o.backgroundColor=t.backgroundColor),r.appendChild(n),r.appendChild(a),l&&a.appendChild(l),document.body.appendChild(r),r},unmask=e=>{e&&(e.style.display="none",e.parentNode&&e.parentNode.removeChild(e))},isObject=e=>e&&"object"==typeof e&&!Array.isArray(e),mergeDeep$1=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,a=t.shift();if(isObject(e)&&isObject(a))for(let t in a)isObject(a[t])?(e[t]||(l={},l[t]={},Object.assign(e,l)),mergeDeep$1(e[t],a[t])):(l={},l[t]=a[t],Object.assign(e,l));let o=[];return o.push(e),o.concat(t),mergeDeep$1.apply(null,o)},buildPopupMenu=e=>{let t=e.getAttribute("v--popup");if(!t){e.setAttribute("v--popup",t=_$2.id());let l=_$2.storeFunction[t],a=e.querySelectorAll(".v-datatable-header .v-button");a&&a.length&&!l&&window.innerWidth<=700&&setTimeout((function(){l=document.createElement("ul"),l.className="v-popup-2",e.appendChild(l);let o=null;const r=e=>{l.style.display="none";let t=e.target.getAttribute("commandId"),a=document.querySelector("#"+t);"BUTTON"==a.tagName?a.click():a.children[0].click(),unmask(o)};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(a=e.querySelectorAll(".v-datatable-header .v-button");l.firstChild;)l.removeChild(l.firstChild);for(s=0;s<a.length;s++)if("none"!=a[s].style.display){let e=document.createElement("li");if(a[s].id||(a[s].id="c-"+_$2.id()),e.setAttribute("commandId",a[s].id),"BUTTON"==a[s].tagName){if(a[s].disabled)continue;e.appendChild(a[s].children[0].cloneNode(!0)),e.appendChild(document.createTextNode(a[s].value?a[s].value:a[s].title))}else a[s].children[0].children[1]&&(e.appendChild(a[s].children[0].children[1]),e.appendChild(document.createTextNode(a[s].textContent)));e.onclick=r,l.appendChild(e)}o=mask(l),l.style.display="block",o.onclick=()=>{l.style.display="none",unmask(o)}},e.appendChild(n),_$2.storeFunction[t]=l}),500)}},resize=()=>{let e=window.innerHeight;document.body.children[0].style.height=e+".px";let t=document.querySelectorAll("#page-header,.ui-layout-north,.v-layout-north,.ion-page >ion-header");t=t[0];const l=document.querySelectorAll("#app > .ui-panel > .v-dialog-content > form > .v-datatable");if(l&&l[0])buildPopupMenu(l[0]);else{let e=document.querySelectorAll(".ion-page");if(e[0]){let t=0;for(let l=0;l<e[0].childNodes.length;l++)"ION-HEADER"!=e[0].childNodes[l].nodeName&&"ION-FOOTER"!=e[0].childNodes[l].nodeName||(t+=e[0].childNodes[l].offsetHeight);let l=0;for(kk=0;kk<e[0].childNodes.length;kk++){let a=e[0].childNodes[kk];if("ION-HEADER"==a.nodeName&&(l=1),1==l&&"ION-HEADER"!=a.nodeName&&"ION-FOOTER"!=a.nodeName&&a.style){a.style.height=e[0].offsetHeight-t+"px",a.style.overflowY="auto";break}}}else console.log(12)}},MsgBox$1=(e,t,l)=>{if(l||(l=["OK"]),!document.body)return;let a=document.createElement("div");a.classList.add("v-overlay"),a.style.padding="40px",a.style.zIndex="2000",document.body.appendChild(a);let o=document.createElement("div"),r=document.createElement("div"),n=document.createElement("div"),s=document.createElement("div");s.className="v-msgbox-buttons",o.classList.add("v-dialog"),o.classList.add("v-msgbox"),n.innerHTML=e,o.setAttribute("path",_$2.currentPath);let i=function(){o.style.display="none",a.style.display="none",o.parentNode.removeChild(o),a.parentNode.removeChild(a),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)}r.className="v-dialog-content v-widget-content",r.appendChild(n),r.appendChild(s),o.appendChild(r),a.appendChild(o),a.style.visibility="unset",a.style.opacity="unset",a.style.overflow="auto",o.style.margin="0 auto",o.style.position="unset",resize()},configureAxios=e=>{let t;_$2.axios_get=e.get,e.interceptors.request.use((function(e){return _$2.eeee=e,e.mask?e.mask():t||(t=mask()),e}),(function(e){return t=unmask(t),MsgBox$1("request "+_$2.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,a=e&&e.data&&e.data.msg?e.data.msg:l.message;if(e&&(e.data&&e.data.message&&(a=e.data.message),"string"==typeof e.data&&(a=e.data),a||(a=e.status+": "+e.statusText)),t=unmask(t),e&&401==e.status&&_$2.app)return _$2.app.toast("Session terminada"),void _$2.app.logout();l.config?.error?l.config.error(l,a):(console.log(l),l.request?MsgBox$1("<b>"+l.request.responseURL+"</b><br/><br/>"+a):MsgBox$1(a))}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=>{for(let t in e)""!==e[t]&&null!==e[t]&&"function"!=typeof e[t]&&void 0!==e[t]||delete e[t];return e},sum=e=>(void 0).reduce(((t,l)=>t+((l=e?l[e]:l)?Number(l):0)),0);function createGetters(){return{get networkStatus(){return _$2.app?.networkStatus||{connected:!0}},get db(){return _$2.app?.db},app:()=>(console.log("get.app="+_$2.app),_$2.app),setApp(e){_$2.app=e,console.log("setApp="+_$2.app)}}}const app=()=>_$2.app,db=()=>_$2.db,initDB=(e,t)=>{let l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;if(_$2.IDBTransaction=window.IDBTransaction||window.webkitIDBTransaction||window.msIDBTransaction,_$2.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange||window.msIDBKeyRange,l){if(l)return _$2.stores=t,new Promise(((a,o)=>{let r=l.open("db",e);r.onupgradeneeded=e=>{let l=e.target.result;t.forEach((e=>{l.objectStoreNames.contains(e[0])||l.createObjectStore(e[0],e[1])}))},r.onerror=e=>{o(e)},r.onsuccess=()=>{_$2.db=r.result,a(_$2.db)}}))}else window.alert("Your browser doesn't support a stable version of IndexedDB.");return l},getStoredList=async(e,t)=>{let l;try{l=JSON.parse(sessionStorage.getItem("loadedStores"))}catch(e){}null==l&&(l={});const a=db();if(!l[e]&&networkStatus.connected){let t=_$2.stores.filter((t=>t[0]==e))[0];if(!t)throw"store '"+e+"' undefined";if(!t[2])throw"store url for '"+e+"' is empty";let o=t[2]?await _$2.axios_get(t[2]):[];const r=a.transaction([t[0]],"readwrite").objectStore(t[0]);await r.clear(),o=o.data||o;for(let e in o)try{await r.add(o[e])}catch(e){throw e}l[e]=1,sessionStorage.setItem("loadedStores",JSON.stringify(l))}let o=new Promise(((t,l)=>{if(a){let l=a.transaction(e).objectStore(e).getAll();l.onsuccess=function(){t(l.result)}}else l("db is null")}));return await o},getters=createGetters(),{networkStatus:networkStatus,setApp:setApp}=getters;class HTML2Canvas{props;ctx;lineHeight;constructor(e){this.props=e,this.ctx=e.ctx,this.lineHeight=e.lineHeight?e.lineHeight:20}heightText(e,t){const{ctx:l,lineHeight:a}=this;let o="",r=a;return e.split("").forEach((e=>{o+=e,l.measureText(o).width>=t-15&&(o="",r+=a)})),r+=7,r}drawText(e,t,l,a,o,r){const{ctx:n,lineHeight:s}=this;let i="",d=s+l;return n.fillStyle="#000000",e.split("").forEach((e=>{i+=e,n.measureText(i).width>=a-15&&(n.fillText(i,t,d),i="",d+=s)})),n.fillText(i,t+("right"==r?a-n.measureText(i).width:0),d),n.beginPath(),d+=7,d}}var script$o={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:a}=t,o=vue.ref(0),r=vue.ref(null),n=vue.ref(-1),s=vue.ref(""),i=vue.ref(null),d=vue.ref(!1),c=vue.ref(0),u=vue.ref("");vue.watch((()=>e.value),(e=>{r.value=e})),vue.watch((()=>e.data),(e=>{i.value=e})),vue.onMounted((()=>{u.value=e.inputClass,e.autoload&&v(),document.addEventListener("click",m)})),vue.onBeforeUnmount((()=>{document.removeEventListener("click",m)}));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:a,source:r}=e;let n=Number(e.pagination);if(1===t)o.value+=n;else if(o.value=0,e.data&&e.autoload)return;let u={query:s.value};e.params&&(u=mergeDeep$1(u,e.params)),axios$2.get((a||e.source)+(n>0?"/"+o.value+"/"+n:""),{params:u}).then((l=>{const a=l.data;console.log(a),a.error?MsgBox(a.error):(i.value=1===t?i.value.concat(a.data?a.data:a):a.data?a.data:a,console.log(i),c.value=a.size,e.autoload||(d.value=!0),console.log("========================="))})).catch(h).then((()=>{l("complete",{data:i.value,query:s.value,target:"me"})}))},h=e=>{console.log(e)},m=e=>{};return{query:s,show:d,selected:r,data2:p,focused:n,inputClass:u,search:v,remove:()=>{l("input",null)},clickout:m,focusout:e=>{},setSelected:e=>{r.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")=>!!a[e]}}};const _withScopeId=e=>(vue.pushScopeId("data-v-72884078"),e=e(),vue.popScopeId(),e),_hoisted_1$f=["value","disabled"],_hoisted_2$a=_withScopeId((()=>vue.createElementVNode("i",{class:"fa fa-times"},null,-1))),_hoisted_3$7=[_hoisted_2$a],_hoisted_4$5=_withScopeId((()=>vue.createElementVNode("i",{class:"fa fa-xs fa-sync"},null,-1))),_hoisted_5$2=[_hoisted_4$5],_hoisted_6$1=["disabled","placeholder"],_hoisted_7$1={class:"v-list"},_hoisted_8=["onClick"],_hoisted_9={key:0,class:"center yellow",style:{padding:"5px"}};function render$k(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",{class:"v-autocomplete",onFocusout:t[7]||(t[7]=(...e)=>a.focusout&&a.focusout(...e)),value:l.value,disabled:l.disabled},[a.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:a.selected}),vue.createTextVNode(" "+vue.toDisplayString(a.hasSlot("label")?" ":a.getLabel(a.selected))+"  ",1),l.readonly?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:0,onClick:t[0]||(t[0]=(...e)=>a.remove&&a.remove(...e)),class:"remove-icon"},[..._hoisted_3$7]))],4)):vue.createCommentVNode("v-if",!0),a.selected?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:1,onClick:t[1]||(t[1]=(...e)=>a.search&&a.search(...e)),class:"search-icon"},[..._hoisted_5$2])),a.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)=>a.search&&a.search(...e)),["stop","prevent"]),["enter"]))],class:vue.normalizeClass(a.inputClass),onFocus:t[4]||(t[4]=e=>a.show=!0),disabled:l.disabled,placeholder:l.placeholder,"onUpdate:modelValue":t[5]||(t[5]=e=>a.query=e)},null,42,_hoisted_6$1)),[[vue.vModelText,a.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_7$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(a.data2,((t,l)=>(vue.openBlock(),vue.createElementBlock("div",{key:l,class:vue.normalizeClass({"v-selected":a.selected==t,"v-focused":a.focused==l}),onClick:e=>a.setSelected(t)},[vue.renderSlot(e.$slots,"default",{row:t})],10,_hoisted_8)))),128)),e.data0&&e.data0.length<e.total?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"center",onClick:t[6]||(t[6]=e=>a.search(1))},"Load more "+vue.toDisplayString(e.total-e.data0.length)+" results...",1)):vue.createCommentVNode("v-if",!0)]),a.data2&&a.data2.length<1?(vue.openBlock(),vue.createElementBlock("div",_hoisted_9,"No results found.")):vue.createCommentVNode("v-if",!0)],4),[[vue.vShow,a.show&&!a.selected]])])),_:3})],40,_hoisted_1$f)}script$o.render=render$k,script$o.__scopeId="data-v-72884078",script$o.__file="src/v-autocomplete.vue";var script$n={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$e={type:"button",class:"_ ui-widget ui-state-default ui-corner-all v-button"};function render$j(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("button",_hoisted_1$e)}script$n.render=render$j,script$n.__file="src/v-button.vue";var script$m={name:"VCalendar",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,l=t.toDate(e);return console.log(l),t.max&&l&&l.getTime()>=t.toDate(t.max).getTime()||t.min&&l&&l.getTime()<=t.toDate(t.min).getTime()?(t.$emit("invalid",{target:t,value:l}),l=null,void(event.target.value=l)):void("time"===t.$props.type?this.$emit("input",t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2)+":00"):l.getTime&&this.$emit("input",l.getTime()))},pad(e,t){for(var l=e+"";l.length<t;)l="0"+l;return l},toDate(e){if(e){var t,l;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=(l=e.split("T"))[1].split(":"),l=l[0].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=e.split("-");var a=parseInt(l[0]);return a<100?e:l=new Date(a,parseInt(l[1])-1,parseInt(l[2]))}return e},changeDate(){var e,t=this,l=t.toDate(t.value);l&&(e="time"===t.$props.type?t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2):"datetime-local"===t.$props.type?t.pad(l.getFullYear(),4)+"-"+t.pad(l.getMonth()+1,2)+"-"+t.pad(l.getDate(),2)+"T"+t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2):t.pad(l.getFullYear(),4)+"-"+t.pad(l.getMonth()+1,2)+"-"+t.pad(l.getDate(),2)),this.$el.children[0].value=e}},updated(){this.changeDate()},mounted(){this.changeDate()}};const _hoisted_1$d=["value"],_hoisted_2$9=["required","readonly","min","max","type"];function render$i(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",{value:r.toDate(l.value)},[vue.createElementVNode("input",{required:l.required,readonly:l.readonly,min:l.min,max:l.max,onChange:t[0]||(t[0]=(...e)=>r.enterD&&r.enterD(...e)),type:l.type?l.type:"date"},null,40,_hoisted_2$9)],8,_hoisted_1$d)}script$m.render=render$i,script$m.__file="src/v-calendar.vue";var script$l={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 a=0;t&&a<t.length;a++)e[l].value==t[a]&&(e[l].checked=!0)}},onChange:function(e,t){var l=this,a=l.$attrs.value;if(("string"==typeof a||a instanceof String)&&(a=a.split("|")),t)a||(l.$attrs.value=a=[]),a.push(e);else{var o=a.indexOf(e);o>-1&&a.splice(o,1)}l.$emit("input",a)}}};function render$h(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",null,[vue.renderSlot(e.$slots,"default")])}script$l.render=render$h,script$l.__file="src/v-checkbox-group.vue";var script$k={name:"VCheckbox",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 l=t.checked?e.value?e.value:t.checked:null!==e.valueFalse&&void 0!==e.valueFalse?e.valueFalse:t.checked;l&&(e.hadValue=1),console.log("nv="+l),e.$emit("input",l)}},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$c={style:{"font-weight":"normal !important",display:"block"},class:"v-checkbox"},_hoisted_2$8=["innerHTML"],_hoisted_3$6=["checked","value"],_hoisted_4$4=vue.createElementVNode("span",{class:"checkmark"},null,-1);function render$g(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("label",_hoisted_1$c,[vue.createElementVNode("span",{innerHTML:r.getLabel()},null,8,_hoisted_2$8),vue.createElementVNode("input",{type:"checkbox",checked:l.value&&l.vmodel==l.value||l.vmodel,onChange:t[0]||(t[0]=(...e)=>r.change&&r.change(...e)),value:l.value},null,40,_hoisted_3$6),_hoisted_4$4])}script$k.render=render$g,script$k.__file="src/v-checkbox.vue";var script$j={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,a=t%l.columns+1,o=["c-w-"+l.columns];return a==l.columns&&o.push("v-last"),l.rowStyleClassFunc?o.push(l.rowStyleClassFunc(e,e,t)):o.push(l.rowStyleClass),o},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 a=t.value?t.value:l.data.data?l.data.data:l.data;t.data||(t.data=[]),t.data=!0===e?a:t.data?t.data.concat(a):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$b={class:"v-dataview"};function render$f(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$b,[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(r.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=>r.load(e.page++)),class:"center v-more-results"},"Ver mas resultados")):vue.createCommentVNode("v-if",!0)])}script$j.render=render$f,script$j.__file="src/v-dataview.vue";var script$i={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$a={class:"v-fieldset"},_hoisted_2$7=["data-icon"],_hoisted_3$5=["innerHTML"],_hoisted_4$3={style:{flex:"1",display:"flex","flex-direction":"column"}};function render$e(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("fieldset",_hoisted_1$a,[l.legend?(vue.openBlock(),vue.createElementBlock("legend",{key:0,onClick:t[0]||(t[0]=e=>o.closed=l.closable&&!o.closed),style:vue.normalizeStyle({cursor:l.closable?"pointer":""})},[l.closable?(vue.openBlock(),vue.createElementBlock("span",{key:0,"data-icon":o.closed?"plus":"minus",style:{margin:"0px 5px 0px 0px"}},[vue.createElementVNode("i",{class:vue.normalizeClass([o.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$5)],4)):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createElementVNode("div",_hoisted_4$3,[vue.renderSlot(e.$slots,"default")],512),[[vue.vShow,!o.closed]])])}script$i.render=render$e,script$i.__file="src/v-fieldset.vue";var script$h={name:"VForm",props:["header","store","action"],setup(e,t){const{slots:l,expose:a}=t;return a({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},l.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,a=e.height;l.style.height=a+"px",t.timer&&clearTimeout(t.timer),t.timer=setTimeout((()=>{if(l.parentElement){var e;if(l.children[1])a-=l.children[0].offsetHeight,l.children[1].style.height=a+"px",l.children[1].style.overflowY="auto",(l=l.children[1].children[0]).style.height=a+"px",l.children&&(l.parentNode.style.overflowY="hidden",l.parentNode.style.overflow="hidden"),[].forEach.call(l.children,((o,r)=>{r==l.children.length-1&&"CENTER"==o.tagName||!o.classList.contains("v-scrollable")&&!o.classList.contains("v-form")&&!o.classList.contains("v-resize")?a-=t.getAbsoluteHeight(o):e||(e=o)})),l=e;else(l=l.children[0]).style.height=a+"px";if(l){l.style.overflowY="auto",l.style.height=a+"px";var o=new Event("parentResize",{bubbles:!0});o.height=a,l.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 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 a=()=>{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=a,t[l].onblur=a,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 o=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 a=document.createElement("div");a.innerHTML="Este campo es requerido!",a.classList.add("v-error"),t.parentNode.insertBefore(a,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="__"}))},__file:"src/v-form.vue"},script$g={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$9={class:"v-group"};function render$d(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.renderSlot(e.$slots,"default")])}script$g.render=render$d,script$g.__file="src/v-group.vue";var script$f={name:"VLayerControl",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 l=this,a=l.map;if(console.log("me.map="+l.map),e!=l.lastScope)if(e<100&&(e*=1e4),l.scope=e,0==l.scope)a.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],a.getSize()),l.lastScope=e,a.getLayerById("districts").getSource().clear(),l.$emit("scope",{feature:{getId:()=>null},target:l});else if(a){if(e>9999){for(var o=a.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 s=a.getLayerById("provinces");for(e=1*(e.value?e.value:e),r=s.getSource().getFeatures(),n=0;n<r.length;n++)if(1*r[n].id_==e){s.onChange({feature:r[n]});break}}}else l.lastScope=e;else a.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],a.getSize())}},created(){var e=this;return e.$parent.$on("build",(t=>{var l=document.createElement("i"),a=t.map;e.selection=new ol.Collection;var o=e.selection;l.setAttribute("class","fa fa-expand"),a.addControl(new ol.control.FullScreen({label:l,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"}),s=r.on("change",(()=>{var t=e.scope;t>9999&&(t=Math.floor(t/100));for(var l=r.getFeatures(),a=0;a<l.length;a++)if(1*l[a].id_==1*t){n.onChange({feature:l[a]});break}Observable.unByKey(s)})),i=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){i.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=i.getSource().on("change",(()=>{if(e.scope>0)for(var l=i.getSource().getFeatures(),a=e.scope,o=0;o<l.length;o++)if(1*l[o].id_==a){e.scope=0,i.onChange({feature:l[o]});break}Observable.unByKey(t)}))}e.$emit("scope",{feature:e.feature2,target:e}),e.feature2=null}};a.on("moveend",d),n.onChange=t=>{var l=t.feature;e.lastScope!=l.getId()&&(o.clear(),o.push(l),t.preventDefault&&t.preventDefault(),e.lastScope=l.getId(),e.feature2=l,e.unmove?d():a.getView().fit(l.getGeometry().getExtent(),{duration:300}))},n.onSelect=t=>{e.$emit("select",t)},a.addLayer(n),a.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)"})}),i.onChange=t=>{var l=t.feature;e.lastScope!=l.getId()&&(2==o.getLength()&&o.pop(),o.push(l),t.preventDefault&&t.preventDefault(),e.lastScope=l.getId(),e.feature2=l,e.unmove?d():a.getView().fit(l.getGeometry().getExtent(),{duration:300}))},i.onSelect=t=>{e.$emit("select",t)},a.addLayer(i),e.map=a,e.$emit("render",e)})),null}};function render$c(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",null,[vue.renderSlot(e.$slots,"default")])}script$f.render=render$c,script$f.__file="src/v-layer-control.vue";var script$e={name:"VMapControl",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(){let e=this,t=window.ol;e.slotUsed=!!this.$slots.default,e.$parent.map?(e.$parent.map.addControl(new t.control.Control({element:e.$el})),e.ready=!0):e.$parent.$on("build",(l=>{l.map.addControl(new t.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$8={class:"ol-unselectable ol-control"};function render$b(e,t,l,a,o,r){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8,[vue.renderSlot(e.$slots,"default"),o.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)=>r.enter&&r.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&&o.visible0]])}script$e.render=render$b,script$e.__file="src/v-map-control.vue";var script$d={name:"VMap",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 l=new RegExp("[?&]"+e+"=([^&#]*)").exec(t);return l&&l[1]||0},addFeature(e,t){let l=window.ol;e=e||{};var a,o=this,r=o.map;if(e.lon&&e.lat){var n=[e.lon,e.lat];a=new l.geom.Point(n[0]>-100?l.proj.fromLonLat(n):n)}else a=new l.geom.Point(r.getView().getCenter());n=(n=a.flatCoordinates)[0]<-1e4?l.proj.toLonLat(n):n;o.$emit("translateend",{lon:n[0],lat:n[1]}),e.geometry=a;var s=new l.Feature(e);if(s.data=e,e.draggable){var i=new l.Collection;i.push(s);var d=new l.interaction.Translate({features:i});d.on("translateend",(e=>{var t=l.proj.toLonLat(e.coordinate);o.$emit("translateend",{lon:t[0],lat:t[1]})})),d.on("translatestart",(e=>{o.selectedFeature=e.features.getArray()[0]})),s.interactionCollection=i,o.map.addInteraction(d)}if("object"==typeof e.style?s.setStyle(e.style):s.setStyle(o.styleMap[e.style?e.style:"default"]),n=(n=a.flatCoordinates)[0]<-1e4?l.proj.toLonLat(n):n,o.$emit("translateend",{lon:n[0],lat:n[1]}),null!=e.layer){var c=r.getLayerById(e.layer);c?c.getSource().addFeatures(s):r.addLayer(new l.layer.Vector({id:e.layer,source:new l.source.Vector({features:new l.Collection([s])})}))}else o.collection.push(s);return t&&(console.log(s.getGeometry().getCoordinates()),o.map.getView().animate(Object.assign({center:s.getGeometry().getCoordinates(),zoom:17,duration:500},t))),s},animate(e){this.map.getView().animate(e),this.movingCompleted=e.complete},build(){var e=this,t=window.ol;e.styleMap={default:new t.style.Style({image:new t.style.Circle({radius:8,stroke:new t.style.Stroke({color:"#8a0000",width:2}),fill:new t.style.Fill({color:"#ff0000"})})}),star:[new t.style.Style({image:new t.style.RegularShape({fill:new t.style.Fill({color:"#ff0000"}),stroke:new t.style.Stroke({color:"#8a0000",width:2}),points:5,radius:10,radius2:4,angle:0})})]};var l=e.urlParam("location"),a=-1;if(l){var o=l.split("/");l=[parseFloat(o[0]),parseFloat(o[1])],a=o[2],e.moved=!0}else l=!1;console.log("w="+e.$el.clientHeight+";h="+e.$el.clientWidth);var r=new t.Map({target:e.$el,layers:[new t.layer.Tile({source:new t.source.OSM({})})],view:new t.View({})});new ResizeObserver((t=>{console.log("w="+e.$el.clientHeight+";h="+e.$el.clientWidth),r.updateSize()})).observe(e.$el),r.getLayerById=function(e){var t;return r.getLayers().forEach((l=>{l.get("id")!==e||(t=l)})),t},r.styleMap=e.styleMap,r.addLayer(new t.layer.Vector({source:new t.source.Vector({features:e.collection=new t.Collection})})),e.moved?(r.getView().setCenter(l),r.getView().setZoom(a||12),e.map=r,console.log("distarar evento buid pageLocation="+l),e.$emit("build",e)):(console.log("En caso no exista una coordenada se usara se fijara a los limites de la region"),_.getCurrentPosition().then((l=>{r.getView().setCenter(t.proj.fromLonLat([l.coords.longitude,l.coords.latitude])),r.getView().setZoom(12),e.map=r,e.$emit("build",e)}),(t=>{r.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],r.getSize()),e.map=r,e.$emit("build",e)})));var n=r.getView().getZoom();r.on("moveend",(t=>{this.movingCompleted&&(this.movingCompleted(e),this.movingCompleted=null);var l=r.getView().getZoom();n!=l&&(n=l,e.$children.forEach((function(e){e.$vnode.tag.endsWith("v-overlay")&&e.$emit("zoom",l)})))})),r.on("singleclick",(e=>{var t=r.forEachFeatureAtPixel(e.pixel,((e,t)=>{if(t)return[e,t]}));if(t){var l=t[1];t=t[0];if(e.feature=t,e.map=r,e.preventDefault(),l.onSelect)return void l.onSelect(e)}})),r.on("dblclick",(t=>{var l=r.forEachFeatureAtPixel(t.pixel,((e,t)=>{if(t)return[e,t]}));if(l){var a=l[1];l=l[0];if(t.feature=l,t.map=r,a.onChange)return console.log("dbclick manda event onchangue"),void a.onChange(t);e.$emit("change",l),r.getView().animate({center:l.getGeometry().getCoordinates(),zoom:17,duration:500},(()=>{for(var l=0;l<e.$children.length;l++){var a=e.$children[0];a.open&&a.open(t)}}))}})),r.getViewport().parentNode.addEventListener("parentResize",(t=>{setTimeout((()=>{r.updateSize(),e.$emit("resize",r)}),100)})),Vue.resize()}}};function render$a(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",null,[vue.renderSlot(e.$slots,"default")])}script$d.render=render$a,script$d.__file="src/v-map.vue";var script$c={name:"VNumber",props:{value:Number,max:Number,min:Number,delay:Number},setup(e,t){const{emit:l}=t,a=vue.ref(null);vue.onMounted((()=>{a.value=e.value})),vue.onUpdated((()=>{a.value=t.attrs.modelValue}));return{v:a,handleInput:t=>{let o=a.value;const r=t.target.getAttribute("decimal");null!==o?(o=num(o),e.max&&o>num(e.max)&&(o=num(e.max)),e.min&&o<num(e.min)&&(o=num(e.min)),null!==r&&(o=o.toFixed(Number(r)))):o=null,a.value=t.target.value;let n=_$2.calendarTimer;n&&clearTimeout(n),e.delay?_$2.calendarTimer=setTimeout((()=>{l("input",o),_$2.calendarTimer=null}),13===t.keyCode?0:e.delay):l("input",o)}}}};function render$9(e,t,l,a,o,r){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"number",onKeyup:t[0]||(t[0]=vue.withKeys(((...e)=>a.handleInput&&a.handleInput(...e)),["enter"])),"onUpdate:modelValue":t[1]||(t[1]=e=>a.v=e),onInput:t[2]||(t[2]=(...e)=>a.handleInput&&a.handleInput(...e)),class:"_"},null,544)),[[vue.vModelText,a.v,void 0,{number:!0}]])}script$c.render=render$9,script$c.__file="src/v-number.vue";var script$b={setup(e,t){const l=e,{displayField:a,store:o,filter:r}=l,{expose:n,emit:s}=t,i=vue.ref([]),d=vue.ref([]),c=vue.ref([]);vue.ref(null),vue.ref(null);const u=vue.inject("collect"),p=vue.computed((()=>d.value&&r?d.value.filter((e=>-1!==JSON.stringify(e).toLowerCase().indexOf(r.toLowerCase()))):d.value)),v=(e,t)=>{const l=c.value;if(l&&l.length)for(var a=0;a<l.length;a++)e&&(e=e[l[a]]);else e&&!t&&(e=e.id?e.id:e.code?e.code:e);return e},h=async(e=null,t=null,a=!1)=>{if(!a&&t&&e&&i.value.push([e,t]),!(i.value.length>1)){if(d.value=[],d.value||(d.value=[]),l.store){let t=await getStoredList(l.store);const[a]=e?Object.keys(e):[];if(a){let l;try{d.value=t.filter((t=>(l=t,l[a].startsWith(e[a]))))}catch(e){console.log("Error trying to filter ",l),console.error(e)}}else d.value=d.value.concat(t)}for(u(p),a||i.value.shift();i.value.length;){const e=i.value.shift()||[];await h(e[0],e[1],!0)}}};return h.getObjectByIndex=e=>{const t=p.value;return t?t[e]:null},h.getValueByIndex=e=>{const t=p.value;return t?v(t[e],1):null},h.getIndexByValue=(e,t)=>{e&&e.id?e=e.id:e&&e.code&&(e=e.code);for(var l=0;l<p.value.length;l++)if(v(p.value[l])==e)return t&&t(l),l;return t&&t(-1),-1},u.push(h),vue.onUpdated((()=>{u.updateSelect()})),vue.onMounted((()=>{l.valueField&&(c.value=l.valueField.split(".")),u.updateSelect()})),vue.onUnmounted((()=>{u.remove(h)})),n({load:h}),()=>p.value.map((e=>vue.h("option",{value:v(e)},e[a])))},name:"VOptions",props:{url:String,src:String,displayField:String,data:Array,store:null,valueField:String,filters:null,filter:null,mode:null},watch:{data(){this.$parent.updateSelect()}},created(){var e=this;e.data&&(e.data2=e.data)},updated(){let e=this;!e.loaded&&e.data&&(e.data2=e.data)},methods:{getParentE(){return this.$el.parentElement.parentElement},getSelectedItem(){var e=this.$el.parentElement;return this.filterList[e.selectedIndex-1]},async load2(e,t,l){}},__file:"src/v-options.vue"},ol$1=window.ol,_$1=window._,axios$1=window.axios,script$a={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$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 l=e.$el.parentElement;var a=window.getComputedStyle(l),o=parseFloat(a.left),r=parseFloat(a.top),n=t.clientX,s=t.clientY,i=l.parentElement;function d(e){l.style.left=o+e.clientX-n+"px",l.style.top=r+e.clientY-s+"px"}i.addEventListener("mousemove",d,!1),i.addEventListener("mouseup",(function(){i.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(_$1.remoteServer+e.src).then((t=>{e.$emit("input",t.data)}))},open(e){for(var t=this,l=e.map,a=e.feature,o=t.overlay,r=o.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),o.setPosition(e.coordinate);var i=l.getView().getCenter(),d=l.getView().getResolution(),c=a?a.getGeometry().getCoordinates():[null],u=l.getPixelFromCoordinate(Number(c[0])?c:e.coordinate);if(this.src)axios$1.get(_$1.remoteServer+this.src).then((e=>{t.$emit("input",e.data),t.c++,setTimeout((function(){var e=l.viewport_.offsetWidth,a=l.viewport_.offsetHeight,n=r.children[0].children[1];n.scrollTop=0;var s=r.offsetHeight;n.style.height=s+100>=a?a-100-r.children[0].children[0].offsetHeight+"px":"300px",s=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,l.getView().animate({center:[i[0]+(u[0]+p+20>=e?+(u[0]+p+20-e):u[0]-20-p<0?-p+u[0]-20:0)*d,i[1]+(u[1]<s?s-u[1]:0)*d],duration:500}),u[0]=u[0]+p-0,u[1]=u[1]-12,o.setPosition(l.getCoordinateFromPixel(u)),t.$el.style.opacity=1,_$1.mobil)for(var v=o.getElement().querySelectorAll("a:not(._)"),h=0;h<v.length;h++)v[h].addEventListener("click",_$1.open2)}),400)})).catch((e=>{console.log(e)}));else{var p=l.viewport_.offsetWidth,v=l.viewport_.offsetHeight,h=r.children[0].children[1];h.scrollTop=0;var m=r.offsetHeight;console.log(r.offsetHeight),h.style.height=m+100>=v?v-100-r.children[0].children[0].offsetHeight+"px":"300px",m=r.offsetHeight;var g=1*t.width,f=p<=g+40?p-40:g;if(r.style.zIndex=10,r.style.width=f+"px",f/=2,l.getView().animate({center:[i[0]+(u[0]+f+20>=p?+(u[0]+f+20-p):u[0]-20-f<0?-f+u[0]-20:0)*d,i[1]+(u[1]<m?m-u[1]:0)*d],duration:500}),u[0]=u[0]+f-0,u[1]=u[1]-12,o.setPosition(l.getCoordinateFromPixel(u)),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,_$1.mobil){var y=o.getElement().querySelectorAll("a:not(._)");for(s=0;s<y.length;s++)y[s].addEventListener("click",_$1.open2)}t.$emit("opened",{target:t})}}}};const _hoisted_1$7={class:"v-ol-overlay"},_hoisted_2$6={key:0,class:"v-panel-titlebar"},_hoisted_3$4=vue.createElementVNode("i",{class:"fa fa-times"},null,-1),_hoisted_4$2=[_hoisted_3$4],_hoisted_5$1={key:2,style:{"text-align":"center"}},_hoisted_6=vue.createElementVNode("img",{src:_imports_0,width:"20",height:"18"},null,-1),_hoisted_7=[_hoisted_6];function render$8(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[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)=>r.close&&r.close(...e))},[..._hoisted_4$2]),vue.createTextVNode(vue.toDisplayString(l.header),1)])):vue.createCommentVNode("v-if",!0),(vue.openBlock(),vue.createElementBlock("div",{class:"v-ol-body",key:"c-"+o.c,style:{padding:"10px"}},[l.value?vue.renderSlot(e.$slots,"default",{key:0,value:l.value}):vue.createCommentVNode("v-if",!0)])),r.hasSlot("footer")&&l.value?(vue.openBlock(),vue.createElementBlock("footer",{key:"f-"+o.c},[vue.renderSlot(e.$slots,"footer",{value:l.value})])):vue.createCommentVNode("v-if",!0),o.coordinate?(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,[..._hoisted_7])):vue.createCommentVNode("v-if",!0)])}script$a.render=render$8,script$a.__file="src/v-overlay.vue";var script$9={name:"VPanel",props:{header:String}};const _hoisted_1$6={class:"ui-panel"},_hoisted_2$5={key:0,class:"v-panel-titlebar v-widget-header ui-helper-clearfix ui-corner-all"},_hoisted_3$3={class:"v-panel-title"},_hoisted_4$1={class:"v-panel-content v-dialog-content v-widget-content"};function render$7(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[l.header?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$5,[vue.createElementVNode("span",_hoisted_3$3,vue.toDisplayString(l.header),1)])):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",_hoisted_4$1,[vue.renderSlot(e.$slots,"default")])])}script$9.render=render$7,script$9.__file="src/v-panel.vue";var script$8={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$5={class:"v-popup",style:{position:"absolute"}};function render$6(e,t,l,a,o,r){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[vue.renderSlot(e.$slots,"default")],512)),[[vue.vShow,o.show]])}script$8.render=render$6,script$8.__file="src/v-popup.vue";var script$7={name:"VRadio",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(){}}};const _hoisted_1$4={class:"v-radio",style:{"font-weight":"normal !important",display:"block"}},_hoisted_2$4=["value"],_hoisted_3$2=vue.createElementVNode("span",{class:"checkmark"},null,-1);function render$5(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("label",_hoisted_1$4,[vue.createTextVNode(vue.toDisplayString(l.label?l.label:l.value)+" ",1),vue.createElementVNode("input",{type:"radio",value:l.value},null,8,_hoisted_2$4),_hoisted_3$2,vue.renderSlot(e.$slots,"default")])}script$7.render=render$5,script$7.__file="src/v-radio.vue";var script$6={__name:"v-radio-group",props:{required:String,name:String,modelValue:String,items:{type:Array,required:!0},type:{type:String,default:"radio"},label:{type:String,default:""}},emits:["update:modelValue"],setup(e,{emit:t}){const l=e,a=t,o=vue.ref(l.modelValue),{proxy:r}=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(r.$el,[]);let t=l.name;t||(t="input_"+Date.now().toString(36)+Math.random().toString(36).substring(2,15));for(let l=0;l<e.length;l++)e[l].name=t,n.has(e[l])||(e[l].addEventListener("change",d),n.add(e[l])),e[l].checked=e[l].value===o.value},d=e=>{let t=e.target.value;""===t&&(t=null),o.value=t,a("update:modelValue",t)};vue.watch((()=>l.modelValue),(e=>{o.value=e,i()})),vue.onMounted((()=>{i()})),vue.onUpdated((()=>{i()}));const c=()=>{const e=[];return r.$slots.default&&e.push(...r.$slots.default()),l.items&&e.push(...l.items.map((e=>vue.h(script$7,{...e,modelValue:o.value,"onUpdate:modelValue":d})))),vue.h("div",[l.label&&vue.h("label",l.label),...e])};return(e,t)=>(vue.openBlock(),vue.createBlock(c))},__file:"src/v-radio-group.vue"},script$5={name:"VSelect",setup(e,t){const{slots:l,emit:a}=t,{displayField:o,valueField:r,disabled:n,readonly:s,autoload:i}=e,d=vue.ref([]),c=vue.ref([]),u=vue.ref([]),p=[],v=vue.ref(!(i+""=="false"||1*i==0)),h=vue.ref(null),m=e=>{const t=e.value;d.value=o?t.sort(((e,t)=>{const l=e[o];return l>t[o]?1:l<t[o]?-1:0})):t},g=()=>{let e=t.attrs.modelValue;if(null!=e&&e.target&&(e=e.value),h.value){let t=h.value,l=t.selectedIndex;e&&""!==e||(t.selectedIndex=0);for(let l=0;l<t.length;l++)t[l].value==e&&(t.selectedIndex=l);const o=p;for(let r=0;r<o.length;r++){if(!o[r].getValueByIndex)continue;let n=o[r].getValueByIndex(l-1);o[r].getIndexByValue(e,((l,s)=>{if(l>-1){t.selectedIndex=l+1;let s=o[r].getValueByIndex(t.selectedIndex-1);-1==s?s=null:o[r].getObjectByIndex&&(s=o[r].getObjectByIndex(t.selectedIndex-1));let i=Number(n);i=isNaN(i)?n?!!e&&(e.id?e.id==n.id:e==n):!e:i==Number(e),i||a("input",e,{value:e,select:t,object:s})}}))}}};m.remove=e=>{const t=p.filter((t=>t!==e));p.length=0,t.forEach((e=>p.push(e)))},m.push=e=>{p.push(e)},m.updateSelect=()=>{g()},r&&(c.value=r.split(".")),vue.provide("collect",m);const f=(t,l)=>{e.disabled?u.value=[t,l]:(u.value=[],p.forEach((e=>{e(t,l)})))};return vue.onMounted((()=>{f()})),vue.onUpdated((()=>{g()})),{options:d,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;t&&""!==t||(t=null,l.selectedIndex=0);let o,r=0;const n=d.value;for(let e=0;e<p.length;e++){if(r=p[e].getValueByIndex(l.selectedIndex-1),-1!=r){o=p[e].getObjectByIndex(l.selectedIndex-1);break}r=0}r?t=r:n.length&&(l.selectedIndex=0),a("update:modelValue",t,{value:t,select:l,object:o}),a("input",t,{value:t,select:l,object:o})},onInput:e=>{e.target.value,e.stopPropagation()},select:h,load:f,lastLoad:u,autoload_:v}},props:{required:null,readonly:null,multiple:null,label:null,disabled:null,autoload:null,displayField:null,valueField:null},data:()=>({autoload_:!0,ik:0,data:[],popup:null,show:!1,sel:[],sela:null,tmp:[],sel2:[]}),mounted(){},watch:{disabled(e,t){this.activate(e,t)},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 a=e.getBoundingClientRect();const o=l.children[0];window.innerWidth<400?(l.style.padding="40px",l.style.height="100%",o.style.height="100%"):(l.style.top=a.bottom+0+"px",l.style.left=a.left+0+"px",l.style.maxHeight=window.innerHeight-a.bottom-30+"px",o.style.maxHeight=l.style.maxHeight),o.style.display="flex",o.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()}}},methods:{activate(e,t){e=!!e,t=!!t;let l=this.lastLoad,a=this;!e&&!e===t&&l.length&&(this.$el.disabled=!1,a.load(l[0],l[1]))},expand(){console.log("click")},internalLoad(){let e=this;e.autoload_=!(e.autoload+""=="false"||1*e.autoload==0);let t=e.$attrs.value;null!=t&&t.target&&(t=t.value);let l=e.$el.childNodes[0];t&&""!==t||(l.selectedIndex=0),t=e.$attrs.value;for(let e=0;e<l.length;e++)l[e].value==t&&(l.selectedIndex=e);e.autoload_&&e.load(),e.$emit("mounted",e)},toggle(){this.show=!this.show},close(){this.show=!1},selectAll(){let e=[];for(let t=0;t<this.data.length;t++)e.push(this.data[t].value);this.sel=e,this.ik++},checkboxInput(){let e=this.sel;e&&e.length&&(e=e.join(","))}}};const _hoisted_1$3={class:"v-select",style:{position:"relative"}},_hoisted_2$3=["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$4(e,t,l,a,o,r){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$3,[l.readonly?vue.createCommentVNode("v-if",!0):vue.withDirectives((vue.openBlock(),vue.createElementBlock("select",{key:0,style:{width:"100%"},ref:"select",onChange:t[0]||(t[0]=(...e)=>a.onChange&&a.onChange(...e)),onInput:t[1]||(t[1]=(...e)=>a.onInput&&a.onInput(...e)),required:l.required,disabled:l.disabled,click:r.expand},[vue.renderSlot(e.$slots,"default")],40,_hoisted_2$3)),[[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":o.show}]),ref:"button",style:{"padding-top":"3px","padding-bottom":"3px"},onClick:t[2]||(t[2]=(...e)=>r.toggle&&r.toggle(...e))},"   ",2),vue.withDirectives(vue.createElementVNode("div",{ref:"popup",onClick:t[5]||(t[5]=(...e)=>r.close&&r.close(...e)),style:{"background-color":"#0000009c"}},[vue.createElementVNode("div",_hoisted_3$1,[vue.createElementVNode("div",_hoisted_4,[vue.createVNode(n,{modelValue:o.sela,"onUpdate:modelValue":t[3]||(t[3]=e=>o.sela=e),onInput:r.selectAll},null,8,["modelValue","onInput"])]),(vue.openBlock(),vue.createBlock(s,{class:"v-select-checkbox-group",style:{"overflow-y":"auto"},key:"p"+o.ik,modelValue:o.sel,"onUpdate:modelValue":t[4]||(t[4]=e=>o.sel=e),onInput:r.checkboxInput},{default:vue.withCtx((()=>[o.data.length?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(o.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,o.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$5.render=render$4,script$5.__file="src/v-select.vue";var script$4={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$2=["value","data-value"],_hoisted_2$2=["onClick"];function render$3(e,t,l,a,o,r){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(o.options,(e=>(vue.openBlock(),vue.createElementBlock("div",{onClick:t=>r.onChange(e),style:vue.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.normalizeClass({"v-selected":e==o.selected})},vue.toDisplayString(e),15,_hoisted_2$2)))),256))],8,_hoisted_1$2)}script$4.render=render$3,script$4.__file="src/v-switch.vue";var script$3={name:"VTable",setup(e,t){const l=vue.ref(1),a=vue.ref(0),o=vue.ref([]),r=vue.ref([]),n=vue.ref(null),s=vue.ref(1),i=vue.computed((()=>{const t=e,l=r.value;let a,o;return l.sum=sum,l.filter((e=>{for(var l in t.filters)if(a=t.filters[l],"function"==typeof a){if(!a(e))return 0}else if(a&&"string"==typeof a&&l in e&&(o=e[l],"string"==typeof o&&(o=o.toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""),!o.includes(a.toUpperCase()))))return 0;return 1}))})),d=vue.computed((()=>{let e=i.value;return e=n?e.sort(((e,t)=>{t=(t=t[n])||0,e=e[n];const l=Number(e);return l&&(e=l),e<t?-1*s:e>t?1*s:0})):e,e.sum=sum,e})),c=[],u=vue.ref(1),p=vue.ref(0),{slots:v,expose:h,emit:m}=t,g=async()=>{var t,l=e.store;null!=l&&(db&&(t=await getStoredList(l)),t||(t=[]),r.value=r.value?t.concat(r.value):t);return data_},f=(e,t,a)=>{var n;if(-10===t)if(i.value.length===o.value.length)o.value=[];else for(o.value=[],n=0;n<i.value.length;n++)o.value.push(n);else a?l.value||!o.value.contains(t)?o.value=[t]:(o.value=[],e=null):this.selected.contains(t)?(o.value.splice(o.value.indexOf(t),1),e=null):o.value.push(t);var s=[],d=o.value.sort(((e,t)=>e-t));for(t=0;d.length>t;t++)s.push(r.value[d[t]]);m("row-select",{target:this,current:e,selection:s})},y=(t,l)=>{const a=[];return e.selectable&&(e=>o.value.includes(e))(t)&&a.push("v-selected"),e.rowStyleClassFunc&&a.push(e.rowStyleClassFunc(l)),a};let $=""+e.selectable;l.value="false"!=$&&"0"!=$?1:0,$=""+e.scrollable,a.value=e.scrollable&&"false"!=$&&"0"!=$?1:0;const b=v.default({row:{}});b&&b.forEach(((e,t)=>{const l=e.props;e.children&&e.children.filter&&(e.children.filter((e=>"v-filter"==e.type)).forEach((t=>{l.filter=t,p.value=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.type)).forEach((t=>{l.footer=t,e.children.shift()}))),c.push({filter:l.filter,header:l.header,width:l.width})}));return h({load:()=>{const t=e;if(o.value=[],t.value&&(r.value=t.value),t.src){var l=t.src;if(!l)return;l.endsWith("/")&&(l=l.slice(0,l.length-1));const e=t.pagination;if(e&&(l+="/"+(u.value-1)*e+"/"+e),networkStatus.connected){var a;if(t.gql){const l=t.gql,o="query{"+Object.keys(l)[0]+"(offset:"+(u.value-1)*e+" limit:"+e+"){\ndata{"+l[Object.keys(l)[0]]+"}\nsize\n}\n}";a=axios$2.post(t.src,{query:o})}else a=axios$2.get(l,{params:clean(t.filters)});a.then((l=>{if(l.data&&l.data.error)MsgBox(l.data.error);else{var a=l.data;t.gql&&(a=l.data.data[Object.keys(t.gql)[0]]),r.value=a.data||a,a&&a.hasOwnProperty("size")&&e&&(t.pages=Math.ceil(a.size/e),u.value>t.pages&&(u.value=1),t.size=a.size),g(),m("loaded",{target:t}),m("row-select",{}),t.remoteLoaded=1,t.loaded=1,t.kc++}})).catch(t.error)}else{r.value=[];const e=g();e.then&&e.then((e=>{r.value=e})),m("row-select",{target:t})}}else r.value=[],g().then((()=>m("loaded",{target:t})));t.kc++,t.loaded=1}}),()=>{const t=vue.h("div",{className:"v-datatable-scrollable-header-box",style:"position: absolute; height: 47px; left: 0px;"},vue.h("table",{className:"v-cloned-header v-table",style:"width: 1536px;"},[vue.h("th",{width:42},[vue.h("span",{className:"v-check"},vue.h("i",{className:"fa fa-lg"}))]),c.map((e=>vue.h("th",e,[e.header,e.filter?.children])))]));return vue.h("div",{className:"v-datatable"},[vue.h("div",{className:"v-datatable-header v-widget-header ui-corner-top"},v.header()),vue.h("div",{className:"v-paginator v-paginator-top v-widget-header v-paginator-pages center"},[vue.h(script$n,{value:"|<"}),vue.h(script$n,{value:"<"}),vue.h("input",{type:"number",style:"width:60px"}),vue.h(script$n,{value:">"}),vue.h(script$n,{value:">|"})]),vue.h("div",{className:"v-widget-header v-datatable-scrollable-header",style:"position: relative; height: 110px; margin-right: 0px;"},t),vue.h("div",{className:"v-datatable-scrollable-body",style:"overflow-y: auto; flex:1",onScroll(e){const l=e.currentTarget.scrollLeft;t.el.style.left="-"+l+"px"}},[vue.h("table",{className:"v-table",style:"width: 1536px;"},[vue.h("thead",{className:"v-head-cloned"},[vue.h("th",{width:42}),...c.map((e=>vue.h("th",{width:e.width})))]),vue.h("tbody",{className:"v-datatable-data"},d.value.length<1?vue.h("td",{colspan:c.length+(l.value?1:0)},e.emptyMessage):[d.value.map(((e,t)=>{const a=v.default({row:e});return a.forEach(((e,t)=>{delete e.props.header,delete e.props.width,e.children&&(e.children.filter((e=>"v-filter"==e.type)).forEach((t=>{p.value=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.type)).forEach((t=>{e.children.shift()})))})),vue.h("tr",{className:y(t,e),onclick(a){((e,t,a)=>{l.value&&0==whichChild(e.target)||f(t,a,1)})(a,e,t)}},[vue.h("td",{width:24}),...a])}))])])])])}},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,pagination:null,selectable:{default:!0},scrollable:null,autoload:{default:!0}},data:()=>({pages:1,resizeAfterUpddate:0,active:0,kc:1,keyBody:1,columns:null,row:{},hasFilters:0,kt:0,size:null,sortKey:"",paginatio_:0,remoteLoaded:null,loaded:!1,sortOrders:{},rowStyleClassFunc:null}),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 l=t.$target.k;e.kt!=l&&(e.load(),e.kt=l)})),e.active&&e.buildColumns(),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),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"),l=e.$el.querySelectorAll(".v-datatable-scrollable-header-box")[0];if(l){var a=e.$el.querySelectorAll(".v-cloned-header");if(0===a.length){a=document.createElement("table");var o=t[0].querySelectorAll("thead")[0],r=0,n=0,s=document.createElement("canvas"),i=window.getComputedStyle(l),d=s.getContext("2d");d.font=i.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,v=new HTML2Canvas({lineHeight:parseInt(i.lineHeight),ctx:d});r=0;if(u.forEach(((t,l)=>{t.childNodes[0].onclick=m;var a=e.columns[l-(selectable0.value?1:0)];if(a&&a.filter&&a.filter.elm)if(a.filter.elm.children.forEach)a.filter.elm.children.forEach((e=>t.appendChild(e)));else for(let e of a.filter.elm.children)t.appendChild(e);else if(l>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 s=t.childNodes[0].offsetHeight;s=v.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",s>n&&(n=s)})),u.forEach(((e,t)=>{t&&(e.childNodes[0].style.height=n+"px"),a.appendChild(e)})),u.forEach(((e,t)=>{var l=document.createElement("th");l.width=e.width,o.childNodes[0].appendChild(l)})),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 a=e.currentTarget.scrollLeft;l.style.left="-"+a+"px",t[0].style.left="-"+a+"px"}));var h=t[1].querySelectorAll("td");for(p=0;p<u.length;p++)h[p]&&(h[p].style.width=u[p].width+"px")}else t[0].parentElement.addEventListener("scroll",(e=>{var t=e.currentTarget.scrollLeft;l.style.left="-"+t+"px"}));a.style.width=r+"px";var m=t=>{var l=e.columns[t.target.parentNode.getAttribute("ind")].sort;l==e.sorter&&(e.sortDir=-1*e.sortDir),e.sorter=l};a.className="v-cloned-header v-table",l.appendChild(a),l.appendChild(l.firstChild),l.style.position="absolute",l.style.height=n+37-37+"px",l.parentElement.style.height=l.style.height,e.$el.style.maxHeight&&(l.parentElement.nextElementSibling.style.maxHeight=parseInt(e.$el.style.maxHeight)-n+"px"),o.className="v-head-cloned"}}var g=e.$el.querySelectorAll(".v-check > svg");for(p=0;p<g.length;p++)g[p].dataset.icon=g[p].parentNode.dataset.icon;if(e.loaded){for(var f=e.$el.querySelectorAll(".group"),y=0;y<f.length;y++)f[y].parentNode.removeChild(f[y]);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(){emit("updated",t)}),100)}},methods:{buildColumns(){},resize(e){var t=this.$el;setTimeout((()=>{var l=t.querySelector(".v-datatable-header");l&&(e-=l.offsetHeight),(l=t.querySelector(".v-paginator"))&&(e-=l.offsetHeight),(l=t.querySelector(".v-datatable-scrollable-header"))&&(l.style.height=l.querySelector("table").offsetHeight+"px",e-=l.offsetHeight),(l=t.querySelector(".v-table-summary"))&&(e-=l.offsetHeight);const a=(l=t.querySelector(".v-datatable-scrollable-body")).offsetWidth-l.clientWidth;l.style.overflowY="auto",l.style.height=e+"px",(l=t.querySelector(".v-datatable-scrollable-header-box"))&&(l.parentNode.style.marginRight=a+"px"),(l=t.querySelector(".v-table-summary"))&&(l.style.overflowY="hidden",l.style.marginRight=a+"px")}),100)},to(e,t){this.loadP(e,t)},loadP(e,t){var l=this;(l.page!=e||t)&&(l.page=e,l.load())},rowCreated(){},hasSlot(e){return!!this.$slots[e]},sortBy(){},rowSelect(e,t,l){var a,o=this;if(-10===t)if(filteredData.value.length===o.selected.length)o.selected=[];else for(o.selected=[],a=0;a<filteredData.value.length;a++)o.selected.push(a);else l?selectable0.value||!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]]);emit("row-select",{target:o,current:e,selection:r})},async getStoredList(e){let t=new Promise((t=>{console.log(db);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$2={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 a=new Event("tabChange",{bubbles:!1});a.$target=t,l.dispatchEvent(a),t.$el.style.height=t.height+"px",(a=new Event("parentResize",{bubbles:!1})).height=t.$el.offsetHeight-25,l.style.height=a.height+"px",setTimeout((()=>{l.dispatchEvent(a)}),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 a=new Event("parentResize",{bubbles:!1});a.height=e.$el.offsetHeight-25,a.target=e.$el,a.$target=e;for(var o=1;o<t.length;o++)"none"!=t[o].style.display&&(console.log("Se envia el alto "+a.height),t[o].style.height=a.height+"px",t[o].dispatchEvent(a));e.$emit("resize",a)})),t[1+e.currentTabIndex].setAttribute("active",1);var a=new Event("tabChange",{bubbles:!1});a.$target=e,t[1+e.currentTabIndex].dispatchEvent(a)}};const _hoisted_1$1={class:"v-tab-nav"},_hoisted_2$1=["onClick"];function render$2(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",{class:"v-tabview",style:vue.normalizeStyle({height:o.height+"px"})},[vue.createElementVNode("ul",_hoisted_1$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(o.tabs,((e,t)=>(vue.openBlock(),vue.createElementBlock("li",{class:vue.normalizeClass({"v-selected":t==o.currentTabIndex}),key:t,onClick:e=>o.currentTabIndex=t},vue.toDisplayString(e.title),11,_hoisted_2$1)))),128))]),vue.renderSlot(e.$slots,"default")],4)}script$2.render=render$2,script$2.__file="src/v-tabview.vue";var script$1={name:"VTextarea",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,l=e.$el;(t=window.attachEvent?function(e,t,l){e.attachEvent("on"+t,l)}:function(e,t,l){e.addEventListener(t,l,!1)})(l,"change",e.resize),t(l,"cut",e.delayedResize),t(l,"paste",e.delayedResize),t(l,"drop",e.delayedResize),t(l,"keydown",e.delayedResize)}};function render$1(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("textarea",null,vue.toDisplayString(l.value),1)}script$1.render=render$1,script$1.__file="src/v-textarea.vue";var script={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,a=new FormData;t=t||e.name.replace(/[^\w\s.]/gi,""),a.append("filename",t),a.append("file",e,t),l.showProgress=!0,axios.post((l.domain?l.domain:"")+"/api/file/upload",a,{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={style:{cursor:"pointer"},class:""},_hoisted_2=["data-icon"],_hoisted_3=[".value"];function render(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",{onClick:t[1]||(t[1]=(...e)=>r.other&&r.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,[l.click?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("input",{key:0,type:"file",onChange:t[0]||(t[0]=e=>r.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),vue.createTextVNode(vue.toDisplayString(l.onlyicon?"":null!=l.value?l.value:"Adjuntar Archivo")+" ",1),o.showProgress?(vue.openBlock(),vue.createElementBlock("progress",{key:1,max:"100",style:{width:"100%"},".value":o.uploadPercentage},null,40,_hoisted_3)):vue.createCommentVNode("v-if",!0)])],6)}script.render=render,script.__file="src/v-uploader.vue";var components={InputTextarea:script$p,InputText:script$q,VAutocomplete:script$o,VButton:script$n,VCalendar:script$m,VCheckboxGroup:script$l,VCheckbox:script$k,VDataview:script$j,VFieldset:script$i,VForm:script$h,VGroup:script$g,VLayerControl:script$f,VMapControl:script$e,VMap:script$d,VNumber:script$c,VOptions:script$b,VOverlay:script$a,VPanel:script$9,VPopup:script$8,VRadioGroup:script$6,VRadio:script$7,VSelect:script$5,VSwitch:script$4,VTable:script$3,VTabview:script$2,VTextarea:script$1,VUploader:script};const IsobitUI={install(e){setApp(e),e.BUILT_ON=(void 0).VITE_APP_BUILT_ON,configureAxios(axios$2);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 ui=cfg=>{const defs={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(!_$2._session){var e=localStorage.getItem("session");e=e?JSON.parse(e):{},_$2._session=e}return _$2._session},set(e){e?(Array.isArray(e.perms)&&(e.perms=e.perms.reduce(((e,t)=>(e[t]=!0,e)),{})),localStorage.setItem("session",JSON.stringify(e))):localStorage.removeItem("session"),_$2._session=e}},online(){return this.app2&&this.app2.networkStatus?.connected},cleanedFilters(){return clean(this.filters)},app:()=>_$2.app,user:()=>_$2.app.session,perms(){return this.session.perms||this.session.allcaps||{}},rowSelectedCount:()=>1,baseURL:()=>axios$2.defaults.baseURL},data(){return{app2:null,filters:{},ui:this,_session:null,x_connected_:null,row:{},networkStatus:{connected:null}}},created(){let e=this;_$2.app2||(_$2.app2=e,console.log("app created",_$2.app2)),e.app2=_$2.app2},methods:{pad:pad,bindLinks(e,t){const l=this;if(e.querySelectorAll){const r=e.querySelectorAll("a:not(._),ion-item:not(._)");var a=e=>{e.preventDefault()},o=e=>{e.preventDefault(),t&&t(),l.open(e)};for(let e=0;e<r.length;e++)r[e].href||r[e].attributes.href?r[e].onclick=o:r[e].onclick=a,r[e].classList?r[e].classList.add("_"):r[e].className="_"}},resize(){},vv(e){var t=this;Network.getStatus().then((function(l){if(l.connected){var a=localStorage.getItem("session");if(a){try{a=JSON.parse(a)}catch(e){a={}}a.connected=e,localStorage.setItem("session",JSON.stringify(a))}}else t.toast("El dispositivo no tiene acceso a internet!"),t.connected=l.connected}))},getSelected(e){for(var t=e&&e.$vnode?e:this.$children[0].$children[0],l=[],a=0;a<t.selected.length;a++)l.push(t.data[t.selected[a]]);return l},getRowSelectedCount(){var e=this.$children[0].$children[0];return e?e.selected.length:0},rewrite:e=>e,edit(e){var t=this,l=t.$children[0].action,a=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];l||(l=window.location.pathname),a&&a.src&&(l=a.src),e.action&&(l=e.action),a||(a=e.$vnode||e.target&&e.target.$vnode?e:t.$children[0].$children[0]).src&&(l=a.src),l&&(l=t.rewrite(l.replace("/api","").replace("/0/0","")));var o=t.getSelected(a)[0],r=o[a.rowKey];o.tmpId&&(r=-o.tmpId),t.getSelectedId&&(r=t.getSelectedId(o)),_$2.app?t.open(l+"/"+r+"/edit"):axios$2.get((_$2.currentPath=(l+"/"+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 l=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];l||(l=e.$vnode?e:t.$children[0].$children[0]);var a=e.$vnode?e.load:null,o=l.$attrs.rowkey;o||(o=l.rowKey);var r=l.data[l.selected[0]];if(l.data,r.tmpId)t.MsgBox("Esta seguro que desea eliminar los registros temporales seleccionados ?",(function(e){if(0==e){for(var o=0,n=_$2.db.transaction([l.store],"readwrite").objectStore(l.store),s=[],i=l.selected.length-1;i>=0;i--)r=l.data[l.selected[i]],s.push(r),r.tmpId&&n.delete(r.tmpId),o++,l.data.splice(l.selected[i],1);o&&(t.app&&t.app.toast?t.app.toast(o+" registros eliminados"):t.MsgBox(o+" registros eliminados")),l.rowSelect(null,-1),l.selected=[],t.$emit("destroyed",s,l.store),a&&a()}}),["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 a=l.src.replace("/0/0",""),o=[],s=l.selected.length-1;axios$2.delete(a+"/"+n,{params:l.filters}).then((()=>{for(;s>=0;s--)r=l.data[l.selected[s]],o.push(r),l.data.splice(l.selected[s],1);t.app&&t.app.toast?t.app.toast(o.length+" registros eliminados"):t.MsgBox(o.length+" registros eliminados"),l.rowSelect(null,-1),l.selected=[]})).catch(t.error)}}),["SI","NO"])}},apiLink:e=>e.replace(_$2.contextPath,_$2.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("me.$route=",me.$router,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:{};else{if(response.target)return el=response.target,me.open(el.pathname?el.pathname:el.href);if("GET"===response){if("string"==typeof path){let e={path:_$2.currentPath=path+("string"==typeof o?"/"+o:"")};return"function"==typeof o?e.result=o:"object"==typeof o&&(e=mergeDeep(e,o)),me.open(response,e)}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)}}var dialog,nid=Vue.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",_$2.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.resize()};if(for_&&for_.classList.contains("panel")){if(for_.id)window.currentEl="#"+for_.id;else{var clsId="cls-id-"+Vue.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"),l=dialog.querySelector(".v-panel-titlebar"),a=window.innerHeight-94-(l?l.clientHeight:0);(t||dialog).style.height=a+"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=_$2.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=_$2.varMap[children.getAttribute("vueid")],tb.onclick=e=>{e.preventDefault();var t=[],l=vue.$children[0].$children[0];for(i=0;i<l.selected.length;i++)t.push(l.filteredData[l.selected[i]]);path.result(t),delete path.result,vue.close(e)},f.appendChild(tb)}resize()}_$2.storeFunction["PROPS="+nid]=path,_$2.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.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=_$2.closest(event.target,".v-dialog"))}catch(e){console.log(e)}t||(t=this.$el.parentElement);var l=t.parentElement;if(l||!_$2.app.$router){t.style.display="none",(" "+l.className+" ").indexOf(" v-overlay ")>-1?l.style.display="none":l=null,Vue.resize();var a=_$2.storeFunction[t.getAttribute("callback")];a&&a(e),t.parentNode.removeChild(t),l&&l.parentNode.removeChild(l),document.documentElement.style.overflow="auto",document.body.scroll="yes"}else _$2.app.$router.back()},create(){const e=this,t=e.$el.__vnode.ctx.exposed;console.log(t);var l=t.action;l||(l=window.location.pathname),l&&(l=l.replace("/api","")),app()?e.open(l+"/create"):instance.get(_$2.currentPath=(l+"/create").replace(/([^:]\/)\/+/g,"$1")+"?modal").then(_$2.open).catch(e.error)},refresh(){const e=this.$el.__vnode;console.log(e.children[1].children[0]);e.children[1].children[0].children[0].component.exposed.load()},async sync(e){var t=this,l=t.$el.querySelector("form").getAttribute("action");if(!l){var a=(l=t.$el.parentNode.getAttribute("path")).split("/");a="edit"==a[a.length-1]?a.splice(0,a.length-2):a.splice(0,a.length-1),l=t.apiLink(a.join("/"))}var o=t.$children[0].$children[0];l=o.src;for(var r=await t.getStoredList(o.store),n=o.selected,s=[],i=[],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,i.push(p),s.push(u)}}s.length>0&&axios$2.post(l+"/bulk"+(e.sufix?e.sufix:""),i).then((function(e){let l=e.data;for(let e=0;e<l.length;e++){if(l[e].errors){t.MsgBox(JSON.stringify(l[e].errors));break}if(l[e].error){t.MsgBox(l[e].error);break}for(var a=0;a<r.length;a++)(l[e].ext&&l[e].ext.tmpId==r[a].tmpId||l[e].tmpId==r[a].tmpId)&&(console.log("ok"),l[e].ext&&r.ext&&(r[a].ext.error=l[e].ext.error),l[e].id&&(r[a].id=l[e].id),r[a].synchronized=1,t.$emit("sync",l[e],r[a]))}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();let t=e.$el.querySelector("form");if(this.validate(t)){let s=t.getAttribute("action");if(!s&&(s=e.$el.parentNode.getAttribute("path"),s)){let t=s.split("/");t="edit"==t[t.length-1]?t.splice(0,t.length-2):t.splice(0,t.length-1),s=e.apiLink(t.join("/"))}let i=e.$data.data?e.$data.data:e.$data.o;var l=JSON.parse(JSON.stringify(i));if(e.process&&(l=e.process(l)),"object"!=typeof l||Array.isArray(l)||null===l)return;if(s&&e.app2.connected)axios$2.post(s,l).then((t=>{var a=t.data;if(l.tmpId){alert(12);var o=e.$children[0].store,r=window._.db.transaction([o],"readwrite").objectStore(o),n=r.get(l.tmpId);a.id&&(l.id=a.id,i.id=l.id),n.onsuccess=function(){i.synchronized=1,l.synchronized=1,(n.result?r.put(l):r.add(l)).onerror=e=>{console.error(e)},e.$emit("sync",a,l)},n.onerror=function(){e.MsgBox("Error getting temporal record "+l.tmpId)}}e.app&&e.app.toast?e.app.toast("El registro fue grabado exitosamente!",(()=>{e.close({success:!0,data:a})})):MsgBox$1("El registro fue grabado exitosamente!",(()=>{e.close({success:!0,data:a})}))})).catch((function(l){var a,o;if(l.response)if("string"==typeof l.response.data)e.MsgBox(l.response.data);else{a=l.response.data.propertyViolations;for(var r=0;r<a.length;r++){var n=a[r];(o=t.querySelector("[name="+n.path+"]"))&&e.showerror(o,n.message)}for(a=l.response.data.fieldViolations,r=0;r<a.length;r++)n=a[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 s=await e.getStoredList(t);if(s||(s=[]),l.id)for(var a=0;a<s.length;a++)s[a].tmpId==l.tmpId&&(delete l.synchronized,s[a]=l);var o=_$2.db.transaction([t],"readwrite").objectStore(t);if(l.id){delete l.synchronized;var r=o.get(l.tmpId);r.onsuccess=function(){r.result?o.put(l):s.forEach((e=>{e.tmpId==l.tmpId&&o.put(l)})),e.$emit("stored",l,s,o),e.$ionic&&e.app.toast("El registro fue grabado exitosamente!"),e.close({success:!0,data:l})},r.onerror=function(){e.MsgBox("Error getting temporal record "+l.tmpId)}}else{l.tmpId=1*new Date,l.id=-l.tmpId;var n=o.add(l);n.onsuccess=t=>{s.unshift(l),e.$emit("stored",l,s,o),e.app&&e.app.toast&&e.app.toast("El registro fue grabado exitosamente!"),i.tmpId=l.tmpId,i.id=l.id,e.close({success:!0,data:l})},n.onerror=t=>{e.app&&e.app.toast&&e.app.toast("Error!")}}}}else MsgBox$1("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,l){"string"==typeof t&&(t={body:t});var a="string"==typeof l?{fileName:l}:l;a||(a={}),(""+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])),l=document.createElement("a");if(l.href=t,!a.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]&&(a.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",a.fileName),document.body.appendChild(l),l.click()}))},savePost(){},validate(e){const t=this;var l=!0;const a=[];e=e&&0!=e?e:t.$el;var o,r=e?.querySelectorAll("input,select,textarea,div[required=required]"),n={};for(v=0;r?.length>v;v++){var s=r[v];if("radio"!==s.type){if(s.error&&(s.error.style.display="none"),!s.disabled&&!s.getAttribute("disabled")&&(s.required||"DIV"===s.tagName)&&("DIV"!=s.tagName&&!s.value||"DIV"===s.tagName&&!s.attributes.value)){for(o=s.previousElementSibling;o&&1!=o.nodeType;)o=o.previousElementSibling;if(!o)for(o=s.parentElement.previousElementSibling;o&&1!=o.nodeType;)o=o.previousElementSibling;a.push(s)}}else{var i=n[s.name];i||(n[s.name]=i=[]),i.push(s)}}for(var d in console.log("valid radios"),n)if(Object.prototype.hasOwnProperty.call(n,d)){for(var c=n[d],u=!1,p=!1,v=0;v<c.length;v++)c[v].required&&!c[v].disabled&&(p=!0),c[v].checked&&(u=!0);(o=(s=c[0].parentNode.parentNode).previousElementSibling)&&o.classList&&o.classList.contains("v-error")&&o.parentNode.removeChild(o),p&&!u&&(t.showerror(s),l=!1)}console.log("ok="+l);for(const e of a)if(e.error)e.error.style.display="unset";else{const t=document.createElement("div");t.innerHTML="Este campo es requerido!",t.classList.add("v-error"),e.error=t,e.parentNode.insertBefore(t,e.nextSibling)}return!a.length}}};cfg||(cfg={data:{o:{}}});const{setup:setup,...other}=cfg;return cfg={mixins:[defs,other],setup:setup},cfg};exports.IsobitUI=IsobitUI,exports._=_$2,exports.app=app,exports.date=date,exports.db=db,exports.getStoredList=getStoredList,exports.initDB=initDB,exports.pad=pad,exports.resize=resize,exports.ui=ui;
package/dist/library.mjs CHANGED
@@ -1 +1 @@
1
- import{openBlock,createElementBlock,ref,watch,onMounted,onBeforeUnmount,computed,normalizeStyle,renderSlot,createTextVNode,toDisplayString,createCommentVNode,withDirectives,withKeys,withModifiers,normalizeClass,vModelText,createVNode,Transition,withCtx,createElementVNode,Fragment,renderList,vShow,pushScopeId,popScopeId,h as h$1,onUpdated,inject,onUnmounted,getCurrentInstance,createBlock,provide,resolveComponent}from"vue";import axios$2 from"axios";import{unByKey}from"ol/Observable";import _imports_0 from"@/cdn/images/triangle-down.svg";var script$q={name:"InputText"};const _hoisted_1$g={type:"text"};function render$m(e,t,l,a,o,r){return openBlock(),createElementBlock("input",_hoisted_1$g)}script$q.render=render$m,script$q.__file="src/InputText.vue";var script$p={name:"InputTextarea"};function render$l(e,t,l,a,o,r){return" text "}script$p.render=render$l,script$p.__file="src/InputTextarea.vue";var script$o={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:a}=t,o=ref(0),r=ref(null),n=ref(-1),s=ref(""),i=ref(null),d=ref(!1),c=ref(0),u=ref("");watch((()=>e.value),(e=>{r.value=e})),watch((()=>e.data),(e=>{i.value=e})),onMounted((()=>{u.value=e.inputClass,e.autoload&&h(),document.addEventListener("click",v)})),onBeforeUnmount((()=>{document.removeEventListener("click",v)}));const p=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})),h=async t=>{const{src:a,source:r}=e;let n=Number(e.pagination);if(1===t)o.value+=n;else if(o.value=0,e.data&&e.autoload)return;const u={query:s.value};e.params&&(u=Vue.mergeDeep(u,e.params)),axios$2.get((a||e.source)+(n>0?"/"+o.value+"/"+n:""),{params:u}).then((l=>{const a=l.data;console.log(a),a.error?MsgBox(a.error):(i.value=1===t?i.value.concat(a.data?a.data:a):a.data?a.data:a,console.log(i),c.value=a.size,e.autoload||(d.value=!0),console.log("========================="))})).catch(m).then((()=>{l("complete",{data:i.value,query:s.value,target:"me"})}))},m=e=>{console.log(e)},v=e=>{};return{query:s,show:d,selected:r,data2:p,focused:n,inputClass:u,search:h,remove:()=>{l("input",null)},clickout:v,focusout:e=>{},setSelected:e=>{r.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")=>!!a[e]}}};const _withScopeId=e=>(pushScopeId("data-v-72884078"),e=e(),popScopeId(),e),_hoisted_1$f=["value","disabled"],_hoisted_2$a=_withScopeId((()=>createElementVNode("i",{class:"fa fa-times"},null,-1))),_hoisted_3$7=[_hoisted_2$a],_hoisted_4$5=_withScopeId((()=>createElementVNode("i",{class:"fa fa-xs fa-sync"},null,-1))),_hoisted_5$2=[_hoisted_4$5],_hoisted_6$1=["disabled","placeholder"],_hoisted_7$1={class:"v-list"},_hoisted_8=["onClick"],_hoisted_9={key:0,class:"center yellow",style:{padding:"5px"}};function render$k(e,t,l,a,o,r){return openBlock(),createElementBlock("div",{class:"v-autocomplete",onFocusout:t[7]||(t[7]=(...e)=>a.focusout&&a.focusout(...e)),value:l.value,disabled:l.disabled},[a.selected&&l.showSelection?(openBlock(),createElementBlock("div",{key:0,class:"v-selection",style:normalizeStyle({whiteSpace:l.nowrap?"nowrap":""})},[renderSlot(e.$slots,"label",{selected:a.selected}),createTextVNode(" "+toDisplayString(a.hasSlot("label")?" ":a.getLabel(a.selected))+"  ",1),l.readonly?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("span",{key:0,onClick:t[0]||(t[0]=(...e)=>a.remove&&a.remove(...e)),class:"remove-icon"},[..._hoisted_3$7]))],4)):createCommentVNode("v-if",!0),a.selected?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("span",{key:1,onClick:t[1]||(t[1]=(...e)=>a.search&&a.search(...e)),class:"search-icon"},[..._hoisted_5$2])),a.selected?createCommentVNode("v-if",!0):withDirectives((openBlock(),createElementBlock("input",{key:2,onKeyup:[t[2]||(t[2]=(...t)=>e.keyup&&e.keyup(...t)),t[3]||(t[3]=withKeys(withModifiers(((...e)=>a.search&&a.search(...e)),["stop","prevent"]),["enter"]))],class:normalizeClass(a.inputClass),onFocus:t[4]||(t[4]=e=>a.show=!0),disabled:l.disabled,placeholder:l.placeholder,"onUpdate:modelValue":t[5]||(t[5]=e=>a.query=e)},null,42,_hoisted_6$1)),[[vModelText,a.query]]),createVNode(Transition,{name:"fade",persisted:""},{default:withCtx((()=>[withDirectives(createElementVNode("div",{class:"v-resultpane",style:normalizeStyle({zIndex:2,width:"calc(100% - 2px)",position:l.floating?"absolute":"relative"})},[createElementVNode("div",_hoisted_7$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(a.data2,((t,l)=>(openBlock(),createElementBlock("div",{key:l,class:normalizeClass({"v-selected":a.selected==t,"v-focused":a.focused==l}),onClick:e=>a.setSelected(t)},[renderSlot(e.$slots,"default",{row:t})],10,_hoisted_8)))),128)),e.data0&&e.data0.length<e.total?(openBlock(),createElementBlock("div",{key:0,class:"center",onClick:t[6]||(t[6]=e=>a.search(1))},"Load more "+toDisplayString(e.total-e.data0.length)+" results...",1)):createCommentVNode("v-if",!0)]),a.data2&&a.data2.length<1?(openBlock(),createElementBlock("div",_hoisted_9,"No results found.")):createCommentVNode("v-if",!0)],4),[[vShow,a.show&&!a.selected]])])),_:3})],40,_hoisted_1$f)}script$o.render=render$k,script$o.__scopeId="data-v-72884078",script$o.__file="src/v-autocomplete.vue";var script$n={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$e={type:"button",class:"_ ui-widget ui-state-default ui-corner-all v-button"};function render$j(e,t,l,a,o,r){return openBlock(),createElementBlock("button",_hoisted_1$e)}script$n.render=render$j,script$n.__file="src/v-button.vue";var script$m={name:"VCalendar",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,l=t.toDate(e);return console.log(l),t.max&&l&&l.getTime()>=t.toDate(t.max).getTime()||t.min&&l&&l.getTime()<=t.toDate(t.min).getTime()?(t.$emit("invalid",{target:t,value:l}),l=null,void(event.target.value=l)):void("time"===t.$props.type?this.$emit("input",t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2)+":00"):l.getTime&&this.$emit("input",l.getTime()))},pad(e,t){for(var l=e+"";l.length<t;)l="0"+l;return l},toDate(e){if(e){var t,l;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=(l=e.split("T"))[1].split(":"),l=l[0].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=e.split("-");var a=parseInt(l[0]);return a<100?e:l=new Date(a,parseInt(l[1])-1,parseInt(l[2]))}return e},changeDate(){var e,t=this,l=t.toDate(t.value);l&&(e="time"===t.$props.type?t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2):"datetime-local"===t.$props.type?t.pad(l.getFullYear(),4)+"-"+t.pad(l.getMonth()+1,2)+"-"+t.pad(l.getDate(),2)+"T"+t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2):t.pad(l.getFullYear(),4)+"-"+t.pad(l.getMonth()+1,2)+"-"+t.pad(l.getDate(),2)),this.$el.children[0].value=e}},updated(){this.changeDate()},mounted(){this.changeDate()}};const _hoisted_1$d=["value"],_hoisted_2$9=["required","readonly","min","max","type"];function render$i(e,t,l,a,o,r){return openBlock(),createElementBlock("div",{value:r.toDate(l.value)},[createElementVNode("input",{required:l.required,readonly:l.readonly,min:l.min,max:l.max,onChange:t[0]||(t[0]=(...e)=>r.enterD&&r.enterD(...e)),type:l.type?l.type:"date"},null,40,_hoisted_2$9)],8,_hoisted_1$d)}script$m.render=render$i,script$m.__file="src/v-calendar.vue";var script$l={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 a=0;t&&a<t.length;a++)e[l].value==t[a]&&(e[l].checked=!0)}},onChange:function(e,t){var l=this,a=l.$attrs.value;if(("string"==typeof a||a instanceof String)&&(a=a.split("|")),t)a||(l.$attrs.value=a=[]),a.push(e);else{var o=a.indexOf(e);o>-1&&a.splice(o,1)}l.$emit("input",a)}}};function render$h(e,t,l,a,o,r){return openBlock(),createElementBlock("div",null,[renderSlot(e.$slots,"default")])}script$l.render=render$h,script$l.__file="src/v-checkbox-group.vue";var script$k={name:"VCheckbox",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 l=t.checked?e.value?e.value:t.checked:null!==e.valueFalse&&void 0!==e.valueFalse?e.valueFalse:t.checked;l&&(e.hadValue=1),console.log("nv="+l),e.$emit("input",l)}},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$c={style:{"font-weight":"normal !important",display:"block"},class:"v-checkbox"},_hoisted_2$8=["innerHTML"],_hoisted_3$6=["checked","value"],_hoisted_4$4=createElementVNode("span",{class:"checkmark"},null,-1);function render$g(e,t,l,a,o,r){return openBlock(),createElementBlock("label",_hoisted_1$c,[createElementVNode("span",{innerHTML:r.getLabel()},null,8,_hoisted_2$8),createElementVNode("input",{type:"checkbox",checked:l.value&&l.vmodel==l.value||l.vmodel,onChange:t[0]||(t[0]=(...e)=>r.change&&r.change(...e)),value:l.value},null,40,_hoisted_3$6),_hoisted_4$4])}script$k.render=render$g,script$k.__file="src/v-checkbox.vue";var script$j={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,a=t%l.columns+1,o=["c-w-"+l.columns];return a==l.columns&&o.push("v-last"),l.rowStyleClassFunc?o.push(l.rowStyleClassFunc(e,e,t)):o.push(l.rowStyleClass),o},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 a=t.value?t.value:l.data.data?l.data.data:l.data;t.data||(t.data=[]),t.data=!0===e?a:t.data?t.data.concat(a):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$b={class:"v-dataview"};function render$f(e,t,l,a,o,r){return openBlock(),createElementBlock("div",_hoisted_1$b,[e.data?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(e.data,((t,l)=>(openBlock(),createElementBlock("div",{class:normalizeClass(r.getRowClass(t,l))},[renderSlot(e.$slots,"default",{row:t,item:t,index:l})],2)))),256)):createCommentVNode("v-if",!0),e.data&&!e.data.length?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(["center v-no-results",{error:e.error}])},toDisplayString(e.error?e.error:"No existen registros para mostrar"),3)):createCommentVNode("v-if",!0),e.data&&e.size>e.data.length?(openBlock(),createElementBlock("div",{key:2,onClick:t[0]||(t[0]=t=>r.load(e.page++)),class:"center v-more-results"},"Ver mas resultados")):createCommentVNode("v-if",!0)])}script$j.render=render$f,script$j.__file="src/v-dataview.vue";var script$i={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$a={class:"v-fieldset"},_hoisted_2$7=["data-icon"],_hoisted_3$5=["innerHTML"],_hoisted_4$3={style:{flex:"1",display:"flex","flex-direction":"column"}};function render$e(e,t,l,a,o,r){return openBlock(),createElementBlock("fieldset",_hoisted_1$a,[l.legend?(openBlock(),createElementBlock("legend",{key:0,onClick:t[0]||(t[0]=e=>o.closed=l.closable&&!o.closed),style:normalizeStyle({cursor:l.closable?"pointer":""})},[l.closable?(openBlock(),createElementBlock("span",{key:0,"data-icon":o.closed?"plus":"minus",style:{margin:"0px 5px 0px 0px"}},[createElementVNode("i",{class:normalizeClass([o.closed?"fa-plus":"fa-minus","fa"])},null,2)],8,_hoisted_2$7)):createCommentVNode("v-if",!0),createElementVNode("span",{innerHTML:l.legend},null,8,_hoisted_3$5)],4)):createCommentVNode("v-if",!0),withDirectives(createElementVNode("div",_hoisted_4$3,[renderSlot(e.$slots,"default")],512),[[vShow,!o.closed]])])}script$i.render=render$e,script$i.__file="src/v-fieldset.vue";var script$h={name:"VForm",props:["header","store","action"],setup(e,t){const{slots:l,expose:a}=t;return a({abc:()=>{alert(8)},...e}),()=>{const t=[];return e.header&&t.push(h$1("div",{class:"v-widget-header v-panel-titlebar"},[h$1("span",{class:"v-panel-title"},e.header)])),t.push(h$1("div",{class:"v-dialog-content v-widget-content"},[h$1("form",{action:e.action},l.default())])),h$1("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,a=e.height;l.style.height=a+"px",t.timer&&clearTimeout(t.timer),t.timer=setTimeout((()=>{if(l.parentElement){var e;if(l.children[1])a-=l.children[0].offsetHeight,l.children[1].style.height=a+"px",l.children[1].style.overflowY="auto",(l=l.children[1].children[0]).style.height=a+"px",l.children&&(l.parentNode.style.overflowY="hidden",l.parentNode.style.overflow="hidden"),[].forEach.call(l.children,((o,r)=>{r==l.children.length-1&&"CENTER"==o.tagName||!o.classList.contains("v-scrollable")&&!o.classList.contains("v-form")&&!o.classList.contains("v-resize")?a-=t.getAbsoluteHeight(o):e||(e=o)})),l=e;else(l=l.children[0]).style.height=a+"px";if(l){l.style.overflowY="auto",l.style.height=a+"px";var o=new Event("parentResize",{bubbles:!0});o.height=a,l.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 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 a=()=>{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=a,t[l].onblur=a,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 o=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 a=document.createElement("div");a.innerHTML="Este campo es requerido!",a.classList.add("v-error"),t.parentNode.insertBefore(a,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="__"}))},__file:"src/v-form.vue"},script$g={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$9={class:"v-group"};function render$d(e,t,l,a,o,r){return openBlock(),createElementBlock("div",_hoisted_1$9,[renderSlot(e.$slots,"default")])}script$g.render=render$d,script$g.__file="src/v-group.vue";var script$f={name:"VLayerControl",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 l=this,a=l.map;if(console.log("me.map="+l.map),e!=l.lastScope)if(e<100&&(e*=1e4),l.scope=e,0==l.scope)a.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],a.getSize()),l.lastScope=e,a.getLayerById("districts").getSource().clear(),l.$emit("scope",{feature:{getId:()=>null},target:l});else if(a){if(e>9999){for(var o=a.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 s=a.getLayerById("provinces");for(e=1*(e.value?e.value:e),r=s.getSource().getFeatures(),n=0;n<r.length;n++)if(1*r[n].id_==e){s.onChange({feature:r[n]});break}}}else l.lastScope=e;else a.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],a.getSize())}},created(){var e=this;return e.$parent.$on("build",(t=>{var l=document.createElement("i"),a=t.map;e.selection=new ol.Collection;var o=e.selection;l.setAttribute("class","fa fa-expand"),a.addControl(new ol.control.FullScreen({label:l,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"}),s=r.on("change",(()=>{var t=e.scope;t>9999&&(t=Math.floor(t/100));for(var l=r.getFeatures(),a=0;a<l.length;a++)if(1*l[a].id_==1*t){n.onChange({feature:l[a]});break}unByKey(s)})),i=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){i.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=i.getSource().on("change",(()=>{if(e.scope>0)for(var l=i.getSource().getFeatures(),a=e.scope,o=0;o<l.length;o++)if(1*l[o].id_==a){e.scope=0,i.onChange({feature:l[o]});break}unByKey(t)}))}e.$emit("scope",{feature:e.feature2,target:e}),e.feature2=null}};a.on("moveend",d),n.onChange=t=>{var l=t.feature;e.lastScope!=l.getId()&&(o.clear(),o.push(l),t.preventDefault&&t.preventDefault(),e.lastScope=l.getId(),e.feature2=l,e.unmove?d():a.getView().fit(l.getGeometry().getExtent(),{duration:300}))},n.onSelect=t=>{e.$emit("select",t)},a.addLayer(n),a.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)"})}),i.onChange=t=>{var l=t.feature;e.lastScope!=l.getId()&&(2==o.getLength()&&o.pop(),o.push(l),t.preventDefault&&t.preventDefault(),e.lastScope=l.getId(),e.feature2=l,e.unmove?d():a.getView().fit(l.getGeometry().getExtent(),{duration:300}))},i.onSelect=t=>{e.$emit("select",t)},a.addLayer(i),e.map=a,e.$emit("render",e)})),null}};function render$c(e,t,l,a,o,r){return openBlock(),createElementBlock("div",null,[renderSlot(e.$slots,"default")])}script$f.render=render$c,script$f.__file="src/v-layer-control.vue";var script$e={name:"VMapControl",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(){let e=this,t=window.ol;e.slotUsed=!!this.$slots.default,e.$parent.map?(e.$parent.map.addControl(new t.control.Control({element:e.$el})),e.ready=!0):e.$parent.$on("build",(l=>{l.map.addControl(new t.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$8={class:"ol-unselectable ol-control"};function render$b(e,t,l,a,o,r){return withDirectives((openBlock(),createElementBlock("div",_hoisted_1$8,[renderSlot(e.$slots,"default"),o.slotUsed?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("button",{key:0,class:"v-map-control-button",onClick:t[0]||(t[0]=withModifiers(((...e)=>r.enter&&r.enter(...e)),["prevent"]))},[l.icon?(openBlock(),createElementBlock("i",{key:0,class:normalizeClass(["fa fa-xs",l.icon])},null,2)):createCommentVNode("v-if",!0)]))],512)),[[vShow,o.ready&&o.visible0]])}script$e.render=render$b,script$e.__file="src/v-map-control.vue";var script$d={name:"VMap",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 l=new RegExp("[?&]"+e+"=([^&#]*)").exec(t);return l&&l[1]||0},addFeature(e,t){let l=window.ol;e=e||{};var a,o=this,r=o.map;if(e.lon&&e.lat){var n=[e.lon,e.lat];a=new l.geom.Point(n[0]>-100?l.proj.fromLonLat(n):n)}else a=new l.geom.Point(r.getView().getCenter());n=(n=a.flatCoordinates)[0]<-1e4?l.proj.toLonLat(n):n;o.$emit("translateend",{lon:n[0],lat:n[1]}),e.geometry=a;var s=new l.Feature(e);if(s.data=e,e.draggable){var i=new l.Collection;i.push(s);var d=new l.interaction.Translate({features:i});d.on("translateend",(e=>{var t=l.proj.toLonLat(e.coordinate);o.$emit("translateend",{lon:t[0],lat:t[1]})})),d.on("translatestart",(e=>{o.selectedFeature=e.features.getArray()[0]})),s.interactionCollection=i,o.map.addInteraction(d)}if("object"==typeof e.style?s.setStyle(e.style):s.setStyle(o.styleMap[e.style?e.style:"default"]),n=(n=a.flatCoordinates)[0]<-1e4?l.proj.toLonLat(n):n,o.$emit("translateend",{lon:n[0],lat:n[1]}),null!=e.layer){var c=r.getLayerById(e.layer);c?c.getSource().addFeatures(s):r.addLayer(new l.layer.Vector({id:e.layer,source:new l.source.Vector({features:new l.Collection([s])})}))}else o.collection.push(s);return t&&(console.log(s.getGeometry().getCoordinates()),o.map.getView().animate(Object.assign({center:s.getGeometry().getCoordinates(),zoom:17,duration:500},t))),s},animate(e){this.map.getView().animate(e),this.movingCompleted=e.complete},build(){var e=this,t=window.ol;e.styleMap={default:new t.style.Style({image:new t.style.Circle({radius:8,stroke:new t.style.Stroke({color:"#8a0000",width:2}),fill:new t.style.Fill({color:"#ff0000"})})}),star:[new t.style.Style({image:new t.style.RegularShape({fill:new t.style.Fill({color:"#ff0000"}),stroke:new t.style.Stroke({color:"#8a0000",width:2}),points:5,radius:10,radius2:4,angle:0})})]};var l=e.urlParam("location"),a=-1;if(l){var o=l.split("/");l=[parseFloat(o[0]),parseFloat(o[1])],a=o[2],e.moved=!0}else l=!1;console.log("w="+e.$el.clientHeight+";h="+e.$el.clientWidth);var r=new t.Map({target:e.$el,layers:[new t.layer.Tile({source:new t.source.OSM({})})],view:new t.View({})});new ResizeObserver((t=>{console.log("w="+e.$el.clientHeight+";h="+e.$el.clientWidth),r.updateSize()})).observe(e.$el),r.getLayerById=function(e){var t;return r.getLayers().forEach((l=>{l.get("id")!==e||(t=l)})),t},r.styleMap=e.styleMap,r.addLayer(new t.layer.Vector({source:new t.source.Vector({features:e.collection=new t.Collection})})),e.moved?(r.getView().setCenter(l),r.getView().setZoom(a||12),e.map=r,console.log("distarar evento buid pageLocation="+l),e.$emit("build",e)):(console.log("En caso no exista una coordenada se usara se fijara a los limites de la region"),_.getCurrentPosition().then((l=>{r.getView().setCenter(t.proj.fromLonLat([l.coords.longitude,l.coords.latitude])),r.getView().setZoom(12),e.map=r,e.$emit("build",e)}),(t=>{r.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],r.getSize()),e.map=r,e.$emit("build",e)})));var n=r.getView().getZoom();r.on("moveend",(t=>{this.movingCompleted&&(this.movingCompleted(e),this.movingCompleted=null);var l=r.getView().getZoom();n!=l&&(n=l,e.$children.forEach((function(e){e.$vnode.tag.endsWith("v-overlay")&&e.$emit("zoom",l)})))})),r.on("singleclick",(e=>{var t=r.forEachFeatureAtPixel(e.pixel,((e,t)=>{if(t)return[e,t]}));if(t){var l=t[1];t=t[0];if(e.feature=t,e.map=r,e.preventDefault(),l.onSelect)return void l.onSelect(e)}})),r.on("dblclick",(t=>{var l=r.forEachFeatureAtPixel(t.pixel,((e,t)=>{if(t)return[e,t]}));if(l){var a=l[1];l=l[0];if(t.feature=l,t.map=r,a.onChange)return console.log("dbclick manda event onchangue"),void a.onChange(t);e.$emit("change",l),r.getView().animate({center:l.getGeometry().getCoordinates(),zoom:17,duration:500},(()=>{for(var l=0;l<e.$children.length;l++){var a=e.$children[0];a.open&&a.open(t)}}))}})),r.getViewport().parentNode.addEventListener("parentResize",(t=>{setTimeout((()=>{r.updateSize(),e.$emit("resize",r)}),100)})),Vue.resize()}}};function render$a(e,t,l,a,o,r){return openBlock(),createElementBlock("div",null,[renderSlot(e.$slots,"default")])}script$d.render=render$a,script$d.__file="src/v-map.vue";const _$2={stores:[],_id:0,axios_get:null,storeFunction:{},id:()=>_$2._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.split("T");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,a=document.createElement("div");a.className="abc",a.style="top:50%;transform:translate(-50%,-50%);position:absolute;width:100%;z-index:2; display: flex;justify-content: center;";let o=a.style;if(o.left="50%",o.textAlign="center",!1!==e)if(e instanceof Element)a=e;else{if(e){let t=document.createElement("div");t.innerHTML=e,a.append(t),a.style="padding:4px;margin-bottom:5px;color:white;font-size:24px;text-align:center"}l=document.createElement("div"),o=l.style,l.className="loading"}let r=document.createElement("div");o=r.style,o.height="100%",o.top="0px",o.position="absolute",o.left="0",o.zIndex=1e4,o.width="100%";let n=document.createElement("div");return o=n.style,o.height="100%",o.width="100%",o.top="0",o.position="absolute",o.left="0",o.backgroundColor="rgba(0,0,0,0.5)",t&&t.opacity&&(o.opacity=t.opacity),t&&t.backgroundColor&&(o.backgroundColor=t.backgroundColor),r.appendChild(n),r.appendChild(a),l&&a.appendChild(l),document.body.appendChild(r),r},unmask=e=>{e&&(e.style.display="none",e.parentNode&&e.parentNode.removeChild(e))},buildPopupMenu=e=>{let t=e.getAttribute("v--popup");if(!t){e.setAttribute("v--popup",t=_$2.id());let l=_$2.storeFunction[t],a=e.querySelectorAll(".v-datatable-header .v-button");a&&a.length&&!l&&window.innerWidth<=700&&setTimeout((function(){l=document.createElement("ul"),l.className="v-popup-2",e.appendChild(l);let o=null;const r=e=>{l.style.display="none";let t=e.target.getAttribute("commandId"),a=document.querySelector("#"+t);"BUTTON"==a.tagName?a.click():a.children[0].click(),unmask(o)};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(a=e.querySelectorAll(".v-datatable-header .v-button");l.firstChild;)l.removeChild(l.firstChild);for(s=0;s<a.length;s++)if("none"!=a[s].style.display){let e=document.createElement("li");if(a[s].id||(a[s].id="c-"+_$2.id()),e.setAttribute("commandId",a[s].id),"BUTTON"==a[s].tagName){if(a[s].disabled)continue;e.appendChild(a[s].children[0].cloneNode(!0)),e.appendChild(document.createTextNode(a[s].value?a[s].value:a[s].title))}else a[s].children[0].children[1]&&(e.appendChild(a[s].children[0].children[1]),e.appendChild(document.createTextNode(a[s].textContent)));e.onclick=r,l.appendChild(e)}o=mask(l),l.style.display="block",o.onclick=()=>{l.style.display="none",unmask(o)}},e.appendChild(n),_$2.storeFunction[t]=l}),500)}},resize=()=>{let e=window.innerHeight;document.body.children[0].style.height=e+".px";let t=document.querySelectorAll("#page-header,.ui-layout-north,.v-layout-north,.ion-page >ion-header");t=t[0];const l=document.querySelectorAll("#app > .ui-panel > .v-dialog-content > form > .v-datatable");if(l&&l[0])buildPopupMenu(l[0]);else{let e=document.querySelectorAll(".ion-page");if(e[0]){let t=0;for(let l=0;l<e[0].childNodes.length;l++)"ION-HEADER"!=e[0].childNodes[l].nodeName&&"ION-FOOTER"!=e[0].childNodes[l].nodeName||(t+=e[0].childNodes[l].offsetHeight);let l=0;for(kk=0;kk<e[0].childNodes.length;kk++){let a=e[0].childNodes[kk];if("ION-HEADER"==a.nodeName&&(l=1),1==l&&"ION-HEADER"!=a.nodeName&&"ION-FOOTER"!=a.nodeName&&a.style){a.style.height=e[0].offsetHeight-t+"px",a.style.overflowY="auto";break}}}else console.log(12)}},MsgBox$1=(e,t,l)=>{if(l||(l=["OK"]),!document.body)return;let a=document.createElement("div");a.classList.add("v-overlay"),a.style.padding="40px",a.style.zIndex="2000",document.body.appendChild(a);let o=document.createElement("div"),r=document.createElement("div"),n=document.createElement("div"),s=document.createElement("div");s.className="v-msgbox-buttons",o.classList.add("v-dialog"),o.classList.add("v-msgbox"),n.innerHTML=e,o.setAttribute("path",_$2.currentPath);let i=function(){o.style.display="none",a.style.display="none",o.parentNode.removeChild(o),a.parentNode.removeChild(a),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)}r.className="v-dialog-content v-widget-content",r.appendChild(n),r.appendChild(s),o.appendChild(r),a.appendChild(o),a.style.visibility="unset",a.style.opacity="unset",a.style.overflow="auto",o.style.margin="0 auto",o.style.position="unset",resize()},configureAxios=e=>{let t;_$2.axios_get=e.get,e.interceptors.request.use((function(e){return _$2.eeee=e,e.mask?e.mask():t||(t=mask()),e}),(function(e){return t=unmask(t),MsgBox$1("request "+_$2.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,a=e&&e.data&&e.data.msg?e.data.msg:l.message;if(e&&(e.data&&e.data.message&&(a=e.data.message),"string"==typeof e.data&&(a=e.data),a||(a=e.status+": "+e.statusText)),t=unmask(t),e&&401==e.status&&_$2.app)return _$2.app.toast("Session terminada"),void _$2.app.logout();l.config?.error?l.config.error(l,a):(console.log(l),l.request?MsgBox$1("<b>"+l.request.responseURL+"</b><br/><br/>"+a):MsgBox$1(a))}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=>{for(let t in e)""!==e[t]&&null!==e[t]&&"function"!=typeof e[t]&&void 0!==e[t]||delete e[t];return e},sum=e=>(void 0).reduce(((t,l)=>t+((l=e?l[e]:l)?Number(l):0)),0);function createGetters(){return{get networkStatus(){return _$2.app?.networkStatus||{connected:!0}},get db(){return _$2.app?.db},app:()=>(console.log("get.app="+_$2.app),_$2.app),setApp(e){_$2.app=e,console.log("setApp="+_$2.app)}}}const app=()=>_$2.app,db=()=>_$2.db,initDB=(e,t)=>{let l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;if(_$2.IDBTransaction=window.IDBTransaction||window.webkitIDBTransaction||window.msIDBTransaction,_$2.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange||window.msIDBKeyRange,l){if(l)return _$2.stores=t,new Promise(((a,o)=>{let r=l.open("db",e);r.onupgradeneeded=e=>{let l=e.target.result;t.forEach((e=>{l.objectStoreNames.contains(e[0])||l.createObjectStore(e[0],e[1])}))},r.onerror=e=>{o(e)},r.onsuccess=()=>{_$2.db=r.result,a(_$2.db)}}))}else window.alert("Your browser doesn't support a stable version of IndexedDB.");return l},getStoredList=async(e,t)=>{let l;try{l=JSON.parse(sessionStorage.getItem("loadedStores"))}catch(e){}null==l&&(l={});const a=db();if(!l[e]&&networkStatus.connected){let t=_$2.stores.filter((t=>t[0]==e))[0];if(!t)throw"store '"+e+"' undefined";if(!t[2])throw"store url for '"+e+"' is empty";let o=t[2]?await _$2.axios_get(t[2]):[];const r=a.transaction([t[0]],"readwrite").objectStore(t[0]);await r.clear(),o=o.data||o;for(let e in o)try{await r.add(o[e])}catch(e){throw e}l[e]=1,sessionStorage.setItem("loadedStores",JSON.stringify(l))}let o=new Promise(((t,l)=>{if(a){let l=a.transaction(e).objectStore(e).getAll();l.onsuccess=function(){t(l.result)}}else l("db is null")}));return await o},getters=createGetters(),{networkStatus:networkStatus,setApp:setApp}=getters;class HTML2Canvas{props;ctx;lineHeight;constructor(e){this.props=e,this.ctx=e.ctx,this.lineHeight=e.lineHeight?e.lineHeight:20}heightText(e,t){const{ctx:l,lineHeight:a}=this;let o="",r=a;return e.split("").forEach((e=>{o+=e,l.measureText(o).width>=t-15&&(o="",r+=a)})),r+=7,r}drawText(e,t,l,a,o,r){const{ctx:n,lineHeight:s}=this;let i="",d=s+l;return n.fillStyle="#000000",e.split("").forEach((e=>{i+=e,n.measureText(i).width>=a-15&&(n.fillText(i,t,d),i="",d+=s)})),n.fillText(i,t+("right"==r?a-n.measureText(i).width:0),d),n.beginPath(),d+=7,d}}var script$c={name:"VNumber",props:{value:Number,max:Number,min:Number,delay:Number},setup(e,t){const{emit:l}=t,a=ref(null);onMounted((()=>{a.value=e.value})),onUpdated((()=>{a.value=t.attrs.modelValue}));return{v:a,handleInput:t=>{let o=a.value;const r=t.target.getAttribute("decimal");null!==o?(o=num(o),e.max&&o>num(e.max)&&(o=num(e.max)),e.min&&o<num(e.min)&&(o=num(e.min)),null!==r&&(o=o.toFixed(Number(r)))):o=null,a.value=t.target.value;let n=_$2.calendarTimer;n&&clearTimeout(n),e.delay?_$2.calendarTimer=setTimeout((()=>{l("input",o),_$2.calendarTimer=null}),13===t.keyCode?0:e.delay):l("input",o)}}}};function render$9(e,t,l,a,o,r){return withDirectives((openBlock(),createElementBlock("input",{type:"number",onKeyup:t[0]||(t[0]=withKeys(((...e)=>a.handleInput&&a.handleInput(...e)),["enter"])),"onUpdate:modelValue":t[1]||(t[1]=e=>a.v=e),onInput:t[2]||(t[2]=(...e)=>a.handleInput&&a.handleInput(...e)),class:"_"},null,544)),[[vModelText,a.v,void 0,{number:!0}]])}script$c.render=render$9,script$c.__file="src/v-number.vue";var script$b={setup(e,t){const l=e,{displayField:a,store:o,filter:r}=l,{expose:n,emit:s}=t,i=ref([]),d=ref([]),c=ref([]);ref(null),ref(null);const u=inject("collect"),p=computed((()=>d.value&&r?d.value.filter((e=>-1!==JSON.stringify(e).toLowerCase().indexOf(r.toLowerCase()))):d.value)),h=(e,t)=>{const l=c.value;if(l&&l.length)for(var a=0;a<l.length;a++)e&&(e=e[l[a]]);else e&&!t&&(e=e.id?e.id:e.code?e.code:e);return e},m=async(e=null,t=null,a=!1)=>{if(!a&&t&&e&&i.value.push([e,t]),!(i.value.length>1)){if(d.value=[],d.value||(d.value=[]),l.store){let t=await getStoredList(l.store);const[a]=e?Object.keys(e):[];if(a){let l;try{d.value=t.filter((t=>(l=t,l[a].startsWith(e[a]))))}catch(e){console.log("Error trying to filter ",l),console.error(e)}}else d.value=d.value.concat(t)}for(u(p),a||i.value.shift();i.value.length;){const e=i.value.shift()||[];await m(e[0],e[1],!0)}}};return m.getObjectByIndex=e=>{const t=p.value;return t?t[e]:null},m.getValueByIndex=e=>{const t=p.value;return t?h(t[e],1):null},m.getIndexByValue=(e,t)=>{e&&e.id?e=e.id:e&&e.code&&(e=e.code);for(var l=0;l<p.value.length;l++)if(h(p.value[l])==e)return t&&t(l),l;return t&&t(-1),-1},u.push(m),onUpdated((()=>{u.updateSelect()})),onMounted((()=>{l.valueField&&(c.value=l.valueField.split(".")),u.updateSelect()})),onUnmounted((()=>{u.remove(m)})),n({load:m}),()=>p.value.map((e=>h$1("option",{value:h(e)},e[a])))},name:"VOptions",props:{url:String,src:String,displayField:String,data:Array,store:null,valueField:String,filters:null,filter:null,mode:null},watch:{data(){this.$parent.updateSelect()}},created(){var e=this;e.data&&(e.data2=e.data)},updated(){let e=this;!e.loaded&&e.data&&(e.data2=e.data)},methods:{getParentE(){return this.$el.parentElement.parentElement},getSelectedItem(){var e=this.$el.parentElement;return this.filterList[e.selectedIndex-1]},async load2(e,t,l){}},__file:"src/v-options.vue"},ol$1=window.ol,_$1=window._,axios$1=window.axios,script$a={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$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 l=e.$el.parentElement;var a=window.getComputedStyle(l),o=parseFloat(a.left),r=parseFloat(a.top),n=t.clientX,s=t.clientY,i=l.parentElement;function d(e){l.style.left=o+e.clientX-n+"px",l.style.top=r+e.clientY-s+"px"}i.addEventListener("mousemove",d,!1),i.addEventListener("mouseup",(function(){i.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(_$1.remoteServer+e.src).then((t=>{e.$emit("input",t.data)}))},open(e){for(var t=this,l=e.map,a=e.feature,o=t.overlay,r=o.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),o.setPosition(e.coordinate);var i=l.getView().getCenter(),d=l.getView().getResolution(),c=a?a.getGeometry().getCoordinates():[null],u=l.getPixelFromCoordinate(Number(c[0])?c:e.coordinate);if(this.src)axios$1.get(_$1.remoteServer+this.src).then((e=>{t.$emit("input",e.data),t.c++,setTimeout((function(){var e=l.viewport_.offsetWidth,a=l.viewport_.offsetHeight,n=r.children[0].children[1];n.scrollTop=0;var s=r.offsetHeight;n.style.height=s+100>=a?a-100-r.children[0].children[0].offsetHeight+"px":"300px",s=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,l.getView().animate({center:[i[0]+(u[0]+p+20>=e?+(u[0]+p+20-e):u[0]-20-p<0?-p+u[0]-20:0)*d,i[1]+(u[1]<s?s-u[1]:0)*d],duration:500}),u[0]=u[0]+p-0,u[1]=u[1]-12,o.setPosition(l.getCoordinateFromPixel(u)),t.$el.style.opacity=1,_$1.mobil)for(var h=o.getElement().querySelectorAll("a:not(._)"),m=0;m<h.length;m++)h[m].addEventListener("click",_$1.open2)}),400)})).catch((e=>{console.log(e)}));else{var p=l.viewport_.offsetWidth,h=l.viewport_.offsetHeight,m=r.children[0].children[1];m.scrollTop=0;var v=r.offsetHeight;console.log(r.offsetHeight),m.style.height=v+100>=h?h-100-r.children[0].children[0].offsetHeight+"px":"300px",v=r.offsetHeight;var g=1*t.width,f=p<=g+40?p-40:g;if(r.style.zIndex=10,r.style.width=f+"px",f/=2,l.getView().animate({center:[i[0]+(u[0]+f+20>=p?+(u[0]+f+20-p):u[0]-20-f<0?-f+u[0]-20:0)*d,i[1]+(u[1]<v?v-u[1]:0)*d],duration:500}),u[0]=u[0]+f-0,u[1]=u[1]-12,o.setPosition(l.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,_$1.mobil){var y=o.getElement().querySelectorAll("a:not(._)");for(s=0;s<y.length;s++)y[s].addEventListener("click",_$1.open2)}t.$emit("opened",{target:t})}}}};const _hoisted_1$7={class:"v-ol-overlay"},_hoisted_2$6={key:0,class:"v-panel-titlebar"},_hoisted_3$4=createElementVNode("i",{class:"fa fa-times"},null,-1),_hoisted_4$2=[_hoisted_3$4],_hoisted_5$1={key:2,style:{"text-align":"center"}},_hoisted_6=createElementVNode("img",{src:_imports_0,width:"20",height:"18"},null,-1),_hoisted_7=[_hoisted_6];function render$8(e,t,l,a,o,r){return openBlock(),createElementBlock("div",_hoisted_1$7,[l.header?(openBlock(),createElementBlock("div",_hoisted_2$6,[createElementVNode("span",{class:"v-icon v-icon-close",onClick:t[0]||(t[0]=(...e)=>r.close&&r.close(...e))},[..._hoisted_4$2]),createTextVNode(toDisplayString(l.header),1)])):createCommentVNode("v-if",!0),(openBlock(),createElementBlock("div",{class:"v-ol-body",key:"c-"+o.c,style:{padding:"10px"}},[l.value?renderSlot(e.$slots,"default",{key:0,value:l.value}):createCommentVNode("v-if",!0)])),r.hasSlot("footer")&&l.value?(openBlock(),createElementBlock("footer",{key:"f-"+o.c},[renderSlot(e.$slots,"footer",{value:l.value})])):createCommentVNode("v-if",!0),o.coordinate?(openBlock(),createElementBlock("div",_hoisted_5$1,[..._hoisted_7])):createCommentVNode("v-if",!0)])}script$a.render=render$8,script$a.__file="src/v-overlay.vue";var script$9={name:"VPanel",props:{header:String}};const _hoisted_1$6={class:"ui-panel"},_hoisted_2$5={key:0,class:"v-panel-titlebar v-widget-header ui-helper-clearfix ui-corner-all"},_hoisted_3$3={class:"v-panel-title"},_hoisted_4$1={class:"v-panel-content v-dialog-content v-widget-content"};function render$7(e,t,l,a,o,r){return openBlock(),createElementBlock("div",_hoisted_1$6,[l.header?(openBlock(),createElementBlock("div",_hoisted_2$5,[createElementVNode("span",_hoisted_3$3,toDisplayString(l.header),1)])):createCommentVNode("v-if",!0),createElementVNode("div",_hoisted_4$1,[renderSlot(e.$slots,"default")])])}script$9.render=render$7,script$9.__file="src/v-panel.vue";var script$8={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$5={class:"v-popup",style:{position:"absolute"}};function render$6(e,t,l,a,o,r){return withDirectives((openBlock(),createElementBlock("div",_hoisted_1$5,[renderSlot(e.$slots,"default")],512)),[[vShow,o.show]])}script$8.render=render$6,script$8.__file="src/v-popup.vue";var script$7={name:"VRadio",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(){}}};const _hoisted_1$4={class:"v-radio",style:{"font-weight":"normal !important",display:"block"}},_hoisted_2$4=["value"],_hoisted_3$2=createElementVNode("span",{class:"checkmark"},null,-1);function render$5(e,t,l,a,o,r){return openBlock(),createElementBlock("label",_hoisted_1$4,[createTextVNode(toDisplayString(l.label?l.label:l.value)+" ",1),createElementVNode("input",{type:"radio",value:l.value},null,8,_hoisted_2$4),_hoisted_3$2,renderSlot(e.$slots,"default")])}script$7.render=render$5,script$7.__file="src/v-radio.vue";var script$6={__name:"v-radio-group",props:{required:String,name:String,modelValue:String,items:{type:Array,required:!0},type:{type:String,default:"radio"},label:{type:String,default:""}},emits:["update:modelValue"],setup(e,{emit:t}){const l=e,a=t,o=ref(l.modelValue),{proxy:r}=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(r.$el,[]);let t=l.name;t||(t="input_"+Date.now().toString(36)+Math.random().toString(36).substring(2,15));for(let l=0;l<e.length;l++)e[l].name=t,n.has(e[l])||(e[l].addEventListener("change",d),n.add(e[l])),e[l].checked=e[l].value===o.value},d=e=>{let t=e.target.value;""===t&&(t=null),o.value=t,a("update:modelValue",t)};watch((()=>l.modelValue),(e=>{o.value=e,i()})),onMounted((()=>{i()})),onUpdated((()=>{i()}));const c=()=>{const e=[];return r.$slots.default&&e.push(...r.$slots.default()),l.items&&e.push(...l.items.map((e=>h$1(script$7,{...e,modelValue:o.value,"onUpdate:modelValue":d})))),h$1("div",[l.label&&h$1("label",l.label),...e])};return(e,t)=>(openBlock(),createBlock(c))},__file:"src/v-radio-group.vue"},script$5={name:"VSelect",setup(e,t){const{slots:l,emit:a}=t,{displayField:o,valueField:r,disabled:n,readonly:s,autoload:i}=e,d=ref([]),c=ref([]),u=ref([]),p=[],h=ref(!(i+""=="false"||1*i==0)),m=ref(null),v=e=>{const t=e.value;d.value=o?t.sort(((e,t)=>{const l=e[o];return l>t[o]?1:l<t[o]?-1:0})):t},g=()=>{let e=t.attrs.modelValue;if(null!=e&&e.target&&(e=e.value),m.value){let t=m.value,l=t.selectedIndex;e&&""!==e||(t.selectedIndex=0);for(let l=0;l<t.length;l++)t[l].value==e&&(t.selectedIndex=l);const o=p;for(let r=0;r<o.length;r++){if(!o[r].getValueByIndex)continue;let n=o[r].getValueByIndex(l-1);o[r].getIndexByValue(e,((l,s)=>{if(l>-1){t.selectedIndex=l+1;let s=o[r].getValueByIndex(t.selectedIndex-1);-1==s?s=null:o[r].getObjectByIndex&&(s=o[r].getObjectByIndex(t.selectedIndex-1));let i=Number(n);i=isNaN(i)?n?!!e&&(e.id?e.id==n.id:e==n):!e:i==Number(e),i||a("input",e,{value:e,select:t,object:s})}}))}}};v.remove=e=>{const t=p.filter((t=>t!==e));p.length=0,t.forEach((e=>p.push(e)))},v.push=e=>{p.push(e)},v.updateSelect=()=>{g()},r&&(c.value=r.split(".")),provide("collect",v);const f=(t,l)=>{e.disabled?u.value=[t,l]:(u.value=[],p.forEach((e=>{e(t,l)})))};return onMounted((()=>{f()})),onUpdated((()=>{g()})),{options:d,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=m.value;t&&""!==t||(t=null,l.selectedIndex=0);let o,r=0;const n=d.value;for(let e=0;e<p.length;e++){if(r=p[e].getValueByIndex(l.selectedIndex-1),-1!=r){o=p[e].getObjectByIndex(l.selectedIndex-1);break}r=0}r?t=r:n.length&&(l.selectedIndex=0),a("update:modelValue",t,{value:t,select:l,object:o}),a("input",t,{value:t,select:l,object:o})},onInput:e=>{e.target.value,e.stopPropagation()},select:m,load:f,lastLoad:u,autoload_:h}},props:{required:null,readonly:null,multiple:null,label:null,disabled:null,autoload:null,displayField:null,valueField:null},data:()=>({autoload_:!0,ik:0,data:[],popup:null,show:!1,sel:[],sela:null,tmp:[],sel2:[]}),mounted(){},watch:{disabled(e,t){this.activate(e,t)},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 a=e.getBoundingClientRect();const o=l.children[0];window.innerWidth<400?(l.style.padding="40px",l.style.height="100%",o.style.height="100%"):(l.style.top=a.bottom+0+"px",l.style.left=a.left+0+"px",l.style.maxHeight=window.innerHeight-a.bottom-30+"px",o.style.maxHeight=l.style.maxHeight),o.style.display="flex",o.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()}}},methods:{activate(e,t){e=!!e,t=!!t;let l=this.lastLoad,a=this;!e&&!e===t&&l.length&&(this.$el.disabled=!1,a.load(l[0],l[1]))},expand(){console.log("click")},internalLoad(){let e=this;e.autoload_=!(e.autoload+""=="false"||1*e.autoload==0);let t=e.$attrs.value;null!=t&&t.target&&(t=t.value);let l=e.$el.childNodes[0];t&&""!==t||(l.selectedIndex=0),t=e.$attrs.value;for(let e=0;e<l.length;e++)l[e].value==t&&(l.selectedIndex=e);e.autoload_&&e.load(),e.$emit("mounted",e)},toggle(){this.show=!this.show},close(){this.show=!1},selectAll(){let e=[];for(let t=0;t<this.data.length;t++)e.push(this.data[t].value);this.sel=e,this.ik++},checkboxInput(){let e=this.sel;e&&e.length&&(e=e.join(","))}}};const _hoisted_1$3={class:"v-select",style:{position:"relative"}},_hoisted_2$3=["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$4(e,t,l,a,o,r){const n=resolveComponent("v-checkbox"),s=resolveComponent("v-checkbox-group"),i=resolveComponent("v-button");return openBlock(),createElementBlock("div",_hoisted_1$3,[l.readonly?createCommentVNode("v-if",!0):withDirectives((openBlock(),createElementBlock("select",{key:0,style:{width:"100%"},ref:"select",onChange:t[0]||(t[0]=(...e)=>a.onChange&&a.onChange(...e)),onInput:t[1]||(t[1]=(...e)=>a.onInput&&a.onInput(...e)),required:l.required,disabled:l.disabled,click:r.expand},[renderSlot(e.$slots,"default")],40,_hoisted_2$3)),[[vShow,!l.multiple]]),l.multiple?(openBlock(),createElementBlock(Fragment,{key:1},[createElementVNode("div",{class:normalizeClass(["v-widget-header",{"v-selected":o.show}]),ref:"button",style:{"padding-top":"3px","padding-bottom":"3px"},onClick:t[2]||(t[2]=(...e)=>r.toggle&&r.toggle(...e))},"   ",2),withDirectives(createElementVNode("div",{ref:"popup",onClick:t[5]||(t[5]=(...e)=>r.close&&r.close(...e)),style:{"background-color":"#0000009c"}},[createElementVNode("div",_hoisted_3$1,[createElementVNode("div",_hoisted_4,[createVNode(n,{modelValue:o.sela,"onUpdate:modelValue":t[3]||(t[3]=e=>o.sela=e),onInput:r.selectAll},null,8,["modelValue","onInput"])]),(openBlock(),createBlock(s,{class:"v-select-checkbox-group",style:{"overflow-y":"auto"},key:"p"+o.ik,modelValue:o.sel,"onUpdate:modelValue":t[4]||(t[4]=e=>o.sel=e),onInput:r.checkboxInput},{default:withCtx((()=>[o.data.length?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(o.data,(e=>(openBlock(),createElementBlock("div",null,[createVNode(n,{value:e.value,label:e.label},null,8,["value","label"])])))),256)):createCommentVNode("v-if",!0)])),_:1},8,["modelValue","onInput"])),createElementVNode("div",_hoisted_5,[createVNode(i,{icon:"fa-sync",value:"Filtrar"})])])],512),[[vShow,o.show]])],64)):createCommentVNode("v-if",!0),l.readonly?(openBlock(),createElementBlock(Fragment,{key:2},[createTextVNode(toDisplayString(l.label?l.label:"---"),1)],64)):createCommentVNode("v-if",!0)])}script$5.render=render$4,script$5.__file="src/v-select.vue";var script$4={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$2=["value","data-value"],_hoisted_2$2=["onClick"];function render$3(e,t,l,a,o,r){return openBlock(),createElementBlock("div",{value:!1===l.value?"false":l.value,"data-value":""+l.value},[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.options,(e=>(openBlock(),createElementBlock("div",{onClick:t=>r.onChange(e),style:normalizeStyle("cursor:pointer;border: 1px solid #000;text-align:center;display:inline-block;width:calc(50% - 2px)"+(e===o.selected?"":";opacity: 0.5")),class:normalizeClass({"v-selected":e==o.selected})},toDisplayString(e),15,_hoisted_2$2)))),256))],8,_hoisted_1$2)}script$4.render=render$3,script$4.__file="src/v-switch.vue";var script$3={name:"VTable",setup(e,t){const l=ref(1),a=ref(0),o=ref([]),r=ref([]),n=ref(null),s=ref(1),i=computed((()=>{const t=e,l=r.value;let a,o;return l.sum=sum,l.filter((e=>{for(var l in t.filters)if(a=t.filters[l],"function"==typeof a){if(!a(e))return 0}else if(a&&"string"==typeof a&&l in e&&(o=e[l],"string"==typeof o&&(o=o.toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""),!o.includes(a.toUpperCase()))))return 0;return 1}))})),d=computed((()=>{let e=i.value;return e=n?e.sort(((e,t)=>{t=(t=t[n])||0,e=e[n];const l=Number(e);return l&&(e=l),e<t?-1*s:e>t?1*s:0})):e,e.sum=sum,e})),c=[],u=ref(1),p=ref(0),{slots:h,expose:m,emit:v}=t,g=async()=>{var t,l=e.store;null!=l&&(db&&(t=await getStoredList(l)),t||(t=[]),r.value=r.value?t.concat(r.value):t);return data_},f=(e,t,a)=>{var n;if(-10===t)if(i.value.length===o.value.length)o.value=[];else for(o.value=[],n=0;n<i.value.length;n++)o.value.push(n);else a?l.value||!o.value.contains(t)?o.value=[t]:(o.value=[],e=null):this.selected.contains(t)?(o.value.splice(o.value.indexOf(t),1),e=null):o.value.push(t);var s=[],d=o.value.sort(((e,t)=>e-t));for(t=0;d.length>t;t++)s.push(r.value[d[t]]);v("row-select",{target:this,current:e,selection:s})},y=(t,l)=>{const a=[];return e.selectable&&(e=>o.value.includes(e))(t)&&a.push("v-selected"),e.rowStyleClassFunc&&a.push(e.rowStyleClassFunc(l)),a};let $=""+e.selectable;l.value="false"!=$&&"0"!=$?1:0,$=""+e.scrollable,a.value=e.scrollable&&"false"!=$&&"0"!=$?1:0;const b=h.default({row:{}});b&&b.forEach(((e,t)=>{const l=e.props;e.children&&e.children.filter&&(e.children.filter((e=>"v-filter"==e.type)).forEach((t=>{l.filter=t,p.value=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.type)).forEach((t=>{l.footer=t,e.children.shift()}))),c.push({filter:l.filter,header:l.header,width:l.width})}));return m({load:()=>{const t=e;if(o.value=[],t.value&&(r.value=t.value),t.src){var l=t.src;if(!l)return;l.endsWith("/")&&(l=l.slice(0,l.length-1));const e=t.pagination;if(e&&(l+="/"+(u.value-1)*e+"/"+e),networkStatus.connected){var a;if(t.gql){const l=t.gql,o="query{"+Object.keys(l)[0]+"(offset:"+(u.value-1)*e+" limit:"+e+"){\ndata{"+l[Object.keys(l)[0]]+"}\nsize\n}\n}";a=axios$2.post(t.src,{query:o})}else a=axios$2.get(l,{params:clean(t.filters)});a.then((l=>{if(l.data&&l.data.error)MsgBox(l.data.error);else{var a=l.data;t.gql&&(a=l.data.data[Object.keys(t.gql)[0]]),r.value=a.data||a,a&&a.hasOwnProperty("size")&&e&&(t.pages=Math.ceil(a.size/e),u.value>t.pages&&(u.value=1),t.size=a.size),g(),v("loaded",{target:t}),v("row-select",{}),t.remoteLoaded=1,t.loaded=1,t.kc++}})).catch(t.error)}else{r.value=[];const e=g();e.then&&e.then((e=>{r.value=e})),v("row-select",{target:t})}}else r.value=[],g().then((()=>v("loaded",{target:t})));t.kc++,t.loaded=1}}),()=>{const t=h$1("div",{className:"v-datatable-scrollable-header-box",style:"position: absolute; height: 47px; left: 0px;"},h$1("table",{className:"v-cloned-header v-table",style:"width: 1536px;"},[h$1("th",{width:42},[h$1("span",{className:"v-check"},h$1("i",{className:"fa fa-lg"}))]),c.map((e=>h$1("th",e,[e.header,e.filter?.children])))]));return h$1("div",{className:"v-datatable"},[h$1("div",{className:"v-datatable-header v-widget-header ui-corner-top"},h.header()),h$1("div",{className:"v-paginator v-paginator-top v-widget-header v-paginator-pages center"},[h$1(script$n,{value:"|<"}),h$1(script$n,{value:"<"}),h$1("input",{type:"number",style:"width:60px"}),h$1(script$n,{value:">"}),h$1(script$n,{value:">|"})]),h$1("div",{className:"v-widget-header v-datatable-scrollable-header",style:"position: relative; height: 110px; margin-right: 0px;"},t),h$1("div",{className:"v-datatable-scrollable-body",style:"overflow-y: auto; flex:1",onScroll(e){const l=e.currentTarget.scrollLeft;t.el.style.left="-"+l+"px"}},[h$1("table",{className:"v-table",style:"width: 1536px;"},[h$1("thead",{className:"v-head-cloned"},[h$1("th",{width:42}),...c.map((e=>h$1("th",{width:e.width})))]),h$1("tbody",{className:"v-datatable-data"},d.value.length<1?h$1("td",{colspan:c.length+(l.value?1:0)},e.emptyMessage):[d.value.map(((e,t)=>{const a=h.default({row:e});return a.forEach(((e,t)=>{delete e.props.header,delete e.props.width,e.children&&(e.children.filter((e=>"v-filter"==e.type)).forEach((t=>{p.value=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.type)).forEach((t=>{e.children.shift()})))})),h$1("tr",{className:y(t,e),onclick(a){((e,t,a)=>{l.value&&0==whichChild(e.target)||f(t,a,1)})(a,e,t)}},[h$1("td",{width:24}),...a])}))])])])])}},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,pagination:null,selectable:{default:!0},scrollable:null,autoload:{default:!0}},data:()=>({pages:1,resizeAfterUpddate:0,active:0,kc:1,keyBody:1,columns:null,row:{},hasFilters:0,kt:0,size:null,sortKey:"",paginatio_:0,remoteLoaded:null,loaded:!1,sortOrders:{},rowStyleClassFunc:null}),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 l=t.$target.k;e.kt!=l&&(e.load(),e.kt=l)})),e.active&&e.buildColumns(),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),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"),l=e.$el.querySelectorAll(".v-datatable-scrollable-header-box")[0];if(l){var a=e.$el.querySelectorAll(".v-cloned-header");if(0===a.length){a=document.createElement("table");var o=t[0].querySelectorAll("thead")[0],r=0,n=0,s=document.createElement("canvas"),i=window.getComputedStyle(l),d=s.getContext("2d");d.font=i.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(i.lineHeight),ctx:d});r=0;if(u.forEach(((t,l)=>{t.childNodes[0].onclick=v;var a=e.columns[l-(selectable0.value?1:0)];if(a&&a.filter&&a.filter.elm)if(a.filter.elm.children.forEach)a.filter.elm.children.forEach((e=>t.appendChild(e)));else for(let e of a.filter.elm.children)t.appendChild(e);else if(l>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 s=t.childNodes[0].offsetHeight;s=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",s>n&&(n=s)})),u.forEach(((e,t)=>{t&&(e.childNodes[0].style.height=n+"px"),a.appendChild(e)})),u.forEach(((e,t)=>{var l=document.createElement("th");l.width=e.width,o.childNodes[0].appendChild(l)})),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 a=e.currentTarget.scrollLeft;l.style.left="-"+a+"px",t[0].style.left="-"+a+"px"}));var m=t[1].querySelectorAll("td");for(p=0;p<u.length;p++)m[p]&&(m[p].style.width=u[p].width+"px")}else t[0].parentElement.addEventListener("scroll",(e=>{var t=e.currentTarget.scrollLeft;l.style.left="-"+t+"px"}));a.style.width=r+"px";var v=t=>{var l=e.columns[t.target.parentNode.getAttribute("ind")].sort;l==e.sorter&&(e.sortDir=-1*e.sortDir),e.sorter=l};a.className="v-cloned-header v-table",l.appendChild(a),l.appendChild(l.firstChild),l.style.position="absolute",l.style.height=n+37-37+"px",l.parentElement.style.height=l.style.height,e.$el.style.maxHeight&&(l.parentElement.nextElementSibling.style.maxHeight=parseInt(e.$el.style.maxHeight)-n+"px"),o.className="v-head-cloned"}}var g=e.$el.querySelectorAll(".v-check > svg");for(p=0;p<g.length;p++)g[p].dataset.icon=g[p].parentNode.dataset.icon;if(e.loaded){for(var f=e.$el.querySelectorAll(".group"),y=0;y<f.length;y++)f[y].parentNode.removeChild(f[y]);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(){emit("updated",t)}),100)}},methods:{buildColumns(){},resize(e){var t=this.$el;setTimeout((()=>{var l=t.querySelector(".v-datatable-header");l&&(e-=l.offsetHeight),(l=t.querySelector(".v-paginator"))&&(e-=l.offsetHeight),(l=t.querySelector(".v-datatable-scrollable-header"))&&(l.style.height=l.querySelector("table").offsetHeight+"px",e-=l.offsetHeight),(l=t.querySelector(".v-table-summary"))&&(e-=l.offsetHeight);const a=(l=t.querySelector(".v-datatable-scrollable-body")).offsetWidth-l.clientWidth;l.style.overflowY="auto",l.style.height=e+"px",(l=t.querySelector(".v-datatable-scrollable-header-box"))&&(l.parentNode.style.marginRight=a+"px"),(l=t.querySelector(".v-table-summary"))&&(l.style.overflowY="hidden",l.style.marginRight=a+"px")}),100)},to(e,t){this.loadP(e,t)},loadP(e,t){var l=this;(l.page!=e||t)&&(l.page=e,l.load())},rowCreated(){},hasSlot(e){return!!this.$slots[e]},sortBy(){},rowSelect(e,t,l){var a,o=this;if(-10===t)if(filteredData.value.length===o.selected.length)o.selected=[];else for(o.selected=[],a=0;a<filteredData.value.length;a++)o.selected.push(a);else l?selectable0.value||!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]]);emit("row-select",{target:o,current:e,selection:r})},async getStoredList(e){let t=new Promise((t=>{console.log(db);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$2={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 a=new Event("tabChange",{bubbles:!1});a.$target=t,l.dispatchEvent(a),t.$el.style.height=t.height+"px",(a=new Event("parentResize",{bubbles:!1})).height=t.$el.offsetHeight-25,l.style.height=a.height+"px",setTimeout((()=>{l.dispatchEvent(a)}),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 a=new Event("parentResize",{bubbles:!1});a.height=e.$el.offsetHeight-25,a.target=e.$el,a.$target=e;for(var o=1;o<t.length;o++)"none"!=t[o].style.display&&(console.log("Se envia el alto "+a.height),t[o].style.height=a.height+"px",t[o].dispatchEvent(a));e.$emit("resize",a)})),t[1+e.currentTabIndex].setAttribute("active",1);var a=new Event("tabChange",{bubbles:!1});a.$target=e,t[1+e.currentTabIndex].dispatchEvent(a)}};const _hoisted_1$1={class:"v-tab-nav"},_hoisted_2$1=["onClick"];function render$2(e,t,l,a,o,r){return openBlock(),createElementBlock("div",{class:"v-tabview",style:normalizeStyle({height:o.height+"px"})},[createElementVNode("ul",_hoisted_1$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.tabs,((e,t)=>(openBlock(),createElementBlock("li",{class:normalizeClass({"v-selected":t==o.currentTabIndex}),key:t,onClick:e=>o.currentTabIndex=t},toDisplayString(e.title),11,_hoisted_2$1)))),128))]),renderSlot(e.$slots,"default")],4)}script$2.render=render$2,script$2.__file="src/v-tabview.vue";var script$1={name:"VTextarea",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,l=e.$el;(t=window.attachEvent?function(e,t,l){e.attachEvent("on"+t,l)}:function(e,t,l){e.addEventListener(t,l,!1)})(l,"change",e.resize),t(l,"cut",e.delayedResize),t(l,"paste",e.delayedResize),t(l,"drop",e.delayedResize),t(l,"keydown",e.delayedResize)}};function render$1(e,t,l,a,o,r){return openBlock(),createElementBlock("textarea",null,toDisplayString(l.value),1)}script$1.render=render$1,script$1.__file="src/v-textarea.vue";var script={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,a=new FormData;t=t||e.name.replace(/[^\w\s.]/gi,""),a.append("filename",t),a.append("file",e,t),l.showProgress=!0,axios.post((l.domain?l.domain:"")+"/api/file/upload",a,{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={style:{cursor:"pointer"},class:""},_hoisted_2=["data-icon"],_hoisted_3=[".value"];function render(e,t,l,a,o,r){return openBlock(),createElementBlock("div",{onClick:t[1]||(t[1]=(...e)=>r.other&&r.other(...e)),class:normalizeClass([l.onlyicon?"":"v-button ui-widget ui-state-default ui-corner-all","v-uploader"]),style:normalizeStyle({padding:l.onlyicon?"0px":""})},[createElementVNode("label",_hoisted_1,[l.click?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("input",{key:0,type:"file",onChange:t[0]||(t[0]=e=>r.handleFileUpload())},null,32)),createElementVNode("i",{class:normalizeClass(["fa",l.icon?l.icon:"fa-upload"]),"data-icon":l.icon,style:normalizeStyle({marginRight:l.onlyicon||""==l.value?"":"10px"})},null,14,_hoisted_2),createTextVNode(toDisplayString(l.onlyicon?"":null!=l.value?l.value:"Adjuntar Archivo")+" ",1),o.showProgress?(openBlock(),createElementBlock("progress",{key:1,max:"100",style:{width:"100%"},".value":o.uploadPercentage},null,40,_hoisted_3)):createCommentVNode("v-if",!0)])],6)}script.render=render,script.__file="src/v-uploader.vue";var components={InputTextarea:script$p,InputText:script$q,VAutocomplete:script$o,VButton:script$n,VCalendar:script$m,VCheckboxGroup:script$l,VCheckbox:script$k,VDataview:script$j,VFieldset:script$i,VForm:script$h,VGroup:script$g,VLayerControl:script$f,VMapControl:script$e,VMap:script$d,VNumber:script$c,VOptions:script$b,VOverlay:script$a,VPanel:script$9,VPopup:script$8,VRadioGroup:script$6,VRadio:script$7,VSelect:script$5,VSwitch:script$4,VTable:script$3,VTabview:script$2,VTextarea:script$1,VUploader:script};const bindLinks=(e,t)=>{var l=void 0;if((e=e||l.$el).querySelectorAll)for(var a=e.querySelectorAll("a:not(._),ion-item:not(._)"),o=function(e){e.preventDefault()},r=function(e){e.preventDefault(),t&&t(),l.open(e)},n=0;n<a.length;n++)a[n].attributes.href?a[n].onclick=r:a[n].onclick=o,a[n].classList?a[n].classList.add("_"):a[n].className="_"},IsobitUI={install(e){setApp(e),e.BUILT_ON=import.meta.env.VITE_APP_BUILT_ON,e.bindLinks=bindLinks,configureAxios(axios$2);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 ui=cfg=>{const defs={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(!_$2._session){var e=localStorage.getItem("session");e=e?JSON.parse(e):{},_$2._session=e}return _$2._session},set(e){e?(Array.isArray(e.perms)&&(e.perms=e.perms.reduce(((e,t)=>(e[t]=!0,e)),{})),localStorage.setItem("session",JSON.stringify(e))):localStorage.removeItem("session"),_$2._session=e}},online(){return this.app2&&this.app2.networkStatus?.connected},cleanedFilters(){return clean(this.filters)},app:()=>_$2.app,user:()=>_$2.app.session,perms(){return this.session.perms||this.session.allcaps||{}},rowSelectedCount:()=>1,baseURL:()=>axios$2.defaults.baseURL},data(){return{app2:null,filters:{},ui:this,_session:null,x_connected_:null,row:{},networkStatus:{connected:null}}},created(){let e=this;_$2.app2||(_$2.app2=e,console.log("app created",_$2.app2)),e.app2=_$2.app2},methods:{pad:pad,resize(){},vv(e){var t=this;Network.getStatus().then((function(l){if(l.connected){var a=localStorage.getItem("session");if(a){try{a=JSON.parse(a)}catch(e){a={}}a.connected=e,localStorage.setItem("session",JSON.stringify(a))}}else t.toast("El dispositivo no tiene acceso a internet!"),t.connected=l.connected}))},getSelected(e){for(var t=e&&e.$vnode?e:this.$children[0].$children[0],l=[],a=0;a<t.selected.length;a++)l.push(t.data[t.selected[a]]);return l},getRowSelectedCount(){var e=this.$children[0].$children[0];return e?e.selected.length:0},rewrite:e=>e,edit(e){var t=this,l=t.$children[0].action,a=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];l||(l=window.location.pathname),a&&a.src&&(l=a.src),e.action&&(l=e.action),a||(a=e.$vnode||e.target&&e.target.$vnode?e:t.$children[0].$children[0]).src&&(l=a.src),l&&(l=t.rewrite(l.replace("/api","").replace("/0/0","")));var o=t.getSelected(a)[0],r=o[a.rowKey];o.tmpId&&(r=-o.tmpId),t.getSelectedId&&(r=t.getSelectedId(o)),_$2.app?t.open(l+"/"+r+"/edit"):axios$2.get((_$2.currentPath=(l+"/"+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 l=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];l||(l=e.$vnode?e:t.$children[0].$children[0]);var a=e.$vnode?e.load:null,o=l.$attrs.rowkey;o||(o=l.rowKey);var r=l.data[l.selected[0]];if(l.data,r.tmpId)t.MsgBox("Esta seguro que desea eliminar los registros temporales seleccionados ?",(function(e){if(0==e){for(var o=0,n=_$2.db.transaction([l.store],"readwrite").objectStore(l.store),s=[],i=l.selected.length-1;i>=0;i--)r=l.data[l.selected[i]],s.push(r),r.tmpId&&n.delete(r.tmpId),o++,l.data.splice(l.selected[i],1);o&&(t.app&&t.app.toast?t.app.toast(o+" registros eliminados"):t.MsgBox(o+" registros eliminados")),l.rowSelect(null,-1),l.selected=[],t.$emit("destroyed",s,l.store),a&&a()}}),["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 a=l.src.replace("/0/0",""),o=[],s=l.selected.length-1;axios$2.delete(a+"/"+n,{params:l.filters}).then((()=>{for(;s>=0;s--)r=l.data[l.selected[s]],o.push(r),l.data.splice(l.selected[s],1);t.app&&t.app.toast?t.app.toast(o.length+" registros eliminados"):t.MsgBox(o.length+" registros eliminados"),l.rowSelect(null,-1),l.selected=[]})).catch(t.error)}}),["SI","NO"])}},apiLink:e=>e.replace(_$2.contextPath,_$2.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("me.$route=",me.$router,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:{};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:_$2.currentPath=path+("string"==typeof o?"/"+o:"")};return"function"==typeof o?cfg.result=o:"object"==typeof o&&(cfg=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)}}var dialog,nid=Vue.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",_$2.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.resize()};if(for_&&for_.classList.contains("panel")){if(for_.id)window.currentEl="#"+for_.id;else{var clsId="cls-id-"+Vue.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"),l=dialog.querySelector(".v-panel-titlebar"),a=window.innerHeight-94-(l?l.clientHeight:0);(t||dialog).style.height=a+"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=_$2.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=_$2.varMap[children.getAttribute("vueid")],tb.onclick=e=>{e.preventDefault();var t=[],l=vue.$children[0].$children[0];for(i=0;i<l.selected.length;i++)t.push(l.filteredData[l.selected[i]]);path.result(t),delete path.result,vue.close(e)},f.appendChild(tb)}resize()}_$2.storeFunction["PROPS="+nid]=path,_$2.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.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=_$2.closest(event.target,".v-dialog"))}catch(e){console.log(e)}t||(t=this.$el.parentElement);var l=t.parentElement;if(l||!_$2.app.$router){t.style.display="none",(" "+l.className+" ").indexOf(" v-overlay ")>-1?l.style.display="none":l=null,Vue.resize();var a=_$2.storeFunction[t.getAttribute("callback")];a&&a(e),t.parentNode.removeChild(t),l&&l.parentNode.removeChild(l),document.documentElement.style.overflow="auto",document.body.scroll="yes"}else _$2.app.$router.back()},create(){const e=this,t=e.$el.__vnode.ctx.exposed;console.log(t);var l=t.action;l||(l=window.location.pathname),l&&(l=l.replace("/api","")),app()?e.open(l+"/create"):instance.get(_$2.currentPath=(l+"/create").replace(/([^:]\/)\/+/g,"$1")+"?modal").then(_$2.open).catch(e.error)},refresh(){const e=this.$el.__vnode;console.log(e.children[1].children[0]);e.children[1].children[0].children[0].component.exposed.load()},async sync(e){var t=this,l=t.$el.querySelector("form").getAttribute("action");if(!l){var a=(l=t.$el.parentNode.getAttribute("path")).split("/");a="edit"==a[a.length-1]?a.splice(0,a.length-2):a.splice(0,a.length-1),l=t.apiLink(a.join("/"))}var o=t.$children[0].$children[0];l=o.src;for(var r=await t.getStoredList(o.store),n=o.selected,s=[],i=[],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,i.push(p),s.push(u)}}s.length>0&&axios$2.post(l+"/bulk"+(e.sufix?e.sufix:""),i).then((function(e){let l=e.data;for(let e=0;e<l.length;e++){if(l[e].errors){t.MsgBox(JSON.stringify(l[e].errors));break}if(l[e].error){t.MsgBox(l[e].error);break}for(var a=0;a<r.length;a++)(l[e].ext&&l[e].ext.tmpId==r[a].tmpId||l[e].tmpId==r[a].tmpId)&&(console.log("ok"),l[e].ext&&r.ext&&(r[a].ext.error=l[e].ext.error),l[e].id&&(r[a].id=l[e].id),r[a].synchronized=1,t.$emit("sync",l[e],r[a]))}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();let t=e.$el.querySelector("form");if(this.validate(t)){let s=t.getAttribute("action");if(!s&&(s=e.$el.parentNode.getAttribute("path"),s)){let t=s.split("/");t="edit"==t[t.length-1]?t.splice(0,t.length-2):t.splice(0,t.length-1),s=e.apiLink(t.join("/"))}let i=e.$data.data?e.$data.data:e.$data.o;var l=JSON.parse(JSON.stringify(i));if(e.process&&(l=e.process(l)),"object"!=typeof l||Array.isArray(l)||null===l)return;if(s&&e.app2.connected)axios$2.post(s,l).then((t=>{var a=t.data;if(l.tmpId){alert(12);var o=e.$children[0].store,r=window._.db.transaction([o],"readwrite").objectStore(o),n=r.get(l.tmpId);a.id&&(l.id=a.id,i.id=l.id),n.onsuccess=function(){i.synchronized=1,l.synchronized=1,(n.result?r.put(l):r.add(l)).onerror=e=>{console.error(e)},e.$emit("sync",a,l)},n.onerror=function(){e.MsgBox("Error getting temporal record "+l.tmpId)}}e.app&&e.app.toast?e.app.toast("El registro fue grabado exitosamente!",(()=>{e.close({success:!0,data:a})})):MsgBox$1("El registro fue grabado exitosamente!",(()=>{e.close({success:!0,data:a})}))})).catch((function(l){var a,o;if(l.response)if("string"==typeof l.response.data)e.MsgBox(l.response.data);else{a=l.response.data.propertyViolations;for(var r=0;r<a.length;r++){var n=a[r];(o=t.querySelector("[name="+n.path+"]"))&&e.showerror(o,n.message)}for(a=l.response.data.fieldViolations,r=0;r<a.length;r++)n=a[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 s=await e.getStoredList(t);if(s||(s=[]),l.id)for(var a=0;a<s.length;a++)s[a].tmpId==l.tmpId&&(delete l.synchronized,s[a]=l);var o=_$2.db.transaction([t],"readwrite").objectStore(t);if(l.id){delete l.synchronized;var r=o.get(l.tmpId);r.onsuccess=function(){r.result?o.put(l):s.forEach((e=>{e.tmpId==l.tmpId&&o.put(l)})),e.$emit("stored",l,s,o),e.$ionic&&e.app.toast("El registro fue grabado exitosamente!"),e.close({success:!0,data:l})},r.onerror=function(){e.MsgBox("Error getting temporal record "+l.tmpId)}}else{l.tmpId=1*new Date,l.id=-l.tmpId;var n=o.add(l);n.onsuccess=t=>{s.unshift(l),e.$emit("stored",l,s,o),e.app&&e.app.toast&&e.app.toast("El registro fue grabado exitosamente!"),i.tmpId=l.tmpId,i.id=l.id,e.close({success:!0,data:l})},n.onerror=t=>{e.app&&e.app.toast&&e.app.toast("Error!")}}}}else MsgBox$1("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,l){"string"==typeof t&&(t={body:t});var a="string"==typeof l?{fileName:l}:l;a||(a={}),(""+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])),l=document.createElement("a");if(l.href=t,!a.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]&&(a.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",a.fileName),document.body.appendChild(l),l.click()}))},savePost(){},validate(e){const t=this;var l=!0;const a=[];e=e&&0!=e?e:t.$el;var o,r=e?.querySelectorAll("input,select,textarea,div[required=required]"),n={};for(h=0;r?.length>h;h++){var s=r[h];if("radio"!==s.type){if(s.error&&(s.error.style.display="none"),!s.disabled&&!s.getAttribute("disabled")&&(s.required||"DIV"===s.tagName)&&("DIV"!=s.tagName&&!s.value||"DIV"===s.tagName&&!s.attributes.value)){for(o=s.previousElementSibling;o&&1!=o.nodeType;)o=o.previousElementSibling;if(!o)for(o=s.parentElement.previousElementSibling;o&&1!=o.nodeType;)o=o.previousElementSibling;a.push(s)}}else{var i=n[s.name];i||(n[s.name]=i=[]),i.push(s)}}for(var d in console.log("valid radios"),n)if(Object.prototype.hasOwnProperty.call(n,d)){for(var c=n[d],u=!1,p=!1,h=0;h<c.length;h++)c[h].required&&!c[h].disabled&&(p=!0),c[h].checked&&(u=!0);(o=(s=c[0].parentNode.parentNode).previousElementSibling)&&o.classList&&o.classList.contains("v-error")&&o.parentNode.removeChild(o),p&&!u&&(t.showerror(s),l=!1)}console.log("ok="+l);for(const e of a)if(e.error)e.error.style.display="unset";else{const t=document.createElement("div");t.innerHTML="Este campo es requerido!",t.classList.add("v-error"),e.error=t,e.parentNode.insertBefore(t,e.nextSibling)}return!a.length}}};cfg||(cfg={data:{o:{}}});const{setup:setup,...other}=cfg;return cfg={mixins:[defs,other],setup:setup},cfg};export{IsobitUI,_$2 as _,app,date,db,getStoredList,initDB,pad,resize,ui};
1
+ import{openBlock,createElementBlock,ref,watch,onMounted,onBeforeUnmount,computed,normalizeStyle,renderSlot,createTextVNode,toDisplayString,createCommentVNode,withDirectives,withKeys,withModifiers,normalizeClass,vModelText,createVNode,Transition,withCtx,createElementVNode,Fragment,renderList,vShow,pushScopeId,popScopeId,h as h$1,onUpdated,inject,onUnmounted,getCurrentInstance,createBlock,provide,resolveComponent}from"vue";import axios$2 from"axios";import{unByKey}from"ol/Observable";import _imports_0 from"@/cdn/images/triangle-down.svg";var script$q={name:"InputText"};const _hoisted_1$g={type:"text"};function render$m(e,t,l,a,o,r){return openBlock(),createElementBlock("input",_hoisted_1$g)}script$q.render=render$m,script$q.__file="src/InputText.vue";var script$p={name:"InputTextarea"};function render$l(e,t,l,a,o,r){return" text "}script$p.render=render$l,script$p.__file="src/InputTextarea.vue";const _$2={stores:[],_id:0,axios_get:null,storeFunction:{},id:()=>_$2._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.split("T");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,a=document.createElement("div");a.className="abc",a.style="top:50%;transform:translate(-50%,-50%);position:absolute;width:100%;z-index:2; display: flex;justify-content: center;";let o=a.style;if(o.left="50%",o.textAlign="center",!1!==e)if(e instanceof Element)a=e;else{if(e){let t=document.createElement("div");t.innerHTML=e,a.append(t),a.style="padding:4px;margin-bottom:5px;color:white;font-size:24px;text-align:center"}l=document.createElement("div"),o=l.style,l.className="loading"}let r=document.createElement("div");o=r.style,o.height="100%",o.top="0px",o.position="absolute",o.left="0",o.zIndex=1e4,o.width="100%";let n=document.createElement("div");return o=n.style,o.height="100%",o.width="100%",o.top="0",o.position="absolute",o.left="0",o.backgroundColor="rgba(0,0,0,0.5)",t&&t.opacity&&(o.opacity=t.opacity),t&&t.backgroundColor&&(o.backgroundColor=t.backgroundColor),r.appendChild(n),r.appendChild(a),l&&a.appendChild(l),document.body.appendChild(r),r},unmask=e=>{e&&(e.style.display="none",e.parentNode&&e.parentNode.removeChild(e))},isObject=e=>e&&"object"==typeof e&&!Array.isArray(e),mergeDeep$1=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,a=t.shift();if(isObject(e)&&isObject(a))for(let t in a)isObject(a[t])?(e[t]||(l={},l[t]={},Object.assign(e,l)),mergeDeep$1(e[t],a[t])):(l={},l[t]=a[t],Object.assign(e,l));let o=[];return o.push(e),o.concat(t),mergeDeep$1.apply(null,o)},buildPopupMenu=e=>{let t=e.getAttribute("v--popup");if(!t){e.setAttribute("v--popup",t=_$2.id());let l=_$2.storeFunction[t],a=e.querySelectorAll(".v-datatable-header .v-button");a&&a.length&&!l&&window.innerWidth<=700&&setTimeout((function(){l=document.createElement("ul"),l.className="v-popup-2",e.appendChild(l);let o=null;const r=e=>{l.style.display="none";let t=e.target.getAttribute("commandId"),a=document.querySelector("#"+t);"BUTTON"==a.tagName?a.click():a.children[0].click(),unmask(o)};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(a=e.querySelectorAll(".v-datatable-header .v-button");l.firstChild;)l.removeChild(l.firstChild);for(s=0;s<a.length;s++)if("none"!=a[s].style.display){let e=document.createElement("li");if(a[s].id||(a[s].id="c-"+_$2.id()),e.setAttribute("commandId",a[s].id),"BUTTON"==a[s].tagName){if(a[s].disabled)continue;e.appendChild(a[s].children[0].cloneNode(!0)),e.appendChild(document.createTextNode(a[s].value?a[s].value:a[s].title))}else a[s].children[0].children[1]&&(e.appendChild(a[s].children[0].children[1]),e.appendChild(document.createTextNode(a[s].textContent)));e.onclick=r,l.appendChild(e)}o=mask(l),l.style.display="block",o.onclick=()=>{l.style.display="none",unmask(o)}},e.appendChild(n),_$2.storeFunction[t]=l}),500)}},resize=()=>{let e=window.innerHeight;document.body.children[0].style.height=e+".px";let t=document.querySelectorAll("#page-header,.ui-layout-north,.v-layout-north,.ion-page >ion-header");t=t[0];const l=document.querySelectorAll("#app > .ui-panel > .v-dialog-content > form > .v-datatable");if(l&&l[0])buildPopupMenu(l[0]);else{let e=document.querySelectorAll(".ion-page");if(e[0]){let t=0;for(let l=0;l<e[0].childNodes.length;l++)"ION-HEADER"!=e[0].childNodes[l].nodeName&&"ION-FOOTER"!=e[0].childNodes[l].nodeName||(t+=e[0].childNodes[l].offsetHeight);let l=0;for(kk=0;kk<e[0].childNodes.length;kk++){let a=e[0].childNodes[kk];if("ION-HEADER"==a.nodeName&&(l=1),1==l&&"ION-HEADER"!=a.nodeName&&"ION-FOOTER"!=a.nodeName&&a.style){a.style.height=e[0].offsetHeight-t+"px",a.style.overflowY="auto";break}}}else console.log(12)}},MsgBox$1=(e,t,l)=>{if(l||(l=["OK"]),!document.body)return;let a=document.createElement("div");a.classList.add("v-overlay"),a.style.padding="40px",a.style.zIndex="2000",document.body.appendChild(a);let o=document.createElement("div"),r=document.createElement("div"),n=document.createElement("div"),s=document.createElement("div");s.className="v-msgbox-buttons",o.classList.add("v-dialog"),o.classList.add("v-msgbox"),n.innerHTML=e,o.setAttribute("path",_$2.currentPath);let i=function(){o.style.display="none",a.style.display="none",o.parentNode.removeChild(o),a.parentNode.removeChild(a),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)}r.className="v-dialog-content v-widget-content",r.appendChild(n),r.appendChild(s),o.appendChild(r),a.appendChild(o),a.style.visibility="unset",a.style.opacity="unset",a.style.overflow="auto",o.style.margin="0 auto",o.style.position="unset",resize()},configureAxios=e=>{let t;_$2.axios_get=e.get,e.interceptors.request.use((function(e){return _$2.eeee=e,e.mask?e.mask():t||(t=mask()),e}),(function(e){return t=unmask(t),MsgBox$1("request "+_$2.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,a=e&&e.data&&e.data.msg?e.data.msg:l.message;if(e&&(e.data&&e.data.message&&(a=e.data.message),"string"==typeof e.data&&(a=e.data),a||(a=e.status+": "+e.statusText)),t=unmask(t),e&&401==e.status&&_$2.app)return _$2.app.toast("Session terminada"),void _$2.app.logout();l.config?.error?l.config.error(l,a):(console.log(l),l.request?MsgBox$1("<b>"+l.request.responseURL+"</b><br/><br/>"+a):MsgBox$1(a))}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=>{for(let t in e)""!==e[t]&&null!==e[t]&&"function"!=typeof e[t]&&void 0!==e[t]||delete e[t];return e},sum=e=>(void 0).reduce(((t,l)=>t+((l=e?l[e]:l)?Number(l):0)),0);function createGetters(){return{get networkStatus(){return _$2.app?.networkStatus||{connected:!0}},get db(){return _$2.app?.db},app:()=>(console.log("get.app="+_$2.app),_$2.app),setApp(e){_$2.app=e,console.log("setApp="+_$2.app)}}}const app=()=>_$2.app,db=()=>_$2.db,initDB=(e,t)=>{let l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;if(_$2.IDBTransaction=window.IDBTransaction||window.webkitIDBTransaction||window.msIDBTransaction,_$2.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange||window.msIDBKeyRange,l){if(l)return _$2.stores=t,new Promise(((a,o)=>{let r=l.open("db",e);r.onupgradeneeded=e=>{let l=e.target.result;t.forEach((e=>{l.objectStoreNames.contains(e[0])||l.createObjectStore(e[0],e[1])}))},r.onerror=e=>{o(e)},r.onsuccess=()=>{_$2.db=r.result,a(_$2.db)}}))}else window.alert("Your browser doesn't support a stable version of IndexedDB.");return l},getStoredList=async(e,t)=>{let l;try{l=JSON.parse(sessionStorage.getItem("loadedStores"))}catch(e){}null==l&&(l={});const a=db();if(!l[e]&&networkStatus.connected){let t=_$2.stores.filter((t=>t[0]==e))[0];if(!t)throw"store '"+e+"' undefined";if(!t[2])throw"store url for '"+e+"' is empty";let o=t[2]?await _$2.axios_get(t[2]):[];const r=a.transaction([t[0]],"readwrite").objectStore(t[0]);await r.clear(),o=o.data||o;for(let e in o)try{await r.add(o[e])}catch(e){throw e}l[e]=1,sessionStorage.setItem("loadedStores",JSON.stringify(l))}let o=new Promise(((t,l)=>{if(a){let l=a.transaction(e).objectStore(e).getAll();l.onsuccess=function(){t(l.result)}}else l("db is null")}));return await o},getters=createGetters(),{networkStatus:networkStatus,setApp:setApp}=getters;class HTML2Canvas{props;ctx;lineHeight;constructor(e){this.props=e,this.ctx=e.ctx,this.lineHeight=e.lineHeight?e.lineHeight:20}heightText(e,t){const{ctx:l,lineHeight:a}=this;let o="",r=a;return e.split("").forEach((e=>{o+=e,l.measureText(o).width>=t-15&&(o="",r+=a)})),r+=7,r}drawText(e,t,l,a,o,r){const{ctx:n,lineHeight:s}=this;let i="",d=s+l;return n.fillStyle="#000000",e.split("").forEach((e=>{i+=e,n.measureText(i).width>=a-15&&(n.fillText(i,t,d),i="",d+=s)})),n.fillText(i,t+("right"==r?a-n.measureText(i).width:0),d),n.beginPath(),d+=7,d}}var script$o={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:a}=t,o=ref(0),r=ref(null),n=ref(-1),s=ref(""),i=ref(null),d=ref(!1),c=ref(0),u=ref("");watch((()=>e.value),(e=>{r.value=e})),watch((()=>e.data),(e=>{i.value=e})),onMounted((()=>{u.value=e.inputClass,e.autoload&&h(),document.addEventListener("click",v)})),onBeforeUnmount((()=>{document.removeEventListener("click",v)}));const p=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})),h=async t=>{const{src:a,source:r}=e;let n=Number(e.pagination);if(1===t)o.value+=n;else if(o.value=0,e.data&&e.autoload)return;let u={query:s.value};e.params&&(u=mergeDeep$1(u,e.params)),axios$2.get((a||e.source)+(n>0?"/"+o.value+"/"+n:""),{params:u}).then((l=>{const a=l.data;console.log(a),a.error?MsgBox(a.error):(i.value=1===t?i.value.concat(a.data?a.data:a):a.data?a.data:a,console.log(i),c.value=a.size,e.autoload||(d.value=!0),console.log("========================="))})).catch(m).then((()=>{l("complete",{data:i.value,query:s.value,target:"me"})}))},m=e=>{console.log(e)},v=e=>{};return{query:s,show:d,selected:r,data2:p,focused:n,inputClass:u,search:h,remove:()=>{l("input",null)},clickout:v,focusout:e=>{},setSelected:e=>{r.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")=>!!a[e]}}};const _withScopeId=e=>(pushScopeId("data-v-72884078"),e=e(),popScopeId(),e),_hoisted_1$f=["value","disabled"],_hoisted_2$a=_withScopeId((()=>createElementVNode("i",{class:"fa fa-times"},null,-1))),_hoisted_3$7=[_hoisted_2$a],_hoisted_4$5=_withScopeId((()=>createElementVNode("i",{class:"fa fa-xs fa-sync"},null,-1))),_hoisted_5$2=[_hoisted_4$5],_hoisted_6$1=["disabled","placeholder"],_hoisted_7$1={class:"v-list"},_hoisted_8=["onClick"],_hoisted_9={key:0,class:"center yellow",style:{padding:"5px"}};function render$k(e,t,l,a,o,r){return openBlock(),createElementBlock("div",{class:"v-autocomplete",onFocusout:t[7]||(t[7]=(...e)=>a.focusout&&a.focusout(...e)),value:l.value,disabled:l.disabled},[a.selected&&l.showSelection?(openBlock(),createElementBlock("div",{key:0,class:"v-selection",style:normalizeStyle({whiteSpace:l.nowrap?"nowrap":""})},[renderSlot(e.$slots,"label",{selected:a.selected}),createTextVNode(" "+toDisplayString(a.hasSlot("label")?" ":a.getLabel(a.selected))+"  ",1),l.readonly?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("span",{key:0,onClick:t[0]||(t[0]=(...e)=>a.remove&&a.remove(...e)),class:"remove-icon"},[..._hoisted_3$7]))],4)):createCommentVNode("v-if",!0),a.selected?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("span",{key:1,onClick:t[1]||(t[1]=(...e)=>a.search&&a.search(...e)),class:"search-icon"},[..._hoisted_5$2])),a.selected?createCommentVNode("v-if",!0):withDirectives((openBlock(),createElementBlock("input",{key:2,onKeyup:[t[2]||(t[2]=(...t)=>e.keyup&&e.keyup(...t)),t[3]||(t[3]=withKeys(withModifiers(((...e)=>a.search&&a.search(...e)),["stop","prevent"]),["enter"]))],class:normalizeClass(a.inputClass),onFocus:t[4]||(t[4]=e=>a.show=!0),disabled:l.disabled,placeholder:l.placeholder,"onUpdate:modelValue":t[5]||(t[5]=e=>a.query=e)},null,42,_hoisted_6$1)),[[vModelText,a.query]]),createVNode(Transition,{name:"fade",persisted:""},{default:withCtx((()=>[withDirectives(createElementVNode("div",{class:"v-resultpane",style:normalizeStyle({zIndex:2,width:"calc(100% - 2px)",position:l.floating?"absolute":"relative"})},[createElementVNode("div",_hoisted_7$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(a.data2,((t,l)=>(openBlock(),createElementBlock("div",{key:l,class:normalizeClass({"v-selected":a.selected==t,"v-focused":a.focused==l}),onClick:e=>a.setSelected(t)},[renderSlot(e.$slots,"default",{row:t})],10,_hoisted_8)))),128)),e.data0&&e.data0.length<e.total?(openBlock(),createElementBlock("div",{key:0,class:"center",onClick:t[6]||(t[6]=e=>a.search(1))},"Load more "+toDisplayString(e.total-e.data0.length)+" results...",1)):createCommentVNode("v-if",!0)]),a.data2&&a.data2.length<1?(openBlock(),createElementBlock("div",_hoisted_9,"No results found.")):createCommentVNode("v-if",!0)],4),[[vShow,a.show&&!a.selected]])])),_:3})],40,_hoisted_1$f)}script$o.render=render$k,script$o.__scopeId="data-v-72884078",script$o.__file="src/v-autocomplete.vue";var script$n={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$e={type:"button",class:"_ ui-widget ui-state-default ui-corner-all v-button"};function render$j(e,t,l,a,o,r){return openBlock(),createElementBlock("button",_hoisted_1$e)}script$n.render=render$j,script$n.__file="src/v-button.vue";var script$m={name:"VCalendar",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,l=t.toDate(e);return console.log(l),t.max&&l&&l.getTime()>=t.toDate(t.max).getTime()||t.min&&l&&l.getTime()<=t.toDate(t.min).getTime()?(t.$emit("invalid",{target:t,value:l}),l=null,void(event.target.value=l)):void("time"===t.$props.type?this.$emit("input",t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2)+":00"):l.getTime&&this.$emit("input",l.getTime()))},pad(e,t){for(var l=e+"";l.length<t;)l="0"+l;return l},toDate(e){if(e){var t,l;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=(l=e.split("T"))[1].split(":"),l=l[0].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=e.split("-");var a=parseInt(l[0]);return a<100?e:l=new Date(a,parseInt(l[1])-1,parseInt(l[2]))}return e},changeDate(){var e,t=this,l=t.toDate(t.value);l&&(e="time"===t.$props.type?t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2):"datetime-local"===t.$props.type?t.pad(l.getFullYear(),4)+"-"+t.pad(l.getMonth()+1,2)+"-"+t.pad(l.getDate(),2)+"T"+t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2):t.pad(l.getFullYear(),4)+"-"+t.pad(l.getMonth()+1,2)+"-"+t.pad(l.getDate(),2)),this.$el.children[0].value=e}},updated(){this.changeDate()},mounted(){this.changeDate()}};const _hoisted_1$d=["value"],_hoisted_2$9=["required","readonly","min","max","type"];function render$i(e,t,l,a,o,r){return openBlock(),createElementBlock("div",{value:r.toDate(l.value)},[createElementVNode("input",{required:l.required,readonly:l.readonly,min:l.min,max:l.max,onChange:t[0]||(t[0]=(...e)=>r.enterD&&r.enterD(...e)),type:l.type?l.type:"date"},null,40,_hoisted_2$9)],8,_hoisted_1$d)}script$m.render=render$i,script$m.__file="src/v-calendar.vue";var script$l={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 a=0;t&&a<t.length;a++)e[l].value==t[a]&&(e[l].checked=!0)}},onChange:function(e,t){var l=this,a=l.$attrs.value;if(("string"==typeof a||a instanceof String)&&(a=a.split("|")),t)a||(l.$attrs.value=a=[]),a.push(e);else{var o=a.indexOf(e);o>-1&&a.splice(o,1)}l.$emit("input",a)}}};function render$h(e,t,l,a,o,r){return openBlock(),createElementBlock("div",null,[renderSlot(e.$slots,"default")])}script$l.render=render$h,script$l.__file="src/v-checkbox-group.vue";var script$k={name:"VCheckbox",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 l=t.checked?e.value?e.value:t.checked:null!==e.valueFalse&&void 0!==e.valueFalse?e.valueFalse:t.checked;l&&(e.hadValue=1),console.log("nv="+l),e.$emit("input",l)}},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$c={style:{"font-weight":"normal !important",display:"block"},class:"v-checkbox"},_hoisted_2$8=["innerHTML"],_hoisted_3$6=["checked","value"],_hoisted_4$4=createElementVNode("span",{class:"checkmark"},null,-1);function render$g(e,t,l,a,o,r){return openBlock(),createElementBlock("label",_hoisted_1$c,[createElementVNode("span",{innerHTML:r.getLabel()},null,8,_hoisted_2$8),createElementVNode("input",{type:"checkbox",checked:l.value&&l.vmodel==l.value||l.vmodel,onChange:t[0]||(t[0]=(...e)=>r.change&&r.change(...e)),value:l.value},null,40,_hoisted_3$6),_hoisted_4$4])}script$k.render=render$g,script$k.__file="src/v-checkbox.vue";var script$j={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,a=t%l.columns+1,o=["c-w-"+l.columns];return a==l.columns&&o.push("v-last"),l.rowStyleClassFunc?o.push(l.rowStyleClassFunc(e,e,t)):o.push(l.rowStyleClass),o},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 a=t.value?t.value:l.data.data?l.data.data:l.data;t.data||(t.data=[]),t.data=!0===e?a:t.data?t.data.concat(a):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$b={class:"v-dataview"};function render$f(e,t,l,a,o,r){return openBlock(),createElementBlock("div",_hoisted_1$b,[e.data?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(e.data,((t,l)=>(openBlock(),createElementBlock("div",{class:normalizeClass(r.getRowClass(t,l))},[renderSlot(e.$slots,"default",{row:t,item:t,index:l})],2)))),256)):createCommentVNode("v-if",!0),e.data&&!e.data.length?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(["center v-no-results",{error:e.error}])},toDisplayString(e.error?e.error:"No existen registros para mostrar"),3)):createCommentVNode("v-if",!0),e.data&&e.size>e.data.length?(openBlock(),createElementBlock("div",{key:2,onClick:t[0]||(t[0]=t=>r.load(e.page++)),class:"center v-more-results"},"Ver mas resultados")):createCommentVNode("v-if",!0)])}script$j.render=render$f,script$j.__file="src/v-dataview.vue";var script$i={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$a={class:"v-fieldset"},_hoisted_2$7=["data-icon"],_hoisted_3$5=["innerHTML"],_hoisted_4$3={style:{flex:"1",display:"flex","flex-direction":"column"}};function render$e(e,t,l,a,o,r){return openBlock(),createElementBlock("fieldset",_hoisted_1$a,[l.legend?(openBlock(),createElementBlock("legend",{key:0,onClick:t[0]||(t[0]=e=>o.closed=l.closable&&!o.closed),style:normalizeStyle({cursor:l.closable?"pointer":""})},[l.closable?(openBlock(),createElementBlock("span",{key:0,"data-icon":o.closed?"plus":"minus",style:{margin:"0px 5px 0px 0px"}},[createElementVNode("i",{class:normalizeClass([o.closed?"fa-plus":"fa-minus","fa"])},null,2)],8,_hoisted_2$7)):createCommentVNode("v-if",!0),createElementVNode("span",{innerHTML:l.legend},null,8,_hoisted_3$5)],4)):createCommentVNode("v-if",!0),withDirectives(createElementVNode("div",_hoisted_4$3,[renderSlot(e.$slots,"default")],512),[[vShow,!o.closed]])])}script$i.render=render$e,script$i.__file="src/v-fieldset.vue";var script$h={name:"VForm",props:["header","store","action"],setup(e,t){const{slots:l,expose:a}=t;return a({abc:()=>{alert(8)},...e}),()=>{const t=[];return e.header&&t.push(h$1("div",{class:"v-widget-header v-panel-titlebar"},[h$1("span",{class:"v-panel-title"},e.header)])),t.push(h$1("div",{class:"v-dialog-content v-widget-content"},[h$1("form",{action:e.action},l.default())])),h$1("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,a=e.height;l.style.height=a+"px",t.timer&&clearTimeout(t.timer),t.timer=setTimeout((()=>{if(l.parentElement){var e;if(l.children[1])a-=l.children[0].offsetHeight,l.children[1].style.height=a+"px",l.children[1].style.overflowY="auto",(l=l.children[1].children[0]).style.height=a+"px",l.children&&(l.parentNode.style.overflowY="hidden",l.parentNode.style.overflow="hidden"),[].forEach.call(l.children,((o,r)=>{r==l.children.length-1&&"CENTER"==o.tagName||!o.classList.contains("v-scrollable")&&!o.classList.contains("v-form")&&!o.classList.contains("v-resize")?a-=t.getAbsoluteHeight(o):e||(e=o)})),l=e;else(l=l.children[0]).style.height=a+"px";if(l){l.style.overflowY="auto",l.style.height=a+"px";var o=new Event("parentResize",{bubbles:!0});o.height=a,l.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 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 a=()=>{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=a,t[l].onblur=a,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 o=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 a=document.createElement("div");a.innerHTML="Este campo es requerido!",a.classList.add("v-error"),t.parentNode.insertBefore(a,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="__"}))},__file:"src/v-form.vue"},script$g={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$9={class:"v-group"};function render$d(e,t,l,a,o,r){return openBlock(),createElementBlock("div",_hoisted_1$9,[renderSlot(e.$slots,"default")])}script$g.render=render$d,script$g.__file="src/v-group.vue";var script$f={name:"VLayerControl",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 l=this,a=l.map;if(console.log("me.map="+l.map),e!=l.lastScope)if(e<100&&(e*=1e4),l.scope=e,0==l.scope)a.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],a.getSize()),l.lastScope=e,a.getLayerById("districts").getSource().clear(),l.$emit("scope",{feature:{getId:()=>null},target:l});else if(a){if(e>9999){for(var o=a.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 s=a.getLayerById("provinces");for(e=1*(e.value?e.value:e),r=s.getSource().getFeatures(),n=0;n<r.length;n++)if(1*r[n].id_==e){s.onChange({feature:r[n]});break}}}else l.lastScope=e;else a.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],a.getSize())}},created(){var e=this;return e.$parent.$on("build",(t=>{var l=document.createElement("i"),a=t.map;e.selection=new ol.Collection;var o=e.selection;l.setAttribute("class","fa fa-expand"),a.addControl(new ol.control.FullScreen({label:l,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"}),s=r.on("change",(()=>{var t=e.scope;t>9999&&(t=Math.floor(t/100));for(var l=r.getFeatures(),a=0;a<l.length;a++)if(1*l[a].id_==1*t){n.onChange({feature:l[a]});break}unByKey(s)})),i=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){i.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=i.getSource().on("change",(()=>{if(e.scope>0)for(var l=i.getSource().getFeatures(),a=e.scope,o=0;o<l.length;o++)if(1*l[o].id_==a){e.scope=0,i.onChange({feature:l[o]});break}unByKey(t)}))}e.$emit("scope",{feature:e.feature2,target:e}),e.feature2=null}};a.on("moveend",d),n.onChange=t=>{var l=t.feature;e.lastScope!=l.getId()&&(o.clear(),o.push(l),t.preventDefault&&t.preventDefault(),e.lastScope=l.getId(),e.feature2=l,e.unmove?d():a.getView().fit(l.getGeometry().getExtent(),{duration:300}))},n.onSelect=t=>{e.$emit("select",t)},a.addLayer(n),a.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)"})}),i.onChange=t=>{var l=t.feature;e.lastScope!=l.getId()&&(2==o.getLength()&&o.pop(),o.push(l),t.preventDefault&&t.preventDefault(),e.lastScope=l.getId(),e.feature2=l,e.unmove?d():a.getView().fit(l.getGeometry().getExtent(),{duration:300}))},i.onSelect=t=>{e.$emit("select",t)},a.addLayer(i),e.map=a,e.$emit("render",e)})),null}};function render$c(e,t,l,a,o,r){return openBlock(),createElementBlock("div",null,[renderSlot(e.$slots,"default")])}script$f.render=render$c,script$f.__file="src/v-layer-control.vue";var script$e={name:"VMapControl",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(){let e=this,t=window.ol;e.slotUsed=!!this.$slots.default,e.$parent.map?(e.$parent.map.addControl(new t.control.Control({element:e.$el})),e.ready=!0):e.$parent.$on("build",(l=>{l.map.addControl(new t.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$8={class:"ol-unselectable ol-control"};function render$b(e,t,l,a,o,r){return withDirectives((openBlock(),createElementBlock("div",_hoisted_1$8,[renderSlot(e.$slots,"default"),o.slotUsed?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("button",{key:0,class:"v-map-control-button",onClick:t[0]||(t[0]=withModifiers(((...e)=>r.enter&&r.enter(...e)),["prevent"]))},[l.icon?(openBlock(),createElementBlock("i",{key:0,class:normalizeClass(["fa fa-xs",l.icon])},null,2)):createCommentVNode("v-if",!0)]))],512)),[[vShow,o.ready&&o.visible0]])}script$e.render=render$b,script$e.__file="src/v-map-control.vue";var script$d={name:"VMap",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 l=new RegExp("[?&]"+e+"=([^&#]*)").exec(t);return l&&l[1]||0},addFeature(e,t){let l=window.ol;e=e||{};var a,o=this,r=o.map;if(e.lon&&e.lat){var n=[e.lon,e.lat];a=new l.geom.Point(n[0]>-100?l.proj.fromLonLat(n):n)}else a=new l.geom.Point(r.getView().getCenter());n=(n=a.flatCoordinates)[0]<-1e4?l.proj.toLonLat(n):n;o.$emit("translateend",{lon:n[0],lat:n[1]}),e.geometry=a;var s=new l.Feature(e);if(s.data=e,e.draggable){var i=new l.Collection;i.push(s);var d=new l.interaction.Translate({features:i});d.on("translateend",(e=>{var t=l.proj.toLonLat(e.coordinate);o.$emit("translateend",{lon:t[0],lat:t[1]})})),d.on("translatestart",(e=>{o.selectedFeature=e.features.getArray()[0]})),s.interactionCollection=i,o.map.addInteraction(d)}if("object"==typeof e.style?s.setStyle(e.style):s.setStyle(o.styleMap[e.style?e.style:"default"]),n=(n=a.flatCoordinates)[0]<-1e4?l.proj.toLonLat(n):n,o.$emit("translateend",{lon:n[0],lat:n[1]}),null!=e.layer){var c=r.getLayerById(e.layer);c?c.getSource().addFeatures(s):r.addLayer(new l.layer.Vector({id:e.layer,source:new l.source.Vector({features:new l.Collection([s])})}))}else o.collection.push(s);return t&&(console.log(s.getGeometry().getCoordinates()),o.map.getView().animate(Object.assign({center:s.getGeometry().getCoordinates(),zoom:17,duration:500},t))),s},animate(e){this.map.getView().animate(e),this.movingCompleted=e.complete},build(){var e=this,t=window.ol;e.styleMap={default:new t.style.Style({image:new t.style.Circle({radius:8,stroke:new t.style.Stroke({color:"#8a0000",width:2}),fill:new t.style.Fill({color:"#ff0000"})})}),star:[new t.style.Style({image:new t.style.RegularShape({fill:new t.style.Fill({color:"#ff0000"}),stroke:new t.style.Stroke({color:"#8a0000",width:2}),points:5,radius:10,radius2:4,angle:0})})]};var l=e.urlParam("location"),a=-1;if(l){var o=l.split("/");l=[parseFloat(o[0]),parseFloat(o[1])],a=o[2],e.moved=!0}else l=!1;console.log("w="+e.$el.clientHeight+";h="+e.$el.clientWidth);var r=new t.Map({target:e.$el,layers:[new t.layer.Tile({source:new t.source.OSM({})})],view:new t.View({})});new ResizeObserver((t=>{console.log("w="+e.$el.clientHeight+";h="+e.$el.clientWidth),r.updateSize()})).observe(e.$el),r.getLayerById=function(e){var t;return r.getLayers().forEach((l=>{l.get("id")!==e||(t=l)})),t},r.styleMap=e.styleMap,r.addLayer(new t.layer.Vector({source:new t.source.Vector({features:e.collection=new t.Collection})})),e.moved?(r.getView().setCenter(l),r.getView().setZoom(a||12),e.map=r,console.log("distarar evento buid pageLocation="+l),e.$emit("build",e)):(console.log("En caso no exista una coordenada se usara se fijara a los limites de la region"),_.getCurrentPosition().then((l=>{r.getView().setCenter(t.proj.fromLonLat([l.coords.longitude,l.coords.latitude])),r.getView().setZoom(12),e.map=r,e.$emit("build",e)}),(t=>{r.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],r.getSize()),e.map=r,e.$emit("build",e)})));var n=r.getView().getZoom();r.on("moveend",(t=>{this.movingCompleted&&(this.movingCompleted(e),this.movingCompleted=null);var l=r.getView().getZoom();n!=l&&(n=l,e.$children.forEach((function(e){e.$vnode.tag.endsWith("v-overlay")&&e.$emit("zoom",l)})))})),r.on("singleclick",(e=>{var t=r.forEachFeatureAtPixel(e.pixel,((e,t)=>{if(t)return[e,t]}));if(t){var l=t[1];t=t[0];if(e.feature=t,e.map=r,e.preventDefault(),l.onSelect)return void l.onSelect(e)}})),r.on("dblclick",(t=>{var l=r.forEachFeatureAtPixel(t.pixel,((e,t)=>{if(t)return[e,t]}));if(l){var a=l[1];l=l[0];if(t.feature=l,t.map=r,a.onChange)return console.log("dbclick manda event onchangue"),void a.onChange(t);e.$emit("change",l),r.getView().animate({center:l.getGeometry().getCoordinates(),zoom:17,duration:500},(()=>{for(var l=0;l<e.$children.length;l++){var a=e.$children[0];a.open&&a.open(t)}}))}})),r.getViewport().parentNode.addEventListener("parentResize",(t=>{setTimeout((()=>{r.updateSize(),e.$emit("resize",r)}),100)})),Vue.resize()}}};function render$a(e,t,l,a,o,r){return openBlock(),createElementBlock("div",null,[renderSlot(e.$slots,"default")])}script$d.render=render$a,script$d.__file="src/v-map.vue";var script$c={name:"VNumber",props:{value:Number,max:Number,min:Number,delay:Number},setup(e,t){const{emit:l}=t,a=ref(null);onMounted((()=>{a.value=e.value})),onUpdated((()=>{a.value=t.attrs.modelValue}));return{v:a,handleInput:t=>{let o=a.value;const r=t.target.getAttribute("decimal");null!==o?(o=num(o),e.max&&o>num(e.max)&&(o=num(e.max)),e.min&&o<num(e.min)&&(o=num(e.min)),null!==r&&(o=o.toFixed(Number(r)))):o=null,a.value=t.target.value;let n=_$2.calendarTimer;n&&clearTimeout(n),e.delay?_$2.calendarTimer=setTimeout((()=>{l("input",o),_$2.calendarTimer=null}),13===t.keyCode?0:e.delay):l("input",o)}}}};function render$9(e,t,l,a,o,r){return withDirectives((openBlock(),createElementBlock("input",{type:"number",onKeyup:t[0]||(t[0]=withKeys(((...e)=>a.handleInput&&a.handleInput(...e)),["enter"])),"onUpdate:modelValue":t[1]||(t[1]=e=>a.v=e),onInput:t[2]||(t[2]=(...e)=>a.handleInput&&a.handleInput(...e)),class:"_"},null,544)),[[vModelText,a.v,void 0,{number:!0}]])}script$c.render=render$9,script$c.__file="src/v-number.vue";var script$b={setup(e,t){const l=e,{displayField:a,store:o,filter:r}=l,{expose:n,emit:s}=t,i=ref([]),d=ref([]),c=ref([]);ref(null),ref(null);const u=inject("collect"),p=computed((()=>d.value&&r?d.value.filter((e=>-1!==JSON.stringify(e).toLowerCase().indexOf(r.toLowerCase()))):d.value)),h=(e,t)=>{const l=c.value;if(l&&l.length)for(var a=0;a<l.length;a++)e&&(e=e[l[a]]);else e&&!t&&(e=e.id?e.id:e.code?e.code:e);return e},m=async(e=null,t=null,a=!1)=>{if(!a&&t&&e&&i.value.push([e,t]),!(i.value.length>1)){if(d.value=[],d.value||(d.value=[]),l.store){let t=await getStoredList(l.store);const[a]=e?Object.keys(e):[];if(a){let l;try{d.value=t.filter((t=>(l=t,l[a].startsWith(e[a]))))}catch(e){console.log("Error trying to filter ",l),console.error(e)}}else d.value=d.value.concat(t)}for(u(p),a||i.value.shift();i.value.length;){const e=i.value.shift()||[];await m(e[0],e[1],!0)}}};return m.getObjectByIndex=e=>{const t=p.value;return t?t[e]:null},m.getValueByIndex=e=>{const t=p.value;return t?h(t[e],1):null},m.getIndexByValue=(e,t)=>{e&&e.id?e=e.id:e&&e.code&&(e=e.code);for(var l=0;l<p.value.length;l++)if(h(p.value[l])==e)return t&&t(l),l;return t&&t(-1),-1},u.push(m),onUpdated((()=>{u.updateSelect()})),onMounted((()=>{l.valueField&&(c.value=l.valueField.split(".")),u.updateSelect()})),onUnmounted((()=>{u.remove(m)})),n({load:m}),()=>p.value.map((e=>h$1("option",{value:h(e)},e[a])))},name:"VOptions",props:{url:String,src:String,displayField:String,data:Array,store:null,valueField:String,filters:null,filter:null,mode:null},watch:{data(){this.$parent.updateSelect()}},created(){var e=this;e.data&&(e.data2=e.data)},updated(){let e=this;!e.loaded&&e.data&&(e.data2=e.data)},methods:{getParentE(){return this.$el.parentElement.parentElement},getSelectedItem(){var e=this.$el.parentElement;return this.filterList[e.selectedIndex-1]},async load2(e,t,l){}},__file:"src/v-options.vue"},ol$1=window.ol,_$1=window._,axios$1=window.axios,script$a={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$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 l=e.$el.parentElement;var a=window.getComputedStyle(l),o=parseFloat(a.left),r=parseFloat(a.top),n=t.clientX,s=t.clientY,i=l.parentElement;function d(e){l.style.left=o+e.clientX-n+"px",l.style.top=r+e.clientY-s+"px"}i.addEventListener("mousemove",d,!1),i.addEventListener("mouseup",(function(){i.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(_$1.remoteServer+e.src).then((t=>{e.$emit("input",t.data)}))},open(e){for(var t=this,l=e.map,a=e.feature,o=t.overlay,r=o.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),o.setPosition(e.coordinate);var i=l.getView().getCenter(),d=l.getView().getResolution(),c=a?a.getGeometry().getCoordinates():[null],u=l.getPixelFromCoordinate(Number(c[0])?c:e.coordinate);if(this.src)axios$1.get(_$1.remoteServer+this.src).then((e=>{t.$emit("input",e.data),t.c++,setTimeout((function(){var e=l.viewport_.offsetWidth,a=l.viewport_.offsetHeight,n=r.children[0].children[1];n.scrollTop=0;var s=r.offsetHeight;n.style.height=s+100>=a?a-100-r.children[0].children[0].offsetHeight+"px":"300px",s=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,l.getView().animate({center:[i[0]+(u[0]+p+20>=e?+(u[0]+p+20-e):u[0]-20-p<0?-p+u[0]-20:0)*d,i[1]+(u[1]<s?s-u[1]:0)*d],duration:500}),u[0]=u[0]+p-0,u[1]=u[1]-12,o.setPosition(l.getCoordinateFromPixel(u)),t.$el.style.opacity=1,_$1.mobil)for(var h=o.getElement().querySelectorAll("a:not(._)"),m=0;m<h.length;m++)h[m].addEventListener("click",_$1.open2)}),400)})).catch((e=>{console.log(e)}));else{var p=l.viewport_.offsetWidth,h=l.viewport_.offsetHeight,m=r.children[0].children[1];m.scrollTop=0;var v=r.offsetHeight;console.log(r.offsetHeight),m.style.height=v+100>=h?h-100-r.children[0].children[0].offsetHeight+"px":"300px",v=r.offsetHeight;var g=1*t.width,f=p<=g+40?p-40:g;if(r.style.zIndex=10,r.style.width=f+"px",f/=2,l.getView().animate({center:[i[0]+(u[0]+f+20>=p?+(u[0]+f+20-p):u[0]-20-f<0?-f+u[0]-20:0)*d,i[1]+(u[1]<v?v-u[1]:0)*d],duration:500}),u[0]=u[0]+f-0,u[1]=u[1]-12,o.setPosition(l.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,_$1.mobil){var y=o.getElement().querySelectorAll("a:not(._)");for(s=0;s<y.length;s++)y[s].addEventListener("click",_$1.open2)}t.$emit("opened",{target:t})}}}};const _hoisted_1$7={class:"v-ol-overlay"},_hoisted_2$6={key:0,class:"v-panel-titlebar"},_hoisted_3$4=createElementVNode("i",{class:"fa fa-times"},null,-1),_hoisted_4$2=[_hoisted_3$4],_hoisted_5$1={key:2,style:{"text-align":"center"}},_hoisted_6=createElementVNode("img",{src:_imports_0,width:"20",height:"18"},null,-1),_hoisted_7=[_hoisted_6];function render$8(e,t,l,a,o,r){return openBlock(),createElementBlock("div",_hoisted_1$7,[l.header?(openBlock(),createElementBlock("div",_hoisted_2$6,[createElementVNode("span",{class:"v-icon v-icon-close",onClick:t[0]||(t[0]=(...e)=>r.close&&r.close(...e))},[..._hoisted_4$2]),createTextVNode(toDisplayString(l.header),1)])):createCommentVNode("v-if",!0),(openBlock(),createElementBlock("div",{class:"v-ol-body",key:"c-"+o.c,style:{padding:"10px"}},[l.value?renderSlot(e.$slots,"default",{key:0,value:l.value}):createCommentVNode("v-if",!0)])),r.hasSlot("footer")&&l.value?(openBlock(),createElementBlock("footer",{key:"f-"+o.c},[renderSlot(e.$slots,"footer",{value:l.value})])):createCommentVNode("v-if",!0),o.coordinate?(openBlock(),createElementBlock("div",_hoisted_5$1,[..._hoisted_7])):createCommentVNode("v-if",!0)])}script$a.render=render$8,script$a.__file="src/v-overlay.vue";var script$9={name:"VPanel",props:{header:String}};const _hoisted_1$6={class:"ui-panel"},_hoisted_2$5={key:0,class:"v-panel-titlebar v-widget-header ui-helper-clearfix ui-corner-all"},_hoisted_3$3={class:"v-panel-title"},_hoisted_4$1={class:"v-panel-content v-dialog-content v-widget-content"};function render$7(e,t,l,a,o,r){return openBlock(),createElementBlock("div",_hoisted_1$6,[l.header?(openBlock(),createElementBlock("div",_hoisted_2$5,[createElementVNode("span",_hoisted_3$3,toDisplayString(l.header),1)])):createCommentVNode("v-if",!0),createElementVNode("div",_hoisted_4$1,[renderSlot(e.$slots,"default")])])}script$9.render=render$7,script$9.__file="src/v-panel.vue";var script$8={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$5={class:"v-popup",style:{position:"absolute"}};function render$6(e,t,l,a,o,r){return withDirectives((openBlock(),createElementBlock("div",_hoisted_1$5,[renderSlot(e.$slots,"default")],512)),[[vShow,o.show]])}script$8.render=render$6,script$8.__file="src/v-popup.vue";var script$7={name:"VRadio",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(){}}};const _hoisted_1$4={class:"v-radio",style:{"font-weight":"normal !important",display:"block"}},_hoisted_2$4=["value"],_hoisted_3$2=createElementVNode("span",{class:"checkmark"},null,-1);function render$5(e,t,l,a,o,r){return openBlock(),createElementBlock("label",_hoisted_1$4,[createTextVNode(toDisplayString(l.label?l.label:l.value)+" ",1),createElementVNode("input",{type:"radio",value:l.value},null,8,_hoisted_2$4),_hoisted_3$2,renderSlot(e.$slots,"default")])}script$7.render=render$5,script$7.__file="src/v-radio.vue";var script$6={__name:"v-radio-group",props:{required:String,name:String,modelValue:String,items:{type:Array,required:!0},type:{type:String,default:"radio"},label:{type:String,default:""}},emits:["update:modelValue"],setup(e,{emit:t}){const l=e,a=t,o=ref(l.modelValue),{proxy:r}=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(r.$el,[]);let t=l.name;t||(t="input_"+Date.now().toString(36)+Math.random().toString(36).substring(2,15));for(let l=0;l<e.length;l++)e[l].name=t,n.has(e[l])||(e[l].addEventListener("change",d),n.add(e[l])),e[l].checked=e[l].value===o.value},d=e=>{let t=e.target.value;""===t&&(t=null),o.value=t,a("update:modelValue",t)};watch((()=>l.modelValue),(e=>{o.value=e,i()})),onMounted((()=>{i()})),onUpdated((()=>{i()}));const c=()=>{const e=[];return r.$slots.default&&e.push(...r.$slots.default()),l.items&&e.push(...l.items.map((e=>h$1(script$7,{...e,modelValue:o.value,"onUpdate:modelValue":d})))),h$1("div",[l.label&&h$1("label",l.label),...e])};return(e,t)=>(openBlock(),createBlock(c))},__file:"src/v-radio-group.vue"},script$5={name:"VSelect",setup(e,t){const{slots:l,emit:a}=t,{displayField:o,valueField:r,disabled:n,readonly:s,autoload:i}=e,d=ref([]),c=ref([]),u=ref([]),p=[],h=ref(!(i+""=="false"||1*i==0)),m=ref(null),v=e=>{const t=e.value;d.value=o?t.sort(((e,t)=>{const l=e[o];return l>t[o]?1:l<t[o]?-1:0})):t},g=()=>{let e=t.attrs.modelValue;if(null!=e&&e.target&&(e=e.value),m.value){let t=m.value,l=t.selectedIndex;e&&""!==e||(t.selectedIndex=0);for(let l=0;l<t.length;l++)t[l].value==e&&(t.selectedIndex=l);const o=p;for(let r=0;r<o.length;r++){if(!o[r].getValueByIndex)continue;let n=o[r].getValueByIndex(l-1);o[r].getIndexByValue(e,((l,s)=>{if(l>-1){t.selectedIndex=l+1;let s=o[r].getValueByIndex(t.selectedIndex-1);-1==s?s=null:o[r].getObjectByIndex&&(s=o[r].getObjectByIndex(t.selectedIndex-1));let i=Number(n);i=isNaN(i)?n?!!e&&(e.id?e.id==n.id:e==n):!e:i==Number(e),i||a("input",e,{value:e,select:t,object:s})}}))}}};v.remove=e=>{const t=p.filter((t=>t!==e));p.length=0,t.forEach((e=>p.push(e)))},v.push=e=>{p.push(e)},v.updateSelect=()=>{g()},r&&(c.value=r.split(".")),provide("collect",v);const f=(t,l)=>{e.disabled?u.value=[t,l]:(u.value=[],p.forEach((e=>{e(t,l)})))};return onMounted((()=>{f()})),onUpdated((()=>{g()})),{options:d,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=m.value;t&&""!==t||(t=null,l.selectedIndex=0);let o,r=0;const n=d.value;for(let e=0;e<p.length;e++){if(r=p[e].getValueByIndex(l.selectedIndex-1),-1!=r){o=p[e].getObjectByIndex(l.selectedIndex-1);break}r=0}r?t=r:n.length&&(l.selectedIndex=0),a("update:modelValue",t,{value:t,select:l,object:o}),a("input",t,{value:t,select:l,object:o})},onInput:e=>{e.target.value,e.stopPropagation()},select:m,load:f,lastLoad:u,autoload_:h}},props:{required:null,readonly:null,multiple:null,label:null,disabled:null,autoload:null,displayField:null,valueField:null},data:()=>({autoload_:!0,ik:0,data:[],popup:null,show:!1,sel:[],sela:null,tmp:[],sel2:[]}),mounted(){},watch:{disabled(e,t){this.activate(e,t)},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 a=e.getBoundingClientRect();const o=l.children[0];window.innerWidth<400?(l.style.padding="40px",l.style.height="100%",o.style.height="100%"):(l.style.top=a.bottom+0+"px",l.style.left=a.left+0+"px",l.style.maxHeight=window.innerHeight-a.bottom-30+"px",o.style.maxHeight=l.style.maxHeight),o.style.display="flex",o.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()}}},methods:{activate(e,t){e=!!e,t=!!t;let l=this.lastLoad,a=this;!e&&!e===t&&l.length&&(this.$el.disabled=!1,a.load(l[0],l[1]))},expand(){console.log("click")},internalLoad(){let e=this;e.autoload_=!(e.autoload+""=="false"||1*e.autoload==0);let t=e.$attrs.value;null!=t&&t.target&&(t=t.value);let l=e.$el.childNodes[0];t&&""!==t||(l.selectedIndex=0),t=e.$attrs.value;for(let e=0;e<l.length;e++)l[e].value==t&&(l.selectedIndex=e);e.autoload_&&e.load(),e.$emit("mounted",e)},toggle(){this.show=!this.show},close(){this.show=!1},selectAll(){let e=[];for(let t=0;t<this.data.length;t++)e.push(this.data[t].value);this.sel=e,this.ik++},checkboxInput(){let e=this.sel;e&&e.length&&(e=e.join(","))}}};const _hoisted_1$3={class:"v-select",style:{position:"relative"}},_hoisted_2$3=["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$4(e,t,l,a,o,r){const n=resolveComponent("v-checkbox"),s=resolveComponent("v-checkbox-group"),i=resolveComponent("v-button");return openBlock(),createElementBlock("div",_hoisted_1$3,[l.readonly?createCommentVNode("v-if",!0):withDirectives((openBlock(),createElementBlock("select",{key:0,style:{width:"100%"},ref:"select",onChange:t[0]||(t[0]=(...e)=>a.onChange&&a.onChange(...e)),onInput:t[1]||(t[1]=(...e)=>a.onInput&&a.onInput(...e)),required:l.required,disabled:l.disabled,click:r.expand},[renderSlot(e.$slots,"default")],40,_hoisted_2$3)),[[vShow,!l.multiple]]),l.multiple?(openBlock(),createElementBlock(Fragment,{key:1},[createElementVNode("div",{class:normalizeClass(["v-widget-header",{"v-selected":o.show}]),ref:"button",style:{"padding-top":"3px","padding-bottom":"3px"},onClick:t[2]||(t[2]=(...e)=>r.toggle&&r.toggle(...e))},"   ",2),withDirectives(createElementVNode("div",{ref:"popup",onClick:t[5]||(t[5]=(...e)=>r.close&&r.close(...e)),style:{"background-color":"#0000009c"}},[createElementVNode("div",_hoisted_3$1,[createElementVNode("div",_hoisted_4,[createVNode(n,{modelValue:o.sela,"onUpdate:modelValue":t[3]||(t[3]=e=>o.sela=e),onInput:r.selectAll},null,8,["modelValue","onInput"])]),(openBlock(),createBlock(s,{class:"v-select-checkbox-group",style:{"overflow-y":"auto"},key:"p"+o.ik,modelValue:o.sel,"onUpdate:modelValue":t[4]||(t[4]=e=>o.sel=e),onInput:r.checkboxInput},{default:withCtx((()=>[o.data.length?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(o.data,(e=>(openBlock(),createElementBlock("div",null,[createVNode(n,{value:e.value,label:e.label},null,8,["value","label"])])))),256)):createCommentVNode("v-if",!0)])),_:1},8,["modelValue","onInput"])),createElementVNode("div",_hoisted_5,[createVNode(i,{icon:"fa-sync",value:"Filtrar"})])])],512),[[vShow,o.show]])],64)):createCommentVNode("v-if",!0),l.readonly?(openBlock(),createElementBlock(Fragment,{key:2},[createTextVNode(toDisplayString(l.label?l.label:"---"),1)],64)):createCommentVNode("v-if",!0)])}script$5.render=render$4,script$5.__file="src/v-select.vue";var script$4={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$2=["value","data-value"],_hoisted_2$2=["onClick"];function render$3(e,t,l,a,o,r){return openBlock(),createElementBlock("div",{value:!1===l.value?"false":l.value,"data-value":""+l.value},[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.options,(e=>(openBlock(),createElementBlock("div",{onClick:t=>r.onChange(e),style:normalizeStyle("cursor:pointer;border: 1px solid #000;text-align:center;display:inline-block;width:calc(50% - 2px)"+(e===o.selected?"":";opacity: 0.5")),class:normalizeClass({"v-selected":e==o.selected})},toDisplayString(e),15,_hoisted_2$2)))),256))],8,_hoisted_1$2)}script$4.render=render$3,script$4.__file="src/v-switch.vue";var script$3={name:"VTable",setup(e,t){const l=ref(1),a=ref(0),o=ref([]),r=ref([]),n=ref(null),s=ref(1),i=computed((()=>{const t=e,l=r.value;let a,o;return l.sum=sum,l.filter((e=>{for(var l in t.filters)if(a=t.filters[l],"function"==typeof a){if(!a(e))return 0}else if(a&&"string"==typeof a&&l in e&&(o=e[l],"string"==typeof o&&(o=o.toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""),!o.includes(a.toUpperCase()))))return 0;return 1}))})),d=computed((()=>{let e=i.value;return e=n?e.sort(((e,t)=>{t=(t=t[n])||0,e=e[n];const l=Number(e);return l&&(e=l),e<t?-1*s:e>t?1*s:0})):e,e.sum=sum,e})),c=[],u=ref(1),p=ref(0),{slots:h,expose:m,emit:v}=t,g=async()=>{var t,l=e.store;null!=l&&(db&&(t=await getStoredList(l)),t||(t=[]),r.value=r.value?t.concat(r.value):t);return data_},f=(e,t,a)=>{var n;if(-10===t)if(i.value.length===o.value.length)o.value=[];else for(o.value=[],n=0;n<i.value.length;n++)o.value.push(n);else a?l.value||!o.value.contains(t)?o.value=[t]:(o.value=[],e=null):this.selected.contains(t)?(o.value.splice(o.value.indexOf(t),1),e=null):o.value.push(t);var s=[],d=o.value.sort(((e,t)=>e-t));for(t=0;d.length>t;t++)s.push(r.value[d[t]]);v("row-select",{target:this,current:e,selection:s})},y=(t,l)=>{const a=[];return e.selectable&&(e=>o.value.includes(e))(t)&&a.push("v-selected"),e.rowStyleClassFunc&&a.push(e.rowStyleClassFunc(l)),a};let $=""+e.selectable;l.value="false"!=$&&"0"!=$?1:0,$=""+e.scrollable,a.value=e.scrollable&&"false"!=$&&"0"!=$?1:0;const b=h.default({row:{}});b&&b.forEach(((e,t)=>{const l=e.props;e.children&&e.children.filter&&(e.children.filter((e=>"v-filter"==e.type)).forEach((t=>{l.filter=t,p.value=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.type)).forEach((t=>{l.footer=t,e.children.shift()}))),c.push({filter:l.filter,header:l.header,width:l.width})}));return m({load:()=>{const t=e;if(o.value=[],t.value&&(r.value=t.value),t.src){var l=t.src;if(!l)return;l.endsWith("/")&&(l=l.slice(0,l.length-1));const e=t.pagination;if(e&&(l+="/"+(u.value-1)*e+"/"+e),networkStatus.connected){var a;if(t.gql){const l=t.gql,o="query{"+Object.keys(l)[0]+"(offset:"+(u.value-1)*e+" limit:"+e+"){\ndata{"+l[Object.keys(l)[0]]+"}\nsize\n}\n}";a=axios$2.post(t.src,{query:o})}else a=axios$2.get(l,{params:clean(t.filters)});a.then((l=>{if(l.data&&l.data.error)MsgBox(l.data.error);else{var a=l.data;t.gql&&(a=l.data.data[Object.keys(t.gql)[0]]),r.value=a.data||a,a&&a.hasOwnProperty("size")&&e&&(t.pages=Math.ceil(a.size/e),u.value>t.pages&&(u.value=1),t.size=a.size),g(),v("loaded",{target:t}),v("row-select",{}),t.remoteLoaded=1,t.loaded=1,t.kc++}})).catch(t.error)}else{r.value=[];const e=g();e.then&&e.then((e=>{r.value=e})),v("row-select",{target:t})}}else r.value=[],g().then((()=>v("loaded",{target:t})));t.kc++,t.loaded=1}}),()=>{const t=h$1("div",{className:"v-datatable-scrollable-header-box",style:"position: absolute; height: 47px; left: 0px;"},h$1("table",{className:"v-cloned-header v-table",style:"width: 1536px;"},[h$1("th",{width:42},[h$1("span",{className:"v-check"},h$1("i",{className:"fa fa-lg"}))]),c.map((e=>h$1("th",e,[e.header,e.filter?.children])))]));return h$1("div",{className:"v-datatable"},[h$1("div",{className:"v-datatable-header v-widget-header ui-corner-top"},h.header()),h$1("div",{className:"v-paginator v-paginator-top v-widget-header v-paginator-pages center"},[h$1(script$n,{value:"|<"}),h$1(script$n,{value:"<"}),h$1("input",{type:"number",style:"width:60px"}),h$1(script$n,{value:">"}),h$1(script$n,{value:">|"})]),h$1("div",{className:"v-widget-header v-datatable-scrollable-header",style:"position: relative; height: 110px; margin-right: 0px;"},t),h$1("div",{className:"v-datatable-scrollable-body",style:"overflow-y: auto; flex:1",onScroll(e){const l=e.currentTarget.scrollLeft;t.el.style.left="-"+l+"px"}},[h$1("table",{className:"v-table",style:"width: 1536px;"},[h$1("thead",{className:"v-head-cloned"},[h$1("th",{width:42}),...c.map((e=>h$1("th",{width:e.width})))]),h$1("tbody",{className:"v-datatable-data"},d.value.length<1?h$1("td",{colspan:c.length+(l.value?1:0)},e.emptyMessage):[d.value.map(((e,t)=>{const a=h.default({row:e});return a.forEach(((e,t)=>{delete e.props.header,delete e.props.width,e.children&&(e.children.filter((e=>"v-filter"==e.type)).forEach((t=>{p.value=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.type)).forEach((t=>{e.children.shift()})))})),h$1("tr",{className:y(t,e),onclick(a){((e,t,a)=>{l.value&&0==whichChild(e.target)||f(t,a,1)})(a,e,t)}},[h$1("td",{width:24}),...a])}))])])])])}},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,pagination:null,selectable:{default:!0},scrollable:null,autoload:{default:!0}},data:()=>({pages:1,resizeAfterUpddate:0,active:0,kc:1,keyBody:1,columns:null,row:{},hasFilters:0,kt:0,size:null,sortKey:"",paginatio_:0,remoteLoaded:null,loaded:!1,sortOrders:{},rowStyleClassFunc:null}),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 l=t.$target.k;e.kt!=l&&(e.load(),e.kt=l)})),e.active&&e.buildColumns(),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),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"),l=e.$el.querySelectorAll(".v-datatable-scrollable-header-box")[0];if(l){var a=e.$el.querySelectorAll(".v-cloned-header");if(0===a.length){a=document.createElement("table");var o=t[0].querySelectorAll("thead")[0],r=0,n=0,s=document.createElement("canvas"),i=window.getComputedStyle(l),d=s.getContext("2d");d.font=i.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(i.lineHeight),ctx:d});r=0;if(u.forEach(((t,l)=>{t.childNodes[0].onclick=v;var a=e.columns[l-(selectable0.value?1:0)];if(a&&a.filter&&a.filter.elm)if(a.filter.elm.children.forEach)a.filter.elm.children.forEach((e=>t.appendChild(e)));else for(let e of a.filter.elm.children)t.appendChild(e);else if(l>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 s=t.childNodes[0].offsetHeight;s=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",s>n&&(n=s)})),u.forEach(((e,t)=>{t&&(e.childNodes[0].style.height=n+"px"),a.appendChild(e)})),u.forEach(((e,t)=>{var l=document.createElement("th");l.width=e.width,o.childNodes[0].appendChild(l)})),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 a=e.currentTarget.scrollLeft;l.style.left="-"+a+"px",t[0].style.left="-"+a+"px"}));var m=t[1].querySelectorAll("td");for(p=0;p<u.length;p++)m[p]&&(m[p].style.width=u[p].width+"px")}else t[0].parentElement.addEventListener("scroll",(e=>{var t=e.currentTarget.scrollLeft;l.style.left="-"+t+"px"}));a.style.width=r+"px";var v=t=>{var l=e.columns[t.target.parentNode.getAttribute("ind")].sort;l==e.sorter&&(e.sortDir=-1*e.sortDir),e.sorter=l};a.className="v-cloned-header v-table",l.appendChild(a),l.appendChild(l.firstChild),l.style.position="absolute",l.style.height=n+37-37+"px",l.parentElement.style.height=l.style.height,e.$el.style.maxHeight&&(l.parentElement.nextElementSibling.style.maxHeight=parseInt(e.$el.style.maxHeight)-n+"px"),o.className="v-head-cloned"}}var g=e.$el.querySelectorAll(".v-check > svg");for(p=0;p<g.length;p++)g[p].dataset.icon=g[p].parentNode.dataset.icon;if(e.loaded){for(var f=e.$el.querySelectorAll(".group"),y=0;y<f.length;y++)f[y].parentNode.removeChild(f[y]);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(){emit("updated",t)}),100)}},methods:{buildColumns(){},resize(e){var t=this.$el;setTimeout((()=>{var l=t.querySelector(".v-datatable-header");l&&(e-=l.offsetHeight),(l=t.querySelector(".v-paginator"))&&(e-=l.offsetHeight),(l=t.querySelector(".v-datatable-scrollable-header"))&&(l.style.height=l.querySelector("table").offsetHeight+"px",e-=l.offsetHeight),(l=t.querySelector(".v-table-summary"))&&(e-=l.offsetHeight);const a=(l=t.querySelector(".v-datatable-scrollable-body")).offsetWidth-l.clientWidth;l.style.overflowY="auto",l.style.height=e+"px",(l=t.querySelector(".v-datatable-scrollable-header-box"))&&(l.parentNode.style.marginRight=a+"px"),(l=t.querySelector(".v-table-summary"))&&(l.style.overflowY="hidden",l.style.marginRight=a+"px")}),100)},to(e,t){this.loadP(e,t)},loadP(e,t){var l=this;(l.page!=e||t)&&(l.page=e,l.load())},rowCreated(){},hasSlot(e){return!!this.$slots[e]},sortBy(){},rowSelect(e,t,l){var a,o=this;if(-10===t)if(filteredData.value.length===o.selected.length)o.selected=[];else for(o.selected=[],a=0;a<filteredData.value.length;a++)o.selected.push(a);else l?selectable0.value||!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]]);emit("row-select",{target:o,current:e,selection:r})},async getStoredList(e){let t=new Promise((t=>{console.log(db);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$2={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 a=new Event("tabChange",{bubbles:!1});a.$target=t,l.dispatchEvent(a),t.$el.style.height=t.height+"px",(a=new Event("parentResize",{bubbles:!1})).height=t.$el.offsetHeight-25,l.style.height=a.height+"px",setTimeout((()=>{l.dispatchEvent(a)}),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 a=new Event("parentResize",{bubbles:!1});a.height=e.$el.offsetHeight-25,a.target=e.$el,a.$target=e;for(var o=1;o<t.length;o++)"none"!=t[o].style.display&&(console.log("Se envia el alto "+a.height),t[o].style.height=a.height+"px",t[o].dispatchEvent(a));e.$emit("resize",a)})),t[1+e.currentTabIndex].setAttribute("active",1);var a=new Event("tabChange",{bubbles:!1});a.$target=e,t[1+e.currentTabIndex].dispatchEvent(a)}};const _hoisted_1$1={class:"v-tab-nav"},_hoisted_2$1=["onClick"];function render$2(e,t,l,a,o,r){return openBlock(),createElementBlock("div",{class:"v-tabview",style:normalizeStyle({height:o.height+"px"})},[createElementVNode("ul",_hoisted_1$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.tabs,((e,t)=>(openBlock(),createElementBlock("li",{class:normalizeClass({"v-selected":t==o.currentTabIndex}),key:t,onClick:e=>o.currentTabIndex=t},toDisplayString(e.title),11,_hoisted_2$1)))),128))]),renderSlot(e.$slots,"default")],4)}script$2.render=render$2,script$2.__file="src/v-tabview.vue";var script$1={name:"VTextarea",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,l=e.$el;(t=window.attachEvent?function(e,t,l){e.attachEvent("on"+t,l)}:function(e,t,l){e.addEventListener(t,l,!1)})(l,"change",e.resize),t(l,"cut",e.delayedResize),t(l,"paste",e.delayedResize),t(l,"drop",e.delayedResize),t(l,"keydown",e.delayedResize)}};function render$1(e,t,l,a,o,r){return openBlock(),createElementBlock("textarea",null,toDisplayString(l.value),1)}script$1.render=render$1,script$1.__file="src/v-textarea.vue";var script={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,a=new FormData;t=t||e.name.replace(/[^\w\s.]/gi,""),a.append("filename",t),a.append("file",e,t),l.showProgress=!0,axios.post((l.domain?l.domain:"")+"/api/file/upload",a,{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={style:{cursor:"pointer"},class:""},_hoisted_2=["data-icon"],_hoisted_3=[".value"];function render(e,t,l,a,o,r){return openBlock(),createElementBlock("div",{onClick:t[1]||(t[1]=(...e)=>r.other&&r.other(...e)),class:normalizeClass([l.onlyicon?"":"v-button ui-widget ui-state-default ui-corner-all","v-uploader"]),style:normalizeStyle({padding:l.onlyicon?"0px":""})},[createElementVNode("label",_hoisted_1,[l.click?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("input",{key:0,type:"file",onChange:t[0]||(t[0]=e=>r.handleFileUpload())},null,32)),createElementVNode("i",{class:normalizeClass(["fa",l.icon?l.icon:"fa-upload"]),"data-icon":l.icon,style:normalizeStyle({marginRight:l.onlyicon||""==l.value?"":"10px"})},null,14,_hoisted_2),createTextVNode(toDisplayString(l.onlyicon?"":null!=l.value?l.value:"Adjuntar Archivo")+" ",1),o.showProgress?(openBlock(),createElementBlock("progress",{key:1,max:"100",style:{width:"100%"},".value":o.uploadPercentage},null,40,_hoisted_3)):createCommentVNode("v-if",!0)])],6)}script.render=render,script.__file="src/v-uploader.vue";var components={InputTextarea:script$p,InputText:script$q,VAutocomplete:script$o,VButton:script$n,VCalendar:script$m,VCheckboxGroup:script$l,VCheckbox:script$k,VDataview:script$j,VFieldset:script$i,VForm:script$h,VGroup:script$g,VLayerControl:script$f,VMapControl:script$e,VMap:script$d,VNumber:script$c,VOptions:script$b,VOverlay:script$a,VPanel:script$9,VPopup:script$8,VRadioGroup:script$6,VRadio:script$7,VSelect:script$5,VSwitch:script$4,VTable:script$3,VTabview:script$2,VTextarea:script$1,VUploader:script};const IsobitUI={install(e){setApp(e),e.BUILT_ON=import.meta.env.VITE_APP_BUILT_ON,configureAxios(axios$2);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 ui=cfg=>{const defs={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(!_$2._session){var e=localStorage.getItem("session");e=e?JSON.parse(e):{},_$2._session=e}return _$2._session},set(e){e?(Array.isArray(e.perms)&&(e.perms=e.perms.reduce(((e,t)=>(e[t]=!0,e)),{})),localStorage.setItem("session",JSON.stringify(e))):localStorage.removeItem("session"),_$2._session=e}},online(){return this.app2&&this.app2.networkStatus?.connected},cleanedFilters(){return clean(this.filters)},app:()=>_$2.app,user:()=>_$2.app.session,perms(){return this.session.perms||this.session.allcaps||{}},rowSelectedCount:()=>1,baseURL:()=>axios$2.defaults.baseURL},data(){return{app2:null,filters:{},ui:this,_session:null,x_connected_:null,row:{},networkStatus:{connected:null}}},created(){let e=this;_$2.app2||(_$2.app2=e,console.log("app created",_$2.app2)),e.app2=_$2.app2},methods:{pad:pad,bindLinks(e,t){const l=this;if(e.querySelectorAll){const r=e.querySelectorAll("a:not(._),ion-item:not(._)");var a=e=>{e.preventDefault()},o=e=>{e.preventDefault(),t&&t(),l.open(e)};for(let e=0;e<r.length;e++)r[e].href||r[e].attributes.href?r[e].onclick=o:r[e].onclick=a,r[e].classList?r[e].classList.add("_"):r[e].className="_"}},resize(){},vv(e){var t=this;Network.getStatus().then((function(l){if(l.connected){var a=localStorage.getItem("session");if(a){try{a=JSON.parse(a)}catch(e){a={}}a.connected=e,localStorage.setItem("session",JSON.stringify(a))}}else t.toast("El dispositivo no tiene acceso a internet!"),t.connected=l.connected}))},getSelected(e){for(var t=e&&e.$vnode?e:this.$children[0].$children[0],l=[],a=0;a<t.selected.length;a++)l.push(t.data[t.selected[a]]);return l},getRowSelectedCount(){var e=this.$children[0].$children[0];return e?e.selected.length:0},rewrite:e=>e,edit(e){var t=this,l=t.$children[0].action,a=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];l||(l=window.location.pathname),a&&a.src&&(l=a.src),e.action&&(l=e.action),a||(a=e.$vnode||e.target&&e.target.$vnode?e:t.$children[0].$children[0]).src&&(l=a.src),l&&(l=t.rewrite(l.replace("/api","").replace("/0/0","")));var o=t.getSelected(a)[0],r=o[a.rowKey];o.tmpId&&(r=-o.tmpId),t.getSelectedId&&(r=t.getSelectedId(o)),_$2.app?t.open(l+"/"+r+"/edit"):axios$2.get((_$2.currentPath=(l+"/"+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 l=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];l||(l=e.$vnode?e:t.$children[0].$children[0]);var a=e.$vnode?e.load:null,o=l.$attrs.rowkey;o||(o=l.rowKey);var r=l.data[l.selected[0]];if(l.data,r.tmpId)t.MsgBox("Esta seguro que desea eliminar los registros temporales seleccionados ?",(function(e){if(0==e){for(var o=0,n=_$2.db.transaction([l.store],"readwrite").objectStore(l.store),s=[],i=l.selected.length-1;i>=0;i--)r=l.data[l.selected[i]],s.push(r),r.tmpId&&n.delete(r.tmpId),o++,l.data.splice(l.selected[i],1);o&&(t.app&&t.app.toast?t.app.toast(o+" registros eliminados"):t.MsgBox(o+" registros eliminados")),l.rowSelect(null,-1),l.selected=[],t.$emit("destroyed",s,l.store),a&&a()}}),["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 a=l.src.replace("/0/0",""),o=[],s=l.selected.length-1;axios$2.delete(a+"/"+n,{params:l.filters}).then((()=>{for(;s>=0;s--)r=l.data[l.selected[s]],o.push(r),l.data.splice(l.selected[s],1);t.app&&t.app.toast?t.app.toast(o.length+" registros eliminados"):t.MsgBox(o.length+" registros eliminados"),l.rowSelect(null,-1),l.selected=[]})).catch(t.error)}}),["SI","NO"])}},apiLink:e=>e.replace(_$2.contextPath,_$2.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("me.$route=",me.$router,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:{};else{if(response.target)return el=response.target,me.open(el.pathname?el.pathname:el.href);if("GET"===response){if("string"==typeof path){let e={path:_$2.currentPath=path+("string"==typeof o?"/"+o:"")};return"function"==typeof o?e.result=o:"object"==typeof o&&(e=mergeDeep(e,o)),me.open(response,e)}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)}}var dialog,nid=Vue.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",_$2.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.resize()};if(for_&&for_.classList.contains("panel")){if(for_.id)window.currentEl="#"+for_.id;else{var clsId="cls-id-"+Vue.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"),l=dialog.querySelector(".v-panel-titlebar"),a=window.innerHeight-94-(l?l.clientHeight:0);(t||dialog).style.height=a+"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=_$2.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=_$2.varMap[children.getAttribute("vueid")],tb.onclick=e=>{e.preventDefault();var t=[],l=vue.$children[0].$children[0];for(i=0;i<l.selected.length;i++)t.push(l.filteredData[l.selected[i]]);path.result(t),delete path.result,vue.close(e)},f.appendChild(tb)}resize()}_$2.storeFunction["PROPS="+nid]=path,_$2.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.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=_$2.closest(event.target,".v-dialog"))}catch(e){console.log(e)}t||(t=this.$el.parentElement);var l=t.parentElement;if(l||!_$2.app.$router){t.style.display="none",(" "+l.className+" ").indexOf(" v-overlay ")>-1?l.style.display="none":l=null,Vue.resize();var a=_$2.storeFunction[t.getAttribute("callback")];a&&a(e),t.parentNode.removeChild(t),l&&l.parentNode.removeChild(l),document.documentElement.style.overflow="auto",document.body.scroll="yes"}else _$2.app.$router.back()},create(){const e=this,t=e.$el.__vnode.ctx.exposed;console.log(t);var l=t.action;l||(l=window.location.pathname),l&&(l=l.replace("/api","")),app()?e.open(l+"/create"):instance.get(_$2.currentPath=(l+"/create").replace(/([^:]\/)\/+/g,"$1")+"?modal").then(_$2.open).catch(e.error)},refresh(){const e=this.$el.__vnode;console.log(e.children[1].children[0]);e.children[1].children[0].children[0].component.exposed.load()},async sync(e){var t=this,l=t.$el.querySelector("form").getAttribute("action");if(!l){var a=(l=t.$el.parentNode.getAttribute("path")).split("/");a="edit"==a[a.length-1]?a.splice(0,a.length-2):a.splice(0,a.length-1),l=t.apiLink(a.join("/"))}var o=t.$children[0].$children[0];l=o.src;for(var r=await t.getStoredList(o.store),n=o.selected,s=[],i=[],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,i.push(p),s.push(u)}}s.length>0&&axios$2.post(l+"/bulk"+(e.sufix?e.sufix:""),i).then((function(e){let l=e.data;for(let e=0;e<l.length;e++){if(l[e].errors){t.MsgBox(JSON.stringify(l[e].errors));break}if(l[e].error){t.MsgBox(l[e].error);break}for(var a=0;a<r.length;a++)(l[e].ext&&l[e].ext.tmpId==r[a].tmpId||l[e].tmpId==r[a].tmpId)&&(console.log("ok"),l[e].ext&&r.ext&&(r[a].ext.error=l[e].ext.error),l[e].id&&(r[a].id=l[e].id),r[a].synchronized=1,t.$emit("sync",l[e],r[a]))}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();let t=e.$el.querySelector("form");if(this.validate(t)){let s=t.getAttribute("action");if(!s&&(s=e.$el.parentNode.getAttribute("path"),s)){let t=s.split("/");t="edit"==t[t.length-1]?t.splice(0,t.length-2):t.splice(0,t.length-1),s=e.apiLink(t.join("/"))}let i=e.$data.data?e.$data.data:e.$data.o;var l=JSON.parse(JSON.stringify(i));if(e.process&&(l=e.process(l)),"object"!=typeof l||Array.isArray(l)||null===l)return;if(s&&e.app2.connected)axios$2.post(s,l).then((t=>{var a=t.data;if(l.tmpId){alert(12);var o=e.$children[0].store,r=window._.db.transaction([o],"readwrite").objectStore(o),n=r.get(l.tmpId);a.id&&(l.id=a.id,i.id=l.id),n.onsuccess=function(){i.synchronized=1,l.synchronized=1,(n.result?r.put(l):r.add(l)).onerror=e=>{console.error(e)},e.$emit("sync",a,l)},n.onerror=function(){e.MsgBox("Error getting temporal record "+l.tmpId)}}e.app&&e.app.toast?e.app.toast("El registro fue grabado exitosamente!",(()=>{e.close({success:!0,data:a})})):MsgBox$1("El registro fue grabado exitosamente!",(()=>{e.close({success:!0,data:a})}))})).catch((function(l){var a,o;if(l.response)if("string"==typeof l.response.data)e.MsgBox(l.response.data);else{a=l.response.data.propertyViolations;for(var r=0;r<a.length;r++){var n=a[r];(o=t.querySelector("[name="+n.path+"]"))&&e.showerror(o,n.message)}for(a=l.response.data.fieldViolations,r=0;r<a.length;r++)n=a[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 s=await e.getStoredList(t);if(s||(s=[]),l.id)for(var a=0;a<s.length;a++)s[a].tmpId==l.tmpId&&(delete l.synchronized,s[a]=l);var o=_$2.db.transaction([t],"readwrite").objectStore(t);if(l.id){delete l.synchronized;var r=o.get(l.tmpId);r.onsuccess=function(){r.result?o.put(l):s.forEach((e=>{e.tmpId==l.tmpId&&o.put(l)})),e.$emit("stored",l,s,o),e.$ionic&&e.app.toast("El registro fue grabado exitosamente!"),e.close({success:!0,data:l})},r.onerror=function(){e.MsgBox("Error getting temporal record "+l.tmpId)}}else{l.tmpId=1*new Date,l.id=-l.tmpId;var n=o.add(l);n.onsuccess=t=>{s.unshift(l),e.$emit("stored",l,s,o),e.app&&e.app.toast&&e.app.toast("El registro fue grabado exitosamente!"),i.tmpId=l.tmpId,i.id=l.id,e.close({success:!0,data:l})},n.onerror=t=>{e.app&&e.app.toast&&e.app.toast("Error!")}}}}else MsgBox$1("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,l){"string"==typeof t&&(t={body:t});var a="string"==typeof l?{fileName:l}:l;a||(a={}),(""+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])),l=document.createElement("a");if(l.href=t,!a.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]&&(a.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",a.fileName),document.body.appendChild(l),l.click()}))},savePost(){},validate(e){const t=this;var l=!0;const a=[];e=e&&0!=e?e:t.$el;var o,r=e?.querySelectorAll("input,select,textarea,div[required=required]"),n={};for(h=0;r?.length>h;h++){var s=r[h];if("radio"!==s.type){if(s.error&&(s.error.style.display="none"),!s.disabled&&!s.getAttribute("disabled")&&(s.required||"DIV"===s.tagName)&&("DIV"!=s.tagName&&!s.value||"DIV"===s.tagName&&!s.attributes.value)){for(o=s.previousElementSibling;o&&1!=o.nodeType;)o=o.previousElementSibling;if(!o)for(o=s.parentElement.previousElementSibling;o&&1!=o.nodeType;)o=o.previousElementSibling;a.push(s)}}else{var i=n[s.name];i||(n[s.name]=i=[]),i.push(s)}}for(var d in console.log("valid radios"),n)if(Object.prototype.hasOwnProperty.call(n,d)){for(var c=n[d],u=!1,p=!1,h=0;h<c.length;h++)c[h].required&&!c[h].disabled&&(p=!0),c[h].checked&&(u=!0);(o=(s=c[0].parentNode.parentNode).previousElementSibling)&&o.classList&&o.classList.contains("v-error")&&o.parentNode.removeChild(o),p&&!u&&(t.showerror(s),l=!1)}console.log("ok="+l);for(const e of a)if(e.error)e.error.style.display="unset";else{const t=document.createElement("div");t.innerHTML="Este campo es requerido!",t.classList.add("v-error"),e.error=t,e.parentNode.insertBefore(t,e.nextSibling)}return!a.length}}};cfg||(cfg={data:{o:{}}});const{setup:setup,...other}=cfg;return cfg={mixins:[defs,other],setup:setup},cfg};export{IsobitUI,_$2 as _,app,date,db,getStoredList,initDB,pad,resize,ui};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isobit-ui",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/library.js",
@@ -11,12 +11,11 @@
11
11
  ],
12
12
  "scripts": {
13
13
  "build": "rollup -c",
14
-
15
14
  "dev": "vue serve v-video-player.vue",
16
- "bili": "bili",
17
- "eslint": "eslint",
18
- "build2": "bili --name index --plugin vue --vue.css false",
19
- "patch": "git add . & git commit -m \"x\" & git push & bili & npm version patch & npm publish"
15
+ "bili": "bili",
16
+ "eslint": "eslint",
17
+ "build2": "bili --name index --plugin vue --vue.css false",
18
+ "patch": "git add . & git commit -m \"x\" & git push & bili & npm version patch & npm publish"
20
19
  },
21
20
  "author": "",
22
21
  "license": "ISC",