@golstats/gsc-reports 1.0.65 → 1.0.67
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/{FilterConditions-55d68355-DMqzcKBO-BmIhhD-B-C4qyyd53.js → FilterConditions-55d68355-DMqzcKBO-BqAxDL_w-t5hljoND.js} +1 -1
- package/dist/{FilterField-59a73e38-CNaE03Ge-BTX2xPpF-DyOvLsHN.js → FilterField-59a73e38-CNaE03Ge-Bv7oIztz-KtUWbrT3.js} +1 -1
- package/dist/{FilterSubcategories-a9b32cc9-_h5FCZ4r-DZeIIQAW-AfkN74dp.js → FilterSubcategories-a9b32cc9-_h5FCZ4r-h8kv1BbC-CHa3yKm3.js} +1 -1
- package/dist/gsc-reports.css +1 -1
- package/dist/gsc-reports.es.js +1 -1
- package/dist/gsc-reports.umd.js +3 -3
- package/dist/{index-C5ej7_M-.js → index-BNb6LArS.js} +6 -7
- package/package.json +2 -2
- package/src/components/elementsTemplates/ReportItem.vue +14 -14
package/dist/gsc-reports.umd.js
CHANGED
|
@@ -4051,7 +4051,7 @@ uniform ${Be} ${qe} u_${it};
|
|
|
4051
4051
|
* vuex v4.1.0
|
|
4052
4052
|
* (c) 2022 Evan You
|
|
4053
4053
|
* @license MIT
|
|
4054
|
-
*/var Qj="store";function Fh(r,a){Object.keys(r).forEach(function(g){return a(r[g],g)})}function l3(r){return r!==null&&typeof r=="object"}function $j(r){return r&&typeof r.then=="function"}function Xu(r,a){if(!r)throw new Error("[vuex] "+a)}function eU(r,a){return function(){return r(a)}}function c3(r,a,g){return a.indexOf(r)<0&&(g&&g.prepend?a.unshift(r):a.push(r)),function(){var B=a.indexOf(r);B>-1&&a.splice(B,1)}}function u3(r,a){r._actions=Object.create(null),r._mutations=Object.create(null),r._wrappedGetters=Object.create(null),r._modulesNamespaceMap=Object.create(null);var g=r.state;eg(r,g,[],r._modules.root,!0),Ov(r,g,a)}function Ov(r,a,g){var B=r._state,J=r._scope;r.getters={},r._makeLocalGettersCache=Object.create(null);var C=r._wrappedGetters,x={},e={},v=p.effectScope(!0);v.run(function(){Fh(C,function(u,t){x[t]=eU(u,r),e[t]=p.computed(function(){return x[t]()}),Object.defineProperty(r.getters,t,{get:function(){return e[t].value},enumerable:!0})})}),r._state=p.reactive({data:a}),r._scope=v,r.strict&&aU(r),B&&g&&r._withCommit(function(){B.data=null}),J&&J.stop()}function eg(r,a,g,B,J){var C=!g.length,x=r._modules.getNamespace(g);if(B.namespaced&&(r._modulesNamespaceMap[x]&&process.env.NODE_ENV!=="production"&&console.error("[vuex] duplicate namespace "+x+" for the namespaced module "+g.join("/")),r._modulesNamespaceMap[x]=B),!C&&!J){var e=Iv(a,g.slice(0,-1)),v=g[g.length-1];r._withCommit(function(){process.env.NODE_ENV!=="production"&&v in e&&console.warn('[vuex] state field "'+v+'" was overridden by a module with the same name at "'+g.join(".")+'"'),e[v]=B.state})}var u=B.context=tU(r,x,g);B.forEachMutation(function(t,w){var y=x+w;rU(r,y,t,u)}),B.forEachAction(function(t,w){var y=t.root?w:x+w,b=t.handler||t;nU(r,y,b,u)}),B.forEachGetter(function(t,w){var y=x+w;iU(r,y,t,u)}),B.forEachChild(function(t,w){eg(r,a,g.concat(w),t,J)})}function tU(r,a,g){var B=a==="",J={dispatch:B?r.dispatch:function(C,x,e){var v=tg(C,x,e),u=v.payload,t=v.options,w=v.type;if((!t||!t.root)&&(w=a+w,process.env.NODE_ENV!=="production"&&!r._actions[w])){console.error("[vuex] unknown local action type: "+v.type+", global type: "+w);return}return r.dispatch(w,u)},commit:B?r.commit:function(C,x,e){var v=tg(C,x,e),u=v.payload,t=v.options,w=v.type;if((!t||!t.root)&&(w=a+w,process.env.NODE_ENV!=="production"&&!r._mutations[w])){console.error("[vuex] unknown local mutation type: "+v.type+", global type: "+w);return}r.commit(w,u,t)}};return Object.defineProperties(J,{getters:{get:B?function(){return r.getters}:function(){return d3(r,a)}},state:{get:function(){return Iv(r.state,g)}}}),J}function d3(r,a){if(!r._makeLocalGettersCache[a]){var g={},B=a.length;Object.keys(r.getters).forEach(function(J){if(J.slice(0,B)===a){var C=J.slice(B);Object.defineProperty(g,C,{get:function(){return r.getters[J]},enumerable:!0})}}),r._makeLocalGettersCache[a]=g}return r._makeLocalGettersCache[a]}function rU(r,a,g,B){var J=r._mutations[a]||(r._mutations[a]=[]);J.push(function(C){g.call(r,B.state,C)})}function nU(r,a,g,B){var J=r._actions[a]||(r._actions[a]=[]);J.push(function(C){var x=g.call(r,{dispatch:B.dispatch,commit:B.commit,getters:B.getters,state:B.state,rootGetters:r.getters,rootState:r.state},C);return $j(x)||(x=Promise.resolve(x)),r._devtoolHook?x.catch(function(e){throw r._devtoolHook.emit("vuex:error",e),e}):x})}function iU(r,a,g,B){if(r._wrappedGetters[a]){process.env.NODE_ENV!=="production"&&console.error("[vuex] duplicate getter key: "+a);return}r._wrappedGetters[a]=function(J){return g(B.state,B.getters,J.state,J.getters)}}function aU(r){p.watch(function(){return r._state.data},function(){process.env.NODE_ENV!=="production"&&Xu(r._committing,"do not mutate vuex store state outside mutation handlers.")},{deep:!0,flush:"sync"})}function Iv(r,a){return a.reduce(function(g,B){return g[B]},r)}function tg(r,a,g){return l3(r)&&r.type&&(g=a,a=r,r=r.type),process.env.NODE_ENV!=="production"&&Xu(typeof r=="string","expects string as the type, but found "+typeof r+"."),{type:r,payload:a,options:g}}var oU="vuex bindings",h3="vuex:mutations",Rv="vuex:actions",Ip="vuex",sU=0;function lU(r,a){Zj({id:"org.vuejs.vuex",app:r,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[oU]},function(g){g.addTimelineLayer({id:h3,label:"Vuex Mutations",color:p3}),g.addTimelineLayer({id:Rv,label:"Vuex Actions",color:p3}),g.addInspector({id:Ip,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),g.on.getInspectorTree(function(B){if(B.app===r&&B.inspectorId===Ip)if(B.filter){var J=[];y3(J,a._modules.root,B.filter,""),B.rootNodes=J}else B.rootNodes=[g3(a._modules.root,"")]}),g.on.getInspectorState(function(B){if(B.app===r&&B.inspectorId===Ip){var J=B.nodeId;d3(a,J),B.state=dU(pU(a._modules,J),J==="root"?a.getters:a._makeLocalGettersCache,J)}}),g.on.editInspectorState(function(B){if(B.app===r&&B.inspectorId===Ip){var J=B.nodeId,C=B.path;J!=="root"&&(C=J.split("/").filter(Boolean).concat(C)),a._withCommit(function(){B.set(a._state.data,C,B.state.value)})}}),a.subscribe(function(B,J){var C={};B.payload&&(C.payload=B.payload),C.state=J,g.notifyComponentUpdate(),g.sendInspectorTree(Ip),g.sendInspectorState(Ip),g.addTimelineEvent({layerId:h3,event:{time:Date.now(),title:B.type,data:C}})}),a.subscribeAction({before:function(B,J){var C={};B.payload&&(C.payload=B.payload),B._id=sU++,B._time=Date.now(),C.state=J,g.addTimelineEvent({layerId:Rv,event:{time:B._time,title:B.type,groupId:B._id,subtitle:"start",data:C}})},after:function(B,J){var C={},x=Date.now()-B._time;C.duration={_custom:{type:"duration",display:x+"ms",tooltip:"Action duration",value:x}},B.payload&&(C.payload=B.payload),C.state=J,g.addTimelineEvent({layerId:Rv,event:{time:Date.now(),title:B.type,groupId:B._id,subtitle:"end",data:C}})}})})}var p3=8702998,cU=6710886,uU=16777215,f3={label:"namespaced",textColor:uU,backgroundColor:cU};function m3(r){return r&&r!=="root"?r.split("/").slice(-2,-1)[0]:"Root"}function g3(r,a){return{id:a||"root",label:m3(a),tags:r.namespaced?[f3]:[],children:Object.keys(r._children).map(function(g){return g3(r._children[g],a+g+"/")})}}function y3(r,a,g,B){B.includes(g)&&r.push({id:B||"root",label:B.endsWith("/")?B.slice(0,B.length-1):B||"Root",tags:a.namespaced?[f3]:[]}),Object.keys(a._children).forEach(function(J){y3(r,a._children[J],g,B+J+"/")})}function dU(r,a,g){a=g==="root"?a:a[g];var B=Object.keys(a),J={state:Object.keys(r.state).map(function(x){return{key:x,editable:!0,value:r.state[x]}})};if(B.length){var C=hU(a);J.getters=Object.keys(C).map(function(x){return{key:x.endsWith("/")?m3(x):x,editable:!1,value:Lv(function(){return C[x]})}})}return J}function hU(r){var a={};return Object.keys(r).forEach(function(g){var B=g.split("/");if(B.length>1){var J=a,C=B.pop();B.forEach(function(x){J[x]||(J[x]={_custom:{value:{},display:x,tooltip:"Module",abstract:!0}}),J=J[x]._custom.value}),J[C]=Lv(function(){return r[g]})}else a[g]=Lv(function(){return r[g]})}),a}function pU(r,a){var g=a.split("/").filter(function(B){return B});return g.reduce(function(B,J,C){var x=B[J];if(!x)throw new Error('Missing module "'+J+'" for path "'+a+'".');return C===g.length-1?x:x._children},a==="root"?r:r.root._children)}function Lv(r){try{return r()}catch(a){return a}}var Yu=function(r,a){this.runtime=a,this._children=Object.create(null),this._rawModule=r;var g=r.state;this.state=(typeof g=="function"?g():g)||{}},v3={namespaced:{configurable:!0}};v3.namespaced.get=function(){return!!this._rawModule.namespaced},Yu.prototype.addChild=function(r,a){this._children[r]=a},Yu.prototype.removeChild=function(r){delete this._children[r]},Yu.prototype.getChild=function(r){return this._children[r]},Yu.prototype.hasChild=function(r){return r in this._children},Yu.prototype.update=function(r){this._rawModule.namespaced=r.namespaced,r.actions&&(this._rawModule.actions=r.actions),r.mutations&&(this._rawModule.mutations=r.mutations),r.getters&&(this._rawModule.getters=r.getters)},Yu.prototype.forEachChild=function(r){Fh(this._children,r)},Yu.prototype.forEachGetter=function(r){this._rawModule.getters&&Fh(this._rawModule.getters,r)},Yu.prototype.forEachAction=function(r){this._rawModule.actions&&Fh(this._rawModule.actions,r)},Yu.prototype.forEachMutation=function(r){this._rawModule.mutations&&Fh(this._rawModule.mutations,r)},Object.defineProperties(Yu.prototype,v3);var jh=function(r){this.register([],r,!1)};jh.prototype.get=function(r){return r.reduce(function(a,g){return a.getChild(g)},this.root)},jh.prototype.getNamespace=function(r){var a=this.root;return r.reduce(function(g,B){return a=a.getChild(B),g+(a.namespaced?B+"/":"")},"")},jh.prototype.update=function(r){b3([],this.root,r)},jh.prototype.register=function(r,a,g){var B=this;g===void 0&&(g=!0),process.env.NODE_ENV!=="production"&&w3(r,a);var J=new Yu(a,g);if(r.length===0)this.root=J;else{var C=this.get(r.slice(0,-1));C.addChild(r[r.length-1],J)}a.modules&&Fh(a.modules,function(x,e){B.register(r.concat(e),x,g)})},jh.prototype.unregister=function(r){var a=this.get(r.slice(0,-1)),g=r[r.length-1],B=a.getChild(g);if(!B){process.env.NODE_ENV!=="production"&&console.warn("[vuex] trying to unregister module '"+g+"', which is not registered");return}B.runtime&&a.removeChild(g)},jh.prototype.isRegistered=function(r){var a=this.get(r.slice(0,-1)),g=r[r.length-1];return a?a.hasChild(g):!1};function b3(r,a,g){if(process.env.NODE_ENV!=="production"&&w3(r,g),a.update(g),g.modules)for(var B in g.modules){if(!a.getChild(B)){process.env.NODE_ENV!=="production"&&console.warn("[vuex] trying to add a new module '"+B+"' on hot reloading, manual reload is needed");return}b3(r.concat(B),a.getChild(B),g.modules[B])}}var x3={assert:function(r){return typeof r=="function"},expected:"function"},fU={assert:function(r){return typeof r=="function"||typeof r=="object"&&typeof r.handler=="function"},expected:'function or object with "handler" function'},_3={getters:x3,mutations:x3,actions:fU};function w3(r,a){Object.keys(_3).forEach(function(g){if(a[g]){var B=_3[g];Fh(a[g],function(J,C){Xu(B.assert(J),mU(r,g,C,J,B.expected))})}})}function mU(r,a,g,B,J){var C=a+" should be "+J+' but "'+a+"."+g+'"';return r.length>0&&(C+=' in module "'+r.join(".")+'"'),C+=" is "+JSON.stringify(B)+".",C}var Au=function r(a){var g=this;a===void 0&&(a={}),process.env.NODE_ENV!=="production"&&(Xu(typeof Promise<"u","vuex requires a Promise polyfill in this browser."),Xu(this instanceof r,"store must be called with the new operator."));var B=a.plugins;B===void 0&&(B=[]);var J=a.strict;J===void 0&&(J=!1);var C=a.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new jh(a),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=C;var x=this,e=this,v=e.dispatch,u=e.commit;this.dispatch=function(w,y){return v.call(x,w,y)},this.commit=function(w,y,b){return u.call(x,w,y,b)},this.strict=J;var t=this._modules.root.state;eg(this,t,[],this._modules.root),Ov(this,t),B.forEach(function(w){return w(g)})},zv={state:{configurable:!0}};Au.prototype.install=function(r,a){r.provide(a||Qj,this),r.config.globalProperties.$store=this;var g=this._devtools!==void 0?this._devtools:process.env.NODE_ENV!=="production"||!1;g&&lU(r,this)},zv.state.get=function(){return this._state.data},zv.state.set=function(r){process.env.NODE_ENV!=="production"&&Xu(!1,"use store.replaceState() to explicit replace store state.")},Au.prototype.commit=function(r,a,g){var B=this,J=tg(r,a,g),C=J.type,x=J.payload,e=J.options,v={type:C,payload:x},u=this._mutations[C];if(!u){process.env.NODE_ENV!=="production"&&console.error("[vuex] unknown mutation type: "+C);return}this._withCommit(function(){u.forEach(function(t){t(x)})}),this._subscribers.slice().forEach(function(t){return t(v,B.state)}),process.env.NODE_ENV!=="production"&&e&&e.silent&&console.warn("[vuex] mutation type: "+C+". Silent option has been removed. Use the filter functionality in the vue-devtools")},Au.prototype.dispatch=function(r,a){var g=this,B=tg(r,a),J=B.type,C=B.payload,x={type:J,payload:C},e=this._actions[J];if(!e){process.env.NODE_ENV!=="production"&&console.error("[vuex] unknown action type: "+J);return}try{this._actionSubscribers.slice().filter(function(u){return u.before}).forEach(function(u){return u.before(x,g.state)})}catch(u){process.env.NODE_ENV!=="production"&&(console.warn("[vuex] error in before action subscribers: "),console.error(u))}var v=e.length>1?Promise.all(e.map(function(u){return u(C)})):e[0](C);return new Promise(function(u,t){v.then(function(w){try{g._actionSubscribers.filter(function(y){return y.after}).forEach(function(y){return y.after(x,g.state)})}catch(y){process.env.NODE_ENV!=="production"&&(console.warn("[vuex] error in after action subscribers: "),console.error(y))}u(w)},function(w){try{g._actionSubscribers.filter(function(y){return y.error}).forEach(function(y){return y.error(x,g.state,w)})}catch(y){process.env.NODE_ENV!=="production"&&(console.warn("[vuex] error in error action subscribers: "),console.error(y))}t(w)})})},Au.prototype.subscribe=function(r,a){return c3(r,this._subscribers,a)},Au.prototype.subscribeAction=function(r,a){var g=typeof r=="function"?{before:r}:r;return c3(g,this._actionSubscribers,a)},Au.prototype.watch=function(r,a,g){var B=this;return process.env.NODE_ENV!=="production"&&Xu(typeof r=="function","store.watch only accepts a function."),p.watch(function(){return r(B.state,B.getters)},a,Object.assign({},g))},Au.prototype.replaceState=function(r){var a=this;this._withCommit(function(){a._state.data=r})},Au.prototype.registerModule=function(r,a,g){g===void 0&&(g={}),typeof r=="string"&&(r=[r]),process.env.NODE_ENV!=="production"&&(Xu(Array.isArray(r),"module path must be a string or an Array."),Xu(r.length>0,"cannot register the root module by using registerModule.")),this._modules.register(r,a),eg(this,this.state,r,this._modules.get(r),g.preserveState),Ov(this,this.state)},Au.prototype.unregisterModule=function(r){var a=this;typeof r=="string"&&(r=[r]),process.env.NODE_ENV!=="production"&&Xu(Array.isArray(r),"module path must be a string or an Array."),this._modules.unregister(r),this._withCommit(function(){var g=Iv(a.state,r.slice(0,-1));delete g[r[r.length-1]]}),u3(this)},Au.prototype.hasModule=function(r){return typeof r=="string"&&(r=[r]),process.env.NODE_ENV!=="production"&&Xu(Array.isArray(r),"module path must be a string or an Array."),this._modules.isRegistered(r)},Au.prototype.hotUpdate=function(r){this._modules.update(r),u3(this,!0)},Au.prototype._withCommit=function(r){var a=this._committing;this._committing=!0,r(),this._committing=a},Object.defineProperties(Au.prototype,zv);var gU=k3(function(r,a){var g={};return process.env.NODE_ENV!=="production"&&!Dv(a)&&console.error("[vuex] mapState: mapper parameter must be either an Array or an Object"),T3(a).forEach(function(B){var J=B.key,C=B.val;g[J]=function(){var x=this.$store.state,e=this.$store.getters;if(r){var v=S3(this.$store,"mapState",r);if(!v)return;x=v.context.state,e=v.context.getters}return typeof C=="function"?C.call(this,x,e):x[C]},g[J].vuex=!0}),g}),yU=k3(function(r,a){var g={};return process.env.NODE_ENV!=="production"&&!Dv(a)&&console.error("[vuex] mapGetters: mapper parameter must be either an Array or an Object"),T3(a).forEach(function(B){var J=B.key,C=B.val;C=r+C,g[J]=function(){if(!(r&&!S3(this.$store,"mapGetters",r))){if(process.env.NODE_ENV!=="production"&&!(C in this.$store.getters)){console.error("[vuex] unknown getter: "+C);return}return this.$store.getters[C]}},g[J].vuex=!0}),g});function T3(r){return Dv(r)?Array.isArray(r)?r.map(function(a){return{key:a,val:a}}):Object.keys(r).map(function(a){return{key:a,val:r[a]}}):[]}function Dv(r){return Array.isArray(r)||l3(r)}function k3(r){return function(a,g){return typeof a!="string"?(g=a,a=""):a.charAt(a.length-1)!=="/"&&(a+="/"),r(a,g)}}function S3(r,a,g){var B=r._modulesNamespaceMap[g];return process.env.NODE_ENV!=="production"&&!B&&console.error("[vuex] module namespace not found in "+a+"(): "+g),B}const vU=(r,a)=>{const g=r.__vccOpts||r;for(const[B,J]of a)g[B]=J;return g},bU={components:{GSCCheckbox:qj},props:{timeLivePossesion:{type:Number,default:6e4},game:{type:Object,default:()=>{}},widthSection:{type:Number,default:0},teamSelected:{type:Object,default:()=>({})},areInactiveVisible:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0},isDefault:{type:Boolean,default:!1}},watch:{game:{deep:!0,immediate:!0,async handler(r){r.is_live==1?(this.getDataPosession(r.gameId),this.intervalIdPossesion=setInterval(()=>{this.getDataPosession(r.gameId)},this.timeLivePossesion),this.$emit("intervalidpossesion",this.intervalIdPossesion)):r.game_status==1||r.game_status==0?this.getDataPosession(r.gameId):this.getDataPosessionPrematch(r.seasonId)}}},data(){return{dataPosession:[],arrTeams:[],intervalIdPossesion:null,containerSize:{width:0,height:0},url:"https://rwtfu33saa.execute-api.us-east-2.amazonaws.com/prod/ta/posessions/",urlPrematch:"https://rwtfu33saa.execute-api.us-east-2.amazonaws.com/prod/ta/seasons/",tokenPremium:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE",objectZeroValues:{numberValue:0,numberBarPercent:0}}},computed:{...gU("nextGeneral",["gameForAnalysis","seasonId"]),...yU("nextGeneral",["arrayFilledDataSortedByPriority"]),itemIndicadorStyle(){return this.containerSize.width<300&&this.areInactiveVisible?{width:"86%",marginLeft:"7%"}:{}},itemIndicadorValueStyle(){return this.containerSize.width<300?{fontSize:"calc(1.5vh - 2px)"}:{}},fieldDataContainerStyle(){return this.widthSection>520&&this.widthSection<=760?{width:`${Math.min(this.containerSize.width,this.containerSize.height*1.75)}px`,maxWidth:"100%"}:{}}},methods:{async getStatsData(r){},async getDataPosession(){try{const r=await js.create({headers:{Authorization:`${this.tokenPremium}`}}).get(this.url+this.game.gameId);this.dataPosession=r.data}catch(r){return Promise.reject(r)}},async getDataPosessionPrematch(r){try{const a=await js.create({headers:{Authorization:`${this.tokenPremium}`}}).get(this.urlPrematch+r+"/posessions");for(const g in a.data.teams)a.data.teams.hasOwnProperty(g)&&(this.arrTeams[g]=a.data.teams[g])}catch(a){return Promise.reject(a)}},onCheckInactive(r){this.$emit("update:areInactiveVisible",r)},deleteDecimalZero(r){const a=typeof r=="string"?parseFloat(r):r;return typeof a=="number"&&!isNaN(a)?a%1===0?a:a%1===0?Math.floor(a):a:r},formatNumbers(r){return r%1!==0?r.toFixed(1):r},hVal(r){return this.getTeamValue(r,this.gameForAnalysis,"homeTeam")},aVal(r){return this.getTeamValue(r,this.gameForAnalysis,"visitingTeam")},getTeamValue(r,a,g){if(!a.game_id)return this.objectZeroValues;const B=r.homeTeam.accomplished.avgPostGame+r.visitingTeam.accomplished.avgPostGame,J=r[g].accomplished.avgPostGame/B;return r[g].accomplished.avgPostGame?{numberValue:J<1?J*100:J,numberBarPercent:r[g].accomplished.avgPostGame/B}:this.objectZeroValues},calculateContainerSize(){if(this.$refs.containerRef){const r=this.$refs.containerRef.getBoundingClientRect();this.containerSize={width:Math.round(r.width),height:Math.round(r.height)}}}},created(){},mounted(){this.$nextTick(()=>{this.calculateContainerSize()}),window.addEventListener("resize",this.calculateContainerSize)},beforeUnmount(){clearInterval(this.intervalIdPossesion),window.removeEventListener("resize",this.calculateContainerSize)}},xU={class:"field-posesion-prominent",ref:"containerRef"},_U={key:0,class:"title"},wU={class:"info-data-item"},TU={key:1},kU={key:0,class:"inactiveInfo"},SU={class:"info-data-item"},EU={class:"info-data-item"},AU={key:1},CU={class:"info-data-item"},MU={key:0,class:"inactiveInfo"},PU={class:"info-data-item"},NU={class:"info-data-item"};function OU(r,a,g,B,J,C){var x,e,v,u;return p.openBlock(),p.createElementBlock("div",xU,[g.widthSection>760&&g.showTitle?(p.openBlock(),p.createElementBlock("div",_U,"Porcentajes")):p.createCommentVNode("",!0),g.game.game_status==1||g.game.game_status==0||g.game.is_live==1?(p.openBlock(),p.createElementBlock("div",{key:1,class:p.normalizeClass(g.widthSection>760?"field-container":g.widthSection>520?"field-container-movil":g.widthSection>440?"field-container-movil-2":g.widthSection>360?"field-container-movil-3":"field-container-movil-4"),style:p.normalizeStyle(J.containerSize.width<400?{paddingTop:"5px",paddingBottom:"5px"}:{})},[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>1020?"field-data-container":g.widthSection>920?"field-data-container-xl":g.widthSection>880?"field-data-container-xl-2":g.widthSection>820?"field-data-container-xl-3":g.widthSection>760?"field-data-container-xl-4":"field-data-container-movil")},[p.createElementVNode("div",{class:p.normalizeClass(g.areInactiveVisible?"container-data-img-home":"container-data-img-home50")},[p.createElementVNode("div",{class:p.normalizeClass(g.areInactiveVisible?"homeInfo":"homeInfo50"),style:p.normalizeStyle({backgroundImage:g.isDefault?"url(https://golstatsimages.blob.core.windows.net/reports-images/esc-local-generico.svg)":"url("+g.game.homeTeam.logo.replace("80","150")+")",opacity:g.isDefault?.45:.2})},null,6),p.createElementVNode("div",wU,[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"item-ref-data":"item-ref-data-movil")},[p.createElementVNode("div",{class:"item-indicador",style:p.normalizeStyle(C.itemIndicadorStyle)},[p.createElementVNode("div",{class:"item-indicador-value",style:p.normalizeStyle(C.itemIndicadorValueStyle)},[((x=J.dataPosession)==null?void 0:x.has_posession)==1?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[g.areInactiveVisible?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode(p.toDisplayString(g.isDefault?"00%":J.dataPosession.active_time.home),1)],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(g.isDefault?"00%":J.dataPosession.home),1)],64))],64)):(p.openBlock(),p.createElementBlock("span",TU,"%"))],4),a[0]||(a[0]=p.createElementVNode("div",{class:"item-indicador-img"},[p.createElementVNode("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.87817 5.92969L0.506034 0.0889796L7.2503 0.0889802L3.87817 5.92969Z",fill:"#38CFFF"})])],-1))],4),p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})}," Pos. "+p.toDisplayString(g.isDefault?"LOC":g.game.homeTeam.acronym),7)],2)])],2),g.areInactiveVisible&&((e=J.dataPosession)==null?void 0:e.has_posession)==1?(p.openBlock(),p.createElementBlock("div",kU,[p.createElementVNode("div",SU,[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"item-ref-data":"item-ref-data-movil")},[p.createElementVNode("div",{class:"item-indicador",style:p.normalizeStyle(C.itemIndicadorStyle)},[p.createElementVNode("div",{class:"item-indicador-value",style:p.normalizeStyle(C.itemIndicadorValueStyle)},p.toDisplayString(g.isDefault?"00%":J.dataPosession.active_time.inactive_time),5),a[1]||(a[1]=p.createElementVNode("div",{class:"item-indicador-img"},[p.createElementVNode("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.87817 5.92969L0.506034 0.0889796L7.2503 0.0889802L3.87817 5.92969Z",fill:"#38CFFF"})])],-1))],4),p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})},[g.widthSection>580?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode("T. Inactivo")],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode("T. Inactivo")],64))],6)],2)])])):p.createCommentVNode("",!0),p.createElementVNode("div",{class:p.normalizeClass(g.areInactiveVisible?"container-data-img-away":"container-data-img-away50")},[p.createElementVNode("div",{class:p.normalizeClass(g.areInactiveVisible?"awayInfo":"awayInfo50"),style:p.normalizeStyle({backgroundImage:g.isDefault?"url(https://golstatsimages.blob.core.windows.net/reports-images/esc-visita-generico.svg)":"url("+g.game.awayTeam.logo.replace("80","150")+")",opacity:g.isDefault?.45:.2})},null,6),p.createElementVNode("div",EU,[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"item-ref-data":"item-ref-data-movil")},[p.createElementVNode("div",{class:"item-indicador",style:p.normalizeStyle(C.itemIndicadorStyle)},[p.createElementVNode("div",{class:"item-indicador-value",style:p.normalizeStyle(C.itemIndicadorValueStyle)},[((v=J.dataPosession)==null?void 0:v.has_posession)==1?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[g.areInactiveVisible?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode(p.toDisplayString(g.isDefault?"00%":J.dataPosession.active_time.away),1)],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(g.isDefault?"00%":J.dataPosession.away),1)],64))],64)):(p.openBlock(),p.createElementBlock("span",AU,"%"))],4),a[2]||(a[2]=p.createElementVNode("div",{class:"item-indicador-img"},[p.createElementVNode("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.87817 5.92969L0.506034 0.0889796L7.2503 0.0889802L3.87817 5.92969Z",fill:"#38CFFF"})])],-1))],4),p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})}," Pos. "+p.toDisplayString(g.isDefault?"VIS":g.game.awayTeam.acronym),7)],2)])],2)],2)],6)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:2},[J.arrTeams.length>0?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(g.widthSection>760?"field-container":g.widthSection>520?"field-container-movil":g.widthSection>440?"field-container-movil-2":g.widthSection>360?"field-container-movil-3":"field-container-movil-4"),style:p.normalizeStyle(J.containerSize.width<400?{paddingTop:"4px",paddingBottom:"4px"}:{})},[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>1020?"field-data-container":g.widthSection>920?"field-data-container-xl":g.widthSection>880?"field-data-container-xl-2":g.widthSection>820?"field-data-container-xl-3":g.widthSection>760?"field-data-container-xl-4":"field-data-container-movil")},[p.createElementVNode("div",{class:p.normalizeClass(g.areInactiveVisible?"container-data-img-home":"container-data-img-home50")},[g.game.homeTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(g.areInactiveVisible?"homeInfo":"homeInfo50"),style:p.normalizeStyle({backgroundImage:g.isDefault?"url(https://golstatsimages.blob.core.windows.net/reports-images/esc-local-generico.svg)":"url("+g.game.homeTeam.logo.replace("80","150")+")",opacity:g.isDefault?.45:.2})},null,6)):p.createCommentVNode("",!0),p.createElementVNode("div",CU,[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"item-ref-data":"item-ref-data-movil")},[p.createElementVNode("div",{class:"item-indicador",style:p.normalizeStyle(C.itemIndicadorStyle)},[p.createElementVNode("div",{class:"item-indicador-value",style:p.normalizeStyle(C.itemIndicadorValueStyle)},[g.areInactiveVisible?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[g.game.awayTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].active_time.away),1)],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].active_time.home),1)],64))],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[g.game.awayTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].away),1)],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].home),1)],64))],64))],4),a[3]||(a[3]=p.createElementVNode("div",{class:"item-indicador-img"},[p.createElementVNode("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.87817 5.92969L0.506034 0.0889796L7.2503 0.0889802L3.87817 5.92969Z",fill:"#38CFFF"})])],-1))],4),g.game.homeTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})}," Pos. "+p.toDisplayString(g.isDefault?"LOC":g.game.homeTeam.acronym),7)):(p.openBlock(),p.createElementBlock("div",{key:1,class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})}," Pos. Rival ",6))],2)])],2),g.areInactiveVisible&&((u=J.arrTeams[g.teamSelected.teamId])==null?void 0:u.has_posession)==1?(p.openBlock(),p.createElementBlock("div",MU,[p.createElementVNode("div",PU,[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"item-ref-data":"item-ref-data-movil")},[p.createElementVNode("div",{class:"item-indicador",style:p.normalizeStyle(C.itemIndicadorStyle)},[p.createElementVNode("div",{class:"item-indicador-value",style:p.normalizeStyle(C.itemIndicadorValueStyle)},p.toDisplayString(g.isDefault?"00%":J.arrTeams[g.teamSelected.teamId].active_time.inactive_time),5),a[4]||(a[4]=p.createElementVNode("div",{class:"item-indicador-img"},[p.createElementVNode("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.87817 5.92969L0.506034 0.0889796L7.2503 0.0889802L3.87817 5.92969Z",fill:"#38CFFF"})])],-1))],4),p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})},[g.widthSection>580?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode("T. Inactivo")],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode("T. Inactivo")],64))],6)],2)])])):p.createCommentVNode("",!0),p.createElementVNode("div",{class:p.normalizeClass(g.areInactiveVisible?"container-data-img-away":"container-data-img-away50")},[g.game.awayTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(g.areInactiveVisible?"awayInfo":"awayInfo50"),style:p.normalizeStyle({backgroundImage:g.isDefault?"url(https://golstatsimages.blob.core.windows.net/reports-images/esc-visita-generico.svg)":"url("+g.game.awayTeam.logo.replace("80","150")+")",opacity:g.isDefault?.45:.2})},null,6)):p.createCommentVNode("",!0),p.createElementVNode("div",NU,[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"item-ref-data":"item-ref-data-movil")},[p.createElementVNode("div",{class:"item-indicador",style:p.normalizeStyle(C.itemIndicadorStyle)},[p.createElementVNode("div",{class:"item-indicador-value",style:p.normalizeStyle(C.itemIndicadorValueStyle)},[g.areInactiveVisible?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[g.game.homeTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].active_time.away),1)],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].active_time.home),1)],64))],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[g.game.homeTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].away),1)],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].home),1)],64))],64))],4),a[5]||(a[5]=p.createElementVNode("div",{class:"item-indicador-img"},[p.createElementVNode("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.87817 5.92969L0.506034 0.0889796L7.2503 0.0889802L3.87817 5.92969Z",fill:"#38CFFF"})])],-1))],4),g.game.awayTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})}," Pos. "+p.toDisplayString(g.isDefault?"VIS":g.game.awayTeam.acronym),7)):(p.openBlock(),p.createElementBlock("div",{key:1,class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})}," Pos. Rival ",6))],2)])],2)],2)],6)):p.createCommentVNode("",!0)],64))],512)}const E3=vU(bU,[["render",OU],["__scopeId","data-v-c04e7fc0"]]),IU=(r,a)=>{const g=r.__vccOpts||r;for(const[B,J]of a)g[B]=J;return g},RU=["src"],LU=["src"],zU={class:"gsc-ms-team gsc-ms-team--left"},DU=["src","alt"],BU={class:"gsc-ms-name"},VU={class:"gsc-ms-center"},FU={class:"gsc-ms-stage"},jU={class:"gsc-ms-score"},UU={class:"gsc-ms-status"},qU={class:"gsc-ms-team gsc-ms-team--right"},WU=["src","alt"],GU={class:"gsc-ms-name"},HU=["src","alt"],XU={key:0,class:"gsc-ms-events-row-default"},YU={key:1,class:"gsc-ms-events-grid"},JU={class:"gsc-ms-events-side gsc-ms-events-side--left"},KU={class:"gsc-ms-events-line"},ZU={key:0,class:"gsc-ms-event-item gsc-ms-event-item--goal-icon"},QU={key:0,class:"gsc-ms-event-item gsc-ms-event-item--yellow"},$U={class:"gsc-ms-event-count"},eq={key:1,class:"gsc-ms-event-item gsc-ms-event-item--red"},tq={class:"gsc-ms-event-count"},rq={class:"gsc-ms-events-side gsc-ms-events-side--right"},nq={class:"gsc-ms-events-line"},iq={key:0,class:"gsc-ms-event-item gsc-ms-event-item--yellow"},aq={class:"gsc-ms-event-count"},oq={key:1,class:"gsc-ms-event-item gsc-ms-event-item--red"},sq={class:"gsc-ms-event-count"},lq={key:1,class:"gsc-ms-event-item gsc-ms-event-item--goal-icon"},cq={class:"gsc-ms-breakdown-col gsc-ms-breakdown-col--left"},uq={class:"gsc-ms-breakdown-team"},dq=["src","alt"],hq={class:"gsc-ms-breakdown-abbr"},pq={class:"gsc-ms-breakdown-list"},fq=["src","alt"],mq={key:1,class:"gsc-ms-breakdown-min"},gq={class:"gsc-ms-breakdown-col gsc-ms-breakdown-col--center"},yq={class:"gsc-ms-breakdown-title"},vq={class:"gsc-ms-breakdown-col gsc-ms-breakdown-col--right"},bq={class:"gsc-ms-breakdown-team"},xq={class:"gsc-ms-breakdown-abbr"},_q=["src","alt"],wq={class:"gsc-ms-breakdown-list"},Tq={key:0,class:"gsc-ms-breakdown-min"},kq=["src","alt"],Sq=585,A3="https://golstatsimages.blob.core.windows.net/todoelfut/lineups/escudo1.png",C3="https://golstatsimages.blob.core.windows.net/todoelfut/lineups/escudo2.png",Eq={__name:"gsc-match-summary",props:{desplegable:{type:Boolean,default:!1},game:{type:Object,required:!0},defaultShields:{type:Boolean,default:!1}},setup(r){const a=r,g=p.ref(null),B=p.ref(0),J={chico:400,mediano:580},C=p.ref("grande");function x(){if(!g.value)return;const k=g.value.offsetWidth;console.log("width: --->",k),B.value=k,k<J.chico?C.value="chico":k<J.mediano?C.value="mediano":C.value="grande",console.log("Ancho del contenedor:",k,"->",C.value)}let e=null;p.onMounted(()=>{x(),e=new window.ResizeObserver(x),g.value&&e.observe(g.value)}),p.onBeforeUnmount(()=>{e&&g.value&&e.unobserve(g.value)});const v=p.computed(()=>`gsc-ms--${C.value}`),u=p.computed(()=>a.defaultShields?{...a.game.homeTeam,logo:A3}:a.game.homeTeam),t=p.computed(()=>a.defaultShields?{...a.game.awayTeam,logo:C3}:a.game.awayTeam),w=p.computed(()=>a.game.score),y=p.computed(()=>a.game.matchday_name.replace("Matchday","Jornada").replace("de Final","").replace("Playoffs 1","Cuartos de Final Ida").replace("Playoffs 2","Cuartos de Final Vuelta").replace("Playoffs 3","Semifinal Ida").replace("Playoffs 4","Semifinal Vuelta").replace("Playoffs 5","Final Ida").replace("Playoffs 6","Final Vuelta")),b=p.computed(()=>{const k=a.game.game_status;return k===1?"Finalizado":k===2?"En Vivo":k===3?"Pendiente":"Desconocido"}),h=p.computed(()=>{var k;return((k=a.game.minutes)==null?void 0:k.home_goals_minutes)||[]}),n=p.computed(()=>{var k;return((k=a.game.minutes)==null?void 0:k.visiting_goals_minutes)||[]}),i=p.computed(()=>{var k;return((k=a.game.minutes)==null?void 0:k.home_yellow_cards_minutes)||[]}),d=p.computed(()=>{var k;return((k=a.game.minutes)==null?void 0:k.away_yellow_cards_minutes)||[]}),s=p.computed(()=>{var k;return((k=a.game.minutes)==null?void 0:k.home_red_cards_minutes)||[]}),c=p.computed(()=>{var k;return((k=a.game.minutes)==null?void 0:k.away_red_cards_minutes)||[]}),f=p.computed(()=>h.value.length),m=p.computed(()=>n.value.length),T=p.computed(()=>i.value.length),E=p.computed(()=>d.value.length),S=p.computed(()=>s.value.length),P=p.computed(()=>c.value.length),N=k=>{if(k.length===0)return[];const I=[];for(let _=0;_<k.length;_+=4){const R=k.slice(_,_+4).map(z=>{const V=z.match(/(\d+\s*\+\s*\d+|\d+)\'?$/);return V?V[1]+"'":z}).join(", ");I.push(R)}return I},A=k=>k.length===0?[]:[k.map(I=>{const _=I.match(/(\d+\s*\+\s*\d+|\d+)\'?$/);return _?_[1]+"'":I}).join(", ")],O=p.computed(()=>{const k=[];if(h.value.forEach(I=>{const _=I.match(/^(.+?)\s+(\d+\s*\+\s*\d+|\d+)\'?$/);if(_){const[,R,z]=_;k.push({type:"gol",player:R.trim(),minute:z+"'",icon:"https://golstatsimages.blob.core.windows.net/reports-images/gol.svg"})}}),i.value.forEach(I=>{const _=I.match(/^(.+?)\s+(\d+\s*\+\s*\d+|\d+)\'?$/);if(_){const[,R,z]=_;k.push({type:"amarilla",player:R.trim(),minute:z+"'",icon:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-amarilla.svg"})}}),s.value.forEach(I=>{const _=I.match(/^(.+?)\s+(\d+\s*\+\s*\d+|\d+)\'?$/);if(_){const[,R,z]=_;k.push({type:"roja",player:R.trim(),minute:z+"'",icon:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-roja.svg"})}}),k.length>9){const I=k.slice(0,9);return I.push({type:"more",player:"...",minute:"",icon:""}),I}return k}),M=p.computed(()=>{const k=[];if(n.value.forEach(I=>{const _=I.match(/^(.+?)\s+(\d+\s*\+\s*\d+|\d+)\'?$/);if(_){const[,R,z]=_;k.push({type:"gol",player:R.trim(),minute:z+"'",icon:"https://golstatsimages.blob.core.windows.net/reports-images/gol.svg"})}}),d.value.forEach(I=>{const _=I.match(/^(.+?)\s+(\d+\s*\+\s*\d+|\d+)\'?$/);if(_){const[,R,z]=_;k.push({type:"amarilla",player:R.trim(),minute:z+"'",icon:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-amarilla.svg"})}}),c.value.forEach(I=>{const _=I.match(/^(.+?)\s+(\d+\s*\+\s*\d+|\d+)\'?$/);if(_){const[,R,z]=_;k.push({type:"roja",player:R.trim(),minute:z+"'",icon:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-roja.svg"})}}),k.length>9){const I=k.slice(0,9);return I.push({type:"more",player:"...",minute:"",icon:""}),I}return k});return(k,I)=>(p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["gsc-match-summary",v.value]),ref_key:"containerRef",ref:g},[p.createElementVNode("img",{class:p.normalizeClass(["gsc-ms-bg-shield","gsc-ms-bg-shield--left",{"gsc-ms-bg-shield--default":a.defaultShields},{"gsc-ms-bg-shield--small":B.value<=370},{"gsc-ms-bg-shield--tiny":B.value<=280}]),src:a.defaultShields?A3:u.value.logo,alt:"Escudo fondo Home"},null,10,RU),p.createElementVNode("img",{class:p.normalizeClass(["gsc-ms-bg-shield","gsc-ms-bg-shield--right",{"gsc-ms-bg-shield--default":a.defaultShields},{"gsc-ms-bg-shield--small":B.value<=370},{"gsc-ms-bg-shield--tiny":B.value<=280}]),src:a.defaultShields?C3:t.value.logo,alt:"Escudo fondo Away"},null,10,LU),p.createElementVNode("div",{class:p.normalizeClass(["gsc-ms-header",[{"gsc-ms-header--vertical-names":B.value<=370},{"gsc-ms-header--small-shields":B.value<=370&&B.value>280},{"gsc-ms-header--tiny":B.value<=280}]])},[p.createElementVNode("div",zU,[p.createElementVNode("img",{class:p.normalizeClass(["gsc-ms-shield",{"gsc-ms-shield--no-radius":a.defaultShields}]),src:u.value.logo,alt:`Escudo ${u.value.acronym}`},null,10,DU),p.createElementVNode("span",BU,p.toDisplayString(a.defaultShields?"LOC":u.value.acronym),1)]),p.createElementVNode("div",VU,[p.createElementVNode("div",FU,p.toDisplayString(a.defaultShields?"Jornada":y.value),1),p.createElementVNode("div",jU,[p.createElementVNode("span",null,p.toDisplayString(a.defaultShields?"-":w.value[0]),1),I[0]||(I[0]=p.createElementVNode("span",null,":",-1)),p.createElementVNode("span",null,p.toDisplayString(a.defaultShields?"-":w.value[1]),1)]),p.createElementVNode("div",UU,p.toDisplayString(a.defaultShields?"-":b.value),1)]),p.createElementVNode("div",qU,[B.value<=370?(p.openBlock(),p.createElementBlock("img",{key:0,class:p.normalizeClass(["gsc-ms-shield",{"gsc-ms-shield--no-radius":a.defaultShields}]),src:t.value.logo,alt:`Escudo ${t.value.acronym}`},null,10,WU)):p.createCommentVNode("",!0),p.createElementVNode("span",GU,p.toDisplayString(a.defaultShields?"VIS":t.value.acronym),1),B.value>370?(p.openBlock(),p.createElementBlock("img",{key:1,class:p.normalizeClass(["gsc-ms-shield",{"gsc-ms-shield--no-radius":a.defaultShields}]),src:t.value.logo,alt:`Escudo ${t.value.acronym}`},null,10,HU)):p.createCommentVNode("",!0)])],2),p.createElementVNode("div",{class:p.normalizeClass(["gsc-ms-events-row",[{"gsc-ms-events-row--mb":!r.desplegable},{"gsc-ms-events-row--small":B.value<=480&&B.value>465},{"gsc-ms-events-row--tiny":B.value<=465},{"gsc-ms-events-row--micro":B.value<=270}]])},[a.defaultShields?(p.openBlock(),p.createElementBlock("div",XU)):(p.openBlock(),p.createElementBlock("div",YU,[p.createElementVNode("div",JU,[p.createElementVNode("div",KU,[f.value>0?(p.openBlock(),p.createElementBlock("div",ZU,I[1]||(I[1]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/gol.svg",class:"gsc-ms-icon",alt:"Gol"},null,-1)]))):p.createCommentVNode("",!0),f.value>0?(p.openBlock(),p.createElementBlock("div",{key:1,class:p.normalizeClass(["gsc-ms-event-item gsc-ms-event-item--goals",[{"gsc-ms-event-item--goals-wide":B.value>=585},{"gsc-ms-event-item--goals-micro":B.value<=245},{"gsc-ms-event-item--goals-few":f.value<=3}]])},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(B.value>=585?A(h.value):N(h.value),(_,R)=>(p.openBlock(),p.createElementBlock("div",{key:`home-goals-line-${R}`,class:"gsc-ms-minutes-line"},p.toDisplayString(_),1))),128))],2)):p.createCommentVNode("",!0),p.createElementVNode("div",{class:p.normalizeClass(["gsc-ms-cards-container",{"gsc-ms-cards-container--vertical":B.value<=340}])},[T.value>0?(p.openBlock(),p.createElementBlock("div",QU,[I[2]||(I[2]=p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-amarilla.svg",class:"gsc-ms-icon tarjeta-amarilla",alt:"Amarilla"},null,-1)),p.createElementVNode("span",$U,p.toDisplayString(T.value),1)])):p.createCommentVNode("",!0),S.value>0?(p.openBlock(),p.createElementBlock("div",eq,[I[3]||(I[3]=p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-roja.svg",class:"gsc-ms-icon tarjeta-roja",alt:"Roja"},null,-1)),p.createElementVNode("span",tq,p.toDisplayString(S.value),1)])):p.createCommentVNode("",!0)],2)])]),p.createElementVNode("div",{class:p.normalizeClass(["gsc-ms-events-separator",{"gsc-ms-events-separator--hidden":B.value<=350}])},null,2),p.createElementVNode("div",rq,[p.createElementVNode("div",nq,[p.createElementVNode("div",{class:p.normalizeClass(["gsc-ms-cards-container",{"gsc-ms-cards-container--vertical":B.value<=340}])},[E.value>0?(p.openBlock(),p.createElementBlock("div",iq,[I[4]||(I[4]=p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-amarilla.svg",class:"gsc-ms-icon tarjeta-amarilla",alt:"Amarilla"},null,-1)),p.createElementVNode("span",aq,p.toDisplayString(E.value),1)])):p.createCommentVNode("",!0),P.value>0?(p.openBlock(),p.createElementBlock("div",oq,[I[5]||(I[5]=p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-roja.svg",class:"gsc-ms-icon tarjeta-roja",alt:"Roja"},null,-1)),p.createElementVNode("span",sq,p.toDisplayString(P.value),1)])):p.createCommentVNode("",!0)],2),m.value>0?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(["gsc-ms-event-item gsc-ms-event-item--goals",[{"gsc-ms-event-item--goals-wide":B.value>=585},{"gsc-ms-event-item--goals-micro":B.value<=245},{"gsc-ms-event-item--goals-few":m.value<=3}]])},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(B.value>=585?A(n.value):N(n.value),(_,R)=>(p.openBlock(),p.createElementBlock("div",{key:`away-goals-line-${R}`,class:"gsc-ms-minutes-line"},p.toDisplayString(_),1))),128))],2)):p.createCommentVNode("",!0),m.value>0?(p.openBlock(),p.createElementBlock("div",lq,I[6]||(I[6]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/gol.svg",class:"gsc-ms-icon",alt:"Gol"},null,-1)]))):p.createCommentVNode("",!0)])])]))],2),r.desplegable?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(["gsc-ms-breakdown",{"gsc-ms-breakdown--mobile":B.value<Sq},{"gsc-ms-breakdown--tiny":B.value<=280}])},[p.createElementVNode("div",cq,[p.createElementVNode("div",uq,[p.createElementVNode("img",{src:u.value.logo,class:"gsc-ms-breakdown-shield",alt:`Escudo ${u.value.acronym}`},null,8,dq),p.createElementVNode("span",hq,p.toDisplayString(a.defaultShields?"LOC":u.value.acronym),1)]),p.createElementVNode("ul",pq,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(O.value,_=>(p.openBlock(),p.createElementBlock("li",{key:`home-${_.player}-${_.minute}`},[_.type!=="more"?(p.openBlock(),p.createElementBlock("img",{key:0,src:_.icon,class:p.normalizeClass(["gsc-ms-icon",{"tarjeta-amarilla":_.type==="amarilla","tarjeta-roja":_.type==="roja"}]),alt:_.type==="gol"?"Gol":_.type==="amarilla"?"Amarilla":"Roja"},null,10,fq)):p.createCommentVNode("",!0),p.createElementVNode("span",{class:p.normalizeClass(["gsc-ms-breakdown-player",{"gsc-ms-breakdown-more":_.type==="more"}])},p.toDisplayString(_.player),3),_.type!=="more"?(p.openBlock(),p.createElementBlock("span",mq,p.toDisplayString(_.minute),1)):p.createCommentVNode("",!0)]))),128))])]),p.createElementVNode("div",gq,[p.createElementVNode("div",yq,[k.size==="chico"?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[I[7]||(I[7]=p.createTextVNode(" Desglose")),I[8]||(I[8]=p.createElementVNode("br",null,null,-1)),I[9]||(I[9]=p.createTextVNode("de eventos "))],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(" Desglose de eventos ")],64))])]),p.createElementVNode("div",vq,[p.createElementVNode("div",bq,[p.createElementVNode("span",xq,p.toDisplayString(a.defaultShields?"VIS":t.value.acronym),1),p.createElementVNode("img",{src:t.value.logo,class:"gsc-ms-breakdown-shield",alt:`Escudo ${t.value.acronym}`},null,8,_q)]),p.createElementVNode("ul",wq,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(M.value,_=>(p.openBlock(),p.createElementBlock("li",{key:`away-${_.player}-${_.minute}`},[_.type!=="more"?(p.openBlock(),p.createElementBlock("span",Tq,p.toDisplayString(_.minute),1)):p.createCommentVNode("",!0),p.createElementVNode("span",{class:p.normalizeClass(["gsc-ms-breakdown-player",{"gsc-ms-breakdown-more":_.type==="more"}])},p.toDisplayString(_.player),3),_.type!=="more"?(p.openBlock(),p.createElementBlock("img",{key:1,src:_.icon,class:p.normalizeClass(["gsc-ms-icon",{"tarjeta-amarilla":_.type==="amarilla","tarjeta-roja":_.type==="roja"}]),alt:_.type==="gol"?"Gol":_.type==="amarilla"?"Amarilla":"Roja"},null,10,kq)):p.createCommentVNode("",!0)]))),128))])])],2)):p.createCommentVNode("",!0)],2))}},M3=IU(Eq,[["__scopeId","data-v-ba9a8434"]]);function P3(r,a){return function(){return r.apply(a,arguments)}}const{toString:Aq}=Object.prototype,{getPrototypeOf:Bv}=Object,{iterator:rg,toStringTag:N3}=Symbol,ng=(r=>a=>{const g=Aq.call(a);return r[g]||(r[g]=g.slice(8,-1).toLowerCase())})(Object.create(null)),Ju=r=>(r=r.toLowerCase(),a=>ng(a)===r),ig=r=>a=>typeof a===r,{isArray:Rp}=Array,Bf=ig("undefined");function Vf(r){return r!==null&&!Bf(r)&&r.constructor!==null&&!Bf(r.constructor)&&lu(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const O3=Ju("ArrayBuffer");function Cq(r){let a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(r):a=r&&r.buffer&&O3(r.buffer),a}const Mq=ig("string"),lu=ig("function"),I3=ig("number"),Ff=r=>r!==null&&typeof r=="object",Pq=r=>r===!0||r===!1,ag=r=>{if(ng(r)!=="object")return!1;const a=Bv(r);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(N3 in r)&&!(rg in r)},Nq=r=>{if(!Ff(r)||Vf(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},Oq=Ju("Date"),Iq=Ju("File"),Rq=Ju("Blob"),Lq=Ju("FileList"),zq=r=>Ff(r)&&lu(r.pipe),Dq=r=>{let a;return r&&(typeof FormData=="function"&&r instanceof FormData||lu(r.append)&&((a=ng(r))==="formdata"||a==="object"&&lu(r.toString)&&r.toString()==="[object FormData]"))},Bq=Ju("URLSearchParams"),[Vq,Fq,jq,Uq]=["ReadableStream","Request","Response","Headers"].map(Ju),qq=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function jf(r,a,{allOwnKeys:g=!1}={}){if(r===null||typeof r>"u")return;let B,J;if(typeof r!="object"&&(r=[r]),Rp(r))for(B=0,J=r.length;B<J;B++)a.call(null,r[B],B,r);else{if(Vf(r))return;const C=g?Object.getOwnPropertyNames(r):Object.keys(r),x=C.length;let e;for(B=0;B<x;B++)e=C[B],a.call(null,r[e],e,r)}}function R3(r,a){if(Vf(r))return null;a=a.toLowerCase();const g=Object.keys(r);let B=g.length,J;for(;B-- >0;)if(J=g[B],a===J.toLowerCase())return J;return null}const Uh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,L3=r=>!Bf(r)&&r!==Uh;function Vv(){const{caseless:r}=L3(this)&&this||{},a={},g=(B,J)=>{const C=r&&R3(a,J)||J;ag(a[C])&&ag(B)?a[C]=Vv(a[C],B):ag(B)?a[C]=Vv({},B):Rp(B)?a[C]=B.slice():a[C]=B};for(let B=0,J=arguments.length;B<J;B++)arguments[B]&&jf(arguments[B],g);return a}const Wq=(r,a,g,{allOwnKeys:B}={})=>(jf(a,(J,C)=>{g&&lu(J)?r[C]=P3(J,g):r[C]=J},{allOwnKeys:B}),r),Gq=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Hq=(r,a,g,B)=>{r.prototype=Object.create(a.prototype,B),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:a.prototype}),g&&Object.assign(r.prototype,g)},Xq=(r,a,g,B)=>{let J,C,x;const e={};if(a=a||{},r==null)return a;do{for(J=Object.getOwnPropertyNames(r),C=J.length;C-- >0;)x=J[C],(!B||B(x,r,a))&&!e[x]&&(a[x]=r[x],e[x]=!0);r=g!==!1&&Bv(r)}while(r&&(!g||g(r,a))&&r!==Object.prototype);return a},Yq=(r,a,g)=>{r=String(r),(g===void 0||g>r.length)&&(g=r.length),g-=a.length;const B=r.indexOf(a,g);return B!==-1&&B===g},Jq=r=>{if(!r)return null;if(Rp(r))return r;let a=r.length;if(!I3(a))return null;const g=new Array(a);for(;a-- >0;)g[a]=r[a];return g},Kq=(r=>a=>r&&a instanceof r)(typeof Uint8Array<"u"&&Bv(Uint8Array)),Zq=(r,a)=>{const g=(r&&r[rg]).call(r);let B;for(;(B=g.next())&&!B.done;){const J=B.value;a.call(r,J[0],J[1])}},Qq=(r,a)=>{let g;const B=[];for(;(g=r.exec(a))!==null;)B.push(g);return B},$q=Ju("HTMLFormElement"),eW=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,g,B){return g.toUpperCase()+B}),z3=(({hasOwnProperty:r})=>(a,g)=>r.call(a,g))(Object.prototype),tW=Ju("RegExp"),D3=(r,a)=>{const g=Object.getOwnPropertyDescriptors(r),B={};jf(g,(J,C)=>{let x;(x=a(J,C,r))!==!1&&(B[C]=x||J)}),Object.defineProperties(r,B)},rW=r=>{D3(r,(a,g)=>{if(lu(r)&&["arguments","caller","callee"].indexOf(g)!==-1)return!1;const B=r[g];if(lu(B)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+g+"'")})}})},nW=(r,a)=>{const g={},B=J=>{J.forEach(C=>{g[C]=!0})};return Rp(r)?B(r):B(String(r).split(a)),g},iW=()=>{},aW=(r,a)=>r!=null&&Number.isFinite(r=+r)?r:a;function oW(r){return!!(r&&lu(r.append)&&r[N3]==="FormData"&&r[rg])}const sW=r=>{const a=new Array(10),g=(B,J)=>{if(Ff(B)){if(a.indexOf(B)>=0)return;if(Vf(B))return B;if(!("toJSON"in B)){a[J]=B;const C=Rp(B)?[]:{};return jf(B,(x,e)=>{const v=g(x,J+1);!Bf(v)&&(C[e]=v)}),a[J]=void 0,C}}return B};return g(r,0)},lW=Ju("AsyncFunction"),cW=r=>r&&(Ff(r)||lu(r))&&lu(r.then)&&lu(r.catch),B3=((r,a)=>r?setImmediate:a?((g,B)=>(Uh.addEventListener("message",({source:J,data:C})=>{J===Uh&&C===g&&B.length&&B.shift()()},!1),J=>{B.push(J),Uh.postMessage(g,"*")}))(`axios@${Math.random()}`,[]):g=>setTimeout(g))(typeof setImmediate=="function",lu(Uh.postMessage)),uW=typeof queueMicrotask<"u"?queueMicrotask.bind(Uh):typeof process<"u"&&process.nextTick||B3,dW=r=>r!=null&&lu(r[rg]),qn={isArray:Rp,isArrayBuffer:O3,isBuffer:Vf,isFormData:Dq,isArrayBufferView:Cq,isString:Mq,isNumber:I3,isBoolean:Pq,isObject:Ff,isPlainObject:ag,isEmptyObject:Nq,isReadableStream:Vq,isRequest:Fq,isResponse:jq,isHeaders:Uq,isUndefined:Bf,isDate:Oq,isFile:Iq,isBlob:Rq,isRegExp:tW,isFunction:lu,isStream:zq,isURLSearchParams:Bq,isTypedArray:Kq,isFileList:Lq,forEach:jf,merge:Vv,extend:Wq,trim:qq,stripBOM:Gq,inherits:Hq,toFlatObject:Xq,kindOf:ng,kindOfTest:Ju,endsWith:Yq,toArray:Jq,forEachEntry:Zq,matchAll:Qq,isHTMLForm:$q,hasOwnProperty:z3,hasOwnProp:z3,reduceDescriptors:D3,freezeMethods:rW,toObjectSet:nW,toCamelCase:eW,noop:iW,toFiniteNumber:aW,findKey:R3,global:Uh,isContextDefined:L3,isSpecCompliantForm:oW,toJSONObject:sW,isAsyncFn:lW,isThenable:cW,setImmediate:B3,asap:uW,isIterable:dW};function ma(r,a,g,B,J){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",a&&(this.code=a),g&&(this.config=g),B&&(this.request=B),J&&(this.response=J,this.status=J.status?J.status:null)}qn.inherits(ma,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:qn.toJSONObject(this.config),code:this.code,status:this.status}}});const V3=ma.prototype,F3={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{F3[r]={value:r}}),Object.defineProperties(ma,F3),Object.defineProperty(V3,"isAxiosError",{value:!0}),ma.from=(r,a,g,B,J,C)=>{const x=Object.create(V3);return qn.toFlatObject(r,x,function(e){return e!==Error.prototype},e=>e!=="isAxiosError"),ma.call(x,r.message,a,g,B,J),x.cause=r,x.name=r.name,C&&Object.assign(x,C),x};const hW=null;function Fv(r){return qn.isPlainObject(r)||qn.isArray(r)}function j3(r){return qn.endsWith(r,"[]")?r.slice(0,-2):r}function U3(r,a,g){return r?r.concat(a).map(function(B,J){return B=j3(B),!g&&J?"["+B+"]":B}).join(g?".":""):a}function pW(r){return qn.isArray(r)&&!r.some(Fv)}const fW=qn.toFlatObject(qn,{},null,function(r){return/^is[A-Z]/.test(r)});function og(r,a,g){if(!qn.isObject(r))throw new TypeError("target must be an object");a=a||new FormData,g=qn.toFlatObject(g,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,h){return!qn.isUndefined(h[b])});const B=g.metaTokens,J=g.visitor||u,C=g.dots,x=g.indexes,e=(g.Blob||typeof Blob<"u"&&Blob)&&qn.isSpecCompliantForm(a);if(!qn.isFunction(J))throw new TypeError("visitor must be a function");function v(b){if(b===null)return"";if(qn.isDate(b))return b.toISOString();if(qn.isBoolean(b))return b.toString();if(!e&&qn.isBlob(b))throw new ma("Blob is not supported. Use a Buffer instead.");return qn.isArrayBuffer(b)||qn.isTypedArray(b)?e&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,h,n){let i=b;if(b&&!n&&typeof b=="object"){if(qn.endsWith(h,"{}"))h=B?h:h.slice(0,-2),b=JSON.stringify(b);else if(qn.isArray(b)&&pW(b)||(qn.isFileList(b)||qn.endsWith(h,"[]"))&&(i=qn.toArray(b)))return h=j3(h),i.forEach(function(d,s){!(qn.isUndefined(d)||d===null)&&a.append(x===!0?U3([h],s,C):x===null?h:h+"[]",v(d))}),!1}return Fv(b)?!0:(a.append(U3(n,h,C),v(b)),!1)}const t=[],w=Object.assign(fW,{defaultVisitor:u,convertValue:v,isVisitable:Fv});function y(b,h){if(!qn.isUndefined(b)){if(t.indexOf(b)!==-1)throw Error("Circular reference detected in "+h.join("."));t.push(b),qn.forEach(b,function(n,i){(!(qn.isUndefined(n)||n===null)&&J.call(a,n,qn.isString(i)?i.trim():i,h,w))===!0&&y(n,h?h.concat(i):[i])}),t.pop()}}if(!qn.isObject(r))throw new TypeError("data must be an object");return y(r),a}function q3(r){const a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(g){return a[g]})}function jv(r,a){this._pairs=[],r&&og(r,this,a)}const W3=jv.prototype;W3.append=function(r,a){this._pairs.push([r,a])},W3.toString=function(r){const a=r?function(g){return r.call(this,g,q3)}:q3;return this._pairs.map(function(g){return a(g[0])+"="+a(g[1])},"").join("&")};function mW(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function G3(r,a,g){if(!a)return r;const B=g&&g.encode||mW;qn.isFunction(g)&&(g={serialize:g});const J=g&&g.serialize;let C;if(J?C=J(a,g):C=qn.isURLSearchParams(a)?a.toString():new jv(a,g).toString(B),C){const x=r.indexOf("#");x!==-1&&(r=r.slice(0,x)),r+=(r.indexOf("?")===-1?"?":"&")+C}return r}let H3=class{constructor(){this.handlers=[]}use(r,a,g){return this.handlers.push({fulfilled:r,rejected:a,synchronous:g?g.synchronous:!1,runWhen:g?g.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){qn.forEach(this.handlers,function(a){a!==null&&r(a)})}};const X3={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gW=typeof URLSearchParams<"u"?URLSearchParams:jv,yW=typeof FormData<"u"?FormData:null,vW=typeof Blob<"u"?Blob:null,bW={isBrowser:!0,classes:{URLSearchParams:gW,FormData:yW,Blob:vW},protocols:["http","https","file","blob","url","data"]},Uv=typeof window<"u"&&typeof document<"u",qv=typeof navigator=="object"&&navigator||void 0,xW=Uv&&(!qv||["ReactNative","NativeScript","NS"].indexOf(qv.product)<0),_W=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",wW=Uv&&window.location.href||"http://localhost",TW=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Uv,hasStandardBrowserEnv:xW,hasStandardBrowserWebWorkerEnv:_W,navigator:qv,origin:wW},Symbol.toStringTag,{value:"Module"})),Cc={...TW,...bW};function kW(r,a){return og(r,new Cc.classes.URLSearchParams,{visitor:function(g,B,J,C){return Cc.isNode&&qn.isBuffer(g)?(this.append(B,g.toString("base64")),!1):C.defaultVisitor.apply(this,arguments)},...a})}function SW(r){return qn.matchAll(/\w+|\[(\w*)]/g,r).map(a=>a[0]==="[]"?"":a[1]||a[0])}function EW(r){const a={},g=Object.keys(r);let B;const J=g.length;let C;for(B=0;B<J;B++)C=g[B],a[C]=r[C];return a}function Y3(r){function a(g,B,J,C){let x=g[C++];if(x==="__proto__")return!0;const e=Number.isFinite(+x),v=C>=g.length;return x=!x&&qn.isArray(J)?J.length:x,v?(qn.hasOwnProp(J,x)?J[x]=[J[x],B]:J[x]=B,!e):((!J[x]||!qn.isObject(J[x]))&&(J[x]=[]),a(g,B,J[x],C)&&qn.isArray(J[x])&&(J[x]=EW(J[x])),!e)}if(qn.isFormData(r)&&qn.isFunction(r.entries)){const g={};return qn.forEachEntry(r,(B,J)=>{a(SW(B),J,g,0)}),g}return null}function AW(r,a,g){if(qn.isString(r))try{return(a||JSON.parse)(r),qn.trim(r)}catch(B){if(B.name!=="SyntaxError")throw B}return(g||JSON.stringify)(r)}const Uf={transitional:X3,adapter:["xhr","http","fetch"],transformRequest:[function(r,a){const g=a.getContentType()||"",B=g.indexOf("application/json")>-1,J=qn.isObject(r);if(J&&qn.isHTMLForm(r)&&(r=new FormData(r)),qn.isFormData(r))return B?JSON.stringify(Y3(r)):r;if(qn.isArrayBuffer(r)||qn.isBuffer(r)||qn.isStream(r)||qn.isFile(r)||qn.isBlob(r)||qn.isReadableStream(r))return r;if(qn.isArrayBufferView(r))return r.buffer;if(qn.isURLSearchParams(r))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let C;if(J){if(g.indexOf("application/x-www-form-urlencoded")>-1)return kW(r,this.formSerializer).toString();if((C=qn.isFileList(r))||g.indexOf("multipart/form-data")>-1){const x=this.env&&this.env.FormData;return og(C?{"files[]":r}:r,x&&new x,this.formSerializer)}}return J||B?(a.setContentType("application/json",!1),AW(r)):r}],transformResponse:[function(r){const a=this.transitional||Uf.transitional,g=a&&a.forcedJSONParsing,B=this.responseType==="json";if(qn.isResponse(r)||qn.isReadableStream(r))return r;if(r&&qn.isString(r)&&(g&&!this.responseType||B)){const J=!(a&&a.silentJSONParsing)&&B;try{return JSON.parse(r)}catch(C){if(J)throw C.name==="SyntaxError"?ma.from(C,ma.ERR_BAD_RESPONSE,this,null,this.response):C}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Cc.classes.FormData,Blob:Cc.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};qn.forEach(["delete","get","head","post","put","patch"],r=>{Uf.headers[r]={}});const CW=qn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),MW=r=>{const a={};let g,B,J;return r&&r.split(`
|
|
4054
|
+
*/var Qj="store";function Fh(r,a){Object.keys(r).forEach(function(g){return a(r[g],g)})}function l3(r){return r!==null&&typeof r=="object"}function $j(r){return r&&typeof r.then=="function"}function Xu(r,a){if(!r)throw new Error("[vuex] "+a)}function eU(r,a){return function(){return r(a)}}function c3(r,a,g){return a.indexOf(r)<0&&(g&&g.prepend?a.unshift(r):a.push(r)),function(){var B=a.indexOf(r);B>-1&&a.splice(B,1)}}function u3(r,a){r._actions=Object.create(null),r._mutations=Object.create(null),r._wrappedGetters=Object.create(null),r._modulesNamespaceMap=Object.create(null);var g=r.state;eg(r,g,[],r._modules.root,!0),Ov(r,g,a)}function Ov(r,a,g){var B=r._state,J=r._scope;r.getters={},r._makeLocalGettersCache=Object.create(null);var C=r._wrappedGetters,x={},e={},v=p.effectScope(!0);v.run(function(){Fh(C,function(u,t){x[t]=eU(u,r),e[t]=p.computed(function(){return x[t]()}),Object.defineProperty(r.getters,t,{get:function(){return e[t].value},enumerable:!0})})}),r._state=p.reactive({data:a}),r._scope=v,r.strict&&aU(r),B&&g&&r._withCommit(function(){B.data=null}),J&&J.stop()}function eg(r,a,g,B,J){var C=!g.length,x=r._modules.getNamespace(g);if(B.namespaced&&(r._modulesNamespaceMap[x]&&process.env.NODE_ENV!=="production"&&console.error("[vuex] duplicate namespace "+x+" for the namespaced module "+g.join("/")),r._modulesNamespaceMap[x]=B),!C&&!J){var e=Iv(a,g.slice(0,-1)),v=g[g.length-1];r._withCommit(function(){process.env.NODE_ENV!=="production"&&v in e&&console.warn('[vuex] state field "'+v+'" was overridden by a module with the same name at "'+g.join(".")+'"'),e[v]=B.state})}var u=B.context=tU(r,x,g);B.forEachMutation(function(t,w){var y=x+w;rU(r,y,t,u)}),B.forEachAction(function(t,w){var y=t.root?w:x+w,b=t.handler||t;nU(r,y,b,u)}),B.forEachGetter(function(t,w){var y=x+w;iU(r,y,t,u)}),B.forEachChild(function(t,w){eg(r,a,g.concat(w),t,J)})}function tU(r,a,g){var B=a==="",J={dispatch:B?r.dispatch:function(C,x,e){var v=tg(C,x,e),u=v.payload,t=v.options,w=v.type;if((!t||!t.root)&&(w=a+w,process.env.NODE_ENV!=="production"&&!r._actions[w])){console.error("[vuex] unknown local action type: "+v.type+", global type: "+w);return}return r.dispatch(w,u)},commit:B?r.commit:function(C,x,e){var v=tg(C,x,e),u=v.payload,t=v.options,w=v.type;if((!t||!t.root)&&(w=a+w,process.env.NODE_ENV!=="production"&&!r._mutations[w])){console.error("[vuex] unknown local mutation type: "+v.type+", global type: "+w);return}r.commit(w,u,t)}};return Object.defineProperties(J,{getters:{get:B?function(){return r.getters}:function(){return d3(r,a)}},state:{get:function(){return Iv(r.state,g)}}}),J}function d3(r,a){if(!r._makeLocalGettersCache[a]){var g={},B=a.length;Object.keys(r.getters).forEach(function(J){if(J.slice(0,B)===a){var C=J.slice(B);Object.defineProperty(g,C,{get:function(){return r.getters[J]},enumerable:!0})}}),r._makeLocalGettersCache[a]=g}return r._makeLocalGettersCache[a]}function rU(r,a,g,B){var J=r._mutations[a]||(r._mutations[a]=[]);J.push(function(C){g.call(r,B.state,C)})}function nU(r,a,g,B){var J=r._actions[a]||(r._actions[a]=[]);J.push(function(C){var x=g.call(r,{dispatch:B.dispatch,commit:B.commit,getters:B.getters,state:B.state,rootGetters:r.getters,rootState:r.state},C);return $j(x)||(x=Promise.resolve(x)),r._devtoolHook?x.catch(function(e){throw r._devtoolHook.emit("vuex:error",e),e}):x})}function iU(r,a,g,B){if(r._wrappedGetters[a]){process.env.NODE_ENV!=="production"&&console.error("[vuex] duplicate getter key: "+a);return}r._wrappedGetters[a]=function(J){return g(B.state,B.getters,J.state,J.getters)}}function aU(r){p.watch(function(){return r._state.data},function(){process.env.NODE_ENV!=="production"&&Xu(r._committing,"do not mutate vuex store state outside mutation handlers.")},{deep:!0,flush:"sync"})}function Iv(r,a){return a.reduce(function(g,B){return g[B]},r)}function tg(r,a,g){return l3(r)&&r.type&&(g=a,a=r,r=r.type),process.env.NODE_ENV!=="production"&&Xu(typeof r=="string","expects string as the type, but found "+typeof r+"."),{type:r,payload:a,options:g}}var oU="vuex bindings",h3="vuex:mutations",Rv="vuex:actions",Ip="vuex",sU=0;function lU(r,a){Zj({id:"org.vuejs.vuex",app:r,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[oU]},function(g){g.addTimelineLayer({id:h3,label:"Vuex Mutations",color:p3}),g.addTimelineLayer({id:Rv,label:"Vuex Actions",color:p3}),g.addInspector({id:Ip,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),g.on.getInspectorTree(function(B){if(B.app===r&&B.inspectorId===Ip)if(B.filter){var J=[];y3(J,a._modules.root,B.filter,""),B.rootNodes=J}else B.rootNodes=[g3(a._modules.root,"")]}),g.on.getInspectorState(function(B){if(B.app===r&&B.inspectorId===Ip){var J=B.nodeId;d3(a,J),B.state=dU(pU(a._modules,J),J==="root"?a.getters:a._makeLocalGettersCache,J)}}),g.on.editInspectorState(function(B){if(B.app===r&&B.inspectorId===Ip){var J=B.nodeId,C=B.path;J!=="root"&&(C=J.split("/").filter(Boolean).concat(C)),a._withCommit(function(){B.set(a._state.data,C,B.state.value)})}}),a.subscribe(function(B,J){var C={};B.payload&&(C.payload=B.payload),C.state=J,g.notifyComponentUpdate(),g.sendInspectorTree(Ip),g.sendInspectorState(Ip),g.addTimelineEvent({layerId:h3,event:{time:Date.now(),title:B.type,data:C}})}),a.subscribeAction({before:function(B,J){var C={};B.payload&&(C.payload=B.payload),B._id=sU++,B._time=Date.now(),C.state=J,g.addTimelineEvent({layerId:Rv,event:{time:B._time,title:B.type,groupId:B._id,subtitle:"start",data:C}})},after:function(B,J){var C={},x=Date.now()-B._time;C.duration={_custom:{type:"duration",display:x+"ms",tooltip:"Action duration",value:x}},B.payload&&(C.payload=B.payload),C.state=J,g.addTimelineEvent({layerId:Rv,event:{time:Date.now(),title:B.type,groupId:B._id,subtitle:"end",data:C}})}})})}var p3=8702998,cU=6710886,uU=16777215,f3={label:"namespaced",textColor:uU,backgroundColor:cU};function m3(r){return r&&r!=="root"?r.split("/").slice(-2,-1)[0]:"Root"}function g3(r,a){return{id:a||"root",label:m3(a),tags:r.namespaced?[f3]:[],children:Object.keys(r._children).map(function(g){return g3(r._children[g],a+g+"/")})}}function y3(r,a,g,B){B.includes(g)&&r.push({id:B||"root",label:B.endsWith("/")?B.slice(0,B.length-1):B||"Root",tags:a.namespaced?[f3]:[]}),Object.keys(a._children).forEach(function(J){y3(r,a._children[J],g,B+J+"/")})}function dU(r,a,g){a=g==="root"?a:a[g];var B=Object.keys(a),J={state:Object.keys(r.state).map(function(x){return{key:x,editable:!0,value:r.state[x]}})};if(B.length){var C=hU(a);J.getters=Object.keys(C).map(function(x){return{key:x.endsWith("/")?m3(x):x,editable:!1,value:Lv(function(){return C[x]})}})}return J}function hU(r){var a={};return Object.keys(r).forEach(function(g){var B=g.split("/");if(B.length>1){var J=a,C=B.pop();B.forEach(function(x){J[x]||(J[x]={_custom:{value:{},display:x,tooltip:"Module",abstract:!0}}),J=J[x]._custom.value}),J[C]=Lv(function(){return r[g]})}else a[g]=Lv(function(){return r[g]})}),a}function pU(r,a){var g=a.split("/").filter(function(B){return B});return g.reduce(function(B,J,C){var x=B[J];if(!x)throw new Error('Missing module "'+J+'" for path "'+a+'".');return C===g.length-1?x:x._children},a==="root"?r:r.root._children)}function Lv(r){try{return r()}catch(a){return a}}var Yu=function(r,a){this.runtime=a,this._children=Object.create(null),this._rawModule=r;var g=r.state;this.state=(typeof g=="function"?g():g)||{}},v3={namespaced:{configurable:!0}};v3.namespaced.get=function(){return!!this._rawModule.namespaced},Yu.prototype.addChild=function(r,a){this._children[r]=a},Yu.prototype.removeChild=function(r){delete this._children[r]},Yu.prototype.getChild=function(r){return this._children[r]},Yu.prototype.hasChild=function(r){return r in this._children},Yu.prototype.update=function(r){this._rawModule.namespaced=r.namespaced,r.actions&&(this._rawModule.actions=r.actions),r.mutations&&(this._rawModule.mutations=r.mutations),r.getters&&(this._rawModule.getters=r.getters)},Yu.prototype.forEachChild=function(r){Fh(this._children,r)},Yu.prototype.forEachGetter=function(r){this._rawModule.getters&&Fh(this._rawModule.getters,r)},Yu.prototype.forEachAction=function(r){this._rawModule.actions&&Fh(this._rawModule.actions,r)},Yu.prototype.forEachMutation=function(r){this._rawModule.mutations&&Fh(this._rawModule.mutations,r)},Object.defineProperties(Yu.prototype,v3);var jh=function(r){this.register([],r,!1)};jh.prototype.get=function(r){return r.reduce(function(a,g){return a.getChild(g)},this.root)},jh.prototype.getNamespace=function(r){var a=this.root;return r.reduce(function(g,B){return a=a.getChild(B),g+(a.namespaced?B+"/":"")},"")},jh.prototype.update=function(r){b3([],this.root,r)},jh.prototype.register=function(r,a,g){var B=this;g===void 0&&(g=!0),process.env.NODE_ENV!=="production"&&w3(r,a);var J=new Yu(a,g);if(r.length===0)this.root=J;else{var C=this.get(r.slice(0,-1));C.addChild(r[r.length-1],J)}a.modules&&Fh(a.modules,function(x,e){B.register(r.concat(e),x,g)})},jh.prototype.unregister=function(r){var a=this.get(r.slice(0,-1)),g=r[r.length-1],B=a.getChild(g);if(!B){process.env.NODE_ENV!=="production"&&console.warn("[vuex] trying to unregister module '"+g+"', which is not registered");return}B.runtime&&a.removeChild(g)},jh.prototype.isRegistered=function(r){var a=this.get(r.slice(0,-1)),g=r[r.length-1];return a?a.hasChild(g):!1};function b3(r,a,g){if(process.env.NODE_ENV!=="production"&&w3(r,g),a.update(g),g.modules)for(var B in g.modules){if(!a.getChild(B)){process.env.NODE_ENV!=="production"&&console.warn("[vuex] trying to add a new module '"+B+"' on hot reloading, manual reload is needed");return}b3(r.concat(B),a.getChild(B),g.modules[B])}}var x3={assert:function(r){return typeof r=="function"},expected:"function"},fU={assert:function(r){return typeof r=="function"||typeof r=="object"&&typeof r.handler=="function"},expected:'function or object with "handler" function'},_3={getters:x3,mutations:x3,actions:fU};function w3(r,a){Object.keys(_3).forEach(function(g){if(a[g]){var B=_3[g];Fh(a[g],function(J,C){Xu(B.assert(J),mU(r,g,C,J,B.expected))})}})}function mU(r,a,g,B,J){var C=a+" should be "+J+' but "'+a+"."+g+'"';return r.length>0&&(C+=' in module "'+r.join(".")+'"'),C+=" is "+JSON.stringify(B)+".",C}var Au=function r(a){var g=this;a===void 0&&(a={}),process.env.NODE_ENV!=="production"&&(Xu(typeof Promise<"u","vuex requires a Promise polyfill in this browser."),Xu(this instanceof r,"store must be called with the new operator."));var B=a.plugins;B===void 0&&(B=[]);var J=a.strict;J===void 0&&(J=!1);var C=a.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new jh(a),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=C;var x=this,e=this,v=e.dispatch,u=e.commit;this.dispatch=function(w,y){return v.call(x,w,y)},this.commit=function(w,y,b){return u.call(x,w,y,b)},this.strict=J;var t=this._modules.root.state;eg(this,t,[],this._modules.root),Ov(this,t),B.forEach(function(w){return w(g)})},zv={state:{configurable:!0}};Au.prototype.install=function(r,a){r.provide(a||Qj,this),r.config.globalProperties.$store=this;var g=this._devtools!==void 0?this._devtools:process.env.NODE_ENV!=="production"||!1;g&&lU(r,this)},zv.state.get=function(){return this._state.data},zv.state.set=function(r){process.env.NODE_ENV!=="production"&&Xu(!1,"use store.replaceState() to explicit replace store state.")},Au.prototype.commit=function(r,a,g){var B=this,J=tg(r,a,g),C=J.type,x=J.payload,e=J.options,v={type:C,payload:x},u=this._mutations[C];if(!u){process.env.NODE_ENV!=="production"&&console.error("[vuex] unknown mutation type: "+C);return}this._withCommit(function(){u.forEach(function(t){t(x)})}),this._subscribers.slice().forEach(function(t){return t(v,B.state)}),process.env.NODE_ENV!=="production"&&e&&e.silent&&console.warn("[vuex] mutation type: "+C+". Silent option has been removed. Use the filter functionality in the vue-devtools")},Au.prototype.dispatch=function(r,a){var g=this,B=tg(r,a),J=B.type,C=B.payload,x={type:J,payload:C},e=this._actions[J];if(!e){process.env.NODE_ENV!=="production"&&console.error("[vuex] unknown action type: "+J);return}try{this._actionSubscribers.slice().filter(function(u){return u.before}).forEach(function(u){return u.before(x,g.state)})}catch(u){process.env.NODE_ENV!=="production"&&(console.warn("[vuex] error in before action subscribers: "),console.error(u))}var v=e.length>1?Promise.all(e.map(function(u){return u(C)})):e[0](C);return new Promise(function(u,t){v.then(function(w){try{g._actionSubscribers.filter(function(y){return y.after}).forEach(function(y){return y.after(x,g.state)})}catch(y){process.env.NODE_ENV!=="production"&&(console.warn("[vuex] error in after action subscribers: "),console.error(y))}u(w)},function(w){try{g._actionSubscribers.filter(function(y){return y.error}).forEach(function(y){return y.error(x,g.state,w)})}catch(y){process.env.NODE_ENV!=="production"&&(console.warn("[vuex] error in error action subscribers: "),console.error(y))}t(w)})})},Au.prototype.subscribe=function(r,a){return c3(r,this._subscribers,a)},Au.prototype.subscribeAction=function(r,a){var g=typeof r=="function"?{before:r}:r;return c3(g,this._actionSubscribers,a)},Au.prototype.watch=function(r,a,g){var B=this;return process.env.NODE_ENV!=="production"&&Xu(typeof r=="function","store.watch only accepts a function."),p.watch(function(){return r(B.state,B.getters)},a,Object.assign({},g))},Au.prototype.replaceState=function(r){var a=this;this._withCommit(function(){a._state.data=r})},Au.prototype.registerModule=function(r,a,g){g===void 0&&(g={}),typeof r=="string"&&(r=[r]),process.env.NODE_ENV!=="production"&&(Xu(Array.isArray(r),"module path must be a string or an Array."),Xu(r.length>0,"cannot register the root module by using registerModule.")),this._modules.register(r,a),eg(this,this.state,r,this._modules.get(r),g.preserveState),Ov(this,this.state)},Au.prototype.unregisterModule=function(r){var a=this;typeof r=="string"&&(r=[r]),process.env.NODE_ENV!=="production"&&Xu(Array.isArray(r),"module path must be a string or an Array."),this._modules.unregister(r),this._withCommit(function(){var g=Iv(a.state,r.slice(0,-1));delete g[r[r.length-1]]}),u3(this)},Au.prototype.hasModule=function(r){return typeof r=="string"&&(r=[r]),process.env.NODE_ENV!=="production"&&Xu(Array.isArray(r),"module path must be a string or an Array."),this._modules.isRegistered(r)},Au.prototype.hotUpdate=function(r){this._modules.update(r),u3(this,!0)},Au.prototype._withCommit=function(r){var a=this._committing;this._committing=!0,r(),this._committing=a},Object.defineProperties(Au.prototype,zv);var gU=k3(function(r,a){var g={};return process.env.NODE_ENV!=="production"&&!Dv(a)&&console.error("[vuex] mapState: mapper parameter must be either an Array or an Object"),T3(a).forEach(function(B){var J=B.key,C=B.val;g[J]=function(){var x=this.$store.state,e=this.$store.getters;if(r){var v=S3(this.$store,"mapState",r);if(!v)return;x=v.context.state,e=v.context.getters}return typeof C=="function"?C.call(this,x,e):x[C]},g[J].vuex=!0}),g}),yU=k3(function(r,a){var g={};return process.env.NODE_ENV!=="production"&&!Dv(a)&&console.error("[vuex] mapGetters: mapper parameter must be either an Array or an Object"),T3(a).forEach(function(B){var J=B.key,C=B.val;C=r+C,g[J]=function(){if(!(r&&!S3(this.$store,"mapGetters",r))){if(process.env.NODE_ENV!=="production"&&!(C in this.$store.getters)){console.error("[vuex] unknown getter: "+C);return}return this.$store.getters[C]}},g[J].vuex=!0}),g});function T3(r){return Dv(r)?Array.isArray(r)?r.map(function(a){return{key:a,val:a}}):Object.keys(r).map(function(a){return{key:a,val:r[a]}}):[]}function Dv(r){return Array.isArray(r)||l3(r)}function k3(r){return function(a,g){return typeof a!="string"?(g=a,a=""):a.charAt(a.length-1)!=="/"&&(a+="/"),r(a,g)}}function S3(r,a,g){var B=r._modulesNamespaceMap[g];return process.env.NODE_ENV!=="production"&&!B&&console.error("[vuex] module namespace not found in "+a+"(): "+g),B}const vU=(r,a)=>{const g=r.__vccOpts||r;for(const[B,J]of a)g[B]=J;return g},bU={components:{GSCCheckbox:qj},props:{timeLivePossesion:{type:Number,default:6e4},game:{type:Object,default:()=>{}},widthSection:{type:Number,default:0},teamSelected:{type:Object,default:()=>({})},areInactiveVisible:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0},isDefault:{type:Boolean,default:!1}},watch:{game:{deep:!0,immediate:!0,async handler(r){r.is_live==1?(this.getDataPosession(r.gameId),this.intervalIdPossesion=setInterval(()=>{this.getDataPosession(r.gameId)},this.timeLivePossesion),this.$emit("intervalidpossesion",this.intervalIdPossesion)):r.game_status==1||r.game_status==0?this.getDataPosession(r.gameId):this.getDataPosessionPrematch(r.seasonId)}}},data(){return{dataPosession:[],arrTeams:[],intervalIdPossesion:null,containerSize:{width:0,height:0},url:"https://rwtfu33saa.execute-api.us-east-2.amazonaws.com/prod/ta/posessions/",urlPrematch:"https://rwtfu33saa.execute-api.us-east-2.amazonaws.com/prod/ta/seasons/",tokenPremium:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE",objectZeroValues:{numberValue:0,numberBarPercent:0}}},computed:{...gU("nextGeneral",["gameForAnalysis","seasonId"]),...yU("nextGeneral",["arrayFilledDataSortedByPriority"]),itemIndicadorStyle(){return this.containerSize.width<300&&this.areInactiveVisible?{width:"86%",marginLeft:"7%"}:{}},itemIndicadorValueStyle(){return this.containerSize.width<300?{fontSize:"calc(1.5vh - 2px)"}:{}},fieldDataContainerStyle(){return this.widthSection>520&&this.widthSection<=760?{width:`${Math.min(this.containerSize.width,this.containerSize.height*1.75)}px`,maxWidth:"100%"}:{}}},methods:{async getStatsData(r){},async getDataPosession(){try{const r=await js.create({headers:{Authorization:`${this.tokenPremium}`}}).get(this.url+this.game.gameId);this.dataPosession=r.data}catch(r){return Promise.reject(r)}},async getDataPosessionPrematch(r){try{const a=await js.create({headers:{Authorization:`${this.tokenPremium}`}}).get(this.urlPrematch+r+"/posessions");for(const g in a.data.teams)a.data.teams.hasOwnProperty(g)&&(this.arrTeams[g]=a.data.teams[g])}catch(a){return Promise.reject(a)}},onCheckInactive(r){this.$emit("update:areInactiveVisible",r)},deleteDecimalZero(r){const a=typeof r=="string"?parseFloat(r):r;return typeof a=="number"&&!isNaN(a)?a%1===0?a:a%1===0?Math.floor(a):a:r},formatNumbers(r){return r%1!==0?r.toFixed(1):r},hVal(r){return this.getTeamValue(r,this.gameForAnalysis,"homeTeam")},aVal(r){return this.getTeamValue(r,this.gameForAnalysis,"visitingTeam")},getTeamValue(r,a,g){if(!a.game_id)return this.objectZeroValues;const B=r.homeTeam.accomplished.avgPostGame+r.visitingTeam.accomplished.avgPostGame,J=r[g].accomplished.avgPostGame/B;return r[g].accomplished.avgPostGame?{numberValue:J<1?J*100:J,numberBarPercent:r[g].accomplished.avgPostGame/B}:this.objectZeroValues},calculateContainerSize(){if(this.$refs.containerRef){const r=this.$refs.containerRef.getBoundingClientRect();this.containerSize={width:Math.round(r.width),height:Math.round(r.height)}}}},created(){},mounted(){this.$nextTick(()=>{this.calculateContainerSize()}),window.addEventListener("resize",this.calculateContainerSize)},beforeUnmount(){clearInterval(this.intervalIdPossesion),window.removeEventListener("resize",this.calculateContainerSize)}},xU={class:"field-posesion-prominent",ref:"containerRef"},_U={key:0,class:"title"},wU={class:"info-data-item"},TU={key:1},kU={key:0,class:"inactiveInfo"},SU={class:"info-data-item"},EU={class:"info-data-item"},AU={key:1},CU={class:"info-data-item"},MU={key:0,class:"inactiveInfo"},PU={class:"info-data-item"},NU={class:"info-data-item"};function OU(r,a,g,B,J,C){var x,e,v,u;return p.openBlock(),p.createElementBlock("div",xU,[g.widthSection>760&&g.showTitle?(p.openBlock(),p.createElementBlock("div",_U,"Porcentajes")):p.createCommentVNode("",!0),g.game.game_status==1||g.game.game_status==0||g.game.is_live==1?(p.openBlock(),p.createElementBlock("div",{key:1,class:p.normalizeClass(g.widthSection>760?"field-container":g.widthSection>520?"field-container-movil":g.widthSection>440?"field-container-movil-2":g.widthSection>360?"field-container-movil-3":"field-container-movil-4"),style:p.normalizeStyle(J.containerSize.width<400?{paddingTop:"5px",paddingBottom:"5px"}:{})},[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>1020?"field-data-container":g.widthSection>920?"field-data-container-xl":g.widthSection>880?"field-data-container-xl-2":g.widthSection>820?"field-data-container-xl-3":g.widthSection>760?"field-data-container-xl-4":"field-data-container-movil")},[p.createElementVNode("div",{class:p.normalizeClass(g.areInactiveVisible?"container-data-img-home":"container-data-img-home50")},[p.createElementVNode("div",{class:p.normalizeClass(g.areInactiveVisible?"homeInfo":"homeInfo50"),style:p.normalizeStyle({backgroundImage:g.isDefault?"url(https://golstatsimages.blob.core.windows.net/reports-images/esc-local-generico.svg)":"url("+g.game.homeTeam.logo.replace("80","150")+")",opacity:g.isDefault?.45:.2})},null,6),p.createElementVNode("div",wU,[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"item-ref-data":"item-ref-data-movil")},[p.createElementVNode("div",{class:"item-indicador",style:p.normalizeStyle(C.itemIndicadorStyle)},[p.createElementVNode("div",{class:"item-indicador-value",style:p.normalizeStyle(C.itemIndicadorValueStyle)},[((x=J.dataPosession)==null?void 0:x.has_posession)==1?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[g.areInactiveVisible?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode(p.toDisplayString(g.isDefault?"00%":J.dataPosession.active_time.home),1)],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(g.isDefault?"00%":J.dataPosession.home),1)],64))],64)):(p.openBlock(),p.createElementBlock("span",TU,"%"))],4),a[0]||(a[0]=p.createElementVNode("div",{class:"item-indicador-img"},[p.createElementVNode("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.87817 5.92969L0.506034 0.0889796L7.2503 0.0889802L3.87817 5.92969Z",fill:"#38CFFF"})])],-1))],4),p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})}," Pos. "+p.toDisplayString(g.isDefault?"LOC":g.game.homeTeam.acronym),7)],2)])],2),g.areInactiveVisible&&((e=J.dataPosession)==null?void 0:e.has_posession)==1?(p.openBlock(),p.createElementBlock("div",kU,[p.createElementVNode("div",SU,[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"item-ref-data":"item-ref-data-movil")},[p.createElementVNode("div",{class:"item-indicador",style:p.normalizeStyle(C.itemIndicadorStyle)},[p.createElementVNode("div",{class:"item-indicador-value",style:p.normalizeStyle(C.itemIndicadorValueStyle)},p.toDisplayString(g.isDefault?"00%":J.dataPosession.active_time.inactive_time),5),a[1]||(a[1]=p.createElementVNode("div",{class:"item-indicador-img"},[p.createElementVNode("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.87817 5.92969L0.506034 0.0889796L7.2503 0.0889802L3.87817 5.92969Z",fill:"#38CFFF"})])],-1))],4),p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})},[g.widthSection>580?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode("T. Inactivo")],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode("T. Inactivo")],64))],6)],2)])])):p.createCommentVNode("",!0),p.createElementVNode("div",{class:p.normalizeClass(g.areInactiveVisible?"container-data-img-away":"container-data-img-away50")},[p.createElementVNode("div",{class:p.normalizeClass(g.areInactiveVisible?"awayInfo":"awayInfo50"),style:p.normalizeStyle({backgroundImage:g.isDefault?"url(https://golstatsimages.blob.core.windows.net/reports-images/esc-visita-generico.svg)":"url("+g.game.awayTeam.logo.replace("80","150")+")",opacity:g.isDefault?.45:.2})},null,6),p.createElementVNode("div",EU,[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"item-ref-data":"item-ref-data-movil")},[p.createElementVNode("div",{class:"item-indicador",style:p.normalizeStyle(C.itemIndicadorStyle)},[p.createElementVNode("div",{class:"item-indicador-value",style:p.normalizeStyle(C.itemIndicadorValueStyle)},[((v=J.dataPosession)==null?void 0:v.has_posession)==1?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[g.areInactiveVisible?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode(p.toDisplayString(g.isDefault?"00%":J.dataPosession.active_time.away),1)],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(g.isDefault?"00%":J.dataPosession.away),1)],64))],64)):(p.openBlock(),p.createElementBlock("span",AU,"%"))],4),a[2]||(a[2]=p.createElementVNode("div",{class:"item-indicador-img"},[p.createElementVNode("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.87817 5.92969L0.506034 0.0889796L7.2503 0.0889802L3.87817 5.92969Z",fill:"#38CFFF"})])],-1))],4),p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})}," Pos. "+p.toDisplayString(g.isDefault?"VIS":g.game.awayTeam.acronym),7)],2)])],2)],2)],6)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:2},[J.arrTeams.length>0?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(g.widthSection>760?"field-container":g.widthSection>520?"field-container-movil":g.widthSection>440?"field-container-movil-2":g.widthSection>360?"field-container-movil-3":"field-container-movil-4"),style:p.normalizeStyle(J.containerSize.width<400?{paddingTop:"4px",paddingBottom:"4px"}:{})},[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>1020?"field-data-container":g.widthSection>920?"field-data-container-xl":g.widthSection>880?"field-data-container-xl-2":g.widthSection>820?"field-data-container-xl-3":g.widthSection>760?"field-data-container-xl-4":"field-data-container-movil")},[p.createElementVNode("div",{class:p.normalizeClass(g.areInactiveVisible?"container-data-img-home":"container-data-img-home50")},[g.game.homeTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(g.areInactiveVisible?"homeInfo":"homeInfo50"),style:p.normalizeStyle({backgroundImage:g.isDefault?"url(https://golstatsimages.blob.core.windows.net/reports-images/esc-local-generico.svg)":"url("+g.game.homeTeam.logo.replace("80","150")+")",opacity:g.isDefault?.45:.2})},null,6)):p.createCommentVNode("",!0),p.createElementVNode("div",CU,[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"item-ref-data":"item-ref-data-movil")},[p.createElementVNode("div",{class:"item-indicador",style:p.normalizeStyle(C.itemIndicadorStyle)},[p.createElementVNode("div",{class:"item-indicador-value",style:p.normalizeStyle(C.itemIndicadorValueStyle)},[g.areInactiveVisible?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[g.game.awayTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].active_time.away),1)],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].active_time.home),1)],64))],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[g.game.awayTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].away),1)],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].home),1)],64))],64))],4),a[3]||(a[3]=p.createElementVNode("div",{class:"item-indicador-img"},[p.createElementVNode("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.87817 5.92969L0.506034 0.0889796L7.2503 0.0889802L3.87817 5.92969Z",fill:"#38CFFF"})])],-1))],4),g.game.homeTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})}," Pos. "+p.toDisplayString(g.isDefault?"LOC":g.game.homeTeam.acronym),7)):(p.openBlock(),p.createElementBlock("div",{key:1,class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})}," Pos. Rival ",6))],2)])],2),g.areInactiveVisible&&((u=J.arrTeams[g.teamSelected.teamId])==null?void 0:u.has_posession)==1?(p.openBlock(),p.createElementBlock("div",MU,[p.createElementVNode("div",PU,[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"item-ref-data":"item-ref-data-movil")},[p.createElementVNode("div",{class:"item-indicador",style:p.normalizeStyle(C.itemIndicadorStyle)},[p.createElementVNode("div",{class:"item-indicador-value",style:p.normalizeStyle(C.itemIndicadorValueStyle)},p.toDisplayString(g.isDefault?"00%":J.arrTeams[g.teamSelected.teamId].active_time.inactive_time),5),a[4]||(a[4]=p.createElementVNode("div",{class:"item-indicador-img"},[p.createElementVNode("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.87817 5.92969L0.506034 0.0889796L7.2503 0.0889802L3.87817 5.92969Z",fill:"#38CFFF"})])],-1))],4),p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})},[g.widthSection>580?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode("T. Inactivo")],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode("T. Inactivo")],64))],6)],2)])])):p.createCommentVNode("",!0),p.createElementVNode("div",{class:p.normalizeClass(g.areInactiveVisible?"container-data-img-away":"container-data-img-away50")},[g.game.awayTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(g.areInactiveVisible?"awayInfo":"awayInfo50"),style:p.normalizeStyle({backgroundImage:g.isDefault?"url(https://golstatsimages.blob.core.windows.net/reports-images/esc-visita-generico.svg)":"url("+g.game.awayTeam.logo.replace("80","150")+")",opacity:g.isDefault?.45:.2})},null,6)):p.createCommentVNode("",!0),p.createElementVNode("div",NU,[p.createElementVNode("div",{class:p.normalizeClass(g.widthSection>580?"item-ref-data":"item-ref-data-movil")},[p.createElementVNode("div",{class:"item-indicador",style:p.normalizeStyle(C.itemIndicadorStyle)},[p.createElementVNode("div",{class:"item-indicador-value",style:p.normalizeStyle(C.itemIndicadorValueStyle)},[g.areInactiveVisible?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[g.game.homeTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].active_time.away),1)],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].active_time.home),1)],64))],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[g.game.homeTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].away),1)],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(J.arrTeams[g.teamSelected.teamId].home),1)],64))],64))],4),a[5]||(a[5]=p.createElementVNode("div",{class:"item-indicador-img"},[p.createElementVNode("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.87817 5.92969L0.506034 0.0889796L7.2503 0.0889802L3.87817 5.92969Z",fill:"#38CFFF"})])],-1))],4),g.game.awayTeam.team_id==g.teamSelected.teamId?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})}," Pos. "+p.toDisplayString(g.isDefault?"VIS":g.game.awayTeam.acronym),7)):(p.openBlock(),p.createElementBlock("div",{key:1,class:p.normalizeClass(g.widthSection>580?"title-indicador":"title-indicador-movil"),style:p.normalizeStyle(J.containerSize.width<250&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 4px)"}:J.containerSize.width<300&&g.areInactiveVisible?{fontSize:"calc(1.3vh - 2px)"}:{})}," Pos. Rival ",6))],2)])],2)],2)],6)):p.createCommentVNode("",!0)],64))],512)}const E3=vU(bU,[["render",OU],["__scopeId","data-v-c04e7fc0"]]),IU=(r,a)=>{const g=r.__vccOpts||r;for(const[B,J]of a)g[B]=J;return g},RU=["src"],LU=["src"],zU={class:"gsc-ms-team gsc-ms-team--left"},DU=["src","alt"],BU={class:"gsc-ms-name"},VU={class:"gsc-ms-center"},FU={class:"gsc-ms-stage"},jU={class:"gsc-ms-score"},UU={class:"gsc-ms-status"},qU={class:"gsc-ms-team gsc-ms-team--right"},WU=["src","alt"],GU={class:"gsc-ms-name"},HU=["src","alt"],XU={key:0,class:"gsc-ms-events-row-default"},YU={key:1,class:"gsc-ms-events-grid"},JU={class:"gsc-ms-events-side gsc-ms-events-side--left"},KU={class:"gsc-ms-events-line"},ZU={key:0,class:"gsc-ms-event-item gsc-ms-event-item--goal-icon"},QU={key:0,class:"gsc-ms-event-item gsc-ms-event-item--yellow"},$U={class:"gsc-ms-event-count"},eq={key:1,class:"gsc-ms-event-item gsc-ms-event-item--red"},tq={class:"gsc-ms-event-count"},rq={class:"gsc-ms-events-side gsc-ms-events-side--right"},nq={class:"gsc-ms-events-line"},iq={key:0,class:"gsc-ms-event-item gsc-ms-event-item--yellow"},aq={class:"gsc-ms-event-count"},oq={key:1,class:"gsc-ms-event-item gsc-ms-event-item--red"},sq={class:"gsc-ms-event-count"},lq={key:1,class:"gsc-ms-event-item gsc-ms-event-item--goal-icon"},cq={class:"gsc-ms-breakdown-col gsc-ms-breakdown-col--left"},uq={class:"gsc-ms-breakdown-team"},dq=["src","alt"],hq={class:"gsc-ms-breakdown-abbr"},pq={class:"gsc-ms-breakdown-list"},fq=["src","alt"],mq={key:1,class:"gsc-ms-breakdown-min"},gq={class:"gsc-ms-breakdown-col gsc-ms-breakdown-col--center"},yq={class:"gsc-ms-breakdown-title"},vq={class:"gsc-ms-breakdown-col gsc-ms-breakdown-col--right"},bq={class:"gsc-ms-breakdown-team"},xq={class:"gsc-ms-breakdown-abbr"},_q=["src","alt"],wq={class:"gsc-ms-breakdown-list"},Tq={key:0,class:"gsc-ms-breakdown-min"},kq=["src","alt"],Sq=585,A3="https://golstatsimages.blob.core.windows.net/todoelfut/lineups/escudo1.png",C3="https://golstatsimages.blob.core.windows.net/todoelfut/lineups/escudo2.png",Eq={__name:"gsc-match-summary",props:{desplegable:{type:Boolean,default:!1},game:{type:Object,required:!0},defaultShields:{type:Boolean,default:!1}},setup(r){const a=r,g=p.ref(null),B=p.ref(0),J={chico:400,mediano:580},C=p.ref("grande");function x(){if(!g.value)return;const k=g.value.offsetWidth;console.log("width: --->",k),B.value=k,k<J.chico?C.value="chico":k<J.mediano?C.value="mediano":C.value="grande",console.log("Ancho del contenedor:",k,"->",C.value)}let e=null;p.onMounted(()=>{x(),e=new window.ResizeObserver(x),g.value&&e.observe(g.value)}),p.onBeforeUnmount(()=>{e&&g.value&&e.unobserve(g.value)});const v=p.computed(()=>`gsc-ms--${C.value}`),u=p.computed(()=>a.defaultShields?{...a.game.homeTeam,logo:A3}:a.game.homeTeam),t=p.computed(()=>a.defaultShields?{...a.game.awayTeam,logo:C3}:a.game.awayTeam),w=p.computed(()=>a.game.score),y=p.computed(()=>a.game.matchday_name.replace("Matchday","Jornada").replace("de Final","").replace("Playoffs 1","Cuartos de Final Ida").replace("Playoffs 2","Cuartos de Final Vuelta").replace("Playoffs 3","Semifinal Ida").replace("Playoffs 4","Semifinal Vuelta").replace("Playoffs 5","Final Ida").replace("Playoffs 6","Final Vuelta")),b=p.computed(()=>{const k=a.game.game_status;return k===1?"Finalizado":k===2?"En Vivo":k===3?"Pendiente":"Desconocido"}),h=p.computed(()=>{var k;return((k=a.game.minutes)==null?void 0:k.home_goals_minutes)||[]}),n=p.computed(()=>{var k;return((k=a.game.minutes)==null?void 0:k.visiting_goals_minutes)||[]}),i=p.computed(()=>{var k;return((k=a.game.minutes)==null?void 0:k.home_yellow_cards_minutes)||[]}),d=p.computed(()=>{var k;return((k=a.game.minutes)==null?void 0:k.away_yellow_cards_minutes)||[]}),s=p.computed(()=>{var k;return((k=a.game.minutes)==null?void 0:k.home_red_cards_minutes)||[]}),c=p.computed(()=>{var k;return((k=a.game.minutes)==null?void 0:k.away_red_cards_minutes)||[]}),f=p.computed(()=>h.value.length),m=p.computed(()=>n.value.length),T=p.computed(()=>i.value.length),E=p.computed(()=>d.value.length),S=p.computed(()=>s.value.length),P=p.computed(()=>c.value.length),N=k=>{if(k.length===0)return[];const I=[];for(let _=0;_<k.length;_+=4){const R=k.slice(_,_+4).map(z=>{const V=z.match(/(\d+\s*\+\s*\d+|\d+)\'?$/);return V?V[1]+"'":z}).join(", ");I.push(R)}return I},A=k=>k.length===0?[]:[k.map(I=>{const _=I.match(/(\d+\s*\+\s*\d+|\d+)\'?$/);return _?_[1]+"'":I}).join(", ")],O=p.computed(()=>{const k=[];if(h.value.forEach(I=>{const _=I.match(/^(.+?)\s+(\d+\s*\+\s*\d+|\d+)\'?$/);if(_){const[,R,z]=_;k.push({type:"gol",player:R.trim(),minute:z+"'",icon:"https://golstatsimages.blob.core.windows.net/reports-images/gol.svg"})}}),i.value.forEach(I=>{const _=I.match(/^(.+?)\s+(\d+\s*\+\s*\d+|\d+)\'?$/);if(_){const[,R,z]=_;k.push({type:"amarilla",player:R.trim(),minute:z+"'",icon:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-amarilla.svg"})}}),s.value.forEach(I=>{const _=I.match(/^(.+?)\s+(\d+\s*\+\s*\d+|\d+)\'?$/);if(_){const[,R,z]=_;k.push({type:"roja",player:R.trim(),minute:z+"'",icon:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-roja.svg"})}}),k.length>9){const I=k.slice(0,9);return I.push({type:"more",player:"...",minute:"",icon:""}),I}return k}),M=p.computed(()=>{const k=[];if(n.value.forEach(I=>{const _=I.match(/^(.+?)\s+(\d+\s*\+\s*\d+|\d+)\'?$/);if(_){const[,R,z]=_;k.push({type:"gol",player:R.trim(),minute:z+"'",icon:"https://golstatsimages.blob.core.windows.net/reports-images/gol.svg"})}}),d.value.forEach(I=>{const _=I.match(/^(.+?)\s+(\d+\s*\+\s*\d+|\d+)\'?$/);if(_){const[,R,z]=_;k.push({type:"amarilla",player:R.trim(),minute:z+"'",icon:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-amarilla.svg"})}}),c.value.forEach(I=>{const _=I.match(/^(.+?)\s+(\d+\s*\+\s*\d+|\d+)\'?$/);if(_){const[,R,z]=_;k.push({type:"roja",player:R.trim(),minute:z+"'",icon:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-roja.svg"})}}),k.length>9){const I=k.slice(0,9);return I.push({type:"more",player:"...",minute:"",icon:""}),I}return k});return(k,I)=>(p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["gsc-match-summary",v.value]),ref_key:"containerRef",ref:g},[p.createElementVNode("img",{class:p.normalizeClass(["gsc-ms-bg-shield","gsc-ms-bg-shield--left",{"gsc-ms-bg-shield--default":a.defaultShields},{"gsc-ms-bg-shield--small":B.value<=370},{"gsc-ms-bg-shield--tiny":B.value<=280}]),src:a.defaultShields?A3:u.value.logo,alt:"Escudo fondo Home"},null,10,RU),p.createElementVNode("img",{class:p.normalizeClass(["gsc-ms-bg-shield","gsc-ms-bg-shield--right",{"gsc-ms-bg-shield--default":a.defaultShields},{"gsc-ms-bg-shield--small":B.value<=370},{"gsc-ms-bg-shield--tiny":B.value<=280}]),src:a.defaultShields?C3:t.value.logo,alt:"Escudo fondo Away"},null,10,LU),p.createElementVNode("div",{class:p.normalizeClass(["gsc-ms-header",[{"gsc-ms-header--vertical-names":B.value<=370},{"gsc-ms-header--small-shields":B.value<=370&&B.value>280},{"gsc-ms-header--tiny":B.value<=280}]])},[p.createElementVNode("div",zU,[p.createElementVNode("img",{class:p.normalizeClass(["gsc-ms-shield",{"gsc-ms-shield--no-radius":a.defaultShields}]),src:u.value.logo,alt:`Escudo ${u.value.acronym}`},null,10,DU),p.createElementVNode("span",BU,p.toDisplayString(a.defaultShields?"LOC":u.value.acronym),1)]),p.createElementVNode("div",VU,[p.createElementVNode("div",FU,p.toDisplayString(a.defaultShields?"Jornada":y.value),1),p.createElementVNode("div",jU,[p.createElementVNode("span",null,p.toDisplayString(a.defaultShields?"-":w.value[0]),1),I[0]||(I[0]=p.createElementVNode("span",null,":",-1)),p.createElementVNode("span",null,p.toDisplayString(a.defaultShields?"-":w.value[1]),1)]),p.createElementVNode("div",UU,p.toDisplayString(a.defaultShields?"-":b.value),1)]),p.createElementVNode("div",qU,[B.value<=370?(p.openBlock(),p.createElementBlock("img",{key:0,class:p.normalizeClass(["gsc-ms-shield",{"gsc-ms-shield--no-radius":a.defaultShields}]),src:t.value.logo,alt:`Escudo ${t.value.acronym}`},null,10,WU)):p.createCommentVNode("",!0),p.createElementVNode("span",GU,p.toDisplayString(a.defaultShields?"VIS":t.value.acronym),1),B.value>370?(p.openBlock(),p.createElementBlock("img",{key:1,class:p.normalizeClass(["gsc-ms-shield",{"gsc-ms-shield--no-radius":a.defaultShields}]),src:t.value.logo,alt:`Escudo ${t.value.acronym}`},null,10,HU)):p.createCommentVNode("",!0)])],2),p.createElementVNode("div",{class:p.normalizeClass(["gsc-ms-events-row",[{"gsc-ms-events-row--mb":!r.desplegable},{"gsc-ms-events-row--small":B.value<=480&&B.value>465},{"gsc-ms-events-row--tiny":B.value<=465},{"gsc-ms-events-row--micro":B.value<=270}]])},[a.defaultShields?(p.openBlock(),p.createElementBlock("div",XU)):(p.openBlock(),p.createElementBlock("div",YU,[p.createElementVNode("div",JU,[p.createElementVNode("div",KU,[f.value>0?(p.openBlock(),p.createElementBlock("div",ZU,I[1]||(I[1]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/gol.svg",class:"gsc-ms-icon",alt:"Gol"},null,-1)]))):p.createCommentVNode("",!0),f.value>0?(p.openBlock(),p.createElementBlock("div",{key:1,class:p.normalizeClass(["gsc-ms-event-item gsc-ms-event-item--goals",[{"gsc-ms-event-item--goals-wide":B.value>=585},{"gsc-ms-event-item--goals-micro":B.value<=245},{"gsc-ms-event-item--goals-few":f.value<=3}]])},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(B.value>=585?A(h.value):N(h.value),(_,R)=>(p.openBlock(),p.createElementBlock("div",{key:`home-goals-line-${R}`,class:"gsc-ms-minutes-line"},p.toDisplayString(_),1))),128))],2)):p.createCommentVNode("",!0),p.createElementVNode("div",{class:p.normalizeClass(["gsc-ms-cards-container",{"gsc-ms-cards-container--vertical":B.value<=340}])},[T.value>0?(p.openBlock(),p.createElementBlock("div",QU,[I[2]||(I[2]=p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-amarilla.svg",class:"gsc-ms-icon tarjeta-amarilla",alt:"Amarilla"},null,-1)),p.createElementVNode("span",$U,p.toDisplayString(T.value),1)])):p.createCommentVNode("",!0),S.value>0?(p.openBlock(),p.createElementBlock("div",eq,[I[3]||(I[3]=p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-roja.svg",class:"gsc-ms-icon tarjeta-roja",alt:"Roja"},null,-1)),p.createElementVNode("span",tq,p.toDisplayString(S.value),1)])):p.createCommentVNode("",!0)],2)])]),p.createElementVNode("div",{class:p.normalizeClass(["gsc-ms-events-separator",{"gsc-ms-events-separator--hidden":B.value<=350}])},null,2),p.createElementVNode("div",rq,[p.createElementVNode("div",nq,[p.createElementVNode("div",{class:p.normalizeClass(["gsc-ms-cards-container",{"gsc-ms-cards-container--vertical":B.value<=340}])},[E.value>0?(p.openBlock(),p.createElementBlock("div",iq,[I[4]||(I[4]=p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-amarilla.svg",class:"gsc-ms-icon tarjeta-amarilla",alt:"Amarilla"},null,-1)),p.createElementVNode("span",aq,p.toDisplayString(E.value),1)])):p.createCommentVNode("",!0),P.value>0?(p.openBlock(),p.createElementBlock("div",oq,[I[5]||(I[5]=p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-tarjeta-roja.svg",class:"gsc-ms-icon tarjeta-roja",alt:"Roja"},null,-1)),p.createElementVNode("span",sq,p.toDisplayString(P.value),1)])):p.createCommentVNode("",!0)],2),m.value>0?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(["gsc-ms-event-item gsc-ms-event-item--goals",[{"gsc-ms-event-item--goals-wide":B.value>=585},{"gsc-ms-event-item--goals-micro":B.value<=245},{"gsc-ms-event-item--goals-few":m.value<=3}]])},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(B.value>=585?A(n.value):N(n.value),(_,R)=>(p.openBlock(),p.createElementBlock("div",{key:`away-goals-line-${R}`,class:"gsc-ms-minutes-line"},p.toDisplayString(_),1))),128))],2)):p.createCommentVNode("",!0),m.value>0?(p.openBlock(),p.createElementBlock("div",lq,I[6]||(I[6]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/gol.svg",class:"gsc-ms-icon",alt:"Gol"},null,-1)]))):p.createCommentVNode("",!0)])])]))],2),r.desplegable?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(["gsc-ms-breakdown",{"gsc-ms-breakdown--mobile":B.value<Sq},{"gsc-ms-breakdown--tiny":B.value<=280}])},[p.createElementVNode("div",cq,[p.createElementVNode("div",uq,[p.createElementVNode("img",{src:u.value.logo,class:"gsc-ms-breakdown-shield",alt:`Escudo ${u.value.acronym}`},null,8,dq),p.createElementVNode("span",hq,p.toDisplayString(a.defaultShields?"LOC":u.value.acronym),1)]),p.createElementVNode("ul",pq,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(O.value,_=>(p.openBlock(),p.createElementBlock("li",{key:`home-${_.player}-${_.minute}`},[_.type!=="more"?(p.openBlock(),p.createElementBlock("img",{key:0,src:_.icon,class:p.normalizeClass(["gsc-ms-icon",{"tarjeta-amarilla":_.type==="amarilla","tarjeta-roja":_.type==="roja"}]),alt:_.type==="gol"?"Gol":_.type==="amarilla"?"Amarilla":"Roja"},null,10,fq)):p.createCommentVNode("",!0),p.createElementVNode("span",{class:p.normalizeClass(["gsc-ms-breakdown-player",{"gsc-ms-breakdown-more":_.type==="more"}])},p.toDisplayString(_.player),3),_.type!=="more"?(p.openBlock(),p.createElementBlock("span",mq,p.toDisplayString(_.minute),1)):p.createCommentVNode("",!0)]))),128))])]),p.createElementVNode("div",gq,[p.createElementVNode("div",yq,[k.size==="chico"?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[I[7]||(I[7]=p.createTextVNode(" Desglose")),I[8]||(I[8]=p.createElementVNode("br",null,null,-1)),I[9]||(I[9]=p.createTextVNode("de eventos "))],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(" Desglose de eventos ")],64))])]),p.createElementVNode("div",vq,[p.createElementVNode("div",bq,[p.createElementVNode("span",xq,p.toDisplayString(a.defaultShields?"VIS":t.value.acronym),1),p.createElementVNode("img",{src:t.value.logo,class:"gsc-ms-breakdown-shield",alt:`Escudo ${t.value.acronym}`},null,8,_q)]),p.createElementVNode("ul",wq,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(M.value,_=>(p.openBlock(),p.createElementBlock("li",{key:`away-${_.player}-${_.minute}`},[_.type!=="more"?(p.openBlock(),p.createElementBlock("span",Tq,p.toDisplayString(_.minute),1)):p.createCommentVNode("",!0),p.createElementVNode("span",{class:p.normalizeClass(["gsc-ms-breakdown-player",{"gsc-ms-breakdown-more":_.type==="more"}])},p.toDisplayString(_.player),3),_.type!=="more"?(p.openBlock(),p.createElementBlock("img",{key:1,src:_.icon,class:p.normalizeClass(["gsc-ms-icon",{"tarjeta-amarilla":_.type==="amarilla","tarjeta-roja":_.type==="roja"}]),alt:_.type==="gol"?"Gol":_.type==="amarilla"?"Amarilla":"Roja"},null,10,kq)):p.createCommentVNode("",!0)]))),128))])])],2)):p.createCommentVNode("",!0)],2))}},M3=IU(Eq,[["__scopeId","data-v-129cd220"]]);function P3(r,a){return function(){return r.apply(a,arguments)}}const{toString:Aq}=Object.prototype,{getPrototypeOf:Bv}=Object,{iterator:rg,toStringTag:N3}=Symbol,ng=(r=>a=>{const g=Aq.call(a);return r[g]||(r[g]=g.slice(8,-1).toLowerCase())})(Object.create(null)),Ju=r=>(r=r.toLowerCase(),a=>ng(a)===r),ig=r=>a=>typeof a===r,{isArray:Rp}=Array,Bf=ig("undefined");function Vf(r){return r!==null&&!Bf(r)&&r.constructor!==null&&!Bf(r.constructor)&&lu(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const O3=Ju("ArrayBuffer");function Cq(r){let a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(r):a=r&&r.buffer&&O3(r.buffer),a}const Mq=ig("string"),lu=ig("function"),I3=ig("number"),Ff=r=>r!==null&&typeof r=="object",Pq=r=>r===!0||r===!1,ag=r=>{if(ng(r)!=="object")return!1;const a=Bv(r);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(N3 in r)&&!(rg in r)},Nq=r=>{if(!Ff(r)||Vf(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},Oq=Ju("Date"),Iq=Ju("File"),Rq=Ju("Blob"),Lq=Ju("FileList"),zq=r=>Ff(r)&&lu(r.pipe),Dq=r=>{let a;return r&&(typeof FormData=="function"&&r instanceof FormData||lu(r.append)&&((a=ng(r))==="formdata"||a==="object"&&lu(r.toString)&&r.toString()==="[object FormData]"))},Bq=Ju("URLSearchParams"),[Vq,Fq,jq,Uq]=["ReadableStream","Request","Response","Headers"].map(Ju),qq=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function jf(r,a,{allOwnKeys:g=!1}={}){if(r===null||typeof r>"u")return;let B,J;if(typeof r!="object"&&(r=[r]),Rp(r))for(B=0,J=r.length;B<J;B++)a.call(null,r[B],B,r);else{if(Vf(r))return;const C=g?Object.getOwnPropertyNames(r):Object.keys(r),x=C.length;let e;for(B=0;B<x;B++)e=C[B],a.call(null,r[e],e,r)}}function R3(r,a){if(Vf(r))return null;a=a.toLowerCase();const g=Object.keys(r);let B=g.length,J;for(;B-- >0;)if(J=g[B],a===J.toLowerCase())return J;return null}const Uh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,L3=r=>!Bf(r)&&r!==Uh;function Vv(){const{caseless:r}=L3(this)&&this||{},a={},g=(B,J)=>{const C=r&&R3(a,J)||J;ag(a[C])&&ag(B)?a[C]=Vv(a[C],B):ag(B)?a[C]=Vv({},B):Rp(B)?a[C]=B.slice():a[C]=B};for(let B=0,J=arguments.length;B<J;B++)arguments[B]&&jf(arguments[B],g);return a}const Wq=(r,a,g,{allOwnKeys:B}={})=>(jf(a,(J,C)=>{g&&lu(J)?r[C]=P3(J,g):r[C]=J},{allOwnKeys:B}),r),Gq=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Hq=(r,a,g,B)=>{r.prototype=Object.create(a.prototype,B),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:a.prototype}),g&&Object.assign(r.prototype,g)},Xq=(r,a,g,B)=>{let J,C,x;const e={};if(a=a||{},r==null)return a;do{for(J=Object.getOwnPropertyNames(r),C=J.length;C-- >0;)x=J[C],(!B||B(x,r,a))&&!e[x]&&(a[x]=r[x],e[x]=!0);r=g!==!1&&Bv(r)}while(r&&(!g||g(r,a))&&r!==Object.prototype);return a},Yq=(r,a,g)=>{r=String(r),(g===void 0||g>r.length)&&(g=r.length),g-=a.length;const B=r.indexOf(a,g);return B!==-1&&B===g},Jq=r=>{if(!r)return null;if(Rp(r))return r;let a=r.length;if(!I3(a))return null;const g=new Array(a);for(;a-- >0;)g[a]=r[a];return g},Kq=(r=>a=>r&&a instanceof r)(typeof Uint8Array<"u"&&Bv(Uint8Array)),Zq=(r,a)=>{const g=(r&&r[rg]).call(r);let B;for(;(B=g.next())&&!B.done;){const J=B.value;a.call(r,J[0],J[1])}},Qq=(r,a)=>{let g;const B=[];for(;(g=r.exec(a))!==null;)B.push(g);return B},$q=Ju("HTMLFormElement"),eW=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,g,B){return g.toUpperCase()+B}),z3=(({hasOwnProperty:r})=>(a,g)=>r.call(a,g))(Object.prototype),tW=Ju("RegExp"),D3=(r,a)=>{const g=Object.getOwnPropertyDescriptors(r),B={};jf(g,(J,C)=>{let x;(x=a(J,C,r))!==!1&&(B[C]=x||J)}),Object.defineProperties(r,B)},rW=r=>{D3(r,(a,g)=>{if(lu(r)&&["arguments","caller","callee"].indexOf(g)!==-1)return!1;const B=r[g];if(lu(B)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+g+"'")})}})},nW=(r,a)=>{const g={},B=J=>{J.forEach(C=>{g[C]=!0})};return Rp(r)?B(r):B(String(r).split(a)),g},iW=()=>{},aW=(r,a)=>r!=null&&Number.isFinite(r=+r)?r:a;function oW(r){return!!(r&&lu(r.append)&&r[N3]==="FormData"&&r[rg])}const sW=r=>{const a=new Array(10),g=(B,J)=>{if(Ff(B)){if(a.indexOf(B)>=0)return;if(Vf(B))return B;if(!("toJSON"in B)){a[J]=B;const C=Rp(B)?[]:{};return jf(B,(x,e)=>{const v=g(x,J+1);!Bf(v)&&(C[e]=v)}),a[J]=void 0,C}}return B};return g(r,0)},lW=Ju("AsyncFunction"),cW=r=>r&&(Ff(r)||lu(r))&&lu(r.then)&&lu(r.catch),B3=((r,a)=>r?setImmediate:a?((g,B)=>(Uh.addEventListener("message",({source:J,data:C})=>{J===Uh&&C===g&&B.length&&B.shift()()},!1),J=>{B.push(J),Uh.postMessage(g,"*")}))(`axios@${Math.random()}`,[]):g=>setTimeout(g))(typeof setImmediate=="function",lu(Uh.postMessage)),uW=typeof queueMicrotask<"u"?queueMicrotask.bind(Uh):typeof process<"u"&&process.nextTick||B3,dW=r=>r!=null&&lu(r[rg]),qn={isArray:Rp,isArrayBuffer:O3,isBuffer:Vf,isFormData:Dq,isArrayBufferView:Cq,isString:Mq,isNumber:I3,isBoolean:Pq,isObject:Ff,isPlainObject:ag,isEmptyObject:Nq,isReadableStream:Vq,isRequest:Fq,isResponse:jq,isHeaders:Uq,isUndefined:Bf,isDate:Oq,isFile:Iq,isBlob:Rq,isRegExp:tW,isFunction:lu,isStream:zq,isURLSearchParams:Bq,isTypedArray:Kq,isFileList:Lq,forEach:jf,merge:Vv,extend:Wq,trim:qq,stripBOM:Gq,inherits:Hq,toFlatObject:Xq,kindOf:ng,kindOfTest:Ju,endsWith:Yq,toArray:Jq,forEachEntry:Zq,matchAll:Qq,isHTMLForm:$q,hasOwnProperty:z3,hasOwnProp:z3,reduceDescriptors:D3,freezeMethods:rW,toObjectSet:nW,toCamelCase:eW,noop:iW,toFiniteNumber:aW,findKey:R3,global:Uh,isContextDefined:L3,isSpecCompliantForm:oW,toJSONObject:sW,isAsyncFn:lW,isThenable:cW,setImmediate:B3,asap:uW,isIterable:dW};function ma(r,a,g,B,J){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",a&&(this.code=a),g&&(this.config=g),B&&(this.request=B),J&&(this.response=J,this.status=J.status?J.status:null)}qn.inherits(ma,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:qn.toJSONObject(this.config),code:this.code,status:this.status}}});const V3=ma.prototype,F3={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{F3[r]={value:r}}),Object.defineProperties(ma,F3),Object.defineProperty(V3,"isAxiosError",{value:!0}),ma.from=(r,a,g,B,J,C)=>{const x=Object.create(V3);return qn.toFlatObject(r,x,function(e){return e!==Error.prototype},e=>e!=="isAxiosError"),ma.call(x,r.message,a,g,B,J),x.cause=r,x.name=r.name,C&&Object.assign(x,C),x};const hW=null;function Fv(r){return qn.isPlainObject(r)||qn.isArray(r)}function j3(r){return qn.endsWith(r,"[]")?r.slice(0,-2):r}function U3(r,a,g){return r?r.concat(a).map(function(B,J){return B=j3(B),!g&&J?"["+B+"]":B}).join(g?".":""):a}function pW(r){return qn.isArray(r)&&!r.some(Fv)}const fW=qn.toFlatObject(qn,{},null,function(r){return/^is[A-Z]/.test(r)});function og(r,a,g){if(!qn.isObject(r))throw new TypeError("target must be an object");a=a||new FormData,g=qn.toFlatObject(g,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,h){return!qn.isUndefined(h[b])});const B=g.metaTokens,J=g.visitor||u,C=g.dots,x=g.indexes,e=(g.Blob||typeof Blob<"u"&&Blob)&&qn.isSpecCompliantForm(a);if(!qn.isFunction(J))throw new TypeError("visitor must be a function");function v(b){if(b===null)return"";if(qn.isDate(b))return b.toISOString();if(qn.isBoolean(b))return b.toString();if(!e&&qn.isBlob(b))throw new ma("Blob is not supported. Use a Buffer instead.");return qn.isArrayBuffer(b)||qn.isTypedArray(b)?e&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,h,n){let i=b;if(b&&!n&&typeof b=="object"){if(qn.endsWith(h,"{}"))h=B?h:h.slice(0,-2),b=JSON.stringify(b);else if(qn.isArray(b)&&pW(b)||(qn.isFileList(b)||qn.endsWith(h,"[]"))&&(i=qn.toArray(b)))return h=j3(h),i.forEach(function(d,s){!(qn.isUndefined(d)||d===null)&&a.append(x===!0?U3([h],s,C):x===null?h:h+"[]",v(d))}),!1}return Fv(b)?!0:(a.append(U3(n,h,C),v(b)),!1)}const t=[],w=Object.assign(fW,{defaultVisitor:u,convertValue:v,isVisitable:Fv});function y(b,h){if(!qn.isUndefined(b)){if(t.indexOf(b)!==-1)throw Error("Circular reference detected in "+h.join("."));t.push(b),qn.forEach(b,function(n,i){(!(qn.isUndefined(n)||n===null)&&J.call(a,n,qn.isString(i)?i.trim():i,h,w))===!0&&y(n,h?h.concat(i):[i])}),t.pop()}}if(!qn.isObject(r))throw new TypeError("data must be an object");return y(r),a}function q3(r){const a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(g){return a[g]})}function jv(r,a){this._pairs=[],r&&og(r,this,a)}const W3=jv.prototype;W3.append=function(r,a){this._pairs.push([r,a])},W3.toString=function(r){const a=r?function(g){return r.call(this,g,q3)}:q3;return this._pairs.map(function(g){return a(g[0])+"="+a(g[1])},"").join("&")};function mW(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function G3(r,a,g){if(!a)return r;const B=g&&g.encode||mW;qn.isFunction(g)&&(g={serialize:g});const J=g&&g.serialize;let C;if(J?C=J(a,g):C=qn.isURLSearchParams(a)?a.toString():new jv(a,g).toString(B),C){const x=r.indexOf("#");x!==-1&&(r=r.slice(0,x)),r+=(r.indexOf("?")===-1?"?":"&")+C}return r}let H3=class{constructor(){this.handlers=[]}use(r,a,g){return this.handlers.push({fulfilled:r,rejected:a,synchronous:g?g.synchronous:!1,runWhen:g?g.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){qn.forEach(this.handlers,function(a){a!==null&&r(a)})}};const X3={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gW=typeof URLSearchParams<"u"?URLSearchParams:jv,yW=typeof FormData<"u"?FormData:null,vW=typeof Blob<"u"?Blob:null,bW={isBrowser:!0,classes:{URLSearchParams:gW,FormData:yW,Blob:vW},protocols:["http","https","file","blob","url","data"]},Uv=typeof window<"u"&&typeof document<"u",qv=typeof navigator=="object"&&navigator||void 0,xW=Uv&&(!qv||["ReactNative","NativeScript","NS"].indexOf(qv.product)<0),_W=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",wW=Uv&&window.location.href||"http://localhost",TW=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Uv,hasStandardBrowserEnv:xW,hasStandardBrowserWebWorkerEnv:_W,navigator:qv,origin:wW},Symbol.toStringTag,{value:"Module"})),Cc={...TW,...bW};function kW(r,a){return og(r,new Cc.classes.URLSearchParams,{visitor:function(g,B,J,C){return Cc.isNode&&qn.isBuffer(g)?(this.append(B,g.toString("base64")),!1):C.defaultVisitor.apply(this,arguments)},...a})}function SW(r){return qn.matchAll(/\w+|\[(\w*)]/g,r).map(a=>a[0]==="[]"?"":a[1]||a[0])}function EW(r){const a={},g=Object.keys(r);let B;const J=g.length;let C;for(B=0;B<J;B++)C=g[B],a[C]=r[C];return a}function Y3(r){function a(g,B,J,C){let x=g[C++];if(x==="__proto__")return!0;const e=Number.isFinite(+x),v=C>=g.length;return x=!x&&qn.isArray(J)?J.length:x,v?(qn.hasOwnProp(J,x)?J[x]=[J[x],B]:J[x]=B,!e):((!J[x]||!qn.isObject(J[x]))&&(J[x]=[]),a(g,B,J[x],C)&&qn.isArray(J[x])&&(J[x]=EW(J[x])),!e)}if(qn.isFormData(r)&&qn.isFunction(r.entries)){const g={};return qn.forEachEntry(r,(B,J)=>{a(SW(B),J,g,0)}),g}return null}function AW(r,a,g){if(qn.isString(r))try{return(a||JSON.parse)(r),qn.trim(r)}catch(B){if(B.name!=="SyntaxError")throw B}return(g||JSON.stringify)(r)}const Uf={transitional:X3,adapter:["xhr","http","fetch"],transformRequest:[function(r,a){const g=a.getContentType()||"",B=g.indexOf("application/json")>-1,J=qn.isObject(r);if(J&&qn.isHTMLForm(r)&&(r=new FormData(r)),qn.isFormData(r))return B?JSON.stringify(Y3(r)):r;if(qn.isArrayBuffer(r)||qn.isBuffer(r)||qn.isStream(r)||qn.isFile(r)||qn.isBlob(r)||qn.isReadableStream(r))return r;if(qn.isArrayBufferView(r))return r.buffer;if(qn.isURLSearchParams(r))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let C;if(J){if(g.indexOf("application/x-www-form-urlencoded")>-1)return kW(r,this.formSerializer).toString();if((C=qn.isFileList(r))||g.indexOf("multipart/form-data")>-1){const x=this.env&&this.env.FormData;return og(C?{"files[]":r}:r,x&&new x,this.formSerializer)}}return J||B?(a.setContentType("application/json",!1),AW(r)):r}],transformResponse:[function(r){const a=this.transitional||Uf.transitional,g=a&&a.forcedJSONParsing,B=this.responseType==="json";if(qn.isResponse(r)||qn.isReadableStream(r))return r;if(r&&qn.isString(r)&&(g&&!this.responseType||B)){const J=!(a&&a.silentJSONParsing)&&B;try{return JSON.parse(r)}catch(C){if(J)throw C.name==="SyntaxError"?ma.from(C,ma.ERR_BAD_RESPONSE,this,null,this.response):C}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Cc.classes.FormData,Blob:Cc.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};qn.forEach(["delete","get","head","post","put","patch"],r=>{Uf.headers[r]={}});const CW=qn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),MW=r=>{const a={};let g,B,J;return r&&r.split(`
|
|
4055
4055
|
`).forEach(function(C){J=C.indexOf(":"),g=C.substring(0,J).trim().toLowerCase(),B=C.substring(J+1).trim(),!(!g||a[g]&&CW[g])&&(g==="set-cookie"?a[g]?a[g].push(B):a[g]=[B]:a[g]=a[g]?a[g]+", "+B:B)}),a},J3=Symbol("internals");function qf(r){return r&&String(r).trim().toLowerCase()}function sg(r){return r===!1||r==null?r:qn.isArray(r)?r.map(sg):String(r)}function PW(r){const a=Object.create(null),g=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let B;for(;B=g.exec(r);)a[B[1]]=B[2];return a}const NW=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function Wv(r,a,g,B,J){if(qn.isFunction(B))return B.call(this,a,g);if(J&&(a=g),!!qn.isString(a)){if(qn.isString(B))return a.indexOf(B)!==-1;if(qn.isRegExp(B))return B.test(a)}}function OW(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(a,g,B)=>g.toUpperCase()+B)}function IW(r,a){const g=qn.toCamelCase(" "+a);["get","set","has"].forEach(B=>{Object.defineProperty(r,B+g,{value:function(J,C,x){return this[B].call(this,a,J,C,x)},configurable:!0})})}let cu=class{constructor(r){r&&this.set(r)}set(r,a,g){const B=this;function J(x,e,v){const u=qf(e);if(!u)throw new Error("header name must be a non-empty string");const t=qn.findKey(B,u);(!t||B[t]===void 0||v===!0||v===void 0&&B[t]!==!1)&&(B[t||e]=sg(x))}const C=(x,e)=>qn.forEach(x,(v,u)=>J(v,u,e));if(qn.isPlainObject(r)||r instanceof this.constructor)C(r,a);else if(qn.isString(r)&&(r=r.trim())&&!NW(r))C(MW(r),a);else if(qn.isObject(r)&&qn.isIterable(r)){let x={},e,v;for(const u of r){if(!qn.isArray(u))throw TypeError("Object iterator must return a key-value pair");x[v=u[0]]=(e=x[v])?qn.isArray(e)?[...e,u[1]]:[e,u[1]]:u[1]}C(x,a)}else r!=null&&J(a,r,g);return this}get(r,a){if(r=qf(r),r){const g=qn.findKey(this,r);if(g){const B=this[g];if(!a)return B;if(a===!0)return PW(B);if(qn.isFunction(a))return a.call(this,B,g);if(qn.isRegExp(a))return a.exec(B);throw new TypeError("parser must be boolean|regexp|function")}}}has(r,a){if(r=qf(r),r){const g=qn.findKey(this,r);return!!(g&&this[g]!==void 0&&(!a||Wv(this,this[g],g,a)))}return!1}delete(r,a){const g=this;let B=!1;function J(C){if(C=qf(C),C){const x=qn.findKey(g,C);x&&(!a||Wv(g,g[x],x,a))&&(delete g[x],B=!0)}}return qn.isArray(r)?r.forEach(J):J(r),B}clear(r){const a=Object.keys(this);let g=a.length,B=!1;for(;g--;){const J=a[g];(!r||Wv(this,this[J],J,r,!0))&&(delete this[J],B=!0)}return B}normalize(r){const a=this,g={};return qn.forEach(this,(B,J)=>{const C=qn.findKey(g,J);if(C){a[C]=sg(B),delete a[J];return}const x=r?OW(J):String(J).trim();x!==J&&delete a[J],a[x]=sg(B),g[x]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){const a=Object.create(null);return qn.forEach(this,(g,B)=>{g!=null&&g!==!1&&(a[B]=r&&qn.isArray(g)?g.join(", "):g)}),a}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,a])=>r+": "+a).join(`
|
|
4056
4056
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...a){const g=new this(r);return a.forEach(B=>g.set(B)),g}static accessor(r){const a=(this[J3]=this[J3]={accessors:{}}).accessors,g=this.prototype;function B(J){const C=qf(J);a[C]||(IW(g,J),a[C]=!0)}return qn.isArray(r)?r.forEach(B):B(r),this}};cu.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),qn.reduceDescriptors(cu.prototype,({value:r},a)=>{let g=a[0].toUpperCase()+a.slice(1);return{get:()=>r,set(B){this[g]=B}}}),qn.freezeMethods(cu);function Gv(r,a){const g=this||Uf,B=a||g,J=cu.from(B.headers);let C=B.data;return qn.forEach(r,function(x){C=x.call(g,C,J.normalize(),a?a.status:void 0)}),J.normalize(),C}function K3(r){return!!(r&&r.__CANCEL__)}function Lp(r,a,g){ma.call(this,r??"canceled",ma.ERR_CANCELED,a,g),this.name="CanceledError"}qn.inherits(Lp,ma,{__CANCEL__:!0});function Z3(r,a,g){const B=g.config.validateStatus;!g.status||!B||B(g.status)?r(g):a(new ma("Request failed with status code "+g.status,[ma.ERR_BAD_REQUEST,ma.ERR_BAD_RESPONSE][Math.floor(g.status/100)-4],g.config,g.request,g))}function RW(r){const a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return a&&a[1]||""}function LW(r,a){r=r||10;const g=new Array(r),B=new Array(r);let J=0,C=0,x;return a=a!==void 0?a:1e3,function(e){const v=Date.now(),u=B[C];x||(x=v),g[J]=e,B[J]=v;let t=C,w=0;for(;t!==J;)w+=g[t++],t=t%r;if(J=(J+1)%r,J===C&&(C=(C+1)%r),v-x<a)return;const y=u&&v-u;return y?Math.round(w*1e3/y):void 0}}function zW(r,a){let g=0,B=1e3/a,J,C;const x=(e,v=Date.now())=>{g=v,J=null,C&&(clearTimeout(C),C=null),r(...e)};return[(...e)=>{const v=Date.now(),u=v-g;u>=B?x(e,v):(J=e,C||(C=setTimeout(()=>{C=null,x(J)},B-u)))},()=>J&&x(J)]}const lg=(r,a,g=3)=>{let B=0;const J=LW(50,250);return zW(C=>{const x=C.loaded,e=C.lengthComputable?C.total:void 0,v=x-B,u=J(v),t=x<=e;B=x;const w={loaded:x,total:e,progress:e?x/e:void 0,bytes:v,rate:u||void 0,estimated:u&&e&&t?(e-x)/u:void 0,event:C,lengthComputable:e!=null,[a?"download":"upload"]:!0};r(w)},g)},Q3=(r,a)=>{const g=r!=null;return[B=>a[0]({lengthComputable:g,total:r,loaded:B}),a[1]]},$3=r=>(...a)=>qn.asap(()=>r(...a)),DW=Cc.hasStandardBrowserEnv?((r,a)=>g=>(g=new URL(g,Cc.origin),r.protocol===g.protocol&&r.host===g.host&&(a||r.port===g.port)))(new URL(Cc.origin),Cc.navigator&&/(msie|trident)/i.test(Cc.navigator.userAgent)):()=>!0,BW=Cc.hasStandardBrowserEnv?{write(r,a,g,B,J,C){const x=[r+"="+encodeURIComponent(a)];qn.isNumber(g)&&x.push("expires="+new Date(g).toGMTString()),qn.isString(B)&&x.push("path="+B),qn.isString(J)&&x.push("domain="+J),C===!0&&x.push("secure"),document.cookie=x.join("; ")},read(r){const a=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function VW(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function FW(r,a){return a?r.replace(/\/?\/$/,"")+"/"+a.replace(/^\/+/,""):r}function e5(r,a,g){let B=!VW(a);return r&&(B||g==!1)?FW(r,a):a}const t5=r=>r instanceof cu?{...r}:r;function qh(r,a){a=a||{};const g={};function B(u,t,w,y){return qn.isPlainObject(u)&&qn.isPlainObject(t)?qn.merge.call({caseless:y},u,t):qn.isPlainObject(t)?qn.merge({},t):qn.isArray(t)?t.slice():t}function J(u,t,w,y){if(qn.isUndefined(t)){if(!qn.isUndefined(u))return B(void 0,u,w,y)}else return B(u,t,w,y)}function C(u,t){if(!qn.isUndefined(t))return B(void 0,t)}function x(u,t){if(qn.isUndefined(t)){if(!qn.isUndefined(u))return B(void 0,u)}else return B(void 0,t)}function e(u,t,w){if(w in a)return B(u,t);if(w in r)return B(void 0,u)}const v={url:C,method:C,data:C,baseURL:x,transformRequest:x,transformResponse:x,paramsSerializer:x,timeout:x,timeoutMessage:x,withCredentials:x,withXSRFToken:x,adapter:x,responseType:x,xsrfCookieName:x,xsrfHeaderName:x,onUploadProgress:x,onDownloadProgress:x,decompress:x,maxContentLength:x,maxBodyLength:x,beforeRedirect:x,transport:x,httpAgent:x,httpsAgent:x,cancelToken:x,socketPath:x,responseEncoding:x,validateStatus:e,headers:(u,t,w)=>J(t5(u),t5(t),w,!0)};return qn.forEach(Object.keys({...r,...a}),function(u){const t=v[u]||J,w=t(r[u],a[u],u);qn.isUndefined(w)&&t!==e||(g[u]=w)}),g}const r5=r=>{const a=qh({},r);let{data:g,withXSRFToken:B,xsrfHeaderName:J,xsrfCookieName:C,headers:x,auth:e}=a;a.headers=x=cu.from(x),a.url=G3(e5(a.baseURL,a.url,a.allowAbsoluteUrls),r.params,r.paramsSerializer),e&&x.set("Authorization","Basic "+btoa((e.username||"")+":"+(e.password?unescape(encodeURIComponent(e.password)):"")));let v;if(qn.isFormData(g)){if(Cc.hasStandardBrowserEnv||Cc.hasStandardBrowserWebWorkerEnv)x.setContentType(void 0);else if((v=x.getContentType())!==!1){const[u,...t]=v?v.split(";").map(w=>w.trim()).filter(Boolean):[];x.setContentType([u||"multipart/form-data",...t].join("; "))}}if(Cc.hasStandardBrowserEnv&&(B&&qn.isFunction(B)&&(B=B(a)),B||B!==!1&&DW(a.url))){const u=J&&C&&BW.read(C);u&&x.set(J,u)}return a},jW=typeof XMLHttpRequest<"u",UW=jW&&function(r){return new Promise(function(a,g){const B=r5(r);let J=B.data;const C=cu.from(B.headers).normalize();let{responseType:x,onUploadProgress:e,onDownloadProgress:v}=B,u,t,w,y,b;function h(){y&&y(),b&&b(),B.cancelToken&&B.cancelToken.unsubscribe(u),B.signal&&B.signal.removeEventListener("abort",u)}let n=new XMLHttpRequest;n.open(B.method.toUpperCase(),B.url,!0),n.timeout=B.timeout;function i(){if(!n)return;const s=cu.from("getAllResponseHeaders"in n&&n.getAllResponseHeaders()),c={data:!x||x==="text"||x==="json"?n.responseText:n.response,status:n.status,statusText:n.statusText,headers:s,config:r,request:n};Z3(function(f){a(f),h()},function(f){g(f),h()},c),n=null}"onloadend"in n?n.onloadend=i:n.onreadystatechange=function(){!n||n.readyState!==4||n.status===0&&!(n.responseURL&&n.responseURL.indexOf("file:")===0)||setTimeout(i)},n.onabort=function(){n&&(g(new ma("Request aborted",ma.ECONNABORTED,r,n)),n=null)},n.onerror=function(){g(new ma("Network Error",ma.ERR_NETWORK,r,n)),n=null},n.ontimeout=function(){let s=B.timeout?"timeout of "+B.timeout+"ms exceeded":"timeout exceeded";const c=B.transitional||X3;B.timeoutErrorMessage&&(s=B.timeoutErrorMessage),g(new ma(s,c.clarifyTimeoutError?ma.ETIMEDOUT:ma.ECONNABORTED,r,n)),n=null},J===void 0&&C.setContentType(null),"setRequestHeader"in n&&qn.forEach(C.toJSON(),function(s,c){n.setRequestHeader(c,s)}),qn.isUndefined(B.withCredentials)||(n.withCredentials=!!B.withCredentials),x&&x!=="json"&&(n.responseType=B.responseType),v&&([w,b]=lg(v,!0),n.addEventListener("progress",w)),e&&n.upload&&([t,y]=lg(e),n.upload.addEventListener("progress",t),n.upload.addEventListener("loadend",y)),(B.cancelToken||B.signal)&&(u=s=>{n&&(g(!s||s.type?new Lp(null,r,n):s),n.abort(),n=null)},B.cancelToken&&B.cancelToken.subscribe(u),B.signal&&(B.signal.aborted?u():B.signal.addEventListener("abort",u)));const d=RW(B.url);if(d&&Cc.protocols.indexOf(d)===-1){g(new ma("Unsupported protocol "+d+":",ma.ERR_BAD_REQUEST,r));return}n.send(J||null)})},qW=(r,a)=>{const{length:g}=r=r?r.filter(Boolean):[];if(a||g){let B=new AbortController,J;const C=function(u){if(!J){J=!0,e();const t=u instanceof Error?u:this.reason;B.abort(t instanceof ma?t:new Lp(t instanceof Error?t.message:t))}};let x=a&&setTimeout(()=>{x=null,C(new ma(`timeout ${a} of ms exceeded`,ma.ETIMEDOUT))},a);const e=()=>{r&&(x&&clearTimeout(x),x=null,r.forEach(u=>{u.unsubscribe?u.unsubscribe(C):u.removeEventListener("abort",C)}),r=null)};r.forEach(u=>u.addEventListener("abort",C));const{signal:v}=B;return v.unsubscribe=()=>qn.asap(e),v}},WW=function*(r,a){let g=r.byteLength;if(g<a){yield r;return}let B=0,J;for(;B<g;)J=B+a,yield r.slice(B,J),B=J},GW=async function*(r,a){for await(const g of HW(r))yield*WW(g,a)},HW=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const a=r.getReader();try{for(;;){const{done:g,value:B}=await a.read();if(g)break;yield B}}finally{await a.cancel()}},n5=(r,a,g,B)=>{const J=GW(r,a);let C=0,x,e=v=>{x||(x=!0,B&&B(v))};return new ReadableStream({async pull(v){try{const{done:u,value:t}=await J.next();if(u){e(),v.close();return}let w=t.byteLength;if(g){let y=C+=w;g(y)}v.enqueue(new Uint8Array(t))}catch(u){throw e(u),u}},cancel(v){return e(v),J.return()}},{highWaterMark:2})},cg=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",i5=cg&&typeof ReadableStream=="function",XW=cg&&(typeof TextEncoder=="function"?(r=>a=>r.encode(a))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),a5=(r,...a)=>{try{return!!r(...a)}catch{return!1}},YW=i5&&a5(()=>{let r=!1;const a=new Request(Cc.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!a}),o5=64*1024,Hv=i5&&a5(()=>qn.isReadableStream(new Response("").body)),ug={stream:Hv&&(r=>r.body)};cg&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(a=>{!ug[a]&&(ug[a]=qn.isFunction(r[a])?g=>g[a]():(g,B)=>{throw new ma(`Response type '${a}' is not supported`,ma.ERR_NOT_SUPPORT,B)})})})(new Response);const JW=async r=>{if(r==null)return 0;if(qn.isBlob(r))return r.size;if(qn.isSpecCompliantForm(r))return(await new Request(Cc.origin,{method:"POST",body:r}).arrayBuffer()).byteLength;if(qn.isArrayBufferView(r)||qn.isArrayBuffer(r))return r.byteLength;if(qn.isURLSearchParams(r)&&(r=r+""),qn.isString(r))return(await XW(r)).byteLength},KW=async(r,a)=>qn.toFiniteNumber(r.getContentLength())??JW(a),ZW=cg&&(async r=>{let{url:a,method:g,data:B,signal:J,cancelToken:C,timeout:x,onDownloadProgress:e,onUploadProgress:v,responseType:u,headers:t,withCredentials:w="same-origin",fetchOptions:y}=r5(r);u=u?(u+"").toLowerCase():"text";let b=qW([J,C&&C.toAbortSignal()],x),h;const n=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let i;try{if(v&&YW&&g!=="get"&&g!=="head"&&(i=await KW(t,B))!==0){let m=new Request(a,{method:"POST",body:B,duplex:"half"}),T;if(qn.isFormData(B)&&(T=m.headers.get("content-type"))&&t.setContentType(T),m.body){const[E,S]=Q3(i,lg($3(v)));B=n5(m.body,o5,E,S)}}qn.isString(w)||(w=w?"include":"omit");const d="credentials"in Request.prototype;h=new Request(a,{...y,signal:b,method:g.toUpperCase(),headers:t.normalize().toJSON(),body:B,duplex:"half",credentials:d?w:void 0});let s=await fetch(h,y);const c=Hv&&(u==="stream"||u==="response");if(Hv&&(e||c&&n)){const m={};["status","statusText","headers"].forEach(P=>{m[P]=s[P]});const T=qn.toFiniteNumber(s.headers.get("content-length")),[E,S]=e&&Q3(T,lg($3(e),!0))||[];s=new Response(n5(s.body,o5,E,()=>{S&&S(),n&&n()}),m)}u=u||"text";let f=await ug[qn.findKey(ug,u)||"text"](s,r);return!c&&n&&n(),await new Promise((m,T)=>{Z3(m,T,{data:f,headers:cu.from(s.headers),status:s.status,statusText:s.statusText,config:r,request:h})})}catch(d){throw n&&n(),d&&d.name==="TypeError"&&/Load failed|fetch/i.test(d.message)?Object.assign(new ma("Network Error",ma.ERR_NETWORK,r,h),{cause:d.cause||d}):ma.from(d,d&&d.code,r,h)}}),Xv={http:hW,xhr:UW,fetch:ZW};qn.forEach(Xv,(r,a)=>{if(r){try{Object.defineProperty(r,"name",{value:a})}catch{}Object.defineProperty(r,"adapterName",{value:a})}});const s5=r=>`- ${r}`,QW=r=>qn.isFunction(r)||r===null||r===!1,l5={getAdapter:r=>{r=qn.isArray(r)?r:[r];const{length:a}=r;let g,B;const J={};for(let C=0;C<a;C++){g=r[C];let x;if(B=g,!QW(g)&&(B=Xv[(x=String(g)).toLowerCase()],B===void 0))throw new ma(`Unknown adapter '${x}'`);if(B)break;J[x||"#"+C]=B}if(!B){const C=Object.entries(J).map(([e,v])=>`adapter ${e} `+(v===!1?"is not supported by the environment":"is not available in the build"));let x=a?C.length>1?`since :
|
|
4057
4057
|
`+C.map(s5).join(`
|
|
@@ -4078,7 +4078,7 @@ uniform ${Be} ${qe} u_${it};
|
|
|
4078
4078
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
4079
4079
|
*/const Uc=new Lse;class Wi{static init(a={},g=".grid-stack"){if(typeof document>"u")return null;const B=Wi.getGridElement(g);return B?(B.gridstack||(B.gridstack=new Wi(B,zn.cloneDeep(a))),B.gridstack):(console.error(typeof g=="string"?'GridStack.initAll() no grid was found with selector "'+g+`" - element missing or wrong selector ?
|
|
4080
4080
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(a={},g=".grid-stack"){const B=[];return typeof document>"u"||(Wi.getGridElements(g).forEach(J=>{J.gridstack||(J.gridstack=new Wi(J,zn.cloneDeep(a))),B.push(J.gridstack)}),B.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+g+`" - element missing or wrong selector ?
|
|
4081
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),B}static addGrid(a,g={}){if(!a)return null;let B=a;if(B.gridstack){const J=B.gridstack;return g&&(J.opts={...J.opts,...g}),g.children!==void 0&&J.load(g.children),J}return(!a.classList.contains("grid-stack")||Wi.addRemoveCB)&&(Wi.addRemoveCB?B=Wi.addRemoveCB(a,g,!0,!0):B=zn.createDiv(["grid-stack",g.class],a)),Wi.init(g,B)}static registerEngine(a){Wi.engineClass=a}get placeholder(){if(!this._placeholder){this._placeholder=zn.createDiv([this.opts.placeholderClass,Cu.itemClass,this.opts.itemClass]);const a=zn.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(a.textContent=this.opts.placeholderText)}return this._placeholder}constructor(a,g={}){var B;this.el=a,this.opts=g,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},a.gridstack=this,this.opts=g=g||{},a.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),g.row&&(g.minRow=g.maxRow=g.row,delete g.row);const J=zn.toNumber(a.getAttribute("gs-row"));g.column==="auto"&&delete g.column,g.alwaysShowResizeHandle!==void 0&&(g._alwaysShowResizeHandle=g.alwaysShowResizeHandle);const C=g.columnOpts;if(C){const t=C.breakpoints;!C.columnWidth&&!(t!=null&&t.length)?delete g.columnOpts:(C.columnMax=C.columnMax||12,(t==null?void 0:t.length)>1&&t.sort((w,y)=>(y.w||0)-(w.w||0)))}const x={...zn.cloneDeep(Cu),column:zn.toNumber(a.getAttribute("gs-column"))||Cu.column,minRow:J||zn.toNumber(a.getAttribute("gs-min-row"))||Cu.minRow,maxRow:J||zn.toNumber(a.getAttribute("gs-max-row"))||Cu.maxRow,staticGrid:zn.toBool(a.getAttribute("gs-static"))||Cu.staticGrid,sizeToContent:zn.toBool(a.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(g.handleClass?"."+g.handleClass:g.handle?g.handle:"")||Cu.draggable.handle},removableOptions:{accept:g.itemClass||Cu.removableOptions.accept,decline:Cu.removableOptions.decline}};a.getAttribute("gs-animate")&&(x.animate=zn.toBool(a.getAttribute("gs-animate"))),g=zn.defaults(g,x),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(g),g.rtl==="auto"&&(g.rtl=a.style.direction==="rtl"),g.rtl&&this.el.classList.add("grid-stack-rtl");const e=this.el.closest("."+Cu.itemClass),v=e==null?void 0:e.gridstackNode;if(v&&(v.subGrid=this,this.parentGridNode=v,this.el.classList.add("grid-stack-nested"),v.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=g.cellHeight==="auto",this._isAutoCellHeight||g.cellHeight==="initial")this.cellHeight(void 0);else{typeof g.cellHeight=="number"&&g.cellHeightUnit&&g.cellHeightUnit!==Cu.cellHeightUnit&&(g.cellHeight=g.cellHeight+g.cellHeightUnit,delete g.cellHeightUnit);const t=g.cellHeight;delete g.cellHeight,this.cellHeight(t)}g.alwaysShowResizeHandle==="mobile"&&(g.alwaysShowResizeHandle=$u),this._setStaticClass();const u=g.engineClass||Wi.engineClass||Bd;if(this.engine=new u({column:this.getColumn(),float:g.float,maxRow:g.maxRow,onChange:t=>{t.forEach(w=>{const y=w.el;y&&(w._removeDOM?(y&&y.remove(),delete w._removeDOM):this._writePosAttr(y,w))}),this._updateContainerHeight()}}),g.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(t=>this._prepareElement(t)),delete this.engine._loading,this.batchUpdate(!1)),g.children){const t=g.children;delete g.children,t.length&&this.load(t)}this.setAnimation(),g.subGridDynamic&&!Ki.pauseDrag&&(Ki.pauseDrag=!0),((B=g.draggable)==null?void 0:B.pause)!==void 0&&(Ki.pauseDrag=g.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(a=this.opts){this.el.classList.add("gs-"+a.column),typeof a.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/a.column}%`)}addWidget(a){if(!a)return;if(typeof a=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(a.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(a);let g,B=a;if(B.grid=this,B.el?g=B.el:Wi.addRemoveCB?g=Wi.addRemoveCB(this.el,a,!0,!1):g=this.createWidgetDivs(B),!g)return;if(B=g.gridstackNode,B&&g.parentElement===this.el&&this.engine.nodes.find(C=>C._id===B._id))return g;const J=this._readAttr(g);return zn.defaults(a,J),this.engine.prepareNode(a),this.el.appendChild(g),this.makeWidget(g,a),g}createWidgetDivs(a){const g=zn.createDiv(["grid-stack-item",this.opts.itemClass]),B=zn.createDiv(["grid-stack-item-content"],g);return zn.lazyLoad(a)?a.visibleObservable||(a.visibleObservable=new IntersectionObserver(([J])=>{var C,x;J.isIntersecting&&((C=a.visibleObservable)==null||C.disconnect(),delete a.visibleObservable,Wi.renderCB(B,a),(x=a.grid)==null||x.prepareDragDrop(a.el))}),window.setTimeout(()=>{var J;return(J=a.visibleObservable)==null?void 0:J.observe(g)})):Wi.renderCB(B,a),g}makeSubGrid(a,g,B,J=!0){var C,x,e;let v=a.gridstackNode;if(v||(v=this.makeWidget(a).gridstackNode),(C=v.subGrid)!=null&&C.el)return v.subGrid;let u,t=this;for(;t&&!u;)u=(x=t.opts)==null?void 0:x.subGridOpts,t=(e=t.parentGridNode)==null?void 0:e.grid;g=zn.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...u||{},...g||v.subGridOpts||{}}),v.subGridOpts=g;let w;g.column==="auto"&&(w=!0,g.column=Math.max(v.w||1,(B==null?void 0:B.w)||1),delete g.columnOpts);let y=v.el.querySelector(".grid-stack-item-content"),b,h;if(J&&(this._removeDD(v.el),h={...v,x:0,y:0},zn.removeInternalForSave(h),delete h.subGridOpts,v.content&&(h.content=v.content,delete v.content),Wi.addRemoveCB?b=Wi.addRemoveCB(this.el,h,!0,!1):(b=zn.createDiv(["grid-stack-item"]),b.appendChild(y),y=zn.createDiv(["grid-stack-item-content"],v.el)),this.prepareDragDrop(v.el)),B){const i=w?g.column:v.w,d=v.h+B.h,s=v.el.style;s.transition="none",this.update(v.el,{w:i,h:d}),setTimeout(()=>s.transition=null)}const n=v.subGrid=Wi.addGrid(y,g);return B!=null&&B._moving&&(n._isTemp=!0),w&&(n._autoColumn=!0),J&&n.makeWidget(b,h),B&&(B._moving?window.setTimeout(()=>zn.simulateMouseEvent(B._event,"mouseenter",n.el),0):n.makeWidget(v.el,v)),this.resizeToContentCheck(!1,v),n}removeAsSubGrid(a){var g;const B=(g=this.parentGridNode)==null?void 0:g.grid;B&&(B.batchUpdate(),B.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(J=>{J.x+=this.parentGridNode.x,J.y+=this.parentGridNode.y,B.makeWidget(J.el,J)}),B.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,a&&window.setTimeout(()=>zn.simulateMouseEvent(a._event,"mouseenter",B.el),0))}save(a=!0,g=!1,B=Wi.saveCB,J){const C=this.engine.save(a,B,J);if(C.forEach(x=>{var e;if(a&&x.el&&!x.subGrid&&!B){const v=x.el.querySelector(".grid-stack-item-content");x.content=v==null?void 0:v.innerHTML,x.content||delete x.content}else if(!a&&!B&&delete x.content,(e=x.subGrid)!=null&&e.el){const v=x.w||x.subGrid.getColumn(),u=x.subGrid.save(a,g,B,v);x.subGridOpts=g?u:{children:u},delete x.subGrid}delete x.el}),g){const x=zn.cloneDeep(this.opts);x.marginBottom===x.marginTop&&x.marginRight===x.marginLeft&&x.marginTop===x.marginRight&&(x.margin=x.marginTop,delete x.marginTop,delete x.marginRight,delete x.marginBottom,delete x.marginLeft),x.rtl===(this.el.style.direction==="rtl")&&(x.rtl="auto"),this._isAutoCellHeight&&(x.cellHeight="auto"),this._autoColumn&&(x.column="auto");const e=x._alwaysShowResizeHandle;return delete x._alwaysShowResizeHandle,e!==void 0?x.alwaysShowResizeHandle=e:delete x.alwaysShowResizeHandle,zn.removeInternalAndSame(x,Cu),x.children=C,x}return C}load(a,g=Wi.addRemoveCB||!0){a=zn.cloneDeep(a);const B=this.getColumn();a.forEach(t=>{t.w=t.w||t.minW||1,t.h=t.h||t.minH||1}),a=zn.sort(a),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let J=0;a.forEach(t=>{J=Math.max(J,(t.x||0)+t.w)}),J>this.engine.defaultColumn&&(this.engine.defaultColumn=J),J>B&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=a,this.engine.columnChanged(J,B,this.responseLayout),a=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(a,J,!0));const C=Wi.addRemoveCB;typeof g=="function"&&(Wi.addRemoveCB=g);const x=[];this.batchUpdate();const e=!this.engine.nodes.length,v=e&&this.opts.animate;v&&this.setAnimation(!1),!e&&g&&[...this.engine.nodes].forEach(t=>{t.id&&(zn.find(a,t.id)||(Wi.addRemoveCB&&Wi.addRemoveCB(this.el,t,!1,!1),x.push(t),this.removeWidget(t.el,!0,!1)))}),this.engine._loading=!0;const u=[];return this.engine.nodes=this.engine.nodes.filter(t=>zn.find(a,t.id)?(u.push(t),!1):!0),a.forEach(t=>{var w;const y=zn.find(u,t.id);if(y){if(zn.shouldSizeToContent(y)&&(t.h=y.h),this.engine.nodeBoundFix(t),(t.autoPosition||t.x===void 0||t.y===void 0)&&(t.w=t.w||y.w,t.h=t.h||y.h,this.engine.findEmptyPosition(t)),this.engine.nodes.push(y),zn.samePos(y,t)&&this.engine.nodes.length>1&&(this.moveNode(y,{...t,forceCollide:!0}),zn.copyPos(t,y)),this.update(y.el,t),(w=t.subGridOpts)!=null&&w.children){const b=y.el.querySelector(".grid-stack");b&&b.gridstack&&b.gridstack.load(t.subGridOpts.children)}}else g&&this.addWidget(t)}),delete this.engine._loading,this.engine.removedNodes=x,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,C?Wi.addRemoveCB=C:delete Wi.addRemoveCB,v&&this.setAnimation(!0,!0),this}batchUpdate(a=!0){return this.engine.batchUpdate(a),a||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(a=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!a||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const g=this.el.querySelector("."+this.opts.itemClass);if(g){const J=zn.toNumber(g.getAttribute("gs-h"))||1;return Math.round(g.offsetHeight/J)}const B=parseInt(this.el.getAttribute("gs-current-row"));return B?Math.round(this.el.getBoundingClientRect().height/B):this.opts.cellHeight}cellHeight(a){if(a!==void 0&&this._isAutoCellHeight!==(a==="auto")&&(this._isAutoCellHeight=a==="auto",this._updateResizeEvent()),(a==="initial"||a==="auto")&&(a=void 0),a===void 0){const B=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;a=this.cellWidth()+B}const g=zn.parseHeight(a);return this.opts.cellHeightUnit===g.unit&&this.opts.cellHeight===g.h?this:(this.opts.cellHeightUnit=g.unit,this.opts.cellHeight=g.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(a=!1){var g;return a&&(g=this.opts.columnOpts)!=null&&g.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var a,g;const B=this.opts.columnOpts;if(!B||!B.columnWidth&&!((a=B.breakpoints)!=null&&a.length))return!1;const J=this.getColumn();let C=J;const x=this._widthOrContainer(!0);if(B.columnWidth)C=Math.min(Math.round(x/B.columnWidth)||1,B.columnMax);else{C=B.columnMax;let e=0;for(;e<B.breakpoints.length&&x<=B.breakpoints[e].w;)C=B.breakpoints[e++].c||J}if(C!==J){const e=(g=B.breakpoints)==null?void 0:g.find(v=>v.c===C);return this.column(C,(e==null?void 0:e.layout)||B.layout),!0}return!1}compact(a="compact",g=!0){return this.engine.compact(a,g),this._triggerChangeEvent(),this}column(a,g="moveScale"){if(!a||a<1||this.opts.column===a)return this;const B=this.getColumn();return this.opts.column=a,this.engine?(this.engine.column=a,this.el.classList.remove("gs-"+B),this._updateColumnVar(),this.engine.columnChanged(B,a,g),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=g,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(a=>a.matches("."+this.opts.itemClass)&&!a.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(a=!0){var g;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),a?this.el.parentNode.removeChild(this.el):(this.removeAll(a),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(g=this._placeholder)==null||delete g.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(a){return this.opts.float!==a&&(this.opts.float=this.engine.float=a,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(a,g=!1){const B=this.el.getBoundingClientRect();let J;g?J={top:B.top+document.documentElement.scrollTop,left:B.left}:J={top:this.el.offsetTop,left:this.el.offsetLeft};const C=a.left-J.left,x=a.top-J.top,e=B.width/this.getColumn(),v=B.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(C/e),y:Math.floor(x/v)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(a,g,B,J){return this.engine.isAreaEmpty(a,g,B,J)}makeWidget(a,g){const B=Wi.getElement(a);if(!B||B.gridstackNode)return B;B.parentElement||this.el.appendChild(B),this._prepareElement(B,!0,g);const J=B.gridstackNode;this._updateContainerHeight(),J.subGridOpts&&this.makeSubGrid(B,J.subGridOpts,void 0,!1);let C;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(C=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),C&&delete this._ignoreLayoutsNodeChange,B}on(a,g){return a.indexOf(" ")!==-1?(a.split(" ").forEach(B=>this.on(B,g)),this):(a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable"?(a==="enable"||a==="disable"?this._gsEventHandler[a]=B=>g(B):this._gsEventHandler[a]=B=>{B.detail&&g(B,B.detail)},this.el.addEventListener(a,this._gsEventHandler[a])):a==="drag"||a==="dragstart"||a==="dragstop"||a==="resizestart"||a==="resize"||a==="resizestop"||a==="dropped"||a==="resizecontent"?this._gsEventHandler[a]=g:console.error("GridStack.on("+a+") event not supported"),this)}off(a){return a.indexOf(" ")!==-1?(a.split(" ").forEach(g=>this.off(g)),this):((a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable")&&this._gsEventHandler[a]&&this.el.removeEventListener(a,this._gsEventHandler[a]),delete this._gsEventHandler[a],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(a=>this.off(a)),this}removeWidget(a,g=!0,B=!0){return a?(Wi.getElements(a).forEach(J=>{if(J.parentElement&&J.parentElement!==this.el)return;let C=J.gridstackNode;C||(C=this.engine.nodes.find(x=>J===x.el)),C&&(g&&Wi.addRemoveCB&&Wi.addRemoveCB(this.el,C,!1,!1),delete J.gridstackNode,this._removeDD(J),this.engine.removeNode(C,g,B),g&&J.parentElement&&J.remove())}),B&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(a=!0,g=!0){return this.engine.nodes.forEach(B=>{a&&Wi.addRemoveCB&&Wi.addRemoveCB(this.el,B,!1,!1),delete B.el.gridstackNode,this.opts.staticGrid||this._removeDD(B.el)}),this.engine.removeAll(a,g),g&&this._triggerRemoveEvent(),this}setAnimation(a=this.opts.animate,g){return g?setTimeout(()=>{this.opts&&this.setAnimation(a)}):a?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=a,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(a,g=!0,B=!0){return!!this.opts.staticGrid===a?this:(a?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(J=>{this.prepareDragDrop(J.el),J.subGrid&&B&&J.subGrid.setStatic(a,g,B)}),g&&this._setStaticClass(),this)}updateOptions(a){var g;const B=this.opts;return a===B?this:(a.acceptWidgets!==void 0&&(B.acceptWidgets=a.acceptWidgets,this._setupAcceptWidget()),a.animate!==void 0&&this.setAnimation(a.animate),a.cellHeight&&this.cellHeight(a.cellHeight),a.class!==void 0&&a.class!==B.class&&(B.class&&this.el.classList.remove(B.class),a.class&&this.el.classList.add(a.class)),a.columnOpts?(this.opts.columnOpts=a.columnOpts,this.checkDynamicColumn()):a.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof a.column=="number"&&this.column(a.column),a.margin!==void 0&&this.margin(a.margin),a.staticGrid!==void 0&&this.setStatic(a.staticGrid),a.disableDrag!==void 0&&!a.staticGrid&&this.enableMove(!a.disableDrag),a.disableResize!==void 0&&!a.staticGrid&&this.enableResize(!a.disableResize),a.float!==void 0&&this.float(a.float),a.row!==void 0?(B.minRow=B.maxRow=B.row=a.row,this._updateContainerHeight()):(a.minRow!==void 0&&(B.minRow=a.minRow,this._updateContainerHeight()),a.maxRow!==void 0&&(B.maxRow=a.maxRow)),(g=a.children)!=null&&g.length&&this.load(a.children),this)}update(a,g){return Wi.getElements(a).forEach(B=>{var J;const C=B==null?void 0:B.gridstackNode;if(!C)return;const x={...zn.copyPos({},C),...zn.cloneDeep(g)};this.engine.nodeBoundFix(x),delete x.autoPosition;const e=["x","y","w","h"];let v;if(e.some(w=>x[w]!==void 0&&x[w]!==C[w])&&(v={},e.forEach(w=>{v[w]=x[w]!==void 0?x[w]:C[w],delete x[w]})),!v&&(x.minW||x.minH||x.maxW||x.maxH)&&(v={}),x.content!==void 0){const w=B.querySelector(".grid-stack-item-content");w&&w.textContent!==x.content&&(C.content=x.content,Wi.renderCB(w,x),(J=C.subGrid)!=null&&J.el&&(w.appendChild(C.subGrid.el),C.subGrid._updateContainerHeight())),delete x.content}let u=!1,t=!1;for(const w in x)w[0]!=="_"&&C[w]!==x[w]&&(C[w]=x[w],u=!0,t=t||!this.opts.staticGrid&&(w==="noResize"||w==="noMove"||w==="locked"));if(zn.sanitizeMinMax(C),v){const w=v.w!==void 0&&v.w!==C.w;this.moveNode(C,v),w&&C.subGrid?C.subGrid.onResize(this.hasAnimationCSS()?C.w:void 0):this.resizeToContentCheck(w,C),delete C._orig}(v||u)&&this._writeAttr(B,C),t&&this.prepareDragDrop(C.el),Wi.updateCB&&Wi.updateCB(C)}),this}moveNode(a,g){const B=a._updating;B||this.engine.cleanNodes().beginUpdate(a),this.engine.moveNode(a,g),this._updateContainerHeight(),B||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(a){var g,B;if(!a||(a.classList.remove("size-to-content-max"),!a.clientHeight))return;const J=a.gridstackNode;if(!J)return;const C=J.grid;if(!C||a.parentElement!==C.el)return;const x=C.getCellHeight(!0);if(!x)return;let e=J.h?J.h*x:a.clientHeight,v;if(J.resizeToContentParent&&(v=a.querySelector(J.resizeToContentParent)),v||(v=a.querySelector(Wi.resizeToContentParent)),!v)return;const u=a.clientHeight-v.clientHeight,t=J.h?J.h*x-u:v.clientHeight;let w;if(J.subGrid){w=J.subGrid.getRow()*J.subGrid.getCellHeight(!0);const h=J.subGrid.el.getBoundingClientRect(),n=a.getBoundingClientRect();w+=h.top-n.top}else{if((B=(g=J.subGridOpts)==null?void 0:g.children)!=null&&B.length)return;{const h=v.firstElementChild;if(!h){console.error(`Error: GridStack.resizeToContent() widget id:${J.id} '${Wi.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}w=h.getBoundingClientRect().height||t}}if(t===w)return;e+=w-t;let y=Math.ceil(e/x);const b=Number.isInteger(J.sizeToContent)?J.sizeToContent:0;b&&y>b&&(y=b,a.classList.add("size-to-content-max")),J.minH&&y<J.minH?y=J.minH:J.maxH&&y>J.maxH&&(y=J.maxH),y!==J.h&&(C._ignoreLayoutsNodeChange=!0,C.moveNode(J,{h:y}),delete C._ignoreLayoutsNodeChange)}resizeToContentCBCheck(a){Wi.resizeToContentCB?Wi.resizeToContentCB(a):this.resizeToContent(a)}rotate(a,g){return Wi.getElements(a).forEach(B=>{const J=B.gridstackNode;if(!zn.canBeRotated(J))return;const C={w:J.h,h:J.w,minH:J.minW,minW:J.minH,maxH:J.maxW,maxW:J.maxH};if(g){const e=g.left>0?Math.floor(g.left/this.cellWidth()):0,v=g.top>0?Math.floor(g.top/this.opts.cellHeight):0;C.x=J.x+e-(J.h-(v+1)),C.y=J.y+v-e}Object.keys(C).forEach(e=>{C[e]===void 0&&delete C[e]});const x=J._orig;this.update(B,C),J._orig=x}),this}margin(a){if(!(typeof a=="string"&&a.split(" ").length>1)){const g=zn.parseHeight(a);if(this.opts.marginUnit===g.unit&&this.opts.margin===g.h)return}return this.opts.margin=a,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(a){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");const g=arguments;let B=0,J={x:g[B++],y:g[B++],w:g[B++],h:g[B++],autoPosition:g[B++]};return this.willItFit(J)}return this.engine.willItFit(a)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const a=this.engine.getDirtyNodes(!0);return a&&a.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(a),this._triggerEvent("change",a)),this.engine.saveInitial(),this}_triggerAddEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.addedNodes)!=null&&a.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(B=>{delete B._dirty});const g=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",g)}return this}_triggerRemoveEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.removedNodes)!=null&&a.length){const g=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",g)}return this}_triggerEvent(a,g){const B=g?new CustomEvent(a,{bubbles:!1,detail:g}):new Event(a);let J=this;for(;J.parentGridNode;)J=J.parentGridNode.grid;return J.el.dispatchEvent(B),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const a=this.parentGridNode;let g=this.getRow()+this._extraDragRow;const B=this.opts.cellHeight,J=this.opts.cellHeightUnit;if(!B)return this;if(!a&&!this.opts.minRow){const C=zn.parseHeight(getComputedStyle(this.el).minHeight);if(C.h>0&&C.unit===J){const x=Math.floor(C.h/B);g<x&&(g=x)}}return this.el.setAttribute("gs-current-row",String(g)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),g&&(this.el.style[a?"minHeight":"height"]=g*B+J),a&&zn.shouldSizeToContent(a)&&a.grid.resizeToContentCBCheck(a.el),this}_prepareElement(a,g=!1,B){B=B||this._readAttr(a),a.gridstackNode=B,B.el=a,B.grid=this,B=this.engine.addNode(B,g),this._writeAttr(a,B),a.classList.add(Cu.itemClass,this.opts.itemClass);const J=zn.shouldSizeToContent(B);return J?a.classList.add("size-to-content"):a.classList.remove("size-to-content"),J&&this.resizeToContentCheck(!1,B),zn.lazyLoad(B)||this.prepareDragDrop(B.el),this}_writePosAttr(a,g){return(!g._moving&&!g._resizing||this._placeholder===a)&&(a.style.top=g.y?g.y===1?"var(--gs-cell-height)":`calc(${g.y} * var(--gs-cell-height))`:null,a.style.left=g.x?g.x===1?"var(--gs-column-width)":`calc(${g.x} * var(--gs-column-width))`:null,a.style.width=g.w>1?`calc(${g.w} * var(--gs-column-width))`:null,a.style.height=g.h>1?`calc(${g.h} * var(--gs-cell-height))`:null),g.x>0?a.setAttribute("gs-x",String(g.x)):a.removeAttribute("gs-x"),g.y>0?a.setAttribute("gs-y",String(g.y)):a.removeAttribute("gs-y"),g.w>1?a.setAttribute("gs-w",String(g.w)):a.removeAttribute("gs-w"),g.h>1?a.setAttribute("gs-h",String(g.h)):a.removeAttribute("gs-h"),this}_writeAttr(a,g){if(!g)return this;this._writePosAttr(a,g);const B={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const J in B)g[J]?a.setAttribute(B[J],String(g[J])):a.removeAttribute(B[J]);return this}_readAttr(a,g=!0){const B={};B.x=zn.toNumber(a.getAttribute("gs-x")),B.y=zn.toNumber(a.getAttribute("gs-y")),B.w=zn.toNumber(a.getAttribute("gs-w")),B.h=zn.toNumber(a.getAttribute("gs-h")),B.autoPosition=zn.toBool(a.getAttribute("gs-auto-position")),B.noResize=zn.toBool(a.getAttribute("gs-no-resize")),B.noMove=zn.toBool(a.getAttribute("gs-no-move")),B.locked=zn.toBool(a.getAttribute("gs-locked"));const J=a.getAttribute("gs-size-to-content");J&&(J==="true"||J==="false"?B.sizeToContent=zn.toBool(J):B.sizeToContent=parseInt(J,10)),B.id=a.getAttribute("gs-id"),B.maxW=zn.toNumber(a.getAttribute("gs-max-w")),B.minW=zn.toNumber(a.getAttribute("gs-min-w")),B.maxH=zn.toNumber(a.getAttribute("gs-max-h")),B.minH=zn.toNumber(a.getAttribute("gs-min-h")),g&&(B.w===1&&a.removeAttribute("gs-w"),B.h===1&&a.removeAttribute("gs-h"),B.maxW&&a.removeAttribute("gs-max-w"),B.minW&&a.removeAttribute("gs-min-w"),B.maxH&&a.removeAttribute("gs-max-h"),B.minH&&a.removeAttribute("gs-min-h"));for(const C in B){if(!B.hasOwnProperty(C))return;!B[C]&&B[C]!==0&&C!=="sizeToContent"&&delete B[C]}return B}_setStaticClass(){const a=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...a),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...a),this.el.removeAttribute("gs-static")),this}onResize(a=(g=>(g=this.el)==null?void 0:g.clientWidth)()){if(!a||this.prevWidth===a)return;this.prevWidth=a,this.batchUpdate();let g=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),g=!0):g=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(B=>{B.subGrid&&B.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(g),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(a=!1,g=void 0){if(this.engine){if(a&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,g),this.animationDelay);if(g)zn.shouldSizeToContent(g)&&this.resizeToContentCBCheck(g.el);else if(this.engine.nodes.some(B=>zn.shouldSizeToContent(B))){const B=[...this.engine.nodes];this.batchUpdate(),B.forEach(J=>{zn.shouldSizeToContent(J)&&this.resizeToContentCBCheck(J.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,g?[g]:this.engine.nodes)}}_updateResizeEvent(a=!1){const g=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(B=>B.sizeToContent));return!a&&g&&!this.resizeObserver?(this._sizeThrottle=zn.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(a||!g)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(a=".grid-stack-item"){return zn.getElement(a)}static getElements(a=".grid-stack-item"){return zn.getElements(a)}static getGridElement(a){return Wi.getElement(a)}static getGridElements(a){return zn.getElements(a)}_initMargin(){let a,g=0,B=[];typeof this.opts.margin=="string"&&(B=this.opts.margin.split(" ")),B.length===2?(this.opts.marginTop=this.opts.marginBottom=B[0],this.opts.marginLeft=this.opts.marginRight=B[1]):B.length===4?(this.opts.marginTop=B[0],this.opts.marginRight=B[1],this.opts.marginBottom=B[2],this.opts.marginLeft=B[3]):(a=zn.parseHeight(this.opts.margin),this.opts.marginUnit=a.unit,g=this.opts.margin=a.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(C=>{this.opts[C]===void 0?this.opts[C]=g:(a=zn.parseHeight(this.opts[C]),this.opts[C]=a.h,delete this.opts.margin)}),this.opts.marginUnit=a.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const J=this.el.style;return J.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),J.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),J.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),J.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return Uc}static setupDragIn(a,g,B,J=document){(g==null?void 0:g.pause)!==void 0&&(Ki.pauseDrag=g.pause),g={appendTo:"body",helper:"clone",...g||{}},(typeof a=="string"?zn.getElements(a,J):a).forEach((C,x)=>{Uc.isDraggable(C)||Uc.dragIn(C,g),B!=null&&B[x]&&(C.gridstackNode=B[x])})}movable(a,g){return this.opts.staticGrid?this:(Wi.getElements(a).forEach(B=>{const J=B.gridstackNode;J&&(g?delete J.noMove:J.noMove=!0,this.prepareDragDrop(J.el))}),this)}resizable(a,g){return this.opts.staticGrid?this:(Wi.getElements(a).forEach(B=>{const J=B.gridstackNode;J&&(g?delete J.noResize:J.noResize=!0,this.prepareDragDrop(J.el))}),this)}disable(a=!0){if(!this.opts.staticGrid)return this.enableMove(!1,a),this.enableResize(!1,a),this._triggerEvent("disable"),this}enable(a=!0){if(!this.opts.staticGrid)return this.enableMove(!0,a),this.enableResize(!0,a),this._triggerEvent("enable"),this}enableMove(a,g=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(B=>{this.prepareDragDrop(B.el),B.subGrid&&g&&B.subGrid.enableMove(a,g)}),this)}enableResize(a,g=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(B=>{this.prepareDragDrop(B.el),B.subGrid&&g&&B.subGrid.enableResize(a,g)}),this)}cancelDrag(){var a;const g=(a=this._placeholder)==null?void 0:a.gridstackNode;g&&(g._isExternal?(g._isAboutToRemove=!0,this.engine.removeNode(g)):g._isAboutToRemove&&Wi._itemRemoving(g.el,!1),this.engine.restoreInitial())}_removeDD(a){return Uc.draggable(a,"destroy").resizable(a,"destroy"),a.gridstackNode&&delete a.gridstackNode._initDD,delete a.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return Uc.droppable(this.el,"destroy"),this;let a,g;const B=(J,C,x)=>{var e;x=x||C;const v=x.gridstackNode;if(!v)return;if(!((e=v.grid)!=null&&e.el)){x.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const b=x.getBoundingClientRect();x.style.left=b.x+(this.dragTransform.xScale-1)*(J.clientX-b.x)/this.dragTransform.xScale+"px",x.style.top=b.y+(this.dragTransform.yScale-1)*(J.clientY-b.y)/this.dragTransform.yScale+"px",x.style.transformOrigin="0px 0px"}let{top:u,left:t}=x.getBoundingClientRect();const w=this.el.getBoundingClientRect();t-=w.left,u-=w.top;const y={position:{top:u*this.dragTransform.xScale,left:t*this.dragTransform.yScale}};if(v._temporaryRemoved){if(v.x=Math.max(0,Math.round(t/g)),v.y=Math.max(0,Math.round(u/a)),delete v.autoPosition,this.engine.nodeBoundFix(v),!this.engine.willItFit(v)){if(v.autoPosition=!0,!this.engine.willItFit(v)){Uc.off(C,"drag");return}v._willFitPos&&(zn.copyPos(v,v._willFitPos),delete v._willFitPos)}this._onStartMoving(x,J,y,v,g,a)}else this._dragOrResize(x,J,y,v,g,a)};return Uc.droppable(this.el,{accept:J=>{const C=J.gridstackNode||this._readAttr(J,!1);if((C==null?void 0:C.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let x=!0;if(typeof this.opts.acceptWidgets=="function")x=this.opts.acceptWidgets(J);else{const e=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;x=J.matches(e)}if(x&&C&&this.opts.maxRow){const e={w:C.w,h:C.h,minW:C.minW,minH:C.minH};x=this.engine.willItFit(e)}return x}}).on(this.el,"dropover",(J,C,x)=>{let e=(x==null?void 0:x.gridstackNode)||C.gridstackNode;if((e==null?void 0:e.grid)===this&&!e._temporaryRemoved)return!1;if(e!=null&&e._sidebarOrig&&(e.w=e._sidebarOrig.w,e.h=e._sidebarOrig.h),e!=null&&e.grid&&e.grid!==this&&!e._temporaryRemoved&&e.grid._leave(C,x),x=x||C,g=this.cellWidth(),a=this.getCellHeight(!0),!e){const t=x.getAttribute("data-gs-widget")||x.getAttribute("gridstacknode");if(t){try{e=JSON.parse(t)}catch{console.error("Gridstack dropover: Bad JSON format: ",t)}x.removeAttribute("data-gs-widget"),x.removeAttribute("gridstacknode")}e||(e=this._readAttr(x)),e._sidebarOrig={w:e.w,h:e.h}}e.grid||(e.el||(e={...e}),e._isExternal=!0,x.gridstackNode=e);const v=e.w||Math.round(x.offsetWidth/g)||1,u=e.h||Math.round(x.offsetHeight/a)||1;return e.grid&&e.grid!==this?(C._gridstackNodeOrig||(C._gridstackNodeOrig=e),C.gridstackNode=e={...e,w:v,h:u,grid:this},delete e.x,delete e.y,this.engine.cleanupNode(e).nodeBoundFix(e),e._initDD=e._isExternal=e._temporaryRemoved=!0):(e.w=v,e.h=u,e._temporaryRemoved=!0),Wi._itemRemoving(e.el,!1),Uc.on(C,"drag",B),B(J,C,x),!1}).on(this.el,"dropout",(J,C,x)=>{const e=(x==null?void 0:x.gridstackNode)||C.gridstackNode;return e&&(!e.grid||e.grid===this)&&(this._leave(C,x),this._isTemp&&this.removeAsSubGrid(e)),!1}).on(this.el,"drop",(J,C,x)=>{var e,v,u;const t=(x==null?void 0:x.gridstackNode)||C.gridstackNode;if((t==null?void 0:t.grid)===this&&!t._isExternal)return!1;const w=!!this.placeholder.parentElement,y=C!==x;this.placeholder.remove(),delete this.placeholder.gridstackNode,w&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const b=C._gridstackNodeOrig;if(delete C._gridstackNodeOrig,w&&b!=null&&b.grid&&b.grid!==this){const n=b.grid;n.engine.removeNodeFromLayoutCache(b),n.engine.removedNodes.push(b),n._triggerRemoveEvent()._triggerChangeEvent(),n.parentGridNode&&!n.engine.nodes.length&&n.opts.subGridDynamic&&n.removeAsSubGrid()}if(!t||(w&&(this.engine.cleanupNode(t),t.grid=this),(e=t.grid)==null||delete e._isTemp,Uc.off(C,"drag"),x!==C?(x.remove(),C=x):C.remove(),this._removeDD(C),!w))return!1;const h=(u=(v=t.subGrid)==null?void 0:v.el)==null?void 0:u.gridstack;return zn.copyPos(t,this._readAttr(this.placeholder)),zn.removePositioningStyles(C),y&&(t.content||t.subGridOpts||Wi.addRemoveCB)?(delete t.el,C=this.addWidget(t)):(this._prepareElement(C,!0,t),this.el.appendChild(C),this.resizeToContentCheck(!1,t),h&&(h.parentGridNode=t),this._updateContainerHeight()),this.engine.addedNodes.push(t),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...J,type:"dropped"},b&&b.grid?b:void 0,t),!1}),this}static _itemRemoving(a,g){if(!a)return;const B=a?a.gridstackNode:void 0;!(B!=null&&B.grid)||a.classList.contains(B.grid.opts.removableOptions.decline)||(g?B._isAboutToRemove=!0:delete B._isAboutToRemove,g?a.classList.add("grid-stack-item-removing"):a.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const a=document.querySelector(this.opts.removable);return a?(!this.opts.staticGrid&&!Uc.isDroppable(a)&&Uc.droppable(a,this.opts.removableOptions).on(a,"dropover",(g,B)=>Wi._itemRemoving(B,!0)).on(a,"dropout",(g,B)=>Wi._itemRemoving(B,!1)),this):this}prepareDragDrop(a,g=!1){const B=a==null?void 0:a.gridstackNode;if(!B)return;const J=B.noMove||this.opts.disableDrag,C=B.noResize||this.opts.disableResize,x=this.opts.staticGrid||J&&C;if((g||x)&&(B._initDD&&(this._removeDD(a),delete B._initDD),x&&a.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!g))return this;if(!B._initDD){let e,v;const u=(y,b)=>{this.triggerEvent(y,y.target),e=this.cellWidth(),v=this.getCellHeight(!0),this._onStartMoving(a,y,b,B,e,v)},t=(y,b)=>{this._dragOrResize(a,y,b,B,e,v)},w=y=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete B._moving,delete B._resizing,delete B._event,delete B._lastTried;const b=B.w!==B._orig.w,h=y.target;if(!(!h.gridstackNode||h.gridstackNode.grid!==this)){if(B.el=h,B._isAboutToRemove){const n=a.gridstackNode.grid;n._gsEventHandler[y.type]&&n._gsEventHandler[y.type](y,h),n.engine.nodes.push(B),n.removeWidget(a,!0,!0)}else zn.removePositioningStyles(h),B._temporaryRemoved?(this._writePosAttr(h,B),this.engine.addNode(B)):this._writePosAttr(h,B),this.triggerEvent(y,h);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),y.type==="resizestop"&&(Number.isInteger(B.sizeToContent)&&(B.sizeToContent=B.h),this.resizeToContentCheck(b,B))}};Uc.draggable(a,{start:u,stop:w,drag:t}).resizable(a,{start:u,stop:w,resize:t}),B._initDD=!0}return Uc.draggable(a,J?"disable":"enable").resizable(a,C?"disable":"enable"),this}_onStartMoving(a,g,B,J,C,x){var e;if(this.engine.cleanNodes().beginUpdate(J),this._writePosAttr(this.placeholder,J),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=J,(e=J.grid)!=null&&e.el)this.dragTransform=zn.getValuesFromTransformedElement(a);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const v=this.placeholder.closest(".grid-stack");this.dragTransform=zn.getValuesFromTransformedElement(v)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(J.el=this.placeholder,J._lastUiPosition=B.position,J._prevYPix=B.position.top,J._moving=g.type==="dragstart",J._resizing=g.type==="resizestart",delete J._lastTried,g.type==="dropover"&&J._temporaryRemoved&&(this.engine.addNode(J),J._moving=!0),this.engine.cacheRects(C,x,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),g.type==="resizestart"){const v=this.getColumn()-J.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-J.y;Uc.resizable(a,"option","minWidth",C*Math.min(J.minW||1,v)).resizable(a,"option","minHeight",x*Math.min(J.minH||1,u)).resizable(a,"option","maxWidth",C*Math.min(J.maxW||Number.MAX_SAFE_INTEGER,v)).resizable(a,"option","maxWidthMoveLeft",C*Math.min(J.maxW||Number.MAX_SAFE_INTEGER,J.x+J.w)).resizable(a,"option","maxHeight",x*Math.min(J.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(a,"option","maxHeightMoveUp",x*Math.min(J.maxH||Number.MAX_SAFE_INTEGER,J.y+J.h))}}_dragOrResize(a,g,B,J,C,x){const e={...J._orig};let v,u=this.opts.marginLeft,t=this.opts.marginRight,w=this.opts.marginTop,y=this.opts.marginBottom;const b=Math.round(x*.1),h=Math.round(C*.1);if(u=Math.min(u,h),t=Math.min(t,h),w=Math.min(w,b),y=Math.min(y,b),g.type==="drag"){if(J._temporaryRemoved)return;const i=B.position.top-J._prevYPix;J._prevYPix=B.position.top,this.opts.draggable.scroll!==!1&&zn.updateScrollPosition(a,B.position,i);const d=B.position.left+(B.position.left>J._lastUiPosition.left?-t:u),s=B.position.top+(B.position.top>J._lastUiPosition.top?-y:w);e.x=Math.round(d/C),e.y=Math.round(s/x);const c=this._extraDragRow;if(this.engine.collide(J,e)){const f=this.getRow();let m=Math.max(0,e.y+J.h-f);this.opts.maxRow&&f+m>this.opts.maxRow&&(m=Math.max(0,this.opts.maxRow-f)),this._extraDragRow=m}else this._extraDragRow=0;if(this._extraDragRow!==c&&this._updateContainerHeight(),J.x===e.x&&J.y===e.y)return}else if(g.type==="resize"){if(e.x<0||(zn.updateScrollResize(g,a,x),e.w=Math.round((B.size.width-u)/C),e.h=Math.round((B.size.height-w)/x),J.w===e.w&&J.h===e.h)||J._lastTried&&J._lastTried.w===e.w&&J._lastTried.h===e.h)return;const i=B.position.left+u,d=B.position.top+w;e.x=Math.round(i/C),e.y=Math.round(d/x),v=!0}J._event=g,J._lastTried=e;const n={x:B.position.left+u,y:B.position.top+w,w:(B.size?B.size.width:J.w*C)-u-t,h:(B.size?B.size.height:J.h*x)-w-y};if(this.engine.moveNodeCheck(J,{...e,cellWidth:C,cellHeight:x,rect:n,resizing:v})){J._lastUiPosition=B.position,this.engine.cacheRects(C,x,w,t,y,u),delete J._skipDown,v&&J.subGrid&&J.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const i=g.target;J._sidebarOrig||this._writePosAttr(i,J),this.triggerEvent(g,i)}}triggerEvent(a,g){let B=this;for(;B.parentGridNode;)B=B.parentGridNode.grid;B._gsEventHandler[a.type]&&B._gsEventHandler[a.type](a,g)}_leave(a,g){g=g||a;const B=g.gridstackNode;if(!B||(g.style.transform=g.style.transformOrigin=null,Uc.off(a,"drag"),B._temporaryRemoved))return;B._temporaryRemoved=!0,this.engine.removeNode(B),B.el=B._isExternal&&g?g:a;const J=B._sidebarOrig;B._isExternal&&this.engine.cleanupNode(B),B._sidebarOrig=J,this.opts.removable===!0&&Wi._itemRemoving(a,!0),a._gridstackNodeOrig?(a.gridstackNode=a._gridstackNodeOrig,delete a._gridstackNodeOrig):B._isExternal&&this.engine.restoreInitial()}commit(){return Ose(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}Wi.renderCB=(r,a)=>{r&&a!=null&&a.content&&(r.textContent=a.content)},Wi.resizeToContentParent=".grid-stack-item-content",Wi.Utils=zn,Wi.Engine=Bd,Wi.GDRev="12.3.2";const zse=[{id:1,name:"Goles",isSelected:!1},{id:2,name:"Pases acertados",isSelected:!1},{id:23,name:"Tiros de Esquina",isSelected:!1},{id:3,name:"Balones recuperados en disputa",isSelected:!1},{id:4,name:"Asistencias",isSelected:!1},{id:5,name:"Participaciones en gol",isSelected:!1},{id:6,name:"Tiros a gol",isSelected:!1},{id:7,name:"Tiros a gol que llegaron a la portería",isSelected:!1},{id:8,name:"Cabeceos en área rival",isSelected:!1},{id:9,name:"Cabeceos en área propia",isSelected:!1},{id:10,name:"Centros",isSelected:!1},{id:11,name:"Centros acertados",isSelected:!1},{id:12,name:"1vs1 exitosos ofensivos",isSelected:!1},{id:13,name:"1vs1 exitosos ofensivos que terminaron en gol",isSelected:!1},{id:14,name:"1vs1 defensivos exitoso",isSelected:!1},{id:15,name:"Rechaces",isSelected:!1},{id:16,name:"Balones ganados en área propia",isSelected:!1},{id:17,name:"Balones ganados en área rival",isSelected:!1},{id:18,name:"Faltas cometidas",isSelected:!1},{id:19,name:"Faltas recibidas",isSelected:!1},{id:20,name:"Tarjetas amarillas",isSelected:!1},{id:21,name:"Tarjetas rojas",isSelected:!1},{id:22,name:"Atajadas",isSelected:!1},{id:24,name:"Oportunidades de gol",isSelected:!1},{id:25,name:"Balones recuperados en cancha rival",isSelected:!1}],Vd=r=>zse.find(a=>a.id===r),Fd=new Map([[9,{id:9,analysisTypes:new Map([["2-20",{analysisType:"successfulPasses",name:"Pases acertados",title:"Mapeo de pases acertados",titleShort:"Pases acertados"}],["3-21",{analysisType:"unsuccessfulPasses",name:"Pases no acertados",title:"Mapeo de pases no acertados",titleShort:"Pases no acertados"}],["222-223-224-225",{analysisType:"recoveredBalls",name:"Balones recuperados",title:"Mapeo de balones recuperados",titleShort:"Balones recuperados"}],["226-227-228-229",{analysisType:"lostBalls",name:"Balones perdidos",title:"Mapeo de balones perdidos",titleShort:"Balones perdidos"}]])}],[1,{general:"General",offensive:"Ofensivo",defensive:"Defensivo",possession:"Posesión",stoppedBall:"Balón parado",penalties:"Infracción"}]]);class Up{constructor(a,g=[],B,J=null,C=!1,x=!1,e=null,v=null){ud(this,"id",""),ud(this,"childViews",[]),ud(this,"viewId",0),ud(this,"dynamicFilters",null),ud(this,"componentSpecificFilters",new Map),ud(this,"isPostMatch",!1),ud(this,"isTemplateMode",!1),ud(this,"filtresJSON",null),ud(this,"token",null),ud(this,"_isUpdating",!1),this.id=a,this.viewId=B,this.childViews=g,this.dynamicFilters=J,this.isPostMatch=C,this.isTemplateMode=x,this.filtresJSON=e,this.token=v,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(a=>{a.view.filterAndViewsContainer=new Up(this.id,[a],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token)})}hasEventTypeId(a,g){return!a||!Array.isArray(a)?!1:a.some(B=>B&&B.event_type_id===g)}hasCategoryId(a,g){return!a||!Array.isArray(a)?!1:a.some(B=>B&&B.category_id===g)}getId(){return this.id}setViewId(a){this.viewId=a}setFiltersJSON(a){this.filtresJSON=a}setDynamicFilters(a,g=null){g?this.componentSpecificFilters.set(g,[...a]):this.dynamicFilters=a}getComponentDynamicFilters(a){return a&&this.componentSpecificFilters.has(a)?this.componentSpecificFilters.get(a):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){this.componentSpecificFilters.forEach((a,g)=>{console.log(` Component ${g}:`,a)})}static debugAllComponentFilters(){document.querySelectorAll("[data-container-id]").forEach(a=>{a.getAttribute("data-container-id")})}clearAllComponentFilters(){this.componentSpecificFilters.clear()}getDynamicFilters(){return this.dynamicFilters}getHomeTeamViews(){return this.childViews.filter(a=>a.view.isHomeTeam)}getAwayTeamViews(){return this.childViews.filter(a=>!a.view.isHomeTeam)}addView(a,g=!1){var B,J,C,x,e,v,u,t,w,y;if(a.view.filterAndViewsContainer=this,Ei.emit("component-added-to-container",this),this.viewId===5&&a.view.componentProps&&!g&&(a.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType===1}),this.viewId===10&&a.view.componentProps&&!g&&(a.view.componentProps.isHomeTeamForAnalysis=this.dynamicFilters[0]!==3?this.dynamicFilters[0]===1:1,a.isHomeTeam=a.view.componentProps.isHomeTeamForAnalysis,a.view.filterMultiple={isHomeTeam:a.view.componentProps.isHomeTeamForAnalysis},a.view.filtersJSON=this.filtresJSON),this.viewId===7&&a.view.componentProps&&!g){const b=this.getComponentDynamicFilters(a.view.id),h=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const n=h[0]===1?"offensive":"defensive",i=h[1]===1;a.view.componentProps.analysisType=n,a.view.componentProps.isHomeTeamForAnalysis=i,a.isHomeTeam=i,a.view.filterMultiple={isHomeTeam:i},Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:h})}if(this.viewId===1&&a.view.componentProps&&!g){const b=this.dynamicFilters[0]||[];if(b&&b.length>0){let h;if(Array.isArray(b)){const i=this.childViews.map(s=>{var c;return(c=s.view.componentProps)==null?void 0:c.type}).filter(s=>s!==void 0),d=b.filter(s=>!i.includes(s));d.length>0?h=d[0]:h=b[0]}else h=b;const n=Fd.get(this.viewId);a.view.componentProps.type=h,a.view.componentProps.default=!1,a.view.title=`Comparativa ${n[h]}`,a.view.filterMultiple={category:h}}}if(this.viewId===9&&a.view.componentProps&&!g){const b=this.dynamicFilters[0].map(d=>d.join("-"));let h="";const n=this.dynamicFilters[1],i=Fd.get(this.viewId);if(n===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(m=>{m.view.componentProps.isHomeTeamForAnalysis=!0,m.view.isHomeTeam=!0,m.view.filterMultiple&&(m.view.filterMultiple.isHomeTeam=!0)});let d=null;const s=this.getHomeTeamViews(),c=this.getAwayTeamViews();let f=!0;for(let m=0;m<b.length;m++){h=b[m],d=i.analysisTypes.get(b[m]);const T=s.find(S=>S.view.componentProps.analysisType===d.analysisType),E=c.find(S=>S.view.componentProps.analysisType===d.analysisType);if(!T||!E){f=!T;break}}f?this.childViews.length===0?(a.view.componentProps.analysisType=d.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.title=d.title,a.view.titleShort=d.titleShort,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:h.split("-").map(m=>parseInt(m))}):this.childViews.reduce((m,T,E,S)=>{let P={analysisType:T.view.componentProps.analysisType,title:T.view.title,isHomeTeamForAnalysis:T.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:T.view.isHomeTeam};return m&&(m.isHomeTeam&&!T.view.isHomeTeam?(T.view.componentProps.analysisType=d.analysisType,T.view.componentProps.isHomeTeamForAnalysis=!0,T.view.title=d.title,a.view.titleShort=d.titleShort,T.view.isHomeTeam=!0,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:h.split("-").map(N=>parseInt(N))}):!m.isHomeTeam&&!T.view.isHomeTeam&&(T.view.componentProps.analysisType=m.analysisType,T.view.componentProps.isHomeTeamForAnalysis=m.isHomeTeamForAnalysis,T.view.title=m.title,T.view.titleShort=m.titleShort,T.view.isHomeTeam=m.isHomeTeam,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:h.split("-").map(N=>parseInt(N))}),E===S.length-1&&(a.view.componentProps.analysisType=P.analysisType,a.view.componentProps.isHomeTeamForAnalysis=P.isHomeTeamForAnalysis,a.view.title=P.title,a.view.titleShort=P.titleShort,a.view.isHomeTeam=P.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:h.split("-").map(N=>parseInt(N))})),P},null):(a.view.componentProps.analysisType=d.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.title=d.title,a.view.titleShort=d.titleShort,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:h.split("-").map(m=>parseInt(m))})}else{const d=n===1,s=d?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=d,a.view.isHomeTeam=d;for(let c=0;c<b.length;c++){const f=i.analysisTypes.get(b[c]);if(!s.find(m=>m.view.componentProps.analysisType===f.analysisType)){a.view.componentProps.analysisType=f.analysisType,a.view.title=f.title,a.view.titleShort=f.titleShort,a.view.filterMultiple={categoryIds:b[c].split("-").map(m=>parseInt(m)),isHomeTeam:a.view.isHomeTeam};break}}}}if(this.viewId===2&&!g&&a.view.componentProps){const b=this.getComponentDynamicFilters(a.view.id),h=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&(this.setDynamicFilters(this.dynamicFilters,a.view.id),console.log(`GscTopPlayer - initialized specific filters for component ${a.view.id} with default filters:`,this.dynamicFilters)),a.view.componentProps.game&&(a.view.componentProps.gameid=a.view.componentProps.game.id,a.view.componentProps.season=a.view.componentProps.game.season_id,a.view.componentProps.teamView=h[1]===2?a.view.componentProps.game.awayTeam.team_id:h[1]===1?a.view.componentProps.game.homeTeam.team_id:0);const n=this.dynamicFilters[0]||[];let i=null;if(Array.isArray(n)){if(n.length>0){const c=this.childViews.map(m=>{var T;const E=(T=m.view.componentProps)==null?void 0:T.categoryView;return E&&E.length>0?E[0].id:null}).filter(m=>m!==null),f=n.filter(m=>!c.includes(m));console.log("GSCtops addView (array mode) - existingCategories:",c),console.log("GSCtops addView (array mode) - categoriesWithoutComponent:",f),f.length>0?i=f[0]:console.log("GSCtops addView (array mode) - all categories already have components")}}else{const c=n;c&&(this.childViews.find(f=>{var m;const T=(m=f.view.componentProps)==null?void 0:m.categoryView;return T&&T.length>0&&T[0].id===c})?console.log("GSCtops addView (single mode) - component already exists, skipping creation"):i=c)}let d=null;if(i)try{d=Vd(i)}catch(c){console.warn("Error getting category by ID:",c)}const s=h&&h.length>1?h[1]:1;a.view.filterMultiple={categoryId:i,teamType:s},a.view.componentProps.categoryView=d?[{id:i,name:d.name}]:i?[{id:i,name:`Category ${i}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&a.view.componentProps&&!g&&a.view.game&&(a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),a.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,a.view.componentProps.game=(B=a.view)==null?void 0:B.game,a.view.componentProps.teamSelected={teamId:(C=(J=a.view)==null?void 0:J.game)==null?void 0:C.home_team},a.view.componentProps.isDefault=!1,Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:this.dynamicFilters})),this.viewId===6&&a.view.componentProps&&!g){a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const b=this.getComponentDynamicFilters(a.view.id),h=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const n=h&&h.length>0?h[0]:[];if(console.log("gamesToShow",n),n&&n.length>0){let i=0;for(const d of n)if(!this.childViews.find(s=>s.view.componentProps.gameNumber===d)){i=d;break}i&&(console.log("2 ************************************************** newGameNumberToShow: entro",i),a.view.componentProps.gameNumber=i,a.view.filterMultiple={gameNumber:i})}console.log(" /////////---------------------------------------> ",a.view.filterMultiple),Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:h})}if(this.viewId===3&&a.view.componentProps&&!g&&a.view.game){a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const b=this.getComponentDynamicFilters(a.view.id),h=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const n=h&&h.length>0?h[0]:!1;a.view.componentProps.desplegable=n,a.view.componentProps.key=n,a.view.componentProps.game=(x=a.view)==null?void 0:x.game,a.view.componentProps.defaultShields=!1,Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:h})}if(this.viewId===4&&(console.log("TIMELINE TIMELINE - TIMELINE TIMELINE - TIMELINE TIMELINE - TIMELINE TIMELINE - TIMELINE TIMELINE - TIMELINE TIMELINE"),console.log("*********************** *********************** this.token *********************** *********************** ",this.token),a.view.componentProps&&!g&&a.view.game)){if(a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),this.isPostMatch){a.view.componentProps.key=!1,a.view.componentProps.isDefault=!1,a.view.componentProps.token=this.token,a.view.componentProps.gameId=(v=(e=a.view)==null?void 0:e.game)==null?void 0:v.game_id,a.view.componentProps.homeTeam=(t=(u=a.view)==null?void 0:u.game)==null?void 0:t.home_team,a.view.componentProps.awayTeam=(y=(w=a.view)==null?void 0:w.game)==null?void 0:y.visiting_team;const n=this.getComponentDynamicFilters(a.view.id),i=n||this.dynamicFilters;!n&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const d=i&&i.length>0?i[0]:[],s=this.hasEventTypeId(d,1),c=this.hasCategoryId(d,8),f=this.hasCategoryId(d,9),m=this.hasEventTypeId(d,3);console.log("Timeline - Events check:",{goals:s,yellowCards:c,redCards:f,substitutions:m,selectedEvents:d,componentId:a.view.id,usingSpecificFilters:!!n}),a.view.componentProps.goals=s,a.view.componentProps.yellowCards=c,a.view.componentProps.redCards=f,a.view.componentProps.substitutions=m}const b=this.getComponentDynamicFilters(a.view.id)||this.dynamicFilters,h=b&&b.length>0?b[0]:[];a.view.componentProps.selectedEvents=h,a.view.componentProps.key=h.length>0,Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:b})}this.childViews.push(a),Ei.emit("view-added"),console.log("this.childViews",this.childViews)}getHowManyViewsToAdd(a){if(this.viewId===5)return 1;if(this.viewId===6){const g=a[0];return g===2||g===3?g:1}if(this.viewId===4){const g=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0,B=this.childViews.length===0&&g;return console.log("Timeline getHowManyViewsToAdd:",{hasSelectedEvents:g,childViewsLength:this.childViews.length,shouldAdd:B,dynamicFilters:a}),g?1:0}if(this.viewId===9){const g=a[0],B=a[1];if(B===1||B===2){const J=B===1?this.getHomeTeamViews():this.getAwayTeamViews();return g.length-J.length}else return g*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const g=a[0]||[],B=a[1]||1;if(console.log("GSCtops getHowManyViewsToAdd - categoriesIdsSelected:",g),console.log("GSCtops getHowManyViewsToAdd - teamType:",B),console.log("GSCtops getHowManyViewsToAdd - childViews.length:",this.childViews.length),!g||g.length===0)return 0;if(Array.isArray(g)){const J=this.childViews.map(x=>{var e;const v=(e=x.view.componentProps)==null?void 0:e.categoryView;return v&&v.length>0?v[0].id:null}).filter(x=>x!==null),C=g.filter(x=>!J.includes(x));return console.log("GSCtops getHowManyViewsToAdd (array mode) - existingCategories:",J),console.log("GSCtops getHowManyViewsToAdd (array mode) - categoriesWithoutComponent:",C),C.length}else{const J=g,C=this.childViews.find(x=>{var e,v;const u=(e=x.view.componentProps)==null?void 0:e.categoryView,t=((v=x.view.filterMultiple)==null?void 0:v.teamType)||1;return u&&u.length>0&&u[0].id===J&&t===B});return console.log("GSCtops getHowManyViewsToAdd (edit mode) - categoryId:",J),console.log("GSCtops getHowManyViewsToAdd (edit mode) - teamType:",B),console.log("GSCtops getHowManyViewsToAdd (edit mode) - existingComponent:",C),C?0:1}}if(this.viewId===1){const g=a[0]||[];if(console.log("GSCComparativeReports getHowManyViewsToAdd - selectedAnalysisTypes:",g),console.log("GSCComparativeReports getHowManyViewsToAdd - childViews.length:",this.childViews.length),!g||g.length===0)return 0;if(Array.isArray(g)){const B=this.childViews.map(C=>{var x;return(x=C.view.componentProps)==null?void 0:x.type}).filter(C=>C!==void 0),J=g.filter(C=>!B.includes(C));return console.log("GSCComparativeReports getHowManyViewsToAdd (array mode) - existingTypes:",B),console.log("GSCComparativeReports getHowManyViewsToAdd (array mode) - typesWithoutComponent:",J),J.length}else{const B=g,J=this.childViews.find(C=>{var x;return((x=C.view.componentProps)==null?void 0:x.type)===B});return console.log("GSCComparativeReports getHowManyViewsToAdd (edit mode) - analysisType:",B),console.log("GSCComparativeReports getHowManyViewsToAdd (edit mode) - existingComponent:",J),J?0:1}}return 0}getRequiresAddView(a){if(console.log("getRequiresAddView",this.viewId,a),this.viewId===5)return console.log("this.childViews:",this.childViews),a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===10)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===7)return a[1]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===6){const g=a[0];return g?g.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const g=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0,B=this.childViews.length===0&&g;return console.log("Timeline getRequiresAddView:",{hasSelectedEvents:g,childViewsLength:this.childViews.length,shouldAdd:B,dynamicFilters:a}),B}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(a);if(this.viewId===1){const g=a[0]||[];if(console.log("GSCComparativeReports getRequiresAddView - selectedAnalysisTypes:",g),console.log("GSCComparativeReports getRequiresAddView - childViews.length:",this.childViews.length),!g||g.length===0)return!1;if(Array.isArray(g)){const B=this.childViews.map(x=>{var e;return(e=x.view.componentProps)==null?void 0:e.type}).filter(x=>x!==void 0),J=g.filter(x=>!B.includes(x));console.log("GSCComparativeReports getRequiresAddView (array mode) - existingTypes:",B),console.log("GSCComparativeReports getRequiresAddView (array mode) - typesWithoutComponent:",J);const C=J.length>0;return console.log("GSCComparativeReports getRequiresAddView (array mode) - shouldAdd:",C),C}else{const B=g,J=this.childViews.find(x=>{var e;return((e=x.view.componentProps)==null?void 0:e.type)===B});console.log("GSCComparativeReports getRequiresAddView (edit mode) - analysisType:",B),console.log("GSCComparativeReports getRequiresAddView (edit mode) - existingComponent:",J);const C=!J;return console.log("GSCComparativeReports getRequiresAddView (edit mode) - shouldAdd:",C),C}}if(this.viewId===2){const g=a[0]||[];if(console.log("2222222222222222222222222222222222222222222222222222222222"),console.log(""),Array.isArray(g)){if(g.length>0){const B=this.childViews.map(x=>{var e;const v=(e=x.view.componentProps)==null?void 0:e.categoryView;return v&&v.length>0?v[0].id:null}).filter(x=>x!==null),J=g.filter(x=>!B.includes(x));console.log("GSCtops getRequiresAddView (array mode) - existingCategories:",B),console.log("GSCtops getRequiresAddView (array mode) - categoriesWithoutComponent:",J);const C=J.length>0;return console.log("GSCtops getRequiresAddView (array mode) - shouldAdd:",C),C}return!1}else{const B=g,J=a[1]||1;if(B){const C=this.childViews.find(e=>{var v,u;const t=(v=e.view.componentProps)==null?void 0:v.categoryView,w=((u=e.view.filterMultiple)==null?void 0:u.teamType)||1;return t&&t.length>0&&t[0].id===B&&w===J});console.log("GSCtops getRequiresAddView (single mode) - categoryId:",B,"teamType:",J),console.log("GSCtops getRequiresAddView (single mode) - existingComponent:",C);const x=!C;return console.log("GSCtops getRequiresAddView (single mode) - shouldAdd:",x),x}return!1}}return this.viewId===8||this.viewId===3?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(a){console.log("*******************************************************"),console.log("dynamicFilters",a);const g=this.childViews.filter(v=>v.view.isHomeTeam),B=this.childViews.filter(v=>!v.view.isHomeTeam),J=a[0].length,C=a[1],x=J*(C===1||C===2?1:2),e=C===3?g.length+B.length:g.length||B.length;return x>e}getRequiresLessViews(a){if(this.viewId===5)return a[0]!==3&&this.childViews.length>1;if(this.viewId===6){const g=a[0];return g===2||g===3}return this.viewId,!1}updateSummary({dynamicFilters:a}){const g=this.childViews[0],B=document.querySelector(`[gs-id="${g.view.id}"]`),J=g.grid;if(g&&B&&J){const C=a[0],x=`min_column${C?"_2":""}`,e=`min_row${C?"_2":""}`,v=`max_column${C?"_2":""}`,u=`max_row${C?"_2":""}`,t=`colspan${C?"_2":""}`,w=`rowspan${C?"_2":""}`,y=g.view.coreView[t],b=g.view.coreView[w],h=g.view.coreView[x],n=g.view.coreView[e],i=g.view.coreView[v],d=g.view.coreView[u];g.view.w=y,g.view.h=b,g.view.maxWidth=i,g.view.maxHeight=d,g.view.minWidth=h,g.view.minHeight=n,B.setAttribute("gs-w",y),B.setAttribute("gs-h",b),B.setAttribute("gs-max-w",i),B.setAttribute("gs-max-h",d),B.setAttribute("gs-min-w",h),B.setAttribute("gs-min-h",n),console.log("childView.view",g.view),J.update(B,{h:b,w:y,"gs-max-h":d,"gs-max-w":i,"gs-min-h":n,"gs-min-w":h})}}updateDynamicFilters(a,g=null){if(this._isUpdating){console.log("Skipping updateDynamicFilters due to update in progress");return}this._isUpdating=!0,g?(this.componentSpecificFilters.set(g,[...a]),console.log(`Updated specific filters for component ${g}:`,a)):this.dynamicFilters=a,Ei.emit("component-added-to-container",this);try{if(this.viewId===5){const B=a[0]||1;if(B<3)if(this.childViews.length===1){const J=this.childViews[0];J.view.componentProps&&(J.view.componentProps.preMatchType=B,J.view.filterMultiple={isHomeTeam:J.view.componentProps.preMatchType===1})}else{const J=this.childViews.pop(),C=J.grid,x=J.page,e=document.querySelector(`[gs-id="${J.view.id}"]`);if(C&&e&&(C.removeWidget(e),x)){const u=x.items.findIndex(t=>t.id===J.view.id);u!==-1&&x.items.splice(u,1)}const v=this.childViews[0];v.view.componentProps&&(v.view.componentProps.preMatchType=B,v.view.filterMultiple={isHomeTeam:v.view.componentProps.preMatchType})}else this.childViews.forEach((J,C)=>{J.view.componentProps.preMatchType=C+1,J.view.filterMultiple={isHomeTeam:J.view.componentProps.preMatchType}})}if(this.viewId===10){const B=a[0]||1;if(B<3)if(this.childViews.length===1){const J=this.childViews[0];J.view.componentProps&&(J.view.componentProps.isHomeTeamForAnalysis=B===1,J.view.filterMultiple={isHomeTeam:J.view.componentProps.isHomeTeamForAnalysis})}else{const J=this.childViews.pop(),C=J.grid,x=J.page,e=document.querySelector(`[gs-id="${J.view.id}"]`);if(C&&e&&(C.removeWidget(e),x)){const u=x.items.findIndex(t=>t.id===J.view.id);u!==-1&&x.items.splice(u,1)}const v=this.childViews[0];v.view.componentProps&&(v.view.componentProps.isHomeTeamForAnalysis=B===1,v.view.filterMultiple={isHomeTeam:v.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((J,C)=>{J.view.componentProps.isHomeTeamForAnalysis=C%2===0,J.view.filterMultiple={isHomeTeam:J.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const B=a[1];if(B===3)this.childViews.forEach((J,C)=>{J.view.componentProps.isHomeTeamForAnalysis=C%2===0,J.view.isHomeTeam=C%2===0,J.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",J.view.filterMultiple={isHomeTeam:J.view.isHomeTeam}});else{const J=B===1;if(this.childViews.length>0){const C=this.childViews[0];C.view.componentProps.isHomeTeamForAnalysis=J,C.view.isHomeTeam=J,C.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",C.view.filterMultiple={isHomeTeam:J},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const B=a[0],J=a[1];if(console.log("---------------->>>> CANCHA DE ZONAS: ",B,J),J===3){if(this.childViews.length>B.length){const C=B.map(x=>{const e=x.join("-");return Fd.get(this.viewId).analysisTypes.get(e).analysisType});this.childViews.reduce((x,e)=>(C.includes(e.view.componentProps.analysisType)||x.push(e.view.componentProps.analysisType),x),[]).forEach(x=>{const e=this.childViews.findIndex(v=>v.view.componentProps.analysisType===x);if(e!==-1){const v=this.childViews[e];this.removeChildView(v)}})}}else{const C=J===1,x=this.getHomeTeamViews(),e=this.getAwayTeamViews();if(console.log("---------------->>>> CUANDO CANCHA DE ZONAS NO ELEJIO AMBOS: ",C),console.log("---------------->>>> homeTeamViews: ",x),console.log("---------------->>>> awayTeamViews: ",e),C&&x.length===0)console.log("---------------->>>> escenario 1: "),e.forEach(v=>{v.view.componentProps.isHomeTeamForAnalysis=C,v.view.isHomeTeam=C,v.view.filterMultiple={categoryIds:B[0],isHomeTeam:C}});else if(!C&&e.length===0)console.log("---------------->>>> escenario 2: "),console.log("homeTeamViews",x),x.forEach(v=>{v.view.componentProps.isHomeTeamForAnalysis=C,v.view.isHomeTeam=C,v.view.filterMultiple={categoryIds:B[0],isHomeTeam:C}});else if(x.length===e.length)console.log("---------------->>>> escenario 3: "),C||x.forEach(v=>{v.view.filterMultiple={categoryIds:B[0],isHomeTeam:C}}),(C?e:x).forEach(v=>{this.removeChildView(v)});else{console.log("---------------->>>> escenario 4: ");const v=C?this.getHomeTeamViews():this.getAwayTeamViews();if(v.length>B.length){console.log("---------------->>>> escenario 4: eliminando vistas excedentes");const u=B.map(t=>{const w=t.join("-");return Fd.get(this.viewId).analysisTypes.get(w).analysisType});v.forEach(t=>{u.includes(t.view.componentProps.analysisType)?t.view.filterMultiple={categoryIds:B[0],isHomeTeam:C}:this.removeChildView(t)})}else v.forEach(u=>{u.view.filterMultiple={categoryIds:B[0],isHomeTeam:C}})}}console.log("this.childViews al final de updateDynamicFilters:",this.childViews)}if(this.viewId===2){const B=a[0]||[];if(Array.isArray(B)){const J=this.childViews.map(C=>{var x,e;const v=(x=C.view.componentProps)==null?void 0:x.categoryView,u=((e=C.view.filterMultiple)==null?void 0:e.teamType)||1,t=v&&v.length>0?v[0].id:null;return t?{categoryId:t,teamType:u,viewId:C.view.id}:null}).filter(C=>C!==null);if(g){const C=this.childViews.find(x=>x.view.id===g);if(C){const x=a[1]||1,e=B[0];if(e){let v=null;try{v=Vd(e)}catch(u){console.warn("Error getting category by ID:",u)}C.view.filterMultiple={categoryId:e,teamType:x},C.view.componentProps.game&&(x===1?C.view.componentProps.teamView=C.view.componentProps.game.homeTeam.team_id:x===2?C.view.componentProps.teamView=C.view.componentProps.game.awayTeam.team_id:C.view.componentProps.teamView=0),C.view.componentProps.categoryView=v?[{id:e,name:v.name}]:[{id:e,name:`Category ${e}`}]}}}if(!g){const C=a[1]||1;this.childViews.forEach(x=>{var e;const v=(e=x.view.componentProps)==null?void 0:e.categoryView;if(v&&v.length>0){const u=v[0].id;B.includes(u)&&(x.view.filterMultiple={categoryId:u,teamType:C})}})}if(J.map(C=>C.categoryId).filter(C=>!B.includes(C)).forEach(C=>{this.childViews.filter(x=>{var e;const v=(e=x.view.componentProps)==null?void 0:e.categoryView;return v&&v.length>0&&v[0].id===C}).forEach(x=>{this.removeChildView(x),Ei.emit("component-removed",{viewId:x.view.id,categoryId:C})})}),g){const C=B[0];if(C){const x=this.childViews.find(e=>e.view.id===g);if(x){let e=null;try{e=Vd(C)}catch(u){console.warn("Error getting category by ID:",u)}const v=a[1]||1;x.view.filterMultiple={categoryId:C,teamType:v},x.view.componentProps.game&&(x.view.componentProps.teamView=v===2?x.view.componentProps.game.awayTeam.team_id:v===1?x.view.componentProps.game.homeTeam.team_id:0),x.view.componentProps.categoryView=e?[{id:C,name:e.name}]:[{id:C,name:`Category ${C}`}]}}}}else{const J=B;if(J&&g){const C=this.childViews.find(x=>x.view.id===g);if(C){let x=null;try{x=Vd(J)}catch(v){console.warn("Error getting category by ID:",v)}const e=a[1]||1;C.view.filterMultiple={categoryId:J,teamType:e},C.view.componentProps.game&&(C.view.componentProps.teamView=e===2?C.view.componentProps.game.awayTeam.team_id:e===1?C.view.componentProps.game.homeTeam.team_id:0),C.view.componentProps.categoryView=x?[{id:J,name:x.name}]:[{id:J,name:`Category ${J}`}]}}}}if(this.viewId===8){const B=a[0]||!1;this.childViews.forEach(J=>{J.view.componentProps&&(J.view.componentProps._isReactive||(J.view.componentProps=p.reactive(J.view.componentProps),J.view.componentProps._isReactive=!0),J.view.componentProps.areInactiveVisible=B,J.view.componentProps.key=B,Ei.emit("component-props-updated",{viewId:J.view.id,componentProps:J.view.componentProps,dynamicFilters:a}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:J.view.id,dynamicFilters:a}))})}if(this.viewId===1){const B=a[0]||[];if(console.log("GSCComparativeReports updateDynamicFilters - selectedAnalysisTypes:",B),console.log("GSCComparativeReports updateDynamicFilters - componentId:",g),g){console.log(`GSCComparativeReports - updating specific filters for component ${g}`),this.setDynamicFilters(a,g);const J=this.childViews.find(C=>C.view.id===g);J&&this.updateComparative(J,a)}else if(this.childViews.reduce((J,C)=>(B.includes(C.view.componentProps.type)||J.push(C.view.componentProps.type),J),[]).forEach(J=>{const C=this.childViews.findIndex(x=>x.view.componentProps.type===J);if(C!==-1){for(let x=C;x<this.childViews.length;x++){const e=this.childViews[x+1],v=this.childViews[x];e&&(v.view.componentProps.type=e.view.componentProps.type,v.view.title=e.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),console.log("GSCComparativeReports - updating all components with global filters"),Array.isArray(B))console.log("GSCComparativeReports updateDynamicFilters (array mode) - skipping removal logic to prevent cross-page deletions"),this.childViews.length>0&&B.length>0&&this.childViews.forEach((J,C)=>{if(J.view.componentProps&&C<B.length){const x=B[C],e=Fd.get(this.viewId);J.view.componentProps.type=x,J.view.componentProps.default=!1,J.view.title=`Comparativa ${e[x]}`,J.view.filterMultiple={category:x},console.log(`GSCComparativeReports updateDynamicFilters - updated component ${C} with type:`,x)}});else{const J=B;if(J&&this.childViews.length>0){const C=this.childViews[0];if(C.view.componentProps){const x=Fd.get(this.viewId);C.view.componentProps.type=J,C.view.componentProps.default=!1,C.view.title=`Comparativa ${x[J]}`,C.view.filterMultiple={category:J}}}}console.log("-------------------------------------------------------------"),console.log("childViews",this.childViews)}if(this.viewId===6){const B=a[0]||[];if(g){console.log(`GSCLineupsReports - updating specific filters for component ${g}`),this.setDynamicFilters(a,g);const J=this.childViews.find(C=>C.view.id===g);J&&this.updateGSCLineupsReports(J,a)}else{if(console.log("GSCLineupsReports - updating all components with global filters"),Array.isArray(B))if(B.length===0)for(console.log("GSCLineupsReports - no games selected, removing all components");this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((J,C)=>(B.includes(C.view.componentProps.gameNumber)||J.push(C.view.componentProps.gameNumber),J),[]).forEach(J=>{const C=this.childViews.findIndex(x=>x.view.componentProps.gameNumber===J);if(C!==-1){for(let x=C;x<this.childViews.length;x++){const e=this.childViews[x+1],v=this.childViews[x];e&&(v.view.componentProps.gameNumber=e.view.componentProps.gameNumber,v.view.filterMultiple={gameNumber:e.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(J=>{J.view.componentProps&&(J.view.componentProps._isReactive||(J.view.componentProps=p.reactive(J.view.componentProps),J.view.componentProps._isReactive=!0),Ei.emit("component-props-updated",{viewId:J.view.id,componentProps:J.view.componentProps,dynamicFilters:a}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:J.view.id,dynamicFilters:a}))})}}if(this.viewId===3){if(console.log("GSCMatchSummary updateDynamicFilters:",{dynamicFilters:a,componentId:g,childViewsLength:this.childViews.length}),g){console.log(`GSCMatchSummary - updating specific filters for component ${g}`),this.setDynamicFilters(a,g);const B=this.childViews.find(J=>J.view.id===g);B&&this.updateMatchSummary(B,a)}else{console.log("GSCMatchSummary - updating all components with global filters");const B=a[0]||!1;this.childViews.forEach(J=>{J.view.componentProps&&(J.view.componentProps._isReactive||(J.view.componentProps=p.reactive(J.view.componentProps),J.view.componentProps._isReactive=!0),J.view.componentProps.desplegable=B,J.view.componentProps.key=B,Ei.emit("component-props-updated",{viewId:J.view.id,componentProps:J.view.componentProps,dynamicFilters:a}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:J.view.id,dynamicFilters:a}))})}this.updateSummary({dynamicFilters:a})}if(this.viewId===4){console.log("444444444444444444444444444444444444444444444444444444444444444444444"),console.log("Timeline updateDynamicFilters:",a);const B=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;if(console.log("Timeline updateDynamicFilters:",{hasSelectedEvents:B,childViewsLength:this.childViews.length,dynamicFilters:a,componentId:g}),g){console.log(`Timeline - updating specific filters for component ${g}`);const J=this.childViews.find(C=>C.view.id===g);console.log("specificView",J),J&&(console.log("is view reactive:",p.isReactive(J)),console.log("is view.componentProps reactive:",p.isReactive(J.view.componentProps)),console.log("is view.dynamicFilters reactive:",p.isReactive(J.dynamicFilters)),J.view.componentProps.selectedEvents)}else if(console.log("Timeline - updating all components with global filters"),!B&&this.childViews.length>0)console.log("Timeline - removing views due to no events"),this.childViews.forEach(J=>{this.removeChildView(J)});else if(B&&this.childViews.length===0){console.log("Timeline - emitting add-view event");const J={pageId:null,view:{id:this.viewId,name:"Timeline",title:"Timeline",colspan:12,rowspan:6,max_column:12,max_row:12,min_column:6,min_row:4},filterAndWidgetContainer:this};Ei.emit("add-view",J)}else this.childViews.forEach(J=>{this.updateTimeline(J,a)})}console.log("updateDynamic filters completed successfullyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"),console.log("this.childViews",this.childViews)}finally{this._isUpdating=!1}}removeAllChildViews(){[...this.childViews].forEach(a=>{this.removeChildView(a)})}removeChildView(a,g=!1){const B=this.childViews.findIndex(J=>J.view.id===a.view.id);if(B!==-1){const J=this.childViews[B];this.childViews.splice(B,1),J.view.id&&(this.componentSpecificFilters.delete(J.view.id),console.log(`Cleaned specific filters for component ${J.view.id}`));const C=J.grid,x=J.page,e=document.querySelector(`[gs-id="${J.view.id}"]`);if(C&&e&&(C.removeWidget(e),x&&!g)){const v=x.items.findIndex(u=>u.id===J.view.id);v!==-1&&(x.items.splice(v,1),x.items.length===0&&Ei.emit("empty-page",x))}}}updateView({view:a,dynamicFilters:g,filtersJSON:B}){console.log("222222222222222222222222222222222222222"),console.log("view:",a),console.log("dynamicFilters:",g),console.log("filtersJSON:",B),console.log("this.viewId:",this.viewId),console.log("childViews:",this.childViews),this.setFiltersJSON(B),this.dynamicFilters=g;const J=this.childViews.find(C=>{var x;return((x=C.view)==null?void 0:x.id)===a.view.id});if(console.log("viewToUpdate:",J),J){J.view.filtersJSON=B,J.view.coreView&&(J.view.coreView.filtersJSON=B);let C=g;if(this.viewId===4){const x=this.getComponentDynamicFilters(a.view.id);x&&(C=x,console.log(`Timeline updateView - using specific filters for component ${a.view.id}:`,C))}else if(this.viewId===8){const x=this.getComponentDynamicFilters(a.view.id);x&&(C=x,console.log(`FieldPosesion updateView - using specific filters for component ${a.view.id}:`,C))}else if(this.viewId===3){const x=this.getComponentDynamicFilters(a.view.id);console.log(`GSCMatchSummary updateView - component ${a.view.id}:`,{componentSpecificFilters:x,dynamicFilters:g,willUseSpecific:!!x}),x?(C=x,console.log(`GSCMatchSummary updateView - using specific filters for component ${a.view.id}:`,C)):console.log("GSCMatchSummary updateView - no specific filters found, using dynamicFilters:",C),this.updateSummary({dynamicFilters:C})}else if(this.viewId===1){const x=this.getComponentDynamicFilters(a.view.id);console.log(`GSCComparativeReports updateView - component ${a.view.id}:`,{componentSpecificFilters:x,dynamicFilters:g,willUseSpecific:!!x}),x?(C=x,console.log(`GSCComparativeReports updateView - using specific filters for component ${a.view.id}:`,C)):console.log("GSCComparativeReports updateView - no specific filters found, using dynamicFilters:",C)}else if(this.viewId===6){const x=this.getComponentDynamicFilters(a.view.id);console.log(`GSCLineupsReports updateView - component ${a.view.id}:`,{componentSpecificFilters:x,dynamicFilters:g,willUseSpecific:!!x}),x?(C=x,console.log(`GSCLineupsReports updateView - using specific filters for component ${a.view.id}:`,C)):console.log("GSCLineupsReports updateView - no specific filters found, using dynamicFilters:",C)}else if(this.viewId===7){const x=this.getComponentDynamicFilters(a.view.id);console.log(`GSCGoalData updateView - component ${a.view.id}:`,{componentSpecificFilters:x,dynamicFilters:g,willUseSpecific:!!x}),x?(C=x,console.log(`GSCGoalData updateView - using specific filters for component ${a.view.id}:`,C)):console.log("GSCGoalData updateView - no specific filters found, using dynamicFilters:",C)}else if(this.viewId===9){console.log("update viewwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww zones");const x=this.getComponentDynamicFilters(a.view.id);console.log(`GSCFieldDataByZones updateView - component ${a.view.id}:`,{componentSpecificFilters:x,dynamicFilters:g,willUseSpecific:!!x}),x?(C=x,console.log(`GSCFieldDataByZones updateView - using specific filters for component ${a.view.id}:`,C)):console.log("GSCFieldDataByZones updateView - no specific filters found, using dynamicFilters:",C)}this.viewId===5?this.updateVolumetricField(J,C):this.viewId===7?this.updateGoalData(J,C):this.viewId===9?this.updateFieldDataByZones(J,g):this.viewId===10?this.updateXg(J,C):this.viewId===3?this.updateMatchSummary(J,C):this.viewId===4?this.updateTimeline(J,C):this.viewId===8?this.updateFieldPosesion(J,C):this.viewId===1?this.updateComparative(J,C):this.viewId===2?this.updateGSCtops(J,C):this.viewId===6&&this.updateGSCLineupsReports(J,C)}else console.log("viewToUpdate not found")}updateComparative(a,g){if(console.log("update comparative",g),a.view.componentProps){const B=g[0]||[];if(console.log("GSCComparativeReports updateComparative - selectedAnalysisTypes:",B),B&&B.length>0){let J;if(Array.isArray(B)){const x=this.childViews.findIndex(e=>e.view.id===a.view.id);x>=0&&x<B.length?J=B[x]:J=B[0]}else J=B;const C=Fd.get(this.viewId);a.view.componentProps.type=J,a.view.componentProps.default=!1,a.view.title=`Comparativa ${C[J]}`,a.view.filterMultiple={category:J},console.log("GSCComparativeReports updateComparative - updated component with type:",J)}Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:g}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:g})}}updateVolumetricField(a,g){if(console.log("updateVolumetricField",g),a.view.componentProps){const B=g[0]||1;a.view.isHomeTeam=B===1,a.view.componentProps.preMatchType=B,a.view.filterMultiple={isHomeTeam:B},console.log("GSCVolumetricField updateVolumetricField - updated component with:",{isHomeTeam:B,preMatchType:a.view.componentProps.preMatchType,filterMultiple:a.view.filterMultiple}),Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:g}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:g}),Ei.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateGoalData(a,g){if(console.log("updateGoalData",g),a.view.componentProps){const B=g[0]===1?"offensive":"defensive",J=g[1]===1;a.view.componentProps.analysisType=B,a.view.componentProps.isHomeTeamForAnalysis=J,a.view.isHomeTeam=J,a.view.filterMultiple={isHomeTeam:J},console.log("GSCGoalData updateGoalData - updated component with:",{analysisType:B,isHomeTeam:J,filterMultiple:a.view.filterMultiple}),Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:g}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:g}),Ei.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldDataByZones(a,g){if(console.log("9999999999999999999999999999999999999999999999999999"),console.log("updateFieldDataByZones",g),console.log("view",a),a.view.componentProps){const B=g[0],J=g[1]===1;if(console.log("dynamicFiltersValuesPerTeam",B),console.log("isHomeTeam",J),a.view.componentProps.isHomeTeamForAnalysis=J,a.view.isHomeTeam=J,a.view.filterMultiple={categoryIds:B,isHomeTeam:J},B&&B.length){const C=B.join("-"),x=Fd.get(this.viewId).analysisTypes.get(C);console.log("analysisTypeInfo",x),x&&(a.view.componentProps.analysisType=x.analysisType,a.view.title=x.title,a.view.titleShort=x.titleShort),console.log("************************************"),console.log("is view reactive:",p.isReactive(a)),console.log("is view.view reactive:",p.isReactive(a.view)),console.log("is view.view.componentProps reactive:",p.isReactive(a.view.componentProps)),console.log("view after update:",a),console.log("this.childViews",this.childViews)}console.log("GSCFieldDataByZones updateFieldDataByZones - updated component with:",{categoryIds:B,isHomeTeam:J,analysisType:a.view.componentProps.analysisType,title:a.view.title,filterMultiple:a.view.filterMultiple})}}updateXg(a,g){console.log("1000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),console.log("dynamicFilters",g),console.log("view",a);const B=g[0]===1;a.view.componentProps&&(a.view.isHomeTeam=B,a.view.componentProps.isHomeTeamForAnalysis=B,a.view.filtersJSON=this.filtresJSON,a.view.filterMultiple={isHomeTeam:B}),console.log("view",a)}updateMatchSummary(a,g){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const B=g&&g.length>0?g[0]:!1;a.view.componentProps.desplegable=B,a.view.componentProps.key=B,Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:g}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:g})}}updateTimeline(a,g){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const B=this.getComponentDynamicFilters(a.view.id),J=B||g,C=J&&J.length>0?J[0]:[];a.view.componentProps.selectedEvents=C,a.view.componentProps.key=C.length>0;const x=this.hasEventTypeId(C,1),e=this.hasCategoryId(C,8),v=this.hasCategoryId(C,9),u=this.hasEventTypeId(C,3);console.log("Timeline update - Events check:",{goals:x,yellowCards:e,redCards:v,substitutions:u,selectedEvents:C,componentId:a.view.id,usingSpecificFilters:!!B}),a.view.componentProps.goals=x,a.view.componentProps.yellowCards=e,a.view.componentProps.redCards=v,a.view.componentProps.substitutions=u,a.view.componentProps._updateKey=Date.now(),Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:J}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:J}),Ei.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldPosesion(a,g){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const B=g&&g.length>0?g[0]:!1;a.view.componentProps.areInactiveVisible=B,a.view.componentProps.key=B,Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:g}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:g})}}updateGSCtops(a,g){if(console.log("updateGSCtops",g),a.view.componentProps){const B=g[0]||[];if(Array.isArray(B)){if(console.log("GSCtops updateGSCtops (array mode) - skipping removal logic to prevent cross-page deletions"),B.length>0){const J=B[0];let C=null;try{C=Vd(J)}catch(e){console.warn("Error getting category by ID:",e)}const x=g[1]||1;a.view.filterMultiple={categoryId:J,teamType:x},a.view.componentProps.game&&(x===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:x===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=C?[{id:J,name:C.name}]:[{id:J,name:`Category ${J}`}]}}else{const J=B;if(J){let C=null;try{C=Vd(J)}catch(e){console.warn("Error getting category by ID:",e)}const x=g[1]||1;a.view.filterMultiple={categoryId:J,teamType:x},a.view.componentProps.game&&(x===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:x===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=C?[{id:J,name:C.name}]:[{id:J,name:`Category ${J}`}]}}}}updateGSCLineupsReports(a,g){if(console.log("updateGSCLineupsReports",g),a.view.componentProps){const B=g[0]||[];if(Array.isArray(B)){if(console.log("GSCLineupsReports updateGSCLineupsReports (array mode) - skipping removal logic to prevent cross-page deletions"),B.length>0){const J=B[0];a.view.filterMultiple={gameNumber:J},a.view.componentProps.gameNumber=J}}else{const J=B;J&&(a.view.filterMultiple={gameNumber:J},a.view.componentProps.gameNumber=J)}Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:g}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:g}),Ei.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}getCategoryIdFromAnalysisType(a,g){if(!a||!g)return null;for(const B of g){const J=B.join("-"),C=Fd.get(this.viewId);if(C&&C.analysisTypes){const x=C.analysisTypes.get(J);if(x&&x.analysisType===a)return B[0]||null}}return null}}const Dse={class:"template-page__header"},Bse={class:"template-page__header__name"},Vse=["value"],Fse={class:"template-page__header__details"},jse={class:"template-page__header__details__teams"},Use={class:"template-page__header__details__teams__team"},qse={key:0,class:"template-page__header__details__teams__team__logo"},Wse=["src"],Gse={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Hse={class:"template-page__header__details__teams__team"},Xse={key:0,class:"template-page__header__details__teams__team__logo"},Yse=["src"],Jse={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Kse={class:"template-page__content"},Zse=["id"],Qse=["gs-id","gs-x","gs-y","gs-w","gs-h","gs-max-w","gs-max-h","gs-min-w","gs-min-h","gs-no-resize","gs-no-move","gs-auto-position"],$se=p.defineComponent({__name:"TemplateReportPage",props:{token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"},game:{type:Object,default:()=>null},lastGames:{type:Array,default:()=>null},id:{type:[String,Number],default:()=>String(Date.now())},page:{type:Object,default:()=>({title:"Page 1",items:[{name:"Tabla jugadores",id:`w-${String(Date.now())}`,x:0,y:0,w:4,h:4,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}}]})},isPostMatch:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},isFilterVisible:{type:Boolean,default:!1}},emits:["intersection-changed","delete-page","change-sort","edit-view","view-changed","component-props-updated","delete-view","dynamic-filters-changed"],setup(r,{emit:a}){var g,B;const J=p.ref(null);let C=null;const x=r,e=p.ref(!1),v=a,u=p.computed(()=>x.page.items.reduce((z,V)=>(z.set(V.id,V),z),new Map)),t=p.computed(()=>{var z,V,U,q;return x.game&&x.game.homeTeam&&x.game.awayTeam?{homeTeam:{name:((z=x.game.homeTeam)==null?void 0:z.acronym)||"LOC",logo:((V=x.game.homeTeam)==null?void 0:V.logo)||null},awayTeam:{name:((U=x.game.awayTeam)==null?void 0:U.acronym)||"VIS",logo:((q=x.game.awayTeam)==null?void 0:q.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let w=null,y=null,b=!1,h=null,n=!1;const i=()=>{n=!0},d=()=>{n=!1};function s(){n||(b=!0,h&&clearTimeout(h),h=setTimeout(()=>{b=!1},150))}function c(){const z={root:null,rootMargin:"0px",threshold:.7};w=new IntersectionObserver(q=>{q.forEach(W=>{if(console.log("Intersection observer triggered:",W.isIntersecting,"isScrolling:",b),b){console.log("Scroll in progress, delaying intersection event"),y&&clearTimeout(y),y=setTimeout(()=>{console.log("Emitting delayed intersection event:",W.isIntersecting),v("intersection-changed",W.isIntersecting)},100);return}y&&clearTimeout(y),y=setTimeout(()=>{console.log("Emitting immediate intersection event:",W.isIntersecting),v("intersection-changed",W.isIntersecting)},50)})},z);const V=J.value;V&&w.observe(V);const U=document.querySelector(".container-main");U&&U.addEventListener("scroll",s,{passive:!0}),document.addEventListener("programmatic-scroll-start",i),document.addEventListener("programmatic-scroll-end",d)}function f(z){console.log("newValue:",z),x.page.title=z.target.value,v("view-changed")}const m={game_id:0,season_id:0,prematch:!1},T={gameId:90209,id:90209,seasonId:1909,regularSeasonId:1909,matchday_name:"Matchday 1",status:1,score:[1,3],game_status:1,dateTimeUTC:"2024-09-05T22:00:00Z",homeTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/2936.png",team_id:2936,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/2936.png",colloquial_name:"Guyana",acronym:"GUY",team_name:"Guyana"},awayTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/3279.png",team_id:3279,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/3279.png",colloquial_name:"Surinam",acronym:"SUR",team_name:"Surinam"},is_live:0,minutes:{home_goals_minutes:[],visiting_goals_minutes:[],home_yellow_cards_minutes:[],away_yellow_cards_minutes:[],home_red_cards_minutes:[],away_red_cards_minutes:[]}},E=new Map([[5,{component:Ix,componentName:"GSCVolumetricField",props:{isGamePreMatch:!x.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:x.isTemplateMode,isTemplateMode:x.isTemplateMode,preMatchType:1}}],[2,{component:Tw,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:x.game?x.game.id:T.gameId,game:x.game,season:x.game?(g=x==null?void 0:x.game)==null?void 0:g.season_id:T.seasonId,teamView:0,useDummyData:x.isTemplateMode}}],[8,{component:E3,componentName:"FieldPosesion",props:{widthSection:600,game:T,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:P4,componentName:"GSCLineupsReports",props:{selectedOption:x.isPostMatch?"Postmatch":"Prematch",game:m,gamehome:m,gameaway:m}}],[3,{component:M3,componentName:"GSCMatchSummary",props:{game:T,defaultShields:!0,desplegable:!1}}],[4,{component:p5,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:T.gameId,homeTeam:T.homeTeam.team_id,awayTeam:T.awayTeam.team_id,token:x.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:v6,componentName:"GSCGoalData",props:{game:x.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!x.isPostMatch,analysisType:1}}],[9,{component:N4,componentName:"GSCFieldDataByZones",props:{game:x.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!x.isPostMatch,negative:!0}}],[10,{component:M6,componentName:"GSCGameXg",props:{game:x.game,isHomeTeamForAnalysis:!0,isPostMatch:x.isPostMatch}}],[1,{component:m6,componentName:"GSCComparativeReports",props:{gameId:x.game?x.game.id:"",homeLogo:x.game?x.game.homeTeam.logo:"",awayLogo:x.game?x.game.awayTeam.logo:"",seasonId:x.game?(B=x==null?void 0:x.game)==null?void 0:B.season_id:0,typeGame:x.isPostMatch,type:"stoppedBall",default:x.isTemplateMode}}]]);function S(z){if(z)if(typeof z=="string"){let V=null;switch(z){case"GSCVolumetricField":V=Ix;break;case"GSCGoalData":V=v6;break;case"GscTopPlayer":V=Tw;break;case"FieldPosesion":V=E3;break;case"GSCLineupsReports":V=P4;break;case"GSCMatchSummary":V=M3;break;case"GSCTimelineReports":V=p5;break;case"GSCFieldDataByZones":V=N4;break;case"GSCGameXg":V=M6;break;case"GSCComparativeReports":V=m6;break;default:V=null}return V}else return z;return null}function P({pageId:z,view:V,filterAndWidgetContainer:U,applyMinimumSize:q=!1,dynamicFilters:W=[]}){if(x.page.id===z&&C){let Z=!1;V.id===3&&(Z=W[0]);const ne=`min_column${Z?"_2":""}`,X=`min_row${Z?"_2":""}`,re=`colspan${Z?"_2":""}`,ee=`rowspan${Z?"_2":""}`,K={w:q?V[ne]:V[re],h:q?V[X]:V[ee]};if(C.willItFit(0,0,K.w,K.h,!0)){const te=C.addWidget(K),ae=Number(te.getAttribute("gs-x")||0),oe=Number(te.getAttribute("gs-y")||0);C.removeWidget(te);const he=E.get(V.id),fe=p.reactive({...JSON.parse(JSON.stringify(he.props))||{},_isReactive:!0}),se=p.reactive({pageId:z,grid:C,page:x.page,view:{name:V.name,title:V.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:ae,y:oe,w:K.w,h:K.h,maxWidth:V.max_column,maxHeight:V.max_row,minWidth:V.min_column,minHeight:V.min_row,componentName:he.componentName,componentProps:fe,pageId:z,coreView:V}});U.addView(se),Ei.emit("add-page-view",se)}else Ei.emit("add-page-and-view",{pageId:z,view:V,filterAndWidgetContainer:U})}}function N(z){if(C){const V=document.querySelector(`[gs-id="${z.id}"]`);V&&(C.removeWidget(V),v("delete-view",z))}v("view-changed")}function A(z){if(!z.filterAndViewsContainer&&z.coreView){const V=new Up(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[z],z.coreView.id,z.dynamicFilters||[],x.isPostMatch,x.isTemplateMode,z.filtersJSON);z.filterAndViewsContainer=V}v("edit-view",z)}function O(){v("delete-page",x.page)}function M(){Ei.emit("change-sort",x.page)}function k(z){if(b)return;console.log("force-component-update event received:",z);const V=x.page.items.find(U=>U.id===z.itemId||U.id===z.viewId);V?(console.log("Found item to update in force-component-update:",V.id),Object.assign(V.componentProps,z.componentProps),V._updateKey=Date.now(),console.log("Updated item in force-component-update:",V.componentProps)):console.log("Item not found in force-component-update for id:",z.itemId||z.viewId)}function I(z){if(b)return;console.log("component-props-updated event received:",z);const V=x.page.items.find(U=>U.id===z.viewId);V?(console.log("Found item to update in component-props-updated:",V.id),Object.assign(V.componentProps,z.componentProps),V._updateKey=Date.now(),console.log("Updated item in component-props-updated:",V.componentProps)):console.log("Item not found in component-props-updated for id:",z.viewId)}function _(z){if(b)return;console.log("dynamic-filters-changed event received:",z);const V=x.page.items.find(U=>U.id===z.viewId);V?(console.log("Found item to update in dynamic-filters-changed:",V.id),Object.assign(V.componentProps,z.componentProps||{}),V._updateKey=Date.now(),console.log("Updated item in dynamic-filters-changed:",V.componentProps)):console.log("Item not found in dynamic-filters-changed for id:",z.viewId)}const R=function(){Ei.off("add-view",P),Ei.off("force-component-update",k),Ei.off("component-props-updated",I),Ei.off("dynamic-filters-changed",_);const z=document.querySelector(".container-main");z&&z.removeEventListener("scroll",s),y&&clearTimeout(y),h&&clearTimeout(h)};return Ei.on("add-view",P),Ei.on("force-component-update",k),Ei.on("component-props-updated",I),Ei.on("dynamic-filters-changed",_),p.onMounted(async()=>{await p.nextTick(),C=Wi.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${x.id}`),C.on("change",(z,V)=>{const U=V[0];if(U){const q=u.value.get(U.id);q&&(q.x=U.x,q.y=U.y,q.w=U.w,q.h=U.h,v("view-changed"))}}),c(),x.page.grid=C,x.page.offListeners=R}),p.onUnmounted(()=>{w&&w.disconnect(),R(),y&&clearTimeout(y),h&&clearTimeout(h),document.removeEventListener("programmatic-scroll-start",i),document.removeEventListener("programmatic-scroll-end",d)}),(z,V)=>(p.openBlock(),p.createElementBlock("div",{ref_key:"templatePage",ref:J,class:"template-page"},[p.createElementVNode("div",Dse,[e.value?(p.openBlock(),p.createBlock(P6,{key:0,"options-type":"page",onClick:V[0]||(V[0]=p.withModifiers(U=>e.value=!1,["self"])),onMouseleave:V[1]||(V[1]=U=>e.value=!1),onCloseTooltip:V[2]||(V[2]=U=>e.value=!1),onDeletePage:O,onChangeSort:M})):p.createCommentVNode("",!0),p.createElementVNode("div",Bse,[V[4]||(V[4]=p.createElementVNode("div",null,[p.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M11.2986 12.9994C7.62909 14.8341 4.11744 16.0178 1.35547 16.4518L9.18763 20.0029C9.34545 20.0818 9.60192 20.0818 9.74002 20.0029L17.8878 16.3137C18.0457 16.2348 18.164 16.0572 18.164 15.8797V8.75781C16.2898 10.2177 13.9422 11.6776 11.2986 12.9994Z",fill:"white"}),p.createElementVNode("path",{d:"M4.7152 8.89735C4.7152 8.89735 10.9494 3.76802 16.8482 1.20335C15.0529 0.946887 11.3637 0.43395 9.3711 0.453678C4.41928 0.493135 1.06546 1.34145 1.06546 1.34145C0.90763 1.3809 0.769531 1.55846 0.769531 1.71629V8.12795C3.01857 6.56942 5.34651 5.56329 5.34651 5.56329C5.34651 5.56329 2.72264 7.06263 0.769531 8.81844V9.41028V14.1648C3.09748 13.9675 6.62886 12.7641 10.3575 10.7321C13.6719 8.91707 16.4733 6.84562 18.17 5.05035V2.40677C14.3032 3.37346 4.7152 8.89735 4.7152 8.89735Z",fill:"white"})])],-1)),V[5]||(V[5]=p.createElementVNode("div",{class:"separator"},null,-1)),p.createElementVNode("input",{value:r.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:f},null,40,Vse)]),p.createElementVNode("div",Fse,[p.createElementVNode("div",jse,[p.createElementVNode("div",Use,[t.value.homeTeam.logo?(p.openBlock(),p.createElementBlock("div",qse,[p.createElementVNode("img",{src:t.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,Wse)])):(p.openBlock(),p.createElementBlock("svg",Gse,[...V[6]||(V[6]=[p.createElementVNode("path",{opacity:"0.4",d:"M12.0153 0.261719C12.0153 0.261719 13.6664 1.94994 17.7355 2.06744C21.149 2.16638 22.3796 1.30063 22.3796 1.30063C22.3796 1.30063 25.4902 10.2488 20.3822 17.7005C17.6983 21.615 12.5533 24.1504 12.0091 24.2617C11.4711 24.1504 6.31984 21.615 3.636 17.7005C-1.4596 10.2488 1.65094 1.30063 1.65094 1.30063C1.65094 1.30063 2.88155 2.16638 6.2951 2.06744C10.3642 1.94994 12.0153 0.261719 12.0153 0.261719Z",fill:"#54728B"},null,-1)])])),p.createElementVNode("span",null,p.toDisplayString(t.value.homeTeam.name),1)]),V[8]||(V[8]=p.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),p.createElementVNode("div",Hse,[p.createElementVNode("span",null,p.toDisplayString(t.value.awayTeam.name),1),t.value.awayTeam.logo?(p.openBlock(),p.createElementBlock("div",Xse,[p.createElementVNode("img",{src:t.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,Yse)])):(p.openBlock(),p.createElementBlock("svg",Jse,[...V[7]||(V[7]=[p.createElementVNode("path",{opacity:"0.4",d:"M12.0153 0.261719C12.0153 0.261719 13.6664 1.94994 17.7355 2.06744C21.149 2.16638 22.3796 1.30063 22.3796 1.30063C22.3796 1.30063 25.4902 10.2488 20.3822 17.7005C17.6983 21.615 12.5533 24.1504 12.0091 24.2617C11.4711 24.1504 6.31984 21.615 3.636 17.7005C-1.4596 10.2488 1.65094 1.30063 1.65094 1.30063C1.65094 1.30063 2.88155 2.16638 6.2951 2.06744C10.3642 1.94994 12.0153 0.261719 12.0153 0.261719Z",fill:"#54728B"},null,-1)])]))])]),r.isTemplateMode&&!r.isFilterVisible?(p.openBlock(),p.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:V[3]||(V[3]=U=>e.value=!0)},[...V[9]||(V[9]=[p.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])])):p.createCommentVNode("",!0)])]),p.createElementVNode("div",Kse,[p.createElementVNode("div",{id:`grid-stack-${r.id}`,class:"grid-stack"},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.page.items,U=>{var q,W,Z;return p.openBlock(),p.createElementBlock("div",{class:"grid-stack-item",key:U.key,"gs-id":U.id,"gs-x":U.x,"gs-y":U.y,"gs-w":U.w,"gs-h":U.h,"gs-max-w":U.maxWidth,"gs-max-h":U.maxHeight,"gs-min-w":U.minWidth,"gs-min-h":U.minHeight,"gs-no-resize":!r.isTemplateMode,"gs-no-move":!x.isTemplateMode,"gs-auto-position":U.x===0&&U.y===0},[p.createElementVNode("div",{class:p.normalizeClass(["grid-stack-item-content",{"is-selected":U.isSelected}])},[p.createVNode(Ase,{title:U.coreView&&U.coreView.id===9&&U.w<4&&U.titleShort||U.title,"is-template-mode":r.isTemplateMode,game:r.game,lastGames:r.lastGames,"is-home-team":(q=U.componentProps)!=null&&q.preMatchType?((W=U.componentProps)==null?void 0:W.preMatchType)===1:U.isHomeTeam,"is-filter-visible":r.isFilterVisible,"view-id":((Z=U==null?void 0:U.coreView)==null?void 0:Z.id)||0,onEdit:ne=>A(U),onDelete:ne=>N(U)},{default:p.withCtx(()=>[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(S(U.componentName)),p.mergeProps({ref_for:!0},U.componentProps,{key:`${U.id}-${U._updateKey||0}`}),null,16))]),_:2},1032,["title","is-template-mode","game","lastGames","is-home-team","is-filter-visible","view-id","onEdit","onDelete"])],2)],8,Qse)}),128))],8,Zse)])],512))}}),ele=dd($se,[["__scopeId","data-v-5ca40dad"]]),tle={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},rle={key:0,class:"cover__main-logo cover__main-logo__home"},nle={key:0,class:"team-logo"},ile=["src"],ale={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ole=["fill"],sle={key:1,class:"cover__main-logo cover__main-logo__away"},lle={key:0,class:"team-logo"},cle=["src"],ule={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dle=["fill"],hle={class:"cover__title-subtitle"},ple={class:"cover__title-subtitle__title"},fle={class:"cover__title-subtitle__subtitle"},mle={key:2,class:"cover-type-one"},gle={class:"team-info-one"},yle={class:"team-data"},vle={key:0,class:"team-logo"},ble=["src"],xle={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_le=["fill","opacity"],wle={class:"team-name"},Tle={key:0,class:"team-events"},kle={class:"score-one"},Sle={key:0},Ele={class:"team-info-one"},Ale={class:"team-data"},Cle={key:0,class:"team-logo"},Mle=["src"],Ple={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Nle=["fill","opacity"],Ole={class:"team-name"},Ile={key:0,class:"team-events"},Rle={key:3,class:"cover-type-two"},Lle={class:"team-data"},zle={class:"team-info"},Dle={key:0,class:"team-logo"},Ble=["src"],Vle={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Fle=["fill","opacity"],jle={key:2,class:"team-score-two"},Ule={key:0,class:"team-goals"},qle={class:"team-data"},Wle={class:"team-info"},Gle={key:0,class:"team-score-two"},Hle={key:1,class:"team-logo"},Xle=["src"],Yle={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Jle=["fill","opacity"],Kle={key:0,class:"team-goals"},Zle={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(r,{emit:a}){const g=r,B=a,J=p.ref(null),C=p.computed(()=>[1,2].includes(g.coverId)),x=p.computed(()=>[1,3].includes(g.coverId)),e=p.computed(()=>g.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:g.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),v=p.computed(()=>g.game&&g.game.score?g.game.score:["0","0"]),u=p.computed(()=>{var P,N,A,O,M,k,I,_;if(g.game&&g.game.homeTeam&&g.game.awayTeam){const R={homeTeam:{name:((P=g.game.homeTeam)==null?void 0:P.acronym)||"LOC",logo:((N=g.game.homeTeam)==null?void 0:N.logo)||null},awayTeam:{name:((A=g.game.awayTeam)==null?void 0:A.acronym)||"VIS",logo:((O=g.game.awayTeam)==null?void 0:O.logo)||null}};return C.value?(R.homeTeam.goalsMinutes=n(g.game.minutes.home_goals_minutes),R.homeTeam.totalYellowCards=((M=g.game.minutes.home_yellow_cards_minutes)==null?void 0:M.length)||0,R.homeTeam.totalRedCards=((k=g.game.minutes.home_red_cards_minutes)==null?void 0:k.length)||0,R.awayTeam.goalsMinutes=n(g.game.minutes.visiting_goals_minutes),R.awayTeam.totalYellowCards=((I=g.game.minutes.away_yellow_cards_minutes)==null?void 0:I.length)||0,R.awayTeam.totalRedCards=((_=g.game.minutes.away_red_cards_minutes)==null?void 0:_.length)||0):(R.homeTeam.goalsEvents=h(g.game.report_minutes.home_goals_minutes),R.awayTeam.goalsEvents=h(g.game.report_minutes.visiting_goals_minutes)),R}return{homeTeam:{name:"LOC",logo:null,goalsMinutes:"00'",totalYellowCards:0,totalRedCards:0,goalsEvents:[{playerName:"Nombre",goalTime:"00'"}]},awayTeam:{name:"VIS",logo:null,goalsMinutes:"00'",totalYellowCards:0,totalRedCards:0,goalsEvents:[{playerName:"Nombre",goalTime:"00'"}]}}}),t=p.computed(()=>({"--background-image":x.value?"url(https://golstatsimages.blob.core.windows.net/report-maker/background-postmatch-template-01@2x.jpg)":"url(https://golstatsimages.blob.core.windows.net/report-maker/background-postmatch-template-02@2x.jpg)","--grid-template-columns-type-one":g.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":g.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":g.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":g.isPostMatch?"100%":"fit-content"})),w=p.computed(()=>g.isPostMatch?"Postmatch":"Prematch"),y=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],b=p.computed(()=>{if(g.game){let P=tle[g.game.matchday_abbreviation];P||(P=g.game.matchday_abbreviation.replace("M","J"));const[N,A,O]=g.game.date.split("-");return`${P} - ${O} ${y[Number(A)-1]}, ${N}`}return"Jornada - Día 00 Mes"});function h(P){return!P||!Array.isArray(P)||P.length===0?"":(console.log("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"),console.log("goalsDetails",P),P.map(N=>{const A=N.split(", ");let O=A[0].replace("'","");O=O.replace("+",""),O=O.replace("’",""),console.log("playerGoalsArray",A);const M=O.split(" "),{strings:k,numbers:I}=M.reduce((z,V)=>(isNaN(Number(V))?z.strings.push(V):z.numbers.push(V),z),{strings:[],numbers:[]}),_=k.join(" "),R=I.length===1?`${I[0]}'`:`${I[0]}' ${I.slice(1).join(" + ")}'`;return{playerName:_,goalTime:A.length===1?R:`${R}, ${A.reduce((z,V,U)=>U===0?z:`${z}${V}${U<A.length-1?", ":""}`,"")}`}}))}function n(P){return!P||!Array.isArray(P)||P.length===0?"":P.reduce((N,A,O)=>{const M=A.split(" ");let k="";return M.length===3?k=M[2]:M.length===5&&(k=`${M[2]} ${M[3]} ${M[4]}`),k&&(N+=`${k}${O<P.length-1?", ":""}`),N},"")}let i=null,d=null,s=!1,c=null,f=!1;const m=()=>{f=!0},T=()=>{f=!1};function E(){if(f){console.log("Cover: Ignoring programmatic scroll");return}s=!0,c&&clearTimeout(c),c=setTimeout(()=>{s=!1},150)}function S(){const P={root:null,rootMargin:"0px",threshold:.7};i=new IntersectionObserver(O=>{O.forEach(M=>{if(console.log("Cover: Intersection observer triggered:",M.isIntersecting,"isScrolling:",s),s){console.log("Cover: Scroll in progress, delaying intersection event"),d&&clearTimeout(d),d=setTimeout(()=>{console.log("Cover: Emitting delayed intersection event:",M.isIntersecting),B("intersection-changed",M.isIntersecting)},100);return}d&&clearTimeout(d),d=setTimeout(()=>{console.log("Cover: Emitting immediate intersection event:",M.isIntersecting),B("intersection-changed",M.isIntersecting)},50)})},P);const N=J.value;N&&i.observe(N);const A=document.querySelector(".container-main");A&&A.addEventListener("scroll",E,{passive:!0}),document.addEventListener("programmatic-scroll-start",m),document.addEventListener("programmatic-scroll-end",T)}return p.onMounted(()=>{S()}),p.onUnmounted(()=>{i&&i.disconnect();const P=document.querySelector(".container-main");P&&P.removeEventListener("scroll",E),document.removeEventListener("programmatic-scroll-start",m),document.removeEventListener("programmatic-scroll-end",T),d&&clearTimeout(d),c&&clearTimeout(c)}),(P,N)=>(p.openBlock(),p.createElementBlock("div",{ref_key:"coverPage",ref:J,class:"cover",style:p.normalizeStyle(t.value)},[C.value?(p.openBlock(),p.createElementBlock("div",rle,[u.value.homeTeam.logo?(p.openBlock(),p.createElementBlock("div",nle,[p.createElementVNode("img",{src:u.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,ile)])):(p.openBlock(),p.createElementBlock("svg",ale,[p.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:e.value.homeTeam},null,8,ole)]))])):p.createCommentVNode("",!0),C.value?(p.openBlock(),p.createElementBlock("div",sle,[u.value.awayTeam.logo?(p.openBlock(),p.createElementBlock("div",lle,[p.createElementVNode("img",{src:u.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,cle)])):(p.openBlock(),p.createElementBlock("svg",ule,[p.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:e.value.awayTeam},null,8,dle)]))])):p.createCommentVNode("",!0),p.createElementVNode("div",hle,[p.createElementVNode("div",ple,[N[0]||(N[0]=p.createElementVNode("div",null,"Análisis",-1)),p.createElementVNode("div",null,p.toDisplayString(w.value),1)]),p.createElementVNode("div",fle,p.toDisplayString(b.value),1)]),C.value?(p.openBlock(),p.createElementBlock("div",mle,[p.createElementVNode("div",gle,[p.createElementVNode("div",yle,[u.value.homeTeam.logo?(p.openBlock(),p.createElementBlock("div",vle,[p.createElementVNode("img",{src:u.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,ble)])):(p.openBlock(),p.createElementBlock("svg",xle,[p.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:e.value.homeTeam,opacity:e.value.opacity},null,8,_le)])),p.createElementVNode("div",wle,p.toDisplayString(u.value.homeTeam.name),1)]),r.isPostMatch?(p.openBlock(),p.createElementBlock("div",Tle,[N[1]||(N[1]=p.createStaticVNode('<svg class="ball" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-0364d256><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path></svg>',1)),p.createElementVNode("div",null,p.toDisplayString(u.value.homeTeam.goalsMinutes),1),N[2]||(N[2]=p.createElementVNode("div",{class:"separator"},null,-1)),N[3]||(N[3]=p.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),p.createElementVNode("div",null,p.toDisplayString(u.value.homeTeam.totalYellowCards),1),N[4]||(N[4]=p.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),p.createElementVNode("div",null,p.toDisplayString(u.value.homeTeam.totalRedCards),1)])):p.createCommentVNode("",!0)]),p.createElementVNode("div",kle,[r.isPostMatch?(p.openBlock(),p.createElementBlock("div",Sle,p.toDisplayString(v.value[0])+" : "+p.toDisplayString(v.value[1]),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",Ele,[p.createElementVNode("div",Ale,[u.value.awayTeam.logo?(p.openBlock(),p.createElementBlock("div",Cle,[p.createElementVNode("img",{src:u.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,Mle)])):(p.openBlock(),p.createElementBlock("svg",Ple,[p.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:e.value.awayTeam,opacity:e.value.opacity},null,8,Nle)])),p.createElementVNode("div",Ole,p.toDisplayString(u.value.awayTeam.name),1)]),r.isPostMatch?(p.openBlock(),p.createElementBlock("div",Ile,[p.createElementVNode("div",null,p.toDisplayString(u.value.awayTeam.totalYellowCards),1),N[5]||(N[5]=p.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),p.createElementVNode("div",null,p.toDisplayString(u.value.awayTeam.totalRedCards),1),N[6]||(N[6]=p.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),N[7]||(N[7]=p.createElementVNode("div",{class:"separator"},null,-1)),p.createElementVNode("div",null,p.toDisplayString(u.value.awayTeam.goalsMinutes),1),N[8]||(N[8]=p.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-0364d256><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path></svg>',1))])):p.createCommentVNode("",!0)])])):(p.openBlock(),p.createElementBlock("div",Rle,[p.createElementVNode("div",Lle,[p.createElementVNode("div",zle,[u.value.homeTeam.logo?(p.openBlock(),p.createElementBlock("div",Dle,[p.createElementVNode("img",{src:u.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,Ble)])):(p.openBlock(),p.createElementBlock("svg",Vle,[p.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:e.value.homeTeam,opacity:e.value.opacity},null,8,Fle)])),r.isPostMatch?(p.openBlock(),p.createElementBlock("div",jle,p.toDisplayString(v.value[0]),1)):p.createCommentVNode("",!0)]),r.isPostMatch?(p.openBlock(),p.createElementBlock("div",Ule,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(u.value.homeTeam.goalsEvents,(A,O)=>(p.openBlock(),p.createElementBlock("div",{key:`goal-${O}`,class:"goal"},[p.createElementVNode("div",null,p.toDisplayString(A.playerName),1),N[9]||(N[9]=p.createElementVNode("div",{class:"bullet"},null,-1)),p.createElementVNode("div",null,p.toDisplayString(A.goalTime),1),N[10]||(N[10]=p.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-0364d256><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path></svg>',1))]))),128))])):p.createCommentVNode("",!0)]),N[13]||(N[13]=p.createElementVNode("div",{class:"separator"},null,-1)),p.createElementVNode("div",qle,[p.createElementVNode("div",Wle,[r.isPostMatch?(p.openBlock(),p.createElementBlock("div",Gle,p.toDisplayString(v.value[1]),1)):p.createCommentVNode("",!0),u.value.awayTeam.logo?(p.openBlock(),p.createElementBlock("div",Hle,[p.createElementVNode("img",{src:u.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,Xle)])):(p.openBlock(),p.createElementBlock("svg",Yle,[p.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:e.value.awayTeam,opacity:e.value.opacity},null,8,Jle)]))]),r.isPostMatch?(p.openBlock(),p.createElementBlock("div",Kle,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(u.value.awayTeam.goalsEvents,(A,O)=>(p.openBlock(),p.createElementBlock("div",{key:`goal-a-${O}`,class:"goal"},[N[11]||(N[11]=p.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-0364d256><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path></svg>',1)),p.createElementVNode("div",null,p.toDisplayString(A.goalTime),1),N[12]||(N[12]=p.createElementVNode("div",{class:"bullet"},null,-1)),p.createElementVNode("div",null,p.toDisplayString(A.playerName),1)]))),128))])):p.createCommentVNode("",!0)])]))],4))}},Qle=dd(Zle,[["__scopeId","data-v-0364d256"]]),$le={class:"floating-bar"},ece={class:"tab active"},tce={class:"select-display"},rce={class:"select-icon"},nce=["src"],ice={key:1,src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png",alt:"icono",class:"option-img-default"},ace={key:0,class:"select-placeholder select-label"},oce={key:1,class:"select-label"},sce={key:0,class:"dropdown-menu field-menu"},lce=["onClick"],cce={class:"option-icon"},uce=["src","data-hover-src"],dce={class:"option-content"},hce={class:"option-title"},pce={key:0,class:"option-description"},fce={class:"select-display"},mce={class:"select-icon"},gce=["src"],yce=["src"],vce={class:"select-label"},bce={key:0,class:"dropdown-menu type-menu type-menu-grid"},xce={class:"option-grid"},_ce=["onClick"],wce={class:"option-grid-title"},Tce={class:"option-grid-icon"},kce=["src"],Sce={key:1,class:"filter-separator"},Ece=["onClick"],Ace={class:"select-display"},Cce={key:0,class:"badge-categorias"},Mce={key:0,class:"dropdown-menu type-menu multi-select-menu"},Pce={class:"multi-select-scroll-area"},Nce={class:"select-all-checkbox"},Oce=["checked","indeterminate","onChange"],Ice={class:"option-checkbox"},Rce=["checked","onChange"],Lce=["onClick"],zce={class:"option-title"},Dce={class:"multi-select-footer"},Bce={key:1,class:"custom-radio-group filter-inline"},Vce={class:"radio-label"},Fce={class:"radio-options"},jce=["name","value","onUpdate:modelValue","disabled","onChange"],Uce={key:2,class:"check-group filter-inline"},qce=["onUpdate:modelValue","checked","onChange"],Wce=["data-filter-type","onClick"],Gce={class:"select-display"},Hce={key:0,class:"dropdown-menu type-menu simple-select-menu"},Xce={class:"simple-select-scroll-area"},Yce=["onMouseenter","onClick"],Jce={class:"option-content"},Kce={class:"option-title"},Zce={key:0,class:"option-checkmark"},Qce={key:4,class:"filter-separator"},$ce=Object.assign({name:"FloatingFiltersBar"},{__name:"filters",props:{token:{type:String,required:!0},view:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!1},filters_edition_mode:{type:Array,default:()=>null}},emits:["filters-changed","close"],setup(r,{expose:a,emit:g}){const B=r,J=g,C=p.ref([]);let x=null,e=null,v=null;const u=p.ref(!1),t=p.ref(!1),w=p.ref(!1),y=p.ref(!1),b=p.ref(!1),h=p.ref(!1),n=p.computed(()=>C.value),i=p.ref(null),d=p.computed(()=>n.value[i.value]||null),s=p.computed(()=>{var ve;const me=((ve=d.value)==null?void 0:ve.views)||[];return O(me)}),c=p.ref(null),f=p.computed(()=>s.value.find(ve=>ve.id===c.value)||null),m=p.ref([]),T=p.computed(()=>{var ve,me;return u.value?((ve=f.value)==null?void 0:ve.filters_edition_mode)||[]:((me=f.value)==null?void 0:me.filters)||[]});p.watch(u,ve=>{ve||(t.value=!1)}),p.watch(f,ve=>{var me,De;if(!ve){m.value=[];return}const Ie=ve.id===6&&B.isPostMatch;if(!Array.isArray(T.value)&&!Ie){m.value=[];return}if(y.value)return;Ie?m.value=[]:(m.value=T.value.map((We,Ye)=>{var ke,ze,Fe,He,rt,nt,ht,vt,mt,Ot,Vt,qt,st,$e,lt,pt,At,_t;if(We.type==="select"){if(u.value&&v&&v.dynamicFilters){const tt=v.dynamicFilters[Ye];if(tt){if(tt.selectedOptions&&Array.isArray(tt.selectedOptions)){const ot=tt.selectedOptions.map(Xe=>Xe.value);return console.log(`Using saved select values for filter ${Ye}:`,ot),ot}else if(tt.selectedValue&&Array.isArray(tt.selectedValue))if(tt.selectedValue.length>0&&tt.selectedValue[0]&&typeof tt.selectedValue[0]=="object"){const ot=Ge(tt.selectedValue);return console.log(`Using saved Timeline values for filter ${Ye}:`,ot),ot}else return console.log(`Using saved selectedValue for filter ${Ye}:`,tt.selectedValue),tt.selectedValue}}if(ve.id===4&&We.options&&Array.isArray(We.options)){const tt=We.options.map(ot=>ot.value);return console.log(`Timeline detected - preselecting all options for filter ${Ye}:`,tt),console.log("Timeline - filter options:",We.options),console.log("Timeline - filter type:",We.type),tt}return[]}else if(We.type==="radio-button"){if(console.log("radioooooooooooooooooooooooooooooooooooooooooo"),u.value&&v&&v.dynamicFilters){const tt=v.dynamicFilters[Ye];if(tt&&tt.selectedOption)return console.log(`Using saved radio-button value for filter ${Ye}:`,tt.selectedOption.value),tt.selectedOption.value}if(ve.id===7&&u.value&&e!=null&&e.view){if(console.log(`GSCGoalData - checking for stored values in initialization for filter ${Ye}:`,e.view),console.log("GSCGoalData - filter index:",Ye,"filter type:",We.type,"filter label:",We.label),Ye===0&&(ke=e.view.componentProps)!=null&&ke.analysisType){const tt=e.view.componentProps.analysisType,ot=tt==="offensive"?1:2;return console.log(`GSCGoalData - setting radio-button filter ${Ye} to analysis value:`,ot,"analysisType:",tt),console.log("GSCGoalData - filter options:",We.options),ot}if(Ye===1&&((ze=e.view.filterMultiple)==null?void 0:ze.isHomeTeam)!==void 0){const tt=e.view.filterMultiple.isHomeTeam,ot=tt?1:2;return console.log(`GSCGoalData - setting radio-button filter ${Ye} to team value:`,ot,"isHomeTeam:",tt),console.log("GSCGoalData - filter options:",We.options),ot}console.log(`GSCGoalData - filter index ${Ye} - no stored value found or not applicable`)}else console.log(`GSCGoalData - conditions not met: newVal.id=${ve.id}, isEditMode=${u.value}, hasView=${!!(e!=null&&e.view)}`);return((He=(Fe=We.options)==null?void 0:Fe[0])==null?void 0:He.value)??null}else if(We.type==="select-simple"){if(console.log("select-simpleeeeeeeeeeeeeeeeeeeeeeeeee"),u.value&&v&&v.dynamicFilters){const tt=v.dynamicFilters[Ye];if(tt&&tt.selectedValue!==void 0){console.log(`Using saved select-simple value for filter ${Ye}:`,tt.selectedValue),console.log("Saved selectedValue type:",typeof tt.selectedValue),console.log("Saved selectedValue is array:",Array.isArray(tt.selectedValue));let ot;return ve.id===2&&(nt=(rt=e==null?void 0:e.view)==null?void 0:rt.filterMultiple)!=null&&nt.categoryId?(ot=e.view.filterMultiple.categoryId,console.log("GSCtops - using filterMultiple.categoryId in initialization:",ot)):ve.id===1&&(vt=(ht=e==null?void 0:e.view)==null?void 0:ht.filterMultiple)!=null&&vt.category?(ot=e.view.filterMultiple.category,console.log("GSCComparativeReports - using filterMultiple.category in initialization:",ot)):ve.id===6&&(Ot=(mt=e==null?void 0:e.view)==null?void 0:mt.filterMultiple)!=null&&Ot.gameNumber?(ot=e.view.filterMultiple.gameNumber,console.log("GSCLineupsReports - using filterMultiple.gameNumber in initialization:",ot)):ot=Array.isArray(tt.selectedValue)?tt.selectedValue[0]:tt.selectedValue,console.log(`Returning select-simple value for filter ${Ye}:`,ot),ot}}if(ve.id===2&&u.value&&e!=null&&e.view){if(x&&e.view.id){const tt=x.getComponentDynamicFilters(e.view.id);if(tt&&tt[Ye]!==void 0)return console.log(`GSCtops - using component specific filter for index ${Ye}:`,tt[Ye]),tt[Ye]}if(e.view.filterMultiple){if(console.log("111 ************************************************************",e.view.filterMultiple),We.type==="select-simple"&&e.view.filterMultiple.categoryId){const tt=e.view.filterMultiple.categoryId,ot=(We.options||[]).find(Xe=>Xe.value==tt);return console.log("GSCtops - matching option in initialization:",ot),tt}if(We.type==="radio-button"&&e.view.filterMultiple.teamType!==void 0){const tt=e.view.filterMultiple.teamType;return(We.options||[]).find(ot=>ot.value==tt)?(console.log("GSCtops - returning teamType:",tt),tt):(console.log("GSCtops - no matching option found for teamType:",tt),console.log("GSCtops - returning teamType anyway for consistency:",tt),tt)}else console.log("GSCtops - radio-button condition not met:",{isRadioButton:We.type==="radio-button",hasTeamType:e.view.filterMultiple.teamType!==void 0,teamType:e.view.filterMultiple.teamType})}}if(ve.id===1&&u.value&&(Vt=e==null?void 0:e.view)!=null&&Vt.filterMultiple&&(console.log(`GSCComparativeReports - checking filterMultiple in initialization for filter ${Ye}:`,e.view.filterMultiple),e.view.filterMultiple.category)){const tt=e.view.filterMultiple.category,ot=(We.options||[]).find(Xe=>Xe.value==tt);return console.log("GSCComparativeReports - matching option in initialization:",ot),tt}if(ve.id===9&&u.value&&(qt=e==null?void 0:e.view)!=null&&qt.filterMultiple&&(console.log(`GSCFieldDataByZones - checking filterMultiple in initialization for filter ${Ye}:`,e.view.filterMultiple),We.type==="select-simple"&&e.view.filterMultiple.categoryIds)){const tt=Array.isArray(e.view.filterMultiple.categoryIds)?e.view.filterMultiple.categoryIds:[e.view.filterMultiple.categoryIds];console.log(`GSCFieldDataByZones - setting select-simple filter ${Ye} to categoryIds:`,tt),console.log("GSCFieldDataByZones - categoryIds type in initialization:",typeof tt),console.log("GSCFieldDataByZones - filter options in initialization:",We.options);const ot=(We.options||[]).filter(Xe=>Array.isArray(Xe.value)?Ce(Xe.value,tt):tt.includes(Xe.value));if(ot.length>0){const Xe=ot[0];return console.log("GSCFieldDataByZones - found matching option in initialization:",Xe),Xe.value}else return console.log("GSCFieldDataByZones - no matching options found, using categoryIds directly:",tt),tt}if(ve.id===6&&u.value&&(st=e==null?void 0:e.view)!=null&&st.filterMultiple&&(console.log(`GSCLineupsReports - checking filterMultiple in initialization for filter ${Ye}:`,e.view.filterMultiple),e.view.filterMultiple.gameNumber)){const tt=e.view.filterMultiple.gameNumber;console.log(`GSCLineupsReports - setting select-simple filter ${Ye} to gameNumber:`,tt),console.log("GSCLineupsReports - gameNumber type in initialization:",typeof tt),console.log("GSCLineupsReports - filter options in initialization:",We.options);const ot=(We.options||[]).find(Xe=>Xe.value==tt);return console.log("GSCLineupsReports - matching option in initialization:",ot),tt}if(ve.id===5&&u.value&&($e=e==null?void 0:e.view)!=null&&$e.filterMultiple&&(console.log(`GSCVolumetricField - checking filterMultiple in initialization for filter ${Ye}:`,e.view.filterMultiple),console.log("GSCVolumetricField - filter details:",{type:We.type,label:We.label,options:We.options}),e.view.filterMultiple.isHomeTeam!==void 0)){const tt=e.view.filterMultiple.isHomeTeam;console.log(`GSCVolumetricField - setting radio-button filter ${Ye} to isHomeTeam:`,tt),console.log("GSCVolumetricField - isHomeTeam type in initialization:",typeof tt),console.log("GSCVolumetricField - filter options in initialization:",We.options);let ot;typeof tt=="boolean"?(ot=tt?1:2,console.log("GSCVolumetricField - isHomeTeam is boolean in initialization, converting:",tt,"-> teamValue:",ot)):typeof tt=="number"?(ot=tt===1?1:2,console.log("GSCVolumetricField - isHomeTeam is number in initialization, using directly:",tt,"-> teamValue:",ot)):(ot=1,console.log("GSCVolumetricField - isHomeTeam is unknown type in initialization, using default:",ot));const Xe=(We.options||[]).find(ct=>ct.value==ot);if(console.log("GSCVolumetricField - matching option in initialization:",Xe),We.type==="radio-button"&&(We.label==="Equipo"||We.label==="Team"||We.label==="Equipo seleccionado"))return console.log("GSCVolumetricField - applying team filter value:",ot),ot;console.log("GSCVolumetricField - filter is not a team filter, skipping:",We.label)}if(ve.id===9&&u.value&&(lt=e==null?void 0:e.view)!=null&<.filterMultiple&&(console.log(`GSCFieldDataByZones - checking filterMultiple in initialization for filter ${Ye}:`,e.view.filterMultiple),We.type==="radio-button"&&e.view.filterMultiple.isHomeTeam!==void 0)){const tt=e.view.filterMultiple.isHomeTeam,ot=tt?1:2;console.log(`GSCFieldDataByZones - setting radio-button filter ${Ye} to team value:`,ot,"isHomeTeam:",tt),console.log("GSCFieldDataByZones - filter options:",We.options);const Xe=((pt=We.options)==null?void 0:pt.map(ct=>ct.value))||[];return Xe.includes(ot)?(console.log("GSCFieldDataByZones - using valid team value from filterMultiple:",ot),ot):(console.log("GSCFieldDataByZones - team value not in valid options, using default:",Xe[0]),Xe[0]||1)}return((_t=(At=We.options)==null?void 0:At[0])==null?void 0:_t.value)??null}else if(We.type==="check"){if(u.value&&v&&v.dynamicFilters){const tt=v.dynamicFilters[Ye];if(tt&&tt.isChecked!==void 0)return console.log(`Using saved checkbox value for filter ${Ye}:`,tt.isChecked),tt.isChecked}if(ve.id===8)return!0;if(ve.id===3){if(u.value&&v&&v.dynamicFilters){const tt=v.dynamicFilters[Ye];if(tt&&tt.isChecked!==void 0)return console.log(`GSCMatchSummary - Using saved checkbox value for filter ${Ye}:`,tt.isChecked),tt.isChecked}return!1}return!1}return null}),console.log("dynamicFilters initialized to:",m.value));const Ve=((me=ve.name)==null?void 0:me.toLowerCase().includes("tops players"))||((De=ve.title)==null?void 0:De.toLowerCase().includes("tops players"));!Ve&&(!u.value||Ie)&&p.nextTick(()=>{var We,Ye,ke;console.log("Timeline - about to emit change:",{esTopsPlayers:Ve,isEditMode:u.value,selectedSecond:(We=f.value)==null?void 0:We.id}),ve.id===4&&u.value&&(Ye=e==null?void 0:e.view)!=null&&Ye.id&&(console.log("Timeline - saving specific filters for component:",e.view.id),x&&x.setDynamicFilters(m.value,e.view.id)),ve.id===3&&u.value&&(ke=e==null?void 0:e.view)!=null&&ke.id&&(console.log("GSCMatchSummary - saving specific filters for component:",e.view.id),x&&x.setDynamicFilters(m.value,e.view.id)),he()})},{immediate:!0}),p.watch(()=>x,ve=>{ve&&ve.dynamicFilters&&(console.log("FilterAndViewsContainer changed, updating dynamicFilters:",ve.dynamicFilters),Array.isArray(ve.dynamicFilters)&&(y.value=!0,m.value=[...ve.dynamicFilters],p.nextTick(()=>{y.value=!1})))},{deep:!0}),p.watch(()=>x==null?void 0:x.dynamicFilters,ve=>{if(ve&&Array.isArray(ve)){if(console.log("Container dynamicFilters changed, updating:",ve),b.value){console.log("Skipping container update due to user update in progress");return}y.value=!0,m.value=[...ve],p.nextTick(()=>{y.value=!1})}},{deep:!0}),p.watch(()=>f.value,ve=>{if(u.value&&v&&ve&&ve.filters){if(y.value)return;if(h.value){console.log("Skipping force updates in selectedSecond watcher - already in force update");return}if(ve.id===3){if(console.log("GSCMatchSummary detected in edit mode, loading saved filters"),b.value||h.value){console.log("GSCMatchSummary - Skipping due to update in progress");return}const me=v.dynamicFilters.find(De=>De.filterType==="check");me&&me.isChecked!==void 0&&(console.log("GSCMatchSummary - Found saved checkbox value:",me.isChecked),m.value&&m.value.length>0&&(b.value=!0,m.value[0]=me.isChecked,console.log("GSCMatchSummary - Updated dynamicFilters:",m.value),p.nextTick(()=>{m.value=[...m.value],console.log("GSCMatchSummary - Forced UI update"),b.value=!1})))}setTimeout(()=>{(!m.value||m.value.length===0)&&(Ne(),Pe(),je()),ve.id===4&&Re()},100)}},{deep:!0}),p.watch(()=>{var ve;return(ve=f.value)==null?void 0:ve.id},ve=>{if(u.value&&v&&ve===4){if(console.log("Timeline detected, preselecting filters"),y.value)return;if(h.value){console.log("Skipping force updates in Timeline watcher - already in force update");return}setTimeout(()=>{Re()},200)}}),p.watch(()=>m.value,ve=>{if(u.value&&v&&ve&&ve.length>0){if(console.log("(((((((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))",v),console.log("Dynamic filters initialized, forcing update"),y.value||b.value)return;if(h.value){console.log("Skipping force updates - already in force update");return}setTimeout(()=>{var me;ge()&&(Ne(),Pe(),je(),((me=f.value)==null?void 0:me.id)===4&&Re())},50)}},{deep:!0});function E(ve,me){var De,Ie,Ve,We,Ye;const ke=m.value[ve];if(((De=f.value)==null?void 0:De.id)===4&&ve===0&&console.log("Timeline filter check - optionValue:",me,"selectedValues:",ke),((Ie=f.value)==null?void 0:Ie.id)===6&&ve===0&&console.log("GSCLineupsReports filter check - optionValue:",me,"selectedValues:",ke,"type:",typeof ke),Array.isArray(ke)){if(((Ve=f.value)==null?void 0:Ve.id)===4&&ve===0){const ze=ke.some(Fe=>{if(me.category_id&&me.event_type_id){if(Fe.category_id&&Fe.event_type_id)return Fe.category_id===me.category_id&&Fe.event_type_id===me.event_type_id;if(Fe.event_type_id&&!Fe.category_id)return Fe.event_type_id===me.event_type_id;if(Fe.category_id&&!Fe.event_type_id)return Fe.category_id===me.category_id}else{if(me.event_type_id)return Fe.event_type_id===me.event_type_id;if(me.category_id)return Fe.category_id===me.category_id}return JSON.stringify(Fe)===JSON.stringify(me)});return((We=f.value)==null?void 0:We.id)===4&&ve===0&&console.log("Timeline comparison (IDs) - optionValue:",me,"selectedValues:",ke,"isSelected:",ze),ze}return ke.includes(me)}else if(ke!=null){if(((Ye=f.value)==null?void 0:Ye.id)===6&&ve===0){const ze=ke===me;return console.log("GSCLineupsReports comparison - optionValue:",me,"selectedValues:",ke,"isSelected:",ze),ze}return ke===me}return!1}function S(ve,me){var De,Ie,Ve;const We=(Ie=(De=f.value)==null?void 0:De.filters)==null?void 0:Ie[ve];if((We==null?void 0:We.type)==="select-simple"){console.log("toggleMultiSelectOption called for select-simple filter, using selectSimpleOption instead"),ae(ve,me);return}Array.isArray(m.value[ve])||(m.value[ve]=[]);const Ye=m.value[ve];console.log("*************************************** selectedSecond:::: ",f);let ke=-1;((Ve=f.value)==null?void 0:Ve.id)===4&&ve===0?ke=Ye.findIndex(ze=>me.category_id&&me.event_type_id?ze.category_id===me.category_id&&ze.event_type_id===me.event_type_id:me.event_type_id?ze.event_type_id===me.event_type_id:me.category_id?ze.category_id===me.category_id:!1):ke=Ye.indexOf(me),ke>-1?Ye.splice(ke,1):Ye.push(me),u.value&&Oe(),he()}function P(ve){var me,De;const Ie=m.value[ve],Ve=(De=(me=f.value)==null?void 0:me.filters)==null?void 0:De[ve];return(Ve==null?void 0:Ve.type)==="select-simple"||!Ve||!Ve.options||!Array.isArray(Ie)?!1:Ie.length===Ve.options.length}function N(ve){var me,De;const Ie=m.value[ve],Ve=(De=(me=f.value)==null?void 0:me.filters)==null?void 0:De[ve];return(Ve==null?void 0:Ve.type)==="select-simple"||!Ve||!Ve.options||!Array.isArray(Ie)?!1:Ie.length>0&&Ie.length<Ve.options.length}function A(){var ve;return console.log("props.isPostMatch",B.isPostMatch),!(((ve=f.value)==null?void 0:ve.id)===6&&B.isPostMatch)}function O(ve){return!ve||!Array.isArray(ve)?ve:ve.filter(me=>{const De=(me.name||me.title||"").toLowerCase();return B.isPostMatch?B.isPostMatch?!["fortalezas","tabla general"].some(Ie=>De.includes(Ie)):!0:!["resumen general","timeline","datos relevantes"].some(Ie=>De.includes(Ie))})}function M(){var ve,me;const De=((me=(ve=d.value)==null?void 0:ve.name)==null?void 0:me.toLowerCase())||"";return De.includes("cancha")||De.includes("volumétrica")||De.includes("volumetric")}function k(ve,me){if(!u.value||!M())return!1;const De=String(ve||"").toLowerCase(),Ie=String(me||"").toLowerCase();return De.includes("ambos")||Ie.includes("ambos")}function I(ve){var me,De;const Ie=(De=(me=f.value)==null?void 0:me.filters)==null?void 0:De[ve];if(!Ie||!Ie.options)return;const Ve=Ie.options.map(We=>We.value);Array.isArray(m.value[ve])||(m.value[ve]=[]),P(ve)?m.value[ve]=[]:m.value[ve]=[...Ve],V.value=ve,he()}const _=p.ref("ambos"),R=p.ref(!1),z=p.ref(!1),V=p.ref(null),U=p.ref(null);function q(ve,me=!1){const De="https://golstatsimages.blob.core.windows.net/images-library/",Ie="https://golstatsimages.blob.core.windows.net/reports-images/",Ve={cancha:"icn_cancha",grafico:"icn_grafico",gráfico:"icn_grafico",chart:"icn_grafico",volumetrica:"icn_cancha",volumétrica:"icn_cancha",volumetric:"icn_cancha",tabla:"icn_tabla",tablas:"icn_tabla",Tablas:"icn_tabla"},We=Object.keys(Ve).find(Ye=>ve==null?void 0:ve.toLowerCase().includes(Ye.toLowerCase()));if(We){const Ye=Ve[We],ke=me?"":"-def";return We.toLowerCase().includes("tabla")?`${Ie}${Ye}${ke}@2x.png`:`${De}${Ye}${ke}@2x.png`}return`${De}icn_default${me?"":"-def"}.png`}function W(){return d.value?d.value.name:"Tipo de vista"}function Z(){return f.value?f.value.name||f.value.title:"Visualización"}function ne(){u.value||(R.value=!R.value,R.value&&(z.value=!1,p.nextTick(()=>{Se()})))}function X(){u.value||d.value&&(z.value=!z.value,z.value&&(R.value=!1))}function re(ve){u.value||(i.value=ve,R.value=!1,c.value=null,he())}function ee(ve){var me,De;u.value||(c.value=ve.id,z.value=!1,(me=ve.name)!=null&&me.toLowerCase().includes("tops players")||(De=ve.title)==null||De.toLowerCase().includes("tops players"))}function K(ve){var me;V.value=V.value===ve?null:ve,((me=f.value)==null?void 0:me.id)===4&&u.value&&ve===0&&(console.log("Timeline dropdown opened, forcing checkbox update"),setTimeout(()=>{m.value=[...m.value]},50))}function te(ve){U.value=U.value===ve?null:ve}function ae(ve,me){var De,Ie,Ve,We,Ye,ke;if(console.log("selectSimpleOption called:",{idx:ve,optionValue:me,isEditMode:u.value}),((De=f.value)==null?void 0:De.id)===2){console.log("GSCtops - selectSimpleOption for GSCtops");const ze=T.value.findIndex(Fe=>Fe.type==="select-simple"&&Fe.label==="Tipo de análisis");ve===ze?(m.value[0]=me,console.log("GSCtops - updated dynamicFilters[0] (category) to:",me)):(m.value[ve]=me,console.log("GSCtops - updated dynamicFilters["+ve+"] to:",me))}else if(((Ie=f.value)==null?void 0:Ie.id)===1)console.log("GSCComparativeReports - selectSimpleOption for GSCComparativeReports"),m.value[0]=me,console.log("GSCComparativeReports - updated dynamicFilters[0] (analysis type) to:",me);else if(((Ve=f.value)==null?void 0:Ve.id)===6)console.log("GSCLineupsReports - selectSimpleOption for GSCLineupsReports"),m.value[0]=me,console.log("GSCLineupsReports - updated dynamicFilters[0] (game number) to:",me);else if(((We=f.value)==null?void 0:We.id)===9)if(console.log("GSCFieldDataByZones - selectSimpleOption for GSCFieldDataByZones"),ve===0){Array.isArray(me)?(m.value[ve]=me,console.log("GSCFieldDataByZones - updated dynamicFilters[0] (categories) to:",me)):(m.value[ve]=[me],console.log("GSCFieldDataByZones - converted to array and updated dynamicFilters[0] (categories) to:",[me]));const ze=((Ye=T.value[ve])==null?void 0:Ye.options)||[];console.log("GSCFieldDataByZones - filterOptions for comparison:",ze);const Fe=Array.isArray(me)?me:[me],He=ze.find(rt=>Array.isArray(rt.value)?Ce(rt.value,Fe):Fe.includes(rt.value));console.log("GSCFieldDataByZones - matching option found:",He),He?(console.log("GSCFieldDataByZones - using matching option value:",He.value),m.value[ve]=He.value,console.log("GSCFieldDataByZones - updated dynamicFilters["+ve+"] to matching option value:",He.value)):(console.log("GSCFieldDataByZones - no matching option found, using selectedValue directly"),m.value[ve]=Fe)}else m.value[ve]=me,console.log("GSCFieldDataByZones - updated dynamicFilters["+ve+"] to:",me);else m.value[ve]=me;U.value=null,console.log("dynamicFilters after selectSimpleOption:",m.value),((ke=f.value)==null?void 0:ke.id)===6&&(console.log("GSCLineupsReports - selectSimpleOption called"),console.log("GSCLineupsReports - isEditMode:",u.value),console.log("GSCLineupsReports - viewToEdit:",e),console.log("GSCLineupsReports - dynamicFilters:",m.value)),u.value&&(console.log("calling updateContainerOnUserChange"),console.log("isEditMode.value:",u.value),console.log("viewToEdit:",e),console.log("filterAndViewsContainer:",x),Oe()),console.log("calling emitChange"),he()}function oe(ve){ve.target.closest(".custom-select")||(R.value=!1,z.value=!1,U.value=null)}function he(){var ve,me,De,Ie,Ve,We,Ye,ke,ze,Fe,He,rt,nt,ht,vt,mt,Ot,Vt,qt,st,$e,lt,pt,At,_t,tt,ot,Xe,ct,kt;if(console.log("emitChange called"),console.log("isEditMode.value:",u.value),console.log("viewToEdit:",e),console.log("dynamicFilters.value:",m.value),y.value){console.log("Skipping emitChange due to container update in progress");return}((ve=f.value)==null?void 0:ve.id)===8&&(console.log("FieldPosesion detected - dynamicFilters:",m.value),console.log("Current filters:",T.value)),((me=f.value)==null?void 0:me.id)===4&&(console.log("Timeline detected - dynamicFilters:",m.value),console.log("Current filters:",T.value),console.log("Timeline - will emit change:",!y.value)),((De=f.value)==null?void 0:De.id)===2&&(console.log("GSCtops detected - dynamicFilters:",m.value),console.log("Current filters:",T.value),console.log("GSCtops - will emit change:",!y.value)),((Ie=f.value)==null?void 0:Ie.id)===6&&(console.log("GSCLineupsReports detected - dynamicFilters:",m.value),console.log("Current filters:",T.value),console.log("GSCLineupsReports - will emit change:",!y.value),console.log("GSCLineupsReports - isEditMode:",u.value),console.log("GSCLineupsReports - viewToEdit:",e)),((Ve=f.value)==null?void 0:Ve.id)===9&&(console.log("GSCFieldDataByZones detected - dynamicFilters:",m.value),console.log("Current filters:",T.value),console.log("GSCFieldDataByZones - will emit change:",!y.value),console.log("GSCFieldDataByZones - isEditMode:",u.value),console.log("GSCFieldDataByZones - viewToEdit:",e));let yt=[],It=[];f.value&&Array.isArray(T.value)&&T.value.forEach((bt,Lt)=>{if(bt.type==="select"&&bt.label==="Tipo de análisis"&&bt.id===2){const Rt=m.value[Lt]||[];Array.isArray(Rt)&&Rt.length>0&&(yt=Rt.map(St=>{var Ht;const Ut=(Ht=bt.options)==null?void 0:Ht.find(Yt=>Yt.value===St);return{value:St,label:(Ut==null?void 0:Ut.label)||St}}))}});const Nt=((We=f.value)==null?void 0:We.id)===4;if(f.value&&Array.isArray(f.value.filters)&&f.value.filters.some(bt=>bt.type==="select"&&bt.label==="Tipo de análisis"&&bt.id===2)&&yt.length===0&&!Nt)return;if(Nt&&m.value&&m.value.length>0){const bt=m.value[0];Array.isArray(bt)&&bt.length>0&&console.log("Timeline - emitting change with events:",bt)}It=((Ye=T.value)==null?void 0:Ye.map((bt,Lt)=>{var Rt,St,Ht,Ut,Yt;const Wt=m.value[Lt];((Rt=f.value)==null?void 0:Rt.id)===8&&console.log(`FieldPosesion filter ${Lt}:`,{type:bt.type,label:bt.label,selectedValue:Wt,selectedValueType:typeof Wt,isRadioButton:bt.type==="radio-button"});let Gt=bt.id||`filter_${Lt}`;return((St=f.value)==null?void 0:St.id)===3&&u.value&&(Ht=e==null?void 0:e.view)!=null&&Ht.id&&(Gt=`filter_${Lt}_component_${e.view.id}`,console.log(`GSCMatchSummary - Generated unique filterId: ${Gt} for component ${e.view.id}`)),{filterId:Gt,filterType:bt.type,filterLabel:bt.label,filterIcon:bt.icon||null,selectedValue:Wt,selectedOptions:bt.type==="select"&&Array.isArray(Wt)&&Wt.length>0?Wt.map(rr=>{var ir;const mr=(ir=bt.options)==null?void 0:ir.find(kr=>kr.value===rr);return{value:rr,label:(mr==null?void 0:mr.label)||rr,icon:(mr==null?void 0:mr.icon)||null}}):null,selectedOption:bt.type==="radio-button"&&Wt!=null?{value:Wt,label:((Yt=(Ut=bt.options)==null?void 0:Ut.find(rr=>rr.value===Wt))==null?void 0:Yt.label)||Wt}:null,isChecked:bt.type==="check"?Wt:null}}))||[];const Ze={mainSelector:{id:((ke=d.value)==null?void 0:ke.id)||null,name:((ze=d.value)==null?void 0:ze.name)||null,url:((Fe=d.value)==null?void 0:Fe.url)||null},viewSelector:{id:((He=f.value)==null?void 0:He.id)||null,name:((rt=f.value)==null?void 0:rt.name)||((nt=f.value)==null?void 0:nt.title)||null,url:((ht=f.value)==null?void 0:ht.url)||null},team:_.value,dynamicFilters:It,categoriasSeleccionadas:yt,timestamp:new Date().toISOString(),summary:{mainSelected:!!d.value,viewSelected:!!f.value,totalDynamicFilters:((vt=T.value)==null?void 0:vt.length)||0,activeFilters:((mt=T.value)==null?void 0:mt.filter((bt,Lt)=>{const Rt=m.value[Lt];return Array.isArray(Rt)?Rt.length>0:Rt!=null&&Rt!==!1}).length)||0}};e&&(console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"),console.log("viewToEdit.view.filterAndViewsContainer",e.view.filterAndViewsContainer),console.log("viewToEdit.view.filterAndViewsContainer.childViews.length",e.view.filterAndViewsContainer.childViews.length));const et={main:d.value,view:f.value,team:_.value,dynamicFilters:m.value,filtersJSON:Ze,filterAndViewsContainer:x,viewToEdit:e};if(console.log("GSCtops - emitting filters-changed with data:",et),J("filters-changed",et),u.value&&e){if(v=Ze,console.log("Updated editFiltersJSON:",v),((Ot=f.value)==null?void 0:Ot.id)===8&&(console.log("FieldPosesion - editFiltersJSON updated:",v),console.log("FieldPosesion - dynamicFilters in JSON:",v.dynamicFilters)),((Vt=f.value)==null?void 0:Vt.id)===2){console.log("GSCtops - editFiltersJSON updated:",v),console.log("GSCtops - dynamicFilters in JSON:",v.dynamicFilters),console.log("GSCtops - viewToEdit.filterMultiple:",(qt=e.view)==null?void 0:qt.filterMultiple);const bt=v.dynamicFilters.findIndex(Lt=>Lt.filterType==="select-simple"&&Lt.filterLabel==="Tipo de análisis");bt!==-1&&($e=(st=e.view)==null?void 0:st.filterMultiple)!=null&&$e.categoryId&&(v.dynamicFilters[bt].selectedValue=e.view.filterMultiple.categoryId,console.log("GSCtops - updated editFiltersJSON with filterMultiple.categoryId:",e.view.filterMultiple.categoryId))}if(((lt=f.value)==null?void 0:lt.id)===1){console.log("GSCComparativeReports - editFiltersJSON updated:",v),console.log("GSCComparativeReports - dynamicFilters in JSON:",v.dynamicFilters),console.log("GSCComparativeReports - viewToEdit.filterMultiple:",(pt=e.view)==null?void 0:pt.filterMultiple);const bt=v.dynamicFilters.findIndex(Lt=>Lt.filterType==="select-simple"&&Lt.filterLabel==="Tipo de análisis");bt!==-1&&(_t=(At=e.view)==null?void 0:At.filterMultiple)!=null&&_t.category&&(v.dynamicFilters[bt].selectedValue=e.view.filterMultiple.category,console.log("GSCComparativeReports - updated editFiltersJSON with filterMultiple.category:",e.view.filterMultiple.category))}}if(((tt=f.value)==null?void 0:tt.id)===6&&u.value&&(ot=e==null?void 0:e.view)!=null&&ot.filterMultiple&&(console.log("GSCLineupsReports - viewToEdit.filterMultiple:",(Xe=e.view)==null?void 0:Xe.filterMultiple),e.view.filterMultiple.gameNumber&&v)){const bt=v.dynamicFilters.findIndex(Lt=>Lt.filterType==="select-simple"&&Lt.filterLabel==="Número de juego");bt!==-1&&(kt=(ct=e.view)==null?void 0:ct.filterMultiple)!=null&&kt.gameNumber&&(v.dynamicFilters[bt].selectedValue=e.view.filterMultiple.gameNumber,console.log("GSCLineupsReports - updated editFiltersJSON with filterMultiple.gameNumber:",e.view.filterMultiple.gameNumber))}x&&!u.value?(x.setDynamicFilters(m.value),console.log("Updated container with new dynamicFilters:",m.value)):x&&u.value&&console.log("In edit mode, not updating container automatically")}function fe(){e=null,v=null,x=null,i.value=null,c.value=null,_.value="ambos",m.value=[],R.value=!1,z.value=!1,V.value=null,U.value=null,u.value=!1,t.value=!1,w.value=!1}function se(ve){if(ve&&ve.dynamicFilters){if(console.log("Updating filters from container:",ve.dynamicFilters),b.value){console.log("Skipping container update due to user update in progress");return}Array.isArray(ve.dynamicFilters)&&ve.dynamicFilters.length>0&&(y.value=!0,m.value=[...ve.dynamicFilters],p.nextTick(()=>{y.value=!1}))}}function ue(ve){if(console.log("preselectFiltersFromJSON called with:",ve),u.value=!0,ve.mainSelector&&ve.mainSelector.id){const me=C.value.findIndex(De=>De.id===ve.mainSelector.id);me!==-1&&(i.value=me,console.log("Selected main index:",me))}ve.viewSelector&&ve.viewSelector.id&&d.value&&d.value.views.findIndex(me=>me.id===ve.viewSelector.id)!==-1&&(c.value=ve.viewSelector.id,console.log("Selected second id:",ve.viewSelector.id)),ve.dynamicFilters&&Array.isArray(ve.dynamicFilters)&&(console.log("Processing dynamic filters:",ve.dynamicFilters),p.nextTick(()=>{setTimeout(()=>{var me,De,Ie,Ve,We,Ye,ke,ze,Fe,He,rt,nt,ht,vt,mt,Ot,Vt,qt,st,$e,lt,pt,At,_t,tt,ot,Xe,ct,kt,yt,It;if(console.log("Processing filters after delay"),console.log("selectedSecond.value:",f.value),f.value&&T.value){if(console.log("Filters available:",T.value),y.value){console.log("Skipping preselect due to container update in progress");return}if(b.value=!0,console.log("&666&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&",ve.dynamicFilters),ve.dynamicFilters.forEach((Nt,Ze)=>{var et,bt,Lt,Rt,St,Ht,Ut,Yt,Wt,Gt,rr,ir,mr,kr;if(Ze<T.value.length){const wr=T.value[Ze];if(((et=f.value)==null?void 0:et.id)===3&&u.value&&console.log(`GSCMatchSummary - Processing filter ${Ze} for component ${((bt=e==null?void 0:e.view)==null?void 0:bt.id)||"unknown"}`),wr.type==="check"){const ar=Nt.isChecked;console.log(`Setting check filter ${Ze} to:`,ar),typeof ar=="boolean"?(m.value[Ze]=ar,console.log(`Successfully set check filter ${Ze} to:`,ar)):console.log(`Invalid isChecked value for filter ${Ze}:`,ar)}else if(wr.type==="select"&&Nt.selectedOptions){const ar=Nt.selectedOptions.map(xr=>xr.value);console.log(`Setting select filter ${Ze} to:`,ar),m.value[Ze]=ar,console.log(`Successfully set select filter ${Ze} to:`,ar)}else if(wr.type==="select"&&Nt.selectedValue&&Array.isArray(Nt.selectedValue))if(Nt.selectedValue.length>0&&Nt.selectedValue[0]&&typeof Nt.selectedValue[0]=="object"){const ar=Ge(Nt.selectedValue);console.log(`Setting Timeline select filter ${Ze} to:`,ar),m.value[Ze]=ar,console.log(`Successfully set Timeline select filter ${Ze} to:`,ar)}else console.log(`Setting select filter ${Ze} to:`,Nt.selectedValue),m.value[Ze]=Nt.selectedValue,console.log(`Successfully set select filter ${Ze} to:`,Nt.selectedValue);else if(wr.type==="radio-button"&&Nt.selectedOption)console.log(`Setting radio filter ${Ze} to:`,Nt.selectedOption.value),m.value[Ze]=Nt.selectedOption.value;else if(wr.type==="select-simple"&&Nt.selectedValue!==void 0){console.log(`Setting select-simple filter ${Ze} to:`,Nt.selectedValue),console.log("select-simple filterData.selectedValue type:",typeof Nt.selectedValue),console.log("select-simple filterData.selectedValue is array:",Array.isArray(Nt.selectedValue));let ar;((Lt=f.value)==null?void 0:Lt.id)===2&&(St=(Rt=e==null?void 0:e.view)==null?void 0:Rt.filterMultiple)!=null&&St.categoryId?(ar=e.view.filterMultiple.categoryId,console.log("GSCtops - using filterMultiple.categoryId instead of selectedValue:",ar)):((Ht=f.value)==null?void 0:Ht.id)===1&&(Yt=(Ut=e==null?void 0:e.view)==null?void 0:Ut.filterMultiple)!=null&&Yt.category?(ar=e.view.filterMultiple.category,console.log("GSCComparativeReports - using filterMultiple.category instead of selectedValue:",ar)):((Wt=f.value)==null?void 0:Wt.id)===6&&(rr=(Gt=e==null?void 0:e.view)==null?void 0:Gt.filterMultiple)!=null&&rr.gameNumber?(ar=e.view.filterMultiple.gameNumber,console.log("GSCLineupsReports - using filterMultiple.gameNumber instead of selectedValue:",ar)):((ir=f.value)==null?void 0:ir.id)===9&&(kr=(mr=e==null?void 0:e.view)==null?void 0:mr.filterMultiple)!=null&&kr.categoryIds?(ar=e.view.filterMultiple.categoryIds,console.log("GSCFieldDataByZones - using filterMultiple.categoryIds instead of selectedValue:",ar)):ar=Array.isArray(Nt.selectedValue)?Nt.selectedValue[0]:Nt.selectedValue,m.value[Ze]=ar,console.log(`Successfully set select-simple filter ${Ze} to:`,ar)}}else console.log(`Filter index ${Ze} out of range`)}),console.log("Final dynamicFilters.value:",m.value),((me=f.value)==null?void 0:me.id)===3&&u.value&&console.log("GSCMatchSummary - Final dynamicFilters after processing:",m.value),((De=f.value)==null?void 0:De.id)===2&&u.value&&(Ie=e==null?void 0:e.view)!=null&&Ie.filterMultiple){if(console.log("GSCtops - checking filterMultiple after preselecting filters:",e.view.filterMultiple),console.log("GSCtops - currentFilters:",T.value),console.log("GSCtops - dynamicFilters before:",m.value),e.view.filterMultiple.categoryId){console.log("GSCtops - found categoryId in filterMultiple:",e.view.filterMultiple.categoryId);const Nt=T.value.findIndex(Ze=>Ze.type==="select-simple"&&Ze.label==="Tipo de análisis");if(console.log("GSCtops - categoryFilterIndex:",Nt),console.log("GSCtops - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("GSCtops - found category filter at index:",Nt);const Ze=e.view.filterMultiple.categoryId;if(console.log("GSCtops - setting category filter directly from filterMultiple.categoryId:",Ze),m.value[0]=Ze,e.view.componentProps&&Ze){let bt=`Category ${Ze}`,Lt=null;try{Lt=Vd(Ze),Lt&&(bt=Lt.name,console.log("GSCtops - found category info from getCategoryById in preselectFiltersFromJSON:",Lt))}catch{console.log("GSCtops - getCategoryById failed in preselectFiltersFromJSON, using filter options");const Rt=T.value.findIndex(St=>St.type==="select-simple"&&St.label==="Tipo de análisis");if(Rt!==-1){const St=(((Ve=T.value[Rt])==null?void 0:Ve.options)||[]).find(Ht=>Ht.value==Ze);St&&(bt=St.label,console.log("GSCtops - found category name from options in preselectFiltersFromJSON:",bt))}}e.view.componentProps.categoryView=[{id:Ze,name:bt}],console.log("GSCtops - updated componentProps.categoryView in preselectFiltersFromJSON:",e.view.componentProps.categoryView)}console.log("GSCtops - automatically set category filter to:",Ze),console.log("GSCtops - categoryId type:",typeof Ze),console.log("GSCtops - updated dynamicFilters:",m.value),console.log("GSCtops - filter options:",(We=T.value[Nt])==null?void 0:We.options);const et=(((Ye=T.value[Nt])==null?void 0:Ye.options)||[]).find(bt=>bt.value==Ze);console.log("GSCtops - matching option:",et),p.nextTick(()=>{m.value=[...m.value],console.log("GSCtops - forced reactivity update")})}else console.log("GSCtops - category filter not found!")}if(e.view.filterMultiple.teamType!==void 0){console.log("GSCtops - found teamType in filterMultiple:",e.view.filterMultiple.teamType),console.log("MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM ------------------------------------> ",T.value);const Nt=T.value.findIndex(Ze=>Ze.type==="radio-button");if(console.log("GSCtops - teamFilterIndex:",Nt),console.log("GSCtops - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("GSCtops - found team filter at index:",Nt);const Ze=e.view.filterMultiple.teamType;console.log("GSCtops - setting team filter directly from filterMultiple.teamType:",Ze),m.value[Nt]=Ze,console.log("GSCtops - automatically set team filter to:",Ze),console.log("GSCtops - teamType type:",typeof Ze),console.log("GSCtops - updated dynamicFilters:",m.value),console.log("GSCtops - filter options:",(ke=T.value[Nt])==null?void 0:ke.options);const et=(((ze=T.value[Nt])==null?void 0:ze.options)||[]).find(bt=>bt.value==Ze);console.log("GSCtops - matching option for team:",et),p.nextTick(()=>{m.value=[...m.value],console.log("GSCtops - forced reactivity update for team filter")})}else console.log("GSCtops - team filter not found!")}}if(((Fe=f.value)==null?void 0:Fe.id)===9&&u.value&&(He=e==null?void 0:e.view)!=null&&He.filterMultiple){if(console.log("55555 GSCFieldDataByZones - checking filterMultiple after preselecting filters:",e.view.filterMultiple),console.log("55555 GSCFieldDataByZones - currentFilters:",T.value),console.log(" 55555GSCFieldDataByZones - dynamicFilters before:",m.value),e.view.filterMultiple.categoryIds){console.log("55555 GSCFieldDataByZones - found categoryIds in filterMultiple:",e.view.filterMultiple.categoryIds);const Nt=T.value.findIndex(Ze=>Ze.type==="select-simple");if(console.log("55555 GSCFieldDataByZones - analysisTypeFilterIndex:",Nt),console.log("55555 GSCFieldDataByZones - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("55555 GSCFieldDataByZones - found analysis type filter at index:",Nt);const Ze=Array.isArray(e.view.filterMultiple.categoryIds)?e.view.filterMultiple.categoryIds:[e.view.filterMultiple.categoryIds];console.log("55555 GSCFieldDataByZones - setting category filter directly from filterMultiple.categoryIds:",Ze),m.value[0]=Ze,console.log("55555 GSCFieldDataByZones - automatically set category filter to:",Ze),console.log("55555 GSCFieldDataByZones - categoryIds type:",typeof Ze),console.log("55555 GSCFieldDataByZones - categoryIds is array:",Array.isArray(Ze)),console.log("55555 GSCFieldDataByZones - updated dynamicFilters:",m.value),console.log("55555 GSCFieldDataByZones - filter options:",(rt=T.value[Nt])==null?void 0:rt.options);const et=((nt=T.value[Nt])==null?void 0:nt.options)||[];console.log("55555 filterOptions :",et);const bt=et.filter(St=>Array.isArray(St.value)?Ce(St.value,Ze):Ze.includes(St.value));if(console.log("55555 GSCFieldDataByZones - matching options:",bt),bt.length>0){const St=bt[0];console.log("55555 GSCFieldDataByZones - found matching option:",St);const Ht=St.value;console.log("55555 GSCFieldDataByZones - using option value:",Ht),m.value[Nt]=Ht,console.log("55555 GSCFieldDataByZones - set dynamicFilters["+Nt+"] to option value:",Ht)}else console.log("55555 GSCFieldDataByZones - no matching options found, using categoryIds directly"),m.value[Nt]=Ze;const Lt=m.value[Nt],Rt=Ce(Lt,Ze);console.log("55555 GSCFieldDataByZones - arrays match:",Rt),console.log("55555 GSCFieldDataByZones - current filter value:",Lt,"categoryIds:",Ze),p.nextTick(()=>{m.value=[...m.value],console.log("55555 GSCFieldDataByZones - forced reactivity update")})}else console.log("55555 GSCFieldDataByZones - analysis type filter not found!")}if(e.view.filterMultiple.isHomeTeam!==void 0){console.log("444444444 GSCFieldDataByZones - found isHomeTeam in filterMultiple:",e.view.filterMultiple.isHomeTeam);const Nt=T.value.findIndex(Ze=>Ze.type==="radio-button");if(console.log("444444444 GSCFieldDataByZones - teamFilterIndex:",Nt),console.log("444444444 GSCFieldDataByZones - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("444444444 GSCFieldDataByZones - found team filter at index:",Nt);const Ze=e.view.filterMultiple.isHomeTeam;console.log("444444444 GSCFieldDataByZones - isHomeTeam type:",typeof Ze,"value:",Ze);let et;typeof Ze=="boolean"?(et=Ze?1:2,console.log("444444444 GSCFieldDataByZones - converted boolean isHomeTeam to teamValue:",Ze,"->",et)):typeof Ze=="number"?(et=Ze===1?1:2,console.log("444444444 GSCFieldDataByZones - converted numeric isHomeTeam to teamValue:",Ze,"->",et)):(et=1,console.log("444444444 GSCFieldDataByZones - using default teamValue:",et)),console.log("444444444 GSCFieldDataByZones - setting team filter directly from filterMultiple.isHomeTeam:",Ze,"-> teamValue:",et),m.value[Nt]=et,console.log("444444444 GSCFieldDataByZones - automatically set team filter to:",et),console.log("444444444 GSCFieldDataByZones - teamValue type:",typeof et),console.log("444444444 GSCFieldDataByZones - updated dynamicFilters:",m.value),console.log(" 444444444 GSCFieldDataByZones - filter options:",(ht=T.value[Nt])==null?void 0:ht.options);const bt=(((vt=T.value[Nt])==null?void 0:vt.options)||[]).find(Lt=>Lt.value==et);console.log("444444444 GSCFieldDataByZones - matching option for team:",bt),p.nextTick(()=>{console.log("4444444 **************************************** dynamicFilters *************",m.value),m.value=[...m.value],console.log(" 444444444GSCFieldDataByZones - forced reactivity update for team filter")})}else console.log(" 444444444GSCFieldDataByZones - team filter not found!")}}if(((mt=f.value)==null?void 0:mt.id)===1&&u.value&&(Ot=e==null?void 0:e.view)!=null&&Ot.filterMultiple&&(console.log("GSCComparativeReports - checking filterMultiple after preselecting filters:",e.view.filterMultiple),console.log("GSCComparativeReports - currentFilters:",T.value),console.log("GSCComparativeReports - dynamicFilters before:",m.value),e.view.filterMultiple.category)){console.log("GSCComparativeReports - found category in filterMultiple:",e.view.filterMultiple.category);const Nt=T.value.findIndex(Ze=>Ze.type==="select-simple"&&Ze.label==="Tipo de análisis");if(console.log("GSCComparativeReports - analysisTypeFilterIndex:",Nt),console.log("GSCComparativeReports - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("GSCComparativeReports - found analysis type filter at index:",Nt);const Ze=e.view.filterMultiple.category;console.log("GSCComparativeReports - setting analysis type filter directly from filterMultiple.category:",Ze),m.value[0]=Ze,e.view.componentProps&&Ze&&(e.view.componentProps.type=Ze,console.log("GSCComparativeReports - updated componentProps.type:",e.view.componentProps.type)),console.log("GSCComparativeReports - automatically set analysis type filter to:",Ze),console.log("GSCComparativeReports - category type:",typeof Ze),console.log("GSCComparativeReports - updated dynamicFilters:",m.value),console.log("GSCComparativeReports - filter options:",(Vt=T.value[Nt])==null?void 0:Vt.options);const et=(((qt=T.value[Nt])==null?void 0:qt.options)||[]).find(bt=>bt.value==Ze);console.log("GSCComparativeReports - matching option:",et),p.nextTick(()=>{m.value=[...m.value],console.log("GSCComparativeReports - forced reactivity update")})}else console.log("GSCComparativeReports - analysis type filter not found!")}if(((st=f.value)==null?void 0:st.id)===6&&u.value&&($e=e==null?void 0:e.view)!=null&&$e.filterMultiple&&(console.log("GSCLineupsReports - checking filterMultiple after preselecting filters:",e.view.filterMultiple),console.log("GSCLineupsReports - currentFilters:",T.value),console.log("GSCLineupsReports - dynamicFilters before:",m.value),e.view.filterMultiple.gameNumber)){console.log("GSCLineupsReports - found gameNumber in filterMultiple:",e.view.filterMultiple.gameNumber);const Nt=T.value.findIndex(Ze=>Ze.type==="select-simple"&&Ze.label==="Número de juego");if(console.log("GSCLineupsReports - gameNumberFilterIndex:",Nt),console.log("GSCLineupsReports - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("GSCLineupsReports - found game number filter at index:",Nt);const Ze=e.view.filterMultiple.gameNumber;console.log("GSCLineupsReports - setting game number filter directly from filterMultiple.gameNumber:",Ze),m.value[0]=Ze,e.view.componentProps&&Ze&&(e.view.componentProps.gameNumber=Ze,console.log("GSCLineupsReports - updated componentProps.gameNumber:",e.view.componentProps.gameNumber)),console.log("GSCLineupsReports - automatically set game number filter to:",Ze),console.log("GSCLineupsReports - gameNumber type:",typeof Ze),console.log("GSCLineupsReports - updated dynamicFilters:",m.value),console.log("GSCLineupsReports - filter options:",(lt=T.value[Nt])==null?void 0:lt.options);const et=(((pt=T.value[Nt])==null?void 0:pt.options)||[]).find(bt=>bt.value==Ze);console.log("GSCLineupsReports - matching option:",et),p.nextTick(()=>{m.value=[...m.value],console.log("GSCLineupsReports - forced reactivity update")})}else console.log("GSCLineupsReports - game number filter not found!")}if(((At=f.value)==null?void 0:At.id)===7&&u.value&&e!=null&&e.view){if(console.log("GSCGoalData - checking stored values after preselecting filters:",e.view),console.log("GSCGoalData - currentFilters:",T.value),console.log("GSCGoalData - dynamicFilters before:",m.value),(_t=e.view.componentProps)!=null&&_t.analysisType&&T.value.length>0&&((tt=T.value[0])==null?void 0:tt.type)==="radio-button"){const Nt=e.view.componentProps.analysisType,Ze=Nt==="offensive"?1:2;console.log("GSCGoalData - setting analysis type filter from componentProps.analysisType:",Ze,"analysisType:",Nt),m.value[0]=Ze}if(((ot=e.view.filterMultiple)==null?void 0:ot.isHomeTeam)!==void 0){console.log("GSCGoalData - found isHomeTeam in filterMultiple:",e.view.filterMultiple.isHomeTeam),console.log('GSCGoalData - searching for radio-button filter with label "Equipo"'),console.log("GSCGoalData - all filters details:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label,options:Ze.options})));const Nt=T.value.findIndex(Ze=>Ze.type==="radio-button"&&Ze.label==="Equipo");if(console.log("GSCGoalData - teamFilterIndex:",Nt),console.log("GSCGoalData - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("GSCGoalData - found team filter at index:",Nt);const Ze=e.view.filterMultiple.isHomeTeam,et=Ze?1:2;console.log("GSCGoalData - setting team filter directly from filterMultiple.isHomeTeam:",et,"isHomeTeam:",Ze),m.value[1]=et}else if(console.log("GSCGoalData - team filter not found by label, trying by index"),T.value.length>1&&((Xe=T.value[1])==null?void 0:Xe.type)==="radio-button"){console.log("GSCGoalData - found radio-button filter at index 1 by fallback");const Ze=e.view.filterMultiple.isHomeTeam,et=Ze?1:2;console.log("GSCGoalData - setting team filter by fallback:",et,"isHomeTeam:",Ze),m.value[1]=et,e.view.componentProps&&(e.view.componentProps.isHomeTeamForAnalysis=Ze,console.log("GSCGoalData - updated componentProps.isHomeTeamForAnalysis:",e.view.componentProps.isHomeTeamForAnalysis)),console.log("GSCGoalData - automatically set team filter to:",et),console.log("GSCGoalData - teamValue type:",typeof et),console.log("GSCGoalData - updated dynamicFilters:",m.value),console.log("GSCGoalData - filter options:",(ct=T.value[1])==null?void 0:ct.options);const bt=(((kt=T.value[1])==null?void 0:kt.options)||[]).find(Lt=>Lt.value==et);console.log("GSCGoalData - matching option:",bt),p.nextTick(()=>{m.value=[...m.value],console.log("GSCGoalData - forced reactivity update")})}else console.log("GSCGoalData - no radio-button filter found at index 1 either");if(Nt!==-1&&e.view.componentProps){const Ze=e.view.filterMultiple.isHomeTeam,et=Ze?1:2;e.view.componentProps.isHomeTeamForAnalysis=Ze,console.log("GSCGoalData - updated componentProps.isHomeTeamForAnalysis:",e.view.componentProps.isHomeTeamForAnalysis),console.log("GSCGoalData - automatically set team filter to:",et),console.log("GSCGoalData - teamValue type:",typeof et),console.log("GSCGoalData - updated dynamicFilters:",m.value),console.log("GSCGoalData - filter options:",(yt=T.value[Nt])==null?void 0:yt.options);const bt=(((It=T.value[Nt])==null?void 0:It.options)||[]).find(Lt=>Lt.value==et);console.log("GSCGoalData - matching option:",bt),p.nextTick(()=>{m.value=[...m.value],console.log("GSCGoalData - forced reactivity update")})}}else console.log("GSCGoalData - isHomeTeam is undefined in filterMultiple")}p.nextTick(()=>{b.value=!1})}},100)}))}function de(){var ve,me,De,Ie,Ve,We,Ye,ke,ze,Fe;return{mainSelector:{id:((ve=d.value)==null?void 0:ve.id)||null,name:((me=d.value)==null?void 0:me.name)||null,url:((De=d.value)==null?void 0:De.url)||null},viewSelector:{id:((Ie=f.value)==null?void 0:Ie.id)||null,name:((Ve=f.value)==null?void 0:Ve.name)||((We=f.value)==null?void 0:We.title)||null,url:((Ye=f.value)==null?void 0:Ye.url)||null},team:_.value,dynamicFilters:((ke=T.value)==null?void 0:ke.map((He,rt)=>{var nt,ht;const vt=m.value[rt];return{filterId:He.id||`filter_${rt}`,filterType:He.type,filterLabel:He.label,filterIcon:He.icon||null,selectedValue:vt,selectedOptions:He.type==="select"&&Array.isArray(vt)&&vt.length>0?vt.map(mt=>{var Ot;const Vt=(Ot=He.options)==null?void 0:Ot.find(qt=>qt.value===mt);return{value:mt,label:(Vt==null?void 0:Vt.label)||mt,icon:(Vt==null?void 0:Vt.icon)||null}}):null,selectedOption:He.type==="radio-button"&&vt?{value:vt,label:((ht=(nt=He.options)==null?void 0:nt.find(mt=>mt.value===vt))==null?void 0:ht.label)||vt}:null,isChecked:He.type==="check"?vt:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!d.value,viewSelected:!!f.value,totalDynamicFilters:((ze=T.value)==null?void 0:ze.length)||0,activeFilters:((Fe=T.value)==null?void 0:Fe.filter((He,rt)=>{const nt=m.value[rt];return Array.isArray(nt)?nt.length>0:nt!=null&&nt!==!1}).length)||0}}}a({getCurrentFiltersJSON:de});function ye(){fe(),J("close",x)}function _e(){t.value=!1,ye()}function xe(){w.value&&(Ei.emit("filters-cancelled",x),w.value=!1),t.value=!1,ye()}p.onMounted(async()=>{document.addEventListener("click",oe),p.nextTick(()=>{Se()});try{const ve=await(await fetch("https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/views",{headers:{Authorization:`${B.token}`}})).json();C.value=ve.data||[]}catch(ve){console.error("Error al obtener datos:",ve)}});function Se(){document.querySelectorAll(".field-menu .option-card").forEach(ve=>{const me=ve.querySelector(".option-img");if(!me||!me.dataset.hoverSrc)return;const De=me.src,Ie=me.dataset.hoverSrc;ve.addEventListener("mouseenter",()=>{me.src=Ie}),ve.addEventListener("mouseleave",()=>{me.src=De})})}p.onUnmounted(()=>{document.removeEventListener("click",oe)}),Ei.on("set-filter-and-views-container",ve=>{x=ve,ve&&se(ve)}),Ei.on("view-added",()=>{console.log("View ************************************************************* add"),t.value=!0,w.value=!0}),Ei.on("component-added-to-container",ve=>{console.log("Component added to container, updating filters, container:",ve),!u.value||x&&ve.id===x.id?se(ve):console.log("Skipping container update - edit mode or different container")}),Ei.on("edit-view",ve=>{var me,De,Ie,Ve,We,Ye,ke,ze,Fe,He,rt,nt,ht,vt,mt,Ot,Vt,qt,st;console.log("edit-view received:",ve),e=ve,x=((me=ve.view)==null?void 0:me.filterAndViewsContainer)||null,v=null;const $e=[(Ie=(De=ve.view)==null?void 0:De.coreView)==null?void 0:Ie.filtersJSON,(Ve=ve.view)==null?void 0:Ve.filtersJSON,(We=ve.coreView)==null?void 0:We.filtersJSON,ve.filtersJSON,(ke=(Ye=ve.view)==null?void 0:Ye.componentProps)==null?void 0:ke.filtersJSON];for(const lt of $e)if(lt){v=lt,console.log("Found editFiltersJSON in:",lt);break}if(x&&(x.viewId===4||x.viewId===8||x.viewId===3||x.viewId===1||x.viewId===2)&&(ze=ve.view)!=null&&ze.id){const lt=x.getComponentDynamicFilters(ve.view.id);if(lt){let pt="Unknown";x.viewId===4?pt="Timeline":x.viewId===8?pt="FieldPosesion":x.viewId===3?pt="GSCMatchSummary":x.viewId===1?pt="GSCComparativeReports":x.viewId===2&&(pt="GscTopPlayer"),console.log(`${pt} - found component specific filters:`,lt),v&&(v={...v,dynamicFilters:lt.map((At,_t)=>Array.isArray(At)?{selectedValue:At,selectedOptions:At.map(tt=>({value:tt,label:tt}))}:typeof At=="boolean"?{isChecked:At}:pt==="GSCComparativeReports"&&_t===0?{selectedValue:At,selectedOptions:[{value:At,label:At}]}:pt==="GscTopPlayer"&&_t===0?{selectedValue:At,selectedOptions:[{value:At,label:At}]}:pt==="GscTopPlayer"&&_t===1?{selectedOption:{value:At,label:At}}:{selectedOption:{value:At,label:At}})},console.log(`${pt} - updated editFiltersJSON with component specific filters:`,v))}}if(x&&x.viewId===2&&(Fe=ve.view)!=null&&Fe.filterMultiple){if(console.log("2222************************************************************",e.view.filterMultiple),console.log("GSCtops detected - checking filterMultiple:",ve.view.filterMultiple),ve.view.filterMultiple.categoryId&&v){console.log("GSCtops - found categoryId in filterMultiple:",ve.view.filterMultiple.categoryId);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="select-simple"&&pt.filterLabel==="Tipo de análisis");lt!==-1&&(console.log("GSCtops - found category filter at index:",lt),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedValue:ve.view.filterMultiple.categoryId,selectedOptions:[{value:ve.view.filterMultiple.categoryId,label:`Category ${ve.view.filterMultiple.categoryId}`}]},console.log("GSCtops - updated filter with single value:",ve.view.filterMultiple.categoryId),console.log("GSCtops - updated filter structure:",v.dynamicFilters[lt]),console.log("GSCtops - updated category filter with filterMultiple.categoryId:",ve.view.filterMultiple.categoryId))}if(ve.view.filterMultiple.teamType!==void 0&&v){console.log("GSCtops - found teamType in filterMultiple:",ve.view.filterMultiple.teamType);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="radio-button");if(lt!==-1){console.log("GSCtops - found team filter at index:",lt);const pt=ve.view.filterMultiple.teamType,At=pt===1?"Mi equipo":pt===2?"Rival":pt===3?"Ambos":"Equipo";v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedOption:{value:pt,label:At}},console.log("GSCtops - updated team filter with teamType:",pt,"label:",At),console.log("GSCtops - updated team filter structure:",v.dynamicFilters[lt]),console.log("GSCtops - updated team filter with filterMultiple.teamType:",ve.view.filterMultiple.teamType)}}}if(x&&x.viewId===1&&(He=ve.view)!=null&&He.filterMultiple&&(console.log("GSCComparativeReports detected - checking filterMultiple:",ve.view.filterMultiple),ve.view.filterMultiple.category&&v)){console.log("GSCComparativeReports - found category in filterMultiple:",ve.view.filterMultiple.category);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="select-simple"&&pt.filterLabel==="Tipo de análisis");lt!==-1&&(console.log("GSCComparativeReports - found analysis type filter at index:",lt),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedValue:ve.view.filterMultiple.category,selectedOptions:[{value:ve.view.filterMultiple.category,label:ve.view.filterMultiple.category}]},console.log("GSCComparativeReports - updated filter with single value:",ve.view.filterMultiple.category),console.log("GSCComparativeReports - updated filter structure:",v.dynamicFilters[lt]),console.log("GSCComparativeReports - updated analysis type filter with filterMultiple.category:",ve.view.filterMultiple.category))}if(x&&x.viewId===9&&(rt=ve.view)!=null&&rt.filterMultiple){if(console.log("GSCFieldDataByZones detected - checking filterMultiple:",ve.view.filterMultiple),ve.view.filterMultiple.categoryIds&&v){console.log("GSCFieldDataByZones - found categoryIds in filterMultiple:",ve.view.filterMultiple.categoryIds);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="select"&&pt.filterLabel==="Tipo de análisis");if(lt!==-1){console.log("GSCFieldDataByZones - found analysis type filter at index:",lt);const pt=Array.isArray(ve.view.filterMultiple.categoryIds)?ve.view.filterMultiple.categoryIds:[ve.view.filterMultiple.categoryIds];console.log("GSCFieldDataByZones - processing categoryIds array:",pt),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedValue:pt,selectedOptions:pt.map(ot=>({value:ot,label:`Category ${ot}`}))},console.log("GSCFieldDataByZones - updated filter with categoryIds:",pt),console.log("GSCFieldDataByZones - updated filter structure:",v.dynamicFilters[lt]);const At=ve.view.filterMultiple.categoryIds,_t=Ce(At,pt);console.log("GSCFieldDataByZones - category arrays match with original:",_t),console.log("GSCFieldDataByZones - original categoryIds:",At,"processed categoryIds:",pt);const tt=(((nt=T.value[lt])==null?void 0:nt.options)||[]).filter(ot=>Array.isArray(ot.value)?Ce(ot.value,pt):pt.includes(ot.value));if(console.log("GSCFieldDataByZones - matching options in editFiltersJSON:",tt),tt.length>0){const ot=tt[0];console.log("GSCFieldDataByZones - found matching option in editFiltersJSON:",ot),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedValue:ot.value,selectedOptions:[ot]},console.log("GSCFieldDataByZones - updated editFiltersJSON with matching option value:",ot.value)}console.log("GSCFieldDataByZones - updated analysis type filter with filterMultiple.categoryIds:",pt)}}if(ve.view.filterMultiple.isHomeTeam!==void 0&&v){console.log("GSCFieldDataByZones - found isHomeTeam in filterMultiple:",ve.view.filterMultiple.isHomeTeam),console.log("GSCFieldDataByZones - isHomeTeam type:",typeof ve.view.filterMultiple.isHomeTeam);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="radio-button");if(lt!==-1){console.log("GSCFieldDataByZones - found team filter at index:",lt);const pt=ve.view.filterMultiple.isHomeTeam;let At,_t;typeof pt=="boolean"?(At=pt?1:2,_t=pt?"Mi equipo":"Rival",console.log("GSCFieldDataByZones - converted boolean isHomeTeam to teamValue:",pt,"->",At,"label:",_t)):typeof pt=="number"?(At=pt===1?1:2,_t=pt===1?"Mi equipo":"Rival",console.log("GSCFieldDataByZones - converted numeric isHomeTeam to teamValue:",pt,"->",At,"label:",_t)):(At=1,_t="Mi equipo",console.log("GSCFieldDataByZones - using default teamValue:",At,"label:",_t)),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedOption:{value:At,label:_t}},console.log("GSCFieldDataByZones - updated team filter with isHomeTeam:",pt,"teamValue:",At,"teamLabel:",_t),console.log("GSCFieldDataByZones - updated team filter structure:",v.dynamicFilters[lt]),console.log("GSCFieldDataByZones - updated team filter with filterMultiple.isHomeTeam:",ve.view.filterMultiple.isHomeTeam)}}}if(x&&x.viewId===6&&(ht=ve.view)!=null&&ht.filterMultiple&&(console.log("GSCLineupsReports detected - checking filterMultiple:",ve.view.filterMultiple),ve.view.filterMultiple.gameNumber&&v)){console.log("GSCLineupsReports - found gameNumber in filterMultiple:",ve.view.filterMultiple.gameNumber);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="select-simple"&&pt.filterLabel==="Número de juego");lt!==-1&&(console.log("GSCLineupsReports - found game number filter at index:",lt),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedValue:ve.view.filterMultiple.gameNumber,selectedOptions:[{value:ve.view.filterMultiple.gameNumber,label:`Juego ${ve.view.filterMultiple.gameNumber}`}]},console.log("GSCLineupsReports - updated filter with single value:",ve.view.filterMultiple.gameNumber),console.log("GSCLineupsReports - updated filter structure:",v.dynamicFilters[lt]),console.log("GSCLineupsReports - updated game number filter with filterMultiple.gameNumber:",ve.view.filterMultiple.gameNumber))}if(x&&x.viewId===7&&ve.view&&v){if(console.log("GSCGoalData detected - checking stored values:",ve.view),(vt=ve.view.componentProps)!=null&&vt.analysisType){console.log("GSCGoalData - found analysisType in componentProps:",ve.view.componentProps.analysisType);const lt=v.dynamicFilters.findIndex((pt,At)=>pt.filterType==="radio-button"&&At===0);if(lt!==-1){console.log("GSCGoalData - found analysis type filter at index:",lt);const pt=ve.view.componentProps.analysisType,At=pt==="offensive"?1:2,_t=pt==="offensive"?"A favor":"En contra";v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedOption:{value:At,label:_t}},console.log("GSCGoalData - updated analysis filter with value:",At,"analysisType:",pt),console.log("GSCGoalData - updated analysis filter structure:",v.dynamicFilters[lt])}}if(((mt=ve.view.filterMultiple)==null?void 0:mt.isHomeTeam)!==void 0){console.log("GSCGoalData - found isHomeTeam in filterMultiple:",ve.view.filterMultiple.isHomeTeam);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="radio-button"&&pt.filterLabel==="Equipo");if(lt!==-1){console.log("GSCGoalData - found team filter at index:",lt);const pt=ve.view.filterMultiple.isHomeTeam,At=pt?1:2,_t=pt?"Equipo propio":"Equipo rival";v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedOption:{value:At,label:_t}},console.log("GSCGoalData - updated filter with team value:",At,"isHomeTeam:",pt),console.log("GSCGoalData - updated filter structure:",v.dynamicFilters[lt]),console.log("GSCGoalData - updated team filter with filterMultiple.isHomeTeam:",pt)}}}if(x&&x.viewId===10&&(Ot=ve.view)!=null&&Ot.filterMultiple&&(console.log("gsc xg detected - checking filterMultiple:",ve.view.filterMultiple),((qt=(Vt=e==null?void 0:e.view)==null?void 0:Vt.coreView)==null?void 0:qt.id)===10)){const lt=ve.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};v&&(v.dynamicFilters[0]={...v.dynamicFilters[0],selectedOption:lt})}if(x&&x.viewId===5&&(st=ve.view)!=null&&st.filterMultiple&&(console.log("GSCVolumetricField detected - checking filterMultiple:",ve.view.filterMultiple),ve.view.filterMultiple.isHomeTeam!==void 0&&v)){console.log("GSCVolumetricField - found isHomeTeam in filterMultiple:",ve.view.filterMultiple.isHomeTeam),console.log("GSCVolumetricField - editFiltersJSON.dynamicFilters:",v.dynamicFilters),console.log("GSCVolumetricField - searching for team filter in editFiltersJSON");const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="radio-button"&&pt.filterLabel==="Equipo");if(console.log("GSCVolumetricField - teamFilterIndex:",lt),console.log("GSCVolumetricField - all filters in editFiltersJSON:",v.dynamicFilters.map((pt,At)=>({index:At,filterType:pt.filterType,filterLabel:pt.filterLabel}))),lt!==-1){console.log("GSCVolumetricField - found team filter at index:",lt);const pt=ve.view.filterMultiple.isHomeTeam;console.log("GSCVolumetricField - isHomeTeam type in editFiltersJSON:",typeof pt,"value:",pt);let At,_t;typeof pt=="boolean"?(At=pt?1:2,_t=pt?"Equipo propio":"Equipo rival",console.log("GSCVolumetricField - isHomeTeam is boolean in editFiltersJSON, converting:",pt,"-> teamValue:",At,"teamLabel:",_t)):typeof pt=="number"?(At=pt===1?1:2,_t=pt===1?"Equipo propio":"Equipo rival",console.log("GSCVolumetricField - isHomeTeam is number in editFiltersJSON, using directly:",pt,"-> teamValue:",At,"teamLabel:",_t)):(At=1,_t="Equipo propio",console.log("GSCVolumetricField - isHomeTeam is unknown type in editFiltersJSON, using default:",At,"teamLabel:",_t)),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedOption:{value:At,label:_t}},console.log("GSCVolumetricField - updated filter with team value:",At,"isHomeTeam:",pt),console.log("GSCVolumetricField - updated filter structure:",v.dynamicFilters[lt]),console.log("GSCVolumetricField - updated team filter with filterMultiple.isHomeTeam:",pt)}else{console.log("GSCVolumetricField - team filter not found in editFiltersJSON, trying fallback");const pt=v.dynamicFilters.findIndex(At=>At.filterType==="radio-button");if(pt!==-1){console.log("GSCVolumetricField - found radio-button filter at index:",pt);const At=ve.view.filterMultiple.isHomeTeam;console.log("GSCVolumetricField - isHomeTeam type in editFiltersJSON fallback:",typeof At,"value:",At);let _t,tt;typeof At=="boolean"?(_t=At?1:2,tt=At?"Equipo propio":"Equipo rival",console.log("GSCVolumetricField - isHomeTeam is boolean in editFiltersJSON fallback, converting:",At,"-> teamValue:",_t,"teamLabel:",tt)):typeof At=="number"?(_t=At===1?1:2,tt=At===1?"Equipo propio":"Equipo rival",console.log("GSCVolumetricField - isHomeTeam is number in editFiltersJSON fallback, using directly:",At,"-> teamValue:",_t,"teamLabel:",tt)):(_t=1,tt="Equipo propio",console.log("GSCVolumetricField - isHomeTeam is unknown type in editFiltersJSON fallback, using default:",_t,"teamLabel:",tt)),v.dynamicFilters[pt]={...v.dynamicFilters[pt],selectedOption:{value:_t,label:tt}},console.log("GSCVolumetricField - updated filter with team value (fallback):",_t,"isHomeTeam:",At),console.log("GSCVolumetricField - updated filter structure (fallback):",v.dynamicFilters[pt])}else console.log("GSCVolumetricField - no radio-button filters found in editFiltersJSON at all!")}}console.log("Final editFiltersJSON:",v),v?ue(v):console.log("No editFiltersJSON found, cannot preselect filters"),t.value=!0});function Me(){V.value=null}function Te(ve,me){var De;((De=f.value)==null?void 0:De.id)===2&&console.log("GSCtops - debugSelectSimple:",{idx:ve,optionValue:me,optionValueType:typeof me,dynamicFiltersValue:m.value[ve],dynamicFiltersValueType:typeof m.value[ve],isEqual:m.value[ve]===me,isEqualLoose:m.value[ve]==me})}function Ce(ve,me){if(!Array.isArray(ve)||!Array.isArray(me)||ve.length!==me.length)return!1;const De=[...ve].sort((Ve,We)=>Ve-We),Ie=[...me].sort((Ve,We)=>Ve-We);return JSON.stringify(De)===JSON.stringify(Ie)}function Ne(){var ve;if(u.value&&v&&v.dynamicFilters){if(console.log("Forcing checkbox and select filter update from editFiltersJSON"),((ve=f.value)==null?void 0:ve.id)===8&&(console.log("FieldPosesion - forceCheckboxUpdate called"),console.log("FieldPosesion - viewToEdit:",e),console.log("FieldPosesion - editFiltersJSON:",v)),h.value){console.log("Skipping forceCheckboxUpdate - already in force update");return}if(y.value)return;h.value=!0,b.value=!0,v.dynamicFilters.forEach((me,De)=>{var Ie,Ve,We;if(me&&(Ie=T.value)!=null&&Ie[De]){const Ye=T.value[De];if(Ye.type==="check"&&me.isChecked!==void 0)console.log(`Forcing checkbox ${De} to:`,me.isChecked),m.value[De]=me.isChecked,((Ve=f.value)==null?void 0:Ve.id)===8&&console.log("FieldPosesion - Checkbox filter updated:",{index:De,value:me.isChecked,componentId:(We=e==null?void 0:e.view)==null?void 0:We.id});else if(Ye.type==="select"&&me.selectedOptions){const ke=me.selectedOptions.map(ze=>ze.value);console.log(`Forcing select filter ${De} to:`,ke),m.value[De]=ke}else Ye.type==="select"&&me.selectedValue&&Array.isArray(me.selectedValue)&&(console.log(`Forcing select filter ${De} to:`,me.selectedValue),m.value[De]=me.selectedValue)}}),p.nextTick(()=>{b.value=!1,h.value=!1})}}function Re(){var ve;if(u.value&&v&&v.dynamicFilters&&((ve=f.value)==null?void 0:ve.id)===4){if(console.log("Preselecting Timeline filters specifically"),h.value){console.log("Skipping preselectTimelineFilters - already in force update");return}if(y.value)return;h.value=!0,b.value=!0,v.dynamicFilters.forEach((me,De)=>{var Ie,Ve;if(me&&((Ve=(Ie=T.value)==null?void 0:Ie[De])==null?void 0:Ve.type)==="select"){if(me.selectedOptions){const We=me.selectedOptions.map(Ye=>Ye.value);console.log(`Preselecting Timeline select filter ${De} to:`,We),m.value[De]=We}else if(me.selectedValue&&Array.isArray(me.selectedValue))if(me.selectedValue.length>0&&me.selectedValue[0]&&typeof me.selectedValue[0]=="object"){const We=Ge(me.selectedValue);console.log(`Preselecting Timeline select filter ${De} to:`,We),m.value[De]=We}else console.log(`Preselecting Timeline select filter ${De} to:`,me.selectedValue),m.value[De]=me.selectedValue}}),setTimeout(()=>{var me;if(console.log("Forcing UI update after preselecting Timeline filters"),m.value=[...m.value],(me=e==null?void 0:e.view)!=null&&me.componentProps&&m.value&&m.value.length>0){const De=m.value[0];if(console.log("Timeline - preselecting componentProps with events:",De),Array.isArray(De)&&De.length>0){const Ie=De.some(ke=>ke.event_type_id===1||typeof ke=="string"&&ke.includes("1")),Ve=De.some(ke=>ke.category_id===8||typeof ke=="string"&&ke.includes("8")),We=De.some(ke=>ke.category_id===9||typeof ke=="string"&&ke.includes("9")),Ye=De.some(ke=>ke.event_type_id===3||typeof ke=="string"&&ke.includes("3"));console.log("Timeline - preselecting Events check:",{goals:Ie,yellowCards:Ve,redCards:We,substitutions:Ye,selectedEvents:De}),e.view.componentProps.selectedEvents=De,e.view.componentProps.goals=Ie,e.view.componentProps.yellowCards=Ve,e.view.componentProps.redCards=We,e.view.componentProps.substitutions=Ye,e.view.componentProps.key=De.length>0,e.view.componentProps._updateKey=Date.now(),console.log("Timeline - preselecting updated componentProps:",e.view.componentProps),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps}),console.log("Timeline - preselecting emitted force-component-update event")}}},200),p.nextTick(()=>{b.value=!1,h.value=!1})}}function Ge(ve){return!Array.isArray(ve)||ve.length===0?[]:ve.map(me=>{if(me&&typeof me=="object"){if(me.event_type_id!==void 0||me.category_id!==void 0)return{event_type_id:me.event_type_id,category_id:me.category_id,...me.name&&{name:me.name},...me.label&&{label:me.label}};if(me.value&&typeof me.value=="object")return{event_type_id:me.value.event_type_id,category_id:me.value.category_id,...me.value.name&&{name:me.value.name},...me.value.label&&{label:me.value.label}};if(typeof me=="string"&&me.includes("-")){const[De,Ie]=me.split("-");return{category_id:parseInt(De),event_type_id:parseInt(Ie)}}}if(typeof me=="string")if(me.includes("-")){const[De,Ie]=me.split("-");return{category_id:parseInt(De),event_type_id:parseInt(Ie)}}else{const De=parseInt(me);if(!isNaN(De))return{event_type_id:De}}return me})}function Pe(){var ve,me,De,Ie,Ve,We,Ye,ke,ze,Fe,He,rt,nt,ht;if(u.value&&v&&v.dynamicFilters&&T.value){if(console.log("Force updating select filters immediately"),h.value){console.log("Skipping forceSelectFilterUpdate - already in force update");return}if(y.value)return;if(h.value=!0,b.value=!0,v.dynamicFilters.forEach((vt,mt)=>{var Ot,Vt,qt,st,$e,lt,pt,At,_t,tt,ot;if(vt&&((Ot=T.value[mt])==null?void 0:Ot.type)==="select"){if(vt.selectedOptions){const Xe=vt.selectedOptions.map(ct=>ct.value);console.log(`Force setting select filter ${mt} to:`,Xe),m.value[mt]=Xe}else if(vt.selectedValue&&Array.isArray(vt.selectedValue))if(vt.selectedValue.length>0&&vt.selectedValue[0]&&typeof vt.selectedValue[0]=="object"){const Xe=Ge(vt.selectedValue);console.log(`Force setting Timeline select filter ${mt} to:`,Xe),m.value[mt]=Xe}else console.log(`Force setting select filter ${mt} to:`,vt.selectedValue),m.value[mt]=vt.selectedValue}else if(vt&&((Vt=T.value[mt])==null?void 0:Vt.type)==="select-simple"&&vt.selectedValue!==void 0){console.log(`Force setting select-simple filter ${mt} to:`,vt.selectedValue),console.log("forceSelectFilterUpdate - selectedValue type:",typeof vt.selectedValue),console.log("forceSelectFilterUpdate - selectedValue is array:",Array.isArray(vt.selectedValue));let Xe;((qt=f.value)==null?void 0:qt.id)===2&&($e=(st=e==null?void 0:e.view)==null?void 0:st.filterMultiple)!=null&&$e.categoryId?(Xe=e.view.filterMultiple.categoryId,console.log("GSCtops - using filterMultiple.categoryId in forceSelectFilterUpdate:",Xe)):((lt=f.value)==null?void 0:lt.id)===1&&(At=(pt=e==null?void 0:e.view)==null?void 0:pt.filterMultiple)!=null&&At.category?(Xe=e.view.filterMultiple.category,console.log("GSCComparativeReports - using filterMultiple.category in forceSelectFilterUpdate:",Xe)):((_t=f.value)==null?void 0:_t.id)===6&&(ot=(tt=e==null?void 0:e.view)==null?void 0:tt.filterMultiple)!=null&&ot.gameNumber?(Xe=e.view.filterMultiple.gameNumber,console.log("GSCLineupsReports - using filterMultiple.gameNumber in forceSelectFilterUpdate:",Xe)):Xe=Array.isArray(vt.selectedValue)?vt.selectedValue[0]:vt.selectedValue,m.value[mt]=Xe,console.log(`Force setting select-simple filter ${mt} to:`,Xe)}}),((ve=f.value)==null?void 0:ve.id)===4&&setTimeout(()=>{var vt;if(console.log("Forcing UI update for Timeline filters"),m.value=[...m.value],(vt=e==null?void 0:e.view)!=null&&vt.componentProps&&m.value&&m.value.length>0){const mt=m.value[0];if(console.log("Timeline - forceSelectFilterUpdate componentProps with events:",mt),Array.isArray(mt)&&mt.length>0){const Ot=mt.some($e=>$e.event_type_id===1||typeof $e=="string"&&$e.includes("1")),Vt=mt.some($e=>$e.category_id===8||typeof $e=="string"&&$e.includes("8")),qt=mt.some($e=>$e.category_id===9||typeof $e=="string"&&$e.includes("9")),st=mt.some($e=>$e.event_type_id===3||typeof $e=="string"&&$e.includes("3"));console.log("Timeline - forceSelectFilterUpdate Events check:",{goals:Ot,yellowCards:Vt,redCards:qt,substitutions:st,selectedEvents:mt}),e.view.componentProps.selectedEvents=mt,e.view.componentProps.goals=Ot,e.view.componentProps.yellowCards=Vt,e.view.componentProps.redCards=qt,e.view.componentProps.substitutions=st,e.view.componentProps.key=mt.length>0,e.view.componentProps._updateKey=Date.now(),console.log("Timeline - forceSelectFilterUpdate updated componentProps:",e.view.componentProps),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps}),console.log("Timeline - forceSelectFilterUpdate emitted force-component-update event")}}},100),((me=f.value)==null?void 0:me.id)===2&&(De=e==null?void 0:e.view)!=null&&De.filterMultiple){if(console.log("GSCtops - checking filterMultiple in forceSelectFilterUpdate:",e.view.filterMultiple),console.log("GSCtops - currentFilters in forceSelectFilterUpdate:",T.value),e.view.filterMultiple.categoryId){console.log("GSCtops - found categoryId in filterMultiple:",e.view.filterMultiple.categoryId);const vt=T.value.findIndex(mt=>mt.type==="select-simple"&&mt.label==="Tipo de análisis");if(console.log("GSCtops - categoryFilterIndex in forceSelectFilterUpdate:",vt),console.log("GSCtops - all filters in forceSelectFilterUpdate:",T.value.map((mt,Ot)=>({index:Ot,type:mt.type,label:mt.label}))),vt!==-1){console.log("GSCtops - found category filter at index:",vt);const mt=e.view.filterMultiple.categoryId;if(console.log("GSCtops - setting category filter directly from filterMultiple.categoryId in forceSelectFilterUpdate:",mt),m.value[0]=mt,e.view.componentProps&&mt){let Vt=`Category ${mt}`,qt=null;try{qt=Vd(mt),qt&&(Vt=qt.name,console.log("GSCtops - found category info from getCategoryById in forceSelectFilterUpdate:",qt))}catch{console.log("GSCtops - getCategoryById failed in forceSelectFilterUpdate, using filter options");const st=T.value.findIndex($e=>$e.type==="select-simple"&&$e.label==="Tipo de análisis");if(st!==-1){const $e=(((Ie=T.value[st])==null?void 0:Ie.options)||[]).find(lt=>lt.value==mt);$e&&(Vt=$e.label,console.log("GSCtops - found category name from options in forceSelectFilterUpdate:",Vt))}}e.view.componentProps.categoryView=[{id:mt,name:Vt}],console.log("GSCtops - updated componentProps.categoryView in forceSelectFilterUpdate:",e.view.componentProps.categoryView)}console.log("GSCtops - automatically set category filter to:",mt),console.log("GSCtops - categoryId type:",typeof mt),console.log("GSCtops - updated dynamicFilters:",m.value),console.log("GSCtops - filter options:",(Ve=T.value[vt])==null?void 0:Ve.options);const Ot=(((We=T.value[vt])==null?void 0:We.options)||[]).find(Vt=>Vt.value==mt);console.log("GSCtops - matching option:",Ot),p.nextTick(()=>{m.value=[...m.value],console.log("GSCtops - forced reactivity update in forceSelectFilterUpdate")})}else console.log("GSCtops - category filter not found in forceSelectFilterUpdate!")}if(e.view.filterMultiple.teamType!==void 0){console.log("GSCtops - found teamType in filterMultiple in forceSelectFilterUpdate:",e.view.filterMultiple.teamType);const vt=T.value.findIndex(mt=>mt.type==="radio-button");if(console.log("GSCtops - teamFilterIndex in forceSelectFilterUpdate:",vt),console.log("GSCtops - all filters in forceSelectFilterUpdate:",T.value.map((mt,Ot)=>({index:Ot,type:mt.type,label:mt.label}))),vt!==-1){console.log("GSCtops - found team filter at index in forceSelectFilterUpdate:",vt);const mt=e.view.filterMultiple.teamType;console.log("GSCtops - setting team filter directly from filterMultiple.teamType in forceSelectFilterUpdate:",mt),m.value[vt]=mt,console.log("GSCtops - automatically set team filter to in forceSelectFilterUpdate:",mt),console.log("GSCtops - teamType type in forceSelectFilterUpdate:",typeof mt),console.log("GSCtops - updated dynamicFilters in forceSelectFilterUpdate:",m.value),console.log("GSCtops - filter options in forceSelectFilterUpdate:",(Ye=T.value[vt])==null?void 0:Ye.options);const Ot=(((ke=T.value[vt])==null?void 0:ke.options)||[]).find(Vt=>Vt.value==mt);console.log("GSCtops - matching option for team in forceSelectFilterUpdate:",Ot),p.nextTick(()=>{m.value=[...m.value],console.log("GSCtops - forced reactivity update for team filter in forceSelectFilterUpdate")})}else console.log("GSCtops - team filter not found in forceSelectFilterUpdate!")}}if(((ze=f.value)==null?void 0:ze.id)===1&&(Fe=e==null?void 0:e.view)!=null&&Fe.filterMultiple&&(console.log("GSCComparativeReports - checking filterMultiple in forceSelectFilterUpdate:",e.view.filterMultiple),console.log("GSCComparativeReports - currentFilters in forceSelectFilterUpdate:",T.value),e.view.filterMultiple.category)){console.log("GSCComparativeReports - found category in filterMultiple:",e.view.filterMultiple.category);const vt=T.value.findIndex(mt=>mt.type==="select-simple"&&mt.label==="Tipo de análisis");if(console.log("GSCComparativeReports - analysisTypeFilterIndex in forceSelectFilterUpdate:",vt),console.log("GSCComparativeReports - all filters in forceSelectFilterUpdate:",T.value.map((mt,Ot)=>({index:Ot,type:mt.type,label:mt.label}))),vt!==-1){console.log("GSCComparativeReports - found analysis type filter at index:",vt);const mt=e.view.filterMultiple.category;console.log("GSCComparativeReports - setting analysis type filter directly from filterMultiple.category in forceSelectFilterUpdate:",mt),m.value[0]=mt,e.view.componentProps&&mt&&(e.view.componentProps.type=mt,console.log("GSCComparativeReports - updated componentProps.type in forceSelectFilterUpdate:",e.view.componentProps.type)),p.nextTick(()=>{m.value=[...m.value],console.log("GSCComparativeReports - forced reactivity update in forceSelectFilterUpdate")})}else console.log("GSCComparativeReports - analysis type filter not found in forceSelectFilterUpdate!")}if(((He=f.value)==null?void 0:He.id)===6&&(rt=e==null?void 0:e.view)!=null&&rt.filterMultiple&&(console.log("GSCLineupsReports - checking filterMultiple in forceSelectFilterUpdate:",e.view.filterMultiple),console.log("GSCLineupsReports - currentFilters in forceSelectFilterUpdate:",T.value),e.view.filterMultiple.gameNumber)){console.log("GSCLineupsReports - found gameNumber in filterMultiple:",e.view.filterMultiple.gameNumber);const vt=T.value.findIndex(mt=>mt.type==="select-simple"&&mt.label==="Número de juego");if(console.log("GSCLineupsReports - gameNumberFilterIndex in forceSelectFilterUpdate:",vt),console.log("GSCLineupsReports - all filters in forceSelectFilterUpdate:",T.value.map((mt,Ot)=>({index:Ot,type:mt.type,label:mt.label}))),vt!==-1){console.log("GSCLineupsReports - found game number filter at index:",vt);const mt=e.view.filterMultiple.gameNumber;console.log("GSCLineupsReports - setting game number filter directly from filterMultiple.gameNumber in forceSelectFilterUpdate:",mt),m.value[0]=mt,e.view.componentProps&&mt&&(e.view.componentProps.gameNumber=mt,console.log("GSCLineupsReports - updated componentProps.gameNumber in forceSelectFilterUpdate:",e.view.componentProps.gameNumber)),p.nextTick(()=>{m.value=[...m.value],console.log("GSCLineupsReports - forced reactivity update in forceSelectFilterUpdate")})}else console.log("GSCLineupsReports - game number filter not found in forceSelectFilterUpdate!")}if(((nt=f.value)==null?void 0:nt.id)===5&&(ht=e==null?void 0:e.view)!=null&&ht.filterMultiple&&(console.log("GSCVolumetricField - checking filterMultiple in forceSelectFilterUpdate:",e.view.filterMultiple),console.log("GSCVolumetricField - currentFilters in forceSelectFilterUpdate:",T.value),e.view.filterMultiple.isHomeTeam!==void 0)){console.log("GSCVolumetricField - found isHomeTeam in filterMultiple:",e.view.filterMultiple.isHomeTeam),console.log('GSCVolumetricField - searching for team filter with label "Equipo"'),console.log("GSCVolumetricField - all filters details:",T.value.map((mt,Ot)=>({index:Ot,type:mt.type,label:mt.label,options:mt.options})));const vt=T.value.findIndex(mt=>mt.type==="radio-button"&&mt.label==="Equipo");if(console.log("GSCVolumetricField - teamFilterIndex in forceSelectFilterUpdate:",vt),console.log("GSCVolumetricField - all filters in forceSelectFilterUpdate:",T.value.map((mt,Ot)=>({index:Ot,type:mt.type,label:mt.label}))),vt!==-1){console.log("GSCVolumetricField - found team filter at index:",vt);const mt=e.view.filterMultiple.isHomeTeam;console.log("GSCVolumetricField - isHomeTeam type:",typeof mt,"value:",mt);let Ot;typeof mt=="boolean"?(Ot=mt?1:2,console.log("GSCVolumetricField - isHomeTeam is boolean, converting:",mt,"-> teamValue:",Ot)):typeof mt=="number"?(Ot=mt===1?1:2,console.log("GSCVolumetricField - isHomeTeam is number, using directly:",mt,"-> teamValue:",Ot)):(Ot=1,console.log("GSCVolumetricField - isHomeTeam is unknown type, using default:",Ot)),console.log("GSCVolumetricField - setting team filter directly from filterMultiple.isHomeTeam in forceSelectFilterUpdate:",Ot),m.value[0]=Ot,e.view.componentProps&&mt!==void 0&&(e.view.componentProps.isHomeTeamForAnalysis=mt===1,console.log("GSCVolumetricField - updated componentProps.isHomeTeamForAnalysis in forceSelectFilterUpdate:",e.view.componentProps.isHomeTeamForAnalysis)),p.nextTick(()=>{m.value=[...m.value],console.log("GSCVolumetricField - forced reactivity update in forceSelectFilterUpdate")})}else{console.log("GSCVolumetricField - team filter not found in forceSelectFilterUpdate!"),console.log("GSCVolumetricField - trying fallback: looking for any radio-button filter");const mt=T.value.findIndex(Ot=>Ot.type==="radio-button");if(mt!==-1){console.log("GSCVolumetricField - found radio-button filter at index:",mt);const Ot=e.view.filterMultiple.isHomeTeam;console.log("GSCVolumetricField - isHomeTeam type in fallback:",typeof Ot,"value:",Ot);let Vt;typeof Ot=="boolean"?(Vt=Ot?1:2,console.log("GSCVolumetricField - isHomeTeam is boolean in fallback, converting:",Ot,"-> teamValue:",Vt)):typeof Ot=="number"?(Vt=Ot===1?1:2,console.log("GSCVolumetricField - isHomeTeam is number in fallback, using directly:",Ot,"-> teamValue:",Vt)):(Vt=1,console.log("GSCVolumetricField - isHomeTeam is unknown type in fallback, using default:",Vt)),console.log("GSCVolumetricField - setting radio-button filter by fallback:",Vt),m.value[mt]=Vt,e.view.componentProps&&Ot!==void 0&&(e.view.componentProps.preMatchType=Ot,console.log("GSCVolumetricField - updated componentProps.preMatchType in fallback:",e.view.componentProps.preMatchType)),p.nextTick(()=>{m.value=[...m.value],console.log("GSCVolumetricField - forced reactivity update in fallback")})}else console.log("GSCVolumetricField - no radio-button filters found at all!")}}p.nextTick(()=>{b.value=!1,h.value=!1})}}function je(){if(console.log("FUNCION: forceRadioFilterUpdate"),h.value){console.log("Skipping forceRadioFilterUpdate - already in force update");return}if(u.value&&v&&v.dynamicFilters&&T.value){if(console.log("1"),y.value)return;h.value=!0,b.value=!0,v.dynamicFilters.forEach((ve,me)=>{var De,Ie;if(ve&&((De=T.value[me])==null?void 0:De.type)==="radio-button"&&(console.log("2"),ve.selectedOption&&ve.selectedOption.value!==void 0)){console.log("3"),console.log("filterData: ----------------->",ve),console.log("editFiltersJSON: ",v),console.log(`Force setting radio filter ${me} to:`,ve.selectedOption.value);const Ve=ve.selectedOption.value;m.value[me]=Ve,console.log(`Radio filter ${me} set to:`,Ve,"Type:",typeof Ve),((Ie=f.value)==null?void 0:Ie.id)===8&&(console.log("FieldPosesion - Radio filter updated to:",ve.selectedOption.value),console.log("FieldPosesion - Current dynamicFilters after update:",m.value))}}),p.nextTick(()=>{b.value=!1,h.value=!1})}}function Oe(){var ve,me,De,Ie,Ve,We,Ye,ke,ze,Fe,He,rt,nt,ht,vt,mt,Ot,Vt,qt,st,$e,lt,pt,At,_t,tt,ot,Xe,ct,kt,yt,It,Nt,Ze,et,bt,Lt,Rt,St,Ht,Ut,Yt,Wt,Gt,rr,ir;if(console.log("updateContainerOnUserChange function called"),console.log("filterAndViewsContainer:",x),console.log("isEditMode.value:",u.value),console.log("viewToEdit:",e),x&&u.value&&e){if(console.log("User made changes, updating container for specific component"),console.log("Current dynamicFilters:",m.value),console.log("Component ID:",(ve=e.view)==null?void 0:ve.id),console.log("Selected component ID:",(me=f.value)==null?void 0:me.id),y.value){console.log("Skipping container update due to container update in progress");return}if(b.value=!0,((De=f.value)==null?void 0:De.id)===4){if(console.log("Timeline - updateContainerOnUserChange - starting Timeline logic"),console.log("Timeline - current dynamicFilters:",m.value),console.log("Timeline - currentFilters:",T.value),x.setDynamicFilters(m.value,(Ie=e.view)==null?void 0:Ie.id),x.updateDynamicFilters(m.value,(Ve=e.view)==null?void 0:Ve.id),e.view.componentProps&&m.value&&m.value.length>0){const mr=m.value[0];if(console.log("Timeline - selectedEvents from dynamicFilters[0]:",mr),Array.isArray(mr)&&mr.length>0){const kr=mr.some(Fr=>Fr.event_type_id===1||typeof Fr=="string"&&Fr.includes("1")),wr=mr.some(Fr=>Fr.category_id===8||typeof Fr=="string"&&Fr.includes("8")),ar=mr.some(Fr=>Fr.category_id===9||typeof Fr=="string"&&Fr.includes("9")),xr=mr.some(Fr=>Fr.event_type_id===3||typeof Fr=="string"&&Fr.includes("3"));console.log("Timeline - Events check:",{goals:kr,yellowCards:wr,redCards:ar,substitutions:xr,selectedEvents:mr}),e.view.componentProps.selectedEvents=mr,e.view.componentProps.goals=kr,e.view.componentProps.yellowCards=wr,e.view.componentProps.redCards=ar,e.view.componentProps.substitutions=xr,e.view.componentProps.key=mr.length>0,e.view.componentProps._updateKey=Date.now(),console.log("Timeline - updated componentProps:",e.view.componentProps),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps}),console.log("Timeline - emitted force-component-update event")}}console.log("Timeline - updated specific filters for component:",(We=e.view)==null?void 0:We.id)}else if(((Ye=f.value)==null?void 0:Ye.id)===8)x.setDynamicFilters(m.value,(ke=e.view)==null?void 0:ke.id),x.updateDynamicFilters(m.value,(ze=e.view)==null?void 0:ze.id),console.log("FieldPosesion - updated specific filters for component:",(Fe=e.view)==null?void 0:Fe.id);else if(((He=f.value)==null?void 0:He.id)===3)x.setDynamicFilters(m.value,(rt=e.view)==null?void 0:rt.id),x.updateDynamicFilters(m.value,(nt=e.view)==null?void 0:nt.id),console.log("GSCMatchSummary - updated specific filters for component:",(ht=e.view)==null?void 0:ht.id);else if(((vt=f.value)==null?void 0:vt.id)===2){console.log("GSCtops - updateContainerOnUserChange - starting GSCtops logic"),console.log("GSCtops - current dynamicFilters:",m.value),console.log("GSCtops - currentFilters:",T.value),x.setDynamicFilters(m.value,(mt=e.view)==null?void 0:mt.id),x.updateDynamicFilters(m.value,(Ot=e.view)==null?void 0:Ot.id);const mr=m.value[0];if(console.log("GSCtops - newCategoryId from dynamicFilters[0]:",mr),mr!==void 0){e.view.filterMultiple||(e.view.filterMultiple={},console.log("GSCtops - created new filterMultiple object"));const wr=e.view.filterMultiple.categoryId;if(e.view.filterMultiple.categoryId=mr,console.log("GSCtops - updated filterMultiple.categoryId from",wr,"to:",mr),console.log("GSCtops - updated component filterMultiple:",e.view.filterMultiple),e.view.componentProps){let ar=`Category ${mr}`,xr=null;try{xr=Vd(mr),xr&&(ar=xr.name,console.log("GSCtops - found category info from getCategoryById:",xr))}catch{console.log("GSCtops - getCategoryById failed, using filter options");const Fr=T.value.findIndex(Er=>Er.type==="select-simple"&&Er.label==="Tipo de análisis");if(Fr!==-1){const Er=(((Vt=T.value[Fr])==null?void 0:Vt.options)||[]).find(vr=>vr.value==mr);Er&&(ar=Er.label,console.log("GSCtops - found category name from options:",ar))}}e.view.componentProps.categoryView=[{id:mr,name:ar}],console.log("GSCtops - updated componentProps.categoryView:",e.view.componentProps.categoryView),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps,filterMultiple:e.view.filterMultiple}),console.log("GSCtops - emitted force-component-update event")}}else console.log("GSCtops - newCategoryId is undefined!");const kr=m.value[1];if(console.log("GSCtops - newTeamType from dynamicFilters[1]:",kr),kr!==void 0){e.view.filterMultiple||(e.view.filterMultiple={},console.log("GSCtops - created new filterMultiple object for teamType"));const wr=e.view.filterMultiple.teamType;e.view.filterMultiple.teamType=kr,console.log("GSCtops - updated filterMultiple.teamType from",wr,"to:",kr),console.log("GSCtops - updated component filterMultiple:",e.view.filterMultiple),e.view.componentProps&&e.view.componentProps.game&&(kr===1?e.view.componentProps.teamView=e.view.componentProps.game.homeTeam.team_id:kr===2?e.view.componentProps.teamView=e.view.componentProps.game.awayTeam.team_id:e.view.componentProps.teamView=0,console.log("GSCtops - updated componentProps.teamView:",e.view.componentProps.teamView)),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps,filterMultiple:e.view.filterMultiple}),console.log("GSCtops - emitted force-component-update event for teamType")}else console.log("GSCtops - newTeamType is undefined!");console.log("GSCtops - updated specific filters for component:",(qt=e.view)==null?void 0:qt.id)}else if(((st=f.value)==null?void 0:st.id)===1){console.log("GSCComparativeReports - updateContainerOnUserChange - starting GSCComparativeReports logic"),console.log("GSCComparativeReports - current dynamicFilters:",m.value),console.log("GSCComparativeReports - currentFilters:",T.value),x.setDynamicFilters(m.value,($e=e.view)==null?void 0:$e.id),x.updateDynamicFilters(m.value,(lt=e.view)==null?void 0:lt.id);const mr=m.value[0];if(console.log("GSCComparativeReports - newCategory from dynamicFilters[0]:",mr),mr!==void 0){e.view.filterMultiple||(e.view.filterMultiple={},console.log("GSCComparativeReports - created new filterMultiple object"));const kr=e.view.filterMultiple.category;e.view.filterMultiple.category=mr,console.log("GSCComparativeReports - updated filterMultiple.category from",kr,"to:",mr),console.log("GSCComparativeReports - updated component filterMultiple:",e.view.filterMultiple),e.view.componentProps&&(e.view.componentProps.type=mr,console.log("GSCComparativeReports - updated componentProps.type:",e.view.componentProps.type)),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps,filterMultiple:e.view.filterMultiple}),console.log("GSCComparativeReports - emitted force-component-update event")}else console.log("GSCComparativeReports - newCategory is undefined!");console.log("GSCComparativeReports - updated specific filters for component:",(pt=e.view)==null?void 0:pt.id)}else if(((At=f.value)==null?void 0:At.id)===6){console.log("GSCLineupsReports - updateContainerOnUserChange - starting GSCLineupsReports logic"),console.log("GSCLineupsReports - current dynamicFilters:",m.value),console.log("GSCLineupsReports - currentFilters:",T.value),console.log("GSCLineupsReports - viewToEdit:",e),console.log("GSCLineupsReports - filterAndViewsContainer:",x),x.setDynamicFilters(m.value,(_t=e.view)==null?void 0:_t.id),x.updateDynamicFilters(m.value,(tt=e.view)==null?void 0:tt.id);const mr=m.value[0];if(console.log("GSCLineupsReports - newGameNumber from dynamicFilters[0]:",mr),mr!==void 0){e.view.filterMultiple||(e.view.filterMultiple={},console.log("GSCLineupsReports - created new filterMultiple object"));const kr=e.view.filterMultiple.gameNumber;e.view.filterMultiple.gameNumber=mr,console.log("GSCLineupsReports - updated filterMultiple.gameNumber from",kr,"to:",mr),console.log("GSCLineupsReports - updated component filterMultiple:",e.view.filterMultiple),e.view.componentProps&&(e.view.componentProps.gameNumber=mr,console.log("GSCLineupsReports - updated componentProps.gameNumber:",e.view.componentProps.gameNumber),e.view._updateKey,e.view._updateKey=Date.now(),console.log("GSCLineupsReports - updated _updateKey:",e.view._updateKey)),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps,filterMultiple:e.view.filterMultiple}),console.log("GSCLineupsReports - emitted force-component-update event"),Ei.emit("dynamic-filters-changed",{containerViewId:(ot=f.value)==null?void 0:ot.id,viewId:e.view.id,dynamicFilters:m.value}),console.log("GSCLineupsReports - emitted dynamic-filters-changed event"),Ei.emit("component-props-updated",{viewId:e.view.id,componentProps:e.view.componentProps,dynamicFilters:m.value}),console.log("GSCLineupsReports - emitted component-props-updated event"),p.nextTick(()=>{console.log("GSCLineupsReports - forcing reactivity update"),e.view.componentProps&&(e.view.componentProps={...e.view.componentProps})})}else console.log("GSCLineupsReports - newGameNumber is undefined!");console.log("GSCLineupsReports - updated specific filters for component:",(Xe=e.view)==null?void 0:Xe.id)}else if(((ct=f.value)==null?void 0:ct.id)===7){console.log("GSCGoalData - updateContainerOnUserChange - starting GSCGoalData logic"),console.log("GSCGoalData - current dynamicFilters:",m.value),console.log("GSCGoalData - currentFilters:",T.value),console.log("GSCGoalData - viewToEdit:",e),console.log("GSCGoalData - filterAndViewsContainer:",x),x.setDynamicFilters(m.value,(kt=e.view)==null?void 0:kt.id),x.updateDynamicFilters(m.value,(yt=e.view)==null?void 0:yt.id);const mr=m.value[0],kr=m.value[1];if(console.log("GSCGoalData - newAnalysisValue from dynamicFilters[0]:",mr),console.log("GSCGoalData - newTeamValue from dynamicFilters[1]:",kr),mr!==void 0&&e.view.componentProps){const wr=mr===1?"offensive":"defensive";e.view.componentProps.analysisType=wr,console.log("GSCGoalData - updated componentProps.analysisType to:",wr)}if(kr!==void 0){e.view.filterMultiple||(e.view.filterMultiple={},console.log("GSCGoalData - created new filterMultiple object"));const wr=e.view.filterMultiple.isHomeTeam,ar=kr===1;e.view.filterMultiple.isHomeTeam=ar,console.log("GSCGoalData - updated filterMultiple.isHomeTeam from",wr,"to:",ar),console.log("GSCGoalData - updated component filterMultiple:",e.view.filterMultiple),e.view.componentProps&&(e.view.componentProps.isHomeTeamForAnalysis=ar,console.log("GSCGoalData - updated componentProps.isHomeTeamForAnalysis:",e.view.componentProps.isHomeTeamForAnalysis),e.view._updateKey,e.view._updateKey=Date.now(),console.log("GSCGoalData - updated _updateKey:",e.view._updateKey)),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps,filterMultiple:e.view.filterMultiple}),console.log("GSCGoalData - emitted force-component-update event"),Ei.emit("dynamic-filters-changed",{containerViewId:(It=f.value)==null?void 0:It.id,viewId:e.view.id,dynamicFilters:m.value}),console.log("GSCGoalData - emitted dynamic-filters-changed event"),Ei.emit("component-props-updated",{viewId:e.view.id,componentProps:e.view.componentProps,dynamicFilters:m.value}),console.log("GSCGoalData - emitted component-props-updated event"),p.nextTick(()=>{console.log("GSCGoalData - forcing reactivity update"),e.view.componentProps&&(e.view.componentProps={...e.view.componentProps})})}else console.log("GSCGoalData - newTeamValue is undefined!");console.log("GSCGoalData - updated specific filters for component:",(Nt=e.view)==null?void 0:Nt.id)}else if(((Ze=f.value)==null?void 0:Ze.id)===5){console.log("GSCVolumetricField - updateContainerOnUserChange - starting GSCVolumetricField logic"),console.log("GSCVolumetricField - current dynamicFilters:",m.value),console.log("GSCVolumetricField - currentFilters:",T.value),console.log("GSCVolumetricField - viewToEdit:",e),console.log("GSCVolumetricField - filterAndViewsContainer:",x),x.setDynamicFilters(m.value,(et=e.view)==null?void 0:et.id),x.updateDynamicFilters(m.value,(bt=e.view)==null?void 0:bt.id);const mr=m.value[0];if(console.log("GSCVolumetricField - newTeamValue from dynamicFilters[0]:",mr),mr!==void 0){e.view.filterMultiple||(e.view.filterMultiple={},console.log("GSCVolumetricField - created new filterMultiple object"));const kr=e.view.filterMultiple.isHomeTeam,wr=mr===1?1:2;e.view.filterMultiple.isHomeTeam=wr,console.log("GSCVolumetricField - updated filterMultiple.isHomeTeam from",kr,"to:",wr),console.log("GSCVolumetricField - updated component filterMultiple:",e.view.filterMultiple),e.view.componentProps&&(e.view.componentProps.isHomeTeamForAnalysis=wr===1,console.log("GSCVolumetricField - updated componentProps.isHomeTeamForAnalysis:",e.view.componentProps.isHomeTeamForAnalysis),e.view._updateKey,e.view._updateKey=Date.now(),console.log("GSCVolumetricField - updated _updateKey:",e.view._updateKey)),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps,filterMultiple:e.view.filterMultiple}),console.log("GSCVolumetricField - emitted force-component-update event"),Ei.emit("dynamic-filters-changed",{containerViewId:(Lt=f.value)==null?void 0:Lt.id,viewId:e.view.id,dynamicFilters:m.value}),console.log("GSCVolumetricField - emitted dynamic-filters-changed event"),Ei.emit("component-props-updated",{viewId:e.view.id,componentProps:e.view.componentProps,dynamicFilters:m.value}),console.log("GSCVolumetricField - emitted component-props-updated event"),p.nextTick(()=>{console.log("GSCVolumetricField - forcing reactivity update"),e.view.componentProps&&(e.view.componentProps={...e.view.componentProps})})}else console.log("GSCVolumetricField - newPreMatchType is undefined!");console.log("GSCVolumetricField - updated specific filters for component:",(Rt=e.view)==null?void 0:Rt.id)}else((St=f.value)==null?void 0:St.id)===9||(x.setDynamicFilters(m.value),x.updateDynamicFilters(m.value));((Ht=f.value)==null?void 0:Ht.id)===8&&console.log("FieldPosesion - Container updated with dynamicFilters:",m.value),((Ut=f.value)==null?void 0:Ut.id)===3&&console.log("GSCMatchSummary - Container updated with dynamicFilters:",m.value),((Yt=f.value)==null?void 0:Yt.id)===2&&console.log("GSCtops - Container updated with dynamicFilters:",m.value),((Wt=f.value)==null?void 0:Wt.id)===1&&console.log("GSCComparativeReports - Container updated with dynamicFilters:",m.value),((Gt=f.value)==null?void 0:Gt.id)===6&&console.log("GSCLineupsReports - Container updated with dynamicFilters:",m.value),((rr=f.value)==null?void 0:rr.id)===5&&console.log("GSCVolumetricField - Container updated with dynamicFilters:",m.value),((ir=f.value)==null?void 0:ir.id)===9&&console.log("GSCFieldDataByZones - Container updated with dynamicFilters:",m.value),p.nextTick(()=>{b.value=!1,console.log("updateContainerOnUserChange completed")})}else console.log("updateContainerOnUserChange - conditions not met"),console.log("filterAndViewsContainer exists:",!!x),console.log("isEditMode.value:",u.value),console.log("viewToEdit exists:",!!e)}function ge(){var ve,me,De;if(!v||!v.dynamicFilters||!T.value)return!1;for(let Ie=0;Ie<v.dynamicFilters.length;Ie++){const Ve=v.dynamicFilters[Ie],We=T.value[Ie],Ye=m.value[Ie];if(!(!Ve||!We)){if(We.type==="check"){if(Ve.isChecked!==Ye)return console.log(`Check filter ${Ie} needs update: saved=${Ve.isChecked}, current=${Ye}`),!0}else if(We.type==="radio-button"){if(((ve=Ve.selectedOption)==null?void 0:ve.value)!==Ye)return console.log(`Radio filter ${Ie} needs update: saved=${(me=Ve.selectedOption)==null?void 0:me.value}, current=${Ye}`),!0}else if(We.type==="select"){const ke=((De=Ve.selectedOptions)==null?void 0:De.map(Fe=>Fe.value))||Ve.selectedValue||[],ze=Array.isArray(Ye)?Ye:[];if(JSON.stringify(ke)!==JSON.stringify(ze))return console.log(`Select filter ${Ie} needs update: saved=${JSON.stringify(ke)}, current=${JSON.stringify(ze)}`),!0}}}return console.log("No force update needed - values already match"),!1}return(ve,me)=>(p.openBlock(),p.createElementBlock("div",$le,[p.createElementVNode("button",ece,p.toDisplayString(u.value?"Editando visualización":"Nueva visualización"),1),p.createElementVNode("div",{class:p.normalizeClass(["custom-select main-select",{disabled:u.value}]),onClick:ne},[p.createElementVNode("div",tce,[p.createElementVNode("span",rce,[d.value?(p.openBlock(),p.createElementBlock("img",{key:0,src:q(d.value.name,!1),alt:"icono",class:"option-img"},null,8,nce)):(p.openBlock(),p.createElementBlock("img",ice))]),d.value?(p.openBlock(),p.createElementBlock("span",oce,p.toDisplayString(W()),1)):(p.openBlock(),p.createElementBlock("span",ace,"Tipo de vista")),p.createElementVNode("span",{class:p.normalizeClass(["arrow",{open:R.value}])},[...me[4]||(me[4]=[p.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[p.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),R.value?(p.openBlock(),p.createElementBlock("div",sce,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.value,(De,Ie)=>(p.openBlock(),p.createElementBlock("div",{key:De.id,class:p.normalizeClass(["option-card",{active:i.value===Ie}]),onClick:p.withModifiers(Ve=>re(Ie),["stop"])},[p.createElementVNode("div",cce,[p.createElementVNode("img",{src:q(De.name,!1),"data-hover-src":q(De.name,!0),alt:"icono",class:"option-img-34"},null,8,uce)]),p.createElementVNode("div",dce,[p.createElementVNode("div",hce,p.toDisplayString(De.name),1),De.description?(p.openBlock(),p.createElementBlock("div",pce,p.toDisplayString(De.description),1)):p.createCommentVNode("",!0)])],10,lce))),128))])):p.createCommentVNode("",!0)],2),d.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(["custom-select second-select",{disabled:u.value}]),onClick:X},[p.createElementVNode("div",fce,[p.createElementVNode("span",mce,[f.value?(p.openBlock(),p.createElementBlock("img",{key:0,src:f.value.url,alt:"icono",class:"option-img-graph2"},null,8,gce)):d.value?(p.openBlock(),p.createElementBlock("img",{key:1,src:q(d.value.name,!1),alt:"icono",class:"option-img"},null,8,yce)):p.createCommentVNode("",!0)]),p.createElementVNode("span",vce,p.toDisplayString(Z()),1),p.createElementVNode("span",{class:p.normalizeClass(["arrow",{open:z.value}])},[...me[5]||(me[5]=[p.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[p.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),z.value&&d.value?(p.openBlock(),p.createElementBlock("div",bce,[p.createElementVNode("div",xce,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(s.value,De=>(p.openBlock(),p.createElementBlock("div",{key:De.id,class:p.normalizeClass(["option-card-grid",{active:c.value===De.id}]),onClick:p.withModifiers(Ie=>ee(De),["stop"])},[p.createElementVNode("div",wce,p.toDisplayString(De.name||De.title),1),p.createElementVNode("div",Tce,[p.createElementVNode("img",{src:De.url,alt:"icono",class:"option-img-grid"},null,8,kce)])],10,_ce))),128))])])):p.createCommentVNode("",!0)],2)):p.createCommentVNode("",!0),f.value?(p.openBlock(),p.createElementBlock("div",Sce)):p.createCommentVNode("",!0),f.value&&T.value&&A()?(p.openBlock(),p.createElementBlock("div",{key:2,class:p.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":T.value.length>=2}])},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(T.value,(De,Ie)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:Ie},[De.type==="select"?(p.openBlock(),p.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:p.withModifiers(Ve=>K(Ie),["stop"])},[p.createElementVNode("div",Ace,[me[7]||(me[7]=p.createElementVNode("span",{class:"select-icon select-analisis-icon"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),me[8]||(me[8]=p.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(m.value[Ie])&&m.value[Ie].length>0?(p.openBlock(),p.createElementBlock("span",Cce,p.toDisplayString(m.value[Ie].length),1)):p.createCommentVNode("",!0),p.createElementVNode("span",{class:p.normalizeClass(["arrow",{open:V.value===Ie}])},[...me[6]||(me[6]=[p.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[p.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),V.value===Ie?(p.openBlock(),p.createElementBlock("div",Mce,[p.createElementVNode("div",Pce,[p.createElementVNode("div",{class:"multi-select-header",onClick:me[1]||(me[1]=p.withModifiers(()=>{},["stop"]))},[p.createElementVNode("label",Nce,[p.createElementVNode("input",{type:"checkbox",checked:P(Ie),indeterminate:N(Ie),onChange:p.withModifiers(Ve=>I(Ie),["stop"]),onClick:me[0]||(me[0]=p.withModifiers(()=>{},["stop"]))},null,40,Oce),me[9]||(me[9]=p.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(De.options,Ve=>(p.openBlock(),p.createElementBlock("div",{key:Ve.value,class:p.normalizeClass(["option-card multi-select-option",{active:E(Ie,Ve.value)}]),onClick:me[2]||(me[2]=p.withModifiers(()=>{},["stop"]))},[p.createElementVNode("div",Ice,[p.createElementVNode("input",{type:"checkbox",checked:E(Ie,Ve.value),onChange:p.withModifiers(We=>S(Ie,Ve.value),["stop"])},null,40,Rce)]),p.createElementVNode("div",{class:"option-content",onClick:We=>S(Ie,Ve.value)},[p.createElementVNode("div",zce,p.toDisplayString(Ve.label),1)],8,Lce)],2))),128))]),p.createElementVNode("div",Dce,[p.createElementVNode("button",{class:"btn-listo",onClick:me[3]||(me[3]=p.withModifiers(Ve=>Me(),["stop"]))},"Listo")])])):p.createCommentVNode("",!0)],8,Ece)):De.type==="radio-button"?(p.openBlock(),p.createElementBlock("div",Bce,[p.createElementVNode("div",Vce,p.toDisplayString(De.label),1),p.createElementVNode("div",Fce,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(De.options,Ve=>(p.openBlock(),p.createElementBlock("label",{key:Ve.value,class:p.normalizeClass(["radio-option-card",{active:m.value[Ie]===Ve.value}])},[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"dynamic-radio-"+Ie,value:Ve.value,"onUpdate:modelValue":We=>m.value[Ie]=We,disabled:k(Ve.value,Ve.label),onChange:()=>{var We,Ye,ke;if(console.log("Radio button changed for GSCFieldDataByZones:",m.value[Ie]),((We=f.value.value)==null?void 0:We.id)===9&&u.value.value&&(ke=(Ye=p.unref(e))==null?void 0:Ye.view)!=null&&ke.filterMultiple){const ze=m.value[Ie]===1;p.unref(e).view.filterMultiple.isHomeTeam=ze,console.log("GSCFieldDataByZones - preserved radio-button value in filterMultiple:",ze)}u.value.value&&Oe(),he()}},null,40,jce),[[p.vModelRadio,m.value[Ie]]]),p.createElementVNode("span",null,p.toDisplayString(Ve.label),1)],2))),128))])])):De.type==="check"?(p.openBlock(),p.createElementBlock("div",Uce,[p.createElementVNode("label",null,[p.withDirectives(p.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":Ve=>m.value[Ie]=Ve,checked:m.value[Ie],onChange:()=>{console.log(`Checkbox ${Ie} changed to:`,m.value[Ie]),u.value.value&&Oe(),he()}},null,40,qce),[[p.vModelCheckbox,m.value[Ie]]]),p.createTextVNode(" "+p.toDisplayString(De.label),1)])])):De.type==="select-simple"?(p.openBlock(),p.createElementBlock("div",{key:3,class:"custom-select dynamic-select filter-inline","data-filter-type":De.type,onClick:p.withModifiers(Ve=>te(Ie),["stop"])},[p.createElementVNode("div",Gce,[me[11]||(me[11]=p.createElementVNode("span",{class:"select-icon select-analisis-icon"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),me[12]||(me[12]=p.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),p.createElementVNode("span",{class:p.normalizeClass(["arrow",{open:U.value===Ie}])},[...me[10]||(me[10]=[p.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[p.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),U.value===Ie?(p.openBlock(),p.createElementBlock("div",Hce,[p.createElementVNode("div",Xce,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(De.options,Ve=>(p.openBlock(),p.createElementBlock("div",{key:Ve.value,class:p.normalizeClass(["option-card simple-select-option",{active:m.value[Ie]===Ve.value}]),onMouseenter:We=>Te(Ie,Ve.value),onClick:p.withModifiers(We=>ae(Ie,Ve.value),["stop"])},[p.createElementVNode("div",Jce,[p.createElementVNode("div",Kce,p.toDisplayString(Ve.label),1)]),m.value[Ie]===Ve.value?(p.openBlock(),p.createElementBlock("div",Zce,[...me[13]||(me[13]=[p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[p.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)],42,Yce))),128))])])):p.createCommentVNode("",!0)],8,Wce)):p.createCommentVNode("",!0),Ie===1&&T.value.length>2?(p.openBlock(),p.createElementBlock("div",Qce)):p.createCommentVNode("",!0)],64))),128))],2)):p.createCommentVNode("",!0),u.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("button",{key:3,class:"cancel-btn",onClick:xe},"Cancelar")),t.value?(p.openBlock(),p.createElementBlock("button",{key:4,class:"ok-btn",onClick:_e},"OK")):p.createCommentVNode("",!0)]))}}),eue=dd($ce,[["__scopeId","data-v-3c21b79b"]]),tue={key:0,class:"modal-simple"},rue={class:"modal-simple__content"},nue={class:"modal-simple__content__header"},iue={class:"modal-simple__content__body"},aue={class:"modal-simple__content__footer"},oue={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(r){return(a,g)=>(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[r.modelValue?(p.openBlock(),p.createElementBlock("div",tue,[p.createElementVNode("div",rue,[p.createElementVNode("div",nue,[p.renderSlot(a.$slots,"header",{},void 0,!0)]),p.createElementVNode("div",iue,[p.renderSlot(a.$slots,"body",{},void 0,!0)]),p.createElementVNode("div",aue,[p.renderSlot(a.$slots,"footer",{},void 0,!0)])])])):p.createCommentVNode("",!0)]))}},sue=dd(oue,[["__scopeId","data-v-1cc4f590"]]),lue={class:"footer"},cue={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(r,{emit:a}){const g=a;function B(C){g("update:modelValue",C)}function J(C){g("action",C),g("update:modelValue",!1)}return(C,x)=>(p.openBlock(),p.createBlock(sue,{"modle-value":r.value,"onUpdate:modelValue":B},{header:p.withCtx(()=>[...x[2]||(x[2]=[p.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:p.withCtx(()=>[...x[3]||(x[3]=[p.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:p.withCtx(()=>[p.createElementVNode("div",lue,[p.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:x[0]||(x[0]=e=>J(!1))}," Seguir editando "),p.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:x[1]||(x[1]=e=>J(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},uue=dd(cue,[["__scopeId","data-v-ed9b5088"]]),due={key:0,class:"modal-simple"},hue={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(r){return(a,g)=>(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[p.createVNode(p.Transition,null,{default:p.withCtx(()=>[r.modelValue?(p.openBlock(),p.createElementBlock("div",due,[...g[0]||(g[0]=[p.createElementVNode("div",{class:"modal-simple__content"},[p.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M29.3346 14.7823V16.0089C29.333 18.8842 28.402 21.6818 26.6804 23.9847C24.9589 26.2876 22.539 27.9722 19.7818 28.7875C17.0245 29.6027 14.0776 29.5048 11.3806 28.5084C8.68354 27.512 6.38084 25.6704 4.81592 23.2584C3.25099 20.8463 2.50769 17.993 2.69687 15.124C2.88605 12.255 3.99758 9.52404 5.86568 7.33836C7.73377 5.15269 10.2583 3.62944 13.0629 2.9958C15.8674 2.36215 18.8017 2.65205 21.428 3.82227",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),p.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):p.createCommentVNode("",!0)]),_:1})]))}},pue=dd(hue,[["__scopeId","data-v-2bc30783"]]),fue={class:"template-maker__header"},mue={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},gue={class:"template-maker__content"},yue={class:"template-maker__content__main"},vue={id:"containerMain",class:"container-main"},bue={class:"template-maker__content__main__cover-selector"},xue=["id"],_ue={class:"page-indicator"},wue={class:"page-indicator__index"},Tue=["onClick"],kue=["onClick"],Sue={key:0,class:"template-maker__content__main__footer"},Eue={class:"template-maker__content__main__footer__paginator"},Aue={class:"template-maker__content__main__footer__paginator__nav"},Cue={class:"template-maker__content__main__footer__paginator__numbers"},Mue=["onClick"],Pue={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(r,{expose:a,emit:g}){const B=new Map,J=p.ref([{title:"Page 1",id:String(Date.now()),items:[{name:"Volumetrica",id:`w-${String(Date.now())}`,x:0,y:0,w:4,h:6,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}},{name:"Volumetrica",id:String(Date.now()),x:4,y:0,w:4,h:4,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}}]}]),C=p.ref(null),x=p.ref(0),e=p.ref(!1),v=p.ref(null),u=p.ref(null),t=p.ref(!0),w=p.ref(!1),y=p.ref(!1),b=p.ref(0),h=p.ref(!1),n=p.ref(null),i=p.ref(new Map),d=p.ref(null),s=p.ref(null),c=p.ref(!1),f=p.ref(!1),m=p.ref(!1),T=p.computed(()=>({"--overflow-y-template-maker":w.value?"scroll":"hidden","--height-container-main":w.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(w.value,"0")})),E=p.computed(()=>x.value+1);p.watch(()=>e.value,Te=>{const Ce=document.getElementById("app");Te?(x.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",Ce&&(Ce.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",Ce&&(Ce.style.overflow=""))});function S(Te){return Te<10?`0${Te}`:Te}async function P({templateId:Te,userId:Ce}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Ce}/templates/${Te}`,{method:"GET",headers:{Authorization:K.token}})).json()).data}catch(Ne){console.error("Error fetching template by ID:",Ne)}}async function N({reportId:Te,userId:Ce}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Ce}/reports/${Te}`,{method:"GET",headers:{Authorization:K.token}})).json()).data}catch(Ne){console.error("Error fetching report by ID:",Ne)}}let A=0;function O(Te){C.value=Te,A>0&&(c.value=!0),A++}function M(Te){Te&&oe(null,!0)}let k=null;function I(Te,Ce){let Ne=Te.getBoundingClientRect(),Re={height:Te.clientHeight,width:Te.clientWidth},Ge=Ce.getBoundingClientRect();if(!(Ge.top>=Ne.top&&Ge.bottom<=Ne.top+Re.height)){const Pe=Ge.top-Ne.top,je=Ge.bottom-Ne.bottom;Math.abs(Pe)<Math.abs(je)?Te.scrollTop+=Pe:Te.scrollTop+=je}}function _(Te,Ce){let Ne=Te.getBoundingClientRect();const Re=Ce.getBoundingClientRect().top-Ne.top;Te.scrollTop+=Re}function R(Te,Ce=!1){const Ne={title:`Page ${J.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(ye(),Te!==void 0&&Te>=-1?J.value.splice(Te+1,0,Ne):J.value.push(Ne),p.nextTick(()=>{const Re=J.value.findIndex(Pe=>Pe.id===Ne.id),Ge=document.getElementById(`page-${Re+1}`);k||(k=document.getElementById("containerMain")),Ge&&k?I(k,Ge):console.error("Page element or container main element not found")}),Ce)return Ne;c.value=!0}function z(Te){if(console.log("onClickPage",Te),Te<0||Te>J.value.length){console.log("Invalid page index:",Te,"Valid range: 0 to",J.value.length);return}x.value=Te;const Ce=document.getElementById(`page-${Te}`);if(console.log("pageElement found:",Ce),k||(k=document.getElementById("containerMain")),console.log("containerMainEl found:",k),Ce&&k){const Ne=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(Ne),_(k,Ce),setTimeout(()=>{const Re=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Re)},300)}else console.error("Page element or container main element not found")}function V(Te){d.value=Te,h.value=!0}function U(Te,Ce){const Ne=Ce+1;Te&&x.value!==Ne&&(x.value=Ne)}function q(Te){h.value=!0,Ei.emit("edit-view",{view:Te})}async function W({templateReportId:Te,userId:Ce,isTemplateMode:Ne}){try{return Ne?P({templateId:Te,userId:Ce}):N({reportId:Te,userId:Ce})}catch(Re){throw new Error("Error fetching template or report by ID: "+Re.message)}}function Z(){A=0,h.value=!1,x.value=0,d.value=null,s.value=null,i.value.clear(),k=null}async function ne(Te){if(console.log("show, initialConfig",Te),Z(),t.value=Te.isTemplateMode,console.log("****************************************** isTemplateMode.value",t.value),w.value=!!Te.isPDFMode,Te.isPDFMode?v.value=await N({reportId:Te.reportId,userId:Te.userId}):(v.value=Te.template,v.value=await W({templateReportId:Te.template.id,userId:Te.template.user_id,isTemplateMode:Te.isTemplateMode})),!v.value)return;v.value&&v.value.game&&(v.value.game=ae(v.value.game)),console.log("templateToEdit.value",v.value),u.value=JSON.parse(JSON.stringify(v.value)),y.value=v.value.template_type===2;const Ce=v.value.pages.find(Ne=>Ne.is_front_page);b.value=Ce?Ce.type:1,e.value=!0,J.value=v.value.pages.reduce((Ne,Re,Ge)=>{if(!Re.is_front_page){Re.name||(Re.name="");const Pe={originalPage:JSON.parse(JSON.stringify(Re)),title:Re.name,id:`p-${Date.now()-Ge*9}`,items:[],components:Re.components};Re.components&&Re.components.length>0&&(Pe.items=Re.components.map((je,Oe)=>{const ge=new Up(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],je.coreView.id,je.dynamicFilters,y.value,t.value,je.filtersJSON||null,K.token),ve={originalComponent:JSON.parse(JSON.stringify(je)),title:je.title,shortTitle:je.shortTitle||je.title,game:v.value.game,idAux:je.id,id:`w-${Date.now()-Oe*7}`,x:je.column,y:je.row,w:je.colspan,h:je.rowspan,maxWidth:je.max_column,maxHeight:je.max_row,minWidth:je.min_column,minHeight:je.min_row,noResize:!t.value,noMove:!t.value,coreView:je.coreView||null,isTemplateMode:t.value,componentName:je.componentName,componentProps:ee({currentProps:je.componentProps,coreView:je.coreView,isTemplateMode:t.value,templateToEdit:v.value,filterMultiple:je.filterMultiple||null,game:v.value.game||null})||{},filterMultiple:je.filterMultiple,isHomeTeam:re({game:v.value.game,isTemplateMode:t.value,currentIsHomeTeam:je.isHomeTeam||je.componentProps.isHomeTeamForAnalysis}),filtersJSON:je.filtersJSON||null,dynamicFilters:je.dynamicFilters||[],filterAndViewsContainer:ge},me=p.reactive({view:ve});return ge.addView(me,!0),i.value.set(ge.getId(),ge),ve})),Ne.push(Pe)}return Ne},[]),console.log("pages.value",J.value),console.log("isvisible.value",e.value)}function X({game:Te,isTemplateMode:Ce}){const Ne=Te&&Te.homeTeam&&Te.awayTeam&&(Te.homeTeam.team_id===K.userTeamId||Te.awayTeam.team_id===K.userTeamId);return{isUserTeamHome:Ne&&Te.homeTeam.team_id===K.userTeamId,requiresUserTeamAdjustment:Ne&&!Ce}}function re({game:Te,isTemplateMode:Ce,currentIsHomeTeam:Ne}){const{isUserTeamHome:Re,requiresUserTeamAdjustment:Ge}=X({game:Te,isTemplateMode:Ce});return Ge?Ne?Re:!Re:Ne}function ee({currentProps:Te,coreView:Ce,templateToEdit:Ne,isTemplateMode:Re,filterMultiple:Ge,game:Pe}){if(!Te||!Ce)return Te||{};const{isUserTeamHome:je,requiresUserTeamAdjustment:Oe}=X({game:Pe,isTemplateMode:Re}),ge={...Te};if(Ce.id===5&&(ge.isGhostEffect=Re,Oe)){const ve=ge.preMatchType===1;ge.preMatchType=ve?je?1:2:je?2:1}if(Ce.id===7&&Oe){const ve=ge.isHomeTeamForAnalysis;ge.isHomeTeamForAnalysis=ve?je:!je}if(Ce.id===9&&Oe){const ve=ge.isHomeTeamForAnalysis;ge.isHomeTeamForAnalysis=ve?je:!je}if(Ce.id===10&&Oe){const ve=ge.isHomeTeamForAnalysis;ge.isHomeTeamForAnalysis=ve?je:!je}if(Ce.id===1&&(ge.gameId=Pe?Pe.id:"",ge.homeLogo=Pe?Pe.homeTeam.logo:"",ge.awayLogo=Pe?Pe.awayTeam.logo:"",ge.seasonId=Pe?Pe.season_id:0,ge.default=Re),Ce.id===6&&(ge.game=Pe||"",ge.lastGames=Ne.last_games,ge.selectedOption=Ne.template_type===2?"Postmatch":"Prematch"),Ce.id===3&&(ge.defaultShields=Re),Ce.id===2){let ve=!0,me=0,De=0;Pe&&(ve=Ne.main_team==Pe.home_team||Ne.main_team==Pe.visiting_team,me=ve?Ne.main_team==(Pe==null?void 0:Pe.home_team)?Pe==null?void 0:Pe.home_team:Pe==null?void 0:Pe.visiting_team:Pe==null?void 0:Pe.home_team,De=ve?Ne.main_team==(Pe==null?void 0:Pe.home_team)?Pe==null?void 0:Pe.visiting_team:Pe==null?void 0:Pe.home_team:Pe==null?void 0:Pe.visiting_team),console.log("<- 1 -> ******************** component props //////////////////////////////////",Te),console.log("<- 2 -> ********************",Ce),console.log("<- 3 -> ********************",Ne),console.log("<- 4 -> ********************",Ge),ge.gamed=Pe?Pe.id:"",ge.game=Pe||"",ge.season=Pe?Pe.season_id:0,ge.teamView=Ge.teamType==3?0:Ge.teamType==1?me:De,ge.useDummyData=Re}return Ce.id===8&&(ge.teamSelected=Pe?{teamId:Pe.home_team}:1,ge.isDefault=Re),Ce.id===4&&(ge.gameId=Pe?Pe.id:"",ge.isDefault=Re,ge.homeTeam=Pe?Pe==null?void 0:Pe.home_team:"",ge.awayTeam=Pe?Pe==null?void 0:Pe.visiting_team:""),Pe&&(ge.game=Pe),ge}const K=r,te=g;p.watch(()=>K.token,(Te,Ce)=>{console.log("Token changed:",{newToken:Te,oldToken:Ce})},{immediate:!0}),a({show:ne}),Ei.on("add-page-view",Te=>{console.log("88888888888888888888888888888888888888888888888888888888888888888"),console.log("viewConfig",Te),B.set(Te.view.id,Te.view);const Ce=J.value.find(Ne=>Ne.id===Te.pageId);Ce&&(Ce.items||(Ce.items=[]),Ce.items.push(Te.view),p.nextTick(()=>{const Ne=document.querySelector(`[gs-id="${Te.view.id}"]`);Te.grid.makeWidget(Ne)}))}),Ei.on("add-page-and-view",Te=>{const Ce=J.value.findIndex(Ne=>Ne.id===Te.pageId);if(Ce>-1){const Ne=R(Ce,!0);setTimeout(()=>{Ei.emit("add-view",{pageId:Ne.id,view:Te.view,filterAndWidgetContainer:Te.filterAndWidgetContainer}),s.value&&(Ne.stepBackPage=s.value),s.value=Ne},500)}else console.error("Page not found for adding view:",Te.pageId)}),Ei.on("empty-page",Te=>{h.value&&d.value&&d.value.id===Te.id||(_e(Te),s.value&&s.value.id===Te.id&&(s.value.stepBackPage?s.value=s.value.stepBackPage:s.value=null))}),Ei.on("filters-cancelled",Te=>{Te&&Te.removeAllChildViews()}),Ei.on("activate-save-button",()=>{console.log("GSC-TemplateReportMaker - activate-save-button event received"),c.value=!0,console.log("GSC-TemplateReportMaker - isSaveActive set to true")});function ae(Te){return{...Te,gameId:Te.game_id,id:Te.game_id,seasonId:Te.season_id,status:Te.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${Te.home_team}.png`,team_id:Te.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${Te.home_team}.png`,colloquial_name:Te.home_team_name,acronym:Te.home_team_acronym,team_name:Te.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${Te.visiting_team}.png`,team_id:Te.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${Te.visiting_team}.png`,colloquial_name:Te.visiting_team_name,acronym:Te.visiting_team_acronym,team_name:Te.visiting_team_name}}}function oe(Te,Ce=!1){Ce||!t.value?(e.value=!1,Z(),te("close")):c.value?f.value=!0:(e.value=!1,Z(),te("close"))}function he(){n.value=null,h.value=!1}function fe({page:Te,view:Ce,applyMinimumSize:Ne=!1}){const Re=Te.grid;if(!Te||!Ce||!Re)return null;const Ge=Ne?{w:Ce.min_column,h:Ce.min_row}:{w:Ce.colspan,h:Ce.rowspan},Pe=Re.willItFit(0,0,Ge.w,Ge.h,!0);return Pe?{willFit:Pe,applyMinimumSize:Ne}:Ne?null:fe({page:Te,view:Ce,applyMinimumSize:!0})}const se=new Set([9]);function ue(Te){var Ce,Ne,Re,Ge,Pe,je,Oe;if(console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"),console.log("onFiltersChanged",Te),Te.dynamicFilters&&Te.dynamicFilters.length>0&&Te.viewToEdit&&Te.viewToEdit.view){const ge=Te.viewToEdit.view.id;J.value.forEach(ve=>{ve.items.forEach(me=>{me.id===ge&&me.coreView&&me.coreView.id===3&&(me.componentProps.desplegable=Te.dynamicFilters[0]||!1,me.componentProps.key=Te.dynamicFilters[0]||!1,p.nextTick(()=>{Ei.emit("force-component-update",{itemId:me.id,componentProps:me.componentProps})}))})})}if(console.log("filters.viewToEdit",Te.viewToEdit),Te.viewToEdit){if(!Te.viewToEdit.view.filterAndViewsContainer){const ge=new Up(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[Te.viewToEdit],((Ce=Te.viewToEdit.view.coreView)==null?void 0:Ce.id)||Te.viewToEdit.view.id,Te.dynamicFilters||[],y.value,t.value,Te.filtersJSON,K.token);Te.viewToEdit.view.filterAndViewsContainer=ge}Te.viewToEdit.view.filterAndViewsContainer.updateView({view:Te.viewToEdit,dynamicFilters:Te.dynamicFilters||[],filtersJSON:Te.filtersJSON||null}),c.value=!0}else if(Te.view){Te.view.id&&Te.filterAndViewsContainer&&Te.view.id!==Te.filterAndViewsContainer.viewId&&(Te.filterAndViewsContainer.removeAllChildViews(),Te.filterAndViewsContainer.setViewId(Te.view.id),Te.filterAndViewsContainer.setFiltersJSON(Te.filtersJSON||null)),Te.view.id&&se.has(Te.view.id)&&Te.dynamicFilters[0]&&Te.dynamicFilters[0].length===0&&Te.filterAndViewsContainer&&(Te.filterAndViewsContainer.updateDynamicFilters(Te.dynamicFilters,(Re=(Ne=Te.viewToEdit)==null?void 0:Ne.view)==null?void 0:Re.id),c.value=!0);const ge=s.value||d.value,ve=fe({page:ge,view:Te.view,applyMinimumSize:!1});Te.view.filtersJSON=Te.filtersJSON||null;const me=Te.filterAndViewsContainer,De=J.value.findIndex(Ie=>Ie.id===ge.id);if(me){const Ie=Te.filterAndViewsContainer.getRequiresAddView(Te.dynamicFilters);console.log("111111111111111111111111111111111"),console.log("requiersAddView",Ie),Ie?(me.setDynamicFilters(Te.dynamicFilters),(ve||De===J.value.length-1)&&(Ei.emit("add-view",{pageId:ge.id,view:Te.view,filterAndWidgetContainer:me,avoidWillFit:!1,applyMinimumSize:ve?ve.applyMinimumSize:!1,dynamicFilters:Te.dynamicFilters}),Te.filterAndViewsContainer.updateDynamicFilters(Te.dynamicFilters,(Pe=(Ge=Te.viewToEdit)==null?void 0:Ge.view)==null?void 0:Pe.id),c.value=!0,setTimeout(()=>{Te.filterAndViewsContainer.getRequiresAddView(Te.dynamicFilters)?(console.log("GSCtops - still requires add view, calling recursively"),ue(Te)):console.log("GSCtops - no more views needed, stopping recursion")},1e3))):(Te.filterAndViewsContainer.updateDynamicFilters(Te.dynamicFilters,(Oe=(je=Te.viewToEdit)==null?void 0:je.view)==null?void 0:Oe.id),c.value=!0)}else if(ve||De===J.value.length-1){const Ie=new Up(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],Te.view.id,Te.dynamicFilters,y.value,t.value,Te.filtersJSON,K.token);Ei.emit("set-filter-and-views-container",Ie),i.value.set(Ie.getId(),Ie),Te.dynamicFilters&&Array.isArray(Te.dynamicFilters[0])?(Te.filterAndViewsContainer=Ie,ue(Te)):Ei.emit("add-view",{pageId:ge.id,view:Te.view,filterAndWidgetContainer:Ie,avoidWillFit:!1,applyMinimumSize:ve?ve.applyMinimumSize:!1,dynamicFilters:Te.dynamicFilters}),c.value=!0}}}async function de(){if(c.value)try{const Te=[{is_front_page:!0,template_type:C.value.isPostMatch?2:1,type:C.value.id},...J.value.map(Ne=>({columns:Ne.originalPage?Ne.originalPage.columns:12,rows:Ne.originalPage?Ne.originalPage.rows:12,gap:Ne.originalPage?Ne.originalPage.gap:10,name:Ne.title,width:Ne.originalPage?Ne.originalPage.width:968,height:Ne.originalPage?Ne.originalPage.height:702,components:Ne.items.map(Re=>({min_column:Re.minWidth,min_row:Re.minHeight,max_column:Re.maxWidth,max_row:Re.maxHeight,column:Re.x,row:Re.y,colspan:Re.w,rowspan:Re.h,name:Re.name,title:Re.title,titleShort:Re.titleShort||Re.title,dynamicFilters:Re.filterAndViewsContainer.getComponentDynamicFilters(Re.id)||Re.filterAndViewsContainer.getDynamicFilters()||[],coreView:Re.coreView||null,componentName:Re.componentName,componentProps:Re.componentProps||{},isHomeTeam:Re.isHomeTeam||Re.componentProps.isHomeTeamForAnalysis,filterMultiple:Re.filterMultiple}))}))];console.log("pagesAuxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),console.log(Te);const Ce=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${v.value.user_id}/templates/${v.value.id}/pages`,{method:"PATCH",headers:{Authorization:K.token},body:JSON.stringify({pages:Te})});m.value=!0,await Ce.json(),c.value=!1,setTimeout(()=>{m.value=!1},2e3)}catch(Te){console.error("Error saving template:",Te)}}function ye(){J.value.forEach(Te=>{Te.offListeners&&Te.offListeners()})}function _e(Te){const Ce=J.value.findIndex(Ne=>Ne.id===Te.id);Ce>-1&&(ye(),J.value=J.value.filter(Ne=>Ne.id!==Te.id),x.value>=Ce&&(x.value=Math.max(0,x.value-1)),c.value=!0)}function xe(){c.value=!0}function Se(Te){const Ce=J.value.find(Ne=>Ne.items.some(Re=>Re.id===Te.id));if(Ce){const Ne=Ce.items.findIndex(Re=>Re.id===Te.id);Ne!==-1&&(Ce.items.splice(Ne,1),c.value=!0)}}function Me(Te){console.log("onChangeSort",Te)}return(Te,Ce)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(uue,{modelValue:f.value,"onUpdate:modelValue":Ce[0]||(Ce[0]=Ne=>f.value=Ne),onAction:M},null,8,["modelValue"]),p.createVNode(pue,{"model-value":m.value},null,8,["model-value"]),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[e.value&&v.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:"template-maker",style:p.normalizeStyle(T.value)},[p.withDirectives(p.createVNode(eue,{token:r.token,view:n.value,"is-post-match":y.value,onClose:he,onFiltersChanged:ue},null,8,["token","view","is-post-match"]),[[p.vShow,t.value&&h.value]]),p.createElementVNode("div",fue,[p.createTextVNode(p.toDisplayString(v.value?v.value.name:"Nuevo template")+" ",1),p.createElementVNode("div",{class:"template-maker__header__close",onClick:oe},[w.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("svg",mue,[...Ce[6]||(Ce[6]=[p.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),p.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),p.createElementVNode("div",gue,[Ce[13]||(Ce[13]=p.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),p.createElementVNode("div",yue,[p.createElementVNode("div",vue,[p.createElementVNode("div",bue,[p.withDirectives(p.createVNode(QT,{"is-post-match":y.value,"initial-cover-id":b.value,onSelectCover:O},null,8,["is-post-match","initial-cover-id"]),[[p.vShow,t.value]])]),(p.openBlock(),p.createElementBlock("div",{class:"template-maker__content__main__pages",key:J.value.length},[C.value?(p.openBlock(),p.createBlock(Qle,{key:0,id:"page-0",game:v.value.game||null,"cover-id":C.value.id,"is-post-match":C.value.isPostMatch,onIntersectionChanged:Ce[1]||(Ce[1]=Ne=>U(Ne,-1))},null,8,["game","cover-id","is-post-match"])):p.createCommentVNode("",!0),t.value?(p.openBlock(),p.createElementBlock("div",{key:1,class:"new-items-buttons",style:p.normalizeStyle({"margin-bottom":J.value.length===0?"30px":"0"})},[h.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Ce[2]||(Ce[2]=Ne=>R(-1))},[...Ce[7]||(Ce[7]=[p.createElementVNode("div",null,"+ Nueva página",-1),p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M8.66797 1.33203H4.0013C3.64768 1.33203 3.30854 1.47251 3.05849 1.72256C2.80844 1.9726 2.66797 2.31174 2.66797 2.66536V13.332C2.66797 13.6857 2.80844 14.0248 3.05849 14.2748C3.30854 14.5249 3.64768 14.6654 4.0013 14.6654H12.0013C12.3549 14.6654 12.6941 14.5249 12.9441 14.2748C13.1942 14.0248 13.3346 13.6857 13.3346 13.332V5.9987L8.66797 1.33203Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):p.createCommentVNode("",!0),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(J.value,(Ne,Re)=>(p.openBlock(),p.createElementBlock("div",{key:Re,id:`page-${Re+1}`,class:"template-maker__content__main__pages__page"},[p.createElementVNode("div",_ue,[p.createElementVNode("div",wue,"Pag "+p.toDisplayString(S(Re+2)),1)]),C.value?(p.openBlock(),p.createBlock(ele,{key:0,page:Ne,"is-template-mode":t.value,"is-post-match":C.value.isPostMatch,game:v.value.game||null,lastGames:v.value.lastGames||[],"is-filter-visible":h.value,onEditView:q,onIntersectionChanged:Ge=>U(Ge,Re),onChangeSort:Me,onDeletePage:_e,onViewChanged:xe,onDeleteView:Se},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):p.createCommentVNode("",!0),t.value&&!h.value?(p.openBlock(),p.createElementBlock("div",{key:1,class:"new-items-buttons",style:p.normalizeStyle({"margin-bottom":Re+1===J.value.length?"30px":"0","margin-top":"10px"})},[p.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:Ge=>R(Re)},[...Ce[8]||(Ce[8]=[p.createElementVNode("div",null,"+ Nueva página",-1),p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M8.66797 1.33203H4.0013C3.64768 1.33203 3.30854 1.47251 3.05849 1.72256C2.80844 1.9726 2.66797 2.31174 2.66797 2.66536V13.332C2.66797 13.6857 2.80844 14.0248 3.05849 14.2748C3.30854 14.5249 3.64768 14.6654 4.0013 14.6654H12.0013C12.3549 14.6654 12.6941 14.5249 12.9441 14.2748C13.1942 14.0248 13.3346 13.6857 13.3346 13.332V5.9987L8.66797 1.33203Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,Tue),p.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:Ge=>V(Ne)},[...Ce[9]||(Ce[9]=[p.createElementVNode("div",null,"+ Agregar gráfico",-1),p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,kue)],4)):p.createCommentVNode("",!0)],8,xue))),128))]))]),w.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",Sue,[p.createElementVNode("div",Eue,[p.createElementVNode("div",Aue,[p.createElementVNode("div",null,"Páginas "+p.toDisplayString(E.value),1),p.createElementVNode("div",{class:p.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:x.value<=0}]),onClick:Ce[3]||(Ce[3]=Ne=>x.value>0&&z(x.value-1))},[...Ce[10]||(Ce[10]=[p.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.22444 5L5.29079 8.57741C5.56974 8.90285 5.56974 9.43049 5.29079 9.75592C5.01184 10.0814 4.55958 10.0814 4.28064 9.75592L0.709209 5.58926C0.430263 5.26382 0.430263 4.73618 0.709209 4.41074L4.28064 0.244078C4.55958 -0.0813593 5.01184 -0.0813592 5.29079 0.244078C5.56974 0.569515 5.56974 1.09715 5.29079 1.42259L2.22444 5Z",fill:"#92929D"})],-1)])],2),p.createElementVNode("div",{class:p.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:x.value>=J.value.length}]),onClick:Ce[4]||(Ce[4]=Ne=>x.value<J.value.length&&z(x.value+1))},[...Ce[11]||(Ce[11]=[p.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.77556 5L0.70921 8.57741C0.430264 8.90285 0.430264 9.43049 0.70921 9.75592C0.988156 10.0814 1.44042 10.0814 1.71936 9.75592L5.29079 5.58926C5.56974 5.26382 5.56974 4.73618 5.29079 4.41074L1.71936 0.244078C1.44042 -0.0813593 0.988155 -0.0813592 0.709209 0.244078C0.430264 0.569515 0.430264 1.09715 0.70921 1.42259L3.77556 5Z",fill:"#92929D"})],-1)])],2)]),p.createElementVNode("div",Cue,[p.createElementVNode("div",{role:"button",class:p.normalizeClass({active:x.value===0}),onClick:Ce[5]||(Ce[5]=Ne=>z(0))},p.toDisplayString(S(1)),3),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(J.value,(Ne,Re)=>(p.openBlock(),p.createElementBlock("div",{role:"button",key:Re,class:p.normalizeClass({active:Re+1===x.value}),onClick:Ge=>z(Re+1)},p.toDisplayString(S(Re+2)),11,Mue))),128))])]),t.value?(p.openBlock(),p.createElementBlock("div",{key:0,role:"button",class:p.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!c.value}]),onClick:de},[...Ce[12]||(Ce[12]=[p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M12.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V3.33333C2 2.97971 2.14048 2.64057 2.39052 2.39052C2.64057 2.14048 2.97971 2 3.33333 2H10.6667L14 5.33333V12.6667C14 13.0203 13.8595 13.3594 13.6095 13.6095C13.3594 13.8595 13.0203 14 12.6667 14Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),p.createElementVNode("div",null,"Guardar",-1)])],2)):p.createCommentVNode("",!0)]))])])],4)):p.createCommentVNode("",!0)]))],64))}},Nue=dd(Pue,[["__scopeId","data-v-cd17536c"]]);function z6(r,a){return function(){return r.apply(a,arguments)}}const{toString:Oue}=Object.prototype,{getPrototypeOf:H2}=Object,{iterator:oy,toStringTag:D6}=Symbol,sy=(r=>a=>{const g=Oue.call(a);return r[g]||(r[g]=g.slice(8,-1).toLowerCase())})(Object.create(null)),ed=r=>(r=r.toLowerCase(),a=>sy(a)===r),ly=r=>a=>typeof a===r,{isArray:qp}=Array,am=ly("undefined");function om(r){return r!==null&&!am(r)&&r.constructor!==null&&!am(r.constructor)&&fu(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const B6=ed("ArrayBuffer");function Iue(r){let a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(r):a=r&&r.buffer&&B6(r.buffer),a}const Rue=ly("string"),fu=ly("function"),V6=ly("number"),sm=r=>r!==null&&typeof r=="object",Lue=r=>r===!0||r===!1,cy=r=>{if(sy(r)!=="object")return!1;const a=H2(r);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(D6 in r)&&!(oy in r)},zue=r=>{if(!sm(r)||om(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},Due=ed("Date"),Bue=ed("File"),Vue=ed("Blob"),Fue=ed("FileList"),jue=r=>sm(r)&&fu(r.pipe),Uue=r=>{let a;return r&&(typeof FormData=="function"&&r instanceof FormData||fu(r.append)&&((a=sy(r))==="formdata"||a==="object"&&fu(r.toString)&&r.toString()==="[object FormData]"))},que=ed("URLSearchParams"),[Wue,Gue,Hue,Xue]=["ReadableStream","Request","Response","Headers"].map(ed),Yue=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function lm(r,a,{allOwnKeys:g=!1}={}){if(r===null||typeof r>"u")return;let B,J;if(typeof r!="object"&&(r=[r]),qp(r))for(B=0,J=r.length;B<J;B++)a.call(null,r[B],B,r);else{if(om(r))return;const C=g?Object.getOwnPropertyNames(r):Object.keys(r),x=C.length;let e;for(B=0;B<x;B++)e=C[B],a.call(null,r[e],e,r)}}function F6(r,a){if(om(r))return null;a=a.toLowerCase();const g=Object.keys(r);let B=g.length,J;for(;B-- >0;)if(J=g[B],a===J.toLowerCase())return J;return null}const Zh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,j6=r=>!am(r)&&r!==Zh;function X2(){const{caseless:r}=j6(this)&&this||{},a={},g=(B,J)=>{const C=r&&F6(a,J)||J;cy(a[C])&&cy(B)?a[C]=X2(a[C],B):cy(B)?a[C]=X2({},B):qp(B)?a[C]=B.slice():a[C]=B};for(let B=0,J=arguments.length;B<J;B++)arguments[B]&&lm(arguments[B],g);return a}const Jue=(r,a,g,{allOwnKeys:B}={})=>(lm(a,(J,C)=>{g&&fu(J)?r[C]=z6(J,g):r[C]=J},{allOwnKeys:B}),r),Kue=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Zue=(r,a,g,B)=>{r.prototype=Object.create(a.prototype,B),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:a.prototype}),g&&Object.assign(r.prototype,g)},Que=(r,a,g,B)=>{let J,C,x;const e={};if(a=a||{},r==null)return a;do{for(J=Object.getOwnPropertyNames(r),C=J.length;C-- >0;)x=J[C],(!B||B(x,r,a))&&!e[x]&&(a[x]=r[x],e[x]=!0);r=g!==!1&&H2(r)}while(r&&(!g||g(r,a))&&r!==Object.prototype);return a},$ue=(r,a,g)=>{r=String(r),(g===void 0||g>r.length)&&(g=r.length),g-=a.length;const B=r.indexOf(a,g);return B!==-1&&B===g},ede=r=>{if(!r)return null;if(qp(r))return r;let a=r.length;if(!V6(a))return null;const g=new Array(a);for(;a-- >0;)g[a]=r[a];return g},tde=(r=>a=>r&&a instanceof r)(typeof Uint8Array<"u"&&H2(Uint8Array)),rde=(r,a)=>{const B=(r&&r[oy]).call(r);let J;for(;(J=B.next())&&!J.done;){const C=J.value;a.call(r,C[0],C[1])}},nde=(r,a)=>{let g;const B=[];for(;(g=r.exec(a))!==null;)B.push(g);return B},ide=ed("HTMLFormElement"),ade=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(g,B,J){return B.toUpperCase()+J}),U6=(({hasOwnProperty:r})=>(a,g)=>r.call(a,g))(Object.prototype),ode=ed("RegExp"),q6=(r,a)=>{const g=Object.getOwnPropertyDescriptors(r),B={};lm(g,(J,C)=>{let x;(x=a(J,C,r))!==!1&&(B[C]=x||J)}),Object.defineProperties(r,B)},sde=r=>{q6(r,(a,g)=>{if(fu(r)&&["arguments","caller","callee"].indexOf(g)!==-1)return!1;const B=r[g];if(fu(B)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+g+"'")})}})},lde=(r,a)=>{const g={},B=J=>{J.forEach(C=>{g[C]=!0})};return qp(r)?B(r):B(String(r).split(a)),g},cde=()=>{},ude=(r,a)=>r!=null&&Number.isFinite(r=+r)?r:a;function dde(r){return!!(r&&fu(r.append)&&r[D6]==="FormData"&&r[oy])}const hde=r=>{const a=new Array(10),g=(B,J)=>{if(sm(B)){if(a.indexOf(B)>=0)return;if(om(B))return B;if(!("toJSON"in B)){a[J]=B;const C=qp(B)?[]:{};return lm(B,(x,e)=>{const v=g(x,J+1);!am(v)&&(C[e]=v)}),a[J]=void 0,C}}return B};return g(r,0)},pde=ed("AsyncFunction"),fde=r=>r&&(sm(r)||fu(r))&&fu(r.then)&&fu(r.catch),W6=((r,a)=>r?setImmediate:a?((g,B)=>(Zh.addEventListener("message",({source:J,data:C})=>{J===Zh&&C===g&&B.length&&B.shift()()},!1),J=>{B.push(J),Zh.postMessage(g,"*")}))(`axios@${Math.random()}`,[]):g=>setTimeout(g))(typeof setImmediate=="function",fu(Zh.postMessage)),mde=typeof queueMicrotask<"u"?queueMicrotask.bind(Zh):typeof process<"u"&&process.nextTick||W6,Hn={isArray:qp,isArrayBuffer:B6,isBuffer:om,isFormData:Uue,isArrayBufferView:Iue,isString:Rue,isNumber:V6,isBoolean:Lue,isObject:sm,isPlainObject:cy,isEmptyObject:zue,isReadableStream:Wue,isRequest:Gue,isResponse:Hue,isHeaders:Xue,isUndefined:am,isDate:Due,isFile:Bue,isBlob:Vue,isRegExp:ode,isFunction:fu,isStream:jue,isURLSearchParams:que,isTypedArray:tde,isFileList:Fue,forEach:lm,merge:X2,extend:Jue,trim:Yue,stripBOM:Kue,inherits:Zue,toFlatObject:Que,kindOf:sy,kindOfTest:ed,endsWith:$ue,toArray:ede,forEachEntry:rde,matchAll:nde,isHTMLForm:ide,hasOwnProperty:U6,hasOwnProp:U6,reduceDescriptors:q6,freezeMethods:sde,toObjectSet:lde,toCamelCase:ade,noop:cde,toFiniteNumber:ude,findKey:F6,global:Zh,isContextDefined:j6,isSpecCompliantForm:dde,toJSONObject:hde,isAsyncFn:pde,isThenable:fde,setImmediate:W6,asap:mde,isIterable:r=>r!=null&&fu(r[oy])};function va(r,a,g,B,J){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",a&&(this.code=a),g&&(this.config=g),B&&(this.request=B),J&&(this.response=J,this.status=J.status?J.status:null)}Hn.inherits(va,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Hn.toJSONObject(this.config),code:this.code,status:this.status}}});const G6=va.prototype,H6={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{H6[r]={value:r}}),Object.defineProperties(va,H6),Object.defineProperty(G6,"isAxiosError",{value:!0}),va.from=(r,a,g,B,J,C)=>{const x=Object.create(G6);return Hn.toFlatObject(r,x,function(v){return v!==Error.prototype},e=>e!=="isAxiosError"),va.call(x,r.message,a,g,B,J),x.cause=r,x.name=r.name,C&&Object.assign(x,C),x};const gde=null;function Y2(r){return Hn.isPlainObject(r)||Hn.isArray(r)}function X6(r){return Hn.endsWith(r,"[]")?r.slice(0,-2):r}function Y6(r,a,g){return r?r.concat(a).map(function(J,C){return J=X6(J),!g&&C?"["+J+"]":J}).join(g?".":""):a}function yde(r){return Hn.isArray(r)&&!r.some(Y2)}const vde=Hn.toFlatObject(Hn,{},null,function(a){return/^is[A-Z]/.test(a)});function uy(r,a,g){if(!Hn.isObject(r))throw new TypeError("target must be an object");a=a||new FormData,g=Hn.toFlatObject(g,{metaTokens:!0,dots:!1,indexes:!1},!1,function(n,i){return!Hn.isUndefined(i[n])});const B=g.metaTokens,J=g.visitor||t,C=g.dots,x=g.indexes,v=(g.Blob||typeof Blob<"u"&&Blob)&&Hn.isSpecCompliantForm(a);if(!Hn.isFunction(J))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(Hn.isDate(h))return h.toISOString();if(Hn.isBoolean(h))return h.toString();if(!v&&Hn.isBlob(h))throw new va("Blob is not supported. Use a Buffer instead.");return Hn.isArrayBuffer(h)||Hn.isTypedArray(h)?v&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function t(h,n,i){let d=h;if(h&&!i&&typeof h=="object"){if(Hn.endsWith(n,"{}"))n=B?n:n.slice(0,-2),h=JSON.stringify(h);else if(Hn.isArray(h)&&yde(h)||(Hn.isFileList(h)||Hn.endsWith(n,"[]"))&&(d=Hn.toArray(h)))return n=X6(n),d.forEach(function(c,f){!(Hn.isUndefined(c)||c===null)&&a.append(x===!0?Y6([n],f,C):x===null?n:n+"[]",u(c))}),!1}return Y2(h)?!0:(a.append(Y6(i,n,C),u(h)),!1)}const w=[],y=Object.assign(vde,{defaultVisitor:t,convertValue:u,isVisitable:Y2});function b(h,n){if(!Hn.isUndefined(h)){if(w.indexOf(h)!==-1)throw Error("Circular reference detected in "+n.join("."));w.push(h),Hn.forEach(h,function(d,s){(!(Hn.isUndefined(d)||d===null)&&J.call(a,d,Hn.isString(s)?s.trim():s,n,y))===!0&&b(d,n?n.concat(s):[s])}),w.pop()}}if(!Hn.isObject(r))throw new TypeError("data must be an object");return b(r),a}function J6(r){const a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(B){return a[B]})}function J2(r,a){this._pairs=[],r&&uy(r,this,a)}const K6=J2.prototype;K6.append=function(a,g){this._pairs.push([a,g])},K6.toString=function(a){const g=a?function(B){return a.call(this,B,J6)}:J6;return this._pairs.map(function(J){return g(J[0])+"="+g(J[1])},"").join("&")};function bde(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Z6(r,a,g){if(!a)return r;const B=g&&g.encode||bde;Hn.isFunction(g)&&(g={serialize:g});const J=g&&g.serialize;let C;if(J?C=J(a,g):C=Hn.isURLSearchParams(a)?a.toString():new J2(a,g).toString(B),C){const x=r.indexOf("#");x!==-1&&(r=r.slice(0,x)),r+=(r.indexOf("?")===-1?"?":"&")+C}return r}class Q6{constructor(){this.handlers=[]}use(a,g,B){return this.handlers.push({fulfilled:a,rejected:g,synchronous:B?B.synchronous:!1,runWhen:B?B.runWhen:null}),this.handlers.length-1}eject(a){this.handlers[a]&&(this.handlers[a]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(a){Hn.forEach(this.handlers,function(B){B!==null&&a(B)})}}const $6={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xde={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:J2,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},K2=typeof window<"u"&&typeof document<"u",Z2=typeof navigator=="object"&&navigator||void 0,_de=K2&&(!Z2||["ReactNative","NativeScript","NS"].indexOf(Z2.product)<0),wde=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Tde=K2&&window.location.href||"http://localhost",Nc={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:K2,hasStandardBrowserEnv:_de,hasStandardBrowserWebWorkerEnv:wde,navigator:Z2,origin:Tde},Symbol.toStringTag,{value:"Module"})),...xde};function kde(r,a){return uy(r,new Nc.classes.URLSearchParams,{visitor:function(g,B,J,C){return Nc.isNode&&Hn.isBuffer(g)?(this.append(B,g.toString("base64")),!1):C.defaultVisitor.apply(this,arguments)},...a})}function Sde(r){return Hn.matchAll(/\w+|\[(\w*)]/g,r).map(a=>a[0]==="[]"?"":a[1]||a[0])}function Ede(r){const a={},g=Object.keys(r);let B;const J=g.length;let C;for(B=0;B<J;B++)C=g[B],a[C]=r[C];return a}function eT(r){function a(g,B,J,C){let x=g[C++];if(x==="__proto__")return!0;const e=Number.isFinite(+x),v=C>=g.length;return x=!x&&Hn.isArray(J)?J.length:x,v?(Hn.hasOwnProp(J,x)?J[x]=[J[x],B]:J[x]=B,!e):((!J[x]||!Hn.isObject(J[x]))&&(J[x]=[]),a(g,B,J[x],C)&&Hn.isArray(J[x])&&(J[x]=Ede(J[x])),!e)}if(Hn.isFormData(r)&&Hn.isFunction(r.entries)){const g={};return Hn.forEachEntry(r,(B,J)=>{a(Sde(B),J,g,0)}),g}return null}function Ade(r,a,g){if(Hn.isString(r))try{return(a||JSON.parse)(r),Hn.trim(r)}catch(B){if(B.name!=="SyntaxError")throw B}return(g||JSON.stringify)(r)}const cm={transitional:$6,adapter:["xhr","http","fetch"],transformRequest:[function(a,g){const B=g.getContentType()||"",J=B.indexOf("application/json")>-1,C=Hn.isObject(a);if(C&&Hn.isHTMLForm(a)&&(a=new FormData(a)),Hn.isFormData(a))return J?JSON.stringify(eT(a)):a;if(Hn.isArrayBuffer(a)||Hn.isBuffer(a)||Hn.isStream(a)||Hn.isFile(a)||Hn.isBlob(a)||Hn.isReadableStream(a))return a;if(Hn.isArrayBufferView(a))return a.buffer;if(Hn.isURLSearchParams(a))return g.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),a.toString();let e;if(C){if(B.indexOf("application/x-www-form-urlencoded")>-1)return kde(a,this.formSerializer).toString();if((e=Hn.isFileList(a))||B.indexOf("multipart/form-data")>-1){const v=this.env&&this.env.FormData;return uy(e?{"files[]":a}:a,v&&new v,this.formSerializer)}}return C||J?(g.setContentType("application/json",!1),Ade(a)):a}],transformResponse:[function(a){const g=this.transitional||cm.transitional,B=g&&g.forcedJSONParsing,J=this.responseType==="json";if(Hn.isResponse(a)||Hn.isReadableStream(a))return a;if(a&&Hn.isString(a)&&(B&&!this.responseType||J)){const x=!(g&&g.silentJSONParsing)&&J;try{return JSON.parse(a)}catch(e){if(x)throw e.name==="SyntaxError"?va.from(e,va.ERR_BAD_RESPONSE,this,null,this.response):e}}return a}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Nc.classes.FormData,Blob:Nc.classes.Blob},validateStatus:function(a){return a>=200&&a<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Hn.forEach(["delete","get","head","post","put","patch"],r=>{cm.headers[r]={}});const Cde=Hn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Mde=r=>{const a={};let g,B,J;return r&&r.split(`
|
|
4081
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),B}static addGrid(a,g={}){if(!a)return null;let B=a;if(B.gridstack){const J=B.gridstack;return g&&(J.opts={...J.opts,...g}),g.children!==void 0&&J.load(g.children),J}return(!a.classList.contains("grid-stack")||Wi.addRemoveCB)&&(Wi.addRemoveCB?B=Wi.addRemoveCB(a,g,!0,!0):B=zn.createDiv(["grid-stack",g.class],a)),Wi.init(g,B)}static registerEngine(a){Wi.engineClass=a}get placeholder(){if(!this._placeholder){this._placeholder=zn.createDiv([this.opts.placeholderClass,Cu.itemClass,this.opts.itemClass]);const a=zn.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(a.textContent=this.opts.placeholderText)}return this._placeholder}constructor(a,g={}){var B;this.el=a,this.opts=g,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},a.gridstack=this,this.opts=g=g||{},a.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),g.row&&(g.minRow=g.maxRow=g.row,delete g.row);const J=zn.toNumber(a.getAttribute("gs-row"));g.column==="auto"&&delete g.column,g.alwaysShowResizeHandle!==void 0&&(g._alwaysShowResizeHandle=g.alwaysShowResizeHandle);const C=g.columnOpts;if(C){const t=C.breakpoints;!C.columnWidth&&!(t!=null&&t.length)?delete g.columnOpts:(C.columnMax=C.columnMax||12,(t==null?void 0:t.length)>1&&t.sort((w,y)=>(y.w||0)-(w.w||0)))}const x={...zn.cloneDeep(Cu),column:zn.toNumber(a.getAttribute("gs-column"))||Cu.column,minRow:J||zn.toNumber(a.getAttribute("gs-min-row"))||Cu.minRow,maxRow:J||zn.toNumber(a.getAttribute("gs-max-row"))||Cu.maxRow,staticGrid:zn.toBool(a.getAttribute("gs-static"))||Cu.staticGrid,sizeToContent:zn.toBool(a.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(g.handleClass?"."+g.handleClass:g.handle?g.handle:"")||Cu.draggable.handle},removableOptions:{accept:g.itemClass||Cu.removableOptions.accept,decline:Cu.removableOptions.decline}};a.getAttribute("gs-animate")&&(x.animate=zn.toBool(a.getAttribute("gs-animate"))),g=zn.defaults(g,x),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(g),g.rtl==="auto"&&(g.rtl=a.style.direction==="rtl"),g.rtl&&this.el.classList.add("grid-stack-rtl");const e=this.el.closest("."+Cu.itemClass),v=e==null?void 0:e.gridstackNode;if(v&&(v.subGrid=this,this.parentGridNode=v,this.el.classList.add("grid-stack-nested"),v.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=g.cellHeight==="auto",this._isAutoCellHeight||g.cellHeight==="initial")this.cellHeight(void 0);else{typeof g.cellHeight=="number"&&g.cellHeightUnit&&g.cellHeightUnit!==Cu.cellHeightUnit&&(g.cellHeight=g.cellHeight+g.cellHeightUnit,delete g.cellHeightUnit);const t=g.cellHeight;delete g.cellHeight,this.cellHeight(t)}g.alwaysShowResizeHandle==="mobile"&&(g.alwaysShowResizeHandle=$u),this._setStaticClass();const u=g.engineClass||Wi.engineClass||Bd;if(this.engine=new u({column:this.getColumn(),float:g.float,maxRow:g.maxRow,onChange:t=>{t.forEach(w=>{const y=w.el;y&&(w._removeDOM?(y&&y.remove(),delete w._removeDOM):this._writePosAttr(y,w))}),this._updateContainerHeight()}}),g.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(t=>this._prepareElement(t)),delete this.engine._loading,this.batchUpdate(!1)),g.children){const t=g.children;delete g.children,t.length&&this.load(t)}this.setAnimation(),g.subGridDynamic&&!Ki.pauseDrag&&(Ki.pauseDrag=!0),((B=g.draggable)==null?void 0:B.pause)!==void 0&&(Ki.pauseDrag=g.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(a=this.opts){this.el.classList.add("gs-"+a.column),typeof a.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/a.column}%`)}addWidget(a){if(!a)return;if(typeof a=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(a.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(a);let g,B=a;if(B.grid=this,B.el?g=B.el:Wi.addRemoveCB?g=Wi.addRemoveCB(this.el,a,!0,!1):g=this.createWidgetDivs(B),!g)return;if(B=g.gridstackNode,B&&g.parentElement===this.el&&this.engine.nodes.find(C=>C._id===B._id))return g;const J=this._readAttr(g);return zn.defaults(a,J),this.engine.prepareNode(a),this.el.appendChild(g),this.makeWidget(g,a),g}createWidgetDivs(a){const g=zn.createDiv(["grid-stack-item",this.opts.itemClass]),B=zn.createDiv(["grid-stack-item-content"],g);return zn.lazyLoad(a)?a.visibleObservable||(a.visibleObservable=new IntersectionObserver(([J])=>{var C,x;J.isIntersecting&&((C=a.visibleObservable)==null||C.disconnect(),delete a.visibleObservable,Wi.renderCB(B,a),(x=a.grid)==null||x.prepareDragDrop(a.el))}),window.setTimeout(()=>{var J;return(J=a.visibleObservable)==null?void 0:J.observe(g)})):Wi.renderCB(B,a),g}makeSubGrid(a,g,B,J=!0){var C,x,e;let v=a.gridstackNode;if(v||(v=this.makeWidget(a).gridstackNode),(C=v.subGrid)!=null&&C.el)return v.subGrid;let u,t=this;for(;t&&!u;)u=(x=t.opts)==null?void 0:x.subGridOpts,t=(e=t.parentGridNode)==null?void 0:e.grid;g=zn.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...u||{},...g||v.subGridOpts||{}}),v.subGridOpts=g;let w;g.column==="auto"&&(w=!0,g.column=Math.max(v.w||1,(B==null?void 0:B.w)||1),delete g.columnOpts);let y=v.el.querySelector(".grid-stack-item-content"),b,h;if(J&&(this._removeDD(v.el),h={...v,x:0,y:0},zn.removeInternalForSave(h),delete h.subGridOpts,v.content&&(h.content=v.content,delete v.content),Wi.addRemoveCB?b=Wi.addRemoveCB(this.el,h,!0,!1):(b=zn.createDiv(["grid-stack-item"]),b.appendChild(y),y=zn.createDiv(["grid-stack-item-content"],v.el)),this.prepareDragDrop(v.el)),B){const i=w?g.column:v.w,d=v.h+B.h,s=v.el.style;s.transition="none",this.update(v.el,{w:i,h:d}),setTimeout(()=>s.transition=null)}const n=v.subGrid=Wi.addGrid(y,g);return B!=null&&B._moving&&(n._isTemp=!0),w&&(n._autoColumn=!0),J&&n.makeWidget(b,h),B&&(B._moving?window.setTimeout(()=>zn.simulateMouseEvent(B._event,"mouseenter",n.el),0):n.makeWidget(v.el,v)),this.resizeToContentCheck(!1,v),n}removeAsSubGrid(a){var g;const B=(g=this.parentGridNode)==null?void 0:g.grid;B&&(B.batchUpdate(),B.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(J=>{J.x+=this.parentGridNode.x,J.y+=this.parentGridNode.y,B.makeWidget(J.el,J)}),B.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,a&&window.setTimeout(()=>zn.simulateMouseEvent(a._event,"mouseenter",B.el),0))}save(a=!0,g=!1,B=Wi.saveCB,J){const C=this.engine.save(a,B,J);if(C.forEach(x=>{var e;if(a&&x.el&&!x.subGrid&&!B){const v=x.el.querySelector(".grid-stack-item-content");x.content=v==null?void 0:v.innerHTML,x.content||delete x.content}else if(!a&&!B&&delete x.content,(e=x.subGrid)!=null&&e.el){const v=x.w||x.subGrid.getColumn(),u=x.subGrid.save(a,g,B,v);x.subGridOpts=g?u:{children:u},delete x.subGrid}delete x.el}),g){const x=zn.cloneDeep(this.opts);x.marginBottom===x.marginTop&&x.marginRight===x.marginLeft&&x.marginTop===x.marginRight&&(x.margin=x.marginTop,delete x.marginTop,delete x.marginRight,delete x.marginBottom,delete x.marginLeft),x.rtl===(this.el.style.direction==="rtl")&&(x.rtl="auto"),this._isAutoCellHeight&&(x.cellHeight="auto"),this._autoColumn&&(x.column="auto");const e=x._alwaysShowResizeHandle;return delete x._alwaysShowResizeHandle,e!==void 0?x.alwaysShowResizeHandle=e:delete x.alwaysShowResizeHandle,zn.removeInternalAndSame(x,Cu),x.children=C,x}return C}load(a,g=Wi.addRemoveCB||!0){a=zn.cloneDeep(a);const B=this.getColumn();a.forEach(t=>{t.w=t.w||t.minW||1,t.h=t.h||t.minH||1}),a=zn.sort(a),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let J=0;a.forEach(t=>{J=Math.max(J,(t.x||0)+t.w)}),J>this.engine.defaultColumn&&(this.engine.defaultColumn=J),J>B&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=a,this.engine.columnChanged(J,B,this.responseLayout),a=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(a,J,!0));const C=Wi.addRemoveCB;typeof g=="function"&&(Wi.addRemoveCB=g);const x=[];this.batchUpdate();const e=!this.engine.nodes.length,v=e&&this.opts.animate;v&&this.setAnimation(!1),!e&&g&&[...this.engine.nodes].forEach(t=>{t.id&&(zn.find(a,t.id)||(Wi.addRemoveCB&&Wi.addRemoveCB(this.el,t,!1,!1),x.push(t),this.removeWidget(t.el,!0,!1)))}),this.engine._loading=!0;const u=[];return this.engine.nodes=this.engine.nodes.filter(t=>zn.find(a,t.id)?(u.push(t),!1):!0),a.forEach(t=>{var w;const y=zn.find(u,t.id);if(y){if(zn.shouldSizeToContent(y)&&(t.h=y.h),this.engine.nodeBoundFix(t),(t.autoPosition||t.x===void 0||t.y===void 0)&&(t.w=t.w||y.w,t.h=t.h||y.h,this.engine.findEmptyPosition(t)),this.engine.nodes.push(y),zn.samePos(y,t)&&this.engine.nodes.length>1&&(this.moveNode(y,{...t,forceCollide:!0}),zn.copyPos(t,y)),this.update(y.el,t),(w=t.subGridOpts)!=null&&w.children){const b=y.el.querySelector(".grid-stack");b&&b.gridstack&&b.gridstack.load(t.subGridOpts.children)}}else g&&this.addWidget(t)}),delete this.engine._loading,this.engine.removedNodes=x,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,C?Wi.addRemoveCB=C:delete Wi.addRemoveCB,v&&this.setAnimation(!0,!0),this}batchUpdate(a=!0){return this.engine.batchUpdate(a),a||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(a=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!a||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const g=this.el.querySelector("."+this.opts.itemClass);if(g){const J=zn.toNumber(g.getAttribute("gs-h"))||1;return Math.round(g.offsetHeight/J)}const B=parseInt(this.el.getAttribute("gs-current-row"));return B?Math.round(this.el.getBoundingClientRect().height/B):this.opts.cellHeight}cellHeight(a){if(a!==void 0&&this._isAutoCellHeight!==(a==="auto")&&(this._isAutoCellHeight=a==="auto",this._updateResizeEvent()),(a==="initial"||a==="auto")&&(a=void 0),a===void 0){const B=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;a=this.cellWidth()+B}const g=zn.parseHeight(a);return this.opts.cellHeightUnit===g.unit&&this.opts.cellHeight===g.h?this:(this.opts.cellHeightUnit=g.unit,this.opts.cellHeight=g.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(a=!1){var g;return a&&(g=this.opts.columnOpts)!=null&&g.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var a,g;const B=this.opts.columnOpts;if(!B||!B.columnWidth&&!((a=B.breakpoints)!=null&&a.length))return!1;const J=this.getColumn();let C=J;const x=this._widthOrContainer(!0);if(B.columnWidth)C=Math.min(Math.round(x/B.columnWidth)||1,B.columnMax);else{C=B.columnMax;let e=0;for(;e<B.breakpoints.length&&x<=B.breakpoints[e].w;)C=B.breakpoints[e++].c||J}if(C!==J){const e=(g=B.breakpoints)==null?void 0:g.find(v=>v.c===C);return this.column(C,(e==null?void 0:e.layout)||B.layout),!0}return!1}compact(a="compact",g=!0){return this.engine.compact(a,g),this._triggerChangeEvent(),this}column(a,g="moveScale"){if(!a||a<1||this.opts.column===a)return this;const B=this.getColumn();return this.opts.column=a,this.engine?(this.engine.column=a,this.el.classList.remove("gs-"+B),this._updateColumnVar(),this.engine.columnChanged(B,a,g),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=g,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(a=>a.matches("."+this.opts.itemClass)&&!a.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(a=!0){var g;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),a?this.el.parentNode.removeChild(this.el):(this.removeAll(a),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(g=this._placeholder)==null||delete g.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(a){return this.opts.float!==a&&(this.opts.float=this.engine.float=a,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(a,g=!1){const B=this.el.getBoundingClientRect();let J;g?J={top:B.top+document.documentElement.scrollTop,left:B.left}:J={top:this.el.offsetTop,left:this.el.offsetLeft};const C=a.left-J.left,x=a.top-J.top,e=B.width/this.getColumn(),v=B.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(C/e),y:Math.floor(x/v)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(a,g,B,J){return this.engine.isAreaEmpty(a,g,B,J)}makeWidget(a,g){const B=Wi.getElement(a);if(!B||B.gridstackNode)return B;B.parentElement||this.el.appendChild(B),this._prepareElement(B,!0,g);const J=B.gridstackNode;this._updateContainerHeight(),J.subGridOpts&&this.makeSubGrid(B,J.subGridOpts,void 0,!1);let C;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(C=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),C&&delete this._ignoreLayoutsNodeChange,B}on(a,g){return a.indexOf(" ")!==-1?(a.split(" ").forEach(B=>this.on(B,g)),this):(a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable"?(a==="enable"||a==="disable"?this._gsEventHandler[a]=B=>g(B):this._gsEventHandler[a]=B=>{B.detail&&g(B,B.detail)},this.el.addEventListener(a,this._gsEventHandler[a])):a==="drag"||a==="dragstart"||a==="dragstop"||a==="resizestart"||a==="resize"||a==="resizestop"||a==="dropped"||a==="resizecontent"?this._gsEventHandler[a]=g:console.error("GridStack.on("+a+") event not supported"),this)}off(a){return a.indexOf(" ")!==-1?(a.split(" ").forEach(g=>this.off(g)),this):((a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable")&&this._gsEventHandler[a]&&this.el.removeEventListener(a,this._gsEventHandler[a]),delete this._gsEventHandler[a],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(a=>this.off(a)),this}removeWidget(a,g=!0,B=!0){return a?(Wi.getElements(a).forEach(J=>{if(J.parentElement&&J.parentElement!==this.el)return;let C=J.gridstackNode;C||(C=this.engine.nodes.find(x=>J===x.el)),C&&(g&&Wi.addRemoveCB&&Wi.addRemoveCB(this.el,C,!1,!1),delete J.gridstackNode,this._removeDD(J),this.engine.removeNode(C,g,B),g&&J.parentElement&&J.remove())}),B&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(a=!0,g=!0){return this.engine.nodes.forEach(B=>{a&&Wi.addRemoveCB&&Wi.addRemoveCB(this.el,B,!1,!1),delete B.el.gridstackNode,this.opts.staticGrid||this._removeDD(B.el)}),this.engine.removeAll(a,g),g&&this._triggerRemoveEvent(),this}setAnimation(a=this.opts.animate,g){return g?setTimeout(()=>{this.opts&&this.setAnimation(a)}):a?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=a,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(a,g=!0,B=!0){return!!this.opts.staticGrid===a?this:(a?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(J=>{this.prepareDragDrop(J.el),J.subGrid&&B&&J.subGrid.setStatic(a,g,B)}),g&&this._setStaticClass(),this)}updateOptions(a){var g;const B=this.opts;return a===B?this:(a.acceptWidgets!==void 0&&(B.acceptWidgets=a.acceptWidgets,this._setupAcceptWidget()),a.animate!==void 0&&this.setAnimation(a.animate),a.cellHeight&&this.cellHeight(a.cellHeight),a.class!==void 0&&a.class!==B.class&&(B.class&&this.el.classList.remove(B.class),a.class&&this.el.classList.add(a.class)),a.columnOpts?(this.opts.columnOpts=a.columnOpts,this.checkDynamicColumn()):a.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof a.column=="number"&&this.column(a.column),a.margin!==void 0&&this.margin(a.margin),a.staticGrid!==void 0&&this.setStatic(a.staticGrid),a.disableDrag!==void 0&&!a.staticGrid&&this.enableMove(!a.disableDrag),a.disableResize!==void 0&&!a.staticGrid&&this.enableResize(!a.disableResize),a.float!==void 0&&this.float(a.float),a.row!==void 0?(B.minRow=B.maxRow=B.row=a.row,this._updateContainerHeight()):(a.minRow!==void 0&&(B.minRow=a.minRow,this._updateContainerHeight()),a.maxRow!==void 0&&(B.maxRow=a.maxRow)),(g=a.children)!=null&&g.length&&this.load(a.children),this)}update(a,g){return Wi.getElements(a).forEach(B=>{var J;const C=B==null?void 0:B.gridstackNode;if(!C)return;const x={...zn.copyPos({},C),...zn.cloneDeep(g)};this.engine.nodeBoundFix(x),delete x.autoPosition;const e=["x","y","w","h"];let v;if(e.some(w=>x[w]!==void 0&&x[w]!==C[w])&&(v={},e.forEach(w=>{v[w]=x[w]!==void 0?x[w]:C[w],delete x[w]})),!v&&(x.minW||x.minH||x.maxW||x.maxH)&&(v={}),x.content!==void 0){const w=B.querySelector(".grid-stack-item-content");w&&w.textContent!==x.content&&(C.content=x.content,Wi.renderCB(w,x),(J=C.subGrid)!=null&&J.el&&(w.appendChild(C.subGrid.el),C.subGrid._updateContainerHeight())),delete x.content}let u=!1,t=!1;for(const w in x)w[0]!=="_"&&C[w]!==x[w]&&(C[w]=x[w],u=!0,t=t||!this.opts.staticGrid&&(w==="noResize"||w==="noMove"||w==="locked"));if(zn.sanitizeMinMax(C),v){const w=v.w!==void 0&&v.w!==C.w;this.moveNode(C,v),w&&C.subGrid?C.subGrid.onResize(this.hasAnimationCSS()?C.w:void 0):this.resizeToContentCheck(w,C),delete C._orig}(v||u)&&this._writeAttr(B,C),t&&this.prepareDragDrop(C.el),Wi.updateCB&&Wi.updateCB(C)}),this}moveNode(a,g){const B=a._updating;B||this.engine.cleanNodes().beginUpdate(a),this.engine.moveNode(a,g),this._updateContainerHeight(),B||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(a){var g,B;if(!a||(a.classList.remove("size-to-content-max"),!a.clientHeight))return;const J=a.gridstackNode;if(!J)return;const C=J.grid;if(!C||a.parentElement!==C.el)return;const x=C.getCellHeight(!0);if(!x)return;let e=J.h?J.h*x:a.clientHeight,v;if(J.resizeToContentParent&&(v=a.querySelector(J.resizeToContentParent)),v||(v=a.querySelector(Wi.resizeToContentParent)),!v)return;const u=a.clientHeight-v.clientHeight,t=J.h?J.h*x-u:v.clientHeight;let w;if(J.subGrid){w=J.subGrid.getRow()*J.subGrid.getCellHeight(!0);const h=J.subGrid.el.getBoundingClientRect(),n=a.getBoundingClientRect();w+=h.top-n.top}else{if((B=(g=J.subGridOpts)==null?void 0:g.children)!=null&&B.length)return;{const h=v.firstElementChild;if(!h){console.error(`Error: GridStack.resizeToContent() widget id:${J.id} '${Wi.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}w=h.getBoundingClientRect().height||t}}if(t===w)return;e+=w-t;let y=Math.ceil(e/x);const b=Number.isInteger(J.sizeToContent)?J.sizeToContent:0;b&&y>b&&(y=b,a.classList.add("size-to-content-max")),J.minH&&y<J.minH?y=J.minH:J.maxH&&y>J.maxH&&(y=J.maxH),y!==J.h&&(C._ignoreLayoutsNodeChange=!0,C.moveNode(J,{h:y}),delete C._ignoreLayoutsNodeChange)}resizeToContentCBCheck(a){Wi.resizeToContentCB?Wi.resizeToContentCB(a):this.resizeToContent(a)}rotate(a,g){return Wi.getElements(a).forEach(B=>{const J=B.gridstackNode;if(!zn.canBeRotated(J))return;const C={w:J.h,h:J.w,minH:J.minW,minW:J.minH,maxH:J.maxW,maxW:J.maxH};if(g){const e=g.left>0?Math.floor(g.left/this.cellWidth()):0,v=g.top>0?Math.floor(g.top/this.opts.cellHeight):0;C.x=J.x+e-(J.h-(v+1)),C.y=J.y+v-e}Object.keys(C).forEach(e=>{C[e]===void 0&&delete C[e]});const x=J._orig;this.update(B,C),J._orig=x}),this}margin(a){if(!(typeof a=="string"&&a.split(" ").length>1)){const g=zn.parseHeight(a);if(this.opts.marginUnit===g.unit&&this.opts.margin===g.h)return}return this.opts.margin=a,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(a){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");const g=arguments;let B=0,J={x:g[B++],y:g[B++],w:g[B++],h:g[B++],autoPosition:g[B++]};return this.willItFit(J)}return this.engine.willItFit(a)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const a=this.engine.getDirtyNodes(!0);return a&&a.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(a),this._triggerEvent("change",a)),this.engine.saveInitial(),this}_triggerAddEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.addedNodes)!=null&&a.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(B=>{delete B._dirty});const g=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",g)}return this}_triggerRemoveEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.removedNodes)!=null&&a.length){const g=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",g)}return this}_triggerEvent(a,g){const B=g?new CustomEvent(a,{bubbles:!1,detail:g}):new Event(a);let J=this;for(;J.parentGridNode;)J=J.parentGridNode.grid;return J.el.dispatchEvent(B),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const a=this.parentGridNode;let g=this.getRow()+this._extraDragRow;const B=this.opts.cellHeight,J=this.opts.cellHeightUnit;if(!B)return this;if(!a&&!this.opts.minRow){const C=zn.parseHeight(getComputedStyle(this.el).minHeight);if(C.h>0&&C.unit===J){const x=Math.floor(C.h/B);g<x&&(g=x)}}return this.el.setAttribute("gs-current-row",String(g)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),g&&(this.el.style[a?"minHeight":"height"]=g*B+J),a&&zn.shouldSizeToContent(a)&&a.grid.resizeToContentCBCheck(a.el),this}_prepareElement(a,g=!1,B){B=B||this._readAttr(a),a.gridstackNode=B,B.el=a,B.grid=this,B=this.engine.addNode(B,g),this._writeAttr(a,B),a.classList.add(Cu.itemClass,this.opts.itemClass);const J=zn.shouldSizeToContent(B);return J?a.classList.add("size-to-content"):a.classList.remove("size-to-content"),J&&this.resizeToContentCheck(!1,B),zn.lazyLoad(B)||this.prepareDragDrop(B.el),this}_writePosAttr(a,g){return(!g._moving&&!g._resizing||this._placeholder===a)&&(a.style.top=g.y?g.y===1?"var(--gs-cell-height)":`calc(${g.y} * var(--gs-cell-height))`:null,a.style.left=g.x?g.x===1?"var(--gs-column-width)":`calc(${g.x} * var(--gs-column-width))`:null,a.style.width=g.w>1?`calc(${g.w} * var(--gs-column-width))`:null,a.style.height=g.h>1?`calc(${g.h} * var(--gs-cell-height))`:null),g.x>0?a.setAttribute("gs-x",String(g.x)):a.removeAttribute("gs-x"),g.y>0?a.setAttribute("gs-y",String(g.y)):a.removeAttribute("gs-y"),g.w>1?a.setAttribute("gs-w",String(g.w)):a.removeAttribute("gs-w"),g.h>1?a.setAttribute("gs-h",String(g.h)):a.removeAttribute("gs-h"),this}_writeAttr(a,g){if(!g)return this;this._writePosAttr(a,g);const B={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const J in B)g[J]?a.setAttribute(B[J],String(g[J])):a.removeAttribute(B[J]);return this}_readAttr(a,g=!0){const B={};B.x=zn.toNumber(a.getAttribute("gs-x")),B.y=zn.toNumber(a.getAttribute("gs-y")),B.w=zn.toNumber(a.getAttribute("gs-w")),B.h=zn.toNumber(a.getAttribute("gs-h")),B.autoPosition=zn.toBool(a.getAttribute("gs-auto-position")),B.noResize=zn.toBool(a.getAttribute("gs-no-resize")),B.noMove=zn.toBool(a.getAttribute("gs-no-move")),B.locked=zn.toBool(a.getAttribute("gs-locked"));const J=a.getAttribute("gs-size-to-content");J&&(J==="true"||J==="false"?B.sizeToContent=zn.toBool(J):B.sizeToContent=parseInt(J,10)),B.id=a.getAttribute("gs-id"),B.maxW=zn.toNumber(a.getAttribute("gs-max-w")),B.minW=zn.toNumber(a.getAttribute("gs-min-w")),B.maxH=zn.toNumber(a.getAttribute("gs-max-h")),B.minH=zn.toNumber(a.getAttribute("gs-min-h")),g&&(B.w===1&&a.removeAttribute("gs-w"),B.h===1&&a.removeAttribute("gs-h"),B.maxW&&a.removeAttribute("gs-max-w"),B.minW&&a.removeAttribute("gs-min-w"),B.maxH&&a.removeAttribute("gs-max-h"),B.minH&&a.removeAttribute("gs-min-h"));for(const C in B){if(!B.hasOwnProperty(C))return;!B[C]&&B[C]!==0&&C!=="sizeToContent"&&delete B[C]}return B}_setStaticClass(){const a=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...a),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...a),this.el.removeAttribute("gs-static")),this}onResize(a=(g=>(g=this.el)==null?void 0:g.clientWidth)()){if(!a||this.prevWidth===a)return;this.prevWidth=a,this.batchUpdate();let g=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),g=!0):g=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(B=>{B.subGrid&&B.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(g),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(a=!1,g=void 0){if(this.engine){if(a&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,g),this.animationDelay);if(g)zn.shouldSizeToContent(g)&&this.resizeToContentCBCheck(g.el);else if(this.engine.nodes.some(B=>zn.shouldSizeToContent(B))){const B=[...this.engine.nodes];this.batchUpdate(),B.forEach(J=>{zn.shouldSizeToContent(J)&&this.resizeToContentCBCheck(J.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,g?[g]:this.engine.nodes)}}_updateResizeEvent(a=!1){const g=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(B=>B.sizeToContent));return!a&&g&&!this.resizeObserver?(this._sizeThrottle=zn.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(a||!g)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(a=".grid-stack-item"){return zn.getElement(a)}static getElements(a=".grid-stack-item"){return zn.getElements(a)}static getGridElement(a){return Wi.getElement(a)}static getGridElements(a){return zn.getElements(a)}_initMargin(){let a,g=0,B=[];typeof this.opts.margin=="string"&&(B=this.opts.margin.split(" ")),B.length===2?(this.opts.marginTop=this.opts.marginBottom=B[0],this.opts.marginLeft=this.opts.marginRight=B[1]):B.length===4?(this.opts.marginTop=B[0],this.opts.marginRight=B[1],this.opts.marginBottom=B[2],this.opts.marginLeft=B[3]):(a=zn.parseHeight(this.opts.margin),this.opts.marginUnit=a.unit,g=this.opts.margin=a.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(C=>{this.opts[C]===void 0?this.opts[C]=g:(a=zn.parseHeight(this.opts[C]),this.opts[C]=a.h,delete this.opts.margin)}),this.opts.marginUnit=a.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const J=this.el.style;return J.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),J.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),J.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),J.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return Uc}static setupDragIn(a,g,B,J=document){(g==null?void 0:g.pause)!==void 0&&(Ki.pauseDrag=g.pause),g={appendTo:"body",helper:"clone",...g||{}},(typeof a=="string"?zn.getElements(a,J):a).forEach((C,x)=>{Uc.isDraggable(C)||Uc.dragIn(C,g),B!=null&&B[x]&&(C.gridstackNode=B[x])})}movable(a,g){return this.opts.staticGrid?this:(Wi.getElements(a).forEach(B=>{const J=B.gridstackNode;J&&(g?delete J.noMove:J.noMove=!0,this.prepareDragDrop(J.el))}),this)}resizable(a,g){return this.opts.staticGrid?this:(Wi.getElements(a).forEach(B=>{const J=B.gridstackNode;J&&(g?delete J.noResize:J.noResize=!0,this.prepareDragDrop(J.el))}),this)}disable(a=!0){if(!this.opts.staticGrid)return this.enableMove(!1,a),this.enableResize(!1,a),this._triggerEvent("disable"),this}enable(a=!0){if(!this.opts.staticGrid)return this.enableMove(!0,a),this.enableResize(!0,a),this._triggerEvent("enable"),this}enableMove(a,g=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(B=>{this.prepareDragDrop(B.el),B.subGrid&&g&&B.subGrid.enableMove(a,g)}),this)}enableResize(a,g=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(B=>{this.prepareDragDrop(B.el),B.subGrid&&g&&B.subGrid.enableResize(a,g)}),this)}cancelDrag(){var a;const g=(a=this._placeholder)==null?void 0:a.gridstackNode;g&&(g._isExternal?(g._isAboutToRemove=!0,this.engine.removeNode(g)):g._isAboutToRemove&&Wi._itemRemoving(g.el,!1),this.engine.restoreInitial())}_removeDD(a){return Uc.draggable(a,"destroy").resizable(a,"destroy"),a.gridstackNode&&delete a.gridstackNode._initDD,delete a.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return Uc.droppable(this.el,"destroy"),this;let a,g;const B=(J,C,x)=>{var e;x=x||C;const v=x.gridstackNode;if(!v)return;if(!((e=v.grid)!=null&&e.el)){x.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const b=x.getBoundingClientRect();x.style.left=b.x+(this.dragTransform.xScale-1)*(J.clientX-b.x)/this.dragTransform.xScale+"px",x.style.top=b.y+(this.dragTransform.yScale-1)*(J.clientY-b.y)/this.dragTransform.yScale+"px",x.style.transformOrigin="0px 0px"}let{top:u,left:t}=x.getBoundingClientRect();const w=this.el.getBoundingClientRect();t-=w.left,u-=w.top;const y={position:{top:u*this.dragTransform.xScale,left:t*this.dragTransform.yScale}};if(v._temporaryRemoved){if(v.x=Math.max(0,Math.round(t/g)),v.y=Math.max(0,Math.round(u/a)),delete v.autoPosition,this.engine.nodeBoundFix(v),!this.engine.willItFit(v)){if(v.autoPosition=!0,!this.engine.willItFit(v)){Uc.off(C,"drag");return}v._willFitPos&&(zn.copyPos(v,v._willFitPos),delete v._willFitPos)}this._onStartMoving(x,J,y,v,g,a)}else this._dragOrResize(x,J,y,v,g,a)};return Uc.droppable(this.el,{accept:J=>{const C=J.gridstackNode||this._readAttr(J,!1);if((C==null?void 0:C.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let x=!0;if(typeof this.opts.acceptWidgets=="function")x=this.opts.acceptWidgets(J);else{const e=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;x=J.matches(e)}if(x&&C&&this.opts.maxRow){const e={w:C.w,h:C.h,minW:C.minW,minH:C.minH};x=this.engine.willItFit(e)}return x}}).on(this.el,"dropover",(J,C,x)=>{let e=(x==null?void 0:x.gridstackNode)||C.gridstackNode;if((e==null?void 0:e.grid)===this&&!e._temporaryRemoved)return!1;if(e!=null&&e._sidebarOrig&&(e.w=e._sidebarOrig.w,e.h=e._sidebarOrig.h),e!=null&&e.grid&&e.grid!==this&&!e._temporaryRemoved&&e.grid._leave(C,x),x=x||C,g=this.cellWidth(),a=this.getCellHeight(!0),!e){const t=x.getAttribute("data-gs-widget")||x.getAttribute("gridstacknode");if(t){try{e=JSON.parse(t)}catch{console.error("Gridstack dropover: Bad JSON format: ",t)}x.removeAttribute("data-gs-widget"),x.removeAttribute("gridstacknode")}e||(e=this._readAttr(x)),e._sidebarOrig={w:e.w,h:e.h}}e.grid||(e.el||(e={...e}),e._isExternal=!0,x.gridstackNode=e);const v=e.w||Math.round(x.offsetWidth/g)||1,u=e.h||Math.round(x.offsetHeight/a)||1;return e.grid&&e.grid!==this?(C._gridstackNodeOrig||(C._gridstackNodeOrig=e),C.gridstackNode=e={...e,w:v,h:u,grid:this},delete e.x,delete e.y,this.engine.cleanupNode(e).nodeBoundFix(e),e._initDD=e._isExternal=e._temporaryRemoved=!0):(e.w=v,e.h=u,e._temporaryRemoved=!0),Wi._itemRemoving(e.el,!1),Uc.on(C,"drag",B),B(J,C,x),!1}).on(this.el,"dropout",(J,C,x)=>{const e=(x==null?void 0:x.gridstackNode)||C.gridstackNode;return e&&(!e.grid||e.grid===this)&&(this._leave(C,x),this._isTemp&&this.removeAsSubGrid(e)),!1}).on(this.el,"drop",(J,C,x)=>{var e,v,u;const t=(x==null?void 0:x.gridstackNode)||C.gridstackNode;if((t==null?void 0:t.grid)===this&&!t._isExternal)return!1;const w=!!this.placeholder.parentElement,y=C!==x;this.placeholder.remove(),delete this.placeholder.gridstackNode,w&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const b=C._gridstackNodeOrig;if(delete C._gridstackNodeOrig,w&&b!=null&&b.grid&&b.grid!==this){const n=b.grid;n.engine.removeNodeFromLayoutCache(b),n.engine.removedNodes.push(b),n._triggerRemoveEvent()._triggerChangeEvent(),n.parentGridNode&&!n.engine.nodes.length&&n.opts.subGridDynamic&&n.removeAsSubGrid()}if(!t||(w&&(this.engine.cleanupNode(t),t.grid=this),(e=t.grid)==null||delete e._isTemp,Uc.off(C,"drag"),x!==C?(x.remove(),C=x):C.remove(),this._removeDD(C),!w))return!1;const h=(u=(v=t.subGrid)==null?void 0:v.el)==null?void 0:u.gridstack;return zn.copyPos(t,this._readAttr(this.placeholder)),zn.removePositioningStyles(C),y&&(t.content||t.subGridOpts||Wi.addRemoveCB)?(delete t.el,C=this.addWidget(t)):(this._prepareElement(C,!0,t),this.el.appendChild(C),this.resizeToContentCheck(!1,t),h&&(h.parentGridNode=t),this._updateContainerHeight()),this.engine.addedNodes.push(t),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...J,type:"dropped"},b&&b.grid?b:void 0,t),!1}),this}static _itemRemoving(a,g){if(!a)return;const B=a?a.gridstackNode:void 0;!(B!=null&&B.grid)||a.classList.contains(B.grid.opts.removableOptions.decline)||(g?B._isAboutToRemove=!0:delete B._isAboutToRemove,g?a.classList.add("grid-stack-item-removing"):a.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const a=document.querySelector(this.opts.removable);return a?(!this.opts.staticGrid&&!Uc.isDroppable(a)&&Uc.droppable(a,this.opts.removableOptions).on(a,"dropover",(g,B)=>Wi._itemRemoving(B,!0)).on(a,"dropout",(g,B)=>Wi._itemRemoving(B,!1)),this):this}prepareDragDrop(a,g=!1){const B=a==null?void 0:a.gridstackNode;if(!B)return;const J=B.noMove||this.opts.disableDrag,C=B.noResize||this.opts.disableResize,x=this.opts.staticGrid||J&&C;if((g||x)&&(B._initDD&&(this._removeDD(a),delete B._initDD),x&&a.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!g))return this;if(!B._initDD){let e,v;const u=(y,b)=>{this.triggerEvent(y,y.target),e=this.cellWidth(),v=this.getCellHeight(!0),this._onStartMoving(a,y,b,B,e,v)},t=(y,b)=>{this._dragOrResize(a,y,b,B,e,v)},w=y=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete B._moving,delete B._resizing,delete B._event,delete B._lastTried;const b=B.w!==B._orig.w,h=y.target;if(!(!h.gridstackNode||h.gridstackNode.grid!==this)){if(B.el=h,B._isAboutToRemove){const n=a.gridstackNode.grid;n._gsEventHandler[y.type]&&n._gsEventHandler[y.type](y,h),n.engine.nodes.push(B),n.removeWidget(a,!0,!0)}else zn.removePositioningStyles(h),B._temporaryRemoved?(this._writePosAttr(h,B),this.engine.addNode(B)):this._writePosAttr(h,B),this.triggerEvent(y,h);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),y.type==="resizestop"&&(Number.isInteger(B.sizeToContent)&&(B.sizeToContent=B.h),this.resizeToContentCheck(b,B))}};Uc.draggable(a,{start:u,stop:w,drag:t}).resizable(a,{start:u,stop:w,resize:t}),B._initDD=!0}return Uc.draggable(a,J?"disable":"enable").resizable(a,C?"disable":"enable"),this}_onStartMoving(a,g,B,J,C,x){var e;if(this.engine.cleanNodes().beginUpdate(J),this._writePosAttr(this.placeholder,J),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=J,(e=J.grid)!=null&&e.el)this.dragTransform=zn.getValuesFromTransformedElement(a);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const v=this.placeholder.closest(".grid-stack");this.dragTransform=zn.getValuesFromTransformedElement(v)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(J.el=this.placeholder,J._lastUiPosition=B.position,J._prevYPix=B.position.top,J._moving=g.type==="dragstart",J._resizing=g.type==="resizestart",delete J._lastTried,g.type==="dropover"&&J._temporaryRemoved&&(this.engine.addNode(J),J._moving=!0),this.engine.cacheRects(C,x,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),g.type==="resizestart"){const v=this.getColumn()-J.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-J.y;Uc.resizable(a,"option","minWidth",C*Math.min(J.minW||1,v)).resizable(a,"option","minHeight",x*Math.min(J.minH||1,u)).resizable(a,"option","maxWidth",C*Math.min(J.maxW||Number.MAX_SAFE_INTEGER,v)).resizable(a,"option","maxWidthMoveLeft",C*Math.min(J.maxW||Number.MAX_SAFE_INTEGER,J.x+J.w)).resizable(a,"option","maxHeight",x*Math.min(J.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(a,"option","maxHeightMoveUp",x*Math.min(J.maxH||Number.MAX_SAFE_INTEGER,J.y+J.h))}}_dragOrResize(a,g,B,J,C,x){const e={...J._orig};let v,u=this.opts.marginLeft,t=this.opts.marginRight,w=this.opts.marginTop,y=this.opts.marginBottom;const b=Math.round(x*.1),h=Math.round(C*.1);if(u=Math.min(u,h),t=Math.min(t,h),w=Math.min(w,b),y=Math.min(y,b),g.type==="drag"){if(J._temporaryRemoved)return;const i=B.position.top-J._prevYPix;J._prevYPix=B.position.top,this.opts.draggable.scroll!==!1&&zn.updateScrollPosition(a,B.position,i);const d=B.position.left+(B.position.left>J._lastUiPosition.left?-t:u),s=B.position.top+(B.position.top>J._lastUiPosition.top?-y:w);e.x=Math.round(d/C),e.y=Math.round(s/x);const c=this._extraDragRow;if(this.engine.collide(J,e)){const f=this.getRow();let m=Math.max(0,e.y+J.h-f);this.opts.maxRow&&f+m>this.opts.maxRow&&(m=Math.max(0,this.opts.maxRow-f)),this._extraDragRow=m}else this._extraDragRow=0;if(this._extraDragRow!==c&&this._updateContainerHeight(),J.x===e.x&&J.y===e.y)return}else if(g.type==="resize"){if(e.x<0||(zn.updateScrollResize(g,a,x),e.w=Math.round((B.size.width-u)/C),e.h=Math.round((B.size.height-w)/x),J.w===e.w&&J.h===e.h)||J._lastTried&&J._lastTried.w===e.w&&J._lastTried.h===e.h)return;const i=B.position.left+u,d=B.position.top+w;e.x=Math.round(i/C),e.y=Math.round(d/x),v=!0}J._event=g,J._lastTried=e;const n={x:B.position.left+u,y:B.position.top+w,w:(B.size?B.size.width:J.w*C)-u-t,h:(B.size?B.size.height:J.h*x)-w-y};if(this.engine.moveNodeCheck(J,{...e,cellWidth:C,cellHeight:x,rect:n,resizing:v})){J._lastUiPosition=B.position,this.engine.cacheRects(C,x,w,t,y,u),delete J._skipDown,v&&J.subGrid&&J.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const i=g.target;J._sidebarOrig||this._writePosAttr(i,J),this.triggerEvent(g,i)}}triggerEvent(a,g){let B=this;for(;B.parentGridNode;)B=B.parentGridNode.grid;B._gsEventHandler[a.type]&&B._gsEventHandler[a.type](a,g)}_leave(a,g){g=g||a;const B=g.gridstackNode;if(!B||(g.style.transform=g.style.transformOrigin=null,Uc.off(a,"drag"),B._temporaryRemoved))return;B._temporaryRemoved=!0,this.engine.removeNode(B),B.el=B._isExternal&&g?g:a;const J=B._sidebarOrig;B._isExternal&&this.engine.cleanupNode(B),B._sidebarOrig=J,this.opts.removable===!0&&Wi._itemRemoving(a,!0),a._gridstackNodeOrig?(a.gridstackNode=a._gridstackNodeOrig,delete a._gridstackNodeOrig):B._isExternal&&this.engine.restoreInitial()}commit(){return Ose(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}Wi.renderCB=(r,a)=>{r&&a!=null&&a.content&&(r.textContent=a.content)},Wi.resizeToContentParent=".grid-stack-item-content",Wi.Utils=zn,Wi.Engine=Bd,Wi.GDRev="12.3.2";const zse=[{id:1,name:"Goles",isSelected:!1},{id:2,name:"Pases acertados",isSelected:!1},{id:23,name:"Tiros de Esquina",isSelected:!1},{id:3,name:"Balones recuperados en disputa",isSelected:!1},{id:4,name:"Asistencias",isSelected:!1},{id:5,name:"Participaciones en gol",isSelected:!1},{id:6,name:"Tiros a gol",isSelected:!1},{id:7,name:"Tiros a gol que llegaron a la portería",isSelected:!1},{id:8,name:"Cabeceos en área rival",isSelected:!1},{id:9,name:"Cabeceos en área propia",isSelected:!1},{id:10,name:"Centros",isSelected:!1},{id:11,name:"Centros acertados",isSelected:!1},{id:12,name:"1vs1 exitosos ofensivos",isSelected:!1},{id:13,name:"1vs1 exitosos ofensivos que terminaron en gol",isSelected:!1},{id:14,name:"1vs1 defensivos exitoso",isSelected:!1},{id:15,name:"Rechaces",isSelected:!1},{id:16,name:"Balones ganados en área propia",isSelected:!1},{id:17,name:"Balones ganados en área rival",isSelected:!1},{id:18,name:"Faltas cometidas",isSelected:!1},{id:19,name:"Faltas recibidas",isSelected:!1},{id:20,name:"Tarjetas amarillas",isSelected:!1},{id:21,name:"Tarjetas rojas",isSelected:!1},{id:22,name:"Atajadas",isSelected:!1},{id:24,name:"Oportunidades de gol",isSelected:!1},{id:25,name:"Balones recuperados en cancha rival",isSelected:!1}],Vd=r=>zse.find(a=>a.id===r),Fd=new Map([[9,{id:9,analysisTypes:new Map([["2-20",{analysisType:"successfulPasses",name:"Pases acertados",title:"Mapeo de pases acertados",titleShort:"Pases acertados"}],["3-21",{analysisType:"unsuccessfulPasses",name:"Pases no acertados",title:"Mapeo de pases no acertados",titleShort:"Pases no acertados"}],["222-223-224-225",{analysisType:"recoveredBalls",name:"Balones recuperados",title:"Mapeo de balones recuperados",titleShort:"Balones recuperados"}],["226-227-228-229",{analysisType:"lostBalls",name:"Balones perdidos",title:"Mapeo de balones perdidos",titleShort:"Balones perdidos"}]])}],[1,{general:"General",offensive:"Ofensivo",defensive:"Defensivo",possession:"Posesión",stoppedBall:"Balón parado",penalties:"Infracción"}]]);class Up{constructor(a,g=[],B,J=null,C=!1,x=!1,e=null,v=null){ud(this,"id",""),ud(this,"childViews",[]),ud(this,"viewId",0),ud(this,"dynamicFilters",null),ud(this,"componentSpecificFilters",new Map),ud(this,"isPostMatch",!1),ud(this,"isTemplateMode",!1),ud(this,"filtresJSON",null),ud(this,"token",null),ud(this,"_isUpdating",!1),this.id=a,this.viewId=B,this.childViews=g,this.dynamicFilters=J,this.isPostMatch=C,this.isTemplateMode=x,this.filtresJSON=e,this.token=v,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(a=>{a.view.filterAndViewsContainer=new Up(this.id,[a],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token)})}hasEventTypeId(a,g){return!a||!Array.isArray(a)?!1:a.some(B=>B&&B.event_type_id===g)}hasCategoryId(a,g){return!a||!Array.isArray(a)?!1:a.some(B=>B&&B.category_id===g)}getId(){return this.id}setViewId(a){this.viewId=a}setFiltersJSON(a){this.filtresJSON=a}setDynamicFilters(a,g=null){g?this.componentSpecificFilters.set(g,[...a]):this.dynamicFilters=a}getComponentDynamicFilters(a){return a&&this.componentSpecificFilters.has(a)?this.componentSpecificFilters.get(a):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){this.componentSpecificFilters.forEach((a,g)=>{console.log(` Component ${g}:`,a)})}static debugAllComponentFilters(){document.querySelectorAll("[data-container-id]").forEach(a=>{a.getAttribute("data-container-id")})}clearAllComponentFilters(){this.componentSpecificFilters.clear()}getDynamicFilters(){return this.dynamicFilters}getHomeTeamViews(){return this.childViews.filter(a=>a.view.isHomeTeam)}getAwayTeamViews(){return this.childViews.filter(a=>!a.view.isHomeTeam)}addView(a,g=!1){var B,J,C,x,e,v,u,t,w,y;if(a.view.filterAndViewsContainer=this,Ei.emit("component-added-to-container",this),this.viewId===5&&a.view.componentProps&&!g&&(a.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType===1}),this.viewId===10&&a.view.componentProps&&!g&&(a.view.componentProps.isHomeTeamForAnalysis=this.dynamicFilters[0]!==3?this.dynamicFilters[0]===1:1,a.isHomeTeam=a.view.componentProps.isHomeTeamForAnalysis,a.view.filterMultiple={isHomeTeam:a.view.componentProps.isHomeTeamForAnalysis},a.view.filtersJSON=this.filtresJSON),this.viewId===7&&a.view.componentProps&&!g){const b=this.getComponentDynamicFilters(a.view.id),h=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const n=h[0]===1?"offensive":"defensive",i=h[1]===1;a.view.componentProps.analysisType=n,a.view.componentProps.isHomeTeamForAnalysis=i,a.isHomeTeam=i,a.view.filterMultiple={isHomeTeam:i},Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:h})}if(this.viewId===1&&a.view.componentProps&&!g){const b=this.dynamicFilters[0]||[];if(b&&b.length>0){let h;if(Array.isArray(b)){const i=this.childViews.map(s=>{var c;return(c=s.view.componentProps)==null?void 0:c.type}).filter(s=>s!==void 0),d=b.filter(s=>!i.includes(s));d.length>0?h=d[0]:h=b[0]}else h=b;const n=Fd.get(this.viewId);a.view.componentProps.type=h,a.view.componentProps.default=!1,a.view.title=`Comparativa ${n[h]}`,a.view.filterMultiple={category:h}}}if(this.viewId===9&&a.view.componentProps&&!g){const b=this.dynamicFilters[0].map(d=>d.join("-"));let h="";const n=this.dynamicFilters[1],i=Fd.get(this.viewId);if(n===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(m=>{m.view.componentProps.isHomeTeamForAnalysis=!0,m.view.isHomeTeam=!0,m.view.filterMultiple&&(m.view.filterMultiple.isHomeTeam=!0)});let d=null;const s=this.getHomeTeamViews(),c=this.getAwayTeamViews();let f=!0;for(let m=0;m<b.length;m++){h=b[m],d=i.analysisTypes.get(b[m]);const T=s.find(S=>S.view.componentProps.analysisType===d.analysisType),E=c.find(S=>S.view.componentProps.analysisType===d.analysisType);if(!T||!E){f=!T;break}}f?this.childViews.length===0?(a.view.componentProps.analysisType=d.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.title=d.title,a.view.titleShort=d.titleShort,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:h.split("-").map(m=>parseInt(m))}):this.childViews.reduce((m,T,E,S)=>{let P={analysisType:T.view.componentProps.analysisType,title:T.view.title,isHomeTeamForAnalysis:T.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:T.view.isHomeTeam};return m&&(m.isHomeTeam&&!T.view.isHomeTeam?(T.view.componentProps.analysisType=d.analysisType,T.view.componentProps.isHomeTeamForAnalysis=!0,T.view.title=d.title,a.view.titleShort=d.titleShort,T.view.isHomeTeam=!0,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:h.split("-").map(N=>parseInt(N))}):!m.isHomeTeam&&!T.view.isHomeTeam&&(T.view.componentProps.analysisType=m.analysisType,T.view.componentProps.isHomeTeamForAnalysis=m.isHomeTeamForAnalysis,T.view.title=m.title,T.view.titleShort=m.titleShort,T.view.isHomeTeam=m.isHomeTeam,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:h.split("-").map(N=>parseInt(N))}),E===S.length-1&&(a.view.componentProps.analysisType=P.analysisType,a.view.componentProps.isHomeTeamForAnalysis=P.isHomeTeamForAnalysis,a.view.title=P.title,a.view.titleShort=P.titleShort,a.view.isHomeTeam=P.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:h.split("-").map(N=>parseInt(N))})),P},null):(a.view.componentProps.analysisType=d.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.title=d.title,a.view.titleShort=d.titleShort,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:h.split("-").map(m=>parseInt(m))})}else{const d=n===1,s=d?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=d,a.view.isHomeTeam=d;for(let c=0;c<b.length;c++){const f=i.analysisTypes.get(b[c]);if(!s.find(m=>m.view.componentProps.analysisType===f.analysisType)){a.view.componentProps.analysisType=f.analysisType,a.view.title=f.title,a.view.titleShort=f.titleShort,a.view.filterMultiple={categoryIds:b[c].split("-").map(m=>parseInt(m)),isHomeTeam:a.view.isHomeTeam};break}}}}if(this.viewId===2&&!g&&a.view.componentProps){const b=this.getComponentDynamicFilters(a.view.id),h=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&(this.setDynamicFilters(this.dynamicFilters,a.view.id),console.log(`GscTopPlayer - initialized specific filters for component ${a.view.id} with default filters:`,this.dynamicFilters)),a.view.componentProps.game&&(a.view.componentProps.gameid=a.view.componentProps.game.id,a.view.componentProps.season=a.view.componentProps.game.season_id,a.view.componentProps.teamView=h[1]===2?a.view.componentProps.game.awayTeam.team_id:h[1]===1?a.view.componentProps.game.homeTeam.team_id:0);const n=this.dynamicFilters[0]||[];let i=null;if(Array.isArray(n)){if(n.length>0){const c=this.childViews.map(m=>{var T;const E=(T=m.view.componentProps)==null?void 0:T.categoryView;return E&&E.length>0?E[0].id:null}).filter(m=>m!==null),f=n.filter(m=>!c.includes(m));console.log("GSCtops addView (array mode) - existingCategories:",c),console.log("GSCtops addView (array mode) - categoriesWithoutComponent:",f),f.length>0?i=f[0]:console.log("GSCtops addView (array mode) - all categories already have components")}}else{const c=n;c&&(this.childViews.find(f=>{var m;const T=(m=f.view.componentProps)==null?void 0:m.categoryView;return T&&T.length>0&&T[0].id===c})?console.log("GSCtops addView (single mode) - component already exists, skipping creation"):i=c)}let d=null;if(i)try{d=Vd(i)}catch(c){console.warn("Error getting category by ID:",c)}const s=h&&h.length>1?h[1]:1;a.view.filterMultiple={categoryId:i,teamType:s},a.view.componentProps.categoryView=d?[{id:i,name:d.name}]:i?[{id:i,name:`Category ${i}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&a.view.componentProps&&!g&&a.view.game&&(a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),a.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,a.view.componentProps.game=(B=a.view)==null?void 0:B.game,a.view.componentProps.teamSelected={teamId:(C=(J=a.view)==null?void 0:J.game)==null?void 0:C.home_team},a.view.componentProps.isDefault=!1,Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:this.dynamicFilters})),this.viewId===6&&a.view.componentProps&&!g){a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const b=this.getComponentDynamicFilters(a.view.id),h=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const n=h&&h.length>0?h[0]:[];if(console.log("gamesToShow",n),n&&n.length>0){let i=0;for(const d of n)if(!this.childViews.find(s=>s.view.componentProps.gameNumber===d)){i=d;break}i&&(console.log("2 ************************************************** newGameNumberToShow: entro",i),a.view.componentProps.gameNumber=i,a.view.filterMultiple={gameNumber:i})}console.log(" /////////---------------------------------------> ",a.view.filterMultiple),Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:h})}if(this.viewId===3&&a.view.componentProps&&!g&&a.view.game){a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const b=this.getComponentDynamicFilters(a.view.id),h=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const n=h&&h.length>0?h[0]:!1;a.view.componentProps.desplegable=n,a.view.componentProps.key=n,a.view.componentProps.game=(x=a.view)==null?void 0:x.game,a.view.componentProps.defaultShields=!1,Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:h})}if(this.viewId===4&&(console.log("TIMELINE TIMELINE - TIMELINE TIMELINE - TIMELINE TIMELINE - TIMELINE TIMELINE - TIMELINE TIMELINE - TIMELINE TIMELINE"),console.log("*********************** *********************** this.token *********************** *********************** ",this.token),a.view.componentProps&&!g&&a.view.game)){if(a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),this.isPostMatch){a.view.componentProps.key=!1,a.view.componentProps.isDefault=!1,a.view.componentProps.token=this.token,a.view.componentProps.gameId=(v=(e=a.view)==null?void 0:e.game)==null?void 0:v.game_id,a.view.componentProps.homeTeam=(t=(u=a.view)==null?void 0:u.game)==null?void 0:t.home_team,a.view.componentProps.awayTeam=(y=(w=a.view)==null?void 0:w.game)==null?void 0:y.visiting_team;const n=this.getComponentDynamicFilters(a.view.id),i=n||this.dynamicFilters;!n&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const d=i&&i.length>0?i[0]:[],s=this.hasEventTypeId(d,1),c=this.hasCategoryId(d,8),f=this.hasCategoryId(d,9),m=this.hasEventTypeId(d,3);console.log("Timeline - Events check:",{goals:s,yellowCards:c,redCards:f,substitutions:m,selectedEvents:d,componentId:a.view.id,usingSpecificFilters:!!n}),a.view.componentProps.goals=s,a.view.componentProps.yellowCards=c,a.view.componentProps.redCards=f,a.view.componentProps.substitutions=m}const b=this.getComponentDynamicFilters(a.view.id)||this.dynamicFilters,h=b&&b.length>0?b[0]:[];a.view.componentProps.selectedEvents=h,a.view.componentProps.key=h.length>0,Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:b})}this.childViews.push(a),Ei.emit("view-added"),console.log("this.childViews",this.childViews)}getHowManyViewsToAdd(a){if(this.viewId===5)return 1;if(this.viewId===6){const g=a[0];return g===2||g===3?g:1}if(this.viewId===4){const g=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0,B=this.childViews.length===0&&g;return console.log("Timeline getHowManyViewsToAdd:",{hasSelectedEvents:g,childViewsLength:this.childViews.length,shouldAdd:B,dynamicFilters:a}),g?1:0}if(this.viewId===9){const g=a[0],B=a[1];if(B===1||B===2){const J=B===1?this.getHomeTeamViews():this.getAwayTeamViews();return g.length-J.length}else return g*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const g=a[0]||[],B=a[1]||1;if(console.log("GSCtops getHowManyViewsToAdd - categoriesIdsSelected:",g),console.log("GSCtops getHowManyViewsToAdd - teamType:",B),console.log("GSCtops getHowManyViewsToAdd - childViews.length:",this.childViews.length),!g||g.length===0)return 0;if(Array.isArray(g)){const J=this.childViews.map(x=>{var e;const v=(e=x.view.componentProps)==null?void 0:e.categoryView;return v&&v.length>0?v[0].id:null}).filter(x=>x!==null),C=g.filter(x=>!J.includes(x));return console.log("GSCtops getHowManyViewsToAdd (array mode) - existingCategories:",J),console.log("GSCtops getHowManyViewsToAdd (array mode) - categoriesWithoutComponent:",C),C.length}else{const J=g,C=this.childViews.find(x=>{var e,v;const u=(e=x.view.componentProps)==null?void 0:e.categoryView,t=((v=x.view.filterMultiple)==null?void 0:v.teamType)||1;return u&&u.length>0&&u[0].id===J&&t===B});return console.log("GSCtops getHowManyViewsToAdd (edit mode) - categoryId:",J),console.log("GSCtops getHowManyViewsToAdd (edit mode) - teamType:",B),console.log("GSCtops getHowManyViewsToAdd (edit mode) - existingComponent:",C),C?0:1}}if(this.viewId===1){const g=a[0]||[];if(console.log("GSCComparativeReports getHowManyViewsToAdd - selectedAnalysisTypes:",g),console.log("GSCComparativeReports getHowManyViewsToAdd - childViews.length:",this.childViews.length),!g||g.length===0)return 0;if(Array.isArray(g)){const B=this.childViews.map(C=>{var x;return(x=C.view.componentProps)==null?void 0:x.type}).filter(C=>C!==void 0),J=g.filter(C=>!B.includes(C));return console.log("GSCComparativeReports getHowManyViewsToAdd (array mode) - existingTypes:",B),console.log("GSCComparativeReports getHowManyViewsToAdd (array mode) - typesWithoutComponent:",J),J.length}else{const B=g,J=this.childViews.find(C=>{var x;return((x=C.view.componentProps)==null?void 0:x.type)===B});return console.log("GSCComparativeReports getHowManyViewsToAdd (edit mode) - analysisType:",B),console.log("GSCComparativeReports getHowManyViewsToAdd (edit mode) - existingComponent:",J),J?0:1}}return 0}getRequiresAddView(a){if(console.log("getRequiresAddView",this.viewId,a),this.viewId===5)return console.log("this.childViews:",this.childViews),a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===10)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===7)return a[1]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===6){const g=a[0];return g?g.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const g=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0,B=this.childViews.length===0&&g;return console.log("Timeline getRequiresAddView:",{hasSelectedEvents:g,childViewsLength:this.childViews.length,shouldAdd:B,dynamicFilters:a}),B}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(a);if(this.viewId===1){const g=a[0]||[];if(console.log("GSCComparativeReports getRequiresAddView - selectedAnalysisTypes:",g),console.log("GSCComparativeReports getRequiresAddView - childViews.length:",this.childViews.length),!g||g.length===0)return!1;if(Array.isArray(g)){const B=this.childViews.map(x=>{var e;return(e=x.view.componentProps)==null?void 0:e.type}).filter(x=>x!==void 0),J=g.filter(x=>!B.includes(x));console.log("GSCComparativeReports getRequiresAddView (array mode) - existingTypes:",B),console.log("GSCComparativeReports getRequiresAddView (array mode) - typesWithoutComponent:",J);const C=J.length>0;return console.log("GSCComparativeReports getRequiresAddView (array mode) - shouldAdd:",C),C}else{const B=g,J=this.childViews.find(x=>{var e;return((e=x.view.componentProps)==null?void 0:e.type)===B});console.log("GSCComparativeReports getRequiresAddView (edit mode) - analysisType:",B),console.log("GSCComparativeReports getRequiresAddView (edit mode) - existingComponent:",J);const C=!J;return console.log("GSCComparativeReports getRequiresAddView (edit mode) - shouldAdd:",C),C}}if(this.viewId===2){const g=a[0]||[];if(console.log("2222222222222222222222222222222222222222222222222222222222"),console.log(""),Array.isArray(g)){if(g.length>0){const B=this.childViews.map(x=>{var e;const v=(e=x.view.componentProps)==null?void 0:e.categoryView;return v&&v.length>0?v[0].id:null}).filter(x=>x!==null),J=g.filter(x=>!B.includes(x));console.log("GSCtops getRequiresAddView (array mode) - existingCategories:",B),console.log("GSCtops getRequiresAddView (array mode) - categoriesWithoutComponent:",J);const C=J.length>0;return console.log("GSCtops getRequiresAddView (array mode) - shouldAdd:",C),C}return!1}else{const B=g,J=a[1]||1;if(B){const C=this.childViews.find(e=>{var v,u;const t=(v=e.view.componentProps)==null?void 0:v.categoryView,w=((u=e.view.filterMultiple)==null?void 0:u.teamType)||1;return t&&t.length>0&&t[0].id===B&&w===J});console.log("GSCtops getRequiresAddView (single mode) - categoryId:",B,"teamType:",J),console.log("GSCtops getRequiresAddView (single mode) - existingComponent:",C);const x=!C;return console.log("GSCtops getRequiresAddView (single mode) - shouldAdd:",x),x}return!1}}return this.viewId===8||this.viewId===3?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(a){console.log("*******************************************************"),console.log("dynamicFilters",a);const g=this.childViews.filter(v=>v.view.isHomeTeam),B=this.childViews.filter(v=>!v.view.isHomeTeam),J=a[0].length,C=a[1],x=J*(C===1||C===2?1:2),e=C===3?g.length+B.length:g.length||B.length;return x>e}getRequiresLessViews(a){if(this.viewId===5)return a[0]!==3&&this.childViews.length>1;if(this.viewId===6){const g=a[0];return g===2||g===3}return this.viewId,!1}updateSummary({dynamicFilters:a}){const g=this.childViews[0],B=document.querySelector(`[gs-id="${g.view.id}"]`),J=g.grid;if(g&&B&&J){const C=a[0],x=`min_column${C?"_2":""}`,e=`min_row${C?"_2":""}`,v=`max_column${C?"_2":""}`,u=`max_row${C?"_2":""}`,t=`colspan${C?"_2":""}`,w=`rowspan${C?"_2":""}`,y=g.view.coreView[t],b=g.view.coreView[w],h=g.view.coreView[x],n=g.view.coreView[e],i=g.view.coreView[v],d=g.view.coreView[u];g.view.w=y,g.view.h=b,g.view.maxWidth=i,g.view.maxHeight=d,g.view.minWidth=h,g.view.minHeight=n,B.setAttribute("gs-w",y),B.setAttribute("gs-h",b),B.setAttribute("gs-max-w",i),B.setAttribute("gs-max-h",d),B.setAttribute("gs-min-w",h),B.setAttribute("gs-min-h",n),console.log("childView.view",g.view),J.update(B,{h:b,w:y,"gs-max-h":d,"gs-max-w":i,"gs-min-h":n,"gs-min-w":h})}}updateDynamicFilters(a,g=null){if(this._isUpdating){console.log("Skipping updateDynamicFilters due to update in progress");return}this._isUpdating=!0,g?(this.componentSpecificFilters.set(g,[...a]),console.log(`Updated specific filters for component ${g}:`,a)):this.dynamicFilters=a,Ei.emit("component-added-to-container",this);try{if(this.viewId===5){const B=a[0]||1;if(B<3)if(this.childViews.length===1){const J=this.childViews[0];J.view.componentProps&&(J.view.componentProps.preMatchType=B,J.view.filterMultiple={isHomeTeam:J.view.componentProps.preMatchType===1})}else{const J=this.childViews.pop(),C=J.grid,x=J.page,e=document.querySelector(`[gs-id="${J.view.id}"]`);if(C&&e&&(C.removeWidget(e),x)){const u=x.items.findIndex(t=>t.id===J.view.id);u!==-1&&x.items.splice(u,1)}const v=this.childViews[0];v.view.componentProps&&(v.view.componentProps.preMatchType=B,v.view.filterMultiple={isHomeTeam:v.view.componentProps.preMatchType})}else this.childViews.forEach((J,C)=>{J.view.componentProps.preMatchType=C+1,J.view.filterMultiple={isHomeTeam:J.view.componentProps.preMatchType}})}if(this.viewId===10){const B=a[0]||1;if(B<3)if(this.childViews.length===1){const J=this.childViews[0];J.view.componentProps&&(J.view.componentProps.isHomeTeamForAnalysis=B===1,J.view.filterMultiple={isHomeTeam:J.view.componentProps.isHomeTeamForAnalysis})}else{const J=this.childViews.pop(),C=J.grid,x=J.page,e=document.querySelector(`[gs-id="${J.view.id}"]`);if(C&&e&&(C.removeWidget(e),x)){const u=x.items.findIndex(t=>t.id===J.view.id);u!==-1&&x.items.splice(u,1)}const v=this.childViews[0];v.view.componentProps&&(v.view.componentProps.isHomeTeamForAnalysis=B===1,v.view.filterMultiple={isHomeTeam:v.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((J,C)=>{J.view.componentProps.isHomeTeamForAnalysis=C%2===0,J.view.filterMultiple={isHomeTeam:J.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const B=a[1];if(B===3)this.childViews.forEach((J,C)=>{J.view.componentProps.isHomeTeamForAnalysis=C%2===0,J.view.isHomeTeam=C%2===0,J.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",J.view.filterMultiple={isHomeTeam:J.view.isHomeTeam}});else{const J=B===1;if(this.childViews.length>0){const C=this.childViews[0];C.view.componentProps.isHomeTeamForAnalysis=J,C.view.isHomeTeam=J,C.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",C.view.filterMultiple={isHomeTeam:J},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const B=a[0],J=a[1];if(console.log("---------------->>>> CANCHA DE ZONAS: ",B,J),J===3){if(this.childViews.length>B.length){const C=B.map(x=>{const e=x.join("-");return Fd.get(this.viewId).analysisTypes.get(e).analysisType});this.childViews.reduce((x,e)=>(C.includes(e.view.componentProps.analysisType)||x.push(e.view.componentProps.analysisType),x),[]).forEach(x=>{const e=this.childViews.findIndex(v=>v.view.componentProps.analysisType===x);if(e!==-1){const v=this.childViews[e];this.removeChildView(v)}})}}else{const C=J===1,x=this.getHomeTeamViews(),e=this.getAwayTeamViews();if(console.log("---------------->>>> CUANDO CANCHA DE ZONAS NO ELEJIO AMBOS: ",C),console.log("---------------->>>> homeTeamViews: ",x),console.log("---------------->>>> awayTeamViews: ",e),C&&x.length===0)console.log("---------------->>>> escenario 1: "),e.forEach(v=>{v.view.componentProps.isHomeTeamForAnalysis=C,v.view.isHomeTeam=C,v.view.filterMultiple={categoryIds:B[0],isHomeTeam:C}});else if(!C&&e.length===0)console.log("---------------->>>> escenario 2: "),console.log("homeTeamViews",x),x.forEach(v=>{v.view.componentProps.isHomeTeamForAnalysis=C,v.view.isHomeTeam=C,v.view.filterMultiple={categoryIds:B[0],isHomeTeam:C}});else if(x.length===e.length)console.log("---------------->>>> escenario 3: "),C||x.forEach(v=>{v.view.filterMultiple={categoryIds:B[0],isHomeTeam:C}}),(C?e:x).forEach(v=>{this.removeChildView(v)});else{console.log("---------------->>>> escenario 4: ");const v=C?this.getHomeTeamViews():this.getAwayTeamViews();if(v.length>B.length){console.log("---------------->>>> escenario 4: eliminando vistas excedentes");const u=B.map(t=>{const w=t.join("-");return Fd.get(this.viewId).analysisTypes.get(w).analysisType});v.forEach(t=>{u.includes(t.view.componentProps.analysisType)?t.view.filterMultiple={categoryIds:B[0],isHomeTeam:C}:this.removeChildView(t)})}else v.forEach(u=>{u.view.filterMultiple={categoryIds:B[0],isHomeTeam:C}})}}console.log("this.childViews al final de updateDynamicFilters:",this.childViews)}if(this.viewId===2){const B=a[0]||[];if(Array.isArray(B)){const J=this.childViews.map(C=>{var x,e;const v=(x=C.view.componentProps)==null?void 0:x.categoryView,u=((e=C.view.filterMultiple)==null?void 0:e.teamType)||1,t=v&&v.length>0?v[0].id:null;return t?{categoryId:t,teamType:u,viewId:C.view.id}:null}).filter(C=>C!==null);if(g){const C=this.childViews.find(x=>x.view.id===g);if(C){const x=a[1]||1,e=B[0];if(e){let v=null;try{v=Vd(e)}catch(u){console.warn("Error getting category by ID:",u)}C.view.filterMultiple={categoryId:e,teamType:x},C.view.componentProps.game&&(x===1?C.view.componentProps.teamView=C.view.componentProps.game.homeTeam.team_id:x===2?C.view.componentProps.teamView=C.view.componentProps.game.awayTeam.team_id:C.view.componentProps.teamView=0),C.view.componentProps.categoryView=v?[{id:e,name:v.name}]:[{id:e,name:`Category ${e}`}]}}}if(!g){const C=a[1]||1;this.childViews.forEach(x=>{var e;const v=(e=x.view.componentProps)==null?void 0:e.categoryView;if(v&&v.length>0){const u=v[0].id;B.includes(u)&&(x.view.filterMultiple={categoryId:u,teamType:C})}})}if(J.map(C=>C.categoryId).filter(C=>!B.includes(C)).forEach(C=>{this.childViews.filter(x=>{var e;const v=(e=x.view.componentProps)==null?void 0:e.categoryView;return v&&v.length>0&&v[0].id===C}).forEach(x=>{this.removeChildView(x),Ei.emit("component-removed",{viewId:x.view.id,categoryId:C})})}),g){const C=B[0];if(C){const x=this.childViews.find(e=>e.view.id===g);if(x){let e=null;try{e=Vd(C)}catch(u){console.warn("Error getting category by ID:",u)}const v=a[1]||1;x.view.filterMultiple={categoryId:C,teamType:v},x.view.componentProps.game&&(x.view.componentProps.teamView=v===2?x.view.componentProps.game.awayTeam.team_id:v===1?x.view.componentProps.game.homeTeam.team_id:0),x.view.componentProps.categoryView=e?[{id:C,name:e.name}]:[{id:C,name:`Category ${C}`}]}}}}else{const J=B;if(J&&g){const C=this.childViews.find(x=>x.view.id===g);if(C){let x=null;try{x=Vd(J)}catch(v){console.warn("Error getting category by ID:",v)}const e=a[1]||1;C.view.filterMultiple={categoryId:J,teamType:e},C.view.componentProps.game&&(C.view.componentProps.teamView=e===2?C.view.componentProps.game.awayTeam.team_id:e===1?C.view.componentProps.game.homeTeam.team_id:0),C.view.componentProps.categoryView=x?[{id:J,name:x.name}]:[{id:J,name:`Category ${J}`}]}}}}if(this.viewId===8){const B=a[0]||!1;this.childViews.forEach(J=>{J.view.componentProps&&(J.view.componentProps._isReactive||(J.view.componentProps=p.reactive(J.view.componentProps),J.view.componentProps._isReactive=!0),J.view.componentProps.areInactiveVisible=B,J.view.componentProps.key=B,Ei.emit("component-props-updated",{viewId:J.view.id,componentProps:J.view.componentProps,dynamicFilters:a}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:J.view.id,dynamicFilters:a}))})}if(this.viewId===1){const B=a[0]||[];if(console.log("GSCComparativeReports updateDynamicFilters - selectedAnalysisTypes:",B),console.log("GSCComparativeReports updateDynamicFilters - componentId:",g),g){console.log(`GSCComparativeReports - updating specific filters for component ${g}`),this.setDynamicFilters(a,g);const J=this.childViews.find(C=>C.view.id===g);J&&this.updateComparative(J,a)}else if(this.childViews.reduce((J,C)=>(B.includes(C.view.componentProps.type)||J.push(C.view.componentProps.type),J),[]).forEach(J=>{const C=this.childViews.findIndex(x=>x.view.componentProps.type===J);if(C!==-1){for(let x=C;x<this.childViews.length;x++){const e=this.childViews[x+1],v=this.childViews[x];e&&(v.view.componentProps.type=e.view.componentProps.type,v.view.title=e.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),console.log("GSCComparativeReports - updating all components with global filters"),Array.isArray(B))console.log("GSCComparativeReports updateDynamicFilters (array mode) - skipping removal logic to prevent cross-page deletions"),this.childViews.length>0&&B.length>0&&this.childViews.forEach((J,C)=>{if(J.view.componentProps&&C<B.length){const x=B[C],e=Fd.get(this.viewId);J.view.componentProps.type=x,J.view.componentProps.default=!1,J.view.title=`Comparativa ${e[x]}`,J.view.filterMultiple={category:x},console.log(`GSCComparativeReports updateDynamicFilters - updated component ${C} with type:`,x)}});else{const J=B;if(J&&this.childViews.length>0){const C=this.childViews[0];if(C.view.componentProps){const x=Fd.get(this.viewId);C.view.componentProps.type=J,C.view.componentProps.default=!1,C.view.title=`Comparativa ${x[J]}`,C.view.filterMultiple={category:J}}}}console.log("-------------------------------------------------------------"),console.log("childViews",this.childViews)}if(this.viewId===6){const B=a[0]||[];if(g){console.log(`GSCLineupsReports - updating specific filters for component ${g}`),this.setDynamicFilters(a,g);const J=this.childViews.find(C=>C.view.id===g);J&&this.updateGSCLineupsReports(J,a)}else{if(console.log("GSCLineupsReports - updating all components with global filters"),Array.isArray(B))if(B.length===0)for(console.log("GSCLineupsReports - no games selected, removing all components");this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((J,C)=>(B.includes(C.view.componentProps.gameNumber)||J.push(C.view.componentProps.gameNumber),J),[]).forEach(J=>{const C=this.childViews.findIndex(x=>x.view.componentProps.gameNumber===J);if(C!==-1){for(let x=C;x<this.childViews.length;x++){const e=this.childViews[x+1],v=this.childViews[x];e&&(v.view.componentProps.gameNumber=e.view.componentProps.gameNumber,v.view.filterMultiple={gameNumber:e.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(J=>{J.view.componentProps&&(J.view.componentProps._isReactive||(J.view.componentProps=p.reactive(J.view.componentProps),J.view.componentProps._isReactive=!0),Ei.emit("component-props-updated",{viewId:J.view.id,componentProps:J.view.componentProps,dynamicFilters:a}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:J.view.id,dynamicFilters:a}))})}}if(this.viewId===3){if(console.log("GSCMatchSummary updateDynamicFilters:",{dynamicFilters:a,componentId:g,childViewsLength:this.childViews.length}),g){console.log(`GSCMatchSummary - updating specific filters for component ${g}`),this.setDynamicFilters(a,g);const B=this.childViews.find(J=>J.view.id===g);B&&this.updateMatchSummary(B,a)}else{console.log("GSCMatchSummary - updating all components with global filters");const B=a[0]||!1;this.childViews.forEach(J=>{J.view.componentProps&&(J.view.componentProps._isReactive||(J.view.componentProps=p.reactive(J.view.componentProps),J.view.componentProps._isReactive=!0),J.view.componentProps.desplegable=B,J.view.componentProps.key=B,Ei.emit("component-props-updated",{viewId:J.view.id,componentProps:J.view.componentProps,dynamicFilters:a}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:J.view.id,dynamicFilters:a}))})}this.updateSummary({dynamicFilters:a})}if(this.viewId===4){console.log("444444444444444444444444444444444444444444444444444444444444444444444"),console.log("Timeline updateDynamicFilters:",a);const B=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;if(console.log("Timeline updateDynamicFilters:",{hasSelectedEvents:B,childViewsLength:this.childViews.length,dynamicFilters:a,componentId:g}),g){console.log(`Timeline - updating specific filters for component ${g}`);const J=this.childViews.find(C=>C.view.id===g);console.log("specificView",J),J&&(console.log("is view reactive:",p.isReactive(J)),console.log("is view.componentProps reactive:",p.isReactive(J.view.componentProps)),console.log("is view.dynamicFilters reactive:",p.isReactive(J.dynamicFilters)),J.view.componentProps.selectedEvents)}else if(console.log("Timeline - updating all components with global filters"),!B&&this.childViews.length>0)console.log("Timeline - removing views due to no events"),this.childViews.forEach(J=>{this.removeChildView(J)});else if(B&&this.childViews.length===0){console.log("Timeline - emitting add-view event");const J={pageId:null,view:{id:this.viewId,name:"Timeline",title:"Timeline",colspan:12,rowspan:6,max_column:12,max_row:12,min_column:6,min_row:4},filterAndWidgetContainer:this};Ei.emit("add-view",J)}else this.childViews.forEach(J=>{this.updateTimeline(J,a)})}console.log("updateDynamic filters completed successfullyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"),console.log("this.childViews",this.childViews)}finally{this._isUpdating=!1}}removeAllChildViews(){[...this.childViews].forEach(a=>{this.removeChildView(a)})}removeChildView(a,g=!1){const B=this.childViews.findIndex(J=>J.view.id===a.view.id);if(B!==-1){const J=this.childViews[B];this.childViews.splice(B,1),J.view.id&&(this.componentSpecificFilters.delete(J.view.id),console.log(`Cleaned specific filters for component ${J.view.id}`));const C=J.grid,x=J.page,e=document.querySelector(`[gs-id="${J.view.id}"]`);if(C&&e&&(C.removeWidget(e),x&&!g)){const v=x.items.findIndex(u=>u.id===J.view.id);v!==-1&&(x.items.splice(v,1),x.items.length===0&&Ei.emit("empty-page",x))}}}updateView({view:a,dynamicFilters:g,filtersJSON:B}){console.log("222222222222222222222222222222222222222"),console.log("view:",a),console.log("dynamicFilters:",g),console.log("filtersJSON:",B),console.log("this.viewId:",this.viewId),console.log("childViews:",this.childViews),this.setFiltersJSON(B),this.dynamicFilters=g;const J=this.childViews.find(C=>{var x;return((x=C.view)==null?void 0:x.id)===a.view.id});if(console.log("viewToUpdate:",J),J){J.view.filtersJSON=B,J.view.coreView&&(J.view.coreView.filtersJSON=B);let C=g;if(this.viewId===4){const x=this.getComponentDynamicFilters(a.view.id);x&&(C=x,console.log(`Timeline updateView - using specific filters for component ${a.view.id}:`,C))}else if(this.viewId===8){const x=this.getComponentDynamicFilters(a.view.id);x&&(C=x,console.log(`FieldPosesion updateView - using specific filters for component ${a.view.id}:`,C))}else if(this.viewId===3){const x=this.getComponentDynamicFilters(a.view.id);console.log(`GSCMatchSummary updateView - component ${a.view.id}:`,{componentSpecificFilters:x,dynamicFilters:g,willUseSpecific:!!x}),x?(C=x,console.log(`GSCMatchSummary updateView - using specific filters for component ${a.view.id}:`,C)):console.log("GSCMatchSummary updateView - no specific filters found, using dynamicFilters:",C),this.updateSummary({dynamicFilters:C})}else if(this.viewId===1){const x=this.getComponentDynamicFilters(a.view.id);console.log(`GSCComparativeReports updateView - component ${a.view.id}:`,{componentSpecificFilters:x,dynamicFilters:g,willUseSpecific:!!x}),x?(C=x,console.log(`GSCComparativeReports updateView - using specific filters for component ${a.view.id}:`,C)):console.log("GSCComparativeReports updateView - no specific filters found, using dynamicFilters:",C)}else if(this.viewId===6){const x=this.getComponentDynamicFilters(a.view.id);console.log(`GSCLineupsReports updateView - component ${a.view.id}:`,{componentSpecificFilters:x,dynamicFilters:g,willUseSpecific:!!x}),x?(C=x,console.log(`GSCLineupsReports updateView - using specific filters for component ${a.view.id}:`,C)):console.log("GSCLineupsReports updateView - no specific filters found, using dynamicFilters:",C)}else if(this.viewId===7){const x=this.getComponentDynamicFilters(a.view.id);console.log(`GSCGoalData updateView - component ${a.view.id}:`,{componentSpecificFilters:x,dynamicFilters:g,willUseSpecific:!!x}),x?(C=x,console.log(`GSCGoalData updateView - using specific filters for component ${a.view.id}:`,C)):console.log("GSCGoalData updateView - no specific filters found, using dynamicFilters:",C)}else if(this.viewId===9){console.log("update viewwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww zones");const x=this.getComponentDynamicFilters(a.view.id);console.log(`GSCFieldDataByZones updateView - component ${a.view.id}:`,{componentSpecificFilters:x,dynamicFilters:g,willUseSpecific:!!x}),x?(C=x,console.log(`GSCFieldDataByZones updateView - using specific filters for component ${a.view.id}:`,C)):console.log("GSCFieldDataByZones updateView - no specific filters found, using dynamicFilters:",C)}this.viewId===5?this.updateVolumetricField(J,C):this.viewId===7?this.updateGoalData(J,C):this.viewId===9?this.updateFieldDataByZones(J,g):this.viewId===10?this.updateXg(J,C):this.viewId===3?this.updateMatchSummary(J,C):this.viewId===4?this.updateTimeline(J,C):this.viewId===8?this.updateFieldPosesion(J,C):this.viewId===1?this.updateComparative(J,C):this.viewId===2?this.updateGSCtops(J,C):this.viewId===6&&this.updateGSCLineupsReports(J,C)}else console.log("viewToUpdate not found")}updateComparative(a,g){if(console.log("update comparative",g),a.view.componentProps){const B=g[0]||[];if(console.log("GSCComparativeReports updateComparative - selectedAnalysisTypes:",B),B&&B.length>0){let J;if(Array.isArray(B)){const x=this.childViews.findIndex(e=>e.view.id===a.view.id);x>=0&&x<B.length?J=B[x]:J=B[0]}else J=B;const C=Fd.get(this.viewId);a.view.componentProps.type=J,a.view.componentProps.default=!1,a.view.title=`Comparativa ${C[J]}`,a.view.filterMultiple={category:J},console.log("GSCComparativeReports updateComparative - updated component with type:",J)}Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:g}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:g})}}updateVolumetricField(a,g){if(console.log("updateVolumetricField",g),a.view.componentProps){const B=g[0]||1;a.view.isHomeTeam=B===1,a.view.componentProps.preMatchType=B,a.view.filterMultiple={isHomeTeam:B},console.log("GSCVolumetricField updateVolumetricField - updated component with:",{isHomeTeam:B,preMatchType:a.view.componentProps.preMatchType,filterMultiple:a.view.filterMultiple}),Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:g}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:g}),Ei.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateGoalData(a,g){if(console.log("updateGoalData",g),a.view.componentProps){const B=g[0]===1?"offensive":"defensive",J=g[1]===1;a.view.componentProps.analysisType=B,a.view.componentProps.isHomeTeamForAnalysis=J,a.view.isHomeTeam=J,a.view.filterMultiple={isHomeTeam:J},console.log("GSCGoalData updateGoalData - updated component with:",{analysisType:B,isHomeTeam:J,filterMultiple:a.view.filterMultiple}),Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:g}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:g}),Ei.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldDataByZones(a,g){if(console.log("9999999999999999999999999999999999999999999999999999"),console.log("updateFieldDataByZones",g),console.log("view",a),a.view.componentProps){const B=g[0],J=g[1]===1;if(console.log("dynamicFiltersValuesPerTeam",B),console.log("isHomeTeam",J),a.view.componentProps.isHomeTeamForAnalysis=J,a.view.isHomeTeam=J,a.view.filterMultiple={categoryIds:B,isHomeTeam:J},B&&B.length){const C=B.join("-"),x=Fd.get(this.viewId).analysisTypes.get(C);console.log("analysisTypeInfo",x),x&&(a.view.componentProps.analysisType=x.analysisType,a.view.title=x.title,a.view.titleShort=x.titleShort),console.log("************************************"),console.log("is view reactive:",p.isReactive(a)),console.log("is view.view reactive:",p.isReactive(a.view)),console.log("is view.view.componentProps reactive:",p.isReactive(a.view.componentProps)),console.log("view after update:",a),console.log("this.childViews",this.childViews)}console.log("GSCFieldDataByZones updateFieldDataByZones - updated component with:",{categoryIds:B,isHomeTeam:J,analysisType:a.view.componentProps.analysisType,title:a.view.title,filterMultiple:a.view.filterMultiple})}}updateXg(a,g){console.log("1000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),console.log("dynamicFilters",g),console.log("view",a);const B=g[0]===1;a.view.componentProps&&(a.view.isHomeTeam=B,a.view.componentProps.isHomeTeamForAnalysis=B,a.view.filtersJSON=this.filtresJSON,a.view.filterMultiple={isHomeTeam:B}),console.log("view",a)}updateMatchSummary(a,g){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const B=g&&g.length>0?g[0]:!1;a.view.componentProps.desplegable=B,a.view.componentProps.key=B,Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:g}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:g})}}updateTimeline(a,g){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const B=this.getComponentDynamicFilters(a.view.id),J=B||g,C=J&&J.length>0?J[0]:[];a.view.componentProps.selectedEvents=C,a.view.componentProps.key=C.length>0;const x=this.hasEventTypeId(C,1),e=this.hasCategoryId(C,8),v=this.hasCategoryId(C,9),u=this.hasEventTypeId(C,3);console.log("Timeline update - Events check:",{goals:x,yellowCards:e,redCards:v,substitutions:u,selectedEvents:C,componentId:a.view.id,usingSpecificFilters:!!B}),a.view.componentProps.goals=x,a.view.componentProps.yellowCards=e,a.view.componentProps.redCards=v,a.view.componentProps.substitutions=u,a.view.componentProps._updateKey=Date.now(),Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:J}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:J}),Ei.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldPosesion(a,g){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=p.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const B=g&&g.length>0?g[0]:!1;a.view.componentProps.areInactiveVisible=B,a.view.componentProps.key=B,Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:g}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:g})}}updateGSCtops(a,g){if(console.log("updateGSCtops",g),a.view.componentProps){const B=g[0]||[];if(Array.isArray(B)){if(console.log("GSCtops updateGSCtops (array mode) - skipping removal logic to prevent cross-page deletions"),B.length>0){const J=B[0];let C=null;try{C=Vd(J)}catch(e){console.warn("Error getting category by ID:",e)}const x=g[1]||1;a.view.filterMultiple={categoryId:J,teamType:x},a.view.componentProps.game&&(x===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:x===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=C?[{id:J,name:C.name}]:[{id:J,name:`Category ${J}`}]}}else{const J=B;if(J){let C=null;try{C=Vd(J)}catch(e){console.warn("Error getting category by ID:",e)}const x=g[1]||1;a.view.filterMultiple={categoryId:J,teamType:x},a.view.componentProps.game&&(x===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:x===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=C?[{id:J,name:C.name}]:[{id:J,name:`Category ${J}`}]}}}}updateGSCLineupsReports(a,g){if(console.log("updateGSCLineupsReports",g),a.view.componentProps){const B=g[0]||[];if(Array.isArray(B)){if(console.log("GSCLineupsReports updateGSCLineupsReports (array mode) - skipping removal logic to prevent cross-page deletions"),B.length>0){const J=B[0];a.view.filterMultiple={gameNumber:J},a.view.componentProps.gameNumber=J}}else{const J=B;J&&(a.view.filterMultiple={gameNumber:J},a.view.componentProps.gameNumber=J)}Ei.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:g}),Ei.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:g}),Ei.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}getCategoryIdFromAnalysisType(a,g){if(!a||!g)return null;for(const B of g){const J=B.join("-"),C=Fd.get(this.viewId);if(C&&C.analysisTypes){const x=C.analysisTypes.get(J);if(x&&x.analysisType===a)return B[0]||null}}return null}}const Dse={class:"template-page__header"},Bse={class:"template-page__header__name"},Vse=["value"],Fse={class:"template-page__header__details"},jse={class:"template-page__header__details__teams"},Use={class:"template-page__header__details__teams__team"},qse={key:0,class:"template-page__header__details__teams__team__logo"},Wse=["src"],Gse={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Hse={class:"template-page__header__details__teams__team"},Xse={key:0,class:"template-page__header__details__teams__team__logo"},Yse=["src"],Jse={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Kse={class:"template-page__content"},Zse=["id"],Qse=["gs-id","gs-x","gs-y","gs-w","gs-h","gs-max-w","gs-max-h","gs-min-w","gs-min-h","gs-no-resize","gs-no-move","gs-auto-position"],$se=p.defineComponent({__name:"TemplateReportPage",props:{token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"},game:{type:Object,default:()=>null},lastGames:{type:Array,default:()=>null},id:{type:[String,Number],default:()=>String(Date.now())},page:{type:Object,default:()=>({title:"Page 1",items:[{name:"Tabla jugadores",id:`w-${String(Date.now())}`,x:0,y:0,w:4,h:4,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}}]})},isPostMatch:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},isFilterVisible:{type:Boolean,default:!1}},emits:["intersection-changed","delete-page","change-sort","edit-view","view-changed","component-props-updated","delete-view","dynamic-filters-changed"],setup(r,{emit:a}){var g,B;const J=p.ref(null);let C=null;const x=r,e=p.ref(!1),v=a,u=p.computed(()=>x.page.items.reduce((z,V)=>(z.set(V.id,V),z),new Map)),t=p.computed(()=>{var z,V,U,q;return x.game&&x.game.homeTeam&&x.game.awayTeam?{homeTeam:{name:((z=x.game.homeTeam)==null?void 0:z.acronym)||"LOC",logo:((V=x.game.homeTeam)==null?void 0:V.logo)||null},awayTeam:{name:((U=x.game.awayTeam)==null?void 0:U.acronym)||"VIS",logo:((q=x.game.awayTeam)==null?void 0:q.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let w=null,y=null,b=!1,h=null,n=!1;const i=()=>{n=!0},d=()=>{n=!1};function s(){n||(b=!0,h&&clearTimeout(h),h=setTimeout(()=>{b=!1},150))}function c(){const z={root:null,rootMargin:"0px",threshold:.7};w=new IntersectionObserver(q=>{q.forEach(W=>{if(console.log("Intersection observer triggered:",W.isIntersecting,"isScrolling:",b),b){console.log("Scroll in progress, delaying intersection event"),y&&clearTimeout(y),y=setTimeout(()=>{console.log("Emitting delayed intersection event:",W.isIntersecting),v("intersection-changed",W.isIntersecting)},100);return}y&&clearTimeout(y),y=setTimeout(()=>{console.log("Emitting immediate intersection event:",W.isIntersecting),v("intersection-changed",W.isIntersecting)},50)})},z);const V=J.value;V&&w.observe(V);const U=document.querySelector(".container-main");U&&U.addEventListener("scroll",s,{passive:!0}),document.addEventListener("programmatic-scroll-start",i),document.addEventListener("programmatic-scroll-end",d)}function f(z){console.log("newValue:",z),x.page.title=z.target.value,v("view-changed")}const m={game_id:0,season_id:0,prematch:!1},T={gameId:90209,id:90209,seasonId:1909,regularSeasonId:1909,matchday_name:"Matchday 1",status:1,score:[1,3],game_status:1,dateTimeUTC:"2024-09-05T22:00:00Z",homeTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/2936.png",team_id:2936,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/2936.png",colloquial_name:"Guyana",acronym:"GUY",team_name:"Guyana"},awayTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/3279.png",team_id:3279,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/3279.png",colloquial_name:"Surinam",acronym:"SUR",team_name:"Surinam"},is_live:0,minutes:{home_goals_minutes:[],visiting_goals_minutes:[],home_yellow_cards_minutes:[],away_yellow_cards_minutes:[],home_red_cards_minutes:[],away_red_cards_minutes:[]}},E=new Map([[5,{component:Ix,componentName:"GSCVolumetricField",props:{isGamePreMatch:!x.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:x.isTemplateMode,isTemplateMode:x.isTemplateMode,preMatchType:1}}],[2,{component:Tw,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:x.game?x.game.id:T.gameId,game:x.game,season:x.game?(g=x==null?void 0:x.game)==null?void 0:g.season_id:T.seasonId,teamView:0,useDummyData:x.isTemplateMode}}],[8,{component:E3,componentName:"FieldPosesion",props:{widthSection:600,game:T,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:P4,componentName:"GSCLineupsReports",props:{selectedOption:x.isPostMatch?"Postmatch":"Prematch",game:m,gamehome:m,gameaway:m}}],[3,{component:M3,componentName:"GSCMatchSummary",props:{game:T,defaultShields:!0,desplegable:!1}}],[4,{component:p5,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:T.gameId,homeTeam:T.homeTeam.team_id,awayTeam:T.awayTeam.team_id,token:x.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:v6,componentName:"GSCGoalData",props:{game:x.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!x.isPostMatch,analysisType:1}}],[9,{component:N4,componentName:"GSCFieldDataByZones",props:{game:x.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!x.isPostMatch,negative:!0}}],[10,{component:M6,componentName:"GSCGameXg",props:{game:x.game,isHomeTeamForAnalysis:!0,isPostMatch:x.isPostMatch}}],[1,{component:m6,componentName:"GSCComparativeReports",props:{gameId:x.game?x.game.id:"",homeLogo:x.game?x.game.homeTeam.logo:"",awayLogo:x.game?x.game.awayTeam.logo:"",seasonId:x.game?(B=x==null?void 0:x.game)==null?void 0:B.season_id:0,typeGame:x.isPostMatch,type:"stoppedBall",default:x.isTemplateMode}}]]);function S(z){if(z)if(typeof z=="string"){let V=null;switch(z){case"GSCVolumetricField":V=Ix;break;case"GSCGoalData":V=v6;break;case"GscTopPlayer":V=Tw;break;case"FieldPosesion":V=E3;break;case"GSCLineupsReports":V=P4;break;case"GSCMatchSummary":V=M3;break;case"GSCTimelineReports":V=p5;break;case"GSCFieldDataByZones":V=N4;break;case"GSCGameXg":V=M6;break;case"GSCComparativeReports":V=m6;break;default:V=null}return V}else return z;return null}function P({pageId:z,view:V,filterAndWidgetContainer:U,applyMinimumSize:q=!1,dynamicFilters:W=[]}){if(x.page.id===z&&C){let Z=!1;V.id===3&&(Z=W[0]);const ne=`min_column${Z?"_2":""}`,X=`min_row${Z?"_2":""}`,re=`colspan${Z?"_2":""}`,ee=`rowspan${Z?"_2":""}`,K={w:q?V[ne]:V[re],h:q?V[X]:V[ee]};if(C.willItFit(0,0,K.w,K.h,!0)){const te=C.addWidget(K),ae=Number(te.getAttribute("gs-x")||0),oe=Number(te.getAttribute("gs-y")||0);C.removeWidget(te);const he=E.get(V.id),fe=p.reactive({...JSON.parse(JSON.stringify(he.props))||{},_isReactive:!0}),se=p.reactive({pageId:z,grid:C,page:x.page,view:{name:V.name,title:V.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:ae,y:oe,w:K.w,h:K.h,maxWidth:V.max_column,maxHeight:V.max_row,minWidth:V.min_column,minHeight:V.min_row,componentName:he.componentName,componentProps:fe,pageId:z,coreView:V}});U.addView(se),Ei.emit("add-page-view",se)}else Ei.emit("add-page-and-view",{pageId:z,view:V,filterAndWidgetContainer:U})}}function N(z){if(C){const V=document.querySelector(`[gs-id="${z.id}"]`);V&&(C.removeWidget(V),v("delete-view",z))}v("view-changed")}function A(z){if(!z.filterAndViewsContainer&&z.coreView){const V=new Up(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[z],z.coreView.id,z.dynamicFilters||[],x.isPostMatch,x.isTemplateMode,z.filtersJSON);z.filterAndViewsContainer=V}v("edit-view",z)}function O(){v("delete-page",x.page)}function M(){Ei.emit("change-sort",x.page)}function k(z){if(b)return;console.log("force-component-update event received:",z);const V=x.page.items.find(U=>U.id===z.itemId||U.id===z.viewId);V?(console.log("Found item to update in force-component-update:",V.id),Object.assign(V.componentProps,z.componentProps),V._updateKey=Date.now(),console.log("Updated item in force-component-update:",V.componentProps)):console.log("Item not found in force-component-update for id:",z.itemId||z.viewId)}function I(z){if(b)return;console.log("component-props-updated event received:",z);const V=x.page.items.find(U=>U.id===z.viewId);V?(console.log("Found item to update in component-props-updated:",V.id),Object.assign(V.componentProps,z.componentProps),V._updateKey=Date.now(),console.log("Updated item in component-props-updated:",V.componentProps)):console.log("Item not found in component-props-updated for id:",z.viewId)}function _(z){if(b)return;console.log("dynamic-filters-changed event received:",z);const V=x.page.items.find(U=>U.id===z.viewId);V?(console.log("Found item to update in dynamic-filters-changed:",V.id),Object.assign(V.componentProps,z.componentProps||{}),V._updateKey=Date.now(),console.log("Updated item in dynamic-filters-changed:",V.componentProps)):console.log("Item not found in dynamic-filters-changed for id:",z.viewId)}const R=function(){Ei.off("add-view",P),Ei.off("force-component-update",k),Ei.off("component-props-updated",I),Ei.off("dynamic-filters-changed",_);const z=document.querySelector(".container-main");z&&z.removeEventListener("scroll",s),y&&clearTimeout(y),h&&clearTimeout(h)};return Ei.on("add-view",P),Ei.on("force-component-update",k),Ei.on("component-props-updated",I),Ei.on("dynamic-filters-changed",_),p.onMounted(async()=>{await p.nextTick(),C=Wi.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${x.id}`),C.on("change",(z,V)=>{const U=V[0];if(U){const q=u.value.get(U.id);q&&(q.x=U.x,q.y=U.y,q.w=U.w,q.h=U.h,v("view-changed"))}}),c(),x.page.grid=C,x.page.offListeners=R}),p.onUnmounted(()=>{w&&w.disconnect(),R(),y&&clearTimeout(y),h&&clearTimeout(h),document.removeEventListener("programmatic-scroll-start",i),document.removeEventListener("programmatic-scroll-end",d)}),(z,V)=>(p.openBlock(),p.createElementBlock("div",{ref_key:"templatePage",ref:J,class:"template-page"},[p.createElementVNode("div",Dse,[e.value?(p.openBlock(),p.createBlock(P6,{key:0,"options-type":"page",onClick:V[0]||(V[0]=p.withModifiers(U=>e.value=!1,["self"])),onMouseleave:V[1]||(V[1]=U=>e.value=!1),onCloseTooltip:V[2]||(V[2]=U=>e.value=!1),onDeletePage:O,onChangeSort:M})):p.createCommentVNode("",!0),p.createElementVNode("div",Bse,[V[4]||(V[4]=p.createElementVNode("div",null,[p.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M11.2986 12.9994C7.62909 14.8341 4.11744 16.0178 1.35547 16.4518L9.18763 20.0029C9.34545 20.0818 9.60192 20.0818 9.74002 20.0029L17.8878 16.3137C18.0457 16.2348 18.164 16.0572 18.164 15.8797V8.75781C16.2898 10.2177 13.9422 11.6776 11.2986 12.9994Z",fill:"white"}),p.createElementVNode("path",{d:"M4.7152 8.89735C4.7152 8.89735 10.9494 3.76802 16.8482 1.20335C15.0529 0.946887 11.3637 0.43395 9.3711 0.453678C4.41928 0.493135 1.06546 1.34145 1.06546 1.34145C0.90763 1.3809 0.769531 1.55846 0.769531 1.71629V8.12795C3.01857 6.56942 5.34651 5.56329 5.34651 5.56329C5.34651 5.56329 2.72264 7.06263 0.769531 8.81844V9.41028V14.1648C3.09748 13.9675 6.62886 12.7641 10.3575 10.7321C13.6719 8.91707 16.4733 6.84562 18.17 5.05035V2.40677C14.3032 3.37346 4.7152 8.89735 4.7152 8.89735Z",fill:"white"})])],-1)),V[5]||(V[5]=p.createElementVNode("div",{class:"separator"},null,-1)),p.createElementVNode("input",{value:r.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:f},null,40,Vse)]),p.createElementVNode("div",Fse,[p.createElementVNode("div",jse,[p.createElementVNode("div",Use,[t.value.homeTeam.logo?(p.openBlock(),p.createElementBlock("div",qse,[p.createElementVNode("img",{src:t.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,Wse)])):(p.openBlock(),p.createElementBlock("svg",Gse,[...V[6]||(V[6]=[p.createElementVNode("path",{opacity:"0.4",d:"M12.0153 0.261719C12.0153 0.261719 13.6664 1.94994 17.7355 2.06744C21.149 2.16638 22.3796 1.30063 22.3796 1.30063C22.3796 1.30063 25.4902 10.2488 20.3822 17.7005C17.6983 21.615 12.5533 24.1504 12.0091 24.2617C11.4711 24.1504 6.31984 21.615 3.636 17.7005C-1.4596 10.2488 1.65094 1.30063 1.65094 1.30063C1.65094 1.30063 2.88155 2.16638 6.2951 2.06744C10.3642 1.94994 12.0153 0.261719 12.0153 0.261719Z",fill:"#54728B"},null,-1)])])),p.createElementVNode("span",null,p.toDisplayString(t.value.homeTeam.name),1)]),V[8]||(V[8]=p.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),p.createElementVNode("div",Hse,[p.createElementVNode("span",null,p.toDisplayString(t.value.awayTeam.name),1),t.value.awayTeam.logo?(p.openBlock(),p.createElementBlock("div",Xse,[p.createElementVNode("img",{src:t.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,Yse)])):(p.openBlock(),p.createElementBlock("svg",Jse,[...V[7]||(V[7]=[p.createElementVNode("path",{opacity:"0.4",d:"M12.0153 0.261719C12.0153 0.261719 13.6664 1.94994 17.7355 2.06744C21.149 2.16638 22.3796 1.30063 22.3796 1.30063C22.3796 1.30063 25.4902 10.2488 20.3822 17.7005C17.6983 21.615 12.5533 24.1504 12.0091 24.2617C11.4711 24.1504 6.31984 21.615 3.636 17.7005C-1.4596 10.2488 1.65094 1.30063 1.65094 1.30063C1.65094 1.30063 2.88155 2.16638 6.2951 2.06744C10.3642 1.94994 12.0153 0.261719 12.0153 0.261719Z",fill:"#54728B"},null,-1)])]))])]),r.isTemplateMode&&!r.isFilterVisible?(p.openBlock(),p.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:V[3]||(V[3]=U=>e.value=!0)},[...V[9]||(V[9]=[p.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])])):p.createCommentVNode("",!0)])]),p.createElementVNode("div",Kse,[p.createElementVNode("div",{id:`grid-stack-${r.id}`,class:"grid-stack"},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.page.items,U=>{var q,W,Z;return p.openBlock(),p.createElementBlock("div",{class:"grid-stack-item",key:U.key,"gs-id":U.id,"gs-x":U.x,"gs-y":U.y,"gs-w":U.w,"gs-h":U.h,"gs-max-w":U.maxWidth,"gs-max-h":U.maxHeight,"gs-min-w":U.minWidth,"gs-min-h":U.minHeight,"gs-no-resize":!r.isTemplateMode,"gs-no-move":!x.isTemplateMode,"gs-auto-position":U.x===0&&U.y===0},[p.createElementVNode("div",{class:p.normalizeClass(["grid-stack-item-content",{"is-selected":U.isSelected}])},[p.createVNode(Ase,{title:U.coreView&&U.coreView.id===9&&U.w<4&&U.titleShort||U.title,"is-template-mode":r.isTemplateMode,game:r.game,lastGames:r.lastGames,"is-home-team":(q=U.componentProps)!=null&&q.preMatchType?((W=U.componentProps)==null?void 0:W.preMatchType)===1:U.isHomeTeam,"is-filter-visible":r.isFilterVisible,"view-id":((Z=U==null?void 0:U.coreView)==null?void 0:Z.id)||0,onEdit:ne=>A(U),onDelete:ne=>N(U)},{default:p.withCtx(()=>[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(S(U.componentName)),p.mergeProps({ref_for:!0},U.componentProps,{key:`${U.id}-${U._updateKey||0}`}),null,16))]),_:2},1032,["title","is-template-mode","game","lastGames","is-home-team","is-filter-visible","view-id","onEdit","onDelete"])],2)],8,Qse)}),128))],8,Zse)])],512))}}),ele=dd($se,[["__scopeId","data-v-5ca40dad"]]),tle={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},rle={key:0,class:"cover__main-logo cover__main-logo__home"},nle={key:0,class:"team-logo"},ile=["src"],ale={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ole=["fill"],sle={key:1,class:"cover__main-logo cover__main-logo__away"},lle={key:0,class:"team-logo"},cle=["src"],ule={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dle=["fill"],hle={class:"cover__title-subtitle"},ple={class:"cover__title-subtitle__title"},fle={class:"cover__title-subtitle__subtitle"},mle={key:2,class:"cover-type-one"},gle={class:"team-info-one"},yle={class:"team-data"},vle={key:0,class:"team-logo"},ble=["src"],xle={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_le=["fill","opacity"],wle={class:"team-name"},Tle={key:0,class:"team-events"},kle={class:"score-one"},Sle={key:0},Ele={class:"team-info-one"},Ale={class:"team-data"},Cle={key:0,class:"team-logo"},Mle=["src"],Ple={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Nle=["fill","opacity"],Ole={class:"team-name"},Ile={key:0,class:"team-events"},Rle={key:3,class:"cover-type-two"},Lle={class:"team-data"},zle={class:"team-info"},Dle={key:0,class:"team-logo"},Ble=["src"],Vle={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Fle=["fill","opacity"],jle={key:2,class:"team-score-two"},Ule={key:0,class:"team-goals"},qle={class:"team-data"},Wle={class:"team-info"},Gle={key:0,class:"team-score-two"},Hle={key:1,class:"team-logo"},Xle=["src"],Yle={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Jle=["fill","opacity"],Kle={key:0,class:"team-goals"},Zle={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(r,{emit:a}){const g=r,B=a,J=p.ref(null),C=p.computed(()=>[1,2].includes(g.coverId)),x=p.computed(()=>[1,3].includes(g.coverId)),e=p.computed(()=>g.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:g.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),v=p.computed(()=>g.game&&g.game.score?g.game.score:["0","0"]),u=p.computed(()=>{var P,N,A,O,M,k,I,_;if(g.game&&g.game.homeTeam&&g.game.awayTeam){const R={homeTeam:{name:((P=g.game.homeTeam)==null?void 0:P.acronym)||"LOC",logo:((N=g.game.homeTeam)==null?void 0:N.logo)||null},awayTeam:{name:((A=g.game.awayTeam)==null?void 0:A.acronym)||"VIS",logo:((O=g.game.awayTeam)==null?void 0:O.logo)||null}};return C.value?(R.homeTeam.goalsMinutes=n(g.game.minutes.home_goals_minutes),R.homeTeam.totalYellowCards=((M=g.game.minutes.home_yellow_cards_minutes)==null?void 0:M.length)||0,R.homeTeam.totalRedCards=((k=g.game.minutes.home_red_cards_minutes)==null?void 0:k.length)||0,R.awayTeam.goalsMinutes=n(g.game.minutes.visiting_goals_minutes),R.awayTeam.totalYellowCards=((I=g.game.minutes.away_yellow_cards_minutes)==null?void 0:I.length)||0,R.awayTeam.totalRedCards=((_=g.game.minutes.away_red_cards_minutes)==null?void 0:_.length)||0):(R.homeTeam.goalsEvents=h(g.game.report_minutes.home_goals_minutes),R.awayTeam.goalsEvents=h(g.game.report_minutes.visiting_goals_minutes)),R}return{homeTeam:{name:"LOC",logo:null,goalsMinutes:"00'",totalYellowCards:0,totalRedCards:0,goalsEvents:[{playerName:"Nombre",goalTime:"00'"}]},awayTeam:{name:"VIS",logo:null,goalsMinutes:"00'",totalYellowCards:0,totalRedCards:0,goalsEvents:[{playerName:"Nombre",goalTime:"00'"}]}}}),t=p.computed(()=>({"--background-image":x.value?"url(https://golstatsimages.blob.core.windows.net/report-maker/background-postmatch-template-01@2x.jpg)":"url(https://golstatsimages.blob.core.windows.net/report-maker/background-postmatch-template-02@2x.jpg)","--grid-template-columns-type-one":g.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":g.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":g.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":g.isPostMatch?"100%":"fit-content"})),w=p.computed(()=>g.isPostMatch?"Postmatch":"Prematch"),y=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],b=p.computed(()=>{if(g.game){let P=tle[g.game.matchday_abbreviation];P||(P=g.game.matchday_abbreviation.replace("M","J"));const[N,A,O]=g.game.date.split("-");return`${P} - ${O} ${y[Number(A)-1]}, ${N}`}return"Jornada - Día 00 Mes"});function h(P){return!P||!Array.isArray(P)||P.length===0?"":(console.log("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"),console.log("goalsDetails",P),P.map(N=>{const A=N.split(", ");let O=A[0].replace("'","");O=O.replace("+",""),O=O.replace("’",""),console.log("playerGoalsArray",A);const M=O.split(" "),{strings:k,numbers:I}=M.reduce((z,V)=>(isNaN(Number(V))?z.strings.push(V):z.numbers.push(V),z),{strings:[],numbers:[]}),_=k.join(" "),R=I.length===1?`${I[0]}'`:`${I[0]}' ${I.slice(1).join(" + ")}'`;return{playerName:_,goalTime:A.length===1?R:`${R}, ${A.reduce((z,V,U)=>U===0?z:`${z}${V}${U<A.length-1?", ":""}`,"")}`}}))}function n(P){return!P||!Array.isArray(P)||P.length===0?"":P.reduce((N,A,O)=>{const M=A.split(" ");let k="";return M.length===3?k=M[2]:M.length===5&&(k=`${M[2]} ${M[3]} ${M[4]}`),k&&(N+=`${k}${O<P.length-1?", ":""}`),N},"")}let i=null,d=null,s=!1,c=null,f=!1;const m=()=>{f=!0},T=()=>{f=!1};function E(){if(f){console.log("Cover: Ignoring programmatic scroll");return}s=!0,c&&clearTimeout(c),c=setTimeout(()=>{s=!1},150)}function S(){const P={root:null,rootMargin:"0px",threshold:.7};i=new IntersectionObserver(O=>{O.forEach(M=>{if(console.log("Cover: Intersection observer triggered:",M.isIntersecting,"isScrolling:",s),s){console.log("Cover: Scroll in progress, delaying intersection event"),d&&clearTimeout(d),d=setTimeout(()=>{console.log("Cover: Emitting delayed intersection event:",M.isIntersecting),B("intersection-changed",M.isIntersecting)},100);return}d&&clearTimeout(d),d=setTimeout(()=>{console.log("Cover: Emitting immediate intersection event:",M.isIntersecting),B("intersection-changed",M.isIntersecting)},50)})},P);const N=J.value;N&&i.observe(N);const A=document.querySelector(".container-main");A&&A.addEventListener("scroll",E,{passive:!0}),document.addEventListener("programmatic-scroll-start",m),document.addEventListener("programmatic-scroll-end",T)}return p.onMounted(()=>{S()}),p.onUnmounted(()=>{i&&i.disconnect();const P=document.querySelector(".container-main");P&&P.removeEventListener("scroll",E),document.removeEventListener("programmatic-scroll-start",m),document.removeEventListener("programmatic-scroll-end",T),d&&clearTimeout(d),c&&clearTimeout(c)}),(P,N)=>(p.openBlock(),p.createElementBlock("div",{ref_key:"coverPage",ref:J,class:"cover",style:p.normalizeStyle(t.value)},[C.value?(p.openBlock(),p.createElementBlock("div",rle,[u.value.homeTeam.logo?(p.openBlock(),p.createElementBlock("div",nle,[p.createElementVNode("img",{src:u.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,ile)])):(p.openBlock(),p.createElementBlock("svg",ale,[p.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:e.value.homeTeam},null,8,ole)]))])):p.createCommentVNode("",!0),C.value?(p.openBlock(),p.createElementBlock("div",sle,[u.value.awayTeam.logo?(p.openBlock(),p.createElementBlock("div",lle,[p.createElementVNode("img",{src:u.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,cle)])):(p.openBlock(),p.createElementBlock("svg",ule,[p.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:e.value.awayTeam},null,8,dle)]))])):p.createCommentVNode("",!0),p.createElementVNode("div",hle,[p.createElementVNode("div",ple,[N[0]||(N[0]=p.createElementVNode("div",null,"Análisis",-1)),p.createElementVNode("div",null,p.toDisplayString(w.value),1)]),p.createElementVNode("div",fle,p.toDisplayString(b.value),1)]),C.value?(p.openBlock(),p.createElementBlock("div",mle,[p.createElementVNode("div",gle,[p.createElementVNode("div",yle,[u.value.homeTeam.logo?(p.openBlock(),p.createElementBlock("div",vle,[p.createElementVNode("img",{src:u.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,ble)])):(p.openBlock(),p.createElementBlock("svg",xle,[p.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:e.value.homeTeam,opacity:e.value.opacity},null,8,_le)])),p.createElementVNode("div",wle,p.toDisplayString(u.value.homeTeam.name),1)]),r.isPostMatch?(p.openBlock(),p.createElementBlock("div",Tle,[N[1]||(N[1]=p.createStaticVNode('<svg class="ball" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-0364d256><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path></svg>',1)),p.createElementVNode("div",null,p.toDisplayString(u.value.homeTeam.goalsMinutes),1),N[2]||(N[2]=p.createElementVNode("div",{class:"separator"},null,-1)),N[3]||(N[3]=p.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),p.createElementVNode("div",null,p.toDisplayString(u.value.homeTeam.totalYellowCards),1),N[4]||(N[4]=p.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),p.createElementVNode("div",null,p.toDisplayString(u.value.homeTeam.totalRedCards),1)])):p.createCommentVNode("",!0)]),p.createElementVNode("div",kle,[r.isPostMatch?(p.openBlock(),p.createElementBlock("div",Sle,p.toDisplayString(v.value[0])+" : "+p.toDisplayString(v.value[1]),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",Ele,[p.createElementVNode("div",Ale,[u.value.awayTeam.logo?(p.openBlock(),p.createElementBlock("div",Cle,[p.createElementVNode("img",{src:u.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,Mle)])):(p.openBlock(),p.createElementBlock("svg",Ple,[p.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:e.value.awayTeam,opacity:e.value.opacity},null,8,Nle)])),p.createElementVNode("div",Ole,p.toDisplayString(u.value.awayTeam.name),1)]),r.isPostMatch?(p.openBlock(),p.createElementBlock("div",Ile,[p.createElementVNode("div",null,p.toDisplayString(u.value.awayTeam.totalYellowCards),1),N[5]||(N[5]=p.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),p.createElementVNode("div",null,p.toDisplayString(u.value.awayTeam.totalRedCards),1),N[6]||(N[6]=p.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),N[7]||(N[7]=p.createElementVNode("div",{class:"separator"},null,-1)),p.createElementVNode("div",null,p.toDisplayString(u.value.awayTeam.goalsMinutes),1),N[8]||(N[8]=p.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-0364d256><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path></svg>',1))])):p.createCommentVNode("",!0)])])):(p.openBlock(),p.createElementBlock("div",Rle,[p.createElementVNode("div",Lle,[p.createElementVNode("div",zle,[u.value.homeTeam.logo?(p.openBlock(),p.createElementBlock("div",Dle,[p.createElementVNode("img",{src:u.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,Ble)])):(p.openBlock(),p.createElementBlock("svg",Vle,[p.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:e.value.homeTeam,opacity:e.value.opacity},null,8,Fle)])),r.isPostMatch?(p.openBlock(),p.createElementBlock("div",jle,p.toDisplayString(v.value[0]),1)):p.createCommentVNode("",!0)]),r.isPostMatch?(p.openBlock(),p.createElementBlock("div",Ule,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(u.value.homeTeam.goalsEvents,(A,O)=>(p.openBlock(),p.createElementBlock("div",{key:`goal-${O}`,class:"goal"},[p.createElementVNode("div",null,p.toDisplayString(A.playerName),1),N[9]||(N[9]=p.createElementVNode("div",{class:"bullet"},null,-1)),p.createElementVNode("div",null,p.toDisplayString(A.goalTime),1),N[10]||(N[10]=p.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-0364d256><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path></svg>',1))]))),128))])):p.createCommentVNode("",!0)]),N[13]||(N[13]=p.createElementVNode("div",{class:"separator"},null,-1)),p.createElementVNode("div",qle,[p.createElementVNode("div",Wle,[r.isPostMatch?(p.openBlock(),p.createElementBlock("div",Gle,p.toDisplayString(v.value[1]),1)):p.createCommentVNode("",!0),u.value.awayTeam.logo?(p.openBlock(),p.createElementBlock("div",Hle,[p.createElementVNode("img",{src:u.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,Xle)])):(p.openBlock(),p.createElementBlock("svg",Yle,[p.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:e.value.awayTeam,opacity:e.value.opacity},null,8,Jle)]))]),r.isPostMatch?(p.openBlock(),p.createElementBlock("div",Kle,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(u.value.awayTeam.goalsEvents,(A,O)=>(p.openBlock(),p.createElementBlock("div",{key:`goal-a-${O}`,class:"goal"},[N[11]||(N[11]=p.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-0364d256><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-0364d256></path></svg>',1)),p.createElementVNode("div",null,p.toDisplayString(A.goalTime),1),N[12]||(N[12]=p.createElementVNode("div",{class:"bullet"},null,-1)),p.createElementVNode("div",null,p.toDisplayString(A.playerName),1)]))),128))])):p.createCommentVNode("",!0)])]))],4))}},Qle=dd(Zle,[["__scopeId","data-v-0364d256"]]),$le={class:"floating-bar"},ece={class:"tab active"},tce={class:"select-display"},rce={class:"select-icon"},nce=["src"],ice={key:1,src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png",alt:"icono",class:"option-img-default"},ace={key:0,class:"select-placeholder select-label"},oce={key:1,class:"select-label"},sce={key:0,class:"dropdown-menu field-menu"},lce=["onClick"],cce={class:"option-icon"},uce=["src","data-hover-src"],dce={class:"option-content"},hce={class:"option-title"},pce={key:0,class:"option-description"},fce={class:"select-display"},mce={class:"select-icon"},gce=["src"],yce=["src"],vce={class:"select-label"},bce={key:0,class:"dropdown-menu type-menu type-menu-grid"},xce={class:"option-grid"},_ce=["onClick"],wce={class:"option-grid-title"},Tce={class:"option-grid-icon"},kce=["src"],Sce={key:1,class:"filter-separator"},Ece=["onClick"],Ace={class:"select-display"},Cce={key:0,class:"badge-categorias"},Mce={key:0,class:"dropdown-menu type-menu multi-select-menu"},Pce={class:"multi-select-scroll-area"},Nce={class:"select-all-checkbox"},Oce=["checked","indeterminate","onChange"],Ice={class:"option-checkbox"},Rce=["checked","onChange"],Lce=["onClick"],zce={class:"option-title"},Dce={class:"multi-select-footer"},Bce={key:1,class:"custom-radio-group filter-inline"},Vce={class:"radio-label"},Fce={class:"radio-options"},jce=["name","value","onUpdate:modelValue","disabled","onChange"],Uce={key:2,class:"check-group filter-inline"},qce=["onUpdate:modelValue","checked","onChange"],Wce=["data-filter-type","onClick"],Gce={class:"select-display"},Hce={key:0,class:"dropdown-menu type-menu simple-select-menu"},Xce={class:"simple-select-scroll-area"},Yce=["onMouseenter","onClick"],Jce={class:"option-content"},Kce={class:"option-title"},Zce={key:0,class:"option-checkmark"},Qce={key:4,class:"filter-separator"},$ce=Object.assign({name:"FloatingFiltersBar"},{__name:"filters",props:{token:{type:String,required:!0},view:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!1},filters_edition_mode:{type:Array,default:()=>null}},emits:["filters-changed","close"],setup(r,{expose:a,emit:g}){const B=r,J=g,C=p.ref([]);let x=null,e=null,v=null;const u=p.ref(!1),t=p.ref(!1),w=p.ref(!1),y=p.ref(!1),b=p.ref(!1),h=p.ref(!1),n=p.computed(()=>C.value),i=p.ref(null),d=p.computed(()=>n.value[i.value]||null),s=p.computed(()=>{var ve;const me=((ve=d.value)==null?void 0:ve.views)||[];return O(me)}),c=p.ref(null),f=p.computed(()=>s.value.find(ve=>ve.id===c.value)||null),m=p.ref([]),T=p.computed(()=>{var ve,me;return u.value?((ve=f.value)==null?void 0:ve.filters_edition_mode)||[]:((me=f.value)==null?void 0:me.filters)||[]});p.watch(u,ve=>{ve||(t.value=!1)}),p.watch(f,ve=>{var me,De;if(!ve){m.value=[];return}const Ie=ve.id===6&&B.isPostMatch;if(!Array.isArray(T.value)&&!Ie){m.value=[];return}if(y.value)return;Ie?m.value=[]:(m.value=T.value.map((We,Ye)=>{var ke,ze,Fe,He,rt,nt,ht,vt,mt,Ot,Vt,qt,st,$e,lt,pt,At,_t;if(We.type==="select"){if(u.value&&v&&v.dynamicFilters){const tt=v.dynamicFilters[Ye];if(tt){if(tt.selectedOptions&&Array.isArray(tt.selectedOptions)){const ot=tt.selectedOptions.map(Xe=>Xe.value);return console.log(`Using saved select values for filter ${Ye}:`,ot),ot}else if(tt.selectedValue&&Array.isArray(tt.selectedValue))if(tt.selectedValue.length>0&&tt.selectedValue[0]&&typeof tt.selectedValue[0]=="object"){const ot=Ge(tt.selectedValue);return console.log(`Using saved Timeline values for filter ${Ye}:`,ot),ot}else return console.log(`Using saved selectedValue for filter ${Ye}:`,tt.selectedValue),tt.selectedValue}}if(ve.id===4&&We.options&&Array.isArray(We.options)){const tt=We.options.map(ot=>ot.value);return console.log(`Timeline detected - preselecting all options for filter ${Ye}:`,tt),console.log("Timeline - filter options:",We.options),console.log("Timeline - filter type:",We.type),tt}return[]}else if(We.type==="radio-button"){if(console.log("radioooooooooooooooooooooooooooooooooooooooooo"),u.value&&v&&v.dynamicFilters){const tt=v.dynamicFilters[Ye];if(tt&&tt.selectedOption)return console.log(`Using saved radio-button value for filter ${Ye}:`,tt.selectedOption.value),tt.selectedOption.value}if(ve.id===7&&u.value&&e!=null&&e.view){if(console.log(`GSCGoalData - checking for stored values in initialization for filter ${Ye}:`,e.view),console.log("GSCGoalData - filter index:",Ye,"filter type:",We.type,"filter label:",We.label),Ye===0&&(ke=e.view.componentProps)!=null&&ke.analysisType){const tt=e.view.componentProps.analysisType,ot=tt==="offensive"?1:2;return console.log(`GSCGoalData - setting radio-button filter ${Ye} to analysis value:`,ot,"analysisType:",tt),console.log("GSCGoalData - filter options:",We.options),ot}if(Ye===1&&((ze=e.view.filterMultiple)==null?void 0:ze.isHomeTeam)!==void 0){const tt=e.view.filterMultiple.isHomeTeam,ot=tt?1:2;return console.log(`GSCGoalData - setting radio-button filter ${Ye} to team value:`,ot,"isHomeTeam:",tt),console.log("GSCGoalData - filter options:",We.options),ot}console.log(`GSCGoalData - filter index ${Ye} - no stored value found or not applicable`)}else console.log(`GSCGoalData - conditions not met: newVal.id=${ve.id}, isEditMode=${u.value}, hasView=${!!(e!=null&&e.view)}`);return((He=(Fe=We.options)==null?void 0:Fe[0])==null?void 0:He.value)??null}else if(We.type==="select-simple"){if(console.log("select-simpleeeeeeeeeeeeeeeeeeeeeeeeee"),u.value&&v&&v.dynamicFilters){const tt=v.dynamicFilters[Ye];if(tt&&tt.selectedValue!==void 0){console.log(`Using saved select-simple value for filter ${Ye}:`,tt.selectedValue),console.log("Saved selectedValue type:",typeof tt.selectedValue),console.log("Saved selectedValue is array:",Array.isArray(tt.selectedValue));let ot;return ve.id===2&&(nt=(rt=e==null?void 0:e.view)==null?void 0:rt.filterMultiple)!=null&&nt.categoryId?(ot=e.view.filterMultiple.categoryId,console.log("GSCtops - using filterMultiple.categoryId in initialization:",ot)):ve.id===1&&(vt=(ht=e==null?void 0:e.view)==null?void 0:ht.filterMultiple)!=null&&vt.category?(ot=e.view.filterMultiple.category,console.log("GSCComparativeReports - using filterMultiple.category in initialization:",ot)):ve.id===6&&(Ot=(mt=e==null?void 0:e.view)==null?void 0:mt.filterMultiple)!=null&&Ot.gameNumber?(ot=e.view.filterMultiple.gameNumber,console.log("GSCLineupsReports - using filterMultiple.gameNumber in initialization:",ot)):ot=Array.isArray(tt.selectedValue)?tt.selectedValue[0]:tt.selectedValue,console.log(`Returning select-simple value for filter ${Ye}:`,ot),ot}}if(ve.id===2&&u.value&&e!=null&&e.view){if(x&&e.view.id){const tt=x.getComponentDynamicFilters(e.view.id);if(tt&&tt[Ye]!==void 0)return console.log(`GSCtops - using component specific filter for index ${Ye}:`,tt[Ye]),tt[Ye]}if(e.view.filterMultiple){if(console.log("111 ************************************************************",e.view.filterMultiple),We.type==="select-simple"&&e.view.filterMultiple.categoryId){const tt=e.view.filterMultiple.categoryId,ot=(We.options||[]).find(Xe=>Xe.value==tt);return console.log("GSCtops - matching option in initialization:",ot),tt}if(We.type==="radio-button"&&e.view.filterMultiple.teamType!==void 0){const tt=e.view.filterMultiple.teamType;return(We.options||[]).find(ot=>ot.value==tt)?(console.log("GSCtops - returning teamType:",tt),tt):(console.log("GSCtops - no matching option found for teamType:",tt),console.log("GSCtops - returning teamType anyway for consistency:",tt),tt)}else console.log("GSCtops - radio-button condition not met:",{isRadioButton:We.type==="radio-button",hasTeamType:e.view.filterMultiple.teamType!==void 0,teamType:e.view.filterMultiple.teamType})}}if(ve.id===1&&u.value&&(Vt=e==null?void 0:e.view)!=null&&Vt.filterMultiple&&(console.log(`GSCComparativeReports - checking filterMultiple in initialization for filter ${Ye}:`,e.view.filterMultiple),e.view.filterMultiple.category)){const tt=e.view.filterMultiple.category,ot=(We.options||[]).find(Xe=>Xe.value==tt);return console.log("GSCComparativeReports - matching option in initialization:",ot),tt}if(ve.id===9&&u.value&&(qt=e==null?void 0:e.view)!=null&&qt.filterMultiple&&(console.log(`GSCFieldDataByZones - checking filterMultiple in initialization for filter ${Ye}:`,e.view.filterMultiple),We.type==="select-simple"&&e.view.filterMultiple.categoryIds)){const tt=Array.isArray(e.view.filterMultiple.categoryIds)?e.view.filterMultiple.categoryIds:[e.view.filterMultiple.categoryIds];console.log(`GSCFieldDataByZones - setting select-simple filter ${Ye} to categoryIds:`,tt),console.log("GSCFieldDataByZones - categoryIds type in initialization:",typeof tt),console.log("GSCFieldDataByZones - filter options in initialization:",We.options);const ot=(We.options||[]).filter(Xe=>Array.isArray(Xe.value)?Ce(Xe.value,tt):tt.includes(Xe.value));if(ot.length>0){const Xe=ot[0];return console.log("GSCFieldDataByZones - found matching option in initialization:",Xe),Xe.value}else return console.log("GSCFieldDataByZones - no matching options found, using categoryIds directly:",tt),tt}if(ve.id===6&&u.value&&(st=e==null?void 0:e.view)!=null&&st.filterMultiple&&(console.log(`GSCLineupsReports - checking filterMultiple in initialization for filter ${Ye}:`,e.view.filterMultiple),e.view.filterMultiple.gameNumber)){const tt=e.view.filterMultiple.gameNumber;console.log(`GSCLineupsReports - setting select-simple filter ${Ye} to gameNumber:`,tt),console.log("GSCLineupsReports - gameNumber type in initialization:",typeof tt),console.log("GSCLineupsReports - filter options in initialization:",We.options);const ot=(We.options||[]).find(Xe=>Xe.value==tt);return console.log("GSCLineupsReports - matching option in initialization:",ot),tt}if(ve.id===5&&u.value&&($e=e==null?void 0:e.view)!=null&&$e.filterMultiple&&(console.log(`GSCVolumetricField - checking filterMultiple in initialization for filter ${Ye}:`,e.view.filterMultiple),console.log("GSCVolumetricField - filter details:",{type:We.type,label:We.label,options:We.options}),e.view.filterMultiple.isHomeTeam!==void 0)){const tt=e.view.filterMultiple.isHomeTeam;console.log(`GSCVolumetricField - setting radio-button filter ${Ye} to isHomeTeam:`,tt),console.log("GSCVolumetricField - isHomeTeam type in initialization:",typeof tt),console.log("GSCVolumetricField - filter options in initialization:",We.options);let ot;typeof tt=="boolean"?(ot=tt?1:2,console.log("GSCVolumetricField - isHomeTeam is boolean in initialization, converting:",tt,"-> teamValue:",ot)):typeof tt=="number"?(ot=tt===1?1:2,console.log("GSCVolumetricField - isHomeTeam is number in initialization, using directly:",tt,"-> teamValue:",ot)):(ot=1,console.log("GSCVolumetricField - isHomeTeam is unknown type in initialization, using default:",ot));const Xe=(We.options||[]).find(ct=>ct.value==ot);if(console.log("GSCVolumetricField - matching option in initialization:",Xe),We.type==="radio-button"&&(We.label==="Equipo"||We.label==="Team"||We.label==="Equipo seleccionado"))return console.log("GSCVolumetricField - applying team filter value:",ot),ot;console.log("GSCVolumetricField - filter is not a team filter, skipping:",We.label)}if(ve.id===9&&u.value&&(lt=e==null?void 0:e.view)!=null&<.filterMultiple&&(console.log(`GSCFieldDataByZones - checking filterMultiple in initialization for filter ${Ye}:`,e.view.filterMultiple),We.type==="radio-button"&&e.view.filterMultiple.isHomeTeam!==void 0)){const tt=e.view.filterMultiple.isHomeTeam,ot=tt?1:2;console.log(`GSCFieldDataByZones - setting radio-button filter ${Ye} to team value:`,ot,"isHomeTeam:",tt),console.log("GSCFieldDataByZones - filter options:",We.options);const Xe=((pt=We.options)==null?void 0:pt.map(ct=>ct.value))||[];return Xe.includes(ot)?(console.log("GSCFieldDataByZones - using valid team value from filterMultiple:",ot),ot):(console.log("GSCFieldDataByZones - team value not in valid options, using default:",Xe[0]),Xe[0]||1)}return((_t=(At=We.options)==null?void 0:At[0])==null?void 0:_t.value)??null}else if(We.type==="check"){if(u.value&&v&&v.dynamicFilters){const tt=v.dynamicFilters[Ye];if(tt&&tt.isChecked!==void 0)return console.log(`Using saved checkbox value for filter ${Ye}:`,tt.isChecked),tt.isChecked}if(ve.id===8)return!0;if(ve.id===3){if(u.value&&v&&v.dynamicFilters){const tt=v.dynamicFilters[Ye];if(tt&&tt.isChecked!==void 0)return console.log(`GSCMatchSummary - Using saved checkbox value for filter ${Ye}:`,tt.isChecked),tt.isChecked}return!1}return!1}return null}),console.log("dynamicFilters initialized to:",m.value));const Ve=((me=ve.name)==null?void 0:me.toLowerCase().includes("tops players"))||((De=ve.title)==null?void 0:De.toLowerCase().includes("tops players"));!Ve&&(!u.value||Ie)&&p.nextTick(()=>{var We,Ye,ke;console.log("Timeline - about to emit change:",{esTopsPlayers:Ve,isEditMode:u.value,selectedSecond:(We=f.value)==null?void 0:We.id}),ve.id===4&&u.value&&(Ye=e==null?void 0:e.view)!=null&&Ye.id&&(console.log("Timeline - saving specific filters for component:",e.view.id),x&&x.setDynamicFilters(m.value,e.view.id)),ve.id===3&&u.value&&(ke=e==null?void 0:e.view)!=null&&ke.id&&(console.log("GSCMatchSummary - saving specific filters for component:",e.view.id),x&&x.setDynamicFilters(m.value,e.view.id)),he()})},{immediate:!0}),p.watch(()=>x,ve=>{ve&&ve.dynamicFilters&&(console.log("FilterAndViewsContainer changed, updating dynamicFilters:",ve.dynamicFilters),Array.isArray(ve.dynamicFilters)&&(y.value=!0,m.value=[...ve.dynamicFilters],p.nextTick(()=>{y.value=!1})))},{deep:!0}),p.watch(()=>x==null?void 0:x.dynamicFilters,ve=>{if(ve&&Array.isArray(ve)){if(console.log("Container dynamicFilters changed, updating:",ve),b.value){console.log("Skipping container update due to user update in progress");return}y.value=!0,m.value=[...ve],p.nextTick(()=>{y.value=!1})}},{deep:!0}),p.watch(()=>f.value,ve=>{if(u.value&&v&&ve&&ve.filters){if(y.value)return;if(h.value){console.log("Skipping force updates in selectedSecond watcher - already in force update");return}if(ve.id===3){if(console.log("GSCMatchSummary detected in edit mode, loading saved filters"),b.value||h.value){console.log("GSCMatchSummary - Skipping due to update in progress");return}const me=v.dynamicFilters.find(De=>De.filterType==="check");me&&me.isChecked!==void 0&&(console.log("GSCMatchSummary - Found saved checkbox value:",me.isChecked),m.value&&m.value.length>0&&(b.value=!0,m.value[0]=me.isChecked,console.log("GSCMatchSummary - Updated dynamicFilters:",m.value),p.nextTick(()=>{m.value=[...m.value],console.log("GSCMatchSummary - Forced UI update"),b.value=!1})))}setTimeout(()=>{(!m.value||m.value.length===0)&&(Ne(),Pe(),je()),ve.id===4&&Re()},100)}},{deep:!0}),p.watch(()=>{var ve;return(ve=f.value)==null?void 0:ve.id},ve=>{if(u.value&&v&&ve===4){if(console.log("Timeline detected, preselecting filters"),y.value)return;if(h.value){console.log("Skipping force updates in Timeline watcher - already in force update");return}setTimeout(()=>{Re()},200)}}),p.watch(()=>m.value,ve=>{if(u.value&&v&&ve&&ve.length>0){if(console.log("(((((((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))",v),console.log("Dynamic filters initialized, forcing update"),y.value||b.value)return;if(h.value){console.log("Skipping force updates - already in force update");return}setTimeout(()=>{var me;ge()&&(Ne(),Pe(),je(),((me=f.value)==null?void 0:me.id)===4&&Re())},50)}},{deep:!0});function E(ve,me){var De,Ie,Ve,We,Ye;const ke=m.value[ve];if(((De=f.value)==null?void 0:De.id)===4&&ve===0&&console.log("Timeline filter check - optionValue:",me,"selectedValues:",ke),((Ie=f.value)==null?void 0:Ie.id)===6&&ve===0&&console.log("GSCLineupsReports filter check - optionValue:",me,"selectedValues:",ke,"type:",typeof ke),Array.isArray(ke)){if(((Ve=f.value)==null?void 0:Ve.id)===4&&ve===0){const ze=ke.some(Fe=>{if(me.category_id&&me.event_type_id){if(Fe.category_id&&Fe.event_type_id)return Fe.category_id===me.category_id&&Fe.event_type_id===me.event_type_id;if(Fe.event_type_id&&!Fe.category_id)return Fe.event_type_id===me.event_type_id;if(Fe.category_id&&!Fe.event_type_id)return Fe.category_id===me.category_id}else{if(me.event_type_id)return Fe.event_type_id===me.event_type_id;if(me.category_id)return Fe.category_id===me.category_id}return JSON.stringify(Fe)===JSON.stringify(me)});return((We=f.value)==null?void 0:We.id)===4&&ve===0&&console.log("Timeline comparison (IDs) - optionValue:",me,"selectedValues:",ke,"isSelected:",ze),ze}return ke.includes(me)}else if(ke!=null){if(((Ye=f.value)==null?void 0:Ye.id)===6&&ve===0){const ze=ke===me;return console.log("GSCLineupsReports comparison - optionValue:",me,"selectedValues:",ke,"isSelected:",ze),ze}return ke===me}return!1}function S(ve,me){var De,Ie,Ve;const We=(Ie=(De=f.value)==null?void 0:De.filters)==null?void 0:Ie[ve];if((We==null?void 0:We.type)==="select-simple"){console.log("toggleMultiSelectOption called for select-simple filter, using selectSimpleOption instead"),ae(ve,me);return}Array.isArray(m.value[ve])||(m.value[ve]=[]);const Ye=m.value[ve];let ke=-1;((Ve=f.value)==null?void 0:Ve.id)===4&&ve===0?ke=Ye.findIndex(ze=>me.category_id&&me.event_type_id?ze.category_id===me.category_id&&ze.event_type_id===me.event_type_id:me.event_type_id?ze.event_type_id===me.event_type_id:me.category_id?ze.category_id===me.category_id:!1):ke=Ye.indexOf(me),ke>-1?Ye.splice(ke,1):Ye.push(me),u.value&&Oe(),he()}function P(ve){var me,De;const Ie=m.value[ve],Ve=(De=(me=f.value)==null?void 0:me.filters)==null?void 0:De[ve];return(Ve==null?void 0:Ve.type)==="select-simple"||!Ve||!Ve.options||!Array.isArray(Ie)?!1:Ie.length===Ve.options.length}function N(ve){var me,De;const Ie=m.value[ve],Ve=(De=(me=f.value)==null?void 0:me.filters)==null?void 0:De[ve];return(Ve==null?void 0:Ve.type)==="select-simple"||!Ve||!Ve.options||!Array.isArray(Ie)?!1:Ie.length>0&&Ie.length<Ve.options.length}function A(){var ve;return console.log("props.isPostMatch",B.isPostMatch),!(((ve=f.value)==null?void 0:ve.id)===6&&B.isPostMatch)}function O(ve){return!ve||!Array.isArray(ve)?ve:ve.filter(me=>{const De=(me.name||me.title||"").toLowerCase();return B.isPostMatch?B.isPostMatch?!["fortalezas","tabla general"].some(Ie=>De.includes(Ie)):!0:!["resumen general","timeline","datos relevantes"].some(Ie=>De.includes(Ie))})}function M(){var ve,me;const De=((me=(ve=d.value)==null?void 0:ve.name)==null?void 0:me.toLowerCase())||"";return De.includes("cancha")||De.includes("volumétrica")||De.includes("volumetric")}function k(ve,me){if(!u.value||!M())return!1;const De=String(ve||"").toLowerCase(),Ie=String(me||"").toLowerCase();return De.includes("ambos")||Ie.includes("ambos")}function I(ve){var me,De;const Ie=(De=(me=f.value)==null?void 0:me.filters)==null?void 0:De[ve];if(!Ie||!Ie.options)return;const Ve=Ie.options.map(We=>We.value);Array.isArray(m.value[ve])||(m.value[ve]=[]),P(ve)?m.value[ve]=[]:m.value[ve]=[...Ve],V.value=ve,he()}const _=p.ref("ambos"),R=p.ref(!1),z=p.ref(!1),V=p.ref(null),U=p.ref(null);function q(ve,me=!1){const De="https://golstatsimages.blob.core.windows.net/images-library/",Ie="https://golstatsimages.blob.core.windows.net/reports-images/",Ve={cancha:"icn_cancha",grafico:"icn_grafico",gráfico:"icn_grafico",chart:"icn_grafico",volumetrica:"icn_cancha",volumétrica:"icn_cancha",volumetric:"icn_cancha",tabla:"icn_tabla",tablas:"icn_tabla",Tablas:"icn_tabla"},We=Object.keys(Ve).find(Ye=>ve==null?void 0:ve.toLowerCase().includes(Ye.toLowerCase()));if(We){const Ye=Ve[We],ke=me?"":"-def";return We.toLowerCase().includes("tabla")?`${Ie}${Ye}${ke}@2x.png`:`${De}${Ye}${ke}@2x.png`}return`${De}icn_default${me?"":"-def"}.png`}function W(){return d.value?d.value.name:"Tipo de vista"}function Z(){return f.value?f.value.name||f.value.title:"Visualización"}function ne(){u.value||(R.value=!R.value,R.value&&(z.value=!1,p.nextTick(()=>{Se()})))}function X(){u.value||d.value&&(z.value=!z.value,z.value&&(R.value=!1))}function re(ve){u.value||(i.value=ve,R.value=!1,c.value=null,he())}function ee(ve){var me,De;u.value||(c.value=ve.id,z.value=!1,(me=ve.name)!=null&&me.toLowerCase().includes("tops players")||(De=ve.title)==null||De.toLowerCase().includes("tops players"))}function K(ve){var me;V.value=V.value===ve?null:ve,((me=f.value)==null?void 0:me.id)===4&&u.value&&ve===0&&(console.log("Timeline dropdown opened, forcing checkbox update"),setTimeout(()=>{m.value=[...m.value]},50))}function te(ve){U.value=U.value===ve?null:ve}function ae(ve,me){var De,Ie,Ve,We,Ye,ke;if(console.log("selectSimpleOption called:",{idx:ve,optionValue:me,isEditMode:u.value}),((De=f.value)==null?void 0:De.id)===2){console.log("GSCtops - selectSimpleOption for GSCtops");const ze=T.value.findIndex(Fe=>Fe.type==="select-simple"&&Fe.label==="Tipo de análisis");ve===ze?(m.value[0]=me,console.log("GSCtops - updated dynamicFilters[0] (category) to:",me)):(m.value[ve]=me,console.log("GSCtops - updated dynamicFilters["+ve+"] to:",me))}else if(((Ie=f.value)==null?void 0:Ie.id)===1)console.log("GSCComparativeReports - selectSimpleOption for GSCComparativeReports"),m.value[0]=me,console.log("GSCComparativeReports - updated dynamicFilters[0] (analysis type) to:",me);else if(((Ve=f.value)==null?void 0:Ve.id)===6)console.log("GSCLineupsReports - selectSimpleOption for GSCLineupsReports"),m.value[0]=me,console.log("GSCLineupsReports - updated dynamicFilters[0] (game number) to:",me);else if(((We=f.value)==null?void 0:We.id)===9)if(console.log("GSCFieldDataByZones - selectSimpleOption for GSCFieldDataByZones"),ve===0){Array.isArray(me)?(m.value[ve]=me,console.log("GSCFieldDataByZones - updated dynamicFilters[0] (categories) to:",me)):(m.value[ve]=[me],console.log("GSCFieldDataByZones - converted to array and updated dynamicFilters[0] (categories) to:",[me]));const ze=((Ye=T.value[ve])==null?void 0:Ye.options)||[];console.log("GSCFieldDataByZones - filterOptions for comparison:",ze);const Fe=Array.isArray(me)?me:[me],He=ze.find(rt=>Array.isArray(rt.value)?Ce(rt.value,Fe):Fe.includes(rt.value));console.log("GSCFieldDataByZones - matching option found:",He),He?(console.log("GSCFieldDataByZones - using matching option value:",He.value),m.value[ve]=He.value,console.log("GSCFieldDataByZones - updated dynamicFilters["+ve+"] to matching option value:",He.value)):(console.log("GSCFieldDataByZones - no matching option found, using selectedValue directly"),m.value[ve]=Fe)}else m.value[ve]=me,console.log("GSCFieldDataByZones - updated dynamicFilters["+ve+"] to:",me);else m.value[ve]=me;U.value=null,console.log("dynamicFilters after selectSimpleOption:",m.value),((ke=f.value)==null?void 0:ke.id)===6&&(console.log("GSCLineupsReports - selectSimpleOption called"),console.log("GSCLineupsReports - isEditMode:",u.value),console.log("GSCLineupsReports - viewToEdit:",e),console.log("GSCLineupsReports - dynamicFilters:",m.value)),u.value&&(console.log("calling updateContainerOnUserChange"),console.log("isEditMode.value:",u.value),console.log("viewToEdit:",e),console.log("filterAndViewsContainer:",x),Oe()),console.log("calling emitChange"),he()}function oe(ve){ve.target.closest(".custom-select")||(R.value=!1,z.value=!1,U.value=null)}function he(){var ve,me,De,Ie,Ve,We,Ye,ke,ze,Fe,He,rt,nt,ht,vt,mt,Ot,Vt,qt,st,$e,lt,pt,At,_t,tt,ot,Xe,ct,kt;if(console.log("emitChange called"),console.log("isEditMode.value:",u.value),console.log("viewToEdit:",e),console.log("dynamicFilters.value:",m.value),y.value){console.log("Skipping emitChange due to container update in progress");return}((ve=f.value)==null?void 0:ve.id)===8&&(console.log("FieldPosesion detected - dynamicFilters:",m.value),console.log("Current filters:",T.value)),((me=f.value)==null?void 0:me.id)===4&&(console.log("Timeline detected - dynamicFilters:",m.value),console.log("Current filters:",T.value),console.log("Timeline - will emit change:",!y.value)),((De=f.value)==null?void 0:De.id)===2&&(console.log("GSCtops detected - dynamicFilters:",m.value),console.log("Current filters:",T.value),console.log("GSCtops - will emit change:",!y.value)),((Ie=f.value)==null?void 0:Ie.id)===6&&(console.log("GSCLineupsReports detected - dynamicFilters:",m.value),console.log("Current filters:",T.value),console.log("GSCLineupsReports - will emit change:",!y.value),console.log("GSCLineupsReports - isEditMode:",u.value),console.log("GSCLineupsReports - viewToEdit:",e)),((Ve=f.value)==null?void 0:Ve.id)===9&&(console.log("GSCFieldDataByZones detected - dynamicFilters:",m.value),console.log("Current filters:",T.value),console.log("GSCFieldDataByZones - will emit change:",!y.value),console.log("GSCFieldDataByZones - isEditMode:",u.value),console.log("GSCFieldDataByZones - viewToEdit:",e));let yt=[],It=[];f.value&&Array.isArray(T.value)&&T.value.forEach((bt,Lt)=>{if(bt.type==="select"&&bt.label==="Tipo de análisis"&&bt.id===2){const Rt=m.value[Lt]||[];Array.isArray(Rt)&&Rt.length>0&&(yt=Rt.map(St=>{var Ht;const Ut=(Ht=bt.options)==null?void 0:Ht.find(Yt=>Yt.value===St);return{value:St,label:(Ut==null?void 0:Ut.label)||St}}))}});const Nt=((We=f.value)==null?void 0:We.id)===4;if(f.value&&Array.isArray(f.value.filters)&&f.value.filters.some(bt=>bt.type==="select"&&bt.label==="Tipo de análisis"&&bt.id===2)&&yt.length===0&&!Nt)return;if(Nt&&m.value&&m.value.length>0){const bt=m.value[0];Array.isArray(bt)&&bt.length>0&&console.log("Timeline - emitting change with events:",bt)}It=((Ye=T.value)==null?void 0:Ye.map((bt,Lt)=>{var Rt,St,Ht,Ut,Yt;const Wt=m.value[Lt];((Rt=f.value)==null?void 0:Rt.id)===8&&console.log(`FieldPosesion filter ${Lt}:`,{type:bt.type,label:bt.label,selectedValue:Wt,selectedValueType:typeof Wt,isRadioButton:bt.type==="radio-button"});let Gt=bt.id||`filter_${Lt}`;return((St=f.value)==null?void 0:St.id)===3&&u.value&&(Ht=e==null?void 0:e.view)!=null&&Ht.id&&(Gt=`filter_${Lt}_component_${e.view.id}`,console.log(`GSCMatchSummary - Generated unique filterId: ${Gt} for component ${e.view.id}`)),{filterId:Gt,filterType:bt.type,filterLabel:bt.label,filterIcon:bt.icon||null,selectedValue:Wt,selectedOptions:bt.type==="select"&&Array.isArray(Wt)&&Wt.length>0?Wt.map(rr=>{var ir;const mr=(ir=bt.options)==null?void 0:ir.find(kr=>kr.value===rr);return{value:rr,label:(mr==null?void 0:mr.label)||rr,icon:(mr==null?void 0:mr.icon)||null}}):null,selectedOption:bt.type==="radio-button"&&Wt!=null?{value:Wt,label:((Yt=(Ut=bt.options)==null?void 0:Ut.find(rr=>rr.value===Wt))==null?void 0:Yt.label)||Wt}:null,isChecked:bt.type==="check"?Wt:null}}))||[];const Ze={mainSelector:{id:((ke=d.value)==null?void 0:ke.id)||null,name:((ze=d.value)==null?void 0:ze.name)||null,url:((Fe=d.value)==null?void 0:Fe.url)||null},viewSelector:{id:((He=f.value)==null?void 0:He.id)||null,name:((rt=f.value)==null?void 0:rt.name)||((nt=f.value)==null?void 0:nt.title)||null,url:((ht=f.value)==null?void 0:ht.url)||null},team:_.value,dynamicFilters:It,categoriasSeleccionadas:yt,timestamp:new Date().toISOString(),summary:{mainSelected:!!d.value,viewSelected:!!f.value,totalDynamicFilters:((vt=T.value)==null?void 0:vt.length)||0,activeFilters:((mt=T.value)==null?void 0:mt.filter((bt,Lt)=>{const Rt=m.value[Lt];return Array.isArray(Rt)?Rt.length>0:Rt!=null&&Rt!==!1}).length)||0}};e&&(console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"),console.log("viewToEdit.view.filterAndViewsContainer",e.view.filterAndViewsContainer),console.log("viewToEdit.view.filterAndViewsContainer.childViews.length",e.view.filterAndViewsContainer.childViews.length));const et={main:d.value,view:f.value,team:_.value,dynamicFilters:m.value,filtersJSON:Ze,filterAndViewsContainer:x,viewToEdit:e};if(console.log("GSCtops - emitting filters-changed with data:",et),J("filters-changed",et),u.value&&e){if(v=Ze,console.log("Updated editFiltersJSON:",v),((Ot=f.value)==null?void 0:Ot.id)===8&&(console.log("FieldPosesion - editFiltersJSON updated:",v),console.log("FieldPosesion - dynamicFilters in JSON:",v.dynamicFilters)),((Vt=f.value)==null?void 0:Vt.id)===2){console.log("GSCtops - editFiltersJSON updated:",v),console.log("GSCtops - dynamicFilters in JSON:",v.dynamicFilters),console.log("GSCtops - viewToEdit.filterMultiple:",(qt=e.view)==null?void 0:qt.filterMultiple);const bt=v.dynamicFilters.findIndex(Lt=>Lt.filterType==="select-simple"&&Lt.filterLabel==="Tipo de análisis");bt!==-1&&($e=(st=e.view)==null?void 0:st.filterMultiple)!=null&&$e.categoryId&&(v.dynamicFilters[bt].selectedValue=e.view.filterMultiple.categoryId,console.log("GSCtops - updated editFiltersJSON with filterMultiple.categoryId:",e.view.filterMultiple.categoryId))}if(((lt=f.value)==null?void 0:lt.id)===1){console.log("GSCComparativeReports - editFiltersJSON updated:",v),console.log("GSCComparativeReports - dynamicFilters in JSON:",v.dynamicFilters),console.log("GSCComparativeReports - viewToEdit.filterMultiple:",(pt=e.view)==null?void 0:pt.filterMultiple);const bt=v.dynamicFilters.findIndex(Lt=>Lt.filterType==="select-simple"&&Lt.filterLabel==="Tipo de análisis");bt!==-1&&(_t=(At=e.view)==null?void 0:At.filterMultiple)!=null&&_t.category&&(v.dynamicFilters[bt].selectedValue=e.view.filterMultiple.category,console.log("GSCComparativeReports - updated editFiltersJSON with filterMultiple.category:",e.view.filterMultiple.category))}}if(((tt=f.value)==null?void 0:tt.id)===6&&u.value&&(ot=e==null?void 0:e.view)!=null&&ot.filterMultiple&&(console.log("GSCLineupsReports - viewToEdit.filterMultiple:",(Xe=e.view)==null?void 0:Xe.filterMultiple),e.view.filterMultiple.gameNumber&&v)){const bt=v.dynamicFilters.findIndex(Lt=>Lt.filterType==="select-simple"&&Lt.filterLabel==="Número de juego");bt!==-1&&(kt=(ct=e.view)==null?void 0:ct.filterMultiple)!=null&&kt.gameNumber&&(v.dynamicFilters[bt].selectedValue=e.view.filterMultiple.gameNumber,console.log("GSCLineupsReports - updated editFiltersJSON with filterMultiple.gameNumber:",e.view.filterMultiple.gameNumber))}x&&!u.value?(x.setDynamicFilters(m.value),console.log("Updated container with new dynamicFilters:",m.value)):x&&u.value&&console.log("In edit mode, not updating container automatically")}function fe(){e=null,v=null,x=null,i.value=null,c.value=null,_.value="ambos",m.value=[],R.value=!1,z.value=!1,V.value=null,U.value=null,u.value=!1,t.value=!1,w.value=!1}function se(ve){if(ve&&ve.dynamicFilters){if(console.log("Updating filters from container:",ve.dynamicFilters),b.value){console.log("Skipping container update due to user update in progress");return}Array.isArray(ve.dynamicFilters)&&ve.dynamicFilters.length>0&&(y.value=!0,m.value=[...ve.dynamicFilters],p.nextTick(()=>{y.value=!1}))}}function ue(ve){if(console.log("preselectFiltersFromJSON called with:",ve),u.value=!0,ve.mainSelector&&ve.mainSelector.id){const me=C.value.findIndex(De=>De.id===ve.mainSelector.id);me!==-1&&(i.value=me,console.log("Selected main index:",me))}ve.viewSelector&&ve.viewSelector.id&&d.value&&d.value.views.findIndex(me=>me.id===ve.viewSelector.id)!==-1&&(c.value=ve.viewSelector.id,console.log("Selected second id:",ve.viewSelector.id)),ve.dynamicFilters&&Array.isArray(ve.dynamicFilters)&&(console.log("Processing dynamic filters:",ve.dynamicFilters),p.nextTick(()=>{setTimeout(()=>{var me,De,Ie,Ve,We,Ye,ke,ze,Fe,He,rt,nt,ht,vt,mt,Ot,Vt,qt,st,$e,lt,pt,At,_t,tt,ot,Xe,ct,kt,yt,It;if(console.log("Processing filters after delay"),console.log("selectedSecond.value:",f.value),f.value&&T.value){if(console.log("Filters available:",T.value),y.value){console.log("Skipping preselect due to container update in progress");return}if(b.value=!0,console.log("&666&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&",ve.dynamicFilters),ve.dynamicFilters.forEach((Nt,Ze)=>{var et,bt,Lt,Rt,St,Ht,Ut,Yt,Wt,Gt,rr,ir,mr,kr;if(Ze<T.value.length){const wr=T.value[Ze];if(((et=f.value)==null?void 0:et.id)===3&&u.value&&console.log(`GSCMatchSummary - Processing filter ${Ze} for component ${((bt=e==null?void 0:e.view)==null?void 0:bt.id)||"unknown"}`),wr.type==="check"){const ar=Nt.isChecked;console.log(`Setting check filter ${Ze} to:`,ar),typeof ar=="boolean"?(m.value[Ze]=ar,console.log(`Successfully set check filter ${Ze} to:`,ar)):console.log(`Invalid isChecked value for filter ${Ze}:`,ar)}else if(wr.type==="select"&&Nt.selectedOptions){const ar=Nt.selectedOptions.map(xr=>xr.value);console.log(`Setting select filter ${Ze} to:`,ar),m.value[Ze]=ar,console.log(`Successfully set select filter ${Ze} to:`,ar)}else if(wr.type==="select"&&Nt.selectedValue&&Array.isArray(Nt.selectedValue))if(Nt.selectedValue.length>0&&Nt.selectedValue[0]&&typeof Nt.selectedValue[0]=="object"){const ar=Ge(Nt.selectedValue);console.log(`Setting Timeline select filter ${Ze} to:`,ar),m.value[Ze]=ar,console.log(`Successfully set Timeline select filter ${Ze} to:`,ar)}else console.log(`Setting select filter ${Ze} to:`,Nt.selectedValue),m.value[Ze]=Nt.selectedValue,console.log(`Successfully set select filter ${Ze} to:`,Nt.selectedValue);else if(wr.type==="radio-button"&&Nt.selectedOption)console.log(`Setting radio filter ${Ze} to:`,Nt.selectedOption.value),m.value[Ze]=Nt.selectedOption.value;else if(wr.type==="select-simple"&&Nt.selectedValue!==void 0){console.log(`Setting select-simple filter ${Ze} to:`,Nt.selectedValue),console.log("select-simple filterData.selectedValue type:",typeof Nt.selectedValue),console.log("select-simple filterData.selectedValue is array:",Array.isArray(Nt.selectedValue));let ar;((Lt=f.value)==null?void 0:Lt.id)===2&&(St=(Rt=e==null?void 0:e.view)==null?void 0:Rt.filterMultiple)!=null&&St.categoryId?(ar=e.view.filterMultiple.categoryId,console.log("GSCtops - using filterMultiple.categoryId instead of selectedValue:",ar)):((Ht=f.value)==null?void 0:Ht.id)===1&&(Yt=(Ut=e==null?void 0:e.view)==null?void 0:Ut.filterMultiple)!=null&&Yt.category?(ar=e.view.filterMultiple.category,console.log("GSCComparativeReports - using filterMultiple.category instead of selectedValue:",ar)):((Wt=f.value)==null?void 0:Wt.id)===6&&(rr=(Gt=e==null?void 0:e.view)==null?void 0:Gt.filterMultiple)!=null&&rr.gameNumber?(ar=e.view.filterMultiple.gameNumber,console.log("GSCLineupsReports - using filterMultiple.gameNumber instead of selectedValue:",ar)):((ir=f.value)==null?void 0:ir.id)===9&&(kr=(mr=e==null?void 0:e.view)==null?void 0:mr.filterMultiple)!=null&&kr.categoryIds?(ar=e.view.filterMultiple.categoryIds,console.log("GSCFieldDataByZones - using filterMultiple.categoryIds instead of selectedValue:",ar)):ar=Array.isArray(Nt.selectedValue)?Nt.selectedValue[0]:Nt.selectedValue,m.value[Ze]=ar,console.log(`Successfully set select-simple filter ${Ze} to:`,ar)}}else console.log(`Filter index ${Ze} out of range`)}),console.log("Final dynamicFilters.value:",m.value),((me=f.value)==null?void 0:me.id)===3&&u.value&&console.log("GSCMatchSummary - Final dynamicFilters after processing:",m.value),((De=f.value)==null?void 0:De.id)===2&&u.value&&(Ie=e==null?void 0:e.view)!=null&&Ie.filterMultiple){if(console.log("GSCtops - checking filterMultiple after preselecting filters:",e.view.filterMultiple),console.log("GSCtops - currentFilters:",T.value),console.log("GSCtops - dynamicFilters before:",m.value),e.view.filterMultiple.categoryId){console.log("GSCtops - found categoryId in filterMultiple:",e.view.filterMultiple.categoryId);const Nt=T.value.findIndex(Ze=>Ze.type==="select-simple"&&Ze.label==="Tipo de análisis");if(console.log("GSCtops - categoryFilterIndex:",Nt),console.log("GSCtops - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("GSCtops - found category filter at index:",Nt);const Ze=e.view.filterMultiple.categoryId;if(console.log("GSCtops - setting category filter directly from filterMultiple.categoryId:",Ze),m.value[0]=Ze,e.view.componentProps&&Ze){let bt=`Category ${Ze}`,Lt=null;try{Lt=Vd(Ze),Lt&&(bt=Lt.name,console.log("GSCtops - found category info from getCategoryById in preselectFiltersFromJSON:",Lt))}catch{console.log("GSCtops - getCategoryById failed in preselectFiltersFromJSON, using filter options");const Rt=T.value.findIndex(St=>St.type==="select-simple"&&St.label==="Tipo de análisis");if(Rt!==-1){const St=(((Ve=T.value[Rt])==null?void 0:Ve.options)||[]).find(Ht=>Ht.value==Ze);St&&(bt=St.label,console.log("GSCtops - found category name from options in preselectFiltersFromJSON:",bt))}}e.view.componentProps.categoryView=[{id:Ze,name:bt}],console.log("GSCtops - updated componentProps.categoryView in preselectFiltersFromJSON:",e.view.componentProps.categoryView)}console.log("GSCtops - automatically set category filter to:",Ze),console.log("GSCtops - categoryId type:",typeof Ze),console.log("GSCtops - updated dynamicFilters:",m.value),console.log("GSCtops - filter options:",(We=T.value[Nt])==null?void 0:We.options);const et=(((Ye=T.value[Nt])==null?void 0:Ye.options)||[]).find(bt=>bt.value==Ze);console.log("GSCtops - matching option:",et),p.nextTick(()=>{m.value=[...m.value],console.log("GSCtops - forced reactivity update")})}else console.log("GSCtops - category filter not found!")}if(e.view.filterMultiple.teamType!==void 0){console.log("GSCtops - found teamType in filterMultiple:",e.view.filterMultiple.teamType),console.log("MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM ------------------------------------> ",T.value);const Nt=T.value.findIndex(Ze=>Ze.type==="radio-button");if(console.log("GSCtops - teamFilterIndex:",Nt),console.log("GSCtops - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("GSCtops - found team filter at index:",Nt);const Ze=e.view.filterMultiple.teamType;console.log("GSCtops - setting team filter directly from filterMultiple.teamType:",Ze),m.value[Nt]=Ze,console.log("GSCtops - automatically set team filter to:",Ze),console.log("GSCtops - teamType type:",typeof Ze),console.log("GSCtops - updated dynamicFilters:",m.value),console.log("GSCtops - filter options:",(ke=T.value[Nt])==null?void 0:ke.options);const et=(((ze=T.value[Nt])==null?void 0:ze.options)||[]).find(bt=>bt.value==Ze);console.log("GSCtops - matching option for team:",et),p.nextTick(()=>{m.value=[...m.value],console.log("GSCtops - forced reactivity update for team filter")})}else console.log("GSCtops - team filter not found!")}}if(((Fe=f.value)==null?void 0:Fe.id)===9&&u.value&&(He=e==null?void 0:e.view)!=null&&He.filterMultiple){if(console.log("55555 GSCFieldDataByZones - checking filterMultiple after preselecting filters:",e.view.filterMultiple),console.log("55555 GSCFieldDataByZones - currentFilters:",T.value),console.log(" 55555GSCFieldDataByZones - dynamicFilters before:",m.value),e.view.filterMultiple.categoryIds){console.log("55555 GSCFieldDataByZones - found categoryIds in filterMultiple:",e.view.filterMultiple.categoryIds);const Nt=T.value.findIndex(Ze=>Ze.type==="select-simple");if(console.log("55555 GSCFieldDataByZones - analysisTypeFilterIndex:",Nt),console.log("55555 GSCFieldDataByZones - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("55555 GSCFieldDataByZones - found analysis type filter at index:",Nt);const Ze=Array.isArray(e.view.filterMultiple.categoryIds)?e.view.filterMultiple.categoryIds:[e.view.filterMultiple.categoryIds];console.log("55555 GSCFieldDataByZones - setting category filter directly from filterMultiple.categoryIds:",Ze),m.value[0]=Ze,console.log("55555 GSCFieldDataByZones - automatically set category filter to:",Ze),console.log("55555 GSCFieldDataByZones - categoryIds type:",typeof Ze),console.log("55555 GSCFieldDataByZones - categoryIds is array:",Array.isArray(Ze)),console.log("55555 GSCFieldDataByZones - updated dynamicFilters:",m.value),console.log("55555 GSCFieldDataByZones - filter options:",(rt=T.value[Nt])==null?void 0:rt.options);const et=((nt=T.value[Nt])==null?void 0:nt.options)||[];console.log("55555 filterOptions :",et);const bt=et.filter(St=>Array.isArray(St.value)?Ce(St.value,Ze):Ze.includes(St.value));if(console.log("55555 GSCFieldDataByZones - matching options:",bt),bt.length>0){const St=bt[0];console.log("55555 GSCFieldDataByZones - found matching option:",St);const Ht=St.value;console.log("55555 GSCFieldDataByZones - using option value:",Ht),m.value[Nt]=Ht,console.log("55555 GSCFieldDataByZones - set dynamicFilters["+Nt+"] to option value:",Ht)}else console.log("55555 GSCFieldDataByZones - no matching options found, using categoryIds directly"),m.value[Nt]=Ze;const Lt=m.value[Nt],Rt=Ce(Lt,Ze);console.log("55555 GSCFieldDataByZones - arrays match:",Rt),console.log("55555 GSCFieldDataByZones - current filter value:",Lt,"categoryIds:",Ze),p.nextTick(()=>{m.value=[...m.value],console.log("55555 GSCFieldDataByZones - forced reactivity update")})}else console.log("55555 GSCFieldDataByZones - analysis type filter not found!")}if(e.view.filterMultiple.isHomeTeam!==void 0){console.log("444444444 GSCFieldDataByZones - found isHomeTeam in filterMultiple:",e.view.filterMultiple.isHomeTeam);const Nt=T.value.findIndex(Ze=>Ze.type==="radio-button");if(console.log("444444444 GSCFieldDataByZones - teamFilterIndex:",Nt),console.log("444444444 GSCFieldDataByZones - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("444444444 GSCFieldDataByZones - found team filter at index:",Nt);const Ze=e.view.filterMultiple.isHomeTeam;console.log("444444444 GSCFieldDataByZones - isHomeTeam type:",typeof Ze,"value:",Ze);let et;typeof Ze=="boolean"?(et=Ze?1:2,console.log("444444444 GSCFieldDataByZones - converted boolean isHomeTeam to teamValue:",Ze,"->",et)):typeof Ze=="number"?(et=Ze===1?1:2,console.log("444444444 GSCFieldDataByZones - converted numeric isHomeTeam to teamValue:",Ze,"->",et)):(et=1,console.log("444444444 GSCFieldDataByZones - using default teamValue:",et)),console.log("444444444 GSCFieldDataByZones - setting team filter directly from filterMultiple.isHomeTeam:",Ze,"-> teamValue:",et),m.value[Nt]=et,console.log("444444444 GSCFieldDataByZones - automatically set team filter to:",et),console.log("444444444 GSCFieldDataByZones - teamValue type:",typeof et),console.log("444444444 GSCFieldDataByZones - updated dynamicFilters:",m.value),console.log(" 444444444 GSCFieldDataByZones - filter options:",(ht=T.value[Nt])==null?void 0:ht.options);const bt=(((vt=T.value[Nt])==null?void 0:vt.options)||[]).find(Lt=>Lt.value==et);console.log("444444444 GSCFieldDataByZones - matching option for team:",bt),p.nextTick(()=>{console.log("4444444 **************************************** dynamicFilters *************",m.value),m.value=[...m.value],console.log(" 444444444GSCFieldDataByZones - forced reactivity update for team filter")})}else console.log(" 444444444GSCFieldDataByZones - team filter not found!")}}if(((mt=f.value)==null?void 0:mt.id)===1&&u.value&&(Ot=e==null?void 0:e.view)!=null&&Ot.filterMultiple&&(console.log("GSCComparativeReports - checking filterMultiple after preselecting filters:",e.view.filterMultiple),console.log("GSCComparativeReports - currentFilters:",T.value),console.log("GSCComparativeReports - dynamicFilters before:",m.value),e.view.filterMultiple.category)){console.log("GSCComparativeReports - found category in filterMultiple:",e.view.filterMultiple.category);const Nt=T.value.findIndex(Ze=>Ze.type==="select-simple"&&Ze.label==="Tipo de análisis");if(console.log("GSCComparativeReports - analysisTypeFilterIndex:",Nt),console.log("GSCComparativeReports - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("GSCComparativeReports - found analysis type filter at index:",Nt);const Ze=e.view.filterMultiple.category;console.log("GSCComparativeReports - setting analysis type filter directly from filterMultiple.category:",Ze),m.value[0]=Ze,e.view.componentProps&&Ze&&(e.view.componentProps.type=Ze,console.log("GSCComparativeReports - updated componentProps.type:",e.view.componentProps.type)),console.log("GSCComparativeReports - automatically set analysis type filter to:",Ze),console.log("GSCComparativeReports - category type:",typeof Ze),console.log("GSCComparativeReports - updated dynamicFilters:",m.value),console.log("GSCComparativeReports - filter options:",(Vt=T.value[Nt])==null?void 0:Vt.options);const et=(((qt=T.value[Nt])==null?void 0:qt.options)||[]).find(bt=>bt.value==Ze);console.log("GSCComparativeReports - matching option:",et),p.nextTick(()=>{m.value=[...m.value],console.log("GSCComparativeReports - forced reactivity update")})}else console.log("GSCComparativeReports - analysis type filter not found!")}if(((st=f.value)==null?void 0:st.id)===6&&u.value&&($e=e==null?void 0:e.view)!=null&&$e.filterMultiple&&(console.log("GSCLineupsReports - checking filterMultiple after preselecting filters:",e.view.filterMultiple),console.log("GSCLineupsReports - currentFilters:",T.value),console.log("GSCLineupsReports - dynamicFilters before:",m.value),e.view.filterMultiple.gameNumber)){console.log("GSCLineupsReports - found gameNumber in filterMultiple:",e.view.filterMultiple.gameNumber);const Nt=T.value.findIndex(Ze=>Ze.type==="select-simple"&&Ze.label==="Número de juego");if(console.log("GSCLineupsReports - gameNumberFilterIndex:",Nt),console.log("GSCLineupsReports - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("GSCLineupsReports - found game number filter at index:",Nt);const Ze=e.view.filterMultiple.gameNumber;console.log("GSCLineupsReports - setting game number filter directly from filterMultiple.gameNumber:",Ze),m.value[0]=Ze,e.view.componentProps&&Ze&&(e.view.componentProps.gameNumber=Ze,console.log("GSCLineupsReports - updated componentProps.gameNumber:",e.view.componentProps.gameNumber)),console.log("GSCLineupsReports - automatically set game number filter to:",Ze),console.log("GSCLineupsReports - gameNumber type:",typeof Ze),console.log("GSCLineupsReports - updated dynamicFilters:",m.value),console.log("GSCLineupsReports - filter options:",(lt=T.value[Nt])==null?void 0:lt.options);const et=(((pt=T.value[Nt])==null?void 0:pt.options)||[]).find(bt=>bt.value==Ze);console.log("GSCLineupsReports - matching option:",et),p.nextTick(()=>{m.value=[...m.value],console.log("GSCLineupsReports - forced reactivity update")})}else console.log("GSCLineupsReports - game number filter not found!")}if(((At=f.value)==null?void 0:At.id)===7&&u.value&&e!=null&&e.view){if(console.log("GSCGoalData - checking stored values after preselecting filters:",e.view),console.log("GSCGoalData - currentFilters:",T.value),console.log("GSCGoalData - dynamicFilters before:",m.value),(_t=e.view.componentProps)!=null&&_t.analysisType&&T.value.length>0&&((tt=T.value[0])==null?void 0:tt.type)==="radio-button"){const Nt=e.view.componentProps.analysisType,Ze=Nt==="offensive"?1:2;console.log("GSCGoalData - setting analysis type filter from componentProps.analysisType:",Ze,"analysisType:",Nt),m.value[0]=Ze}if(((ot=e.view.filterMultiple)==null?void 0:ot.isHomeTeam)!==void 0){console.log("GSCGoalData - found isHomeTeam in filterMultiple:",e.view.filterMultiple.isHomeTeam),console.log('GSCGoalData - searching for radio-button filter with label "Equipo"'),console.log("GSCGoalData - all filters details:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label,options:Ze.options})));const Nt=T.value.findIndex(Ze=>Ze.type==="radio-button"&&Ze.label==="Equipo");if(console.log("GSCGoalData - teamFilterIndex:",Nt),console.log("GSCGoalData - all filters:",T.value.map((Ze,et)=>({index:et,type:Ze.type,label:Ze.label}))),Nt!==-1){console.log("GSCGoalData - found team filter at index:",Nt);const Ze=e.view.filterMultiple.isHomeTeam,et=Ze?1:2;console.log("GSCGoalData - setting team filter directly from filterMultiple.isHomeTeam:",et,"isHomeTeam:",Ze),m.value[1]=et}else if(console.log("GSCGoalData - team filter not found by label, trying by index"),T.value.length>1&&((Xe=T.value[1])==null?void 0:Xe.type)==="radio-button"){console.log("GSCGoalData - found radio-button filter at index 1 by fallback");const Ze=e.view.filterMultiple.isHomeTeam,et=Ze?1:2;console.log("GSCGoalData - setting team filter by fallback:",et,"isHomeTeam:",Ze),m.value[1]=et,e.view.componentProps&&(e.view.componentProps.isHomeTeamForAnalysis=Ze,console.log("GSCGoalData - updated componentProps.isHomeTeamForAnalysis:",e.view.componentProps.isHomeTeamForAnalysis)),console.log("GSCGoalData - automatically set team filter to:",et),console.log("GSCGoalData - teamValue type:",typeof et),console.log("GSCGoalData - updated dynamicFilters:",m.value),console.log("GSCGoalData - filter options:",(ct=T.value[1])==null?void 0:ct.options);const bt=(((kt=T.value[1])==null?void 0:kt.options)||[]).find(Lt=>Lt.value==et);console.log("GSCGoalData - matching option:",bt),p.nextTick(()=>{m.value=[...m.value],console.log("GSCGoalData - forced reactivity update")})}else console.log("GSCGoalData - no radio-button filter found at index 1 either");if(Nt!==-1&&e.view.componentProps){const Ze=e.view.filterMultiple.isHomeTeam,et=Ze?1:2;e.view.componentProps.isHomeTeamForAnalysis=Ze,console.log("GSCGoalData - updated componentProps.isHomeTeamForAnalysis:",e.view.componentProps.isHomeTeamForAnalysis),console.log("GSCGoalData - automatically set team filter to:",et),console.log("GSCGoalData - teamValue type:",typeof et),console.log("GSCGoalData - updated dynamicFilters:",m.value),console.log("GSCGoalData - filter options:",(yt=T.value[Nt])==null?void 0:yt.options);const bt=(((It=T.value[Nt])==null?void 0:It.options)||[]).find(Lt=>Lt.value==et);console.log("GSCGoalData - matching option:",bt),p.nextTick(()=>{m.value=[...m.value],console.log("GSCGoalData - forced reactivity update")})}}else console.log("GSCGoalData - isHomeTeam is undefined in filterMultiple")}p.nextTick(()=>{b.value=!1})}},100)}))}function de(){var ve,me,De,Ie,Ve,We,Ye,ke,ze,Fe;return{mainSelector:{id:((ve=d.value)==null?void 0:ve.id)||null,name:((me=d.value)==null?void 0:me.name)||null,url:((De=d.value)==null?void 0:De.url)||null},viewSelector:{id:((Ie=f.value)==null?void 0:Ie.id)||null,name:((Ve=f.value)==null?void 0:Ve.name)||((We=f.value)==null?void 0:We.title)||null,url:((Ye=f.value)==null?void 0:Ye.url)||null},team:_.value,dynamicFilters:((ke=T.value)==null?void 0:ke.map((He,rt)=>{var nt,ht;const vt=m.value[rt];return{filterId:He.id||`filter_${rt}`,filterType:He.type,filterLabel:He.label,filterIcon:He.icon||null,selectedValue:vt,selectedOptions:He.type==="select"&&Array.isArray(vt)&&vt.length>0?vt.map(mt=>{var Ot;const Vt=(Ot=He.options)==null?void 0:Ot.find(qt=>qt.value===mt);return{value:mt,label:(Vt==null?void 0:Vt.label)||mt,icon:(Vt==null?void 0:Vt.icon)||null}}):null,selectedOption:He.type==="radio-button"&&vt?{value:vt,label:((ht=(nt=He.options)==null?void 0:nt.find(mt=>mt.value===vt))==null?void 0:ht.label)||vt}:null,isChecked:He.type==="check"?vt:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!d.value,viewSelected:!!f.value,totalDynamicFilters:((ze=T.value)==null?void 0:ze.length)||0,activeFilters:((Fe=T.value)==null?void 0:Fe.filter((He,rt)=>{const nt=m.value[rt];return Array.isArray(nt)?nt.length>0:nt!=null&&nt!==!1}).length)||0}}}a({getCurrentFiltersJSON:de});function ye(){fe(),J("close",x)}function _e(){t.value=!1,ye()}function xe(){w.value&&(Ei.emit("filters-cancelled",x),w.value=!1),t.value=!1,ye()}p.onMounted(async()=>{document.addEventListener("click",oe),p.nextTick(()=>{Se()});try{const ve=await(await fetch("https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/views",{headers:{Authorization:`${B.token}`}})).json();C.value=ve.data||[]}catch(ve){console.error("Error al obtener datos:",ve)}});function Se(){document.querySelectorAll(".field-menu .option-card").forEach(ve=>{const me=ve.querySelector(".option-img");if(!me||!me.dataset.hoverSrc)return;const De=me.src,Ie=me.dataset.hoverSrc;ve.addEventListener("mouseenter",()=>{me.src=Ie}),ve.addEventListener("mouseleave",()=>{me.src=De})})}p.onUnmounted(()=>{document.removeEventListener("click",oe)}),Ei.on("set-filter-and-views-container",ve=>{x=ve,ve&&se(ve)}),Ei.on("view-added",()=>{console.log("View ************************************************************* add"),t.value=!0,w.value=!0}),Ei.on("component-added-to-container",ve=>{console.log("Component added to container, updating filters, container:",ve),!u.value||x&&ve.id===x.id?se(ve):console.log("Skipping container update - edit mode or different container")}),Ei.on("edit-view",ve=>{var me,De,Ie,Ve,We,Ye,ke,ze,Fe,He,rt,nt,ht,vt,mt,Ot,Vt,qt,st;console.log("edit-view received:",ve),e=ve,x=((me=ve.view)==null?void 0:me.filterAndViewsContainer)||null,v=null;const $e=[(Ie=(De=ve.view)==null?void 0:De.coreView)==null?void 0:Ie.filtersJSON,(Ve=ve.view)==null?void 0:Ve.filtersJSON,(We=ve.coreView)==null?void 0:We.filtersJSON,ve.filtersJSON,(ke=(Ye=ve.view)==null?void 0:Ye.componentProps)==null?void 0:ke.filtersJSON];for(const lt of $e)if(lt){v=lt,console.log("Found editFiltersJSON in:",lt);break}if(x&&(x.viewId===4||x.viewId===8||x.viewId===3||x.viewId===1||x.viewId===2)&&(ze=ve.view)!=null&&ze.id){const lt=x.getComponentDynamicFilters(ve.view.id);if(lt){let pt="Unknown";x.viewId===4?pt="Timeline":x.viewId===8?pt="FieldPosesion":x.viewId===3?pt="GSCMatchSummary":x.viewId===1?pt="GSCComparativeReports":x.viewId===2&&(pt="GscTopPlayer"),console.log(`${pt} - found component specific filters:`,lt),v&&(v={...v,dynamicFilters:lt.map((At,_t)=>Array.isArray(At)?{selectedValue:At,selectedOptions:At.map(tt=>({value:tt,label:tt}))}:typeof At=="boolean"?{isChecked:At}:pt==="GSCComparativeReports"&&_t===0?{selectedValue:At,selectedOptions:[{value:At,label:At}]}:pt==="GscTopPlayer"&&_t===0?{selectedValue:At,selectedOptions:[{value:At,label:At}]}:pt==="GscTopPlayer"&&_t===1?{selectedOption:{value:At,label:At}}:{selectedOption:{value:At,label:At}})},console.log(`${pt} - updated editFiltersJSON with component specific filters:`,v))}}if(x&&x.viewId===2&&(Fe=ve.view)!=null&&Fe.filterMultiple){if(console.log("2222************************************************************",e.view.filterMultiple),console.log("GSCtops detected - checking filterMultiple:",ve.view.filterMultiple),ve.view.filterMultiple.categoryId&&v){console.log("GSCtops - found categoryId in filterMultiple:",ve.view.filterMultiple.categoryId);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="select-simple"&&pt.filterLabel==="Tipo de análisis");lt!==-1&&(console.log("GSCtops - found category filter at index:",lt),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedValue:ve.view.filterMultiple.categoryId,selectedOptions:[{value:ve.view.filterMultiple.categoryId,label:`Category ${ve.view.filterMultiple.categoryId}`}]},console.log("GSCtops - updated filter with single value:",ve.view.filterMultiple.categoryId),console.log("GSCtops - updated filter structure:",v.dynamicFilters[lt]),console.log("GSCtops - updated category filter with filterMultiple.categoryId:",ve.view.filterMultiple.categoryId))}if(ve.view.filterMultiple.teamType!==void 0&&v){console.log("GSCtops - found teamType in filterMultiple:",ve.view.filterMultiple.teamType);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="radio-button");if(lt!==-1){console.log("GSCtops - found team filter at index:",lt);const pt=ve.view.filterMultiple.teamType,At=pt===1?"Mi equipo":pt===2?"Rival":pt===3?"Ambos":"Equipo";v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedOption:{value:pt,label:At}},console.log("GSCtops - updated team filter with teamType:",pt,"label:",At),console.log("GSCtops - updated team filter structure:",v.dynamicFilters[lt]),console.log("GSCtops - updated team filter with filterMultiple.teamType:",ve.view.filterMultiple.teamType)}}}if(x&&x.viewId===1&&(He=ve.view)!=null&&He.filterMultiple&&(console.log("GSCComparativeReports detected - checking filterMultiple:",ve.view.filterMultiple),ve.view.filterMultiple.category&&v)){console.log("GSCComparativeReports - found category in filterMultiple:",ve.view.filterMultiple.category);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="select-simple"&&pt.filterLabel==="Tipo de análisis");lt!==-1&&(console.log("GSCComparativeReports - found analysis type filter at index:",lt),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedValue:ve.view.filterMultiple.category,selectedOptions:[{value:ve.view.filterMultiple.category,label:ve.view.filterMultiple.category}]},console.log("GSCComparativeReports - updated filter with single value:",ve.view.filterMultiple.category),console.log("GSCComparativeReports - updated filter structure:",v.dynamicFilters[lt]),console.log("GSCComparativeReports - updated analysis type filter with filterMultiple.category:",ve.view.filterMultiple.category))}if(x&&x.viewId===9&&(rt=ve.view)!=null&&rt.filterMultiple){if(console.log("GSCFieldDataByZones detected - checking filterMultiple:",ve.view.filterMultiple),ve.view.filterMultiple.categoryIds&&v){console.log("GSCFieldDataByZones - found categoryIds in filterMultiple:",ve.view.filterMultiple.categoryIds);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="select"&&pt.filterLabel==="Tipo de análisis");if(lt!==-1){console.log("GSCFieldDataByZones - found analysis type filter at index:",lt);const pt=Array.isArray(ve.view.filterMultiple.categoryIds)?ve.view.filterMultiple.categoryIds:[ve.view.filterMultiple.categoryIds];console.log("GSCFieldDataByZones - processing categoryIds array:",pt),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedValue:pt,selectedOptions:pt.map(ot=>({value:ot,label:`Category ${ot}`}))},console.log("GSCFieldDataByZones - updated filter with categoryIds:",pt),console.log("GSCFieldDataByZones - updated filter structure:",v.dynamicFilters[lt]);const At=ve.view.filterMultiple.categoryIds,_t=Ce(At,pt);console.log("GSCFieldDataByZones - category arrays match with original:",_t),console.log("GSCFieldDataByZones - original categoryIds:",At,"processed categoryIds:",pt);const tt=(((nt=T.value[lt])==null?void 0:nt.options)||[]).filter(ot=>Array.isArray(ot.value)?Ce(ot.value,pt):pt.includes(ot.value));if(console.log("GSCFieldDataByZones - matching options in editFiltersJSON:",tt),tt.length>0){const ot=tt[0];console.log("GSCFieldDataByZones - found matching option in editFiltersJSON:",ot),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedValue:ot.value,selectedOptions:[ot]},console.log("GSCFieldDataByZones - updated editFiltersJSON with matching option value:",ot.value)}console.log("GSCFieldDataByZones - updated analysis type filter with filterMultiple.categoryIds:",pt)}}if(ve.view.filterMultiple.isHomeTeam!==void 0&&v){console.log("GSCFieldDataByZones - found isHomeTeam in filterMultiple:",ve.view.filterMultiple.isHomeTeam),console.log("GSCFieldDataByZones - isHomeTeam type:",typeof ve.view.filterMultiple.isHomeTeam);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="radio-button");if(lt!==-1){console.log("GSCFieldDataByZones - found team filter at index:",lt);const pt=ve.view.filterMultiple.isHomeTeam;let At,_t;typeof pt=="boolean"?(At=pt?1:2,_t=pt?"Mi equipo":"Rival",console.log("GSCFieldDataByZones - converted boolean isHomeTeam to teamValue:",pt,"->",At,"label:",_t)):typeof pt=="number"?(At=pt===1?1:2,_t=pt===1?"Mi equipo":"Rival",console.log("GSCFieldDataByZones - converted numeric isHomeTeam to teamValue:",pt,"->",At,"label:",_t)):(At=1,_t="Mi equipo",console.log("GSCFieldDataByZones - using default teamValue:",At,"label:",_t)),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedOption:{value:At,label:_t}},console.log("GSCFieldDataByZones - updated team filter with isHomeTeam:",pt,"teamValue:",At,"teamLabel:",_t),console.log("GSCFieldDataByZones - updated team filter structure:",v.dynamicFilters[lt]),console.log("GSCFieldDataByZones - updated team filter with filterMultiple.isHomeTeam:",ve.view.filterMultiple.isHomeTeam)}}}if(x&&x.viewId===6&&(ht=ve.view)!=null&&ht.filterMultiple&&(console.log("GSCLineupsReports detected - checking filterMultiple:",ve.view.filterMultiple),ve.view.filterMultiple.gameNumber&&v)){console.log("GSCLineupsReports - found gameNumber in filterMultiple:",ve.view.filterMultiple.gameNumber);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="select-simple"&&pt.filterLabel==="Número de juego");lt!==-1&&(console.log("GSCLineupsReports - found game number filter at index:",lt),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedValue:ve.view.filterMultiple.gameNumber,selectedOptions:[{value:ve.view.filterMultiple.gameNumber,label:`Juego ${ve.view.filterMultiple.gameNumber}`}]},console.log("GSCLineupsReports - updated filter with single value:",ve.view.filterMultiple.gameNumber),console.log("GSCLineupsReports - updated filter structure:",v.dynamicFilters[lt]),console.log("GSCLineupsReports - updated game number filter with filterMultiple.gameNumber:",ve.view.filterMultiple.gameNumber))}if(x&&x.viewId===7&&ve.view&&v){if(console.log("GSCGoalData detected - checking stored values:",ve.view),(vt=ve.view.componentProps)!=null&&vt.analysisType){console.log("GSCGoalData - found analysisType in componentProps:",ve.view.componentProps.analysisType);const lt=v.dynamicFilters.findIndex((pt,At)=>pt.filterType==="radio-button"&&At===0);if(lt!==-1){console.log("GSCGoalData - found analysis type filter at index:",lt);const pt=ve.view.componentProps.analysisType,At=pt==="offensive"?1:2,_t=pt==="offensive"?"A favor":"En contra";v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedOption:{value:At,label:_t}},console.log("GSCGoalData - updated analysis filter with value:",At,"analysisType:",pt),console.log("GSCGoalData - updated analysis filter structure:",v.dynamicFilters[lt])}}if(((mt=ve.view.filterMultiple)==null?void 0:mt.isHomeTeam)!==void 0){console.log("GSCGoalData - found isHomeTeam in filterMultiple:",ve.view.filterMultiple.isHomeTeam);const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="radio-button"&&pt.filterLabel==="Equipo");if(lt!==-1){console.log("GSCGoalData - found team filter at index:",lt);const pt=ve.view.filterMultiple.isHomeTeam,At=pt?1:2,_t=pt?"Equipo propio":"Equipo rival";v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedOption:{value:At,label:_t}},console.log("GSCGoalData - updated filter with team value:",At,"isHomeTeam:",pt),console.log("GSCGoalData - updated filter structure:",v.dynamicFilters[lt]),console.log("GSCGoalData - updated team filter with filterMultiple.isHomeTeam:",pt)}}}if(x&&x.viewId===10&&(Ot=ve.view)!=null&&Ot.filterMultiple&&(console.log("gsc xg detected - checking filterMultiple:",ve.view.filterMultiple),((qt=(Vt=e==null?void 0:e.view)==null?void 0:Vt.coreView)==null?void 0:qt.id)===10)){const lt=ve.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};v&&(v.dynamicFilters[0]={...v.dynamicFilters[0],selectedOption:lt})}if(x&&x.viewId===5&&(st=ve.view)!=null&&st.filterMultiple&&(console.log("GSCVolumetricField detected - checking filterMultiple:",ve.view.filterMultiple),ve.view.filterMultiple.isHomeTeam!==void 0&&v)){console.log("GSCVolumetricField - found isHomeTeam in filterMultiple:",ve.view.filterMultiple.isHomeTeam),console.log("GSCVolumetricField - editFiltersJSON.dynamicFilters:",v.dynamicFilters),console.log("GSCVolumetricField - searching for team filter in editFiltersJSON");const lt=v.dynamicFilters.findIndex(pt=>pt.filterType==="radio-button"&&pt.filterLabel==="Equipo");if(console.log("GSCVolumetricField - teamFilterIndex:",lt),console.log("GSCVolumetricField - all filters in editFiltersJSON:",v.dynamicFilters.map((pt,At)=>({index:At,filterType:pt.filterType,filterLabel:pt.filterLabel}))),lt!==-1){console.log("GSCVolumetricField - found team filter at index:",lt);const pt=ve.view.filterMultiple.isHomeTeam;console.log("GSCVolumetricField - isHomeTeam type in editFiltersJSON:",typeof pt,"value:",pt);let At,_t;typeof pt=="boolean"?(At=pt?1:2,_t=pt?"Equipo propio":"Equipo rival",console.log("GSCVolumetricField - isHomeTeam is boolean in editFiltersJSON, converting:",pt,"-> teamValue:",At,"teamLabel:",_t)):typeof pt=="number"?(At=pt===1?1:2,_t=pt===1?"Equipo propio":"Equipo rival",console.log("GSCVolumetricField - isHomeTeam is number in editFiltersJSON, using directly:",pt,"-> teamValue:",At,"teamLabel:",_t)):(At=1,_t="Equipo propio",console.log("GSCVolumetricField - isHomeTeam is unknown type in editFiltersJSON, using default:",At,"teamLabel:",_t)),v.dynamicFilters[lt]={...v.dynamicFilters[lt],selectedOption:{value:At,label:_t}},console.log("GSCVolumetricField - updated filter with team value:",At,"isHomeTeam:",pt),console.log("GSCVolumetricField - updated filter structure:",v.dynamicFilters[lt]),console.log("GSCVolumetricField - updated team filter with filterMultiple.isHomeTeam:",pt)}else{console.log("GSCVolumetricField - team filter not found in editFiltersJSON, trying fallback");const pt=v.dynamicFilters.findIndex(At=>At.filterType==="radio-button");if(pt!==-1){console.log("GSCVolumetricField - found radio-button filter at index:",pt);const At=ve.view.filterMultiple.isHomeTeam;console.log("GSCVolumetricField - isHomeTeam type in editFiltersJSON fallback:",typeof At,"value:",At);let _t,tt;typeof At=="boolean"?(_t=At?1:2,tt=At?"Equipo propio":"Equipo rival",console.log("GSCVolumetricField - isHomeTeam is boolean in editFiltersJSON fallback, converting:",At,"-> teamValue:",_t,"teamLabel:",tt)):typeof At=="number"?(_t=At===1?1:2,tt=At===1?"Equipo propio":"Equipo rival",console.log("GSCVolumetricField - isHomeTeam is number in editFiltersJSON fallback, using directly:",At,"-> teamValue:",_t,"teamLabel:",tt)):(_t=1,tt="Equipo propio",console.log("GSCVolumetricField - isHomeTeam is unknown type in editFiltersJSON fallback, using default:",_t,"teamLabel:",tt)),v.dynamicFilters[pt]={...v.dynamicFilters[pt],selectedOption:{value:_t,label:tt}},console.log("GSCVolumetricField - updated filter with team value (fallback):",_t,"isHomeTeam:",At),console.log("GSCVolumetricField - updated filter structure (fallback):",v.dynamicFilters[pt])}else console.log("GSCVolumetricField - no radio-button filters found in editFiltersJSON at all!")}}console.log("Final editFiltersJSON:",v),v?ue(v):console.log("No editFiltersJSON found, cannot preselect filters"),t.value=!0});function Me(){V.value=null}function Te(ve,me){var De;((De=f.value)==null?void 0:De.id)===2&&console.log("GSCtops - debugSelectSimple:",{idx:ve,optionValue:me,optionValueType:typeof me,dynamicFiltersValue:m.value[ve],dynamicFiltersValueType:typeof m.value[ve],isEqual:m.value[ve]===me,isEqualLoose:m.value[ve]==me})}function Ce(ve,me){if(!Array.isArray(ve)||!Array.isArray(me)||ve.length!==me.length)return!1;const De=[...ve].sort((Ve,We)=>Ve-We),Ie=[...me].sort((Ve,We)=>Ve-We);return JSON.stringify(De)===JSON.stringify(Ie)}function Ne(){var ve;if(u.value&&v&&v.dynamicFilters){if(console.log("Forcing checkbox and select filter update from editFiltersJSON"),((ve=f.value)==null?void 0:ve.id)===8&&(console.log("FieldPosesion - forceCheckboxUpdate called"),console.log("FieldPosesion - viewToEdit:",e),console.log("FieldPosesion - editFiltersJSON:",v)),h.value){console.log("Skipping forceCheckboxUpdate - already in force update");return}if(y.value)return;h.value=!0,b.value=!0,v.dynamicFilters.forEach((me,De)=>{var Ie,Ve,We;if(me&&(Ie=T.value)!=null&&Ie[De]){const Ye=T.value[De];if(Ye.type==="check"&&me.isChecked!==void 0)console.log(`Forcing checkbox ${De} to:`,me.isChecked),m.value[De]=me.isChecked,((Ve=f.value)==null?void 0:Ve.id)===8&&console.log("FieldPosesion - Checkbox filter updated:",{index:De,value:me.isChecked,componentId:(We=e==null?void 0:e.view)==null?void 0:We.id});else if(Ye.type==="select"&&me.selectedOptions){const ke=me.selectedOptions.map(ze=>ze.value);console.log(`Forcing select filter ${De} to:`,ke),m.value[De]=ke}else Ye.type==="select"&&me.selectedValue&&Array.isArray(me.selectedValue)&&(console.log(`Forcing select filter ${De} to:`,me.selectedValue),m.value[De]=me.selectedValue)}}),p.nextTick(()=>{b.value=!1,h.value=!1})}}function Re(){var ve;if(u.value&&v&&v.dynamicFilters&&((ve=f.value)==null?void 0:ve.id)===4){if(console.log("Preselecting Timeline filters specifically"),h.value){console.log("Skipping preselectTimelineFilters - already in force update");return}if(y.value)return;h.value=!0,b.value=!0,v.dynamicFilters.forEach((me,De)=>{var Ie,Ve;if(me&&((Ve=(Ie=T.value)==null?void 0:Ie[De])==null?void 0:Ve.type)==="select"){if(me.selectedOptions){const We=me.selectedOptions.map(Ye=>Ye.value);console.log(`Preselecting Timeline select filter ${De} to:`,We),m.value[De]=We}else if(me.selectedValue&&Array.isArray(me.selectedValue))if(me.selectedValue.length>0&&me.selectedValue[0]&&typeof me.selectedValue[0]=="object"){const We=Ge(me.selectedValue);console.log(`Preselecting Timeline select filter ${De} to:`,We),m.value[De]=We}else console.log(`Preselecting Timeline select filter ${De} to:`,me.selectedValue),m.value[De]=me.selectedValue}}),setTimeout(()=>{var me;if(console.log("Forcing UI update after preselecting Timeline filters"),m.value=[...m.value],(me=e==null?void 0:e.view)!=null&&me.componentProps&&m.value&&m.value.length>0){const De=m.value[0];if(console.log("Timeline - preselecting componentProps with events:",De),Array.isArray(De)&&De.length>0){const Ie=De.some(ke=>ke.event_type_id===1||typeof ke=="string"&&ke.includes("1")),Ve=De.some(ke=>ke.category_id===8||typeof ke=="string"&&ke.includes("8")),We=De.some(ke=>ke.category_id===9||typeof ke=="string"&&ke.includes("9")),Ye=De.some(ke=>ke.event_type_id===3||typeof ke=="string"&&ke.includes("3"));console.log("Timeline - preselecting Events check:",{goals:Ie,yellowCards:Ve,redCards:We,substitutions:Ye,selectedEvents:De}),e.view.componentProps.selectedEvents=De,e.view.componentProps.goals=Ie,e.view.componentProps.yellowCards=Ve,e.view.componentProps.redCards=We,e.view.componentProps.substitutions=Ye,e.view.componentProps.key=De.length>0,e.view.componentProps._updateKey=Date.now(),console.log("Timeline - preselecting updated componentProps:",e.view.componentProps),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps}),console.log("Timeline - preselecting emitted force-component-update event")}}},200),p.nextTick(()=>{b.value=!1,h.value=!1})}}function Ge(ve){return!Array.isArray(ve)||ve.length===0?[]:ve.map(me=>{if(me&&typeof me=="object"){if(me.event_type_id!==void 0||me.category_id!==void 0)return{event_type_id:me.event_type_id,category_id:me.category_id,...me.name&&{name:me.name},...me.label&&{label:me.label}};if(me.value&&typeof me.value=="object")return{event_type_id:me.value.event_type_id,category_id:me.value.category_id,...me.value.name&&{name:me.value.name},...me.value.label&&{label:me.value.label}};if(typeof me=="string"&&me.includes("-")){const[De,Ie]=me.split("-");return{category_id:parseInt(De),event_type_id:parseInt(Ie)}}}if(typeof me=="string")if(me.includes("-")){const[De,Ie]=me.split("-");return{category_id:parseInt(De),event_type_id:parseInt(Ie)}}else{const De=parseInt(me);if(!isNaN(De))return{event_type_id:De}}return me})}function Pe(){var ve,me,De,Ie,Ve,We,Ye,ke,ze,Fe,He,rt,nt,ht;if(u.value&&v&&v.dynamicFilters&&T.value){if(console.log("Force updating select filters immediately"),h.value){console.log("Skipping forceSelectFilterUpdate - already in force update");return}if(y.value)return;if(h.value=!0,b.value=!0,v.dynamicFilters.forEach((vt,mt)=>{var Ot,Vt,qt,st,$e,lt,pt,At,_t,tt,ot;if(vt&&((Ot=T.value[mt])==null?void 0:Ot.type)==="select"){if(vt.selectedOptions){const Xe=vt.selectedOptions.map(ct=>ct.value);console.log(`Force setting select filter ${mt} to:`,Xe),m.value[mt]=Xe}else if(vt.selectedValue&&Array.isArray(vt.selectedValue))if(vt.selectedValue.length>0&&vt.selectedValue[0]&&typeof vt.selectedValue[0]=="object"){const Xe=Ge(vt.selectedValue);console.log(`Force setting Timeline select filter ${mt} to:`,Xe),m.value[mt]=Xe}else console.log(`Force setting select filter ${mt} to:`,vt.selectedValue),m.value[mt]=vt.selectedValue}else if(vt&&((Vt=T.value[mt])==null?void 0:Vt.type)==="select-simple"&&vt.selectedValue!==void 0){console.log(`Force setting select-simple filter ${mt} to:`,vt.selectedValue),console.log("forceSelectFilterUpdate - selectedValue type:",typeof vt.selectedValue),console.log("forceSelectFilterUpdate - selectedValue is array:",Array.isArray(vt.selectedValue));let Xe;((qt=f.value)==null?void 0:qt.id)===2&&($e=(st=e==null?void 0:e.view)==null?void 0:st.filterMultiple)!=null&&$e.categoryId?(Xe=e.view.filterMultiple.categoryId,console.log("GSCtops - using filterMultiple.categoryId in forceSelectFilterUpdate:",Xe)):((lt=f.value)==null?void 0:lt.id)===1&&(At=(pt=e==null?void 0:e.view)==null?void 0:pt.filterMultiple)!=null&&At.category?(Xe=e.view.filterMultiple.category,console.log("GSCComparativeReports - using filterMultiple.category in forceSelectFilterUpdate:",Xe)):((_t=f.value)==null?void 0:_t.id)===6&&(ot=(tt=e==null?void 0:e.view)==null?void 0:tt.filterMultiple)!=null&&ot.gameNumber?(Xe=e.view.filterMultiple.gameNumber,console.log("GSCLineupsReports - using filterMultiple.gameNumber in forceSelectFilterUpdate:",Xe)):Xe=Array.isArray(vt.selectedValue)?vt.selectedValue[0]:vt.selectedValue,m.value[mt]=Xe,console.log(`Force setting select-simple filter ${mt} to:`,Xe)}}),((ve=f.value)==null?void 0:ve.id)===4&&setTimeout(()=>{var vt;if(console.log("Forcing UI update for Timeline filters"),m.value=[...m.value],(vt=e==null?void 0:e.view)!=null&&vt.componentProps&&m.value&&m.value.length>0){const mt=m.value[0];if(console.log("Timeline - forceSelectFilterUpdate componentProps with events:",mt),Array.isArray(mt)&&mt.length>0){const Ot=mt.some($e=>$e.event_type_id===1||typeof $e=="string"&&$e.includes("1")),Vt=mt.some($e=>$e.category_id===8||typeof $e=="string"&&$e.includes("8")),qt=mt.some($e=>$e.category_id===9||typeof $e=="string"&&$e.includes("9")),st=mt.some($e=>$e.event_type_id===3||typeof $e=="string"&&$e.includes("3"));console.log("Timeline - forceSelectFilterUpdate Events check:",{goals:Ot,yellowCards:Vt,redCards:qt,substitutions:st,selectedEvents:mt}),e.view.componentProps.selectedEvents=mt,e.view.componentProps.goals=Ot,e.view.componentProps.yellowCards=Vt,e.view.componentProps.redCards=qt,e.view.componentProps.substitutions=st,e.view.componentProps.key=mt.length>0,e.view.componentProps._updateKey=Date.now(),console.log("Timeline - forceSelectFilterUpdate updated componentProps:",e.view.componentProps),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps}),console.log("Timeline - forceSelectFilterUpdate emitted force-component-update event")}}},100),((me=f.value)==null?void 0:me.id)===2&&(De=e==null?void 0:e.view)!=null&&De.filterMultiple){if(console.log("GSCtops - checking filterMultiple in forceSelectFilterUpdate:",e.view.filterMultiple),console.log("GSCtops - currentFilters in forceSelectFilterUpdate:",T.value),e.view.filterMultiple.categoryId){console.log("GSCtops - found categoryId in filterMultiple:",e.view.filterMultiple.categoryId);const vt=T.value.findIndex(mt=>mt.type==="select-simple"&&mt.label==="Tipo de análisis");if(console.log("GSCtops - categoryFilterIndex in forceSelectFilterUpdate:",vt),console.log("GSCtops - all filters in forceSelectFilterUpdate:",T.value.map((mt,Ot)=>({index:Ot,type:mt.type,label:mt.label}))),vt!==-1){console.log("GSCtops - found category filter at index:",vt);const mt=e.view.filterMultiple.categoryId;if(console.log("GSCtops - setting category filter directly from filterMultiple.categoryId in forceSelectFilterUpdate:",mt),m.value[0]=mt,e.view.componentProps&&mt){let Vt=`Category ${mt}`,qt=null;try{qt=Vd(mt),qt&&(Vt=qt.name,console.log("GSCtops - found category info from getCategoryById in forceSelectFilterUpdate:",qt))}catch{console.log("GSCtops - getCategoryById failed in forceSelectFilterUpdate, using filter options");const st=T.value.findIndex($e=>$e.type==="select-simple"&&$e.label==="Tipo de análisis");if(st!==-1){const $e=(((Ie=T.value[st])==null?void 0:Ie.options)||[]).find(lt=>lt.value==mt);$e&&(Vt=$e.label,console.log("GSCtops - found category name from options in forceSelectFilterUpdate:",Vt))}}e.view.componentProps.categoryView=[{id:mt,name:Vt}],console.log("GSCtops - updated componentProps.categoryView in forceSelectFilterUpdate:",e.view.componentProps.categoryView)}console.log("GSCtops - automatically set category filter to:",mt),console.log("GSCtops - categoryId type:",typeof mt),console.log("GSCtops - updated dynamicFilters:",m.value),console.log("GSCtops - filter options:",(Ve=T.value[vt])==null?void 0:Ve.options);const Ot=(((We=T.value[vt])==null?void 0:We.options)||[]).find(Vt=>Vt.value==mt);console.log("GSCtops - matching option:",Ot),p.nextTick(()=>{m.value=[...m.value],console.log("GSCtops - forced reactivity update in forceSelectFilterUpdate")})}else console.log("GSCtops - category filter not found in forceSelectFilterUpdate!")}if(e.view.filterMultiple.teamType!==void 0){console.log("GSCtops - found teamType in filterMultiple in forceSelectFilterUpdate:",e.view.filterMultiple.teamType);const vt=T.value.findIndex(mt=>mt.type==="radio-button");if(console.log("GSCtops - teamFilterIndex in forceSelectFilterUpdate:",vt),console.log("GSCtops - all filters in forceSelectFilterUpdate:",T.value.map((mt,Ot)=>({index:Ot,type:mt.type,label:mt.label}))),vt!==-1){console.log("GSCtops - found team filter at index in forceSelectFilterUpdate:",vt);const mt=e.view.filterMultiple.teamType;console.log("GSCtops - setting team filter directly from filterMultiple.teamType in forceSelectFilterUpdate:",mt),m.value[vt]=mt,console.log("GSCtops - automatically set team filter to in forceSelectFilterUpdate:",mt),console.log("GSCtops - teamType type in forceSelectFilterUpdate:",typeof mt),console.log("GSCtops - updated dynamicFilters in forceSelectFilterUpdate:",m.value),console.log("GSCtops - filter options in forceSelectFilterUpdate:",(Ye=T.value[vt])==null?void 0:Ye.options);const Ot=(((ke=T.value[vt])==null?void 0:ke.options)||[]).find(Vt=>Vt.value==mt);console.log("GSCtops - matching option for team in forceSelectFilterUpdate:",Ot),p.nextTick(()=>{m.value=[...m.value],console.log("GSCtops - forced reactivity update for team filter in forceSelectFilterUpdate")})}else console.log("GSCtops - team filter not found in forceSelectFilterUpdate!")}}if(((ze=f.value)==null?void 0:ze.id)===1&&(Fe=e==null?void 0:e.view)!=null&&Fe.filterMultiple&&(console.log("GSCComparativeReports - checking filterMultiple in forceSelectFilterUpdate:",e.view.filterMultiple),console.log("GSCComparativeReports - currentFilters in forceSelectFilterUpdate:",T.value),e.view.filterMultiple.category)){console.log("GSCComparativeReports - found category in filterMultiple:",e.view.filterMultiple.category);const vt=T.value.findIndex(mt=>mt.type==="select-simple"&&mt.label==="Tipo de análisis");if(console.log("GSCComparativeReports - analysisTypeFilterIndex in forceSelectFilterUpdate:",vt),console.log("GSCComparativeReports - all filters in forceSelectFilterUpdate:",T.value.map((mt,Ot)=>({index:Ot,type:mt.type,label:mt.label}))),vt!==-1){console.log("GSCComparativeReports - found analysis type filter at index:",vt);const mt=e.view.filterMultiple.category;console.log("GSCComparativeReports - setting analysis type filter directly from filterMultiple.category in forceSelectFilterUpdate:",mt),m.value[0]=mt,e.view.componentProps&&mt&&(e.view.componentProps.type=mt,console.log("GSCComparativeReports - updated componentProps.type in forceSelectFilterUpdate:",e.view.componentProps.type)),p.nextTick(()=>{m.value=[...m.value],console.log("GSCComparativeReports - forced reactivity update in forceSelectFilterUpdate")})}else console.log("GSCComparativeReports - analysis type filter not found in forceSelectFilterUpdate!")}if(((He=f.value)==null?void 0:He.id)===6&&(rt=e==null?void 0:e.view)!=null&&rt.filterMultiple&&(console.log("GSCLineupsReports - checking filterMultiple in forceSelectFilterUpdate:",e.view.filterMultiple),console.log("GSCLineupsReports - currentFilters in forceSelectFilterUpdate:",T.value),e.view.filterMultiple.gameNumber)){console.log("GSCLineupsReports - found gameNumber in filterMultiple:",e.view.filterMultiple.gameNumber);const vt=T.value.findIndex(mt=>mt.type==="select-simple"&&mt.label==="Número de juego");if(console.log("GSCLineupsReports - gameNumberFilterIndex in forceSelectFilterUpdate:",vt),console.log("GSCLineupsReports - all filters in forceSelectFilterUpdate:",T.value.map((mt,Ot)=>({index:Ot,type:mt.type,label:mt.label}))),vt!==-1){console.log("GSCLineupsReports - found game number filter at index:",vt);const mt=e.view.filterMultiple.gameNumber;console.log("GSCLineupsReports - setting game number filter directly from filterMultiple.gameNumber in forceSelectFilterUpdate:",mt),m.value[0]=mt,e.view.componentProps&&mt&&(e.view.componentProps.gameNumber=mt,console.log("GSCLineupsReports - updated componentProps.gameNumber in forceSelectFilterUpdate:",e.view.componentProps.gameNumber)),p.nextTick(()=>{m.value=[...m.value],console.log("GSCLineupsReports - forced reactivity update in forceSelectFilterUpdate")})}else console.log("GSCLineupsReports - game number filter not found in forceSelectFilterUpdate!")}if(((nt=f.value)==null?void 0:nt.id)===5&&(ht=e==null?void 0:e.view)!=null&&ht.filterMultiple&&(console.log("GSCVolumetricField - checking filterMultiple in forceSelectFilterUpdate:",e.view.filterMultiple),console.log("GSCVolumetricField - currentFilters in forceSelectFilterUpdate:",T.value),e.view.filterMultiple.isHomeTeam!==void 0)){console.log("GSCVolumetricField - found isHomeTeam in filterMultiple:",e.view.filterMultiple.isHomeTeam),console.log('GSCVolumetricField - searching for team filter with label "Equipo"'),console.log("GSCVolumetricField - all filters details:",T.value.map((mt,Ot)=>({index:Ot,type:mt.type,label:mt.label,options:mt.options})));const vt=T.value.findIndex(mt=>mt.type==="radio-button"&&mt.label==="Equipo");if(console.log("GSCVolumetricField - teamFilterIndex in forceSelectFilterUpdate:",vt),console.log("GSCVolumetricField - all filters in forceSelectFilterUpdate:",T.value.map((mt,Ot)=>({index:Ot,type:mt.type,label:mt.label}))),vt!==-1){console.log("GSCVolumetricField - found team filter at index:",vt);const mt=e.view.filterMultiple.isHomeTeam;console.log("GSCVolumetricField - isHomeTeam type:",typeof mt,"value:",mt);let Ot;typeof mt=="boolean"?(Ot=mt?1:2,console.log("GSCVolumetricField - isHomeTeam is boolean, converting:",mt,"-> teamValue:",Ot)):typeof mt=="number"?(Ot=mt===1?1:2,console.log("GSCVolumetricField - isHomeTeam is number, using directly:",mt,"-> teamValue:",Ot)):(Ot=1,console.log("GSCVolumetricField - isHomeTeam is unknown type, using default:",Ot)),console.log("GSCVolumetricField - setting team filter directly from filterMultiple.isHomeTeam in forceSelectFilterUpdate:",Ot),m.value[0]=Ot,e.view.componentProps&&mt!==void 0&&(e.view.componentProps.isHomeTeamForAnalysis=mt===1,console.log("GSCVolumetricField - updated componentProps.isHomeTeamForAnalysis in forceSelectFilterUpdate:",e.view.componentProps.isHomeTeamForAnalysis)),p.nextTick(()=>{m.value=[...m.value],console.log("GSCVolumetricField - forced reactivity update in forceSelectFilterUpdate")})}else{console.log("GSCVolumetricField - team filter not found in forceSelectFilterUpdate!"),console.log("GSCVolumetricField - trying fallback: looking for any radio-button filter");const mt=T.value.findIndex(Ot=>Ot.type==="radio-button");if(mt!==-1){console.log("GSCVolumetricField - found radio-button filter at index:",mt);const Ot=e.view.filterMultiple.isHomeTeam;console.log("GSCVolumetricField - isHomeTeam type in fallback:",typeof Ot,"value:",Ot);let Vt;typeof Ot=="boolean"?(Vt=Ot?1:2,console.log("GSCVolumetricField - isHomeTeam is boolean in fallback, converting:",Ot,"-> teamValue:",Vt)):typeof Ot=="number"?(Vt=Ot===1?1:2,console.log("GSCVolumetricField - isHomeTeam is number in fallback, using directly:",Ot,"-> teamValue:",Vt)):(Vt=1,console.log("GSCVolumetricField - isHomeTeam is unknown type in fallback, using default:",Vt)),console.log("GSCVolumetricField - setting radio-button filter by fallback:",Vt),m.value[mt]=Vt,e.view.componentProps&&Ot!==void 0&&(e.view.componentProps.preMatchType=Ot,console.log("GSCVolumetricField - updated componentProps.preMatchType in fallback:",e.view.componentProps.preMatchType)),p.nextTick(()=>{m.value=[...m.value],console.log("GSCVolumetricField - forced reactivity update in fallback")})}else console.log("GSCVolumetricField - no radio-button filters found at all!")}}p.nextTick(()=>{b.value=!1,h.value=!1})}}function je(){if(console.log("FUNCION: forceRadioFilterUpdate"),h.value){console.log("Skipping forceRadioFilterUpdate - already in force update");return}if(u.value&&v&&v.dynamicFilters&&T.value){if(console.log("1"),y.value)return;h.value=!0,b.value=!0,v.dynamicFilters.forEach((ve,me)=>{var De,Ie;if(ve&&((De=T.value[me])==null?void 0:De.type)==="radio-button"&&(console.log("2"),ve.selectedOption&&ve.selectedOption.value!==void 0)){console.log("3"),console.log("filterData: ----------------->",ve),console.log("editFiltersJSON: ",v),console.log(`Force setting radio filter ${me} to:`,ve.selectedOption.value);const Ve=ve.selectedOption.value;m.value[me]=Ve,console.log(`Radio filter ${me} set to:`,Ve,"Type:",typeof Ve),((Ie=f.value)==null?void 0:Ie.id)===8&&(console.log("FieldPosesion - Radio filter updated to:",ve.selectedOption.value),console.log("FieldPosesion - Current dynamicFilters after update:",m.value))}}),p.nextTick(()=>{b.value=!1,h.value=!1})}}function Oe(){var ve,me,De,Ie,Ve,We,Ye,ke,ze,Fe,He,rt,nt,ht,vt,mt,Ot,Vt,qt,st,$e,lt,pt,At,_t,tt,ot,Xe,ct,kt,yt,It,Nt,Ze,et,bt,Lt,Rt,St,Ht,Ut,Yt,Wt,Gt,rr,ir;if(console.log("updateContainerOnUserChange function called"),console.log("filterAndViewsContainer:",x),console.log("isEditMode.value:",u.value),console.log("viewToEdit:",e),x&&u.value&&e){if(console.log("User made changes, updating container for specific component"),console.log("Current dynamicFilters:",m.value),console.log("Component ID:",(ve=e.view)==null?void 0:ve.id),console.log("Selected component ID:",(me=f.value)==null?void 0:me.id),y.value){console.log("Skipping container update due to container update in progress");return}if(b.value=!0,((De=f.value)==null?void 0:De.id)===4){if(console.log("Timeline - updateContainerOnUserChange - starting Timeline logic"),console.log("Timeline - current dynamicFilters:",m.value),console.log("Timeline - currentFilters:",T.value),x.setDynamicFilters(m.value,(Ie=e.view)==null?void 0:Ie.id),x.updateDynamicFilters(m.value,(Ve=e.view)==null?void 0:Ve.id),e.view.componentProps&&m.value&&m.value.length>0){const mr=m.value[0];if(console.log("Timeline - selectedEvents from dynamicFilters[0]:",mr),Array.isArray(mr)&&mr.length>0){const kr=mr.some(Fr=>Fr.event_type_id===1||typeof Fr=="string"&&Fr.includes("1")),wr=mr.some(Fr=>Fr.category_id===8||typeof Fr=="string"&&Fr.includes("8")),ar=mr.some(Fr=>Fr.category_id===9||typeof Fr=="string"&&Fr.includes("9")),xr=mr.some(Fr=>Fr.event_type_id===3||typeof Fr=="string"&&Fr.includes("3"));console.log("Timeline - Events check:",{goals:kr,yellowCards:wr,redCards:ar,substitutions:xr,selectedEvents:mr}),e.view.componentProps.selectedEvents=mr,e.view.componentProps.goals=kr,e.view.componentProps.yellowCards=wr,e.view.componentProps.redCards=ar,e.view.componentProps.substitutions=xr,e.view.componentProps.key=mr.length>0,e.view.componentProps._updateKey=Date.now(),console.log("Timeline - updated componentProps:",e.view.componentProps),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps}),console.log("Timeline - emitted force-component-update event")}}console.log("Timeline - updated specific filters for component:",(We=e.view)==null?void 0:We.id)}else if(((Ye=f.value)==null?void 0:Ye.id)===8)x.setDynamicFilters(m.value,(ke=e.view)==null?void 0:ke.id),x.updateDynamicFilters(m.value,(ze=e.view)==null?void 0:ze.id),console.log("FieldPosesion - updated specific filters for component:",(Fe=e.view)==null?void 0:Fe.id);else if(((He=f.value)==null?void 0:He.id)===3)x.setDynamicFilters(m.value,(rt=e.view)==null?void 0:rt.id),x.updateDynamicFilters(m.value,(nt=e.view)==null?void 0:nt.id),console.log("GSCMatchSummary - updated specific filters for component:",(ht=e.view)==null?void 0:ht.id);else if(((vt=f.value)==null?void 0:vt.id)===2){console.log("GSCtops - updateContainerOnUserChange - starting GSCtops logic"),console.log("GSCtops - current dynamicFilters:",m.value),console.log("GSCtops - currentFilters:",T.value),x.setDynamicFilters(m.value,(mt=e.view)==null?void 0:mt.id),x.updateDynamicFilters(m.value,(Ot=e.view)==null?void 0:Ot.id);const mr=m.value[0];if(console.log("GSCtops - newCategoryId from dynamicFilters[0]:",mr),mr!==void 0){e.view.filterMultiple||(e.view.filterMultiple={},console.log("GSCtops - created new filterMultiple object"));const wr=e.view.filterMultiple.categoryId;if(e.view.filterMultiple.categoryId=mr,console.log("GSCtops - updated filterMultiple.categoryId from",wr,"to:",mr),console.log("GSCtops - updated component filterMultiple:",e.view.filterMultiple),e.view.componentProps){let ar=`Category ${mr}`,xr=null;try{xr=Vd(mr),xr&&(ar=xr.name,console.log("GSCtops - found category info from getCategoryById:",xr))}catch{console.log("GSCtops - getCategoryById failed, using filter options");const Fr=T.value.findIndex(Er=>Er.type==="select-simple"&&Er.label==="Tipo de análisis");if(Fr!==-1){const Er=(((Vt=T.value[Fr])==null?void 0:Vt.options)||[]).find(vr=>vr.value==mr);Er&&(ar=Er.label,console.log("GSCtops - found category name from options:",ar))}}e.view.componentProps.categoryView=[{id:mr,name:ar}],console.log("GSCtops - updated componentProps.categoryView:",e.view.componentProps.categoryView),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps,filterMultiple:e.view.filterMultiple}),console.log("GSCtops - emitted force-component-update event")}}else console.log("GSCtops - newCategoryId is undefined!");const kr=m.value[1];if(console.log("GSCtops - newTeamType from dynamicFilters[1]:",kr),kr!==void 0){e.view.filterMultiple||(e.view.filterMultiple={},console.log("GSCtops - created new filterMultiple object for teamType"));const wr=e.view.filterMultiple.teamType;e.view.filterMultiple.teamType=kr,console.log("GSCtops - updated filterMultiple.teamType from",wr,"to:",kr),console.log("GSCtops - updated component filterMultiple:",e.view.filterMultiple),e.view.componentProps&&e.view.componentProps.game&&(kr===1?e.view.componentProps.teamView=e.view.componentProps.game.homeTeam.team_id:kr===2?e.view.componentProps.teamView=e.view.componentProps.game.awayTeam.team_id:e.view.componentProps.teamView=0,console.log("GSCtops - updated componentProps.teamView:",e.view.componentProps.teamView)),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps,filterMultiple:e.view.filterMultiple}),console.log("GSCtops - emitted force-component-update event for teamType")}else console.log("GSCtops - newTeamType is undefined!");console.log("GSCtops - updated specific filters for component:",(qt=e.view)==null?void 0:qt.id)}else if(((st=f.value)==null?void 0:st.id)===1){console.log("GSCComparativeReports - updateContainerOnUserChange - starting GSCComparativeReports logic"),console.log("GSCComparativeReports - current dynamicFilters:",m.value),console.log("GSCComparativeReports - currentFilters:",T.value),x.setDynamicFilters(m.value,($e=e.view)==null?void 0:$e.id),x.updateDynamicFilters(m.value,(lt=e.view)==null?void 0:lt.id);const mr=m.value[0];if(console.log("GSCComparativeReports - newCategory from dynamicFilters[0]:",mr),mr!==void 0){e.view.filterMultiple||(e.view.filterMultiple={},console.log("GSCComparativeReports - created new filterMultiple object"));const kr=e.view.filterMultiple.category;e.view.filterMultiple.category=mr,console.log("GSCComparativeReports - updated filterMultiple.category from",kr,"to:",mr),console.log("GSCComparativeReports - updated component filterMultiple:",e.view.filterMultiple),e.view.componentProps&&(e.view.componentProps.type=mr,console.log("GSCComparativeReports - updated componentProps.type:",e.view.componentProps.type)),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps,filterMultiple:e.view.filterMultiple}),console.log("GSCComparativeReports - emitted force-component-update event")}else console.log("GSCComparativeReports - newCategory is undefined!");console.log("GSCComparativeReports - updated specific filters for component:",(pt=e.view)==null?void 0:pt.id)}else if(((At=f.value)==null?void 0:At.id)===6){console.log("GSCLineupsReports - updateContainerOnUserChange - starting GSCLineupsReports logic"),console.log("GSCLineupsReports - current dynamicFilters:",m.value),console.log("GSCLineupsReports - currentFilters:",T.value),console.log("GSCLineupsReports - viewToEdit:",e),console.log("GSCLineupsReports - filterAndViewsContainer:",x),x.setDynamicFilters(m.value,(_t=e.view)==null?void 0:_t.id),x.updateDynamicFilters(m.value,(tt=e.view)==null?void 0:tt.id);const mr=m.value[0];if(console.log("GSCLineupsReports - newGameNumber from dynamicFilters[0]:",mr),mr!==void 0){e.view.filterMultiple||(e.view.filterMultiple={},console.log("GSCLineupsReports - created new filterMultiple object"));const kr=e.view.filterMultiple.gameNumber;e.view.filterMultiple.gameNumber=mr,console.log("GSCLineupsReports - updated filterMultiple.gameNumber from",kr,"to:",mr),console.log("GSCLineupsReports - updated component filterMultiple:",e.view.filterMultiple),e.view.componentProps&&(e.view.componentProps.gameNumber=mr,console.log("GSCLineupsReports - updated componentProps.gameNumber:",e.view.componentProps.gameNumber),e.view._updateKey,e.view._updateKey=Date.now(),console.log("GSCLineupsReports - updated _updateKey:",e.view._updateKey)),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps,filterMultiple:e.view.filterMultiple}),console.log("GSCLineupsReports - emitted force-component-update event"),Ei.emit("dynamic-filters-changed",{containerViewId:(ot=f.value)==null?void 0:ot.id,viewId:e.view.id,dynamicFilters:m.value}),console.log("GSCLineupsReports - emitted dynamic-filters-changed event"),Ei.emit("component-props-updated",{viewId:e.view.id,componentProps:e.view.componentProps,dynamicFilters:m.value}),console.log("GSCLineupsReports - emitted component-props-updated event"),p.nextTick(()=>{console.log("GSCLineupsReports - forcing reactivity update"),e.view.componentProps&&(e.view.componentProps={...e.view.componentProps})})}else console.log("GSCLineupsReports - newGameNumber is undefined!");console.log("GSCLineupsReports - updated specific filters for component:",(Xe=e.view)==null?void 0:Xe.id)}else if(((ct=f.value)==null?void 0:ct.id)===7){console.log("GSCGoalData - updateContainerOnUserChange - starting GSCGoalData logic"),console.log("GSCGoalData - current dynamicFilters:",m.value),console.log("GSCGoalData - currentFilters:",T.value),console.log("GSCGoalData - viewToEdit:",e),console.log("GSCGoalData - filterAndViewsContainer:",x),x.setDynamicFilters(m.value,(kt=e.view)==null?void 0:kt.id),x.updateDynamicFilters(m.value,(yt=e.view)==null?void 0:yt.id);const mr=m.value[0],kr=m.value[1];if(console.log("GSCGoalData - newAnalysisValue from dynamicFilters[0]:",mr),console.log("GSCGoalData - newTeamValue from dynamicFilters[1]:",kr),mr!==void 0&&e.view.componentProps){const wr=mr===1?"offensive":"defensive";e.view.componentProps.analysisType=wr,console.log("GSCGoalData - updated componentProps.analysisType to:",wr)}if(kr!==void 0){e.view.filterMultiple||(e.view.filterMultiple={},console.log("GSCGoalData - created new filterMultiple object"));const wr=e.view.filterMultiple.isHomeTeam,ar=kr===1;e.view.filterMultiple.isHomeTeam=ar,console.log("GSCGoalData - updated filterMultiple.isHomeTeam from",wr,"to:",ar),console.log("GSCGoalData - updated component filterMultiple:",e.view.filterMultiple),e.view.componentProps&&(e.view.componentProps.isHomeTeamForAnalysis=ar,console.log("GSCGoalData - updated componentProps.isHomeTeamForAnalysis:",e.view.componentProps.isHomeTeamForAnalysis),e.view._updateKey,e.view._updateKey=Date.now(),console.log("GSCGoalData - updated _updateKey:",e.view._updateKey)),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps,filterMultiple:e.view.filterMultiple}),console.log("GSCGoalData - emitted force-component-update event"),Ei.emit("dynamic-filters-changed",{containerViewId:(It=f.value)==null?void 0:It.id,viewId:e.view.id,dynamicFilters:m.value}),console.log("GSCGoalData - emitted dynamic-filters-changed event"),Ei.emit("component-props-updated",{viewId:e.view.id,componentProps:e.view.componentProps,dynamicFilters:m.value}),console.log("GSCGoalData - emitted component-props-updated event"),p.nextTick(()=>{console.log("GSCGoalData - forcing reactivity update"),e.view.componentProps&&(e.view.componentProps={...e.view.componentProps})})}else console.log("GSCGoalData - newTeamValue is undefined!");console.log("GSCGoalData - updated specific filters for component:",(Nt=e.view)==null?void 0:Nt.id)}else if(((Ze=f.value)==null?void 0:Ze.id)===5){console.log("GSCVolumetricField - updateContainerOnUserChange - starting GSCVolumetricField logic"),console.log("GSCVolumetricField - current dynamicFilters:",m.value),console.log("GSCVolumetricField - currentFilters:",T.value),console.log("GSCVolumetricField - viewToEdit:",e),console.log("GSCVolumetricField - filterAndViewsContainer:",x),x.setDynamicFilters(m.value,(et=e.view)==null?void 0:et.id),x.updateDynamicFilters(m.value,(bt=e.view)==null?void 0:bt.id);const mr=m.value[0];if(console.log("GSCVolumetricField - newTeamValue from dynamicFilters[0]:",mr),mr!==void 0){e.view.filterMultiple||(e.view.filterMultiple={},console.log("GSCVolumetricField - created new filterMultiple object"));const kr=e.view.filterMultiple.isHomeTeam,wr=mr===1?1:2;e.view.filterMultiple.isHomeTeam=wr,console.log("GSCVolumetricField - updated filterMultiple.isHomeTeam from",kr,"to:",wr),console.log("GSCVolumetricField - updated component filterMultiple:",e.view.filterMultiple),e.view.componentProps&&(e.view.componentProps.isHomeTeamForAnalysis=wr===1,console.log("GSCVolumetricField - updated componentProps.isHomeTeamForAnalysis:",e.view.componentProps.isHomeTeamForAnalysis),e.view._updateKey,e.view._updateKey=Date.now(),console.log("GSCVolumetricField - updated _updateKey:",e.view._updateKey)),Ei.emit("force-component-update",{itemId:e.view.id,componentProps:e.view.componentProps,filterMultiple:e.view.filterMultiple}),console.log("GSCVolumetricField - emitted force-component-update event"),Ei.emit("dynamic-filters-changed",{containerViewId:(Lt=f.value)==null?void 0:Lt.id,viewId:e.view.id,dynamicFilters:m.value}),console.log("GSCVolumetricField - emitted dynamic-filters-changed event"),Ei.emit("component-props-updated",{viewId:e.view.id,componentProps:e.view.componentProps,dynamicFilters:m.value}),console.log("GSCVolumetricField - emitted component-props-updated event"),p.nextTick(()=>{console.log("GSCVolumetricField - forcing reactivity update"),e.view.componentProps&&(e.view.componentProps={...e.view.componentProps})})}else console.log("GSCVolumetricField - newPreMatchType is undefined!");console.log("GSCVolumetricField - updated specific filters for component:",(Rt=e.view)==null?void 0:Rt.id)}else((St=f.value)==null?void 0:St.id)===9||(x.setDynamicFilters(m.value),x.updateDynamicFilters(m.value));((Ht=f.value)==null?void 0:Ht.id)===8&&console.log("FieldPosesion - Container updated with dynamicFilters:",m.value),((Ut=f.value)==null?void 0:Ut.id)===3&&console.log("GSCMatchSummary - Container updated with dynamicFilters:",m.value),((Yt=f.value)==null?void 0:Yt.id)===2&&console.log("GSCtops - Container updated with dynamicFilters:",m.value),((Wt=f.value)==null?void 0:Wt.id)===1&&console.log("GSCComparativeReports - Container updated with dynamicFilters:",m.value),((Gt=f.value)==null?void 0:Gt.id)===6&&console.log("GSCLineupsReports - Container updated with dynamicFilters:",m.value),((rr=f.value)==null?void 0:rr.id)===5&&console.log("GSCVolumetricField - Container updated with dynamicFilters:",m.value),((ir=f.value)==null?void 0:ir.id)===9&&console.log("GSCFieldDataByZones - Container updated with dynamicFilters:",m.value),p.nextTick(()=>{b.value=!1,console.log("updateContainerOnUserChange completed")})}else console.log("updateContainerOnUserChange - conditions not met"),console.log("filterAndViewsContainer exists:",!!x),console.log("isEditMode.value:",u.value),console.log("viewToEdit exists:",!!e)}function ge(){var ve,me,De;if(!v||!v.dynamicFilters||!T.value)return!1;for(let Ie=0;Ie<v.dynamicFilters.length;Ie++){const Ve=v.dynamicFilters[Ie],We=T.value[Ie],Ye=m.value[Ie];if(!(!Ve||!We)){if(We.type==="check"){if(Ve.isChecked!==Ye)return console.log(`Check filter ${Ie} needs update: saved=${Ve.isChecked}, current=${Ye}`),!0}else if(We.type==="radio-button"){if(((ve=Ve.selectedOption)==null?void 0:ve.value)!==Ye)return console.log(`Radio filter ${Ie} needs update: saved=${(me=Ve.selectedOption)==null?void 0:me.value}, current=${Ye}`),!0}else if(We.type==="select"){const ke=((De=Ve.selectedOptions)==null?void 0:De.map(Fe=>Fe.value))||Ve.selectedValue||[],ze=Array.isArray(Ye)?Ye:[];if(JSON.stringify(ke)!==JSON.stringify(ze))return console.log(`Select filter ${Ie} needs update: saved=${JSON.stringify(ke)}, current=${JSON.stringify(ze)}`),!0}}}return console.log("No force update needed - values already match"),!1}return(ve,me)=>(p.openBlock(),p.createElementBlock("div",$le,[p.createElementVNode("button",ece,p.toDisplayString(u.value?"Editando visualización":"Nueva visualización"),1),p.createElementVNode("div",{class:p.normalizeClass(["custom-select main-select",{disabled:u.value}]),onClick:ne},[p.createElementVNode("div",tce,[p.createElementVNode("span",rce,[d.value?(p.openBlock(),p.createElementBlock("img",{key:0,src:q(d.value.name,!1),alt:"icono",class:"option-img"},null,8,nce)):(p.openBlock(),p.createElementBlock("img",ice))]),d.value?(p.openBlock(),p.createElementBlock("span",oce,p.toDisplayString(W()),1)):(p.openBlock(),p.createElementBlock("span",ace,"Tipo de vista")),p.createElementVNode("span",{class:p.normalizeClass(["arrow",{open:R.value}])},[...me[4]||(me[4]=[p.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[p.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),R.value?(p.openBlock(),p.createElementBlock("div",sce,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.value,(De,Ie)=>(p.openBlock(),p.createElementBlock("div",{key:De.id,class:p.normalizeClass(["option-card",{active:i.value===Ie}]),onClick:p.withModifiers(Ve=>re(Ie),["stop"])},[p.createElementVNode("div",cce,[p.createElementVNode("img",{src:q(De.name,!1),"data-hover-src":q(De.name,!0),alt:"icono",class:"option-img-34"},null,8,uce)]),p.createElementVNode("div",dce,[p.createElementVNode("div",hce,p.toDisplayString(De.name),1),De.description?(p.openBlock(),p.createElementBlock("div",pce,p.toDisplayString(De.description),1)):p.createCommentVNode("",!0)])],10,lce))),128))])):p.createCommentVNode("",!0)],2),d.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(["custom-select second-select",{disabled:u.value}]),onClick:X},[p.createElementVNode("div",fce,[p.createElementVNode("span",mce,[f.value?(p.openBlock(),p.createElementBlock("img",{key:0,src:f.value.url,alt:"icono",class:"option-img-graph2"},null,8,gce)):d.value?(p.openBlock(),p.createElementBlock("img",{key:1,src:q(d.value.name,!1),alt:"icono",class:"option-img"},null,8,yce)):p.createCommentVNode("",!0)]),p.createElementVNode("span",vce,p.toDisplayString(Z()),1),p.createElementVNode("span",{class:p.normalizeClass(["arrow",{open:z.value}])},[...me[5]||(me[5]=[p.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[p.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),z.value&&d.value?(p.openBlock(),p.createElementBlock("div",bce,[p.createElementVNode("div",xce,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(s.value,De=>(p.openBlock(),p.createElementBlock("div",{key:De.id,class:p.normalizeClass(["option-card-grid",{active:c.value===De.id}]),onClick:p.withModifiers(Ie=>ee(De),["stop"])},[p.createElementVNode("div",wce,p.toDisplayString(De.name||De.title),1),p.createElementVNode("div",Tce,[p.createElementVNode("img",{src:De.url,alt:"icono",class:"option-img-grid"},null,8,kce)])],10,_ce))),128))])])):p.createCommentVNode("",!0)],2)):p.createCommentVNode("",!0),f.value?(p.openBlock(),p.createElementBlock("div",Sce)):p.createCommentVNode("",!0),f.value&&T.value&&A()?(p.openBlock(),p.createElementBlock("div",{key:2,class:p.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":T.value.length>=2}])},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(T.value,(De,Ie)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:Ie},[De.type==="select"?(p.openBlock(),p.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:p.withModifiers(Ve=>K(Ie),["stop"])},[p.createElementVNode("div",Ace,[me[7]||(me[7]=p.createElementVNode("span",{class:"select-icon select-analisis-icon"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),me[8]||(me[8]=p.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(m.value[Ie])&&m.value[Ie].length>0?(p.openBlock(),p.createElementBlock("span",Cce,p.toDisplayString(m.value[Ie].length),1)):p.createCommentVNode("",!0),p.createElementVNode("span",{class:p.normalizeClass(["arrow",{open:V.value===Ie}])},[...me[6]||(me[6]=[p.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[p.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),V.value===Ie?(p.openBlock(),p.createElementBlock("div",Mce,[p.createElementVNode("div",Pce,[p.createElementVNode("div",{class:"multi-select-header",onClick:me[1]||(me[1]=p.withModifiers(()=>{},["stop"]))},[p.createElementVNode("label",Nce,[p.createElementVNode("input",{type:"checkbox",checked:P(Ie),indeterminate:N(Ie),onChange:p.withModifiers(Ve=>I(Ie),["stop"]),onClick:me[0]||(me[0]=p.withModifiers(()=>{},["stop"]))},null,40,Oce),me[9]||(me[9]=p.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(De.options,Ve=>(p.openBlock(),p.createElementBlock("div",{key:Ve.value,class:p.normalizeClass(["option-card multi-select-option",{active:E(Ie,Ve.value)}]),onClick:me[2]||(me[2]=p.withModifiers(()=>{},["stop"]))},[p.createElementVNode("div",Ice,[p.createElementVNode("input",{type:"checkbox",checked:E(Ie,Ve.value),onChange:p.withModifiers(We=>S(Ie,Ve.value),["stop"])},null,40,Rce)]),p.createElementVNode("div",{class:"option-content",onClick:We=>S(Ie,Ve.value)},[p.createElementVNode("div",zce,p.toDisplayString(Ve.label),1)],8,Lce)],2))),128))]),p.createElementVNode("div",Dce,[p.createElementVNode("button",{class:"btn-listo",onClick:me[3]||(me[3]=p.withModifiers(Ve=>Me(),["stop"]))},"Listo")])])):p.createCommentVNode("",!0)],8,Ece)):De.type==="radio-button"?(p.openBlock(),p.createElementBlock("div",Bce,[p.createElementVNode("div",Vce,p.toDisplayString(De.label),1),p.createElementVNode("div",Fce,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(De.options,Ve=>(p.openBlock(),p.createElementBlock("label",{key:Ve.value,class:p.normalizeClass(["radio-option-card",{active:m.value[Ie]===Ve.value}])},[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"dynamic-radio-"+Ie,value:Ve.value,"onUpdate:modelValue":We=>m.value[Ie]=We,disabled:k(Ve.value,Ve.label),onChange:()=>{var We,Ye,ke;if(console.log("Radio button changed for GSCFieldDataByZones:",m.value[Ie]),((We=f.value.value)==null?void 0:We.id)===9&&u.value.value&&(ke=(Ye=p.unref(e))==null?void 0:Ye.view)!=null&&ke.filterMultiple){const ze=m.value[Ie]===1;p.unref(e).view.filterMultiple.isHomeTeam=ze,console.log("GSCFieldDataByZones - preserved radio-button value in filterMultiple:",ze)}u.value.value&&Oe(),he()}},null,40,jce),[[p.vModelRadio,m.value[Ie]]]),p.createElementVNode("span",null,p.toDisplayString(Ve.label),1)],2))),128))])])):De.type==="check"?(p.openBlock(),p.createElementBlock("div",Uce,[p.createElementVNode("label",null,[p.withDirectives(p.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":Ve=>m.value[Ie]=Ve,checked:m.value[Ie],onChange:()=>{console.log(`Checkbox ${Ie} changed to:`,m.value[Ie]),u.value.value&&Oe(),he()}},null,40,qce),[[p.vModelCheckbox,m.value[Ie]]]),p.createTextVNode(" "+p.toDisplayString(De.label),1)])])):De.type==="select-simple"?(p.openBlock(),p.createElementBlock("div",{key:3,class:"custom-select dynamic-select filter-inline","data-filter-type":De.type,onClick:p.withModifiers(Ve=>te(Ie),["stop"])},[p.createElementVNode("div",Gce,[me[11]||(me[11]=p.createElementVNode("span",{class:"select-icon select-analisis-icon"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),me[12]||(me[12]=p.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),p.createElementVNode("span",{class:p.normalizeClass(["arrow",{open:U.value===Ie}])},[...me[10]||(me[10]=[p.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[p.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),U.value===Ie?(p.openBlock(),p.createElementBlock("div",Hce,[p.createElementVNode("div",Xce,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(De.options,Ve=>(p.openBlock(),p.createElementBlock("div",{key:Ve.value,class:p.normalizeClass(["option-card simple-select-option",{active:m.value[Ie]===Ve.value}]),onMouseenter:We=>Te(Ie,Ve.value),onClick:p.withModifiers(We=>ae(Ie,Ve.value),["stop"])},[p.createElementVNode("div",Jce,[p.createElementVNode("div",Kce,p.toDisplayString(Ve.label),1)]),m.value[Ie]===Ve.value?(p.openBlock(),p.createElementBlock("div",Zce,[...me[13]||(me[13]=[p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[p.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)],42,Yce))),128))])])):p.createCommentVNode("",!0)],8,Wce)):p.createCommentVNode("",!0),Ie===1&&T.value.length>2?(p.openBlock(),p.createElementBlock("div",Qce)):p.createCommentVNode("",!0)],64))),128))],2)):p.createCommentVNode("",!0),u.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("button",{key:3,class:"cancel-btn",onClick:xe},"Cancelar")),t.value?(p.openBlock(),p.createElementBlock("button",{key:4,class:"ok-btn",onClick:_e},"OK")):p.createCommentVNode("",!0)]))}}),eue=dd($ce,[["__scopeId","data-v-ec3ff35f"]]),tue={key:0,class:"modal-simple"},rue={class:"modal-simple__content"},nue={class:"modal-simple__content__header"},iue={class:"modal-simple__content__body"},aue={class:"modal-simple__content__footer"},oue={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(r){return(a,g)=>(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[r.modelValue?(p.openBlock(),p.createElementBlock("div",tue,[p.createElementVNode("div",rue,[p.createElementVNode("div",nue,[p.renderSlot(a.$slots,"header",{},void 0,!0)]),p.createElementVNode("div",iue,[p.renderSlot(a.$slots,"body",{},void 0,!0)]),p.createElementVNode("div",aue,[p.renderSlot(a.$slots,"footer",{},void 0,!0)])])])):p.createCommentVNode("",!0)]))}},sue=dd(oue,[["__scopeId","data-v-1cc4f590"]]),lue={class:"footer"},cue={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(r,{emit:a}){const g=a;function B(C){g("update:modelValue",C)}function J(C){g("action",C),g("update:modelValue",!1)}return(C,x)=>(p.openBlock(),p.createBlock(sue,{"modle-value":r.value,"onUpdate:modelValue":B},{header:p.withCtx(()=>[...x[2]||(x[2]=[p.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:p.withCtx(()=>[...x[3]||(x[3]=[p.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:p.withCtx(()=>[p.createElementVNode("div",lue,[p.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:x[0]||(x[0]=e=>J(!1))}," Seguir editando "),p.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:x[1]||(x[1]=e=>J(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},uue=dd(cue,[["__scopeId","data-v-ed9b5088"]]),due={key:0,class:"modal-simple"},hue={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(r){return(a,g)=>(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[p.createVNode(p.Transition,null,{default:p.withCtx(()=>[r.modelValue?(p.openBlock(),p.createElementBlock("div",due,[...g[0]||(g[0]=[p.createElementVNode("div",{class:"modal-simple__content"},[p.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M29.3346 14.7823V16.0089C29.333 18.8842 28.402 21.6818 26.6804 23.9847C24.9589 26.2876 22.539 27.9722 19.7818 28.7875C17.0245 29.6027 14.0776 29.5048 11.3806 28.5084C8.68354 27.512 6.38084 25.6704 4.81592 23.2584C3.25099 20.8463 2.50769 17.993 2.69687 15.124C2.88605 12.255 3.99758 9.52404 5.86568 7.33836C7.73377 5.15269 10.2583 3.62944 13.0629 2.9958C15.8674 2.36215 18.8017 2.65205 21.428 3.82227",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),p.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):p.createCommentVNode("",!0)]),_:1})]))}},pue=dd(hue,[["__scopeId","data-v-2bc30783"]]),fue={class:"template-maker__header"},mue={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},gue={class:"template-maker__content"},yue={class:"template-maker__content__main"},vue={id:"containerMain",class:"container-main"},bue={class:"template-maker__content__main__cover-selector"},xue=["id"],_ue={class:"page-indicator"},wue={class:"page-indicator__index"},Tue=["onClick"],kue=["onClick"],Sue={key:0,class:"template-maker__content__main__footer"},Eue={class:"template-maker__content__main__footer__paginator"},Aue={class:"template-maker__content__main__footer__paginator__nav"},Cue={class:"template-maker__content__main__footer__paginator__numbers"},Mue=["onClick"],Pue={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(r,{expose:a,emit:g}){const B=new Map,J=p.ref([{title:"Page 1",id:String(Date.now()),items:[{name:"Volumetrica",id:`w-${String(Date.now())}`,x:0,y:0,w:4,h:6,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}},{name:"Volumetrica",id:String(Date.now()),x:4,y:0,w:4,h:4,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}}]}]),C=p.ref(null),x=p.ref(0),e=p.ref(!1),v=p.ref(null),u=p.ref(null),t=p.ref(!0),w=p.ref(!1),y=p.ref(!1),b=p.ref(0),h=p.ref(!1),n=p.ref(null),i=p.ref(new Map),d=p.ref(null),s=p.ref(null),c=p.ref(!1),f=p.ref(!1),m=p.ref(!1),T=p.computed(()=>({"--overflow-y-template-maker":w.value?"scroll":"hidden","--height-container-main":w.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(w.value,"0")})),E=p.computed(()=>x.value+1);p.watch(()=>e.value,Te=>{const Ce=document.getElementById("app");Te?(x.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",Ce&&(Ce.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",Ce&&(Ce.style.overflow=""))});function S(Te){return Te<10?`0${Te}`:Te}async function P({templateId:Te,userId:Ce}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Ce}/templates/${Te}`,{method:"GET",headers:{Authorization:K.token}})).json()).data}catch(Ne){console.error("Error fetching template by ID:",Ne)}}async function N({reportId:Te,userId:Ce}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Ce}/reports/${Te}`,{method:"GET",headers:{Authorization:K.token}})).json()).data}catch(Ne){console.error("Error fetching report by ID:",Ne)}}let A=0;function O(Te){C.value=Te,A>0&&(c.value=!0),A++}function M(Te){Te&&oe(null,!0)}let k=null;function I(Te,Ce){let Ne=Te.getBoundingClientRect(),Re={height:Te.clientHeight,width:Te.clientWidth},Ge=Ce.getBoundingClientRect();if(!(Ge.top>=Ne.top&&Ge.bottom<=Ne.top+Re.height)){const Pe=Ge.top-Ne.top,je=Ge.bottom-Ne.bottom;Math.abs(Pe)<Math.abs(je)?Te.scrollTop+=Pe:Te.scrollTop+=je}}function _(Te,Ce){let Ne=Te.getBoundingClientRect();const Re=Ce.getBoundingClientRect().top-Ne.top;Te.scrollTop+=Re}function R(Te,Ce=!1){const Ne={title:`Page ${J.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(ye(),Te!==void 0&&Te>=-1?J.value.splice(Te+1,0,Ne):J.value.push(Ne),p.nextTick(()=>{const Re=J.value.findIndex(Pe=>Pe.id===Ne.id),Ge=document.getElementById(`page-${Re+1}`);k||(k=document.getElementById("containerMain")),Ge&&k?I(k,Ge):console.error("Page element or container main element not found")}),Ce)return Ne;c.value=!0}function z(Te){if(console.log("onClickPage",Te),Te<0||Te>J.value.length){console.log("Invalid page index:",Te,"Valid range: 0 to",J.value.length);return}x.value=Te;const Ce=document.getElementById(`page-${Te}`);if(console.log("pageElement found:",Ce),k||(k=document.getElementById("containerMain")),console.log("containerMainEl found:",k),Ce&&k){const Ne=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(Ne),_(k,Ce),setTimeout(()=>{const Re=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Re)},300)}else console.error("Page element or container main element not found")}function V(Te){d.value=Te,h.value=!0}function U(Te,Ce){const Ne=Ce+1;Te&&x.value!==Ne&&(x.value=Ne)}function q(Te){h.value=!0,Ei.emit("edit-view",{view:Te})}async function W({templateReportId:Te,userId:Ce,isTemplateMode:Ne}){try{return Ne?P({templateId:Te,userId:Ce}):N({reportId:Te,userId:Ce})}catch(Re){throw new Error("Error fetching template or report by ID: "+Re.message)}}function Z(){A=0,h.value=!1,x.value=0,d.value=null,s.value=null,i.value.clear(),k=null}async function ne(Te){if(console.log("show, initialConfig",Te),Z(),t.value=Te.isTemplateMode,console.log("****************************************** isTemplateMode.value",t.value),w.value=!!Te.isPDFMode,Te.isPDFMode?v.value=await N({reportId:Te.reportId,userId:Te.userId}):(v.value=Te.template,v.value=await W({templateReportId:Te.template.id,userId:Te.template.user_id,isTemplateMode:Te.isTemplateMode})),!v.value)return;v.value&&v.value.game&&(v.value.game=ae(v.value.game)),console.log("templateToEdit.value",v.value),u.value=JSON.parse(JSON.stringify(v.value)),y.value=v.value.template_type===2;const Ce=v.value.pages.find(Ne=>Ne.is_front_page);b.value=Ce?Ce.type:1,e.value=!0,J.value=v.value.pages.reduce((Ne,Re,Ge)=>{if(!Re.is_front_page){Re.name||(Re.name="");const Pe={originalPage:JSON.parse(JSON.stringify(Re)),title:Re.name,id:`p-${Date.now()-Ge*9}`,items:[],components:Re.components};Re.components&&Re.components.length>0&&(Pe.items=Re.components.map((je,Oe)=>{const ge=new Up(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],je.coreView.id,je.dynamicFilters,y.value,t.value,je.filtersJSON||null,K.token),ve={originalComponent:JSON.parse(JSON.stringify(je)),title:je.title,shortTitle:je.shortTitle||je.title,game:v.value.game,idAux:je.id,id:`w-${Date.now()-Oe*7}`,x:je.column,y:je.row,w:je.colspan,h:je.rowspan,maxWidth:je.max_column,maxHeight:je.max_row,minWidth:je.min_column,minHeight:je.min_row,noResize:!t.value,noMove:!t.value,coreView:je.coreView||null,isTemplateMode:t.value,componentName:je.componentName,componentProps:ee({currentProps:je.componentProps,coreView:je.coreView,isTemplateMode:t.value,templateToEdit:v.value,filterMultiple:je.filterMultiple||null,game:v.value.game||null})||{},filterMultiple:je.filterMultiple,isHomeTeam:re({game:v.value.game,isTemplateMode:t.value,currentIsHomeTeam:je.isHomeTeam||je.componentProps.isHomeTeamForAnalysis}),filtersJSON:je.filtersJSON||null,dynamicFilters:je.dynamicFilters||[],filterAndViewsContainer:ge},me=p.reactive({view:ve});return ge.addView(me,!0),i.value.set(ge.getId(),ge),ve})),Ne.push(Pe)}return Ne},[]),console.log("pages.value",J.value),console.log("isvisible.value",e.value)}function X({game:Te,isTemplateMode:Ce}){const Ne=Te&&Te.homeTeam&&Te.awayTeam&&(Te.homeTeam.team_id===K.userTeamId||Te.awayTeam.team_id===K.userTeamId);return{isUserTeamHome:Ne&&Te.homeTeam.team_id===K.userTeamId,requiresUserTeamAdjustment:Ne&&!Ce}}function re({game:Te,isTemplateMode:Ce,currentIsHomeTeam:Ne}){const{isUserTeamHome:Re,requiresUserTeamAdjustment:Ge}=X({game:Te,isTemplateMode:Ce});return Ge?Ne?Re:!Re:Ne}function ee({currentProps:Te,coreView:Ce,templateToEdit:Ne,isTemplateMode:Re,filterMultiple:Ge,game:Pe}){if(!Te||!Ce)return Te||{};const{isUserTeamHome:je,requiresUserTeamAdjustment:Oe}=X({game:Pe,isTemplateMode:Re}),ge={...Te};if(Ce.id===5&&(ge.isGhostEffect=Re,Oe)){const ve=ge.preMatchType===1;ge.preMatchType=ve?je?1:2:je?2:1}if(Ce.id===7&&Oe){const ve=ge.isHomeTeamForAnalysis;ge.isHomeTeamForAnalysis=ve?je:!je}if(Ce.id===9&&Oe){const ve=ge.isHomeTeamForAnalysis;ge.isHomeTeamForAnalysis=ve?je:!je}if(Ce.id===10&&Oe){const ve=ge.isHomeTeamForAnalysis;ge.isHomeTeamForAnalysis=ve?je:!je}if(Ce.id===1&&(ge.gameId=Pe?Pe.id:"",ge.homeLogo=Pe?Pe.homeTeam.logo:"",ge.awayLogo=Pe?Pe.awayTeam.logo:"",ge.seasonId=Pe?Pe.season_id:0,ge.default=Re),Ce.id===6&&(ge.game=Pe||"",ge.lastGames=Ne.last_games,ge.selectedOption=Ne.template_type===2?"Postmatch":"Prematch"),Ce.id===3&&(ge.defaultShields=Re),Ce.id===2){let ve=!0,me=0,De=0;Pe&&(ve=Ne.main_team==Pe.home_team||Ne.main_team==Pe.visiting_team,me=ve?Ne.main_team==(Pe==null?void 0:Pe.home_team)?Pe==null?void 0:Pe.home_team:Pe==null?void 0:Pe.visiting_team:Pe==null?void 0:Pe.home_team,De=ve?Ne.main_team==(Pe==null?void 0:Pe.home_team)?Pe==null?void 0:Pe.visiting_team:Pe==null?void 0:Pe.home_team:Pe==null?void 0:Pe.visiting_team),console.log("<- 1 -> ******************** component props //////////////////////////////////",Te),console.log("<- 2 -> ********************",Ce),console.log("<- 3 -> ********************",Ne),console.log("<- 4 -> ********************",Ge),ge.gamed=Pe?Pe.id:"",ge.game=Pe||"",ge.season=Pe?Pe.season_id:0,ge.teamView=Ge.teamType==3?0:Ge.teamType==1?me:De,ge.useDummyData=Re}return Ce.id===8&&(ge.teamSelected=Pe?{teamId:Pe.home_team}:1,ge.isDefault=Re),Ce.id===4&&(ge.gameId=Pe?Pe.id:"",ge.isDefault=Re,ge.homeTeam=Pe?Pe==null?void 0:Pe.home_team:"",ge.awayTeam=Pe?Pe==null?void 0:Pe.visiting_team:""),Pe&&(ge.game=Pe),ge}const K=r,te=g;p.watch(()=>K.token,(Te,Ce)=>{console.log("Token changed:",{newToken:Te,oldToken:Ce})},{immediate:!0}),a({show:ne}),Ei.on("add-page-view",Te=>{console.log("88888888888888888888888888888888888888888888888888888888888888888"),console.log("viewConfig",Te),B.set(Te.view.id,Te.view);const Ce=J.value.find(Ne=>Ne.id===Te.pageId);Ce&&(Ce.items||(Ce.items=[]),Ce.items.push(Te.view),p.nextTick(()=>{const Ne=document.querySelector(`[gs-id="${Te.view.id}"]`);Te.grid.makeWidget(Ne)}))}),Ei.on("add-page-and-view",Te=>{const Ce=J.value.findIndex(Ne=>Ne.id===Te.pageId);if(Ce>-1){const Ne=R(Ce,!0);setTimeout(()=>{Ei.emit("add-view",{pageId:Ne.id,view:Te.view,filterAndWidgetContainer:Te.filterAndWidgetContainer}),s.value&&(Ne.stepBackPage=s.value),s.value=Ne},500)}else console.error("Page not found for adding view:",Te.pageId)}),Ei.on("empty-page",Te=>{h.value&&d.value&&d.value.id===Te.id||(_e(Te),s.value&&s.value.id===Te.id&&(s.value.stepBackPage?s.value=s.value.stepBackPage:s.value=null))}),Ei.on("filters-cancelled",Te=>{Te&&Te.removeAllChildViews()}),Ei.on("activate-save-button",()=>{console.log("GSC-TemplateReportMaker - activate-save-button event received"),c.value=!0,console.log("GSC-TemplateReportMaker - isSaveActive set to true")});function ae(Te){return{...Te,gameId:Te.game_id,id:Te.game_id,seasonId:Te.season_id,status:Te.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${Te.home_team}.png`,team_id:Te.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${Te.home_team}.png`,colloquial_name:Te.home_team_name,acronym:Te.home_team_acronym,team_name:Te.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${Te.visiting_team}.png`,team_id:Te.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${Te.visiting_team}.png`,colloquial_name:Te.visiting_team_name,acronym:Te.visiting_team_acronym,team_name:Te.visiting_team_name}}}function oe(Te,Ce=!1){Ce||!t.value?(e.value=!1,Z(),te("close")):c.value?f.value=!0:(e.value=!1,Z(),te("close"))}function he(){n.value=null,h.value=!1}function fe({page:Te,view:Ce,applyMinimumSize:Ne=!1}){const Re=Te.grid;if(!Te||!Ce||!Re)return null;const Ge=Ne?{w:Ce.min_column,h:Ce.min_row}:{w:Ce.colspan,h:Ce.rowspan},Pe=Re.willItFit(0,0,Ge.w,Ge.h,!0);return Pe?{willFit:Pe,applyMinimumSize:Ne}:Ne?null:fe({page:Te,view:Ce,applyMinimumSize:!0})}const se=new Set([9]);function ue(Te){var Ce,Ne,Re,Ge,Pe,je,Oe;if(console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"),console.log("onFiltersChanged",Te),Te.dynamicFilters&&Te.dynamicFilters.length>0&&Te.viewToEdit&&Te.viewToEdit.view){const ge=Te.viewToEdit.view.id;J.value.forEach(ve=>{ve.items.forEach(me=>{me.id===ge&&me.coreView&&me.coreView.id===3&&(me.componentProps.desplegable=Te.dynamicFilters[0]||!1,me.componentProps.key=Te.dynamicFilters[0]||!1,p.nextTick(()=>{Ei.emit("force-component-update",{itemId:me.id,componentProps:me.componentProps})}))})})}if(console.log("filters.viewToEdit",Te.viewToEdit),Te.viewToEdit){if(!Te.viewToEdit.view.filterAndViewsContainer){const ge=new Up(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[Te.viewToEdit],((Ce=Te.viewToEdit.view.coreView)==null?void 0:Ce.id)||Te.viewToEdit.view.id,Te.dynamicFilters||[],y.value,t.value,Te.filtersJSON,K.token);Te.viewToEdit.view.filterAndViewsContainer=ge}Te.viewToEdit.view.filterAndViewsContainer.updateView({view:Te.viewToEdit,dynamicFilters:Te.dynamicFilters||[],filtersJSON:Te.filtersJSON||null}),c.value=!0}else if(Te.view){Te.view.id&&Te.filterAndViewsContainer&&Te.view.id!==Te.filterAndViewsContainer.viewId&&(Te.filterAndViewsContainer.removeAllChildViews(),Te.filterAndViewsContainer.setViewId(Te.view.id),Te.filterAndViewsContainer.setFiltersJSON(Te.filtersJSON||null)),Te.view.id&&se.has(Te.view.id)&&Te.dynamicFilters[0]&&Te.dynamicFilters[0].length===0&&Te.filterAndViewsContainer&&(Te.filterAndViewsContainer.updateDynamicFilters(Te.dynamicFilters,(Re=(Ne=Te.viewToEdit)==null?void 0:Ne.view)==null?void 0:Re.id),c.value=!0);const ge=s.value||d.value,ve=fe({page:ge,view:Te.view,applyMinimumSize:!1});Te.view.filtersJSON=Te.filtersJSON||null;const me=Te.filterAndViewsContainer,De=J.value.findIndex(Ie=>Ie.id===ge.id);if(me){const Ie=Te.filterAndViewsContainer.getRequiresAddView(Te.dynamicFilters);console.log("111111111111111111111111111111111"),console.log("requiersAddView",Ie),Ie?(me.setDynamicFilters(Te.dynamicFilters),(ve||De===J.value.length-1)&&(Ei.emit("add-view",{pageId:ge.id,view:Te.view,filterAndWidgetContainer:me,avoidWillFit:!1,applyMinimumSize:ve?ve.applyMinimumSize:!1,dynamicFilters:Te.dynamicFilters}),Te.filterAndViewsContainer.updateDynamicFilters(Te.dynamicFilters,(Pe=(Ge=Te.viewToEdit)==null?void 0:Ge.view)==null?void 0:Pe.id),c.value=!0,setTimeout(()=>{Te.filterAndViewsContainer.getRequiresAddView(Te.dynamicFilters)?(console.log("GSCtops - still requires add view, calling recursively"),ue(Te)):console.log("GSCtops - no more views needed, stopping recursion")},1e3))):(Te.filterAndViewsContainer.updateDynamicFilters(Te.dynamicFilters,(Oe=(je=Te.viewToEdit)==null?void 0:je.view)==null?void 0:Oe.id),c.value=!0)}else if(ve||De===J.value.length-1){const Ie=new Up(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],Te.view.id,Te.dynamicFilters,y.value,t.value,Te.filtersJSON,K.token);Ei.emit("set-filter-and-views-container",Ie),i.value.set(Ie.getId(),Ie),Te.dynamicFilters&&Array.isArray(Te.dynamicFilters[0])?(Te.filterAndViewsContainer=Ie,ue(Te)):Ei.emit("add-view",{pageId:ge.id,view:Te.view,filterAndWidgetContainer:Ie,avoidWillFit:!1,applyMinimumSize:ve?ve.applyMinimumSize:!1,dynamicFilters:Te.dynamicFilters}),c.value=!0}}}async function de(){if(c.value)try{const Te=[{is_front_page:!0,template_type:C.value.isPostMatch?2:1,type:C.value.id},...J.value.map(Ne=>({columns:Ne.originalPage?Ne.originalPage.columns:12,rows:Ne.originalPage?Ne.originalPage.rows:12,gap:Ne.originalPage?Ne.originalPage.gap:10,name:Ne.title,width:Ne.originalPage?Ne.originalPage.width:968,height:Ne.originalPage?Ne.originalPage.height:702,components:Ne.items.map(Re=>({min_column:Re.minWidth,min_row:Re.minHeight,max_column:Re.maxWidth,max_row:Re.maxHeight,column:Re.x,row:Re.y,colspan:Re.w,rowspan:Re.h,name:Re.name,title:Re.title,titleShort:Re.titleShort||Re.title,dynamicFilters:Re.filterAndViewsContainer.getComponentDynamicFilters(Re.id)||Re.filterAndViewsContainer.getDynamicFilters()||[],coreView:Re.coreView||null,componentName:Re.componentName,componentProps:Re.componentProps||{},isHomeTeam:Re.isHomeTeam||Re.componentProps.isHomeTeamForAnalysis,filterMultiple:Re.filterMultiple}))}))];console.log("pagesAuxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),console.log(Te);const Ce=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${v.value.user_id}/templates/${v.value.id}/pages`,{method:"PATCH",headers:{Authorization:K.token},body:JSON.stringify({pages:Te})});m.value=!0,await Ce.json(),c.value=!1,setTimeout(()=>{m.value=!1},2e3)}catch(Te){console.error("Error saving template:",Te)}}function ye(){J.value.forEach(Te=>{Te.offListeners&&Te.offListeners()})}function _e(Te){const Ce=J.value.findIndex(Ne=>Ne.id===Te.id);Ce>-1&&(ye(),J.value=J.value.filter(Ne=>Ne.id!==Te.id),x.value>=Ce&&(x.value=Math.max(0,x.value-1)),c.value=!0)}function xe(){c.value=!0}function Se(Te){const Ce=J.value.find(Ne=>Ne.items.some(Re=>Re.id===Te.id));if(Ce){const Ne=Ce.items.findIndex(Re=>Re.id===Te.id);Ne!==-1&&(Ce.items.splice(Ne,1),c.value=!0)}}function Me(Te){console.log("onChangeSort",Te)}return(Te,Ce)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(uue,{modelValue:f.value,"onUpdate:modelValue":Ce[0]||(Ce[0]=Ne=>f.value=Ne),onAction:M},null,8,["modelValue"]),p.createVNode(pue,{"model-value":m.value},null,8,["model-value"]),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[e.value&&v.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:"template-maker",style:p.normalizeStyle(T.value)},[p.withDirectives(p.createVNode(eue,{token:r.token,view:n.value,"is-post-match":y.value,onClose:he,onFiltersChanged:ue},null,8,["token","view","is-post-match"]),[[p.vShow,t.value&&h.value]]),p.createElementVNode("div",fue,[p.createTextVNode(p.toDisplayString(v.value?v.value.name:"Nuevo template")+" ",1),p.createElementVNode("div",{class:"template-maker__header__close",onClick:oe},[w.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("svg",mue,[...Ce[6]||(Ce[6]=[p.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),p.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),p.createElementVNode("div",gue,[Ce[13]||(Ce[13]=p.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),p.createElementVNode("div",yue,[p.createElementVNode("div",vue,[p.createElementVNode("div",bue,[p.withDirectives(p.createVNode(QT,{"is-post-match":y.value,"initial-cover-id":b.value,onSelectCover:O},null,8,["is-post-match","initial-cover-id"]),[[p.vShow,t.value]])]),(p.openBlock(),p.createElementBlock("div",{class:"template-maker__content__main__pages",key:J.value.length},[C.value?(p.openBlock(),p.createBlock(Qle,{key:0,id:"page-0",game:v.value.game||null,"cover-id":C.value.id,"is-post-match":C.value.isPostMatch,onIntersectionChanged:Ce[1]||(Ce[1]=Ne=>U(Ne,-1))},null,8,["game","cover-id","is-post-match"])):p.createCommentVNode("",!0),t.value?(p.openBlock(),p.createElementBlock("div",{key:1,class:"new-items-buttons",style:p.normalizeStyle({"margin-bottom":J.value.length===0?"30px":"0"})},[h.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Ce[2]||(Ce[2]=Ne=>R(-1))},[...Ce[7]||(Ce[7]=[p.createElementVNode("div",null,"+ Nueva página",-1),p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M8.66797 1.33203H4.0013C3.64768 1.33203 3.30854 1.47251 3.05849 1.72256C2.80844 1.9726 2.66797 2.31174 2.66797 2.66536V13.332C2.66797 13.6857 2.80844 14.0248 3.05849 14.2748C3.30854 14.5249 3.64768 14.6654 4.0013 14.6654H12.0013C12.3549 14.6654 12.6941 14.5249 12.9441 14.2748C13.1942 14.0248 13.3346 13.6857 13.3346 13.332V5.9987L8.66797 1.33203Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):p.createCommentVNode("",!0),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(J.value,(Ne,Re)=>(p.openBlock(),p.createElementBlock("div",{key:Re,id:`page-${Re+1}`,class:"template-maker__content__main__pages__page"},[p.createElementVNode("div",_ue,[p.createElementVNode("div",wue,"Pag "+p.toDisplayString(S(Re+2)),1)]),C.value?(p.openBlock(),p.createBlock(ele,{key:0,page:Ne,"is-template-mode":t.value,"is-post-match":C.value.isPostMatch,game:v.value.game||null,lastGames:v.value.lastGames||[],"is-filter-visible":h.value,onEditView:q,onIntersectionChanged:Ge=>U(Ge,Re),onChangeSort:Me,onDeletePage:_e,onViewChanged:xe,onDeleteView:Se},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):p.createCommentVNode("",!0),t.value&&!h.value?(p.openBlock(),p.createElementBlock("div",{key:1,class:"new-items-buttons",style:p.normalizeStyle({"margin-bottom":Re+1===J.value.length?"30px":"0","margin-top":"10px"})},[p.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:Ge=>R(Re)},[...Ce[8]||(Ce[8]=[p.createElementVNode("div",null,"+ Nueva página",-1),p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M8.66797 1.33203H4.0013C3.64768 1.33203 3.30854 1.47251 3.05849 1.72256C2.80844 1.9726 2.66797 2.31174 2.66797 2.66536V13.332C2.66797 13.6857 2.80844 14.0248 3.05849 14.2748C3.30854 14.5249 3.64768 14.6654 4.0013 14.6654H12.0013C12.3549 14.6654 12.6941 14.5249 12.9441 14.2748C13.1942 14.0248 13.3346 13.6857 13.3346 13.332V5.9987L8.66797 1.33203Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,Tue),p.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:Ge=>V(Ne)},[...Ce[9]||(Ce[9]=[p.createElementVNode("div",null,"+ Agregar gráfico",-1),p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,kue)],4)):p.createCommentVNode("",!0)],8,xue))),128))]))]),w.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",Sue,[p.createElementVNode("div",Eue,[p.createElementVNode("div",Aue,[p.createElementVNode("div",null,"Páginas "+p.toDisplayString(E.value),1),p.createElementVNode("div",{class:p.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:x.value<=0}]),onClick:Ce[3]||(Ce[3]=Ne=>x.value>0&&z(x.value-1))},[...Ce[10]||(Ce[10]=[p.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.22444 5L5.29079 8.57741C5.56974 8.90285 5.56974 9.43049 5.29079 9.75592C5.01184 10.0814 4.55958 10.0814 4.28064 9.75592L0.709209 5.58926C0.430263 5.26382 0.430263 4.73618 0.709209 4.41074L4.28064 0.244078C4.55958 -0.0813593 5.01184 -0.0813592 5.29079 0.244078C5.56974 0.569515 5.56974 1.09715 5.29079 1.42259L2.22444 5Z",fill:"#92929D"})],-1)])],2),p.createElementVNode("div",{class:p.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:x.value>=J.value.length}]),onClick:Ce[4]||(Ce[4]=Ne=>x.value<J.value.length&&z(x.value+1))},[...Ce[11]||(Ce[11]=[p.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.77556 5L0.70921 8.57741C0.430264 8.90285 0.430264 9.43049 0.70921 9.75592C0.988156 10.0814 1.44042 10.0814 1.71936 9.75592L5.29079 5.58926C5.56974 5.26382 5.56974 4.73618 5.29079 4.41074L1.71936 0.244078C1.44042 -0.0813593 0.988155 -0.0813592 0.709209 0.244078C0.430264 0.569515 0.430264 1.09715 0.70921 1.42259L3.77556 5Z",fill:"#92929D"})],-1)])],2)]),p.createElementVNode("div",Cue,[p.createElementVNode("div",{role:"button",class:p.normalizeClass({active:x.value===0}),onClick:Ce[5]||(Ce[5]=Ne=>z(0))},p.toDisplayString(S(1)),3),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(J.value,(Ne,Re)=>(p.openBlock(),p.createElementBlock("div",{role:"button",key:Re,class:p.normalizeClass({active:Re+1===x.value}),onClick:Ge=>z(Re+1)},p.toDisplayString(S(Re+2)),11,Mue))),128))])]),t.value?(p.openBlock(),p.createElementBlock("div",{key:0,role:"button",class:p.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!c.value}]),onClick:de},[...Ce[12]||(Ce[12]=[p.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M12.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V3.33333C2 2.97971 2.14048 2.64057 2.39052 2.39052C2.64057 2.14048 2.97971 2 3.33333 2H10.6667L14 5.33333V12.6667C14 13.0203 13.8595 13.3594 13.6095 13.6095C13.3594 13.8595 13.0203 14 12.6667 14Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),p.createElementVNode("div",null,"Guardar",-1)])],2)):p.createCommentVNode("",!0)]))])])],4)):p.createCommentVNode("",!0)]))],64))}},Nue=dd(Pue,[["__scopeId","data-v-cd17536c"]]);function z6(r,a){return function(){return r.apply(a,arguments)}}const{toString:Oue}=Object.prototype,{getPrototypeOf:H2}=Object,{iterator:oy,toStringTag:D6}=Symbol,sy=(r=>a=>{const g=Oue.call(a);return r[g]||(r[g]=g.slice(8,-1).toLowerCase())})(Object.create(null)),ed=r=>(r=r.toLowerCase(),a=>sy(a)===r),ly=r=>a=>typeof a===r,{isArray:qp}=Array,am=ly("undefined");function om(r){return r!==null&&!am(r)&&r.constructor!==null&&!am(r.constructor)&&fu(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const B6=ed("ArrayBuffer");function Iue(r){let a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(r):a=r&&r.buffer&&B6(r.buffer),a}const Rue=ly("string"),fu=ly("function"),V6=ly("number"),sm=r=>r!==null&&typeof r=="object",Lue=r=>r===!0||r===!1,cy=r=>{if(sy(r)!=="object")return!1;const a=H2(r);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(D6 in r)&&!(oy in r)},zue=r=>{if(!sm(r)||om(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},Due=ed("Date"),Bue=ed("File"),Vue=ed("Blob"),Fue=ed("FileList"),jue=r=>sm(r)&&fu(r.pipe),Uue=r=>{let a;return r&&(typeof FormData=="function"&&r instanceof FormData||fu(r.append)&&((a=sy(r))==="formdata"||a==="object"&&fu(r.toString)&&r.toString()==="[object FormData]"))},que=ed("URLSearchParams"),[Wue,Gue,Hue,Xue]=["ReadableStream","Request","Response","Headers"].map(ed),Yue=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function lm(r,a,{allOwnKeys:g=!1}={}){if(r===null||typeof r>"u")return;let B,J;if(typeof r!="object"&&(r=[r]),qp(r))for(B=0,J=r.length;B<J;B++)a.call(null,r[B],B,r);else{if(om(r))return;const C=g?Object.getOwnPropertyNames(r):Object.keys(r),x=C.length;let e;for(B=0;B<x;B++)e=C[B],a.call(null,r[e],e,r)}}function F6(r,a){if(om(r))return null;a=a.toLowerCase();const g=Object.keys(r);let B=g.length,J;for(;B-- >0;)if(J=g[B],a===J.toLowerCase())return J;return null}const Zh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,j6=r=>!am(r)&&r!==Zh;function X2(){const{caseless:r}=j6(this)&&this||{},a={},g=(B,J)=>{const C=r&&F6(a,J)||J;cy(a[C])&&cy(B)?a[C]=X2(a[C],B):cy(B)?a[C]=X2({},B):qp(B)?a[C]=B.slice():a[C]=B};for(let B=0,J=arguments.length;B<J;B++)arguments[B]&&lm(arguments[B],g);return a}const Jue=(r,a,g,{allOwnKeys:B}={})=>(lm(a,(J,C)=>{g&&fu(J)?r[C]=z6(J,g):r[C]=J},{allOwnKeys:B}),r),Kue=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Zue=(r,a,g,B)=>{r.prototype=Object.create(a.prototype,B),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:a.prototype}),g&&Object.assign(r.prototype,g)},Que=(r,a,g,B)=>{let J,C,x;const e={};if(a=a||{},r==null)return a;do{for(J=Object.getOwnPropertyNames(r),C=J.length;C-- >0;)x=J[C],(!B||B(x,r,a))&&!e[x]&&(a[x]=r[x],e[x]=!0);r=g!==!1&&H2(r)}while(r&&(!g||g(r,a))&&r!==Object.prototype);return a},$ue=(r,a,g)=>{r=String(r),(g===void 0||g>r.length)&&(g=r.length),g-=a.length;const B=r.indexOf(a,g);return B!==-1&&B===g},ede=r=>{if(!r)return null;if(qp(r))return r;let a=r.length;if(!V6(a))return null;const g=new Array(a);for(;a-- >0;)g[a]=r[a];return g},tde=(r=>a=>r&&a instanceof r)(typeof Uint8Array<"u"&&H2(Uint8Array)),rde=(r,a)=>{const B=(r&&r[oy]).call(r);let J;for(;(J=B.next())&&!J.done;){const C=J.value;a.call(r,C[0],C[1])}},nde=(r,a)=>{let g;const B=[];for(;(g=r.exec(a))!==null;)B.push(g);return B},ide=ed("HTMLFormElement"),ade=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(g,B,J){return B.toUpperCase()+J}),U6=(({hasOwnProperty:r})=>(a,g)=>r.call(a,g))(Object.prototype),ode=ed("RegExp"),q6=(r,a)=>{const g=Object.getOwnPropertyDescriptors(r),B={};lm(g,(J,C)=>{let x;(x=a(J,C,r))!==!1&&(B[C]=x||J)}),Object.defineProperties(r,B)},sde=r=>{q6(r,(a,g)=>{if(fu(r)&&["arguments","caller","callee"].indexOf(g)!==-1)return!1;const B=r[g];if(fu(B)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+g+"'")})}})},lde=(r,a)=>{const g={},B=J=>{J.forEach(C=>{g[C]=!0})};return qp(r)?B(r):B(String(r).split(a)),g},cde=()=>{},ude=(r,a)=>r!=null&&Number.isFinite(r=+r)?r:a;function dde(r){return!!(r&&fu(r.append)&&r[D6]==="FormData"&&r[oy])}const hde=r=>{const a=new Array(10),g=(B,J)=>{if(sm(B)){if(a.indexOf(B)>=0)return;if(om(B))return B;if(!("toJSON"in B)){a[J]=B;const C=qp(B)?[]:{};return lm(B,(x,e)=>{const v=g(x,J+1);!am(v)&&(C[e]=v)}),a[J]=void 0,C}}return B};return g(r,0)},pde=ed("AsyncFunction"),fde=r=>r&&(sm(r)||fu(r))&&fu(r.then)&&fu(r.catch),W6=((r,a)=>r?setImmediate:a?((g,B)=>(Zh.addEventListener("message",({source:J,data:C})=>{J===Zh&&C===g&&B.length&&B.shift()()},!1),J=>{B.push(J),Zh.postMessage(g,"*")}))(`axios@${Math.random()}`,[]):g=>setTimeout(g))(typeof setImmediate=="function",fu(Zh.postMessage)),mde=typeof queueMicrotask<"u"?queueMicrotask.bind(Zh):typeof process<"u"&&process.nextTick||W6,Hn={isArray:qp,isArrayBuffer:B6,isBuffer:om,isFormData:Uue,isArrayBufferView:Iue,isString:Rue,isNumber:V6,isBoolean:Lue,isObject:sm,isPlainObject:cy,isEmptyObject:zue,isReadableStream:Wue,isRequest:Gue,isResponse:Hue,isHeaders:Xue,isUndefined:am,isDate:Due,isFile:Bue,isBlob:Vue,isRegExp:ode,isFunction:fu,isStream:jue,isURLSearchParams:que,isTypedArray:tde,isFileList:Fue,forEach:lm,merge:X2,extend:Jue,trim:Yue,stripBOM:Kue,inherits:Zue,toFlatObject:Que,kindOf:sy,kindOfTest:ed,endsWith:$ue,toArray:ede,forEachEntry:rde,matchAll:nde,isHTMLForm:ide,hasOwnProperty:U6,hasOwnProp:U6,reduceDescriptors:q6,freezeMethods:sde,toObjectSet:lde,toCamelCase:ade,noop:cde,toFiniteNumber:ude,findKey:F6,global:Zh,isContextDefined:j6,isSpecCompliantForm:dde,toJSONObject:hde,isAsyncFn:pde,isThenable:fde,setImmediate:W6,asap:mde,isIterable:r=>r!=null&&fu(r[oy])};function va(r,a,g,B,J){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",a&&(this.code=a),g&&(this.config=g),B&&(this.request=B),J&&(this.response=J,this.status=J.status?J.status:null)}Hn.inherits(va,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Hn.toJSONObject(this.config),code:this.code,status:this.status}}});const G6=va.prototype,H6={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{H6[r]={value:r}}),Object.defineProperties(va,H6),Object.defineProperty(G6,"isAxiosError",{value:!0}),va.from=(r,a,g,B,J,C)=>{const x=Object.create(G6);return Hn.toFlatObject(r,x,function(v){return v!==Error.prototype},e=>e!=="isAxiosError"),va.call(x,r.message,a,g,B,J),x.cause=r,x.name=r.name,C&&Object.assign(x,C),x};const gde=null;function Y2(r){return Hn.isPlainObject(r)||Hn.isArray(r)}function X6(r){return Hn.endsWith(r,"[]")?r.slice(0,-2):r}function Y6(r,a,g){return r?r.concat(a).map(function(J,C){return J=X6(J),!g&&C?"["+J+"]":J}).join(g?".":""):a}function yde(r){return Hn.isArray(r)&&!r.some(Y2)}const vde=Hn.toFlatObject(Hn,{},null,function(a){return/^is[A-Z]/.test(a)});function uy(r,a,g){if(!Hn.isObject(r))throw new TypeError("target must be an object");a=a||new FormData,g=Hn.toFlatObject(g,{metaTokens:!0,dots:!1,indexes:!1},!1,function(n,i){return!Hn.isUndefined(i[n])});const B=g.metaTokens,J=g.visitor||t,C=g.dots,x=g.indexes,v=(g.Blob||typeof Blob<"u"&&Blob)&&Hn.isSpecCompliantForm(a);if(!Hn.isFunction(J))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(Hn.isDate(h))return h.toISOString();if(Hn.isBoolean(h))return h.toString();if(!v&&Hn.isBlob(h))throw new va("Blob is not supported. Use a Buffer instead.");return Hn.isArrayBuffer(h)||Hn.isTypedArray(h)?v&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function t(h,n,i){let d=h;if(h&&!i&&typeof h=="object"){if(Hn.endsWith(n,"{}"))n=B?n:n.slice(0,-2),h=JSON.stringify(h);else if(Hn.isArray(h)&&yde(h)||(Hn.isFileList(h)||Hn.endsWith(n,"[]"))&&(d=Hn.toArray(h)))return n=X6(n),d.forEach(function(c,f){!(Hn.isUndefined(c)||c===null)&&a.append(x===!0?Y6([n],f,C):x===null?n:n+"[]",u(c))}),!1}return Y2(h)?!0:(a.append(Y6(i,n,C),u(h)),!1)}const w=[],y=Object.assign(vde,{defaultVisitor:t,convertValue:u,isVisitable:Y2});function b(h,n){if(!Hn.isUndefined(h)){if(w.indexOf(h)!==-1)throw Error("Circular reference detected in "+n.join("."));w.push(h),Hn.forEach(h,function(d,s){(!(Hn.isUndefined(d)||d===null)&&J.call(a,d,Hn.isString(s)?s.trim():s,n,y))===!0&&b(d,n?n.concat(s):[s])}),w.pop()}}if(!Hn.isObject(r))throw new TypeError("data must be an object");return b(r),a}function J6(r){const a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(B){return a[B]})}function J2(r,a){this._pairs=[],r&&uy(r,this,a)}const K6=J2.prototype;K6.append=function(a,g){this._pairs.push([a,g])},K6.toString=function(a){const g=a?function(B){return a.call(this,B,J6)}:J6;return this._pairs.map(function(J){return g(J[0])+"="+g(J[1])},"").join("&")};function bde(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Z6(r,a,g){if(!a)return r;const B=g&&g.encode||bde;Hn.isFunction(g)&&(g={serialize:g});const J=g&&g.serialize;let C;if(J?C=J(a,g):C=Hn.isURLSearchParams(a)?a.toString():new J2(a,g).toString(B),C){const x=r.indexOf("#");x!==-1&&(r=r.slice(0,x)),r+=(r.indexOf("?")===-1?"?":"&")+C}return r}class Q6{constructor(){this.handlers=[]}use(a,g,B){return this.handlers.push({fulfilled:a,rejected:g,synchronous:B?B.synchronous:!1,runWhen:B?B.runWhen:null}),this.handlers.length-1}eject(a){this.handlers[a]&&(this.handlers[a]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(a){Hn.forEach(this.handlers,function(B){B!==null&&a(B)})}}const $6={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xde={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:J2,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},K2=typeof window<"u"&&typeof document<"u",Z2=typeof navigator=="object"&&navigator||void 0,_de=K2&&(!Z2||["ReactNative","NativeScript","NS"].indexOf(Z2.product)<0),wde=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Tde=K2&&window.location.href||"http://localhost",Nc={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:K2,hasStandardBrowserEnv:_de,hasStandardBrowserWebWorkerEnv:wde,navigator:Z2,origin:Tde},Symbol.toStringTag,{value:"Module"})),...xde};function kde(r,a){return uy(r,new Nc.classes.URLSearchParams,{visitor:function(g,B,J,C){return Nc.isNode&&Hn.isBuffer(g)?(this.append(B,g.toString("base64")),!1):C.defaultVisitor.apply(this,arguments)},...a})}function Sde(r){return Hn.matchAll(/\w+|\[(\w*)]/g,r).map(a=>a[0]==="[]"?"":a[1]||a[0])}function Ede(r){const a={},g=Object.keys(r);let B;const J=g.length;let C;for(B=0;B<J;B++)C=g[B],a[C]=r[C];return a}function eT(r){function a(g,B,J,C){let x=g[C++];if(x==="__proto__")return!0;const e=Number.isFinite(+x),v=C>=g.length;return x=!x&&Hn.isArray(J)?J.length:x,v?(Hn.hasOwnProp(J,x)?J[x]=[J[x],B]:J[x]=B,!e):((!J[x]||!Hn.isObject(J[x]))&&(J[x]=[]),a(g,B,J[x],C)&&Hn.isArray(J[x])&&(J[x]=Ede(J[x])),!e)}if(Hn.isFormData(r)&&Hn.isFunction(r.entries)){const g={};return Hn.forEachEntry(r,(B,J)=>{a(Sde(B),J,g,0)}),g}return null}function Ade(r,a,g){if(Hn.isString(r))try{return(a||JSON.parse)(r),Hn.trim(r)}catch(B){if(B.name!=="SyntaxError")throw B}return(g||JSON.stringify)(r)}const cm={transitional:$6,adapter:["xhr","http","fetch"],transformRequest:[function(a,g){const B=g.getContentType()||"",J=B.indexOf("application/json")>-1,C=Hn.isObject(a);if(C&&Hn.isHTMLForm(a)&&(a=new FormData(a)),Hn.isFormData(a))return J?JSON.stringify(eT(a)):a;if(Hn.isArrayBuffer(a)||Hn.isBuffer(a)||Hn.isStream(a)||Hn.isFile(a)||Hn.isBlob(a)||Hn.isReadableStream(a))return a;if(Hn.isArrayBufferView(a))return a.buffer;if(Hn.isURLSearchParams(a))return g.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),a.toString();let e;if(C){if(B.indexOf("application/x-www-form-urlencoded")>-1)return kde(a,this.formSerializer).toString();if((e=Hn.isFileList(a))||B.indexOf("multipart/form-data")>-1){const v=this.env&&this.env.FormData;return uy(e?{"files[]":a}:a,v&&new v,this.formSerializer)}}return C||J?(g.setContentType("application/json",!1),Ade(a)):a}],transformResponse:[function(a){const g=this.transitional||cm.transitional,B=g&&g.forcedJSONParsing,J=this.responseType==="json";if(Hn.isResponse(a)||Hn.isReadableStream(a))return a;if(a&&Hn.isString(a)&&(B&&!this.responseType||J)){const x=!(g&&g.silentJSONParsing)&&J;try{return JSON.parse(a)}catch(e){if(x)throw e.name==="SyntaxError"?va.from(e,va.ERR_BAD_RESPONSE,this,null,this.response):e}}return a}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Nc.classes.FormData,Blob:Nc.classes.Blob},validateStatus:function(a){return a>=200&&a<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Hn.forEach(["delete","get","head","post","put","patch"],r=>{cm.headers[r]={}});const Cde=Hn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Mde=r=>{const a={};let g,B,J;return r&&r.split(`
|
|
4082
4082
|
`).forEach(function(x){J=x.indexOf(":"),g=x.substring(0,J).trim().toLowerCase(),B=x.substring(J+1).trim(),!(!g||a[g]&&Cde[g])&&(g==="set-cookie"?a[g]?a[g].push(B):a[g]=[B]:a[g]=a[g]?a[g]+", "+B:B)}),a},tT=Symbol("internals");function um(r){return r&&String(r).trim().toLowerCase()}function dy(r){return r===!1||r==null?r:Hn.isArray(r)?r.map(dy):String(r)}function Pde(r){const a=Object.create(null),g=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let B;for(;B=g.exec(r);)a[B[1]]=B[2];return a}const Nde=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function Q2(r,a,g,B,J){if(Hn.isFunction(B))return B.call(this,a,g);if(J&&(a=g),!!Hn.isString(a)){if(Hn.isString(B))return a.indexOf(B)!==-1;if(Hn.isRegExp(B))return B.test(a)}}function Ode(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(a,g,B)=>g.toUpperCase()+B)}function Ide(r,a){const g=Hn.toCamelCase(" "+a);["get","set","has"].forEach(B=>{Object.defineProperty(r,B+g,{value:function(J,C,x){return this[B].call(this,a,J,C,x)},configurable:!0})})}let mu=class{constructor(a){a&&this.set(a)}set(a,g,B){const J=this;function C(e,v,u){const t=um(v);if(!t)throw new Error("header name must be a non-empty string");const w=Hn.findKey(J,t);(!w||J[w]===void 0||u===!0||u===void 0&&J[w]!==!1)&&(J[w||v]=dy(e))}const x=(e,v)=>Hn.forEach(e,(u,t)=>C(u,t,v));if(Hn.isPlainObject(a)||a instanceof this.constructor)x(a,g);else if(Hn.isString(a)&&(a=a.trim())&&!Nde(a))x(Mde(a),g);else if(Hn.isObject(a)&&Hn.isIterable(a)){let e={},v,u;for(const t of a){if(!Hn.isArray(t))throw TypeError("Object iterator must return a key-value pair");e[u=t[0]]=(v=e[u])?Hn.isArray(v)?[...v,t[1]]:[v,t[1]]:t[1]}x(e,g)}else a!=null&&C(g,a,B);return this}get(a,g){if(a=um(a),a){const B=Hn.findKey(this,a);if(B){const J=this[B];if(!g)return J;if(g===!0)return Pde(J);if(Hn.isFunction(g))return g.call(this,J,B);if(Hn.isRegExp(g))return g.exec(J);throw new TypeError("parser must be boolean|regexp|function")}}}has(a,g){if(a=um(a),a){const B=Hn.findKey(this,a);return!!(B&&this[B]!==void 0&&(!g||Q2(this,this[B],B,g)))}return!1}delete(a,g){const B=this;let J=!1;function C(x){if(x=um(x),x){const e=Hn.findKey(B,x);e&&(!g||Q2(B,B[e],e,g))&&(delete B[e],J=!0)}}return Hn.isArray(a)?a.forEach(C):C(a),J}clear(a){const g=Object.keys(this);let B=g.length,J=!1;for(;B--;){const C=g[B];(!a||Q2(this,this[C],C,a,!0))&&(delete this[C],J=!0)}return J}normalize(a){const g=this,B={};return Hn.forEach(this,(J,C)=>{const x=Hn.findKey(B,C);if(x){g[x]=dy(J),delete g[C];return}const e=a?Ode(C):String(C).trim();e!==C&&delete g[C],g[e]=dy(J),B[e]=!0}),this}concat(...a){return this.constructor.concat(this,...a)}toJSON(a){const g=Object.create(null);return Hn.forEach(this,(B,J)=>{B!=null&&B!==!1&&(g[J]=a&&Hn.isArray(B)?B.join(", "):B)}),g}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([a,g])=>a+": "+g).join(`
|
|
4083
4083
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(a){return a instanceof this?a:new this(a)}static concat(a,...g){const B=new this(a);return g.forEach(J=>B.set(J)),B}static accessor(a){const B=(this[tT]=this[tT]={accessors:{}}).accessors,J=this.prototype;function C(x){const e=um(x);B[e]||(Ide(J,x),B[e]=!0)}return Hn.isArray(a)?a.forEach(C):C(a),this}};mu.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Hn.reduceDescriptors(mu.prototype,({value:r},a)=>{let g=a[0].toUpperCase()+a.slice(1);return{get:()=>r,set(B){this[g]=B}}}),Hn.freezeMethods(mu);function $2(r,a){const g=this||cm,B=a||g,J=mu.from(B.headers);let C=B.data;return Hn.forEach(r,function(e){C=e.call(g,C,J.normalize(),a?a.status:void 0)}),J.normalize(),C}function rT(r){return!!(r&&r.__CANCEL__)}function Wp(r,a,g){va.call(this,r??"canceled",va.ERR_CANCELED,a,g),this.name="CanceledError"}Hn.inherits(Wp,va,{__CANCEL__:!0});function nT(r,a,g){const B=g.config.validateStatus;!g.status||!B||B(g.status)?r(g):a(new va("Request failed with status code "+g.status,[va.ERR_BAD_REQUEST,va.ERR_BAD_RESPONSE][Math.floor(g.status/100)-4],g.config,g.request,g))}function Rde(r){const a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return a&&a[1]||""}function Lde(r,a){r=r||10;const g=new Array(r),B=new Array(r);let J=0,C=0,x;return a=a!==void 0?a:1e3,function(v){const u=Date.now(),t=B[C];x||(x=u),g[J]=v,B[J]=u;let w=C,y=0;for(;w!==J;)y+=g[w++],w=w%r;if(J=(J+1)%r,J===C&&(C=(C+1)%r),u-x<a)return;const b=t&&u-t;return b?Math.round(y*1e3/b):void 0}}function zde(r,a){let g=0,B=1e3/a,J,C;const x=(u,t=Date.now())=>{g=t,J=null,C&&(clearTimeout(C),C=null),r(...u)};return[(...u)=>{const t=Date.now(),w=t-g;w>=B?x(u,t):(J=u,C||(C=setTimeout(()=>{C=null,x(J)},B-w)))},()=>J&&x(J)]}const hy=(r,a,g=3)=>{let B=0;const J=Lde(50,250);return zde(C=>{const x=C.loaded,e=C.lengthComputable?C.total:void 0,v=x-B,u=J(v),t=x<=e;B=x;const w={loaded:x,total:e,progress:e?x/e:void 0,bytes:v,rate:u||void 0,estimated:u&&e&&t?(e-x)/u:void 0,event:C,lengthComputable:e!=null,[a?"download":"upload"]:!0};r(w)},g)},iT=(r,a)=>{const g=r!=null;return[B=>a[0]({lengthComputable:g,total:r,loaded:B}),a[1]]},aT=r=>(...a)=>Hn.asap(()=>r(...a)),Dde=Nc.hasStandardBrowserEnv?((r,a)=>g=>(g=new URL(g,Nc.origin),r.protocol===g.protocol&&r.host===g.host&&(a||r.port===g.port)))(new URL(Nc.origin),Nc.navigator&&/(msie|trident)/i.test(Nc.navigator.userAgent)):()=>!0,Bde=Nc.hasStandardBrowserEnv?{write(r,a,g,B,J,C){const x=[r+"="+encodeURIComponent(a)];Hn.isNumber(g)&&x.push("expires="+new Date(g).toGMTString()),Hn.isString(B)&&x.push("path="+B),Hn.isString(J)&&x.push("domain="+J),C===!0&&x.push("secure"),document.cookie=x.join("; ")},read(r){const a=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Vde(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function Fde(r,a){return a?r.replace(/\/?\/$/,"")+"/"+a.replace(/^\/+/,""):r}function oT(r,a,g){let B=!Vde(a);return r&&(B||g==!1)?Fde(r,a):a}const sT=r=>r instanceof mu?{...r}:r;function Qh(r,a){a=a||{};const g={};function B(u,t,w,y){return Hn.isPlainObject(u)&&Hn.isPlainObject(t)?Hn.merge.call({caseless:y},u,t):Hn.isPlainObject(t)?Hn.merge({},t):Hn.isArray(t)?t.slice():t}function J(u,t,w,y){if(Hn.isUndefined(t)){if(!Hn.isUndefined(u))return B(void 0,u,w,y)}else return B(u,t,w,y)}function C(u,t){if(!Hn.isUndefined(t))return B(void 0,t)}function x(u,t){if(Hn.isUndefined(t)){if(!Hn.isUndefined(u))return B(void 0,u)}else return B(void 0,t)}function e(u,t,w){if(w in a)return B(u,t);if(w in r)return B(void 0,u)}const v={url:C,method:C,data:C,baseURL:x,transformRequest:x,transformResponse:x,paramsSerializer:x,timeout:x,timeoutMessage:x,withCredentials:x,withXSRFToken:x,adapter:x,responseType:x,xsrfCookieName:x,xsrfHeaderName:x,onUploadProgress:x,onDownloadProgress:x,decompress:x,maxContentLength:x,maxBodyLength:x,beforeRedirect:x,transport:x,httpAgent:x,httpsAgent:x,cancelToken:x,socketPath:x,responseEncoding:x,validateStatus:e,headers:(u,t,w)=>J(sT(u),sT(t),w,!0)};return Hn.forEach(Object.keys({...r,...a}),function(t){const w=v[t]||J,y=w(r[t],a[t],t);Hn.isUndefined(y)&&w!==e||(g[t]=y)}),g}const lT=r=>{const a=Qh({},r);let{data:g,withXSRFToken:B,xsrfHeaderName:J,xsrfCookieName:C,headers:x,auth:e}=a;a.headers=x=mu.from(x),a.url=Z6(oT(a.baseURL,a.url,a.allowAbsoluteUrls),r.params,r.paramsSerializer),e&&x.set("Authorization","Basic "+btoa((e.username||"")+":"+(e.password?unescape(encodeURIComponent(e.password)):"")));let v;if(Hn.isFormData(g)){if(Nc.hasStandardBrowserEnv||Nc.hasStandardBrowserWebWorkerEnv)x.setContentType(void 0);else if((v=x.getContentType())!==!1){const[u,...t]=v?v.split(";").map(w=>w.trim()).filter(Boolean):[];x.setContentType([u||"multipart/form-data",...t].join("; "))}}if(Nc.hasStandardBrowserEnv&&(B&&Hn.isFunction(B)&&(B=B(a)),B||B!==!1&&Dde(a.url))){const u=J&&C&&Bde.read(C);u&&x.set(J,u)}return a},jde=typeof XMLHttpRequest<"u"&&function(r){return new Promise(function(g,B){const J=lT(r);let C=J.data;const x=mu.from(J.headers).normalize();let{responseType:e,onUploadProgress:v,onDownloadProgress:u}=J,t,w,y,b,h;function n(){b&&b(),h&&h(),J.cancelToken&&J.cancelToken.unsubscribe(t),J.signal&&J.signal.removeEventListener("abort",t)}let i=new XMLHttpRequest;i.open(J.method.toUpperCase(),J.url,!0),i.timeout=J.timeout;function d(){if(!i)return;const c=mu.from("getAllResponseHeaders"in i&&i.getAllResponseHeaders()),m={data:!e||e==="text"||e==="json"?i.responseText:i.response,status:i.status,statusText:i.statusText,headers:c,config:r,request:i};nT(function(E){g(E),n()},function(E){B(E),n()},m),i=null}"onloadend"in i?i.onloadend=d:i.onreadystatechange=function(){!i||i.readyState!==4||i.status===0&&!(i.responseURL&&i.responseURL.indexOf("file:")===0)||setTimeout(d)},i.onabort=function(){i&&(B(new va("Request aborted",va.ECONNABORTED,r,i)),i=null)},i.onerror=function(){B(new va("Network Error",va.ERR_NETWORK,r,i)),i=null},i.ontimeout=function(){let f=J.timeout?"timeout of "+J.timeout+"ms exceeded":"timeout exceeded";const m=J.transitional||$6;J.timeoutErrorMessage&&(f=J.timeoutErrorMessage),B(new va(f,m.clarifyTimeoutError?va.ETIMEDOUT:va.ECONNABORTED,r,i)),i=null},C===void 0&&x.setContentType(null),"setRequestHeader"in i&&Hn.forEach(x.toJSON(),function(f,m){i.setRequestHeader(m,f)}),Hn.isUndefined(J.withCredentials)||(i.withCredentials=!!J.withCredentials),e&&e!=="json"&&(i.responseType=J.responseType),u&&([y,h]=hy(u,!0),i.addEventListener("progress",y)),v&&i.upload&&([w,b]=hy(v),i.upload.addEventListener("progress",w),i.upload.addEventListener("loadend",b)),(J.cancelToken||J.signal)&&(t=c=>{i&&(B(!c||c.type?new Wp(null,r,i):c),i.abort(),i=null)},J.cancelToken&&J.cancelToken.subscribe(t),J.signal&&(J.signal.aborted?t():J.signal.addEventListener("abort",t)));const s=Rde(J.url);if(s&&Nc.protocols.indexOf(s)===-1){B(new va("Unsupported protocol "+s+":",va.ERR_BAD_REQUEST,r));return}i.send(C||null)})},Ude=(r,a)=>{const{length:g}=r=r?r.filter(Boolean):[];if(a||g){let B=new AbortController,J;const C=function(u){if(!J){J=!0,e();const t=u instanceof Error?u:this.reason;B.abort(t instanceof va?t:new Wp(t instanceof Error?t.message:t))}};let x=a&&setTimeout(()=>{x=null,C(new va(`timeout ${a} of ms exceeded`,va.ETIMEDOUT))},a);const e=()=>{r&&(x&&clearTimeout(x),x=null,r.forEach(u=>{u.unsubscribe?u.unsubscribe(C):u.removeEventListener("abort",C)}),r=null)};r.forEach(u=>u.addEventListener("abort",C));const{signal:v}=B;return v.unsubscribe=()=>Hn.asap(e),v}},qde=function*(r,a){let g=r.byteLength;if(g<a){yield r;return}let B=0,J;for(;B<g;)J=B+a,yield r.slice(B,J),B=J},Wde=async function*(r,a){for await(const g of Gde(r))yield*qde(g,a)},Gde=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const a=r.getReader();try{for(;;){const{done:g,value:B}=await a.read();if(g)break;yield B}}finally{await a.cancel()}},cT=(r,a,g,B)=>{const J=Wde(r,a);let C=0,x,e=v=>{x||(x=!0,B&&B(v))};return new ReadableStream({async pull(v){try{const{done:u,value:t}=await J.next();if(u){e(),v.close();return}let w=t.byteLength;if(g){let y=C+=w;g(y)}v.enqueue(new Uint8Array(t))}catch(u){throw e(u),u}},cancel(v){return e(v),J.return()}},{highWaterMark:2})},py=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",uT=py&&typeof ReadableStream=="function",Hde=py&&(typeof TextEncoder=="function"?(r=>a=>r.encode(a))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),dT=(r,...a)=>{try{return!!r(...a)}catch{return!1}},Xde=uT&&dT(()=>{let r=!1;const a=new Request(Nc.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!a}),hT=64*1024,eb=uT&&dT(()=>Hn.isReadableStream(new Response("").body)),fy={stream:eb&&(r=>r.body)};py&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(a=>{!fy[a]&&(fy[a]=Hn.isFunction(r[a])?g=>g[a]():(g,B)=>{throw new va(`Response type '${a}' is not supported`,va.ERR_NOT_SUPPORT,B)})})})(new Response);const Yde=async r=>{if(r==null)return 0;if(Hn.isBlob(r))return r.size;if(Hn.isSpecCompliantForm(r))return(await new Request(Nc.origin,{method:"POST",body:r}).arrayBuffer()).byteLength;if(Hn.isArrayBufferView(r)||Hn.isArrayBuffer(r))return r.byteLength;if(Hn.isURLSearchParams(r)&&(r=r+""),Hn.isString(r))return(await Hde(r)).byteLength},Jde=async(r,a)=>{const g=Hn.toFiniteNumber(r.getContentLength());return g??Yde(a)},tb={http:gde,xhr:jde,fetch:py&&(async r=>{let{url:a,method:g,data:B,signal:J,cancelToken:C,timeout:x,onDownloadProgress:e,onUploadProgress:v,responseType:u,headers:t,withCredentials:w="same-origin",fetchOptions:y}=lT(r);u=u?(u+"").toLowerCase():"text";let b=Ude([J,C&&C.toAbortSignal()],x),h;const n=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let i;try{if(v&&Xde&&g!=="get"&&g!=="head"&&(i=await Jde(t,B))!==0){let m=new Request(a,{method:"POST",body:B,duplex:"half"}),T;if(Hn.isFormData(B)&&(T=m.headers.get("content-type"))&&t.setContentType(T),m.body){const[E,S]=iT(i,hy(aT(v)));B=cT(m.body,hT,E,S)}}Hn.isString(w)||(w=w?"include":"omit");const d="credentials"in Request.prototype;h=new Request(a,{...y,signal:b,method:g.toUpperCase(),headers:t.normalize().toJSON(),body:B,duplex:"half",credentials:d?w:void 0});let s=await fetch(h,y);const c=eb&&(u==="stream"||u==="response");if(eb&&(e||c&&n)){const m={};["status","statusText","headers"].forEach(P=>{m[P]=s[P]});const T=Hn.toFiniteNumber(s.headers.get("content-length")),[E,S]=e&&iT(T,hy(aT(e),!0))||[];s=new Response(cT(s.body,hT,E,()=>{S&&S(),n&&n()}),m)}u=u||"text";let f=await fy[Hn.findKey(fy,u)||"text"](s,r);return!c&&n&&n(),await new Promise((m,T)=>{nT(m,T,{data:f,headers:mu.from(s.headers),status:s.status,statusText:s.statusText,config:r,request:h})})}catch(d){throw n&&n(),d&&d.name==="TypeError"&&/Load failed|fetch/i.test(d.message)?Object.assign(new va("Network Error",va.ERR_NETWORK,r,h),{cause:d.cause||d}):va.from(d,d&&d.code,r,h)}})};Hn.forEach(tb,(r,a)=>{if(r){try{Object.defineProperty(r,"name",{value:a})}catch{}Object.defineProperty(r,"adapterName",{value:a})}});const pT=r=>`- ${r}`,Kde=r=>Hn.isFunction(r)||r===null||r===!1,fT={getAdapter:r=>{r=Hn.isArray(r)?r:[r];const{length:a}=r;let g,B;const J={};for(let C=0;C<a;C++){g=r[C];let x;if(B=g,!Kde(g)&&(B=tb[(x=String(g)).toLowerCase()],B===void 0))throw new va(`Unknown adapter '${x}'`);if(B)break;J[x||"#"+C]=B}if(!B){const C=Object.entries(J).map(([e,v])=>`adapter ${e} `+(v===!1?"is not supported by the environment":"is not available in the build"));let x=a?C.length>1?`since :
|
|
4084
4084
|
`+C.map(pT).join(`
|
|
@@ -4095,4 +4095,4 @@ ${n}`}return t.join(", ")}),C=p.computed(()=>{var t,w,y;const u=(y=(w=(t=g.repor
|
|
|
4095
4095
|
`)}])},p.toDisplayString(B.value),3)):p.createCommentVNode("",!0),p.createElementVNode("div",{class:p.normalizeClass(["separator",{"two-lines":B.value&&B.value.includes(`
|
|
4096
4096
|
`)}])},null,2),p.createElementVNode("span",Ime,[t[0]||(t[0]=p.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})],-1)),p.createElementVNode("span",Rme,p.toDisplayString(C.value||0),1)]),p.createElementVNode("span",Lme,[t[1]||(t[1]=p.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})],-1)),p.createElementVNode("span",zme,p.toDisplayString(x.value||0),1)])]),t[6]||(t[6]=p.createElementVNode("div",{class:"empty"},null,-1)),p.createElementVNode("div",Dme,[p.createElementVNode("span",Bme,p.toDisplayString(e.value||0),1),t[3]||(t[3]=p.createElementVNode("span",{class:"stat yellow"},[p.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})])],-1)),p.createElementVNode("span",Vme,p.toDisplayString(v.value||0),1),t[4]||(t[4]=p.createElementVNode("span",{class:"stat red"},[p.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})])],-1)),p.createElementVNode("div",{class:p.normalizeClass(["separator",{"two-lines":J.value&&J.value.includes(`
|
|
4097
4097
|
`)}])},null,2),J.value!==null?(p.openBlock(),p.createElementBlock("span",{key:0,class:p.normalizeClass(["stat time",{"two-lines":J.value&&J.value.includes(`
|
|
4098
|
-
`)}])},p.toDisplayString(J.value),3)):p.createCommentVNode("",!0),t[5]||(t[5]=p.createStaticVNode('<span class="stat ball" data-v-2a752817><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-2a752817><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path></svg></span>',1))])])])]))}},[["__scopeId","data-v-2a752817"]]),jme={class:"prematch-bg"},Ume={class:"subtitle"},qme={class:"jornada"},Wme={class:"fecha"},Gme={class:"teams-row"},Hme={class:"team team-local"},Xme={class:"escudo-svg"},Yme=["src"],Jme={class:"team team-visitor"},Kme={class:"escudo-svg"},Zme=["src"],Qme=ws({__name:"AnalisisPrematchType3",props:{report:{type:Object,default:()=>({})}},setup(r){function a(B){return B?B.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}const g=r;return(B,J)=>(p.openBlock(),p.createElementBlock("div",jme,[J[1]||(J[1]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),p.createElementVNode("div",Ume,[p.createElementVNode("span",qme,p.toDisplayString(a(g.report.game.matchday_name)),1),p.createElementVNode("span",Wme," - "+p.toDisplayString(p.unref(jd)(g.report.game.date_time_utc)),1)]),p.createElementVNode("div",Gme,[p.createElementVNode("div",Hme,[p.createElementVNode("span",Xme,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+g.report.game.home_team+".png"},null,8,Yme)])]),J[0]||(J[0]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",Jme,[p.createElementVNode("span",Kme,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+g.report.game.visiting_team+".png"},null,8,Zme)])])])]))}},[["__scopeId","data-v-23601285"]]),$me={class:"prematch-bg"},e0e={class:"subtitle"},t0e={class:"jornada"},r0e={class:"fecha"},n0e={class:"teams-row"},i0e={class:"team team-local"},a0e={class:"team-header"},o0e={class:"escudo-svg"},s0e=["src"],l0e={class:"score"},c0e={class:"players-list"},u0e={class:"player-name"},d0e={key:0,class:"more-events-indicator"},h0e={class:"team team-visitor"},p0e={class:"team-header"},f0e={class:"score"},m0e={class:"escudo-svg"},g0e=["src"],y0e={class:"players-list"},v0e={class:"player-name"},b0e={key:0},x0e={key:0,class:"more-events-indicator"},_0e=ws({__name:"AnalisisPostMatchType3",props:{report:{type:Object,default:()=>({})}},setup(r){var v,u;function a(t){return t?t.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}const g=r;console.log("Props report: ",g.report),console.log("Game minutes: ",(u=(v=g.report)==null?void 0:v.game)==null?void 0:u.report_minutes);const B=p.computed(()=>{var t,w,y;return(((y=(w=(t=g.report)==null?void 0:t.game)==null?void 0:w.report_minutes)==null?void 0:y.home_goals_minutes)||[]).slice(0,5)}),J=p.computed(()=>{var t,w,y;return(((y=(w=(t=g.report)==null?void 0:t.game)==null?void 0:w.report_minutes)==null?void 0:y.visiting_goals_minutes)||[]).slice(0,5)});function C(t){const w=Array.from(t.matchAll(/\d+\s*\+*\s*\d*'/g)).map(h=>h[0]).join(", "),y=t.match(/^(.*?)\s*\d+'/),b=y?" "+y[1].trim():"";return{minutos:w,nombre:b}}const x=p.computed(()=>{var w,y,b,h;return(((h=(b=(y=(w=g.report)==null?void 0:w.game)==null?void 0:y.report_minutes)==null?void 0:b.home_goals_minutes)==null?void 0:h.length)||0)>5}),e=p.computed(()=>{var w,y,b,h;return(((h=(b=(y=(w=g.report)==null?void 0:w.game)==null?void 0:y.report_minutes)==null?void 0:b.visiting_goals_minutes)==null?void 0:h.length)||0)>5});return(t,w)=>(p.openBlock(),p.createElementBlock("div",$me,[w[5]||(w[5]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),p.createElementVNode("div",e0e,[p.createElementVNode("span",t0e,"Jornada "+p.toDisplayString(a(r.report.game.matchday_name)),1),p.createElementVNode("span",r0e," - "+p.toDisplayString(p.unref(jd)(r.report.game.date_time_utc)),1)]),p.createElementVNode("div",n0e,[p.createElementVNode("div",i0e,[p.createElementVNode("div",a0e,[p.createElementVNode("span",o0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.home_team+".png"},null,8,s0e)]),p.createElementVNode("div",l0e,p.toDisplayString(r.report.game.score[0]),1)]),p.createElementVNode("div",c0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(B.value,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`home-event-${b}`,class:"player-item"},[p.createElementVNode("span",u0e,p.toDisplayString(y)+" ",1),w[0]||(w[0]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"})])],-1))]))),128)),x.value?(p.openBlock(),p.createElementBlock("div",d0e,[...w[1]||(w[1]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])]),w[4]||(w[4]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",h0e,[p.createElementVNode("div",p0e,[p.createElementVNode("div",f0e,p.toDisplayString(r.report.game.score[1]),1),p.createElementVNode("span",m0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.visiting_team+".png"},null,8,g0e)])]),p.createElementVNode("div",y0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(J.value,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`visiting-event-${b}`,class:"player-item"},[w[2]||(w[2]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),p.createElementVNode("span",v0e,[p.createTextVNode(p.toDisplayString(C(y).minutos)+" ",1),C(y).nombre?(p.openBlock(),p.createElementBlock("span",b0e,p.toDisplayString(C(y).nombre),1)):p.createCommentVNode("",!0)])]))),128)),e.value?(p.openBlock(),p.createElementBlock("div",x0e,[...w[3]||(w[3]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-78a5f6b6"]]),w0e={class:"prematch-bg"},T0e={class:"subtitle"},k0e={class:"jornada"},S0e={class:"fecha"},E0e={class:"teams-row"},A0e={class:"team team-local"},C0e={class:"escudo-svg"},M0e=["src"],P0e={class:"team team-visitor"},N0e={class:"escudo-svg"},O0e=["src"],I0e=ws({__name:"AnalisisPrematchType4",props:{report:{type:Object,default:()=>({})}},setup(r){function a(B){return B?B.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}const g=r;return(B,J)=>(p.openBlock(),p.createElementBlock("div",w0e,[J[1]||(J[1]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),p.createElementVNode("div",T0e,[p.createElementVNode("span",k0e,p.toDisplayString(a(g.report.game.matchday_name)),1),p.createElementVNode("span",S0e," - "+p.toDisplayString(p.unref(jd)(g.report.game.date_time_utc)),1)]),p.createElementVNode("div",E0e,[p.createElementVNode("div",A0e,[p.createElementVNode("span",C0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+g.report.game.home_team+".png"},null,8,M0e)])]),J[0]||(J[0]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",P0e,[p.createElementVNode("span",N0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+g.report.game.visiting_team+".png"},null,8,O0e)])])])]))}},[["__scopeId","data-v-347d4c02"]]),R0e={class:"prematch-bg"},L0e={class:"subtitle"},z0e={class:"jornada"},D0e={class:"fecha"},B0e={class:"teams-row"},V0e={class:"team team-local"},F0e={class:"team-header"},j0e={class:"escudo-svg"},U0e=["src"],q0e={class:"score"},W0e={class:"players-list"},G0e={class:"player-name"},H0e={key:0,class:"more-events-indicator"},X0e={class:"team team-visitor"},Y0e={class:"team-header"},J0e={class:"score"},K0e={class:"escudo-svg"},Z0e=["src"],Q0e={class:"players-list"},$0e={class:"player-name"},ege={key:0},tge={key:0,class:"more-events-indicator"},rge=ws({__name:"AnalisisPostMatchType4",props:{report:{type:Object,default:()=>({})}},setup(r){var v,u;function a(t){return t?t.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}const g=r;console.log("Props report: ",g.report),console.log("Game minutes: ",(u=(v=g.report)==null?void 0:v.game)==null?void 0:u.report_minutes);const B=p.computed(()=>{var t,w,y;return(((y=(w=(t=g.report)==null?void 0:t.game)==null?void 0:w.report_minutes)==null?void 0:y.home_goals_minutes)||[]).slice(0,5)}),J=p.computed(()=>{var t,w,y;return(((y=(w=(t=g.report)==null?void 0:t.game)==null?void 0:w.report_minutes)==null?void 0:y.visiting_goals_minutes)||[]).slice(0,5)});function C(t){const w=Array.from(t.matchAll(/\d+\s*\+*\s*\d*'/g)).map(h=>h[0]).join(", "),y=t.match(/^(.*?)\s*\d+'/),b=y?y[1].trim():"";return{minutos:w,nombre:b}}const x=p.computed(()=>{var w,y,b,h;return(((h=(b=(y=(w=g.report)==null?void 0:w.game)==null?void 0:y.report_minutes)==null?void 0:b.home_goals_minutes)==null?void 0:h.length)||0)>5}),e=p.computed(()=>{var w,y,b,h;return(((h=(b=(y=(w=g.report)==null?void 0:w.game)==null?void 0:y.report_minutes)==null?void 0:b.visiting_goals_minutes)==null?void 0:h.length)||0)>5});return(t,w)=>(p.openBlock(),p.createElementBlock("div",R0e,[w[5]||(w[5]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),p.createElementVNode("div",L0e,[p.createElementVNode("span",z0e,"Jornada "+p.toDisplayString(a(r.report.game.matchday_name)),1),p.createElementVNode("span",D0e," - "+p.toDisplayString(p.unref(jd)(r.report.game.date_time_utc)),1)]),p.createElementVNode("div",B0e,[p.createElementVNode("div",V0e,[p.createElementVNode("div",F0e,[p.createElementVNode("span",j0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.home_team+".png"},null,8,U0e)]),p.createElementVNode("div",q0e,p.toDisplayString(r.report.game.score[0]),1)]),p.createElementVNode("div",W0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(B.value,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`home-event-${b}`,class:"player-item"},[p.createElementVNode("span",G0e,p.toDisplayString(y)+" ",1),w[0]||(w[0]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"})])],-1))]))),128)),x.value?(p.openBlock(),p.createElementBlock("div",H0e,[...w[1]||(w[1]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])]),w[4]||(w[4]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",X0e,[p.createElementVNode("div",Y0e,[p.createElementVNode("div",J0e,p.toDisplayString(r.report.game.score[1]),1),p.createElementVNode("span",K0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.visiting_team+".png"},null,8,Z0e)])]),p.createElementVNode("div",Q0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(J.value,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`visiting-event-${b}`,class:"player-item"},[w[2]||(w[2]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),p.createElementVNode("span",$0e,[p.createTextVNode(p.toDisplayString(C(y).minutos)+" ",1),C(y).nombre?(p.openBlock(),p.createElementBlock("span",ege," "+p.toDisplayString(C(y).nombre),1)):p.createCommentVNode("",!0)])]))),128)),e.value?(p.openBlock(),p.createElementBlock("div",tge,[...w[3]||(w[3]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-4bfbb192"]]),nge={class:"report-card",style:{position:"relative"}},ige={class:"report-img-placeholder",style:{position:"relative"}},age={class:"inner-card-report"},oge={class:"report-footer"},sge={class:"report-title"},lge={class:"report-template"},cge={class:"template-name"},uge={class:"report-league"},dge={class:"report-tournament"},hge=ws({__name:"ReportItem",props:{type:{type:Number,default:1},localTeam:{type:String,default:"América"},report:{type:Object,default:()=>{}},visitorTeam:{type:String,default:"Chivas"},localScore:{type:Number,default:2},visitorScore:{type:Number,default:1},league:{type:String,default:"Liga MX"},date:{type:String,default:"15 Nov 2024"}},emits:["ver-reporte","renombrar","eliminar","edit-template","open-report","download-report"],setup(r,{emit:a}){const g=a,B=r,J=p.ref(!1);function C(){J.value=!1,g("open-report",B.report)}function x(){console.log("renombrar"),J.value=!1,g("renombrar",B.report.report_name||"Reporte",B.report.id)}function e(){console.log("editar"),J.value=!1,g("edit-template",B.report)}function v(){console.log("duplicar"),J.value=!1}function u(){console.log("eliminar"),J.value=!1,g("eliminar",B.report)}function t(){console.log("descargar"),g("download-report",B.report),J.value=!1}function w(b){return b?b.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}function y(){g("open-report",B.report)}return(b,h)=>(p.openBlock(),p.createElementBlock("div",nge,[p.createElementVNode("div",{class:"three-dots",onClick:h[0]||(h[0]=p.withModifiers(n=>J.value=!J.value,["stop"]))},[...h[4]||(h[4]=[p.createElementVNode("span",null,null,-1),p.createElementVNode("span",null,null,-1),p.createElementVNode("span",null,null,-1)])]),p.createElementVNode("div",ige,[r.report.template_type===1&&r.report.pages[0].type==1?(p.openBlock(),p.createBlock(pfe,{key:0,"local-team":r.localTeam,"visitor-team":r.visitorTeam,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==1?(p.openBlock(),p.createBlock(Wfe,{key:1,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):p.createCommentVNode("",!0),r.report.template_type===1&&r.report.pages[0].type==2?(p.openBlock(),p.createBlock(cme,{key:2,"local-team":r.localTeam,"visitor-team":r.visitorTeam,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==2?(p.openBlock(),p.createBlock(Fme,{key:3,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):p.createCommentVNode("",!0),r.report.template_type===1&&r.report.pages[0].type==3?(p.openBlock(),p.createBlock(Qme,{key:4,"local-team":r.localTeam,"visitor-team":r.visitorTeam,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==3?(p.openBlock(),p.createBlock(_0e,{key:5,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.report.template_type===1&&r.report.pages[0].type==4?(p.openBlock(),p.createBlock(I0e,{key:6,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==4?(p.openBlock(),p.createBlock(rge,{key:7,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):p.createCommentVNode("",!0),p.createElementVNode("div",{class:"report-img-overlay"},[p.createElementVNode("button",{class:"report-img-button",onClick:y},"Ver reporte")])]),p.createElementVNode("div",age,[p.createElementVNode("div",oge,[p.createElementVNode("div",sge,p.toDisplayString(r.report.report_name),1),p.createElementVNode("div",lge,[h[5]||(h[5]=p.createTextVNode(" Template: ",-1)),p.createElementVNode("span",cge,p.toDisplayString(r.report.name),1)]),p.createElementVNode("div",uge,p.toDisplayString(r.report.season_name)+" - "+p.toDisplayString(w(r.report.game.matchday_name))+" | "+p.toDisplayString(p.unref(jd)(r.report.game.date_time_utc)),1),p.createElementVNode("div",dge,p.toDisplayString(r.report.tournament_name),1)])]),J.value?(p.openBlock(),p.createBlock(Ype,{key:0,onClick:h[1]||(h[1]=p.withModifiers(n=>J.value=!1,["self"])),onMouseleave:h[2]||(h[2]=n=>J.value=!1),onVerReporte:C,onRenombrar:x,onEditar:e,onDuplicar:v,onEliminar:u,onDescargar:t})):p.createCommentVNode("",!0),J.value?(p.openBlock(),p.createElementBlock("div",{key:1,class:"tooltip-overlay",onClick:h[3]||(h[3]=n=>J.value=!1)})):p.createCommentVNode("",!0)]))}},[["__scopeId","data-v-a75289c7"]]),pge={class:"modal-overlay"},fge={class:"modal-content"},mge={class:"modal-body"},gge=["placeholder","disabled"],yge={key:0,class:"error-message"},vge={class:"modal-footer"},bge=["disabled"],xge=["disabled"],_ge={key:0},wge={key:1},Tge=ws({__name:"ModalRenameReporte",props:{initialName:{type:String,required:!0},templateType:{type:String,required:!0},token:{type:String,required:!0},userId:{type:[String,Number],required:!0},reportId:{type:[String,Number],required:!0}},emits:["close","rename","refresh"],setup(r,{emit:a}){const g=r,B=a,J=p.ref(g.initialName),C=p.ref(!1),x=p.ref("");p.watch(()=>g.initialName,v=>{J.value=v,x.value=""});async function e(){var v;if(console.log("acceptRename"),!(J.value.trim().length<3)){console.log("acceptRename 22"),C.value=!0,x.value="";try{await to.create({headers:{Authorization:`${g.token}`}}).put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${g.userId}/reports/${g.reportId}/rename`,{name:J.value.trim()}),B("rename",J.value.trim()),B("refresh"),B("close")}catch(u){console.error("Error al renombrar el reporte:",u),((v=u.response)==null?void 0:v.status)===409?x.value="Ya existe un reporte con el mismo nombre":x.value="Error al renombrar el reporte. Inténtalo de nuevo."}finally{C.value=!1}}}return p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""}),(v,u)=>(p.openBlock(),p.createElementBlock("div",pge,[p.createElementVNode("div",fge,[p.createElementVNode("button",{class:"close-btn",onClick:u[0]||(u[0]=t=>v.$emit("close"))},[...u[3]||(u[3]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),u[5]||(u[5]=p.createElementVNode("div",{class:"modal-header"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),p.createElementVNode("span",{class:"modal-title"},"Renombrar Reporte")],-1)),u[6]||(u[6]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",mge,[u[4]||(u[4]=p.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),p.withDirectives(p.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":u[1]||(u[1]=t=>J.value=t),placeholder:r.initialName,maxlength:"40",autocomplete:"off",disabled:C.value},null,8,gge),[[p.vModelText,J.value]]),x.value?(p.openBlock(),p.createElementBlock("div",yge,p.toDisplayString(x.value),1)):p.createCommentVNode("",!0)]),u[7]||(u[7]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",vge,[p.createElementVNode("button",{class:"cancel-btn",onClick:u[2]||(u[2]=t=>v.$emit("close")),disabled:C.value},"Cancelar",8,bge),p.createElementVNode("button",{class:"next-btn",disabled:J.value.trim().length<3||C.value,onClick:e},[C.value?(p.openBlock(),p.createElementBlock("span",_ge,"Guardando...")):(p.openBlock(),p.createElementBlock("span",wge,"Guardar"))],8,xge)])])]))}},[["__scopeId","data-v-3a66dd5f"]]),kge={class:"modal-overlay"},Sge={class:"modal-content"},Ege={class:"modal-footer"},Age=["disabled"],Cge=["disabled"],Mge=ws({__name:"ModalDeleteReport",props:{reportId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","reportDeleted"],setup(r,{emit:a}){const g=r,B=a,J=p.ref(!1),C=async()=>{try{J.value=!0;const e=await to.create({headers:{Authorization:`${g.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${g.userId}/reports/${g.reportId}`);console.log("Reporte eliminado exitosamente:",e.data),B("reportDeleted",g.reportId),B("close")}catch(x){console.error("Error al eliminar el reporte:",x),alert("Error al eliminar el reporte. Por favor, intenta de nuevo.")}finally{J.value=!1}};return p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""}),(x,e)=>(p.openBlock(),p.createElementBlock("div",kge,[p.createElementVNode("div",Sge,[p.createElementVNode("button",{class:"close-btn",onClick:e[0]||(e[0]=v=>x.$emit("close"))},[...e[2]||(e[2]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),e[3]||(e[3]=p.createStaticVNode('<div class="modal-header" data-v-8c239161><img src="https://golstatsimages.blob.core.windows.net/reports-images/icn-delete-delete.svg" class="icon-title" alt="icon" data-v-8c239161><span class="modal-title" data-v-8c239161>Eliminar reporte</span></div><div class="header-separator" data-v-8c239161></div><div class="modal-body confirm-text" data-v-8c239161> ¿Estás seguro que deseas eliminar<br data-v-8c239161> este reporte? Si lo haces no habrá manera<br data-v-8c239161> de recuperarlo. </div><div class="header-separator" data-v-8c239161></div>',4)),p.createElementVNode("div",Ege,[p.createElementVNode("button",{class:"cancel-btn",onClick:e[1]||(e[1]=v=>x.$emit("close")),disabled:J.value},"Cancelar",8,Age),p.createElementVNode("button",{class:"delete-btn",onClick:C,disabled:J.value},p.toDisplayString(J.value?"Eliminando...":"Eliminar"),9,Cge)])])]))}},[["__scopeId","data-v-8c239161"]]),Pge={class:"reports-header"},Nge={class:"count"},Oge={key:0,class:"sort-options"},Ige=["onClick"],Rge={key:0,class:"checkmark"},Lge={key:0,class:"loading-state"},zge={key:1,class:"error-state"},Dge={key:3,class:"empty-reports"},Bge={key:4,class:"empty-reports"},Vge=ws({__name:"ReportsSection",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0},searchQuery:{type:String,default:""}},emits:["open-report"],setup(r,{emit:a}){const g=r,B=a,J=p.ref([]),C=p.ref(!1),x=p.ref(null),e=p.computed(()=>{let V=J.value;if(g.searchQuery.trim()){const U=g.searchQuery.toLowerCase().trim();V=J.value.filter(q=>{var re,ee,K,te,ae,oe,he;return!!((((re=q.report_name)==null?void 0:re.toLowerCase())||"").includes(U)||(((ee=q.name)==null?void 0:ee.toLowerCase())||"").includes(U)||q.created_at&&new Date(q.created_at).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(U)||(K=q.game)!=null&&K.date_time_utc&&new Date(q.game.date_time_utc).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(U)||(((ae=(te=q.game)==null?void 0:te.season_name)==null?void 0:ae.toLowerCase())||"").includes(U)||(((oe=q.tournament_name)==null?void 0:oe.toLowerCase())||"").includes(U)||(he=q.game)!=null&&he.matchday&&q.game.matchday.toString().includes(U))})}return u.value&&(V=[...V].sort((U,q)=>{var W,Z;if(u.value==="A - Z"){const ne=(U.report_name||"").toLowerCase(),X=(q.report_name||"").toLowerCase();return ne.localeCompare(X,"es",{sensitivity:"base"})}else if(u.value==="Más recientes"){const ne=new Date(U.created_at||0);return new Date(q.created_at||0)-ne}else if(u.value==="Torneo"){const ne=(U.tournament_name||"").toLowerCase(),X=(q.tournament_name||"").toLowerCase();if(ne!==X)return ne.localeCompare(X,"es",{sensitivity:"base"});const re=U.season_id||0;return(q.season_id||0)-re}else if(u.value==="Jornada"){const ne=((W=U.game)==null?void 0:W.matchday_id)||0,X=((Z=q.game)==null?void 0:Z.matchday_id)||0;return ne-X}return 0})),V}),v=p.ref(!1),u=p.ref("Más recientes"),t=p.ref(!1),w=p.ref(""),y=p.ref(""),b=p.ref(""),h=p.ref(!1),n=p.ref(""),i=p.ref(""),d=p.ref(null),s=p.ref(null),c=p.ref(null),f=p.ref(0),m=[{label:"A - Z",value:"A - Z"},{label:"Más recientes",value:"Más recientes"},{label:"Torneo",value:"Torneo"},{label:"Jornada",value:"Jornada"}],T=async()=>{C.value=!0,x.value=null;try{const V=await to.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${g.userId}/reports`,{headers:{Authorization:`${g.token}`,"Content-Type":"application/json"}});V.data&&Array.isArray(V.data)?J.value=V.data:V.data&&V.data.reports?J.value=V.data.reports:V.data&&V.data.data?J.value=V.data.data:J.value=[]}catch(V){console.error("Error cargando reportes:",V),console.error("Error response:",V.response),x.value=V.message||"Error al cargar los reportes",J.value=[]}finally{C.value=!1}},E=p.computed(()=>{if(!f.value)return"grid-1-column";const V=340,U=20,W=f.value-40,Z=Math.floor((W+U)/(V+U)),ne=Math.max(1,Z);return ne>=4?"grid-4-columns":ne>=3?"grid-3-columns":ne>=2?"grid-2-columns":"grid-1-column"}),S=()=>{v.value=!v.value},P=V=>{console.log("Ordenando por:",V),u.value=V,v.value=!1};function N(V){console.log("reports section onOpenReport",V),B("open-report",V)}const A=(V,U)=>{w.value=V,y.value=U;const q=J.value.find(W=>W.id===U);b.value=q?q.template_type:"",t.value=!0},O=V=>{console.log("Renombrar reporte de",w.value,"a",V),t.value=!1;const U=J.value.findIndex(q=>q.id===y.value);U!==-1&&(J.value[U].report_name=V)},M=V=>{n.value=V.report_name||"Reporte",i.value=V.id,h.value=!0},k=V=>{h.value=!1,J.value=J.value.filter(U=>U.id!==V)};function I(V){console.log("Descargando reporte:",V),B("download-report",V)}const _=V=>{v.value&&d.value&&!d.value.contains(V.target)&&(v.value=!1)},R=()=>{s.value&&(f.value=s.value.offsetWidth)};let z=null;return p.onMounted(async()=>{document.addEventListener("mousedown",_),await T(),await p.nextTick(),R(),window.ResizeObserver?(z=new ResizeObserver(()=>{R()}),s.value&&z.observe(s.value)):window.addEventListener("resize",R)}),p.onBeforeUnmount(()=>{document.removeEventListener("mousedown",_),z?z.disconnect():window.removeEventListener("resize",R)}),(V,U)=>(p.openBlock(),p.createElementBlock("div",{class:"reports-section",ref_key:"reportsSectionRef",ref:s},[p.createElementVNode("div",Pge,[p.createElementVNode("span",null,[U[2]||(U[2]=p.createTextVNode("Reportes ",-1)),p.createElementVNode("span",Nge,"("+p.toDisplayString(e.value.length)+")",1)]),p.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:d},[p.createElementVNode("button",{class:"sort-button",onClick:S},[p.createTextVNode(p.toDisplayString(u.value||"Ordenar")+" ",1),p.createElementVNode("span",{class:p.normalizeClass(["dropdown-arrow",{rotated:v.value}])},null,2)]),v.value?(p.openBlock(),p.createElementBlock("div",Oge,[(p.openBlock(),p.createElementBlock(p.Fragment,null,p.renderList(m,q=>p.createElementVNode("div",{key:q.value,class:p.normalizeClass(["sort-option",{selected:u.value===q.value}]),onClick:W=>u.value!==q.value&&P(q.value)},[p.createElementVNode("span",null,p.toDisplayString(q.label),1),u.value===q.value?(p.openBlock(),p.createElementBlock("span",Rge,[...U[3]||(U[3]=[p.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)],10,Ige)),64))])):p.createCommentVNode("",!0)],512)]),C.value?(p.openBlock(),p.createElementBlock("div",Lge,[...U[4]||(U[4]=[p.createElementVNode("div",{class:"loading-spinner"},null,-1),p.createElementVNode("p",null,"Cargando reportes...",-1)])])):x.value?(p.openBlock(),p.createElementBlock("div",zge,[p.createElementVNode("p",null,"Error al cargar reportes: "+p.toDisplayString(x.value),1),p.createElementVNode("button",{onClick:T,class:"retry-button"},"Reintentar")])):(p.openBlock(),p.createElementBlock("div",{key:2,class:p.normalizeClass(["reports-grid",E.value]),ref_key:"reportsGridRef",ref:c},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.value,q=>(p.openBlock(),p.createBlock(hge,{key:q.id,report:q,onOpenReport:N,onRenombrar:A,onEliminar:M,onDownloadReport:I},null,8,["report"]))),128))],2)),!C.value&&!x.value&&J.value.length===0?(p.openBlock(),p.createElementBlock("div",Dge," No tienes reportes aún. ")):p.createCommentVNode("",!0),!C.value&&!x.value&&J.value.length>0&&e.value.length===0?(p.openBlock(),p.createElementBlock("div",Bge," No se encontraron reportes que coincidan con tu búsqueda. ")):p.createCommentVNode("",!0),t.value?(p.openBlock(),p.createBlock(Tge,{key:5,initialName:w.value,templateType:b.value,token:r.token,userId:r.userId,reportId:y.value,onClose:U[0]||(U[0]=q=>t.value=!1),onRename:O,onRefresh:T},null,8,["initialName","templateType","token","userId","reportId"])):p.createCommentVNode("",!0),h.value?(p.openBlock(),p.createBlock(Mge,{key:6,"report-id":i.value,"user-id":r.userId,token:r.token,onClose:U[1]||(U[1]=q=>h.value=!1),onReportDeleted:k},null,8,["report-id","user-id","token"])):p.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-70130c65"]]),Fge={class:"modal-overlay"},jge={class:"modal-content"},Uge=ws({__name:"ModalSoloEscritorio",setup(r){return(a,g)=>(p.openBlock(),p.createElementBlock("div",Fge,[p.createElementVNode("div",jge,[g[1]||(g[1]=p.createStaticVNode('<div class="modal-icon" data-v-76d7f6ed><svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-76d7f6ed><rect x="8" y="10" width="32" height="20" rx="2" stroke="#C0CBE0" stroke-width="2" data-v-76d7f6ed></rect><rect x="16" y="34" width="16" height="2" rx="1" fill="#C0CBE0" data-v-76d7f6ed></rect></svg></div><div class="modal-text" data-v-76d7f6ed> Esta sección solo está disponible para<br data-v-76d7f6ed> escritorio. Utiliza tu computadora <br data-v-76d7f6ed>para ingresar. </div>',2)),p.createElementVNode("button",{class:"modal-btn",onClick:g[0]||(g[0]=B=>a.$emit("toHome"))},"OK")])]))}},[["__scopeId","data-v-76d7f6ed"]]),qge={class:"top-bar"},Wge={class:"tabs-container"},Gge={class:"tabs"},Hge={key:0,class:"actions"},Xge={class:"search-container"},Yge={key:1,class:"actions"},Jge={class:"search-container"},Kge=ws({__name:"gsc-reports",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0}},emits:["toHome","download-report"],setup(r,{emit:a}){const g=r,{userId:B,team:J,token:C}=g,x=p.ref("templates"),e=p.ref(!1),v=p.ref(null),u=p.ref(!1),t=p.ref(""),w=p.ref(""),y=p.ref(null),b=p.ref(null),h=p.ref(0),n=a;function i(){if(v.value){const P=v.value.offsetWidth;e.value=P<1028}}p.watch(e,P=>{P?document.body.style.overflow="hidden":document.body.style.overflow=""}),p.onBeforeUnmount(()=>{document.body.style.overflow=""}),p.onMounted(()=>{i(),window.addEventListener("resize",i)}),p.onBeforeUnmount(()=>{window.removeEventListener("resize",i)});function d(P){console.log("onOpenModalNewTemplate, gsc-reports:",P),s(P)}function s(P){console.log("onEditTemplate, template:",P),console.log("Edicion es: "),console.log({template:P,isTemplateMode:!0}),y.value.show({template:P,isTemplateMode:!0})}const c=()=>{t.value=""},f=()=>{w.value=""};function m(P){console.log("gsc-report onOpenReport, report:",P),y.value&&y.value.show({template:P,isTemplateMode:!1})}function T(P){n("download-report",P)}function E(){n("toHome")}function S(){b.value&&b.value.obtenerTemplates(),h.value+=1}return(P,N)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(p.unref(Nue),{ref_key:"reportTemplateMaker",ref:y,token:p.unref(C),"user-team-id":p.unref(J),onClose:S},null,8,["token","user-team-id"]),p.createElementVNode("div",{ref_key:"containerRef",ref:v,class:"reports-container"},[e.value?(p.openBlock(),p.createBlock(Uge,{key:0,onToHome:E})):p.createCommentVNode("",!0),N[12]||(N[12]=p.createElementVNode("h1",{class:"title"},"Mis reportes",-1)),p.createElementVNode("div",qge,[p.createElementVNode("div",Wge,[p.createElementVNode("div",Gge,[p.createElementVNode("div",{class:p.normalizeClass(["tab tab-templates",{active:x.value==="templates"}]),onClick:N[0]||(N[0]=A=>x.value="templates")}," Templates ",2),p.createElementVNode("div",{class:p.normalizeClass(["tab tab-reports",{active:x.value==="reports"}]),onClick:N[1]||(N[1]=A=>x.value="reports")}," Tus reportes ",2)])]),x.value==="templates"?(p.openBlock(),p.createElementBlock("div",Hge,[p.createElementVNode("div",Xge,[N[8]||(N[8]=p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":N[2]||(N[2]=A=>t.value=A),class:"search",type:"text",placeholder:"Buscar template"},null,512),[[p.vModelText,t.value]]),t.value?(p.openBlock(),p.createElementBlock("button",{key:0,onClick:c,class:"clear-search-btn",type:"button"},[...N[7]||(N[7]=[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)]),p.createElementVNode("button",{class:"create-template-btn",onClick:N[3]||(N[3]=A=>u.value=!0)},[...N[9]||(N[9]=[p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-agregar@3x.png",alt:"Agregar",class:"create-icon"},null,-1),p.createTextVNode(" Crear template ",-1)])])])):p.createCommentVNode("",!0),x.value==="reports"?(p.openBlock(),p.createElementBlock("div",Yge,[p.createElementVNode("div",Jge,[N[11]||(N[11]=p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":N[4]||(N[4]=A=>w.value=A),class:"search search-reports",type:"text",placeholder:"Buscar reporte"},null,512),[[p.vModelText,w.value]]),w.value?(p.openBlock(),p.createElementBlock("button",{key:0,onClick:f,class:"clear-search-btn",type:"button"},[...N[10]||(N[10]=[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)])])):p.createCommentVNode("",!0)]),x.value==="templates"?(p.openBlock(),p.createBlock(Hpe,{ref_key:"templatesSectionRef",ref:b,userId:p.unref(B),token:p.unref(C),team:p.unref(J),searchQuery:t.value,key:h.value,onSwitchToReports:N[5]||(N[5]=A=>x.value="reports"),onOpenModalNewTemplate:d,onEditTemplate:s},null,8,["userId","token","team","searchQuery"])):(p.openBlock(),p.createBlock(Vge,{key:2,userId:p.unref(B),token:p.unref(C),team:p.unref(J),searchQuery:w.value,onOpenReport:m,onDownloadReport:T},null,8,["userId","token","team","searchQuery"])),u.value?(p.openBlock(),p.createBlock(bT,{key:3,token:p.unref(C),team:p.unref(J),onOpenModalNewTemplate:d,onClose:N[6]||(N[6]=A=>u.value=!1)},null,8,["token","team"])):p.createCommentVNode("",!0)],512)],64))}},[["__scopeId","data-v-717aa34b"]]),Zge={class:"subcategory-group"},Qge={__name:"SubcategoryGroup",props:{subcategoryGroup:{type:Array,default:()=>[]}},setup(r){return(a,g)=>(p.openBlock(),p.createElementBlock("div",Zge,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.subcategoryGroup,B=>(p.openBlock(),p.createBlock(p.unref(K1),{key:B.id,modelValue:B.isSelected,"onUpdate:modelValue":J=>B.isSelected=J,label:B.name},null,8,["modelValue","onUpdate:modelValue","label"]))),128))]))}},$ge=nu(Qge,[["__scopeId","data-v-ae6f3d72"]]),eye={class:"filter-subcategories"},tye=Object.freeze(Object.defineProperty({__proto__:null,default:nu({__name:"FilterSubcategories",props:{subcategoryGroups:{type:Array,default:()=>[]}},setup(r){return(a,g)=>(p.openBlock(),p.createElementBlock("div",eye,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.subcategoryGroups,B=>(p.openBlock(),p.createElementBlock("div",{key:B.id,class:"filter-subcategories__group"},[p.createVNode($ge,{subcategoryGroup:B},null,8,["subcategoryGroup"])]))),128))]))}},[["__scopeId","data-v-5edaefc2"]])},Symbol.toStringTag,{value:"Module"})),yy=r=>(p.pushScopeId("data-v-80d9c265"),r=r(),p.popScopeId(),r),rye={class:"details__header"},nye=yy(()=>p.createElementVNode("div",{class:"details__header__title"},"Jugando como",-1)),iye={class:"details__header__checkbox"},aye={class:"details__body"},oye={class:"details__body__playing-as"},sye=["onClick"],lye={class:"details__header"},cye=yy(()=>p.createElementVNode("div",{class:"details__header__title"},"En: (Elige el lapso de tiempo)",-1)),uye={class:"details__header__checkbox"},dye={class:"details__body"},hye=yy(()=>p.createElementVNode("div",{class:"details__body__title"},"1er tiempo",-1)),pye={class:"details__body__game-section"},fye=["onClick"],mye={class:"details__body"},gye=yy(()=>p.createElementVNode("div",{class:"details__body__title"},"2do tiempo",-1)),yye={class:"details__body__game-section"},vye=["onClick"],bye=Object.freeze(Object.defineProperty({__proto__:null,default:nu({__name:"FilterConditions",props:{playingAs:{type:Array,default:()=>[{name:"Local",isSelected:!0},{name:"Visitante",isSelected:!0}]},gameSections:{type:Array,default:()=>[{text:"0-15",value:1,isSelected:!0},{text:"16-30",value:2,isSelected:!0},{text:"31-45",value:3,isSelected:!0},{text:"46-60",value:4,isSelected:!0},{text:"61-75",value:5,isSelected:!0},{text:"76-90",value:6,isSelected:!0}]},buttonsBackgroundColor:{type:String,default:"rgba(255, 255, 255, 0)"},buttonsBackgroundColorActive:{type:String,default:"rgba(203, 238, 107, 0.05)"},buttonsTextColor:{type:String,default:"rgba(255, 255, 255, 0.8)"},buttonsTextColorActive:{type:String,default:"rgba(255, 255, 255, 1)"},buttonsBorderColor:{type:String,default:"#8ea2ab"},buttonsBorderColorActive:{type:String,default:"#cbee6b"},buttonsBorderWidth:{type:String,default:"0.8px"},buttonsBorderWidthActive:{type:String,default:"1px"},buttonsBorderRadius:{type:String,default:"4px"}},setup(r){const a=r;p.useCssVars(t=>({"49cba245":r.buttonsBackgroundColor,"52f02da6":r.buttonsTextColor,"7d3f686a":r.buttonsBorderWidth,"7c286a07":r.buttonsBorderColor,"24a6f4aa":r.buttonsBackgroundColorActive,cd8d7768:r.buttonsTextColorActive,"35fa5c10":r.buttonsBorderWidthActive,"0cde1826":r.buttonsBorderColorActive}));const g=p.computed(()=>a.playingAs.every(t=>t.isSelected)),B=p.computed(()=>a.gameSections.every(t=>t.isSelected)),J=p.computed(()=>a.gameSections.reduce((t,w)=>(w.value<=3?t.firstHalf.push(w):t.secondHalf.push(w),t),{firstHalf:[],secondHalf:[]})),C=p.computed(()=>({"--border-radius-first-button":`${a.buttonsBorderRadius} 0 0 ${a.buttonsBorderRadius}`,"--border-radius-last-button":`0 ${a.buttonsBorderRadius} ${a.buttonsBorderRadius} 0`}));function x(t){t?a.playingAs.forEach(w=>{w.isSelected=!0}):a.playingAs.forEach((w,y)=>{w.isSelected=y===0})}function e(t){a.playingAs.filter(w=>w.isSelected).length===1&&t.isSelected||(t.isSelected=!t.isSelected)}function v(t){a.gameSections.filter(w=>w.isSelected).length===1&&t.isSelected||(t.isSelected=!t.isSelected)}function u(t){t?a.gameSections.forEach(w=>{w.isSelected=!0}):a.gameSections.forEach((w,y)=>{w.isSelected=y===0})}return(t,w)=>(p.openBlock(),p.createElementBlock("div",{class:"details",style:p.normalizeStyle(C.value)},[p.createElementVNode("div",rye,[nye,p.createElementVNode("div",iye,[p.createVNode(p.unref(K1),{label:"Todos","model-value":g.value,"onUpdate:modelValue":x},null,8,["model-value"])])]),p.createElementVNode("div",aye,[p.createElementVNode("div",oye,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(a.playingAs,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`pa${b}`,class:p.normalizeClass(["details__body__button",{active:y.isSelected}]),onClick:h=>e(y)},p.toDisplayString(y.name),11,sye))),128))])]),p.createElementVNode("div",lye,[cye,p.createElementVNode("div",uye,[p.createVNode(p.unref(K1),{label:"Todos","model-value":B.value,"onUpdate:modelValue":u},null,8,["model-value"])])]),p.createElementVNode("div",dye,[hye,p.createElementVNode("div",pye,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(J.value.firstHalf,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`pa${b}`,class:p.normalizeClass(["details__body__button",{active:y.isSelected}]),onClick:h=>v(y)},p.toDisplayString(y.text),11,fye))),128))])]),p.createElementVNode("div",mye,[gye,p.createElementVNode("div",yye,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(J.value.secondHalf,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`pa${b}`,class:p.normalizeClass(["details__body__button",{active:y.isSelected}]),onClick:h=>v(y)},p.toDisplayString(y.text),11,vye))),128))])])],4))}},[["__scopeId","data-v-80d9c265"]])},Symbol.toStringTag,{value:"Module"})),xye={class:"filter-field"},_ye=Object.freeze(Object.defineProperty({__proto__:null,default:nu({__name:"FilterField",setup(r){const a=p.ref(Array.from({length:16},(B,J)=>J+1));function g(){}return(B,J)=>(p.openBlock(),p.createElementBlock("div",xye,[p.createVNode(p.unref(FI),{width:"100%","background-color":"#2E3B46",value:a.value,"onUpdate:modelValue":g},null,8,["value"])]))}},[["__scopeId","data-v-8103c3e1"]])},Symbol.toStringTag,{value:"Module"}));Ah.GSCReports=Kge,Object.defineProperty(Ah,Symbol.toStringTag,{value:"Module"})}));
|
|
4098
|
+
`)}])},p.toDisplayString(J.value),3)):p.createCommentVNode("",!0),t[5]||(t[5]=p.createStaticVNode('<span class="stat ball" data-v-2a752817><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-2a752817><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-2a752817></path></svg></span>',1))])])])]))}},[["__scopeId","data-v-2a752817"]]),jme={class:"prematch-bg"},Ume={class:"subtitle"},qme={class:"jornada"},Wme={class:"fecha"},Gme={class:"teams-row"},Hme={class:"team team-local"},Xme={class:"escudo-svg"},Yme=["src"],Jme={class:"team team-visitor"},Kme={class:"escudo-svg"},Zme=["src"],Qme=ws({__name:"AnalisisPrematchType3",props:{report:{type:Object,default:()=>({})}},setup(r){function a(B){return B?B.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}const g=r;return(B,J)=>(p.openBlock(),p.createElementBlock("div",jme,[J[1]||(J[1]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),p.createElementVNode("div",Ume,[p.createElementVNode("span",qme,p.toDisplayString(a(g.report.game.matchday_name)),1),p.createElementVNode("span",Wme," - "+p.toDisplayString(p.unref(jd)(g.report.game.date_time_utc)),1)]),p.createElementVNode("div",Gme,[p.createElementVNode("div",Hme,[p.createElementVNode("span",Xme,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+g.report.game.home_team+".png"},null,8,Yme)])]),J[0]||(J[0]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",Jme,[p.createElementVNode("span",Kme,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+g.report.game.visiting_team+".png"},null,8,Zme)])])])]))}},[["__scopeId","data-v-23601285"]]),$me={class:"prematch-bg"},e0e={class:"subtitle"},t0e={class:"jornada"},r0e={class:"fecha"},n0e={class:"teams-row"},i0e={class:"team team-local"},a0e={class:"team-header"},o0e={class:"escudo-svg"},s0e=["src"],l0e={class:"score"},c0e={class:"players-list"},u0e={class:"player-name"},d0e={key:0,class:"more-events-indicator"},h0e={class:"team team-visitor"},p0e={class:"team-header"},f0e={class:"score"},m0e={class:"escudo-svg"},g0e=["src"],y0e={class:"players-list"},v0e={class:"player-name"},b0e={key:0},x0e={key:0,class:"more-events-indicator"},_0e=ws({__name:"AnalisisPostMatchType3",props:{report:{type:Object,default:()=>({})}},setup(r){var v,u;function a(t){return t?t.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}const g=r;console.log("Props report: ",g.report),console.log("Game minutes: ",(u=(v=g.report)==null?void 0:v.game)==null?void 0:u.report_minutes);const B=p.computed(()=>{var t,w,y;return(((y=(w=(t=g.report)==null?void 0:t.game)==null?void 0:w.report_minutes)==null?void 0:y.home_goals_minutes)||[]).slice(0,5)}),J=p.computed(()=>{var t,w,y;return(((y=(w=(t=g.report)==null?void 0:t.game)==null?void 0:w.report_minutes)==null?void 0:y.visiting_goals_minutes)||[]).slice(0,5)});function C(t){const w=Array.from(t.matchAll(/\d+\s*\+*\s*\d*'/g)).map(h=>h[0]).join(", "),y=t.match(/^(.*?)\s*\d+'/),b=y?" "+y[1].trim():"";return{minutos:w,nombre:b}}const x=p.computed(()=>{var w,y,b,h;return(((h=(b=(y=(w=g.report)==null?void 0:w.game)==null?void 0:y.report_minutes)==null?void 0:b.home_goals_minutes)==null?void 0:h.length)||0)>5}),e=p.computed(()=>{var w,y,b,h;return(((h=(b=(y=(w=g.report)==null?void 0:w.game)==null?void 0:y.report_minutes)==null?void 0:b.visiting_goals_minutes)==null?void 0:h.length)||0)>5});return(t,w)=>(p.openBlock(),p.createElementBlock("div",$me,[w[5]||(w[5]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),p.createElementVNode("div",e0e,[p.createElementVNode("span",t0e,"Jornada "+p.toDisplayString(a(r.report.game.matchday_name)),1),p.createElementVNode("span",r0e," - "+p.toDisplayString(p.unref(jd)(r.report.game.date_time_utc)),1)]),p.createElementVNode("div",n0e,[p.createElementVNode("div",i0e,[p.createElementVNode("div",a0e,[p.createElementVNode("span",o0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.home_team+".png"},null,8,s0e)]),p.createElementVNode("div",l0e,p.toDisplayString(r.report.game.score[0]),1)]),p.createElementVNode("div",c0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(B.value,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`home-event-${b}`,class:"player-item"},[p.createElementVNode("span",u0e,p.toDisplayString(y)+" ",1),w[0]||(w[0]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"})])],-1))]))),128)),x.value?(p.openBlock(),p.createElementBlock("div",d0e,[...w[1]||(w[1]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])]),w[4]||(w[4]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",h0e,[p.createElementVNode("div",p0e,[p.createElementVNode("div",f0e,p.toDisplayString(r.report.game.score[1]),1),p.createElementVNode("span",m0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.visiting_team+".png"},null,8,g0e)])]),p.createElementVNode("div",y0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(J.value,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`visiting-event-${b}`,class:"player-item"},[w[2]||(w[2]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),p.createElementVNode("span",v0e,[p.createTextVNode(p.toDisplayString(C(y).minutos)+" ",1),C(y).nombre?(p.openBlock(),p.createElementBlock("span",b0e,p.toDisplayString(C(y).nombre),1)):p.createCommentVNode("",!0)])]))),128)),e.value?(p.openBlock(),p.createElementBlock("div",x0e,[...w[3]||(w[3]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-78a5f6b6"]]),w0e={class:"prematch-bg"},T0e={class:"subtitle"},k0e={class:"jornada"},S0e={class:"fecha"},E0e={class:"teams-row"},A0e={class:"team team-local"},C0e={class:"escudo-svg"},M0e=["src"],P0e={class:"team team-visitor"},N0e={class:"escudo-svg"},O0e=["src"],I0e=ws({__name:"AnalisisPrematchType4",props:{report:{type:Object,default:()=>({})}},setup(r){function a(B){return B?B.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}const g=r;return(B,J)=>(p.openBlock(),p.createElementBlock("div",w0e,[J[1]||(J[1]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),p.createElementVNode("div",T0e,[p.createElementVNode("span",k0e,p.toDisplayString(a(g.report.game.matchday_name)),1),p.createElementVNode("span",S0e," - "+p.toDisplayString(p.unref(jd)(g.report.game.date_time_utc)),1)]),p.createElementVNode("div",E0e,[p.createElementVNode("div",A0e,[p.createElementVNode("span",C0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+g.report.game.home_team+".png"},null,8,M0e)])]),J[0]||(J[0]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",P0e,[p.createElementVNode("span",N0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+g.report.game.visiting_team+".png"},null,8,O0e)])])])]))}},[["__scopeId","data-v-347d4c02"]]),R0e={class:"prematch-bg"},L0e={class:"subtitle"},z0e={class:"jornada"},D0e={class:"fecha"},B0e={class:"teams-row"},V0e={class:"team team-local"},F0e={class:"team-header"},j0e={class:"escudo-svg"},U0e=["src"],q0e={class:"score"},W0e={class:"players-list"},G0e={class:"player-name"},H0e={key:0,class:"more-events-indicator"},X0e={class:"team team-visitor"},Y0e={class:"team-header"},J0e={class:"score"},K0e={class:"escudo-svg"},Z0e=["src"],Q0e={class:"players-list"},$0e={class:"player-name"},ege={key:0},tge={key:0,class:"more-events-indicator"},rge=ws({__name:"AnalisisPostMatchType4",props:{report:{type:Object,default:()=>({})}},setup(r){var v,u;function a(t){return t?t.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}const g=r;console.log("Props report: ",g.report),console.log("Game minutes: ",(u=(v=g.report)==null?void 0:v.game)==null?void 0:u.report_minutes);const B=p.computed(()=>{var t,w,y;return(((y=(w=(t=g.report)==null?void 0:t.game)==null?void 0:w.report_minutes)==null?void 0:y.home_goals_minutes)||[]).slice(0,5)}),J=p.computed(()=>{var t,w,y;return(((y=(w=(t=g.report)==null?void 0:t.game)==null?void 0:w.report_minutes)==null?void 0:y.visiting_goals_minutes)||[]).slice(0,5)});function C(t){const w=Array.from(t.matchAll(/\d+\s*\+*\s*\d*'/g)).map(h=>h[0]).join(", "),y=t.match(/^(.*?)\s*\d+'/),b=y?y[1].trim():"";return{minutos:w,nombre:b}}const x=p.computed(()=>{var w,y,b,h;return(((h=(b=(y=(w=g.report)==null?void 0:w.game)==null?void 0:y.report_minutes)==null?void 0:b.home_goals_minutes)==null?void 0:h.length)||0)>5}),e=p.computed(()=>{var w,y,b,h;return(((h=(b=(y=(w=g.report)==null?void 0:w.game)==null?void 0:y.report_minutes)==null?void 0:b.visiting_goals_minutes)==null?void 0:h.length)||0)>5});return(t,w)=>(p.openBlock(),p.createElementBlock("div",R0e,[w[5]||(w[5]=p.createElementVNode("div",{class:"title"},[p.createTextVNode("Análisis "),p.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),p.createElementVNode("div",L0e,[p.createElementVNode("span",z0e,"Jornada "+p.toDisplayString(a(r.report.game.matchday_name)),1),p.createElementVNode("span",D0e," - "+p.toDisplayString(p.unref(jd)(r.report.game.date_time_utc)),1)]),p.createElementVNode("div",B0e,[p.createElementVNode("div",V0e,[p.createElementVNode("div",F0e,[p.createElementVNode("span",j0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.home_team+".png"},null,8,U0e)]),p.createElementVNode("div",q0e,p.toDisplayString(r.report.game.score[0]),1)]),p.createElementVNode("div",W0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(B.value,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`home-event-${b}`,class:"player-item"},[p.createElementVNode("span",G0e,p.toDisplayString(y)+" ",1),w[0]||(w[0]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"})])],-1))]))),128)),x.value?(p.openBlock(),p.createElementBlock("div",H0e,[...w[1]||(w[1]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])]),w[4]||(w[4]=p.createElementVNode("div",{class:"divider-line"},[p.createElementVNode("div",{class:"dotted-line"})],-1)),p.createElementVNode("div",X0e,[p.createElementVNode("div",Y0e,[p.createElementVNode("div",J0e,p.toDisplayString(r.report.game.score[1]),1),p.createElementVNode("span",K0e,[p.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+r.report.game.visiting_team+".png"},null,8,Z0e)])]),p.createElementVNode("div",Q0e,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(J.value,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`visiting-event-${b}`,class:"player-item"},[w[2]||(w[2]=p.createElementVNode("span",{class:"player-icon"},[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z",stroke:"white","stroke-width":"1.36665","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),p.createElementVNode("span",$0e,[p.createTextVNode(p.toDisplayString(C(y).minutos)+" ",1),C(y).nombre?(p.openBlock(),p.createElementBlock("span",ege," "+p.toDisplayString(C(y).nombre),1)):p.createCommentVNode("",!0)])]))),128)),e.value?(p.openBlock(),p.createElementBlock("div",tge,[...w[3]||(w[3]=[p.createElementVNode("span",{class:"more-events-text"},"...",-1)])])):p.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-4bfbb192"]]),nge={class:"report-card",style:{position:"relative"}},ige={class:"report-img-placeholder",style:{position:"relative"}},age={class:"inner-card-report"},oge={class:"report-footer"},sge={class:"report-title"},lge={class:"report-template"},cge={class:"template-name"},uge={class:"report-league"},dge={class:"report-tournament"},hge=ws({__name:"ReportItem",props:{type:{type:Number,default:1},localTeam:{type:String,default:"América"},report:{type:Object,default:()=>{}},visitorTeam:{type:String,default:"Chivas"},localScore:{type:Number,default:2},visitorScore:{type:Number,default:1},league:{type:String,default:"Liga MX"},date:{type:String,default:"15 Nov 2024"}},emits:["ver-reporte","renombrar","eliminar","edit-template","open-report","download-report"],setup(r,{emit:a}){const g=a,B=r,J=p.ref(!1);function C(){J.value=!1,g("open-report",B.report)}function x(){console.log("renombrar"),J.value=!1,g("renombrar",B.report.report_name||"Reporte",B.report.id)}function e(){console.log("editar"),J.value=!1,g("edit-template",B.report)}function v(){console.log("duplicar"),J.value=!1}function u(){console.log("eliminar"),J.value=!1,g("eliminar",B.report)}function t(){console.log("descargar"),g("download-report",B.report),J.value=!1}function w(b){return b?b.replace("Matchday","J").replace("de Final","").replace("Playoffs 1","CFI").replace("Playoffs 2","CFV").replace("Playoffs 3","SI").replace("Playoffs 4","SV").replace("Playoffs 5","FI").replace("Playoffs 6","FV"):""}function y(){g("open-report",B.report)}return(b,h)=>(p.openBlock(),p.createElementBlock("div",nge,[p.createElementVNode("div",{class:"three-dots",onClick:h[0]||(h[0]=p.withModifiers(n=>J.value=!J.value,["stop"]))},[...h[4]||(h[4]=[p.createElementVNode("span",null,null,-1),p.createElementVNode("span",null,null,-1),p.createElementVNode("span",null,null,-1)])]),p.createElementVNode("div",ige,[r.report.template_type===1&&r.report.pages[0].type==1?(p.openBlock(),p.createBlock(pfe,{key:0,"local-team":r.localTeam,"visitor-team":r.visitorTeam,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==1?(p.openBlock(),p.createBlock(Wfe,{key:1,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):p.createCommentVNode("",!0),r.report.template_type===1&&r.report.pages[0].type==2?(p.openBlock(),p.createBlock(cme,{key:2,"local-team":r.localTeam,"visitor-team":r.visitorTeam,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==2?(p.openBlock(),p.createBlock(Fme,{key:3,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):p.createCommentVNode("",!0),r.report.template_type===1&&r.report.pages[0].type==3?(p.openBlock(),p.createBlock(Qme,{key:4,"local-team":r.localTeam,"visitor-team":r.visitorTeam,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==3?(p.openBlock(),p.createBlock(_0e,{key:5,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.report.template_type===1&&r.report.pages[0].type==4?(p.openBlock(),p.createBlock(I0e,{key:6,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.report.template_type===2&&r.report.pages[0].type==4?(p.openBlock(),p.createBlock(rge,{key:7,"local-team":r.localTeam,"visitor-team":r.visitorTeam,"local-score":r.localScore,"visitor-score":r.visitorScore,league:r.league,date:r.date,report:r.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):p.createCommentVNode("",!0),p.createElementVNode("div",{class:"report-img-overlay"},[p.createElementVNode("button",{class:"report-img-button",onClick:y},"Ver reporte")])]),p.createElementVNode("div",age,[p.createElementVNode("div",oge,[p.createElementVNode("div",sge,p.toDisplayString(r.report.report_name),1),p.createElementVNode("div",lge,[h[5]||(h[5]=p.createTextVNode(" Template: ",-1)),p.createElementVNode("span",cge,p.toDisplayString(r.report.name),1)]),p.createElementVNode("div",uge,p.toDisplayString(r.report.season_name)+" - "+p.toDisplayString(w(r.report.game.matchday_name))+" | "+p.toDisplayString(p.unref(jd)(r.report.game.date_time_utc)),1),p.createElementVNode("div",dge,p.toDisplayString(r.report.tournament_name),1)])]),J.value?(p.openBlock(),p.createBlock(Ype,{key:0,onClick:h[1]||(h[1]=p.withModifiers(n=>J.value=!1,["self"])),onMouseleave:h[2]||(h[2]=n=>J.value=!1),onVerReporte:C,onRenombrar:x,onEditar:e,onDuplicar:v,onEliminar:u,onDescargar:t})):p.createCommentVNode("",!0),J.value?(p.openBlock(),p.createElementBlock("div",{key:1,class:"tooltip-overlay",onClick:h[3]||(h[3]=n=>J.value=!1)})):p.createCommentVNode("",!0)]))}},[["__scopeId","data-v-fb57d46a"]]),pge={class:"modal-overlay"},fge={class:"modal-content"},mge={class:"modal-body"},gge=["placeholder","disabled"],yge={key:0,class:"error-message"},vge={class:"modal-footer"},bge=["disabled"],xge=["disabled"],_ge={key:0},wge={key:1},Tge=ws({__name:"ModalRenameReporte",props:{initialName:{type:String,required:!0},templateType:{type:String,required:!0},token:{type:String,required:!0},userId:{type:[String,Number],required:!0},reportId:{type:[String,Number],required:!0}},emits:["close","rename","refresh"],setup(r,{emit:a}){const g=r,B=a,J=p.ref(g.initialName),C=p.ref(!1),x=p.ref("");p.watch(()=>g.initialName,v=>{J.value=v,x.value=""});async function e(){var v;if(console.log("acceptRename"),!(J.value.trim().length<3)){console.log("acceptRename 22"),C.value=!0,x.value="";try{await to.create({headers:{Authorization:`${g.token}`}}).put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${g.userId}/reports/${g.reportId}/rename`,{name:J.value.trim()}),B("rename",J.value.trim()),B("refresh"),B("close")}catch(u){console.error("Error al renombrar el reporte:",u),((v=u.response)==null?void 0:v.status)===409?x.value="Ya existe un reporte con el mismo nombre":x.value="Error al renombrar el reporte. Inténtalo de nuevo."}finally{C.value=!1}}}return p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""}),(v,u)=>(p.openBlock(),p.createElementBlock("div",pge,[p.createElementVNode("div",fge,[p.createElementVNode("button",{class:"close-btn",onClick:u[0]||(u[0]=t=>v.$emit("close"))},[...u[3]||(u[3]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),u[5]||(u[5]=p.createElementVNode("div",{class:"modal-header"},[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),p.createElementVNode("span",{class:"modal-title"},"Renombrar Reporte")],-1)),u[6]||(u[6]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",mge,[u[4]||(u[4]=p.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),p.withDirectives(p.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":u[1]||(u[1]=t=>J.value=t),placeholder:r.initialName,maxlength:"40",autocomplete:"off",disabled:C.value},null,8,gge),[[p.vModelText,J.value]]),x.value?(p.openBlock(),p.createElementBlock("div",yge,p.toDisplayString(x.value),1)):p.createCommentVNode("",!0)]),u[7]||(u[7]=p.createElementVNode("div",{class:"header-separator"},null,-1)),p.createElementVNode("div",vge,[p.createElementVNode("button",{class:"cancel-btn",onClick:u[2]||(u[2]=t=>v.$emit("close")),disabled:C.value},"Cancelar",8,bge),p.createElementVNode("button",{class:"next-btn",disabled:J.value.trim().length<3||C.value,onClick:e},[C.value?(p.openBlock(),p.createElementBlock("span",_ge,"Guardando...")):(p.openBlock(),p.createElementBlock("span",wge,"Guardar"))],8,xge)])])]))}},[["__scopeId","data-v-3a66dd5f"]]),kge={class:"modal-overlay"},Sge={class:"modal-content"},Ege={class:"modal-footer"},Age=["disabled"],Cge=["disabled"],Mge=ws({__name:"ModalDeleteReport",props:{reportId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","reportDeleted"],setup(r,{emit:a}){const g=r,B=a,J=p.ref(!1),C=async()=>{try{J.value=!0;const e=await to.create({headers:{Authorization:`${g.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${g.userId}/reports/${g.reportId}`);console.log("Reporte eliminado exitosamente:",e.data),B("reportDeleted",g.reportId),B("close")}catch(x){console.error("Error al eliminar el reporte:",x),alert("Error al eliminar el reporte. Por favor, intenta de nuevo.")}finally{J.value=!1}};return p.onMounted(()=>{document.body.style.overflow="hidden"}),p.onUnmounted(()=>{document.body.style.overflow=""}),(x,e)=>(p.openBlock(),p.createElementBlock("div",kge,[p.createElementVNode("div",Sge,[p.createElementVNode("button",{class:"close-btn",onClick:e[0]||(e[0]=v=>x.$emit("close"))},[...e[2]||(e[2]=[p.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1)])]),e[3]||(e[3]=p.createStaticVNode('<div class="modal-header" data-v-8c239161><img src="https://golstatsimages.blob.core.windows.net/reports-images/icn-delete-delete.svg" class="icon-title" alt="icon" data-v-8c239161><span class="modal-title" data-v-8c239161>Eliminar reporte</span></div><div class="header-separator" data-v-8c239161></div><div class="modal-body confirm-text" data-v-8c239161> ¿Estás seguro que deseas eliminar<br data-v-8c239161> este reporte? Si lo haces no habrá manera<br data-v-8c239161> de recuperarlo. </div><div class="header-separator" data-v-8c239161></div>',4)),p.createElementVNode("div",Ege,[p.createElementVNode("button",{class:"cancel-btn",onClick:e[1]||(e[1]=v=>x.$emit("close")),disabled:J.value},"Cancelar",8,Age),p.createElementVNode("button",{class:"delete-btn",onClick:C,disabled:J.value},p.toDisplayString(J.value?"Eliminando...":"Eliminar"),9,Cge)])])]))}},[["__scopeId","data-v-8c239161"]]),Pge={class:"reports-header"},Nge={class:"count"},Oge={key:0,class:"sort-options"},Ige=["onClick"],Rge={key:0,class:"checkmark"},Lge={key:0,class:"loading-state"},zge={key:1,class:"error-state"},Dge={key:3,class:"empty-reports"},Bge={key:4,class:"empty-reports"},Vge=ws({__name:"ReportsSection",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0},searchQuery:{type:String,default:""}},emits:["open-report"],setup(r,{emit:a}){const g=r,B=a,J=p.ref([]),C=p.ref(!1),x=p.ref(null),e=p.computed(()=>{let V=J.value;if(g.searchQuery.trim()){const U=g.searchQuery.toLowerCase().trim();V=J.value.filter(q=>{var re,ee,K,te,ae,oe,he;return!!((((re=q.report_name)==null?void 0:re.toLowerCase())||"").includes(U)||(((ee=q.name)==null?void 0:ee.toLowerCase())||"").includes(U)||q.created_at&&new Date(q.created_at).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(U)||(K=q.game)!=null&&K.date_time_utc&&new Date(q.game.date_time_utc).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(U)||(((ae=(te=q.game)==null?void 0:te.season_name)==null?void 0:ae.toLowerCase())||"").includes(U)||(((oe=q.tournament_name)==null?void 0:oe.toLowerCase())||"").includes(U)||(he=q.game)!=null&&he.matchday&&q.game.matchday.toString().includes(U))})}return u.value&&(V=[...V].sort((U,q)=>{var W,Z;if(u.value==="A - Z"){const ne=(U.report_name||"").toLowerCase(),X=(q.report_name||"").toLowerCase();return ne.localeCompare(X,"es",{sensitivity:"base"})}else if(u.value==="Más recientes"){const ne=new Date(U.created_at||0);return new Date(q.created_at||0)-ne}else if(u.value==="Torneo"){const ne=(U.tournament_name||"").toLowerCase(),X=(q.tournament_name||"").toLowerCase();if(ne!==X)return ne.localeCompare(X,"es",{sensitivity:"base"});const re=U.season_id||0;return(q.season_id||0)-re}else if(u.value==="Jornada"){const ne=((W=U.game)==null?void 0:W.matchday_id)||0,X=((Z=q.game)==null?void 0:Z.matchday_id)||0;return ne-X}return 0})),V}),v=p.ref(!1),u=p.ref("Más recientes"),t=p.ref(!1),w=p.ref(""),y=p.ref(""),b=p.ref(""),h=p.ref(!1),n=p.ref(""),i=p.ref(""),d=p.ref(null),s=p.ref(null),c=p.ref(null),f=p.ref(0),m=[{label:"A - Z",value:"A - Z"},{label:"Más recientes",value:"Más recientes"},{label:"Torneo",value:"Torneo"},{label:"Jornada",value:"Jornada"}],T=async()=>{C.value=!0,x.value=null;try{const V=await to.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${g.userId}/reports`,{headers:{Authorization:`${g.token}`,"Content-Type":"application/json"}});V.data&&Array.isArray(V.data)?J.value=V.data:V.data&&V.data.reports?J.value=V.data.reports:V.data&&V.data.data?J.value=V.data.data:J.value=[]}catch(V){console.error("Error cargando reportes:",V),console.error("Error response:",V.response),x.value=V.message||"Error al cargar los reportes",J.value=[]}finally{C.value=!1}},E=p.computed(()=>{if(!f.value)return"grid-1-column";const V=340,U=20,W=f.value-40,Z=Math.floor((W+U)/(V+U)),ne=Math.max(1,Z);return ne>=4?"grid-4-columns":ne>=3?"grid-3-columns":ne>=2?"grid-2-columns":"grid-1-column"}),S=()=>{v.value=!v.value},P=V=>{console.log("Ordenando por:",V),u.value=V,v.value=!1};function N(V){console.log("reports section onOpenReport",V),B("open-report",V)}const A=(V,U)=>{w.value=V,y.value=U;const q=J.value.find(W=>W.id===U);b.value=q?q.template_type:"",t.value=!0},O=V=>{console.log("Renombrar reporte de",w.value,"a",V),t.value=!1;const U=J.value.findIndex(q=>q.id===y.value);U!==-1&&(J.value[U].report_name=V)},M=V=>{n.value=V.report_name||"Reporte",i.value=V.id,h.value=!0},k=V=>{h.value=!1,J.value=J.value.filter(U=>U.id!==V)};function I(V){console.log("Descargando reporte:",V),B("download-report",V)}const _=V=>{v.value&&d.value&&!d.value.contains(V.target)&&(v.value=!1)},R=()=>{s.value&&(f.value=s.value.offsetWidth)};let z=null;return p.onMounted(async()=>{document.addEventListener("mousedown",_),await T(),await p.nextTick(),R(),window.ResizeObserver?(z=new ResizeObserver(()=>{R()}),s.value&&z.observe(s.value)):window.addEventListener("resize",R)}),p.onBeforeUnmount(()=>{document.removeEventListener("mousedown",_),z?z.disconnect():window.removeEventListener("resize",R)}),(V,U)=>(p.openBlock(),p.createElementBlock("div",{class:"reports-section",ref_key:"reportsSectionRef",ref:s},[p.createElementVNode("div",Pge,[p.createElementVNode("span",null,[U[2]||(U[2]=p.createTextVNode("Reportes ",-1)),p.createElementVNode("span",Nge,"("+p.toDisplayString(e.value.length)+")",1)]),p.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:d},[p.createElementVNode("button",{class:"sort-button",onClick:S},[p.createTextVNode(p.toDisplayString(u.value||"Ordenar")+" ",1),p.createElementVNode("span",{class:p.normalizeClass(["dropdown-arrow",{rotated:v.value}])},null,2)]),v.value?(p.openBlock(),p.createElementBlock("div",Oge,[(p.openBlock(),p.createElementBlock(p.Fragment,null,p.renderList(m,q=>p.createElementVNode("div",{key:q.value,class:p.normalizeClass(["sort-option",{selected:u.value===q.value}]),onClick:W=>u.value!==q.value&&P(q.value)},[p.createElementVNode("span",null,p.toDisplayString(q.label),1),u.value===q.value?(p.openBlock(),p.createElementBlock("span",Rge,[...U[3]||(U[3]=[p.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)],10,Ige)),64))])):p.createCommentVNode("",!0)],512)]),C.value?(p.openBlock(),p.createElementBlock("div",Lge,[...U[4]||(U[4]=[p.createElementVNode("div",{class:"loading-spinner"},null,-1),p.createElementVNode("p",null,"Cargando reportes...",-1)])])):x.value?(p.openBlock(),p.createElementBlock("div",zge,[p.createElementVNode("p",null,"Error al cargar reportes: "+p.toDisplayString(x.value),1),p.createElementVNode("button",{onClick:T,class:"retry-button"},"Reintentar")])):(p.openBlock(),p.createElementBlock("div",{key:2,class:p.normalizeClass(["reports-grid",E.value]),ref_key:"reportsGridRef",ref:c},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.value,q=>(p.openBlock(),p.createBlock(hge,{key:q.id,report:q,onOpenReport:N,onRenombrar:A,onEliminar:M,onDownloadReport:I},null,8,["report"]))),128))],2)),!C.value&&!x.value&&J.value.length===0?(p.openBlock(),p.createElementBlock("div",Dge," No tienes reportes aún. ")):p.createCommentVNode("",!0),!C.value&&!x.value&&J.value.length>0&&e.value.length===0?(p.openBlock(),p.createElementBlock("div",Bge," No se encontraron reportes que coincidan con tu búsqueda. ")):p.createCommentVNode("",!0),t.value?(p.openBlock(),p.createBlock(Tge,{key:5,initialName:w.value,templateType:b.value,token:r.token,userId:r.userId,reportId:y.value,onClose:U[0]||(U[0]=q=>t.value=!1),onRename:O,onRefresh:T},null,8,["initialName","templateType","token","userId","reportId"])):p.createCommentVNode("",!0),h.value?(p.openBlock(),p.createBlock(Mge,{key:6,"report-id":i.value,"user-id":r.userId,token:r.token,onClose:U[1]||(U[1]=q=>h.value=!1),onReportDeleted:k},null,8,["report-id","user-id","token"])):p.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-70130c65"]]),Fge={class:"modal-overlay"},jge={class:"modal-content"},Uge=ws({__name:"ModalSoloEscritorio",setup(r){return(a,g)=>(p.openBlock(),p.createElementBlock("div",Fge,[p.createElementVNode("div",jge,[g[1]||(g[1]=p.createStaticVNode('<div class="modal-icon" data-v-76d7f6ed><svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-76d7f6ed><rect x="8" y="10" width="32" height="20" rx="2" stroke="#C0CBE0" stroke-width="2" data-v-76d7f6ed></rect><rect x="16" y="34" width="16" height="2" rx="1" fill="#C0CBE0" data-v-76d7f6ed></rect></svg></div><div class="modal-text" data-v-76d7f6ed> Esta sección solo está disponible para<br data-v-76d7f6ed> escritorio. Utiliza tu computadora <br data-v-76d7f6ed>para ingresar. </div>',2)),p.createElementVNode("button",{class:"modal-btn",onClick:g[0]||(g[0]=B=>a.$emit("toHome"))},"OK")])]))}},[["__scopeId","data-v-76d7f6ed"]]),qge={class:"top-bar"},Wge={class:"tabs-container"},Gge={class:"tabs"},Hge={key:0,class:"actions"},Xge={class:"search-container"},Yge={key:1,class:"actions"},Jge={class:"search-container"},Kge=ws({__name:"gsc-reports",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0}},emits:["toHome","download-report"],setup(r,{emit:a}){const g=r,{userId:B,team:J,token:C}=g,x=p.ref("templates"),e=p.ref(!1),v=p.ref(null),u=p.ref(!1),t=p.ref(""),w=p.ref(""),y=p.ref(null),b=p.ref(null),h=p.ref(0),n=a;function i(){if(v.value){const P=v.value.offsetWidth;e.value=P<1028}}p.watch(e,P=>{P?document.body.style.overflow="hidden":document.body.style.overflow=""}),p.onBeforeUnmount(()=>{document.body.style.overflow=""}),p.onMounted(()=>{i(),window.addEventListener("resize",i)}),p.onBeforeUnmount(()=>{window.removeEventListener("resize",i)});function d(P){console.log("onOpenModalNewTemplate, gsc-reports:",P),s(P)}function s(P){console.log("onEditTemplate, template:",P),console.log("Edicion es: "),console.log({template:P,isTemplateMode:!0}),y.value.show({template:P,isTemplateMode:!0})}const c=()=>{t.value=""},f=()=>{w.value=""};function m(P){console.log("gsc-report onOpenReport, report:",P),y.value&&y.value.show({template:P,isTemplateMode:!1})}function T(P){n("download-report",P)}function E(){n("toHome")}function S(){b.value&&b.value.obtenerTemplates(),h.value+=1}return(P,N)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(p.unref(Nue),{ref_key:"reportTemplateMaker",ref:y,token:p.unref(C),"user-team-id":p.unref(J),onClose:S},null,8,["token","user-team-id"]),p.createElementVNode("div",{ref_key:"containerRef",ref:v,class:"reports-container"},[e.value?(p.openBlock(),p.createBlock(Uge,{key:0,onToHome:E})):p.createCommentVNode("",!0),N[12]||(N[12]=p.createElementVNode("h1",{class:"title"},"Mis reportes",-1)),p.createElementVNode("div",qge,[p.createElementVNode("div",Wge,[p.createElementVNode("div",Gge,[p.createElementVNode("div",{class:p.normalizeClass(["tab tab-templates",{active:x.value==="templates"}]),onClick:N[0]||(N[0]=A=>x.value="templates")}," Templates ",2),p.createElementVNode("div",{class:p.normalizeClass(["tab tab-reports",{active:x.value==="reports"}]),onClick:N[1]||(N[1]=A=>x.value="reports")}," Tus reportes ",2)])]),x.value==="templates"?(p.openBlock(),p.createElementBlock("div",Hge,[p.createElementVNode("div",Xge,[N[8]||(N[8]=p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":N[2]||(N[2]=A=>t.value=A),class:"search",type:"text",placeholder:"Buscar template"},null,512),[[p.vModelText,t.value]]),t.value?(p.openBlock(),p.createElementBlock("button",{key:0,onClick:c,class:"clear-search-btn",type:"button"},[...N[7]||(N[7]=[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)]),p.createElementVNode("button",{class:"create-template-btn",onClick:N[3]||(N[3]=A=>u.value=!0)},[...N[9]||(N[9]=[p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-agregar@3x.png",alt:"Agregar",class:"create-icon"},null,-1),p.createTextVNode(" Crear template ",-1)])])])):p.createCommentVNode("",!0),x.value==="reports"?(p.openBlock(),p.createElementBlock("div",Yge,[p.createElementVNode("div",Jge,[N[11]||(N[11]=p.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":N[4]||(N[4]=A=>w.value=A),class:"search search-reports",type:"text",placeholder:"Buscar reporte"},null,512),[[p.vModelText,w.value]]),w.value?(p.openBlock(),p.createElementBlock("button",{key:0,onClick:f,class:"clear-search-btn",type:"button"},[...N[10]||(N[10]=[p.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):p.createCommentVNode("",!0)])])):p.createCommentVNode("",!0)]),x.value==="templates"?(p.openBlock(),p.createBlock(Hpe,{ref_key:"templatesSectionRef",ref:b,userId:p.unref(B),token:p.unref(C),team:p.unref(J),searchQuery:t.value,key:h.value,onSwitchToReports:N[5]||(N[5]=A=>x.value="reports"),onOpenModalNewTemplate:d,onEditTemplate:s},null,8,["userId","token","team","searchQuery"])):(p.openBlock(),p.createBlock(Vge,{key:2,userId:p.unref(B),token:p.unref(C),team:p.unref(J),searchQuery:w.value,onOpenReport:m,onDownloadReport:T},null,8,["userId","token","team","searchQuery"])),u.value?(p.openBlock(),p.createBlock(bT,{key:3,token:p.unref(C),team:p.unref(J),onOpenModalNewTemplate:d,onClose:N[6]||(N[6]=A=>u.value=!1)},null,8,["token","team"])):p.createCommentVNode("",!0)],512)],64))}},[["__scopeId","data-v-717aa34b"]]),Zge={class:"subcategory-group"},Qge={__name:"SubcategoryGroup",props:{subcategoryGroup:{type:Array,default:()=>[]}},setup(r){return(a,g)=>(p.openBlock(),p.createElementBlock("div",Zge,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.subcategoryGroup,B=>(p.openBlock(),p.createBlock(p.unref(K1),{key:B.id,modelValue:B.isSelected,"onUpdate:modelValue":J=>B.isSelected=J,label:B.name},null,8,["modelValue","onUpdate:modelValue","label"]))),128))]))}},$ge=nu(Qge,[["__scopeId","data-v-ae6f3d72"]]),eye={class:"filter-subcategories"},tye=Object.freeze(Object.defineProperty({__proto__:null,default:nu({__name:"FilterSubcategories",props:{subcategoryGroups:{type:Array,default:()=>[]}},setup(r){return(a,g)=>(p.openBlock(),p.createElementBlock("div",eye,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.subcategoryGroups,B=>(p.openBlock(),p.createElementBlock("div",{key:B.id,class:"filter-subcategories__group"},[p.createVNode($ge,{subcategoryGroup:B},null,8,["subcategoryGroup"])]))),128))]))}},[["__scopeId","data-v-5edaefc2"]])},Symbol.toStringTag,{value:"Module"})),yy=r=>(p.pushScopeId("data-v-80d9c265"),r=r(),p.popScopeId(),r),rye={class:"details__header"},nye=yy(()=>p.createElementVNode("div",{class:"details__header__title"},"Jugando como",-1)),iye={class:"details__header__checkbox"},aye={class:"details__body"},oye={class:"details__body__playing-as"},sye=["onClick"],lye={class:"details__header"},cye=yy(()=>p.createElementVNode("div",{class:"details__header__title"},"En: (Elige el lapso de tiempo)",-1)),uye={class:"details__header__checkbox"},dye={class:"details__body"},hye=yy(()=>p.createElementVNode("div",{class:"details__body__title"},"1er tiempo",-1)),pye={class:"details__body__game-section"},fye=["onClick"],mye={class:"details__body"},gye=yy(()=>p.createElementVNode("div",{class:"details__body__title"},"2do tiempo",-1)),yye={class:"details__body__game-section"},vye=["onClick"],bye=Object.freeze(Object.defineProperty({__proto__:null,default:nu({__name:"FilterConditions",props:{playingAs:{type:Array,default:()=>[{name:"Local",isSelected:!0},{name:"Visitante",isSelected:!0}]},gameSections:{type:Array,default:()=>[{text:"0-15",value:1,isSelected:!0},{text:"16-30",value:2,isSelected:!0},{text:"31-45",value:3,isSelected:!0},{text:"46-60",value:4,isSelected:!0},{text:"61-75",value:5,isSelected:!0},{text:"76-90",value:6,isSelected:!0}]},buttonsBackgroundColor:{type:String,default:"rgba(255, 255, 255, 0)"},buttonsBackgroundColorActive:{type:String,default:"rgba(203, 238, 107, 0.05)"},buttonsTextColor:{type:String,default:"rgba(255, 255, 255, 0.8)"},buttonsTextColorActive:{type:String,default:"rgba(255, 255, 255, 1)"},buttonsBorderColor:{type:String,default:"#8ea2ab"},buttonsBorderColorActive:{type:String,default:"#cbee6b"},buttonsBorderWidth:{type:String,default:"0.8px"},buttonsBorderWidthActive:{type:String,default:"1px"},buttonsBorderRadius:{type:String,default:"4px"}},setup(r){const a=r;p.useCssVars(t=>({"49cba245":r.buttonsBackgroundColor,"52f02da6":r.buttonsTextColor,"7d3f686a":r.buttonsBorderWidth,"7c286a07":r.buttonsBorderColor,"24a6f4aa":r.buttonsBackgroundColorActive,cd8d7768:r.buttonsTextColorActive,"35fa5c10":r.buttonsBorderWidthActive,"0cde1826":r.buttonsBorderColorActive}));const g=p.computed(()=>a.playingAs.every(t=>t.isSelected)),B=p.computed(()=>a.gameSections.every(t=>t.isSelected)),J=p.computed(()=>a.gameSections.reduce((t,w)=>(w.value<=3?t.firstHalf.push(w):t.secondHalf.push(w),t),{firstHalf:[],secondHalf:[]})),C=p.computed(()=>({"--border-radius-first-button":`${a.buttonsBorderRadius} 0 0 ${a.buttonsBorderRadius}`,"--border-radius-last-button":`0 ${a.buttonsBorderRadius} ${a.buttonsBorderRadius} 0`}));function x(t){t?a.playingAs.forEach(w=>{w.isSelected=!0}):a.playingAs.forEach((w,y)=>{w.isSelected=y===0})}function e(t){a.playingAs.filter(w=>w.isSelected).length===1&&t.isSelected||(t.isSelected=!t.isSelected)}function v(t){a.gameSections.filter(w=>w.isSelected).length===1&&t.isSelected||(t.isSelected=!t.isSelected)}function u(t){t?a.gameSections.forEach(w=>{w.isSelected=!0}):a.gameSections.forEach((w,y)=>{w.isSelected=y===0})}return(t,w)=>(p.openBlock(),p.createElementBlock("div",{class:"details",style:p.normalizeStyle(C.value)},[p.createElementVNode("div",rye,[nye,p.createElementVNode("div",iye,[p.createVNode(p.unref(K1),{label:"Todos","model-value":g.value,"onUpdate:modelValue":x},null,8,["model-value"])])]),p.createElementVNode("div",aye,[p.createElementVNode("div",oye,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(a.playingAs,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`pa${b}`,class:p.normalizeClass(["details__body__button",{active:y.isSelected}]),onClick:h=>e(y)},p.toDisplayString(y.name),11,sye))),128))])]),p.createElementVNode("div",lye,[cye,p.createElementVNode("div",uye,[p.createVNode(p.unref(K1),{label:"Todos","model-value":B.value,"onUpdate:modelValue":u},null,8,["model-value"])])]),p.createElementVNode("div",dye,[hye,p.createElementVNode("div",pye,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(J.value.firstHalf,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`pa${b}`,class:p.normalizeClass(["details__body__button",{active:y.isSelected}]),onClick:h=>v(y)},p.toDisplayString(y.text),11,fye))),128))])]),p.createElementVNode("div",mye,[gye,p.createElementVNode("div",yye,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(J.value.secondHalf,(y,b)=>(p.openBlock(),p.createElementBlock("div",{key:`pa${b}`,class:p.normalizeClass(["details__body__button",{active:y.isSelected}]),onClick:h=>v(y)},p.toDisplayString(y.text),11,vye))),128))])])],4))}},[["__scopeId","data-v-80d9c265"]])},Symbol.toStringTag,{value:"Module"})),xye={class:"filter-field"},_ye=Object.freeze(Object.defineProperty({__proto__:null,default:nu({__name:"FilterField",setup(r){const a=p.ref(Array.from({length:16},(B,J)=>J+1));function g(){}return(B,J)=>(p.openBlock(),p.createElementBlock("div",xye,[p.createVNode(p.unref(FI),{width:"100%","background-color":"#2E3B46",value:a.value,"onUpdate:modelValue":g},null,8,["value"])]))}},[["__scopeId","data-v-8103c3e1"]])},Symbol.toStringTag,{value:"Module"}));Ah.GSCReports=Kge,Object.defineProperty(Ah,Symbol.toStringTag,{value:"Module"})}));
|